-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
60 lines (58 loc) · 1.7 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
'use strict';
/**
* quote Input Plugin
*
*
* Simple input plugin for quote type
*/
const validation = require('./lib/validation.js');
/**
* Single quote Input Plugin
* @module quoteInputPlugin
*/
module.exports = {
name: 'quote',
description: 'Simple input plugin for quote type',
validation: {
quoteValidation: validation,
},
inputs: {
quote: {
validation: {
function: 'quoteValidation',
on: 'blur',
},
label: 'Quote:',
type: 'text',
placeholder: 'Quotation Text',
settings: {
empty: false,
},
},
author: {
validation: {
function: 'quoteValidation',
on: 'blur',
},
label: 'Author:',
type: 'text',
placeholder: 'Author Name',
settings: {
empty: false,
},
},
source: {
validation: {
function: 'quoteValidation',
on: 'blur',
},
label: 'Citation:',
type: 'text',
placeholder: 'Source Material',
settings: {
empty: false,
},
},
},
html: '<div class="form--field"><label for="{{quote.id}}">{{quote.label}}</label><input type="{{quote.type}}" id="{{quote.id}}" name="{{quote.name}}" value="{{quote.value}}" placeholder="{{quote.placeholder}}" /></div><div class="form--field"><label for="{{author.id}}">{{author.label}}</label><input type="{{author.type}}" id="{{author.id}}" name="{{author.name}}" value="{{author.value}}" placeholder="{{author.placeholder}}" /></div><div class="form--field"><label for="{{source.id}}">{{source.label}}</label><input type="{{source.type}}" id="{{source.id}}" name="{{source.name}}" value="{{source.value}}" placeholder="{{source.placeholder}}" /></div>',
};