@wirenboard/json-editor 2.5.3-wb13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env-dist +2 -0
- package/.eslintrc +7 -0
- package/.gitattributes +1 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +9 -0
- package/.github/issue_template +25 -0
- package/.github/workflows/build.yml +58 -0
- package/.travis.yml +70 -0
- package/CHANGELOG.md +915 -0
- package/CONTRIBUTING.md +92 -0
- package/LICENSE +20 -0
- package/Makefile +26 -0
- package/README.md +1646 -0
- package/README_ADDON.md +573 -0
- package/UPGRADING.md +46 -0
- package/build/CssToJson.js +55 -0
- package/codecept.conf.js +35 -0
- package/config/.eslintrc +7 -0
- package/config/codeceptjs_helpers.js +139 -0
- package/config/helpers.js +10 -0
- package/config/karma.conf.js +93 -0
- package/config/readme.md +31 -0
- package/config/webpack.common.js +75 -0
- package/config/webpack.dev.js +15 -0
- package/config/webpack.nonmin.js +19 -0
- package/config/webpack.prod.js +25 -0
- package/dist/jsoneditor.js +14 -0
- package/dist/nonmin/jsoneditor.js +29097 -0
- package/dist/nonmin/jsoneditor.js.map +1 -0
- package/docs/ace_editor.html +56 -0
- package/docs/advanced.html +136 -0
- package/docs/basic.html +63 -0
- package/docs/basic_person.json +26 -0
- package/docs/choices.html +86 -0
- package/docs/cleave.html +132 -0
- package/docs/colorpicker.html +194 -0
- package/docs/css_integration.html +135 -0
- package/docs/datetime.html +305 -0
- package/docs/describedby.html +161 -0
- package/docs/enumsource.html +67 -0
- package/docs/images/categoriesDemo.png +0 -0
- package/docs/images/inheritance_tree.png +0 -0
- package/docs/images/jsoneditor.png +0 -0
- package/docs/imask.html +192 -0
- package/docs/index.html +579 -0
- package/docs/materialize_css.html +164 -0
- package/docs/meta_schema.json +705 -0
- package/docs/multiple_upload_base64.html +65 -0
- package/docs/person.json +73 -0
- package/docs/polyfills/assign.js +29 -0
- package/docs/radio.html +156 -0
- package/docs/recursive.html +170 -0
- package/docs/select2.html +99 -0
- package/docs/selectize.html +100 -0
- package/docs/signature.html +42 -0
- package/docs/starrating.html +137 -0
- package/docs/upload.html +131 -0
- package/docs/uuid.html +70 -0
- package/docs/wysiwyg.html +56 -0
- package/jasmine.json +11 -0
- package/json-editor-json-editor-2.5.3-wb13.tgz +0 -0
- package/package.json +100 -0
- package/release-notes.md +88 -0
- package/src/core.js +412 -0
- package/src/defaults.js +402 -0
- package/src/editor.js +707 -0
- package/src/editors/ace.js +89 -0
- package/src/editors/array/choices.js +103 -0
- package/src/editors/array/select2.js +110 -0
- package/src/editors/array/selectize.js +103 -0
- package/src/editors/array.css +9 -0
- package/src/editors/array.css.js +3 -0
- package/src/editors/array.js +818 -0
- package/src/editors/autocomplete.js +58 -0
- package/src/editors/base64.js +157 -0
- package/src/editors/button.js +97 -0
- package/src/editors/checkbox.js +95 -0
- package/src/editors/choices.css +3 -0
- package/src/editors/choices.css.js +3 -0
- package/src/editors/choices.js +69 -0
- package/src/editors/colorpicker.js +103 -0
- package/src/editors/datetime.js +141 -0
- package/src/editors/describedby.js +188 -0
- package/src/editors/enum.js +136 -0
- package/src/editors/hidden.js +127 -0
- package/src/editors/index.js +81 -0
- package/src/editors/info.js +20 -0
- package/src/editors/integer.js +19 -0
- package/src/editors/ip.js +36 -0
- package/src/editors/jodit.js +64 -0
- package/src/editors/multiple.js +409 -0
- package/src/editors/multiselect.js +218 -0
- package/src/editors/null.js +18 -0
- package/src/editors/number.js +51 -0
- package/src/editors/object.css +41 -0
- package/src/editors/object.css.js +3 -0
- package/src/editors/object.js +1290 -0
- package/src/editors/radio.js +111 -0
- package/src/editors/sceditor.js +72 -0
- package/src/editors/select.js +370 -0
- package/src/editors/select2.js +110 -0
- package/src/editors/selectize.js +112 -0
- package/src/editors/signature.js +113 -0
- package/src/editors/simplemde.js +100 -0
- package/src/editors/starrating.css +52 -0
- package/src/editors/starrating.css.js +3 -0
- package/src/editors/starrating.js +135 -0
- package/src/editors/stepper.js +27 -0
- package/src/editors/string.js +372 -0
- package/src/editors/table.js +516 -0
- package/src/editors/upload.js +321 -0
- package/src/editors/uuid.js +56 -0
- package/src/iconlib.js +24 -0
- package/src/iconlibs/bootstrap2.js +28 -0
- package/src/iconlibs/bootstrap3.js +28 -0
- package/src/iconlibs/fontawesome3.js +28 -0
- package/src/iconlibs/fontawesome4.js +28 -0
- package/src/iconlibs/fontawesome5.js +28 -0
- package/src/iconlibs/foundation2.js +24 -0
- package/src/iconlibs/foundation3.js +28 -0
- package/src/iconlibs/index.js +25 -0
- package/src/iconlibs/jqueryui.js +28 -0
- package/src/iconlibs/materialicons.js +49 -0
- package/src/iconlibs/openiconic.js +28 -0
- package/src/iconlibs/spectre.js +28 -0
- package/src/resolvers.js +128 -0
- package/src/schemaloader.js +408 -0
- package/src/style.css +150 -0
- package/src/style.css.js +3 -0
- package/src/templates/default.js +52 -0
- package/src/templates/ejs.js +13 -0
- package/src/templates/handlebars.js +1 -0
- package/src/templates/hogan.js +10 -0
- package/src/templates/index.js +21 -0
- package/src/templates/lodash.js +9 -0
- package/src/templates/markup.js +9 -0
- package/src/templates/mustache.js +9 -0
- package/src/templates/swig.js +1 -0
- package/src/templates/underscore.js +9 -0
- package/src/theme.js +659 -0
- package/src/themes/barebones.css +35 -0
- package/src/themes/barebones.css.js +3 -0
- package/src/themes/barebones.js +28 -0
- package/src/themes/bootstrap2.js +319 -0
- package/src/themes/bootstrap3.css +0 -0
- package/src/themes/bootstrap3.css.js +3 -0
- package/src/themes/bootstrap3.js +315 -0
- package/src/themes/bootstrap4.css +89 -0
- package/src/themes/bootstrap4.css.js +3 -0
- package/src/themes/bootstrap4.js +690 -0
- package/src/themes/bootstrap5.css.js +3 -0
- package/src/themes/foundation.js +569 -0
- package/src/themes/html.css +60 -0
- package/src/themes/html.css.js +3 -0
- package/src/themes/html.js +71 -0
- package/src/themes/index.js +28 -0
- package/src/themes/jqueryui.js +198 -0
- package/src/themes/materialize.js +426 -0
- package/src/themes/spectre.css +208 -0
- package/src/themes/spectre.css.js +3 -0
- package/src/themes/spectre.js +406 -0
- package/src/themes/tailwind.css +249 -0
- package/src/themes/tailwind.css.js +3 -0
- package/src/themes/tailwind.js +443 -0
- package/src/utilities.js +138 -0
- package/src/validator.js +877 -0
- package/src/validators/ip-validator.js +51 -0
- package/tests/Dockerfile +3 -0
- package/tests/README.md +48 -0
- package/tests/codeceptjs/codecept.json +42 -0
- package/tests/codeceptjs/constrains/if-then-else_test.js +143 -0
- package/tests/codeceptjs/core_test.js +217 -0
- package/tests/codeceptjs/editors/advanced_test.js +13 -0
- package/tests/codeceptjs/editors/array_any_of_test.js +50 -0
- package/tests/codeceptjs/editors/array_test.js +900 -0
- package/tests/codeceptjs/editors/button_test.js +35 -0
- package/tests/codeceptjs/editors/checkbox_test.js +21 -0
- package/tests/codeceptjs/editors/colorpicker_test.js +27 -0
- package/tests/codeceptjs/editors/datetime_test.js +33 -0
- package/tests/codeceptjs/editors/inheritance_test.js +11 -0
- package/tests/codeceptjs/editors/integer_test.js +84 -0
- package/tests/codeceptjs/editors/issues/issue-gh-812_test.js +32 -0
- package/tests/codeceptjs/editors/jodit_test.js +24 -0
- package/tests/codeceptjs/editors/multiselect_test.js +8 -0
- package/tests/codeceptjs/editors/number_test.js +82 -0
- package/tests/codeceptjs/editors/object_test.js +204 -0
- package/tests/codeceptjs/editors/option-no_default_values_test.js +42 -0
- package/tests/codeceptjs/editors/programmatic-changes_test.js +20 -0
- package/tests/codeceptjs/editors/radio_test.js +10 -0
- package/tests/codeceptjs/editors/rating_test.js +13 -0
- package/tests/codeceptjs/editors/select_test.js +22 -0
- package/tests/codeceptjs/editors/stepper_test.js +27 -0
- package/tests/codeceptjs/editors/string_test.js +118 -0
- package/tests/codeceptjs/editors/table-confirm-delete_test.js +67 -0
- package/tests/codeceptjs/editors/tabs_test.js +14 -0
- package/tests/codeceptjs/editors/uuid_test.js +21 -0
- package/tests/codeceptjs/editors/validation_test.js +14 -0
- package/tests/codeceptjs/meta-schema_test.js +17 -0
- package/tests/codeceptjs/schemaloader_test.js +13 -0
- package/tests/codeceptjs/steps.d.ts +13 -0
- package/tests/codeceptjs/steps_file.js +12 -0
- package/tests/codeceptjs/themes_test.js +519 -0
- package/tests/docker-compose.yml +34 -0
- package/tests/fixtures/basic_person.json +26 -0
- package/tests/fixtures/nested_object.json +26 -0
- package/tests/fixtures/person.json +55 -0
- package/tests/fixtures/recursive.json +8 -0
- package/tests/fixtures/some_types.json +32 -0
- package/tests/fixtures/string.json +3 -0
- package/tests/fixtures/validation.json +1140 -0
- package/tests/pages/_demo.html +475 -0
- package/tests/pages/advanced.html +137 -0
- package/tests/pages/anyof.html +80 -0
- package/tests/pages/array-anyof.html +142 -0
- package/tests/pages/array-checkboxes.html +41 -0
- package/tests/pages/array-choices.html +45 -0
- package/tests/pages/array-integers.html +37 -0
- package/tests/pages/array-move-events.html +61 -0
- package/tests/pages/array-multiselects.html +42 -0
- package/tests/pages/array-nested-arrays.html +40 -0
- package/tests/pages/array-numbers.html +37 -0
- package/tests/pages/array-objects.html +42 -0
- package/tests/pages/array-ratings.html +40 -0
- package/tests/pages/array-selectize.html +51 -0
- package/tests/pages/array-selects.html +36 -0
- package/tests/pages/array-strings.html +36 -0
- package/tests/pages/array.html +42 -0
- package/tests/pages/assets/pages.css +130 -0
- package/tests/pages/button-callbacks.html +77 -0
- package/tests/pages/checkbox-labels.html +114 -0
- package/tests/pages/colorpicker-no-3rd-party.html +43 -0
- package/tests/pages/colorpicker-use-vanilla-picker.html +50 -0
- package/tests/pages/core.html +118 -0
- package/tests/pages/datetime.html +76 -0
- package/tests/pages/form-name.html +108 -0
- package/tests/pages/grid-strict.html +311 -0
- package/tests/pages/grid.html +284 -0
- package/tests/pages/if-then-else-allOf.html +117 -0
- package/tests/pages/inheritance.html +76 -0
- package/tests/pages/integer.html +68 -0
- package/tests/pages/issues/_template.html +50 -0
- package/tests/pages/issues/issue-gh-812.html +110 -0
- package/tests/pages/issues/issue-gh-823-meta-schema.html +35 -0
- package/tests/pages/issues/issue-gh-848.html +81 -0
- package/tests/pages/meta_schema.json +705 -0
- package/tests/pages/number.html +89 -0
- package/tests/pages/object-no-additional-properties.html +65 -0
- package/tests/pages/object-no-duplicated-id.html +68 -0
- package/tests/pages/object-required-properties.html +236 -0
- package/tests/pages/object-with-dependencies-array.html +46 -0
- package/tests/pages/object-with-dependencies.html +60 -0
- package/tests/pages/object.html +79 -0
- package/tests/pages/oneof.html +103 -0
- package/tests/pages/option-no_default_values.html +58 -0
- package/tests/pages/programmatic-changes.html +120 -0
- package/tests/pages/read-only.html +105 -0
- package/tests/pages/select.html +41 -0
- package/tests/pages/stepper.html +59 -0
- package/tests/pages/string-ace-editor.html +52 -0
- package/tests/pages/string-cleave.html +46 -0
- package/tests/pages/string-custom-attributes.html +62 -0
- package/tests/pages/string-formats.html +52 -0
- package/tests/pages/string-formats2.html +57 -0
- package/tests/pages/string-jodit-editor.html +49 -0
- package/tests/pages/string-sceditor.html +62 -0
- package/tests/pages/table-move-events.html +56 -0
- package/tests/pages/table.html +46 -0
- package/tests/pages/tabs.html +131 -0
- package/tests/pages/themes.html +527 -0
- package/tests/pages/translate-property.html +247 -0
- package/tests/pages/urn.html +93 -0
- package/tests/pages/uuid.html +72 -0
- package/tests/pages/validation.html +99 -0
- package/tests/unit/.eslintrc +8 -0
- package/tests/unit/core.spec.js +309 -0
- package/tests/unit/defaults.spec.js +40 -0
- package/tests/unit/editor.spec.js +160 -0
- package/tests/unit/editors/array.spec.js +86 -0
- package/tests/unit/editors/object.spec.js +79 -0
- package/tests/unit/editors/table.spec.js +91 -0
- package/tests/unit/readme.md +35 -0
- package/tests/unit/schemaloader.spec.js +498 -0
- package/tests/unit/validator.spec.js +94 -0
- package/tests/unit/validators/ip-validator.spec.js +62 -0
|
@@ -0,0 +1,569 @@
|
|
|
1
|
+
/* Base Foundation theme */
|
|
2
|
+
import { AbstractTheme } from '../theme.js'
|
|
3
|
+
|
|
4
|
+
export class foundationTheme extends AbstractTheme {
|
|
5
|
+
getChildEditorHolder () {
|
|
6
|
+
const el = document.createElement('div')
|
|
7
|
+
el.style.marginBottom = '15px'
|
|
8
|
+
return el
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
getSelectInput (options, multiple) {
|
|
12
|
+
const el = super.getSelectInput(options)
|
|
13
|
+
el.style.minWidth = 'none'
|
|
14
|
+
el.style.padding = '5px'
|
|
15
|
+
el.style.marginTop = '3px'
|
|
16
|
+
return el
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
getSwitcher (options) {
|
|
20
|
+
const el = super.getSwitcher(options)
|
|
21
|
+
el.style.paddingRight = '8px'
|
|
22
|
+
return el
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
afterInputReady (input) {
|
|
26
|
+
if (input.group) return
|
|
27
|
+
if (this.closest(input, '.compact')) {
|
|
28
|
+
input.style.marginBottom = 0
|
|
29
|
+
}
|
|
30
|
+
input.group = this.closest(input, '.form-control')
|
|
31
|
+
if (this.queuedInputErrorText) {
|
|
32
|
+
const text = this.queuedInputErrorText
|
|
33
|
+
delete this.queuedInputErrorText
|
|
34
|
+
this.addInputError(input, text)
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
getFormInputLabel (text, req) {
|
|
39
|
+
const el = super.getFormInputLabel(text, req)
|
|
40
|
+
el.style.display = 'inline-block'
|
|
41
|
+
return el
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
getFormInputField (type) {
|
|
45
|
+
const el = super.getFormInputField(type)
|
|
46
|
+
el.style.width = '100%'
|
|
47
|
+
el.style.marginBottom = (type === 'checkbox' || type === 'radio') ? '0' : '12px'
|
|
48
|
+
return el
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
getFormInputDescription (text) {
|
|
52
|
+
const el = document.createElement('p')
|
|
53
|
+
if (window.DOMPurify) el.innerHTML = window.DOMPurify.sanitize(text)
|
|
54
|
+
else el.textContent = this.cleanText(text)
|
|
55
|
+
el.style.marginTop = '-10px'
|
|
56
|
+
el.style.fontStyle = 'italic'
|
|
57
|
+
return el
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
getIndentedPanel () {
|
|
61
|
+
const el = document.createElement('div')
|
|
62
|
+
el.classList.add('panel')
|
|
63
|
+
el.style.paddingBottom = 0
|
|
64
|
+
return el
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
getHeaderButtonHolder () {
|
|
68
|
+
const el = this.getButtonHolder()
|
|
69
|
+
el.style.display = 'inline-block'
|
|
70
|
+
el.style.marginLeft = '10px'
|
|
71
|
+
el.style.verticalAlign = 'middle'
|
|
72
|
+
return el
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
getButtonHolder () {
|
|
76
|
+
const el = document.createElement('span')
|
|
77
|
+
el.classList.add('button-group')
|
|
78
|
+
return el
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
getButton (text, icon, title) {
|
|
82
|
+
const el = super.getButton(text, icon, title)
|
|
83
|
+
el.classList.add('small', 'button')
|
|
84
|
+
return el
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
addInputError (input, text) {
|
|
88
|
+
if (!input.group) {
|
|
89
|
+
this.queuedInputErrorText = text
|
|
90
|
+
return
|
|
91
|
+
}
|
|
92
|
+
input.group.classList.add('error')
|
|
93
|
+
|
|
94
|
+
if (!input.errmsg) {
|
|
95
|
+
input.insertAdjacentHTML('afterend', '<small class="error"></small>')
|
|
96
|
+
input.errmsg = input.parentNode.getElementsByClassName('error')[0]
|
|
97
|
+
} else {
|
|
98
|
+
input.errmsg.style.display = ''
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
input.errmsg.textContent = text
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
removeInputError (input) {
|
|
105
|
+
if (!input.group) {
|
|
106
|
+
delete this.queuedInputErrorText
|
|
107
|
+
}
|
|
108
|
+
if (!input.errmsg) return
|
|
109
|
+
input.group.classList.remove('error')
|
|
110
|
+
input.errmsg.style.display = 'none'
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
getProgressBar () {
|
|
114
|
+
const progressBar = document.createElement('div')
|
|
115
|
+
progressBar.classList.add('progress')
|
|
116
|
+
|
|
117
|
+
const meter = document.createElement('span')
|
|
118
|
+
meter.classList.add('meter')
|
|
119
|
+
meter.style.width = '0%'
|
|
120
|
+
progressBar.appendChild(meter)
|
|
121
|
+
return progressBar
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
updateProgressBar (progressBar, progress) {
|
|
125
|
+
if (!progressBar) return
|
|
126
|
+
progressBar.firstChild.style.width = `${progress}%`
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
updateProgressBarUnknown (progressBar) {
|
|
130
|
+
if (!progressBar) return
|
|
131
|
+
progressBar.firstChild.style.width = '100%'
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
getInputGroup (input, buttons) {
|
|
135
|
+
if (!input) return undefined
|
|
136
|
+
|
|
137
|
+
const inputGroupContainer = document.createElement('div')
|
|
138
|
+
inputGroupContainer.classList.add('input-group')
|
|
139
|
+
input.classList.add('input-group-field')
|
|
140
|
+
inputGroupContainer.appendChild(input)
|
|
141
|
+
|
|
142
|
+
for (let i = 0; i < buttons.length; i++) {
|
|
143
|
+
const inputGroup = document.createElement('div')
|
|
144
|
+
inputGroup.classList.add('input-group-button')
|
|
145
|
+
inputGroup.style.verticalAlign = 'top'
|
|
146
|
+
buttons[i].classList.remove('small')
|
|
147
|
+
inputGroup.appendChild(buttons[i])
|
|
148
|
+
inputGroupContainer.appendChild(inputGroup)
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return inputGroupContainer
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/* Foundation 3 Specific Theme */
|
|
156
|
+
export class foundation3Theme extends foundationTheme {
|
|
157
|
+
getHeaderButtonHolder () {
|
|
158
|
+
const el = super.getHeaderButtonHolder()
|
|
159
|
+
el.style.fontSize = '.6em'
|
|
160
|
+
return el
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
getFormInputLabel (text, req) {
|
|
164
|
+
const el = super.getFormInputLabel(text, req)
|
|
165
|
+
el.style.fontWeight = 'bold'
|
|
166
|
+
return el
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
getTabHolder (propertyName) {
|
|
170
|
+
const pName = (typeof propertyName === 'undefined') ? '' : propertyName
|
|
171
|
+
const el = document.createElement('div')
|
|
172
|
+
el.classList.add('row')
|
|
173
|
+
el.innerHTML = `<dl class="tabs vertical two columns" id="${pName}"></dl><div class="tabs-content ten columns" id="${pName}"></div>`
|
|
174
|
+
return el
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
getTopTabHolder (propertyName) {
|
|
178
|
+
const pName = (typeof propertyName === 'undefined') ? '' : propertyName
|
|
179
|
+
const el = document.createElement('div')
|
|
180
|
+
el.classList.add('row')
|
|
181
|
+
el.innerHTML = `<dl class="tabs horizontal" style="padding-left: 10px; margin-left: 10px;" id="${pName}"></dl><div class="tabs-content twelve columns" style="padding: 10px; margin-left: 10px;" id="${pName}"></div>`
|
|
182
|
+
return el
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
setGridColumnSize (el, size, offset) {
|
|
186
|
+
const sizes = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve']
|
|
187
|
+
el.classList.add('columns', sizes[size])
|
|
188
|
+
if (offset && offset < 11) {
|
|
189
|
+
el.classList.add(`offset-by-${sizes[offset]}`)
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
getTab (text, tabId) {
|
|
194
|
+
const el = document.createElement('dd')
|
|
195
|
+
const a = document.createElement('a')
|
|
196
|
+
a.setAttribute('href', `#${tabId}`)
|
|
197
|
+
a.appendChild(text)
|
|
198
|
+
el.appendChild(a)
|
|
199
|
+
return el
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
getTopTab (text, tabId) {
|
|
203
|
+
const el = document.createElement('dd')
|
|
204
|
+
const a = document.createElement('a')
|
|
205
|
+
a.setAttribute('href', `#${tabId}`)
|
|
206
|
+
a.appendChild(text)
|
|
207
|
+
el.appendChild(a)
|
|
208
|
+
return el
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
getTabContentHolder (tabHolder) {
|
|
212
|
+
return tabHolder.children[1]
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
getTopTabContentHolder (tabHolder) {
|
|
216
|
+
return tabHolder.children[1]
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
getTabContent () {
|
|
220
|
+
const el = document.createElement('div')
|
|
221
|
+
el.classList.add('content', 'active')
|
|
222
|
+
el.style.paddingLeft = '5px'
|
|
223
|
+
return el
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
getTopTabContent () {
|
|
227
|
+
const el = document.createElement('div')
|
|
228
|
+
el.classList.add('content', 'active')
|
|
229
|
+
el.style.paddingLeft = '5px'
|
|
230
|
+
return el
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
markTabActive (row) {
|
|
234
|
+
row.tab.classList.add('active')
|
|
235
|
+
|
|
236
|
+
if (typeof row.rowPane !== 'undefined') {
|
|
237
|
+
row.rowPane.style.display = ''
|
|
238
|
+
} else {
|
|
239
|
+
row.container.style.display = ''
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
markTabInactive (row) {
|
|
244
|
+
row.tab.classList.remove('active')
|
|
245
|
+
|
|
246
|
+
if (typeof row.rowPane !== 'undefined') {
|
|
247
|
+
row.rowPane.style.display = 'none'
|
|
248
|
+
} else {
|
|
249
|
+
row.container.style.display = 'none'
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
addTab (holder, tab) {
|
|
254
|
+
holder.children[0].appendChild(tab)
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
addTopTab (holder, tab) {
|
|
258
|
+
holder.children[0].appendChild(tab)
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/* Foundation 4 Specific Theme */
|
|
263
|
+
export class foundation4Theme extends foundationTheme {
|
|
264
|
+
getHeaderButtonHolder () {
|
|
265
|
+
const el = super.getHeaderButtonHolder()
|
|
266
|
+
el.style.fontSize = '.6em'
|
|
267
|
+
return el
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
setGridColumnSize (el, size, offset) {
|
|
271
|
+
el.classList.add('columns', `large-${size}`)
|
|
272
|
+
if (offset) {
|
|
273
|
+
el.classList.add(`large-offset-${offset}`)
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
getFormInputDescription (text) {
|
|
278
|
+
const el = super.getFormInputDescription(text)
|
|
279
|
+
el.style.fontSize = '.8rem'
|
|
280
|
+
return el
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
getFormInputLabel (text, req) {
|
|
284
|
+
const el = super.getFormInputLabel(text, req)
|
|
285
|
+
el.style.fontWeight = 'bold'
|
|
286
|
+
return el
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
/* Foundation 5 Specific Theme */
|
|
291
|
+
export class foundation5Theme extends foundationTheme {
|
|
292
|
+
getFormInputDescription (text) {
|
|
293
|
+
const el = super.getFormInputDescription(text)
|
|
294
|
+
el.style.fontSize = '.8rem'
|
|
295
|
+
return el
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
setGridColumnSize (el, size, offset) {
|
|
299
|
+
el.classList.add('columns', `medium-${size}`)
|
|
300
|
+
if (offset) {
|
|
301
|
+
el.classList.add(`medium-offset-${offset}`)
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
getButton (text, icon, title) {
|
|
306
|
+
const el = super.getButton(text, icon, title)
|
|
307
|
+
el.className = `${el.className.replace(/\s*small/g, '')} tiny`
|
|
308
|
+
return el
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
getTabHolder (propertyName) {
|
|
312
|
+
const pName = (typeof propertyName === 'undefined') ? '' : propertyName
|
|
313
|
+
const el = document.createElement('div')
|
|
314
|
+
el.innerHTML = `<dl class="tabs vertical" id="${pName}"></dl><div class="tabs-content vertical" id="${pName}"></div>`
|
|
315
|
+
return el
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
getTopTabHolder (propertyName) {
|
|
319
|
+
const pName = (typeof propertyName === 'undefined') ? '' : propertyName
|
|
320
|
+
const el = document.createElement('div')
|
|
321
|
+
el.classList.add('row')
|
|
322
|
+
el.innerHTML = `<dl class="tabs horizontal" style="padding-left: 10px;" id="${pName}"></dl><div class="tabs-content horizontal" style="padding: 10px;" id="${pName}"></div>`
|
|
323
|
+
return el
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
getTab (text, tabId) {
|
|
327
|
+
const el = document.createElement('dd')
|
|
328
|
+
const a = document.createElement('a')
|
|
329
|
+
a.setAttribute('href', `#${tabId}`)
|
|
330
|
+
a.appendChild(text)
|
|
331
|
+
el.appendChild(a)
|
|
332
|
+
return el
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
getTopTab (text, tabId) {
|
|
336
|
+
const el = document.createElement('dd')
|
|
337
|
+
const a = document.createElement('a')
|
|
338
|
+
a.setAttribute('href', `#${tabId}`)
|
|
339
|
+
a.appendChild(text)
|
|
340
|
+
el.appendChild(a)
|
|
341
|
+
return el
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
getTabContentHolder (tabHolder) {
|
|
345
|
+
return tabHolder.children[1]
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
getTopTabContentHolder (tabHolder) {
|
|
349
|
+
return tabHolder.children[1]
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
getTabContent () {
|
|
353
|
+
const el = document.createElement('div')
|
|
354
|
+
el.classList.add('tab-content', 'active')
|
|
355
|
+
el.style.paddingLeft = '5px'
|
|
356
|
+
return el
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
getTopTabContent () {
|
|
360
|
+
const el = document.createElement('div')
|
|
361
|
+
el.classList.add('tab-content', 'active')
|
|
362
|
+
el.style.paddingLeft = '5px'
|
|
363
|
+
return el
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
markTabActive (row) {
|
|
367
|
+
row.tab.classList.add('active')
|
|
368
|
+
|
|
369
|
+
if (typeof row.rowPane !== 'undefined') {
|
|
370
|
+
row.rowPane.style.display = ''
|
|
371
|
+
} else {
|
|
372
|
+
row.container.style.display = ''
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
markTabInactive (row) {
|
|
377
|
+
row.tab.classList.remove('active')
|
|
378
|
+
|
|
379
|
+
if (typeof row.rowPane !== 'undefined') {
|
|
380
|
+
row.rowPane.style.display = 'none'
|
|
381
|
+
} else {
|
|
382
|
+
row.container.style.display = 'none'
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
addTab (holder, tab) {
|
|
387
|
+
holder.children[0].appendChild(tab)
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
addTopTab (holder, tab) {
|
|
391
|
+
holder.children[0].appendChild(tab)
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
export class foundation6Theme extends foundation5Theme {
|
|
396
|
+
getIndentedPanel () {
|
|
397
|
+
const el = document.createElement('div')
|
|
398
|
+
el.classList.add('callout', 'secondary')
|
|
399
|
+
el.style = 'padding-left: 10px; margin-left: 10px;'
|
|
400
|
+
return el
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
getButtonHolder () {
|
|
404
|
+
const el = document.createElement('span')
|
|
405
|
+
el.classList.add('button-group', 'tiny')
|
|
406
|
+
el.style.marginBottom = 0
|
|
407
|
+
return el
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
getFormInputLabel (text, req) {
|
|
411
|
+
const el = super.getFormInputLabel(text, req)
|
|
412
|
+
el.style.display = 'block'
|
|
413
|
+
return el
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
getFormControl (label, input, description, infoText) {
|
|
417
|
+
const el = document.createElement('div')
|
|
418
|
+
el.classList.add('form-control')
|
|
419
|
+
if (label) el.appendChild(label)
|
|
420
|
+
if (input.type === 'checkbox' || input.type === 'radio') {
|
|
421
|
+
input.style.width = 'auto'
|
|
422
|
+
label.insertBefore(input, label.firstChild)
|
|
423
|
+
} else if (label) {
|
|
424
|
+
if (infoText) label.appendChild(infoText)
|
|
425
|
+
label.appendChild(input)
|
|
426
|
+
} else {
|
|
427
|
+
if (infoText) el.appendChild(infoText)
|
|
428
|
+
el.appendChild(input)
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
if (description && label) label.appendChild(description)
|
|
432
|
+
return el
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
addInputError (input, text) {
|
|
436
|
+
if (!input.group) return
|
|
437
|
+
input.group.classList.add('error')
|
|
438
|
+
|
|
439
|
+
if (!input.errmsg) {
|
|
440
|
+
const errorEl = document.createElement('span')
|
|
441
|
+
errorEl.classList.add('form-error', 'is-visible')
|
|
442
|
+
input.group.getElementsByTagName('label')[0].appendChild(errorEl)
|
|
443
|
+
|
|
444
|
+
input.classList.add('is-invalid-input')
|
|
445
|
+
|
|
446
|
+
input.errmsg = errorEl
|
|
447
|
+
} else {
|
|
448
|
+
input.errmsg.style.display = ''
|
|
449
|
+
input.className = ''
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
input.errmsg.textContent = text
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
removeInputError (input) {
|
|
456
|
+
if (!input.errmsg) return
|
|
457
|
+
input.classList.remove('is-invalid-input')
|
|
458
|
+
if (input.errmsg.parentNode) {
|
|
459
|
+
input.errmsg.parentNode.removeChild(input.errmsg)
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
getTabHolder (propertyName) {
|
|
464
|
+
const pName = (typeof propertyName === 'undefined') ? '' : propertyName
|
|
465
|
+
const el = document.createElement('div')
|
|
466
|
+
el.classList.add('grid-x')
|
|
467
|
+
el.innerHTML = `<div class="medium-2 cell" style="float: left;"><ul class="vertical tabs" data-tabs id="${pName}"></ul></div><div class="medium-10 cell" style="float: left;"><div class="tabs-content" data-tabs-content="${pName}"></div></div>`
|
|
468
|
+
return el
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
getTopTabHolder (propertyName) {
|
|
472
|
+
const pName = (typeof propertyName === 'undefined') ? '' : propertyName
|
|
473
|
+
const el = document.createElement('div')
|
|
474
|
+
el.classList.add('grid-y')
|
|
475
|
+
el.innerHTML = `<div className="cell"><ul class="tabs" data-tabs id="${pName}"></ul><div class="tabs-content" data-tabs-content="${pName}"></div></div>`
|
|
476
|
+
return el
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
insertBasicTopTab (tab, newTabsHolder) {
|
|
480
|
+
newTabsHolder.firstChild.firstChild.insertBefore(tab, newTabsHolder.firstChild.firstChild.firstChild)
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
getTab (text, tabId) {
|
|
484
|
+
const el = document.createElement('li')
|
|
485
|
+
el.classList.add('tabs-title')
|
|
486
|
+
const a = document.createElement('a')
|
|
487
|
+
a.setAttribute('href', `#${tabId}`)
|
|
488
|
+
a.appendChild(text)
|
|
489
|
+
el.appendChild(a)
|
|
490
|
+
return el
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
getTopTab (text, tabId) {
|
|
494
|
+
const el = document.createElement('li')
|
|
495
|
+
el.classList.add('tabs-title')
|
|
496
|
+
const a = document.createElement('a')
|
|
497
|
+
a.setAttribute('href', `#${tabId}`)
|
|
498
|
+
a.appendChild(text)
|
|
499
|
+
el.appendChild(a)
|
|
500
|
+
return el
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
getTabContentHolder (tabHolder) {
|
|
504
|
+
return tabHolder.children[1].firstChild
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
getTopTabContentHolder (tabHolder) {
|
|
508
|
+
return tabHolder.firstChild.children[1]
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
getTabContent () {
|
|
512
|
+
const el = document.createElement('div')
|
|
513
|
+
el.classList.add('tabs-panel')
|
|
514
|
+
el.style.paddingLeft = '5px'
|
|
515
|
+
return el
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
getTopTabContent () {
|
|
519
|
+
const el = document.createElement('div')
|
|
520
|
+
el.classList.add('tabs-panel')
|
|
521
|
+
el.style.paddingLeft = '5px'
|
|
522
|
+
return el
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
markTabActive (row) {
|
|
526
|
+
row.tab.classList.add('is-active')
|
|
527
|
+
row.tab.firstChild.setAttribute('aria-selected', 'true')
|
|
528
|
+
|
|
529
|
+
if (typeof row.rowPane !== 'undefined') {
|
|
530
|
+
row.rowPane.classList.add('is-active')
|
|
531
|
+
row.rowPane.setAttribute('aria-selected', 'true')
|
|
532
|
+
} else {
|
|
533
|
+
row.container.classList.add('is-active')
|
|
534
|
+
row.container.setAttribute('aria-selected', 'true')
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
markTabInactive (row) {
|
|
539
|
+
row.tab.classList.remove('is-active')
|
|
540
|
+
row.tab.firstChild.removeAttribute('aria-selected')
|
|
541
|
+
|
|
542
|
+
if (typeof row.rowPane !== 'undefined') {
|
|
543
|
+
row.rowPane.classList.remove('is-active')
|
|
544
|
+
row.rowPane.removeAttribute('aria-selected')
|
|
545
|
+
} else {
|
|
546
|
+
row.container.classList.remove('is-active')
|
|
547
|
+
row.container.removeAttribute('aria-selected')
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
addTab (holder, tab) {
|
|
552
|
+
holder.children[0].firstChild.appendChild(tab)
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
addTopTab (holder, tab) {
|
|
556
|
+
holder.firstChild.children[0].appendChild(tab)
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
getFirstTab (holder) {
|
|
560
|
+
return holder.firstChild.firstChild.firstChild
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/* Custom stylesheet rules. format: "selector" : "CSS rules" */
|
|
565
|
+
foundationTheme.rules = { 'div[data-schemaid="root"]:after': 'position:relative;color:red;margin:10px 0;font-weight:600;display:block;width:100%;text-align:center;content:"This is an old JSON-Editor 1.x Theme and might not display elements correctly when used with the 2.x version"' }
|
|
566
|
+
foundation3Theme.rules = foundationTheme.rules
|
|
567
|
+
foundation4Theme.rules = foundationTheme.rules
|
|
568
|
+
foundation5Theme.rules = foundationTheme.rules
|
|
569
|
+
foundation6Theme.rules = foundationTheme.rules
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
.je-form-input-label {
|
|
2
|
+
display: block;
|
|
3
|
+
margin-bottom: 3px;
|
|
4
|
+
font-weight: bold;
|
|
5
|
+
}
|
|
6
|
+
.je-form-input-description {
|
|
7
|
+
display: inline-block;
|
|
8
|
+
margin: 0;
|
|
9
|
+
font-size: 0.8em;
|
|
10
|
+
font-style: italic;
|
|
11
|
+
}
|
|
12
|
+
.je-indented-panel {
|
|
13
|
+
padding: 5px;
|
|
14
|
+
margin: 10px;
|
|
15
|
+
border-radius: 3px;
|
|
16
|
+
border: 1px solid #ddd;
|
|
17
|
+
}
|
|
18
|
+
.je-child-editor-holder {
|
|
19
|
+
margin-bottom: 8px;
|
|
20
|
+
}
|
|
21
|
+
.je-header-button-holder {
|
|
22
|
+
display: inline-block;
|
|
23
|
+
margin-left: 10px;
|
|
24
|
+
font-size: 0.8em;
|
|
25
|
+
vertical-align: middle;
|
|
26
|
+
}
|
|
27
|
+
.je-table {
|
|
28
|
+
margin-bottom: 5px;
|
|
29
|
+
border-bottom: 1px solid #ccc;
|
|
30
|
+
}
|
|
31
|
+
/* Upload Editor preview image */
|
|
32
|
+
.je-upload-preview img {
|
|
33
|
+
float: left;
|
|
34
|
+
margin: 0 0.5rem 0.5rem 0;
|
|
35
|
+
max-width: 100%;
|
|
36
|
+
max-height: 5rem;
|
|
37
|
+
}
|
|
38
|
+
.je-dropzone {
|
|
39
|
+
position: relative;
|
|
40
|
+
margin: 0.5rem 0;
|
|
41
|
+
border: 2px dashed black;
|
|
42
|
+
width: 100%;
|
|
43
|
+
height: 60px;
|
|
44
|
+
background: teal;
|
|
45
|
+
transition: all 0.5s;
|
|
46
|
+
}
|
|
47
|
+
.je-dropzone:before {
|
|
48
|
+
position: absolute;
|
|
49
|
+
content: attr(data-text);
|
|
50
|
+
color: rgba(0, 0, 0, 0.6);
|
|
51
|
+
left: 50%;
|
|
52
|
+
top: 50%;
|
|
53
|
+
transform: translate(-50%, -50%);
|
|
54
|
+
}
|
|
55
|
+
.je-dropzone.valid-dropzone {
|
|
56
|
+
background: green;
|
|
57
|
+
}
|
|
58
|
+
.je-dropzone.invalid-dropzone {
|
|
59
|
+
background: red;
|
|
60
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
export default {".je-form-input-label":"display:block;margin-bottom:3px;font-weight:bold",".je-form-input-description":"display:inline-block;margin:0;font-size:0.8em;font-style:italic",".je-indented-panel":"padding:5px;margin:10px;border-radius:3px;border:1px%20solid%20%23ddd",".je-child-editor-holder":"margin-bottom:8px",".je-header-button-holder":"display:inline-block;margin-left:10px;font-size:0.8em;vertical-align:middle",".je-table":"margin-bottom:5px;border-bottom:1px%20solid%20%23ccc",".je-upload-preview img":"float:left;margin:0%200.5rem%200.5rem%200;max-width:100%25;max-height:5rem",".je-dropzone":"position:relative;margin:0.5rem%200;border:2px%20dashed%20black;width:100%25;height:60px;background:teal;transition:all%200.5s",".je-dropzone:before":"position:absolute;content:attr(data-text);color:rgba(0%2C%200%2C%200%2C%200.6);left:50%25;top:50%25;transform:translate(-50%25%2C%20-50%25)",".je-dropzone.valid-dropzone":"background:green",".je-dropzone.invalid-dropzone":"background:red"}
|
|
3
|
+
/* eslint-enable */
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { AbstractTheme } from '../theme.js'
|
|
2
|
+
import rules from './html.css.js'
|
|
3
|
+
|
|
4
|
+
export class htmlTheme extends AbstractTheme {
|
|
5
|
+
getFormInputLabel (text, req) {
|
|
6
|
+
const el = super.getFormInputLabel(text, req)
|
|
7
|
+
el.classList.add('je-form-input-label')
|
|
8
|
+
return el
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
getFormInputDescription (text) {
|
|
12
|
+
const el = super.getFormInputDescription(text)
|
|
13
|
+
el.classList.add('je-form-input-label')
|
|
14
|
+
return el
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
getIndentedPanel () {
|
|
18
|
+
const el = super.getIndentedPanel()
|
|
19
|
+
el.classList.add('je-indented-panel')
|
|
20
|
+
return el
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
getTopIndentedPanel () {
|
|
24
|
+
return this.getIndentedPanel()
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
getChildEditorHolder () {
|
|
28
|
+
const el = super.getChildEditorHolder()
|
|
29
|
+
el.classList.add('je-child-editor-holder')
|
|
30
|
+
return el
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
getHeaderButtonHolder () {
|
|
34
|
+
const el = this.getButtonHolder()
|
|
35
|
+
el.classList.add('je-header-button-holder')
|
|
36
|
+
return el
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
getTable () {
|
|
40
|
+
const el = super.getTable()
|
|
41
|
+
el.classList.add('je-table')
|
|
42
|
+
return el
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
addInputError (input, text) {
|
|
46
|
+
const group = this.closest(input, '.form-control') || input.controlgroup
|
|
47
|
+
|
|
48
|
+
if (!input.errmsg) {
|
|
49
|
+
input.errmsg = document.createElement('div')
|
|
50
|
+
input.errmsg.setAttribute('class', 'errmsg')
|
|
51
|
+
input.errmsg.style = input.errmsg.style || {}
|
|
52
|
+
input.errmsg.style.color = 'red'
|
|
53
|
+
group.appendChild(input.errmsg)
|
|
54
|
+
} else {
|
|
55
|
+
input.errmsg.style.display = 'block'
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
input.errmsg.innerHTML = ''
|
|
59
|
+
input.errmsg.appendChild(document.createTextNode(text))
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
removeInputError (input) {
|
|
63
|
+
if (input.style) {
|
|
64
|
+
input.style.borderColor = ''
|
|
65
|
+
}
|
|
66
|
+
if (input.errmsg) input.errmsg.style.display = 'none'
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Custom stylesheet rules. format: "selector" : "CSS rules" */
|
|
71
|
+
htmlTheme.rules = rules
|