priorities rework, webc update (#366)

* update

* update

* tabs test

* update

* test

* ...

* fix editor

* update ui

* fix visual glitch if help is off

* fix fadecandy error and th

[skip ci]
This commit is contained in:
brindosch
2017-01-17 21:53:35 +01:00
committed by redPanther
parent 5b809743f7
commit 8d7137136b
75 changed files with 1713 additions and 1144 deletions

1
assets/webconfig/js/lib/dialog.min.js vendored Normal file

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
//download.js v4.2, by dandavis; 2008-2016. [CCBY2] see http://danml.com/download.html for tests/usage
(function(r,k){"function"==typeof define&&define.amd?define([],k):"object"==typeof exports?module.exports=k():r.download=k()})(this,function(){return function k(a,b,g){function q(p){var a=p.split(/[:;,]/);p=a[1];var a=("base64"==a[2]?atob:decodeURIComponent)(a.pop()),d=a.length,b=0,c=new Uint8Array(d);for(b;b<d;++b)c[b]=a.charCodeAt(b);return new f([c],{type:p})}function l(a,b){if("download"in d)return d.href=a,d.setAttribute("download",m),d.className="download-js-link",d.innerHTML="downloading...",d.style.display="none",document.body.appendChild(d),setTimeout(function(){d.click(),document.body.removeChild(d),!0===b&&setTimeout(function(){e.URL.revokeObjectURL(d.href)},250)},66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return a=a.replace(/^data:([\w\/\-\+]+)/,"application/octet-stream"),!window.open(a)&&confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=a),!0;var c=document.createElement("iframe");document.body.appendChild(c),b||(a="data:"+a.replace(/^data:([\w\/\-\+]+)/,"application/octet-stream")),c.src=a,setTimeout(function(){document.body.removeChild(c)},333)}var e=window,c=g||"application/octet-stream",h=!b&&!g&&a,d=document.createElement("a");g=function(a){return String(a)};var f=e.Blob||e.MozBlob||e.WebKitBlob||g,m=b||"download",f=f.call?f.bind(e):Blob;"true"===String(this)&&(a=[a,c],c=a[0],a=a[1]);if(h&&2048>h.length&&(m=h.split("/").pop().split("?")[0],d.href=h,-1!==d.href.indexOf(h))){var n=new XMLHttpRequest;return n.open("GET",h,!0),n.responseType="blob",n.onload=function(a){k(a.target.response,m,"application/octet-stream")},setTimeout(function(){n.send()},0),n}if(/^data\:[\w+\-]+\/[\w+\-]+[,;]/.test(a)){if(!(2096103.424<a.length&&f!==g))return navigator.msSaveBlob?navigator.msSaveBlob(q(a),m):l(a);a=q(a),c=a.type||"application/octet-stream"}b=a instanceof f?a:new f([a],{type:c});if(navigator.msSaveBlob)return navigator.msSaveBlob(b,m);if(e.URL)l(e.URL.createObjectURL(b),!0);else{if("string"==typeof b||b.constructor===g)try{return l("data:"+c+";base64,"+e.btoa(b))}catch(p){return l("data:"+c+","+encodeURIComponent(b))}c=new FileReader,c.onload=function(a){l(this.result)},c.readAsDataURL(b)}return!0}});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -232,6 +232,7 @@ JSONEditor.prototype = {
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.access = this.options.access;
this.schema = this.options.schema;
this.theme = new theme_class();
this.template = this.options.template;
@@ -322,7 +323,8 @@ JSONEditor.prototype = {
this.validation_results = null;
this.theme = null;
this.iconlib = null;
this.template = null;
this.access = null;
this.template = null;
this.__data = null;
this.ready = false;
this.element.innerHTML = '';
@@ -1418,7 +1420,8 @@ JSONEditor.AbstractEditor = Class.extend({
this.theme = this.jsoneditor.theme;
this.template_engine = this.jsoneditor.template;
this.iconlib = this.jsoneditor.iconlib;
this.access = this.jsoneditor.access;
this.translate = this.jsoneditor.translate || JSONEditor.defaults.translate;
this.original_schema = options.schema;
@@ -1458,13 +1461,12 @@ JSONEditor.AbstractEditor = Class.extend({
this.register();
this.onWatchedFieldChange();
//hide input field, if it didn't match the current access level
var storedAccess = localStorage.getItem("accesslevel");
//hide input fields, if they didn't match the current access level
var storedAccess = this.access
if(this.schema.access){
if(this.schema.access == 'system')
this.container.style.display = "none";
if(this.schema.access == 'expert' && storedAccess != 'expert'){
else if(this.schema.access == 'expert' && storedAccess != 'expert'){
this.container.style.display = "none";
//this.disable();
}
@@ -1725,7 +1727,7 @@ JSONEditor.AbstractEditor = Class.extend({
}
},
setValue: function(value) {
this.value = value;
this.value = value;
},
getValue: function() {
return this.value;
@@ -2150,7 +2152,7 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({
if(this.format) this.input.setAttribute('data-schemaformat',this.format);
if(this.defaultValue) this.input.setAttribute('data-schemaformat',this.format);
if(this.formname)this.label.setAttribute('for',this.formname);
if(this.formname && this.label)this.label.setAttribute('for',this.formname);
this.control = this.theme.getFormControl(this.label, this.input, this.description, this.append, this.placeholder);
this.container.appendChild(this.control);
@@ -2898,7 +2900,7 @@ JSONEditor.defaults.editors.object = JSONEditor.AbstractEditor.extend({
else this.showEditJSON();
},
insertPropertyControlUsingPropertyOrder: function (property, control, container) {
var propertyOrder;
var propertyOrder;
if (this.schema.properties[property])
propertyOrder = this.schema.properties[property].propertyOrder;
if (typeof propertyOrder !== "number") propertyOrder = 1000;
@@ -4842,7 +4844,7 @@ JSONEditor.defaults.editors["enum"] = JSONEditor.AbstractEditor.extend({
}
},
setValue: function(val) {
if(this.value !== val) {
if(this.value !== val) {
this.value = val;
this.refreshValue();
this.onChange();
@@ -4861,16 +4863,15 @@ JSONEditor.defaults.editors.select = JSONEditor.AbstractEditor.extend({
setValue: function(value,initial) {
value = this.typecast(value||'');
// Sanitize value before setting it
//Sanitize value before setting it
var sanitized = value;
if(this.enum_values.indexOf(sanitized) < 0) {
sanitized = this.enum_values[0];
}
if(this.value === sanitized) {
return;
return;
}
this.input.value = this.enum_options[this.enum_values.indexOf(sanitized)];
if(this.select2) this.select2.select2('val',this.input.value);
this.value = sanitized;
@@ -4909,7 +4910,7 @@ JSONEditor.defaults.editors.select = JSONEditor.AbstractEditor.extend({
}
},
getValue: function() {
return this.value;
return this.value;
},
preBuild: function() {
var self = this;

File diff suppressed because one or more lines are too long