Skip to content

Commit dc157a0

Browse files
committed
Create jsoneditor.barebones-theme.js
Minimal html structuring with no styling. Intended to be styled later using css.
1 parent a3b9bfe commit dc157a0

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
JSONEditor.defaults.themes.barebones = JSONEditor.AbstractTheme.extend({
2+
getFormInputLabel: function (text) {
3+
var el = this._super(text);
4+
return el;
5+
},
6+
getFormInputDescription: function (text) {
7+
var el = this._super(text);
8+
return el;
9+
},
10+
getIndentedPanel: function () {
11+
var el = this._super();
12+
return el;
13+
},
14+
getChildEditorHolder: function () {
15+
var el = this._super();
16+
return el;
17+
},
18+
getHeaderButtonHolder: function () {
19+
var el = this.getButtonHolder();
20+
return el;
21+
},
22+
getTable: function () {
23+
var el = this._super();
24+
return el;
25+
},
26+
addInputError: function (input, text) {
27+
if (!input.errmsg) {
28+
var group = this.closest(input, '.form-control');
29+
input.errmsg = document.createElement('div');
30+
input.errmsg.setAttribute('class', 'errmsg');
31+
group.appendChild(input.errmsg);
32+
}
33+
else {
34+
input.errmsg.style.display = 'block';
35+
}
36+
37+
input.errmsg.innerHTML = '';
38+
input.errmsg.appendChild(document.createTextNode(text));
39+
},
40+
removeInputError: function (input) {
41+
input.style.borderColor = '';
42+
if (input.errmsg) input.errmsg.style.display = 'none';
43+
},
44+
getProgressBar: function () {
45+
var max = 100, start = 0;
46+
47+
var progressBar = document.createElement('progress');
48+
progressBar.setAttribute('max', max);
49+
progressBar.setAttribute('value', start);
50+
return progressBar;
51+
},
52+
updateProgressBar: function (progressBar, progress) {
53+
if (!progressBar) return;
54+
progressBar.setAttribute('value', progress);
55+
},
56+
updateProgressBarUnknown: function (progressBar) {
57+
if (!progressBar) return;
58+
progressBar.removeAttribute('value');
59+
}
60+
});

0 commit comments

Comments
 (0)