LSP: Fix debug level 0 not sending
This commit is contained in:
parent
fb6abe27d2
commit
bd1736c7e2
2 changed files with 4 additions and 4 deletions
|
@ -26,7 +26,7 @@ f.submenu[e]))}else if("hiddenmenu"in f)for(e in o=$("<span>").addClass("hiddenm
|
||||||
a)},findOutput:function(a){return this.findInOutput("connectors",a)},findInOutput:function(a,c){if("capabilities"in mist.data){var d=!1,b=mist.data.capabilities[a];c in b&&(d=b[c]);c+".exe"in b&&(d=b[c+".exe"]);return d}throw"Request capabilities first";},buildUI:function(a){var c=$("<div>").addClass("input_container"),d;for(d in a){var b=a[d];if(b instanceof jQuery)c.append(b);else if("help"==b.type){var f=$("<span>").addClass("text_container").append($("<span>").addClass("description").append(b.help));
|
a)},findOutput:function(a){return this.findInOutput("connectors",a)},findInOutput:function(a,c){if("capabilities"in mist.data){var d=!1,b=mist.data.capabilities[a];c in b&&(d=b[c]);c+".exe"in b&&(d=b[c+".exe"]);return d}throw"Request capabilities first";},buildUI:function(a){var c=$("<div>").addClass("input_container"),d;for(d in a){var b=a[d];if(b instanceof jQuery)c.append(b);else if("help"==b.type){var f=$("<span>").addClass("text_container").append($("<span>").addClass("description").append(b.help));
|
||||||
c.append(f);if("classes"in b)for(var n in b.classes)f.addClass(b.classes[n])}else if("text"==b.type)c.append($("<span>").addClass("text_container").append($("<span>").addClass("text").append(b.text)));else if("custom"==b.type)c.append(b.custom);else if("buttons"==b.type)for(n in f=$("<span>").addClass("button_container").on("keydown",function(a){a.stopPropagation()}),"css"in b&&f.css(b.css),c.append(f),b.buttons){var o=b.buttons[n],e=$("<button>").text(o.label).data("opts",o);"css"in o&&e.css(o.css);
|
c.append(f);if("classes"in b)for(var n in b.classes)f.addClass(b.classes[n])}else if("text"==b.type)c.append($("<span>").addClass("text_container").append($("<span>").addClass("text").append(b.text)));else if("custom"==b.type)c.append(b.custom);else if("buttons"==b.type)for(n in f=$("<span>").addClass("button_container").on("keydown",function(a){a.stopPropagation()}),"css"in b&&f.css(b.css),c.append(f),b.buttons){var o=b.buttons[n],e=$("<button>").text(o.label).data("opts",o);"css"in o&&e.css(o.css);
|
||||||
if("classes"in o)for(var r in o.classes)e.addClass(o.classes[r]);f.append(e);switch(o.type){case "cancel":e.addClass("cancel").click(o["function"]);break;case "save":e.addClass("save").click(function(){var a=$(this).data("opts").preSave;a&&a.call(this);var b=$(this).closest(".input_container"),c=!1;b.find('.hasValidate:visible, input[type="hidden"].hasValidate').each(function(){if(c=$(this).data("validate")(this,!0))return!1});(a=$(this).data("opts").failedValidate)&&a.call(this);c||(b.find('.isSetting:visible, input[type="hidden"].isSetting').each(function(){var a=
|
if("classes"in o)for(var r in o.classes)e.addClass(o.classes[r]);f.append(e);switch(o.type){case "cancel":e.addClass("cancel").click(o["function"]);break;case "save":e.addClass("save").click(function(){var a=$(this).data("opts").preSave;a&&a.call(this);var b=$(this).closest(".input_container"),c=!1;b.find('.hasValidate:visible, input[type="hidden"].hasValidate').each(function(){if(c=$(this).data("validate")(this,!0))return!1});(a=$(this).data("opts").failedValidate)&&a.call(this);c||(b.find('.isSetting:visible, input[type="hidden"].isSetting').each(function(){var a=
|
||||||
$(this).getval(),b=$(this).data("pointer");if(""==a)if("default"in $(this).data("opts"))a=$(this).data("opts")["default"];else return b.main[b.index]=null,!0;b.main[b.index]=a}),(a=$(this).data("opts")["function"])&&a(this))});break;default:e.click(o["function"])}}else{o=$("<label>").addClass("UIelement");c.append(o);"css"in b&&o.css(b.css);o.append($("<span>").addClass("label").html("label"in b?b.label+":":""));if("classes"in b)for(r in b.classes)o.addClass(b.classes[r]);e=$("<span>").addClass("field_container");
|
$(this).getval(),b=$(this).data("pointer");if(""===a)if("default"in $(this).data("opts"))a=$(this).data("opts")["default"];else return b.main[b.index]=null,!0;b.main[b.index]=a}),(a=$(this).data("opts")["function"])&&a(this))});break;default:e.click(o["function"])}}else{o=$("<label>").addClass("UIelement");c.append(o);"css"in b&&o.css(b.css);o.append($("<span>").addClass("label").html("label"in b?b.label+":":""));if("classes"in b)for(r in b.classes)o.addClass(b.classes[r]);e=$("<span>").addClass("field_container");
|
||||||
o.append(e);switch(b.type){case "password":f=$("<input>").attr("type","password");break;case "int":f=$("<input>").attr("type","number");"min"in b&&f.attr("min",b.min);"max"in b&&f.attr("max",b.max);"validate"in b?b.validate.push("int"):b.validate=["int"];break;case "span":f=$("<span>");break;case "debug":b.select=[["","Default"],[0,"0 - All debugging messages disabled"],[1,"1 - Messages about failed operations"],[2,"2 - Previous level, and error messages"],[3,"3 - Previous level, and warning messages"],
|
o.append(e);switch(b.type){case "password":f=$("<input>").attr("type","password");break;case "int":f=$("<input>").attr("type","number");"min"in b&&f.attr("min",b.min);"max"in b&&f.attr("max",b.max);"validate"in b?b.validate.push("int"):b.validate=["int"];break;case "span":f=$("<span>");break;case "debug":b.select=[["","Default"],[0,"0 - All debugging messages disabled"],[1,"1 - Messages about failed operations"],[2,"2 - Previous level, and error messages"],[3,"3 - Previous level, and warning messages"],
|
||||||
[4,"4 - Previous level, and status messages for development"],[5,"5 - Previous level, and more status messages for development"],[6,"6 - Previous level, and verbose debugging messages"],[7,"7 - Previous level, and very verbose debugging messages"],[8,"8 - Report everything in extreme detail"],[9,"9 - Report everything in insane detail"],[10,"10 - All messages enabled"]];case "select":f=$("<select>");for(n in b.select){var i=$("<option>");"string"==typeof b.select[n]?i.text(b.select[n]):i.val(b.select[n][0]).text(b.select[n][1]);
|
[4,"4 - Previous level, and status messages for development"],[5,"5 - Previous level, and more status messages for development"],[6,"6 - Previous level, and verbose debugging messages"],[7,"7 - Previous level, and very verbose debugging messages"],[8,"8 - Report everything in extreme detail"],[9,"9 - Report everything in insane detail"],[10,"10 - All messages enabled"]];case "select":f=$("<select>");for(n in b.select){var i=$("<option>");"string"==typeof b.select[n]?i.text(b.select[n]):i.val(b.select[n][0]).text(b.select[n][1]);
|
||||||
f.append(i)}break;case "textarea":f=$("<textarea>").on("keydown",function(a){a.stopPropagation()});break;case "checkbox":f=$("<input>").attr("type","checkbox");break;case "hidden":f=$("<input>").attr("type","hidden");o.hide();break;case "email":f=$("<input>").attr("type","email").attr("autocomplete","on").attr("required","");break;case "browse":f=$("<input>").attr("type","text");"filetypes"in b&&f.data("filetypes",b.filetypes);break;case "geolimited":case "hostlimited":f=$("<input>").attr("type",
|
f.append(i)}break;case "textarea":f=$("<textarea>").on("keydown",function(a){a.stopPropagation()});break;case "checkbox":f=$("<input>").attr("type","checkbox");break;case "hidden":f=$("<input>").attr("type","hidden");o.hide();break;case "email":f=$("<input>").attr("type","email").attr("autocomplete","on").attr("required","");break;case "browse":f=$("<input>").attr("type","text");"filetypes"in b&&f.data("filetypes",b.filetypes);break;case "geolimited":case "hostlimited":f=$("<input>").attr("type",
|
||||||
|
@ -230,7 +230,7 @@ b+'~="'+$(this).getval()+'"]) { display: none; }\n';$(c).data("content",c.innerH
|
||||||
a&&b.push({type:"help",help:a.desc});if("sort"in a){var n=[],o;for(o in f)if(a[f[o]])for(var e in a[f[o]]){var r=a[f[o]][e];if(Array.isArray(r))for(var i in r){if(!("validate"in r[i]))r[i].validate=[];r[i].validate=f[o];r[i].id=e;n.push(r[i])}else{if(!("validate"in r))r.validate=[];r.validate.push(f[o]);r.id=e;n.push(r)}}n.sort(function(b,c){return(""+b[a.sort]).localeCompare(c[a.sort])});for(e in n){r=n[e];b.push(d(r.validate,r.id,r))}}else for(o in f)if(a[f[o]]){b.push($("<h4>").text(UI.format.capital(f[o])+
|
a&&b.push({type:"help",help:a.desc});if("sort"in a){var n=[],o;for(o in f)if(a[f[o]])for(var e in a[f[o]]){var r=a[f[o]][e];if(Array.isArray(r))for(var i in r){if(!("validate"in r[i]))r[i].validate=[];r[i].validate=f[o];r[i].id=e;n.push(r[i])}else{if(!("validate"in r))r.validate=[];r.validate.push(f[o]);r.id=e;n.push(r)}}n.sort(function(b,c){return(""+b[a.sort]).localeCompare(c[a.sort])});for(e in n){r=n[e];b.push(d(r.validate,r.id,r))}}else for(o in f)if(a[f[o]]){b.push($("<h4>").text(UI.format.capital(f[o])+
|
||||||
" parameters"));for(e in a[f[o]]){r=a[f[o]][e];if(Array.isArray(r))for(i in r)b.push(d(o,e,r[i]));else b.push(d(o,e,r))}}return b},stored:{get:function(){return mist.data.ui_settings||{}},set:function(a,c){var d=this.get();d[a]=c;mist.send(function(){},{ui_settings:d})},del:function(a){delete mist.data.ui_settings[a];mist.send(function(){},{ui_settings:mist.data.ui_settings})}}};
|
" parameters"));for(e in a[f[o]]){r=a[f[o]][e];if(Array.isArray(r))for(i in r)b.push(d(o,e,r[i]));else b.push(d(o,e,r))}}return b},stored:{get:function(){return mist.data.ui_settings||{}},set:function(a,c){var d=this.get();d[a]=c;mist.send(function(){},{ui_settings:d})},del:function(a){delete mist.data.ui_settings[a];mist.send(function(){},{ui_settings:mist.data.ui_settings})}}};
|
||||||
function log(){try{UI.debug&&[].push.call(arguments,Error().stack);[].unshift.call(arguments,"["+UI.format.time((new Date).getTime()/1E3)+"]");console.log.apply(console,arguments)}catch(a){}}
|
function log(){try{UI.debug&&[].push.call(arguments,Error().stack);[].unshift.call(arguments,"["+UI.format.time((new Date).getTime()/1E3)+"]");console.log.apply(console,arguments)}catch(a){}}
|
||||||
$.fn.getval=function(){var a=$(this).data("opts"),c=$(this).val();if(a&&"type"in a)switch(a.type){case "span":c=$(this).html();break;case "debug":c=Number($(this).val());break;case "checkbox":c=$(this).prop("checked");break;case "radioselect":a=$(this).find("label > input[type=radio]:checked").parent();if(a.length){c=[];c.push(a.children("input[type=radio]").val());a=a.children("select");a.length&&c.push(a.val())}else c="";break;case "checklist":c=[];$(this).find(".checklist input[type=checkbox]:checked").each(function(){c.push($(this).attr("name"))});
|
$.fn.getval=function(){var a=$(this).data("opts"),c=$(this).val();if(a&&"type"in a)switch(a.type){case "span":c=$(this).html();break;case "debug":c=$(this).val()==""?null:Number($(this).val());break;case "checkbox":c=$(this).prop("checked");break;case "radioselect":a=$(this).find("label > input[type=radio]:checked").parent();if(a.length){c=[];c.push(a.children("input[type=radio]").val());a=a.children("select");a.length&&c.push(a.val())}else c="";break;case "checklist":c=[];$(this).find(".checklist input[type=checkbox]:checked").each(function(){c.push($(this).attr("name"))});
|
||||||
break;case "unix":c!=""&&(c=Math.round(new Date($(this).val())/1E3));break;case "selectinput":c=$(this).children("select").first().val();c=="CUSTOM"&&(c=$(this).children("label").first().find(".field_container").children().first().getval());break;case "inputlist":c=[];$(this).children().each(function(){$(this).val()!=""&&c.push($(this).val())});break;case "sublist":c=$(this).data("savelist")}return c};
|
break;case "unix":c!=""&&(c=Math.round(new Date($(this).val())/1E3));break;case "selectinput":c=$(this).children("select").first().val();c=="CUSTOM"&&(c=$(this).children("label").first().find(".field_container").children().first().getval());break;case "inputlist":c=[];$(this).children().each(function(){$(this).val()!=""&&c.push($(this).val())});break;case "sublist":c=$(this).data("savelist")}return c};
|
||||||
$.fn.setval=function(a){var c=$(this).data("opts");$(this).val(a);if(c&&"type"in c)switch(c.type){case "span":$(this).html(a);break;case "checkbox":$(this).prop("checked",a);break;case "geolimited":case "hostlimited":c=$(this).closest(".field_container").data("subUI");if(typeof a=="undefined"||a.length==0)a="-";c.blackwhite.val(a.charAt(0));var a=a.substr(1).split(" "),d;for(d in a)c.values.append(c.prototype.clone(true).val(a[d]));c.blackwhite.trigger("change");break;case "radioselect":if(typeof a==
|
$.fn.setval=function(a){var c=$(this).data("opts");$(this).val(a);if(c&&"type"in c)switch(c.type){case "span":$(this).html(a);break;case "checkbox":$(this).prop("checked",a);break;case "geolimited":case "hostlimited":c=$(this).closest(".field_container").data("subUI");if(typeof a=="undefined"||a.length==0)a="-";c.blackwhite.val(a.charAt(0));var a=a.substr(1).split(" "),d;for(d in a)c.values.append(c.prototype.clone(true).val(a[d]));c.blackwhite.trigger("change");break;case "radioselect":if(typeof a==
|
||||||
"undefined")return $(this);d=$(this).find('label > input[type=radio][value="'+a[0]+'"]').prop("checked",true).parent();a.length>1&&d.children("select").val(a[1]);break;case "checklist":c=$(this).find(".checklist input[type=checkbox]").prop("checked",false);for(d in a)c.filter('[name="'+a[d]+'"]').prop("checked",true);break;case "unix":if(typeof a!="undefined"){a=new Date(Math.round(a)*1E3);a.setMinutes(a.getMinutes()-a.getTimezoneOffset());a=a.toISOString();$(this).val(a.split("Z")[0])}break;case "selectinput":a===
|
"undefined")return $(this);d=$(this).find('label > input[type=radio][value="'+a[0]+'"]').prop("checked",true).parent();a.length>1&&d.children("select").val(a[1]);break;case "checklist":c=$(this).find(".checklist input[type=checkbox]").prop("checked",false);for(d in a)c.filter('[name="'+a[d]+'"]').prop("checked",true);break;case "unix":if(typeof a!="undefined"){a=new Date(Math.round(a)*1E3);a.setMinutes(a.getMinutes()-a.getTimezoneOffset());a=a.toISOString();$(this).val(a.split("Z")[0])}break;case "selectinput":a===
|
||||||
|
|
|
@ -468,7 +468,7 @@ var UI = {
|
||||||
var val = $(this).getval();
|
var val = $(this).getval();
|
||||||
var pointer = $(this).data('pointer');
|
var pointer = $(this).data('pointer');
|
||||||
|
|
||||||
if (val == '') {
|
if (val === '') {
|
||||||
if ('default' in $(this).data('opts')) {
|
if ('default' in $(this).data('opts')) {
|
||||||
val = $(this).data('opts')['default'];
|
val = $(this).data('opts')['default'];
|
||||||
}
|
}
|
||||||
|
@ -6888,7 +6888,7 @@ $.fn.getval = function(){
|
||||||
val = $(this).html();
|
val = $(this).html();
|
||||||
break;
|
break;
|
||||||
case 'debug':
|
case 'debug':
|
||||||
val = Number($(this).val());
|
val = $(this).val() == "" ? null : Number($(this).val());
|
||||||
break;
|
break;
|
||||||
case 'checkbox':
|
case 'checkbox':
|
||||||
val = $(this).prop('checked');
|
val = $(this).prop('checked');
|
||||||
|
|
Loading…
Add table
Reference in a new issue