From a04f34eab75143a144e48bd84da16cb2d2319758 Mon Sep 17 00:00:00 2001 From: brindosch Date: Thu, 15 Sep 2016 19:06:21 +0200 Subject: [PATCH] update schemas | mod jsoneditor (#243) * update * sync [skip ci] * always required [skip ci] --- assets/webconfig/js/lib/jsoneditor.js | 494 +++++++++--------- libsrc/hyperion/hyperion.schema.json | 186 ++++--- libsrc/leddevice/schemas/schema-adalight.json | 9 +- .../schemas/schema-adalightapa102.json | 9 +- libsrc/leddevice/schemas/schema-apa102.json | 11 +- libsrc/leddevice/schemas/schema-atmo.json | 9 +- libsrc/leddevice/schemas/schema-atmoorb.json | 16 +- libsrc/leddevice/schemas/schema-e131.json | 17 +- libsrc/leddevice/schemas/schema-lpd6803.json | 9 +- libsrc/leddevice/schemas/schema-lpd8806.json | 9 +- .../schemas/schema-multi-lightpack.json | 4 + libsrc/leddevice/schemas/schema-p9813.json | 9 +- .../leddevice/schemas/schema-paintpack.json | 9 +- .../leddevice/schemas/schema-philipshue.json | 18 +- libsrc/leddevice/schemas/schema-rawhid.json | 9 +- libsrc/leddevice/schemas/schema-sedu.json | 9 +- .../schemas/schema-sk6812rgbw-spi.json | 10 +- .../leddevice/schemas/schema-tinkerforge.json | 25 + libsrc/leddevice/schemas/schema-tpm2.json | 17 + libsrc/leddevice/schemas/schema-tpm2net.json | 18 + libsrc/leddevice/schemas/schema-udpraw.json | 6 +- libsrc/leddevice/schemas/schema-ws2801.json | 10 +- .../leddevice/schemas/schema-ws2812spi.json | 10 +- 23 files changed, 534 insertions(+), 389 deletions(-) diff --git a/assets/webconfig/js/lib/jsoneditor.js b/assets/webconfig/js/lib/jsoneditor.js index d65540c3..8b81c0ff 100755 --- a/assets/webconfig/js/lib/jsoneditor.js +++ b/assets/webconfig/js/lib/jsoneditor.js @@ -20,20 +20,20 @@ var Class; (function(){ var initializing = false, fnTest = /xyz/.test(function(){window.postMessage("xyz");}) ? /\b_super\b/ : /.*/; - + // The base Class implementation (does nothing) Class = function(){}; - + // Create a new Class that inherits from this class Class.extend = function extend(prop) { var _super = this.prototype; - + // Instantiate a base class (but only create the instance, // don't run the init constructor) initializing = true; var prototype = new this(); initializing = false; - + // Copy the properties over onto the new prototype for (var name in prop) { // Check if we're overwriting an existing function @@ -42,41 +42,41 @@ var Class; (function(name, fn){ return function() { var tmp = this._super; - + // Add a new ._super() method that is the same method // but on the super-class this._super = _super[name]; - + // The method only need to be bound temporarily, so we // remove it when we're done executing - var ret = fn.apply(this, arguments); + var ret = fn.apply(this, arguments); this._super = tmp; - + return ret; }; })(name, prop[name]) : prop[name]; } - + // The dummy class constructor function Class() { // All construction is actually done in the init method if ( !initializing && this.init ) this.init.apply(this, arguments); } - + // Populate our constructed prototype object Class.prototype = prototype; - + // Enforce the constructor to be what we expect Class.prototype.constructor = Class; - + // And make this class extendable Class.extend = extend; - + return Class; }; - + return Class; })(); @@ -102,20 +102,20 @@ var Class; var vendors = ['ms', 'moz', 'webkit', 'o']; for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { window.requestAnimationFrame = window[vendors[x]+'RequestAnimationFrame']; - window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] || + window.cancelAnimationFrame = window[vendors[x]+'CancelAnimationFrame'] || window[vendors[x]+'CancelRequestAnimationFrame']; } - + if (!window.requestAnimationFrame) window.requestAnimationFrame = function(callback, element) { var currTime = new Date().getTime(); var timeToCall = Math.max(0, 16 - (currTime - lastTime)); - var id = window.setTimeout(function() { callback(currTime + timeToCall); }, + var id = window.setTimeout(function() { callback(currTime + timeToCall); }, timeToCall); lastTime = currTime + timeToCall; return id; }; - + if (!window.cancelAnimationFrame) window.cancelAnimationFrame = function(id) { clearTimeout(id); @@ -226,38 +226,38 @@ JSONEditor.prototype = { constructor: JSONEditor, init: function() { var self = this; - + this.ready = false; var theme_class = JSONEditor.defaults.themes[this.options.theme || JSONEditor.defaults.theme]; if(!theme_class) throw "Unknown theme " + (this.options.theme || JSONEditor.defaults.theme); - + this.schema = this.options.schema; this.theme = new theme_class(); this.template = this.options.template; this.refs = this.options.refs || {}; this.uuid = 0; this.__data = {}; - + var icon_class = JSONEditor.defaults.iconlibs[this.options.iconlib || JSONEditor.defaults.iconlib]; if(icon_class) this.iconlib = new icon_class(); this.root_container = this.theme.getContainer(); this.element.appendChild(this.root_container); - + this.translate = this.options.translate || JSONEditor.defaults.translate; // Fetch all external refs via ajax this._loadExternalRefs(this.schema, function() { self._getDefinitions(self.schema); - + // Validator options var validator_options = {}; if(self.options.custom_validators) { validator_options.custom_validators = self.options.custom_validators; } self.validator = new JSONEditor.Validator(self,null,validator_options); - + // Create the root editor var editor_class = self.getEditorClass(self.schema); self.root = self.createEditor(editor_class, { @@ -266,7 +266,7 @@ JSONEditor.prototype = { required: true, container: self.root_container }); - + self.root.preBuild(); self.root.build(); self.root.postBuild(); @@ -301,7 +301,7 @@ JSONEditor.prototype = { }, validate: function(value) { if(!this.ready) throw "JSON Editor not ready yet. Listen for 'ready' event before validating"; - + // Custom value if(arguments.length === 1) { return this.validator.validate(value); @@ -314,7 +314,7 @@ JSONEditor.prototype = { destroy: function() { if(this.destroyed) return; if(!this.ready) return; - + this.schema = null; this.options = null; this.root.destroy(); @@ -328,14 +328,14 @@ JSONEditor.prototype = { this.__data = null; this.ready = false; this.element.innerHTML = ''; - + this.destroyed = true; }, on: function(event, callback) { this.callbacks = this.callbacks || {}; this.callbacks[event] = this.callbacks[event] || []; this.callbacks[event].push(callback); - + return this; }, off: function(event, callback) { @@ -359,7 +359,7 @@ JSONEditor.prototype = { else { this.callbacks = {}; } - + return this; }, trigger: function(event) { @@ -368,7 +368,7 @@ JSONEditor.prototype = { this.callbacks[event][i](); } } - + return this; }, setOption: function(option, value) { @@ -380,7 +380,7 @@ JSONEditor.prototype = { else { throw "Option "+option+" must be set during instantiation and cannot be changed later"; } - + return this; }, getEditorClass: function(schema) { @@ -409,30 +409,30 @@ JSONEditor.prototype = { }, onChange: function() { if(!this.ready) return; - + if(this.firing_change) return; this.firing_change = true; - + var self = this; - + window.requestAnimationFrame(function() { self.firing_change = false; if(!self.ready) return; // Validate and cache results self.validation_results = self.validator.validate(self.root.getValue()); - + if(self.options.show_errors !== "never") { self.root.showValidationErrors(self.validation_results); } else { self.root.showValidationErrors([]); } - + // Fire change event self.trigger('change'); }); - + return this; }, compileTemplate: function(template, name) { @@ -475,7 +475,7 @@ JSONEditor.prototype = { else { // No data stored if(!el.hasAttribute('data-jsoneditor-'+key)) return null; - + return this.__data[el.getAttribute('data-jsoneditor-'+key)]; } }, @@ -497,7 +497,7 @@ JSONEditor.prototype = { this.watchlist = this.watchlist || {}; this.watchlist[path] = this.watchlist[path] || []; this.watchlist[path].push(callback); - + return this; }, unwatch: function(path,callback) { @@ -507,7 +507,7 @@ JSONEditor.prototype = { this.watchlist[path] = null; return this; } - + var newlist = []; for(var i=0; i=0) { holder = this.theme.getBlockLinkHolder(); - + link = this.theme.getBlockLink(); link.setAttribute('target','_blank'); - + var media = document.createElement(type); media.setAttribute('controls','controls'); - + this.theme.createMediaLink(holder,link,media); - - // When a watched field changes, update the url + + // When a watched field changes, update the url this.link_watchers.push(function(vars) { var url = href(vars); link.setAttribute('href',url); @@ -1634,7 +1634,7 @@ JSONEditor.AbstractEditor = Class.extend({ }); } } - + if(data.class) link.className = link.className + ' ' + data.class; return holder; @@ -1644,7 +1644,7 @@ JSONEditor.AbstractEditor = Class.extend({ var watched = {}; var changed = false; var self = this; - + if(this.watched) { var val,editor; for(var name in this.watched) { @@ -1655,12 +1655,12 @@ JSONEditor.AbstractEditor = Class.extend({ watched[name] = val; } } - + watched.self = this.getValue(); if(this.watched_values.self !== watched.self) changed = true; - + this.watched_values = watched; - + return changed; }, getWatchedFieldValues: function() { @@ -1690,7 +1690,7 @@ JSONEditor.AbstractEditor = Class.extend({ }, onWatchedFieldChange: function() { var vars; - if(this.header_template) { + if(this.header_template) { vars = $extend(this.getWatchedFieldValues(),{ key: this.key, i: this.key, @@ -1699,7 +1699,7 @@ JSONEditor.AbstractEditor = Class.extend({ title: this.getTitle() }); var header_text = this.header_template(vars); - + if(header_text !== this.header_text) { this.header_text = header_text; this.updateHeaderText(); @@ -1749,12 +1749,12 @@ JSONEditor.AbstractEditor = Class.extend({ getDefault: function() { if(this.schema["default"]) return this.schema["default"]; if(this.schema["enum"]) return this.schema["enum"][0]; - + var type = this.schema.type || this.schema.oneOf; if(type && Array.isArray(type)) type = type[0]; if(type && typeof type === "object") type = type.type; if(type && Array.isArray(type)) type = type[0]; - + if(typeof type === "string") { if(type === "number") return 0.0; if(type === "boolean") return false; @@ -1763,7 +1763,7 @@ JSONEditor.AbstractEditor = Class.extend({ if(type === "object") return {}; if(type === "array") return []; } - + return null; }, getTitle: function() { @@ -1782,12 +1782,12 @@ JSONEditor.AbstractEditor = Class.extend({ if(typeof this.schema.required === "boolean") return this.schema.required; else if(this.parent && this.parent.schema && Array.isArray(this.parent.schema.required)) return this.parent.schema.required.indexOf(this.key) > -1; else if(this.jsoneditor.options.required_by_default) return true; - else return false; - }, + else return true; + }, getDisplayText: function(arr) { var disp = []; var used = {}; - + // Determine how many times each attribute name is used. // This helps us pick the most distinct display text for the schemas. $each(arr,function(i,el) { @@ -1808,11 +1808,11 @@ JSONEditor.AbstractEditor = Class.extend({ used[el.type]++; } }); - + // Determine display text for each element of the array $each(arr,function(i,el) { var name; - + // If it's a simple string if(typeof el === "string") name = el; // Object @@ -1826,19 +1826,19 @@ JSONEditor.AbstractEditor = Class.extend({ else if(el.description) name = el.description; else if(JSON.stringify(el).length < 50) name = JSON.stringify(el); else name = "type"; - + disp.push(name); }); - + // Replace identical display text with "text 1", "text 2", etc. var inc = {}; $each(disp,function(i,name) { inc[name] = inc[name] || 0; inc[name]++; - + if(used[name] > 1) disp[i] = name + " " + inc[name]; }); - + return disp; }, getOption: function(key) { @@ -1848,7 +1848,7 @@ JSONEditor.AbstractEditor = Class.extend({ catch(e) { window.console.error(e); } - + return this.options[key]; }, showValidationErrors: function(errors) { @@ -1881,15 +1881,15 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({ }, setValue: function(value,initial,from_template) { var self = this; - + if(this.template && !from_template) { return; } - + if(value === null || typeof value === 'undefined') value = ""; else if(typeof value === "object") value = JSON.stringify(value); else if(typeof value !== "string") value = ""+value; - + if(value === this.serialized) return; // Sanitize value before setting it @@ -1900,7 +1900,7 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({ } this.input.value = sanitized; - + // If using SCEditor, update the WYSIWYG if(this.sceditor_instance) { this.sceditor_instance.val(sanitized); @@ -1911,14 +1911,14 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({ else if(this.ace_editor) { this.ace_editor.setValue(sanitized); } - + var changed = from_template || this.getValue() !== value; - + this.refreshValue(); - + if(initial) this.is_dirty = false; else if(this.jsoneditor.options.show_errors === "change") this.is_dirty = true; - + if(this.adjust_height) this.adjust_height(this.input); // Bubble this setValue to parents if the value changed @@ -1927,11 +1927,11 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({ getNumColumns: function() { var min = Math.ceil(Math.max(this.getTitle().length,this.schema.maxLength||0,this.schema.minLength||0)/5); var num; - + if(this.input_type === 'textarea') num = 6; else if(['text','email'].indexOf(this.input_type) >= 0) num = 4; else num = 2; - + return Math.min(12,Math.max(min,num)); }, build: function() { @@ -2027,7 +2027,7 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({ ) { this.input_type = this.format; this.source_code = true; - + this.input = this.theme.getTextareaInput(); } // HTML5 Input type @@ -2041,7 +2041,7 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({ this.input_type = 'text'; this.input = this.theme.getFormInputField(this.input_type); } - + // minLength, maxLength, and pattern if(typeof this.schema.maxLength !== "undefined") this.input.setAttribute('maxlength',this.schema.maxLength); if(typeof this.schema.pattern !== "undefined") this.input.setAttribute('pattern',this.schema.pattern); @@ -2060,10 +2060,10 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({ } this.input - .addEventListener('change',function(e) { + .addEventListener('change',function(e) { e.preventDefault(); e.stopPropagation(); - + // Don't allow changing if this field is a template if(self.schema.template) { this.value = self.value; @@ -2071,19 +2071,19 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({ } var val = this.value; - + // sanitize value var sanitized = self.sanitize(val); if(val !== sanitized) { this.value = sanitized; } - + self.is_dirty = true; self.refreshValue(); self.onChange(true); }); - + if(this.options.input_height) this.input.style.height = this.options.input_height; if(this.options.expand_height) { this.adjust_height = function(el) { @@ -2110,7 +2110,7 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({ el.style.height = (ch+1)+'px'; } }; - + this.input.addEventListener('keyup',function(e) { self.adjust_height(this); }); @@ -2157,12 +2157,12 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({ }, afterInputReady: function() { var self = this, options; - + // Code editor - if(this.source_code) { + if(this.source_code) { // WYSIWYG html and bbcode editor - if(this.options.wysiwyg && - ['html','bbcode'].indexOf(this.input_type) >= 0 && + if(this.options.wysiwyg && + ['html','bbcode'].indexOf(this.input_type) >= 0 && window.jQuery && window.jQuery.fn && window.jQuery.fn.sceditor ) { options = $extend({},{ @@ -2171,11 +2171,11 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({ width: '100%', height: 300 },JSONEditor.plugins.sceditor,self.options.sceditor_options||{}); - + window.jQuery(self.input).sceditor(options); - + self.sceditor_instance = window.jQuery(self.input).sceditor('instance'); - + self.sceditor_instance.blur(function() { // Get editor's value var val = window.jQuery("
"+self.sceditor_instance.val()+"
"); @@ -2193,16 +2193,16 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({ this.epiceditor_container = document.createElement('div'); this.input.parentNode.insertBefore(this.epiceditor_container,this.input); this.input.style.display = 'none'; - + options = $extend({},JSONEditor.plugins.epiceditor,{ container: this.epiceditor_container, clientSideStorage: false }); - + this.epiceditor = new window.EpicEditor(options).load(); - + this.epiceditor.importFile(null,this.getValue()); - + this.epiceditor.on('update',function() { var val = self.epiceditor.exportFile(); self.input.value = val; @@ -2218,7 +2218,7 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({ if(mode === 'cpp' || mode === 'c++' || mode === 'c') { mode = 'c_cpp'; } - + this.ace_container = document.createElement('div'); this.ace_container.style.width = '100%'; this.ace_container.style.position = 'relative'; @@ -2226,15 +2226,15 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({ this.input.parentNode.insertBefore(this.ace_container,this.input); this.input.style.display = 'none'; this.ace_editor = window.ace.edit(this.ace_container); - + this.ace_editor.setValue(this.getValue()); - + // The theme if(JSONEditor.plugins.ace.theme) this.ace_editor.setTheme('ace/theme/'+JSONEditor.plugins.ace.theme); // The mode mode = window.ace.require("ace/mode/"+mode); if(mode) this.ace_editor.getSession().setMode(new mode.Mode()); - + // Listen for changes this.ace_editor.on('change',function() { var val = self.ace_editor.getValue(); @@ -2245,7 +2245,7 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({ }); } } - + self.theme.afterInputReady(self.input); }, refreshValue: function() { @@ -2264,8 +2264,8 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({ else if(this.ace_editor) { this.ace_editor.destroy(); } - - + + this.template = null; if(this.input && this.input.parentNode) this.input.parentNode.removeChild(this.input); if(this.label && this.label.parentNode) this.label.parentNode.removeChild(this.label); @@ -2282,23 +2282,23 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({ /** * Re-calculates the value if needed */ - onWatchedFieldChange: function() { + onWatchedFieldChange: function() { var self = this, vars, j; - + // If this editor needs to be rendered by a macro template if(this.template) { vars = this.getWatchedFieldValues(); this.setValue(this.template(vars),false,true); } - + this._super(); }, showValidationErrors: function(errors) { var self = this; - + if(this.jsoneditor.options.show_errors === "always") {} else if(!this.is_dirty && this.previous_error_setting===this.jsoneditor.options.show_errors) return; - + this.previous_error_setting = this.jsoneditor.options.show_errors; var messages = []; @@ -3053,7 +3053,7 @@ JSONEditor.defaults.editors.object = JSONEditor.AbstractEditor.extend({ if(!this.editors.hasOwnProperty(i)) continue; this.value[i] = this.editors[i].getValue(); } - + if(this.adding_property) this.refreshAddProperties(); }, refreshAddProperties: function() { @@ -3260,11 +3260,11 @@ JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({ if(this.add_row_button) this.add_row_button.disabled = false; if(this.remove_all_rows_button) this.remove_all_rows_button.disabled = false; if(this.delete_last_row_button) this.delete_last_row_button.disabled = false; - + if(this.rows) { for(var i=0; i= this.rows.length; - + $each(this.rows,function(i,editor) { // Hide the move down button for the last row if(editor.movedown_button) { @@ -3613,15 +3613,15 @@ JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({ // Get the value for this editor self.value[i] = editor.getValue(); }); - + var controls_needed = false; - + if(!this.value.length) { this.delete_last_row_button.style.display = 'none'; this.remove_all_rows_button.style.display = 'none'; } - else if(this.value.length === 1) { - this.remove_all_rows_button.style.display = 'none'; + else if(this.value.length === 1) { + this.remove_all_rows_button.style.display = 'none'; // If there are minItems items in the array, or configured to hide the delete_last_row button, hide the delete button beneath the rows if(minItems || this.hide_delete_last_row_buttons) { @@ -3657,8 +3657,8 @@ JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({ else { this.add_row_button.style.display = ''; controls_needed = true; - } - + } + if(!this.collapsed && controls_needed) { this.controls.style.display = 'inline-block'; } @@ -3670,7 +3670,7 @@ JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({ addRow: function(value, initial) { var self = this; var i = this.rows.length; - + self.rows[i] = this.getElementEditor(i); self.row_cache[i] = self.rows[i]; @@ -3687,9 +3687,9 @@ JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({ self.theme.addTab(self.tabs_holder, self.rows[i].tab); } - + var controls_holder = self.rows[i].title_controls || self.rows[i].array_controls; - + // Buttons to delete row, move row up, and move row down if(!self.hide_delete_buttons) { self.rows[i].delete_button = this.getButton(self.getItemTitle(),'delete',this.translate('button_delete_row_title',[self.getItemTitle()])); @@ -3714,7 +3714,7 @@ JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({ // Otherwise, make the previous tab active if there is one else if(j) new_active_tab = self.rows[j-1].tab; } - + return; // If this is the one we're deleting } newval.push(row); @@ -3727,12 +3727,12 @@ JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({ self.onChange(true); }); - + if(controls_holder) { controls_holder.appendChild(self.rows[i].delete_button); } } - + if(i && !self.hide_move_buttons) { self.rows[i].moveup_button = this.getButton('','moveup',this.translate('button_move_up_title')); self.rows[i].moveup_button.className += ' moveup'; @@ -3754,12 +3754,12 @@ JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({ self.onChange(true); }); - + if(controls_holder) { controls_holder.appendChild(self.rows[i].moveup_button); } } - + if(!self.hide_move_buttons) { self.rows[i].movedown_button = this.getButton('','movedown',this.translate('button_move_down_title')); self.rows[i].movedown_button.className += ' movedown'; @@ -3780,7 +3780,7 @@ JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({ self.refreshTabs(); self.onChange(true); }); - + if(controls_holder) { controls_holder.appendChild(self.rows[i].movedown_button); } @@ -3791,7 +3791,7 @@ JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({ }, addControls: function() { var self = this; - + this.collapsed = false; this.toggle_button = this.getButton('','collapse',this.translate('button_collapse')); this.title_controls.appendChild(this.toggle_button); @@ -3822,7 +3822,7 @@ JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({ if(this.options.collapsed) { $trigger(this.toggle_button,'click'); } - + // Collapse button disabled if(this.schema.options && typeof this.schema.options.disable_collapse !== "undefined") { if(this.schema.options.disable_collapse) this.toggle_button.style.display = 'none'; @@ -3830,10 +3830,10 @@ JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({ else if(this.jsoneditor.options.disable_collapse) { this.toggle_button.style.display = 'none'; } - + // Add "new row" and "delete last" buttons below editor this.add_row_button = this.getButton(this.getItemTitle(),'add',this.translate('button_add_row_title',[this.getItemTitle()])); - + this.add_row_button.addEventListener('click',function(e) { e.preventDefault(); e.stopPropagation(); @@ -3860,10 +3860,10 @@ JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({ e.preventDefault(); e.stopPropagation(); var rows = self.getValue(); - + var new_active_tab = null; if(self.rows.length > 1 && self.rows[self.rows.length-1].tab === self.active_tab) new_active_tab = self.rows[self.rows.length-2].tab; - + rows.pop(); self.setValue(rows); if(new_active_tab) { @@ -3887,11 +3887,11 @@ JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({ this.add_row_button.style.width = '100%'; this.add_row_button.style.textAlign = 'left'; this.add_row_button.style.marginBottom = '3px'; - + this.delete_last_row_button.style.width = '100%'; this.delete_last_row_button.style.textAlign = 'left'; this.delete_last_row_button.style.marginBottom = '3px'; - + this.remove_all_rows_button.style.width = '100%'; this.remove_all_rows_button.style.textAlign = 'left'; this.remove_all_rows_button.style.marginBottom = '3px'; @@ -4450,7 +4450,7 @@ JSONEditor.defaults.editors.multiple = JSONEditor.AbstractEditor.extend({ if(!this.editors[i]) { this.buildChildEditor(i); } - + var current_value = self.getValue(); self.type = i; @@ -4583,8 +4583,8 @@ JSONEditor.defaults.editors.multiple = JSONEditor.AbstractEditor.extend({ this.editor_holder = document.createElement('div'); container.appendChild(this.editor_holder); - - + + var validator_options = {}; if(self.jsoneditor.options.custom_validators) { validator_options.custom_validators = self.jsoneditor.options.custom_validators; @@ -4881,7 +4881,7 @@ JSONEditor.defaults.editors.select = JSONEditor.AbstractEditor.extend({ // Enum options enumerated if(this.schema["enum"]) { var display = this.schema.options && this.schema.options.enum_titles || []; - + $each(this.schema["enum"],function(i,option) { self.enum_options[i] = ""+option; self.enum_display[i] = ""+(display[i] || option); @@ -4893,20 +4893,20 @@ JSONEditor.defaults.editors.select = JSONEditor.AbstractEditor.extend({ self.enum_options.unshift('undefined'); self.enum_values.unshift(undefined); } - + } // Boolean else if(this.schema.type === "boolean") { self.enum_display = this.schema.options && this.schema.options.enum_titles || ['true','false']; self.enum_options = ['1','']; self.enum_values = [true,false]; - + if(!this.isRequired()){ self.enum_display.unshift(' '); self.enum_options.unshift('undefined'); self.enum_values.unshift(undefined); } - + } // Dynamic Enum else if(this.schema.enumSource) { @@ -4914,7 +4914,7 @@ JSONEditor.defaults.editors.select = JSONEditor.AbstractEditor.extend({ this.enum_display = []; this.enum_options = []; this.enum_values = []; - + // Shortcut declaration for using a single array if(!(Array.isArray(this.schema.enumSource))) { if(this.schema.enumValue) { @@ -4950,7 +4950,7 @@ JSONEditor.defaults.editors.select = JSONEditor.AbstractEditor.extend({ } } } - + // Now, enumSource is an array of sources // Walk through this array and fix up the values for(i=0; i 1) { var cur; func = function(vars) { @@ -7566,7 +7566,7 @@ JSONEditor.defaults.templates["default"] = function() { return vars[p]; }; } - + replacements.push({ s: matches[i], r: func @@ -7676,17 +7676,17 @@ JSONEditor.defaults.options = {}; JSONEditor.defaults.translate = function(key, variables) { var lang = JSONEditor.defaults.languages[JSONEditor.defaults.language]; if(!lang) throw "Unknown language "+JSONEditor.defaults.language; - + var string = lang[key] || JSONEditor.defaults.languages[JSONEditor.defaults.default_language][key]; - + if(typeof string === "undefined") throw "Unknown translate string "+key; - + if(variables) { for(var i=0; i 1) { editor.setValue(arguments[1]); @@ -8002,7 +7998,7 @@ JSONEditor.defaults.resolvers.unshift(function(schema) { } else if(options === 'validate') { if(!editor) throw "Must initialize jsoneditor before validating"; - + // Validate a specific value if(arguments.length > 1) { return editor.validate(arguments[1]); @@ -8023,11 +8019,11 @@ JSONEditor.defaults.resolvers.unshift(function(schema) { if(editor) { editor.destroy(); } - + // Create editor editor = new JSONEditor(this.get(0),options); this.data('jsoneditor',editor); - + // Setup event listeners editor.on('change',function() { self.trigger('change'); @@ -8036,7 +8032,7 @@ JSONEditor.defaults.resolvers.unshift(function(schema) { self.trigger('ready'); }); } - + return this; }; } @@ -8045,4 +8041,4 @@ JSONEditor.defaults.resolvers.unshift(function(schema) { window.JSONEditor = JSONEditor; })(); -//# sourceMappingURL=jsoneditor.js.map \ No newline at end of file +//# sourceMappingURL=jsoneditor.js.map diff --git a/libsrc/hyperion/hyperion.schema.json b/libsrc/hyperion/hyperion.schema.json index 1b6c8dd1..edb43841 100644 --- a/libsrc/hyperion/hyperion.schema.json +++ b/libsrc/hyperion/hyperion.schema.json @@ -7,7 +7,6 @@ { "type" : "object", "title" : "Logging", - "required": ["level"], "properties" : { "level" : @@ -66,7 +65,6 @@ "channelAdjustment_enable" : { "type" : "boolean", - "format": "checkbox", "propertyOrder" : 1 }, "channelAdjustment" : @@ -245,7 +243,6 @@ "transform_enable" : { "type" : "boolean", - "format": "checkbox", "propertyOrder" : 3 }, "transform" : @@ -376,13 +373,11 @@ { "type" : "object", "title" : "Smoothing", - "required": ["type"], "properties" : { "enable" : { "type" : "boolean", - "format": "checkbox", "title" : "Activate", "default" : true, "propertyOrder" : 1 @@ -392,7 +387,8 @@ "type" : "string", "title" : "Type", "enum" : ["linear"], - "default" : "linear" + "default" : "linear", + "propertyOrder" : 2 }, "time_ms" : { @@ -400,7 +396,8 @@ "title" : "Time", "minimum" : 25, "maximum": 600, - "default" : 200 + "default" : 200, + "propertyOrder" : 3 }, "updateFrequency" : { @@ -408,7 +405,8 @@ "title" : "Update frequency", "minimum" : 1.000, "maximum" : 100.000, - "default" : 25.000 + "default" : 25.000, + "propertyOrder" : 4 }, "updateDelay" : { @@ -416,14 +414,15 @@ "title" : "Update delay", "minimum" : 0, "maximum": 2048, - "default" : 0 + "default" : 0, + "propertyOrder" : 5 }, "continuousOutput" : { "type" : "boolean", - "format": "checkbox", "title" : "Continuous output", - "default" : true + "default" : true, + "propertyOrder" : 6 } }, "additionalProperties" : false @@ -434,13 +433,11 @@ "items": { "type" : "object", - "required": ["mode","standard"], "properties" : { "enable" : { "type" : "boolean", - "format": "checkbox", "title" : "Activate", "default" : false, "propertyOrder" : 1 @@ -449,92 +446,105 @@ { "type" : "string", "title" : "Device", - "default" : "auto" + "default" : "auto", + "propertyOrder" : 2 }, "input" : { "type" : "integer", "title" : "Input", - "default" : 0 + "default" : 0, + "propertyOrder" : 3 }, "standard" : { "type" : "string", "title" : "Video standard", "enum" : ["PAL","NTSC"], - "default" : "PAL" + "default" : "PAL", + "propertyOrder" : 4 }, "width" : { "type" : "integer", "title" : "Width", - "default" : -1 + "default" : -1, + "propertyOrder" : 5 }, "height" : { "type" : "integer", "title" : "Height", - "default" : -1 + "default" : -1, + "propertyOrder" : 6 }, "frameDecimation" : { "type" : "integer", "title" : "Frame decimation", - "default" : 2 + "default" : 2, + "propertyOrder" : 7 }, "sizeDecimation" : { "type" : "integer", "title" : "Size decimation", - "default" : 6 + "default" : 6, + "propertyOrder" : 8 }, "priority" : { "type" : "integer", "title" : "Priority channel", - "default" : 900 + "default" : 900, + "propertyOrder" : 9 }, "mode" : { "type" : "string", "title" : "Mode", "enum" : ["2D","3DSBS","3DTAB"], - "default" : "2D" + "default" : "2D", + "propertyOrder" : 10 }, "useKodiChecker" : { "type" : "boolean", - "format": "checkbox", "title" : "Use Kodi Watch", - "default" : false + "default" : false, + "propertyOrder" : 11 }, "cropLeft" : { "type" : "integer", "title" : "Crop left", "minimum" : 0, - "default" : 0 + "default" : 0, + "propertyOrder" : 12 }, "cropRight" : { "type" : "integer", "title" : "Crop right", "minimum" : 0, - "default" : 0 + "default" : 0, + "propertyOrder" : 13 }, "cropTop" : { "type" : "integer", "title" : "Crop top", "minimum" : 0, - "default" : 0 + "default" : 0, + "propertyOrder" : 14 }, "cropBottom" : { "type" : "integer", "title" : "Crop bottom", "minimum" : 0, - "default" : 0 + "default" : 0, + "propertyOrder" : 15 }, "redSignalThreshold" : { @@ -542,7 +552,8 @@ "title" : "Red signal threshold", "minimum" : 0.0, "maximum" : 1.0, - "default" : 0.1 + "default" : 0.1, + "propertyOrder" : 16 }, "greenSignalThreshold" : { @@ -550,7 +561,8 @@ "title" : "Green signal threshold", "minimum" : 0.0, "maximum" : 1.0, - "default" : 0.1 + "default" : 0.1, + "propertyOrder" : 17 }, "blueSignalThreshold" : { @@ -558,7 +570,8 @@ "title" : "Blue signal threshold", "minimum" : 0.0, "maximum" : 1.0, - "default" : 0.1 + "default" : 0.1, + "propertyOrder" : 18 } }, "additionalProperties" : false @@ -573,7 +586,6 @@ "enable" : { "type" : "boolean", - "format": "checkbox", "title" : "Activate", "default" : true, "propertyOrder" : 1 @@ -642,7 +654,6 @@ "useXGetImage" : { "type" : "boolean", - "format": "checkbox", "title" : "Use XGetImage", "default" : false }, @@ -679,14 +690,12 @@ { "type" : "object", "title" : "Blackbar detector", - "required": ["mode"], "defaultProperties": ["enable","mode","threshold"], "properties" : { "enable" : { "type" : "boolean", - "format": "checkbox", "title" : "Activate", "default" : true, "propertyOrder" : 1 @@ -697,34 +706,44 @@ "title" : "Threshold", "minimum" : 0.0, "maximum" : 1.0, - "default" : 0.05 + "default" : 0.05, + "propertyOrder" : 2 }, "unknownFrameCnt" : { - "type" : "number", - "minimum" : 0 + "type" : "integer", + "minimum" : 0, + "default" : 600, + "propertyOrder" : 3 }, "borderFrameCnt" : { - "type" : "number", - "minimum" : 0 + "type" : "integer", + "minimum" : 0, + "default" : 50, + "propertyOrder" : 4 }, "maxInconsistentCnt" : { - "type" : "number", - "minimum" : 0 + "type" : "integer", + "minimum" : 0, + "default" : 10, + "propertyOrder" : 5 }, "blurRemoveCnt" : { - "type" : "number", - "minimum" : 0 + "type" : "integer", + "minimum" : 0, + "default" : 1, + "propertyOrder" : 6 }, "mode" : { "type" : "string", "title": "Mode", "enum" : ["default", "classic", "osd"], - "default" : "default" + "default" : "default", + "propertyOrder" : 7 } }, "additionalProperties" : false @@ -738,7 +757,6 @@ "enable" : { "type" : "boolean", - "format": "checkbox", "title" : "Activate", "default" : false, "propertyOrder" : 1 @@ -747,7 +765,8 @@ { "type" : "string", "title" : "Kodi IP address", - "default" : "127.0.0.1" + "default" : "127.0.0.1", + "propertyOrder" : 2 }, "kodiTcpPort" : { @@ -755,56 +774,57 @@ "title" : "Kodi TCP port", "minimum" : 0, "maximum" : 65535, - "default" : 9090 + "default" : 9090, + "propertyOrder" : 3 }, "grabVideo" : { "type" : "boolean", - "format": "checkbox", "title" : "Video", - "default" : true + "default" : true, + "propertyOrder" : 4 }, "grabPictures" : { "type" : "boolean", - "format": "checkbox", "title" : "Pictures", - "default" : true + "default" : true, + "propertyOrder" : 5 }, "grabAudio" : { "type" : "boolean", - "format": "checkbox", "title" : "Audio", - "default" : true + "default" : true, + "propertyOrder" : 6 }, "grabMenu" : { "type" : "boolean", - "format": "checkbox", "title" : "Menu", - "default" : false + "default" : false, + "propertyOrder" : 7 }, "grabPause" : { "type" : "boolean", - "format": "checkbox", "title" : "Pause", - "default" : false + "default" : false, + "propertyOrder" : 8 }, "grabScreensaver" : { "type" : "boolean", - "format": "checkbox", "title" : "Screensaver", - "default" : false + "default" : false, + "propertyOrder" : 9 }, "enable3DDetection" : { "type" : "boolean", - "format": "checkbox", "title" : "Detect 3D", - "default" : false + "default" : false, + "propertyOrder" : 10 } }, "additionalProperties" : false @@ -857,7 +877,6 @@ "enable" : { "type" : "boolean", - "format": "checkbox", "title" : "Activate", "required" : true, "propertyOrder" : 1 @@ -865,12 +884,14 @@ "json" : { "type" : "array", - "required" : true + "required" : true, + "propertyOrder" : 2 }, "proto" : { "type" : "array", - "required" : true + "required" : true, + "propertyOrder" : 3 } }, "additionalProperties" : false @@ -922,7 +943,6 @@ "enable" : { "type" : "boolean", - "format": "checkbox", "title" : "Activate", "default" : false, "propertyOrder" : 1 @@ -933,14 +953,16 @@ "required" : true, "title" : "Port", "minimum" : 0, - "maximum" : 65535 + "maximum" : 65535, + "propertyOrder" : 2 }, "priority" : { "type" : "integer", "title" : "Priority", "minimum" : 0, - "default" : 800 + "default" : 800, + "propertyOrder" : 3 } }, "additionalProperties" : false @@ -954,7 +976,6 @@ "enable" : { "type" : "boolean", - "format": "checkbox", "title" : "Activate", "default" : false, "propertyOrder" : 1 @@ -964,7 +985,8 @@ "type" : "string", "title" : "Address", "default" : "239.255.28.01", - "required" : true + "required" : true, + "propertyOrder" : 2 }, "port" : { @@ -972,26 +994,29 @@ "title" : "Port", "minimum" : 0, "maximum" : 65535, - "default" : 2801 + "default" : 2801, + "propertyOrder" : 3 }, "priority" : { "type" : "integer", "title" : "Priority", - "default" : 800 + "default" : 800, + "propertyOrder" : 4 }, "timeout" : { "type" : "integer", "title" : "Timeout", - "default" : 10000 + "default" : 10000, + "propertyOrder" : 5 }, "shared" : { "type" : "boolean", - "format": "checkbox", "title" : "Shared", - "default" : false + "default" : false, + "propertyOrder" : 6 } }, "additionalProperties" : false @@ -1005,7 +1030,6 @@ "enable" : { "type" : "boolean", - "format": "checkbox", "title" : "Activate", "default" : true, "propertyOrder" : 1 @@ -1013,13 +1037,15 @@ "document_root" : { "type" : "string", - "title" : "Document Root" + "title" : "Document Root", + "propertyOrder" : 2 }, "port" : { "type" : "integer", "title" : "Port", - "default" : 8099 + "default" : 8099, + "propertyOrder" : 3 } }, "additionalProperties" : false @@ -1030,10 +1056,6 @@ "properties" : { "paths" : - { - "type" : "array" - }, - "disable" : { "type" : "array" } diff --git a/libsrc/leddevice/schemas/schema-adalight.json b/libsrc/leddevice/schemas/schema-adalight.json index 22e72a91..4755a475 100644 --- a/libsrc/leddevice/schemas/schema-adalight.json +++ b/libsrc/leddevice/schemas/schema-adalight.json @@ -4,17 +4,20 @@ "properties":{ "output": { "type": "string", - "title":"Output path" + "title":"Output path", + "propertyOrder" : 1 }, "rate": { "type": "integer", "title":"Baudrate", - "default": 1000000 + "default": 1000000, + "propertyOrder" : 2 }, "delayAfterConnect": { "type": "integer", "title":"Delay after connect", - "default": 250 + "default": 250, + "propertyOrder" : 3 } }, "additionalProperties": true diff --git a/libsrc/leddevice/schemas/schema-adalightapa102.json b/libsrc/leddevice/schemas/schema-adalightapa102.json index 22e72a91..4755a475 100644 --- a/libsrc/leddevice/schemas/schema-adalightapa102.json +++ b/libsrc/leddevice/schemas/schema-adalightapa102.json @@ -4,17 +4,20 @@ "properties":{ "output": { "type": "string", - "title":"Output path" + "title":"Output path", + "propertyOrder" : 1 }, "rate": { "type": "integer", "title":"Baudrate", - "default": 1000000 + "default": 1000000, + "propertyOrder" : 2 }, "delayAfterConnect": { "type": "integer", "title":"Delay after connect", - "default": 250 + "default": 250, + "propertyOrder" : 3 } }, "additionalProperties": true diff --git a/libsrc/leddevice/schemas/schema-apa102.json b/libsrc/leddevice/schemas/schema-apa102.json index a50f7e5d..29b75521 100644 --- a/libsrc/leddevice/schemas/schema-apa102.json +++ b/libsrc/leddevice/schemas/schema-apa102.json @@ -5,17 +5,22 @@ "output": { "type": "string", "title":"SPI path", - "enum" : ["/dev/spidev0.0","/dev/spidev0.1"] + "enum" : ["/dev/spidev0.0","/dev/spidev0.1"], + "default" : "/dev/spidev0.0", + "propertyOrder" : 1 }, "rate": { "type": "integer", "title":"Baudrate", - "default": 1000000 + "default": 1000000, + "propertyOrder" : 2 }, "invert": { "type": "boolean", "title":"Invert signal", - "default": false + "default": false, + "format": "checkbox", + "propertyOrder" : 3 } }, "additionalProperties": true diff --git a/libsrc/leddevice/schemas/schema-atmo.json b/libsrc/leddevice/schemas/schema-atmo.json index 22e72a91..4755a475 100644 --- a/libsrc/leddevice/schemas/schema-atmo.json +++ b/libsrc/leddevice/schemas/schema-atmo.json @@ -4,17 +4,20 @@ "properties":{ "output": { "type": "string", - "title":"Output path" + "title":"Output path", + "propertyOrder" : 1 }, "rate": { "type": "integer", "title":"Baudrate", - "default": 1000000 + "default": 1000000, + "propertyOrder" : 2 }, "delayAfterConnect": { "type": "integer", "title":"Delay after connect", - "default": 250 + "default": 250, + "propertyOrder" : 3 } }, "additionalProperties": true diff --git a/libsrc/leddevice/schemas/schema-atmoorb.json b/libsrc/leddevice/schemas/schema-atmoorb.json index 293d8764..265c4536 100644 --- a/libsrc/leddevice/schemas/schema-atmoorb.json +++ b/libsrc/leddevice/schemas/schema-atmoorb.json @@ -5,29 +5,35 @@ "output": { "type": "string", "title":"Multicast group", - "default" : "239.15.18.2" + "default" : "239.15.18.2", + "propertyOrder" : 1 }, "orbIds": { "type": "string", "title":"Baudrate", - "default": "1" + "default": "1", + "propertyOrder" : 2 }, "numLeds": { "type": "integer", "title":"Number of LEDs", - "default": 24 + "default": 24, + "propertyOrder" : 3 }, "port": { "type": "integer", "title":"Port", "minimum" : 0, "maximum" : 65535, - "default": 24 + "default": 24, + "propertyOrder" : 4 }, "useOrbSmoothing": { "type": "boolean", + "format": "checkbox", "title":"Use orb smoothing", - "default": true + "default": true, + "propertyOrder" : 5 } }, "additionalProperties": true diff --git a/libsrc/leddevice/schemas/schema-e131.json b/libsrc/leddevice/schemas/schema-e131.json index 104bd3f2..ef14834e 100644 --- a/libsrc/leddevice/schemas/schema-e131.json +++ b/libsrc/leddevice/schemas/schema-e131.json @@ -4,26 +4,31 @@ "properties":{ "host" : { "type": "string", - "title":"Target IP" + "title":"Target IP", + "propertyOrder" : 1 }, "port" : { "type": "integer", "title":"Port", - "default": 5568 + "default": 5568, + "propertyOrder" : 2 }, "universe": { "type": "integer", "title":"Universe", - "default": 1 + "default": 1, + "propertyOrder" : 3 }, - "latchtinme": { + "latchtime": { "type": "integer", "title":"Latchtime", - "default": 104000 + "default": 104000, + "propertyOrder" : 4 }, "cid": { "type": "string", - "title":"CID" + "title":"CID", + "propertyOrder" : 5 } }, "additionalProperties": true diff --git a/libsrc/leddevice/schemas/schema-lpd6803.json b/libsrc/leddevice/schemas/schema-lpd6803.json index a50f7e5d..5d2cd18d 100644 --- a/libsrc/leddevice/schemas/schema-lpd6803.json +++ b/libsrc/leddevice/schemas/schema-lpd6803.json @@ -5,17 +5,20 @@ "output": { "type": "string", "title":"SPI path", - "enum" : ["/dev/spidev0.0","/dev/spidev0.1"] + "enum" : ["/dev/spidev0.0","/dev/spidev0.1"], + "propertyOrder" : 1 }, "rate": { "type": "integer", "title":"Baudrate", - "default": 1000000 + "default": 1000000, + "propertyOrder" : 2 }, "invert": { "type": "boolean", "title":"Invert signal", - "default": false + "default": false, + "propertyOrder" : 3 } }, "additionalProperties": true diff --git a/libsrc/leddevice/schemas/schema-lpd8806.json b/libsrc/leddevice/schemas/schema-lpd8806.json index a50f7e5d..5d2cd18d 100644 --- a/libsrc/leddevice/schemas/schema-lpd8806.json +++ b/libsrc/leddevice/schemas/schema-lpd8806.json @@ -5,17 +5,20 @@ "output": { "type": "string", "title":"SPI path", - "enum" : ["/dev/spidev0.0","/dev/spidev0.1"] + "enum" : ["/dev/spidev0.0","/dev/spidev0.1"], + "propertyOrder" : 1 }, "rate": { "type": "integer", "title":"Baudrate", - "default": 1000000 + "default": 1000000, + "propertyOrder" : 2 }, "invert": { "type": "boolean", "title":"Invert signal", - "default": false + "default": false, + "propertyOrder" : 3 } }, "additionalProperties": true diff --git a/libsrc/leddevice/schemas/schema-multi-lightpack.json b/libsrc/leddevice/schemas/schema-multi-lightpack.json index 0bce7984..4834bff2 100644 --- a/libsrc/leddevice/schemas/schema-multi-lightpack.json +++ b/libsrc/leddevice/schemas/schema-multi-lightpack.json @@ -2,6 +2,10 @@ "type":"object", "required":true, "properties":{ + "output": { + "type": "string", + "title":"Serial number" + } }, "additionalProperties": true } diff --git a/libsrc/leddevice/schemas/schema-p9813.json b/libsrc/leddevice/schemas/schema-p9813.json index a50f7e5d..5d2cd18d 100644 --- a/libsrc/leddevice/schemas/schema-p9813.json +++ b/libsrc/leddevice/schemas/schema-p9813.json @@ -5,17 +5,20 @@ "output": { "type": "string", "title":"SPI path", - "enum" : ["/dev/spidev0.0","/dev/spidev0.1"] + "enum" : ["/dev/spidev0.0","/dev/spidev0.1"], + "propertyOrder" : 1 }, "rate": { "type": "integer", "title":"Baudrate", - "default": 1000000 + "default": 1000000, + "propertyOrder" : 2 }, "invert": { "type": "boolean", "title":"Invert signal", - "default": false + "default": false, + "propertyOrder" : 3 } }, "additionalProperties": true diff --git a/libsrc/leddevice/schemas/schema-paintpack.json b/libsrc/leddevice/schemas/schema-paintpack.json index b449ccb7..3b593996 100644 --- a/libsrc/leddevice/schemas/schema-paintpack.json +++ b/libsrc/leddevice/schemas/schema-paintpack.json @@ -5,17 +5,20 @@ "VID": { "type": "string", "title":"VID", - "default" : "0x2341" + "default" : "0x2341", + "propertyOrder" : 1 }, "PID": { "type": "string", "title":"PID", - "default" : "0x8036" + "default" : "0x8036", + "propertyOrder" : 2 }, "delayAfterConnect": { "type": "integer", "title":"Delay after connect", - "default": 0 + "default": 0, + "propertyOrder" : 3 } }, "additionalProperties": true diff --git a/libsrc/leddevice/schemas/schema-philipshue.json b/libsrc/leddevice/schemas/schema-philipshue.json index 2ac74497..8c48bafa 100644 --- a/libsrc/leddevice/schemas/schema-philipshue.json +++ b/libsrc/leddevice/schemas/schema-philipshue.json @@ -4,29 +4,35 @@ "properties":{ "output": { "type": "string", - "title":"Target IP" + "title":"Target IP", + "propertyOrder" : 1 }, "username": { "type": "string", "title":"Username", - "default": "newdeveloper" + "default": "newdeveloper", + "propertyOrder" : 2 }, "lightIds": { "type": "array", "title":"Light ids", - "items": { + "items" : { "type" : "integer" - } + }, + "propertyOrder" : 3 }, "transitiontime": { "type": "integer", "title":"Transistion time (x100ms)", - "default" : 1 + "default" : 1, + "propertyOrder" : 4 }, "switchOffOnBlack": { "type": "boolean", + "format": "checkbox", "title":"Switch off on black", - "default" : true + "default" : true, + "propertyOrder" : 5 } }, "additionalProperties": true diff --git a/libsrc/leddevice/schemas/schema-rawhid.json b/libsrc/leddevice/schemas/schema-rawhid.json index b449ccb7..3b593996 100644 --- a/libsrc/leddevice/schemas/schema-rawhid.json +++ b/libsrc/leddevice/schemas/schema-rawhid.json @@ -5,17 +5,20 @@ "VID": { "type": "string", "title":"VID", - "default" : "0x2341" + "default" : "0x2341", + "propertyOrder" : 1 }, "PID": { "type": "string", "title":"PID", - "default" : "0x8036" + "default" : "0x8036", + "propertyOrder" : 2 }, "delayAfterConnect": { "type": "integer", "title":"Delay after connect", - "default": 0 + "default": 0, + "propertyOrder" : 3 } }, "additionalProperties": true diff --git a/libsrc/leddevice/schemas/schema-sedu.json b/libsrc/leddevice/schemas/schema-sedu.json index 22e72a91..4755a475 100644 --- a/libsrc/leddevice/schemas/schema-sedu.json +++ b/libsrc/leddevice/schemas/schema-sedu.json @@ -4,17 +4,20 @@ "properties":{ "output": { "type": "string", - "title":"Output path" + "title":"Output path", + "propertyOrder" : 1 }, "rate": { "type": "integer", "title":"Baudrate", - "default": 1000000 + "default": 1000000, + "propertyOrder" : 2 }, "delayAfterConnect": { "type": "integer", "title":"Delay after connect", - "default": 250 + "default": 250, + "propertyOrder" : 3 } }, "additionalProperties": true diff --git a/libsrc/leddevice/schemas/schema-sk6812rgbw-spi.json b/libsrc/leddevice/schemas/schema-sk6812rgbw-spi.json index adc0ce99..cb5b2298 100644 --- a/libsrc/leddevice/schemas/schema-sk6812rgbw-spi.json +++ b/libsrc/leddevice/schemas/schema-sk6812rgbw-spi.json @@ -5,17 +5,21 @@ "output": { "type": "string", "title":"SPI path", - "enum" : ["/dev/spidev0.0","/dev/spidev0.1"] + "enum" : ["/dev/spidev0.0","/dev/spidev0.1"], + "propertyOrder" : 1 }, "rate": { "type": "integer", "title":"Baudrate", - "default": 2666666 + "default": 2666666, + "propertyOrder" : 2 }, "invert": { "type": "boolean", + "format": "checkbox", "title":"Invert signal", - "default": false + "default": false, + "propertyOrder" : 3 } }, "additionalProperties": true diff --git a/libsrc/leddevice/schemas/schema-tinkerforge.json b/libsrc/leddevice/schemas/schema-tinkerforge.json index 0bce7984..7b44495a 100644 --- a/libsrc/leddevice/schemas/schema-tinkerforge.json +++ b/libsrc/leddevice/schemas/schema-tinkerforge.json @@ -2,6 +2,31 @@ "type":"object", "required":true, "properties":{ + "output": { + "type": "string", + "title":"Output", + "default" : "127.0.0.1", + "propertyOrder" : 1 + }, + "port": { + "type": "integer", + "title":"Port", + "minimum" : 0, + "maximum" : 65535, + "default" : 4223, + "propertyOrder" : 2 + }, + "uid": { + "type": "string", + "title":"UID", + "propertyOrder" : 3 + }, + "rate": { + "type": "integer", + "title":"Intervall", + "minimum" : 0, + "propertyOrder" : 4 + } }, "additionalProperties": true } diff --git a/libsrc/leddevice/schemas/schema-tpm2.json b/libsrc/leddevice/schemas/schema-tpm2.json index 0bce7984..4755a475 100644 --- a/libsrc/leddevice/schemas/schema-tpm2.json +++ b/libsrc/leddevice/schemas/schema-tpm2.json @@ -2,6 +2,23 @@ "type":"object", "required":true, "properties":{ + "output": { + "type": "string", + "title":"Output path", + "propertyOrder" : 1 + }, + "rate": { + "type": "integer", + "title":"Baudrate", + "default": 1000000, + "propertyOrder" : 2 + }, + "delayAfterConnect": { + "type": "integer", + "title":"Delay after connect", + "default": 250, + "propertyOrder" : 3 + } }, "additionalProperties": true } diff --git a/libsrc/leddevice/schemas/schema-tpm2net.json b/libsrc/leddevice/schemas/schema-tpm2net.json index 0bce7984..f9a01219 100644 --- a/libsrc/leddevice/schemas/schema-tpm2net.json +++ b/libsrc/leddevice/schemas/schema-tpm2net.json @@ -2,6 +2,24 @@ "type":"object", "required":true, "properties":{ + "host" : { + "type": "string", + "title":"Target IP", + "propertyOrder" : 1 + }, + "latchtime": { + "type": "integer", + "title":"Latchtime", + "default": 104000, + "propertyOrder" : 2 + }, + "max-packet": { + "type": "integer", + "title":"Max-packet", + "minimum" : 0, + "default" : 170, + "propertyOrder" : 3 + } }, "additionalProperties": true } diff --git a/libsrc/leddevice/schemas/schema-udpraw.json b/libsrc/leddevice/schemas/schema-udpraw.json index 836920ec..a9da54ef 100644 --- a/libsrc/leddevice/schemas/schema-udpraw.json +++ b/libsrc/leddevice/schemas/schema-udpraw.json @@ -4,12 +4,14 @@ "properties":{ "host" : { "type": "string", - "title":"Target IP" + "title":"Target IP", + "propertyOrder" : 1 }, "port" : { "type": "integer", "title":"Port", - "default": 5568 + "default": 5568, + "propertyOrder" : 2 } }, "additionalProperties": true diff --git a/libsrc/leddevice/schemas/schema-ws2801.json b/libsrc/leddevice/schemas/schema-ws2801.json index a50f7e5d..4f36c9a0 100644 --- a/libsrc/leddevice/schemas/schema-ws2801.json +++ b/libsrc/leddevice/schemas/schema-ws2801.json @@ -5,17 +5,21 @@ "output": { "type": "string", "title":"SPI path", - "enum" : ["/dev/spidev0.0","/dev/spidev0.1"] + "enum" : ["/dev/spidev0.0","/dev/spidev0.1"], + "propertyOrder" : 1 }, "rate": { "type": "integer", "title":"Baudrate", - "default": 1000000 + "default": 1000000, + "propertyOrder" : 2 }, "invert": { "type": "boolean", + "format": "checkbox", "title":"Invert signal", - "default": false + "default": false, + "propertyOrder" : 3 } }, "additionalProperties": true diff --git a/libsrc/leddevice/schemas/schema-ws2812spi.json b/libsrc/leddevice/schemas/schema-ws2812spi.json index adc0ce99..4f36c9a0 100644 --- a/libsrc/leddevice/schemas/schema-ws2812spi.json +++ b/libsrc/leddevice/schemas/schema-ws2812spi.json @@ -5,17 +5,21 @@ "output": { "type": "string", "title":"SPI path", - "enum" : ["/dev/spidev0.0","/dev/spidev0.1"] + "enum" : ["/dev/spidev0.0","/dev/spidev0.1"], + "propertyOrder" : 1 }, "rate": { "type": "integer", "title":"Baudrate", - "default": 2666666 + "default": 1000000, + "propertyOrder" : 2 }, "invert": { "type": "boolean", + "format": "checkbox", "title":"Invert signal", - "default": false + "default": false, + "propertyOrder" : 3 } }, "additionalProperties": true