Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds JSONEditor.plugins.selectize.remove_button option and Semantic UI theme #644

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
allow passing in function that resolves external refs
Alvin committed Feb 22, 2017
commit 8bcd45cb3534156d7a23b1eaebfcb8155d1005e3
95 changes: 69 additions & 26 deletions dist/jsoneditor.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/jsoneditor.js.map

Large diffs are not rendered by default.

28 changes: 10 additions & 18 deletions dist/jsoneditor.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/jsoneditor.min.js.map

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions src/core.js
Original file line number Diff line number Diff line change
@@ -359,7 +359,7 @@ JSONEditor.prototype = {
}

return refs;
},
},
_loadExternalRefs: function(schema, callback) {
var self = this;
var refs = this._getExternalRefs(schema);
@@ -368,7 +368,11 @@ JSONEditor.prototype = {

$each(refs,function(url) {
if(self.refs[url]) return;
if(!self.options.ajax) throw "Must set ajax option to true to load external ref "+url;
if(self.options.resolveReferenceUrl && typeof(self.options.resolveReferenceUrl) == "function") {
var u = self.options.resolveReferenceUrl(url);
if (u) self.refs[url] = u;
}
else if(!self.options.ajax) throw "Must set ajax option to true to load external ref "+url;
self.refs[url] = 'loading';
waiting++;

9 changes: 5 additions & 4 deletions src/themes/semantic_ui.js
Original file line number Diff line number Diff line change
@@ -102,7 +102,7 @@ JSONEditor.defaults.themes.semantic_ui = JSONEditor.AbstractTheme.extend({
},
getButtonHolder: function() {
var el = document.createElement('div');
el.className="button-holder"
el.className="button-holder";
//el.style.float = "right";
return el;
},
@@ -117,16 +117,17 @@ JSONEditor.defaults.themes.semantic_ui = JSONEditor.AbstractTheme.extend({
return el;
},
addInputError: function(input, text) {
console.log(['erroradd', input]);

if(!input.errmsg) {
/*
var group = this.closest(input,'.field');
var target = $(group).find('label')[0];
input.errmsg = document.createElement('small');
input.errmsg.setAttribute('class','error');
input.errmsg.style = input.errmsg.style || {};
input.errmsg.style.float = 'right';
target.appendChild(input.errmsg);
*/
}
else {
input.errmsg.style.display = 'block';
@@ -147,8 +148,8 @@ JSONEditor.defaults.themes.semantic_ui = JSONEditor.AbstractTheme.extend({
},
getTabContent: function() {
var el = document.createElement('div');
el.className = "tab-contents"
return el
el.className = "tab-contents";
return el;
},
getTab: function(text) {
var el = document.createElement('a');