mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2023-10-10 13:36:59 +02:00
Allow editor-validation for enum-lists
This commit is contained in:
parent
561fabeba6
commit
184cfb1e72
@ -421,8 +421,8 @@ $(document).ready(function () {
|
|||||||
// translate
|
// translate
|
||||||
performTranslation();
|
performTranslation();
|
||||||
|
|
||||||
// update instance listing
|
// update instance listing
|
||||||
updateHyperionInstanceListing();
|
updateHyperionInstanceListing();
|
||||||
|
|
||||||
//add intros
|
//add intros
|
||||||
if (window.showOptHelp) {
|
if (window.showOptHelp) {
|
||||||
@ -561,21 +561,21 @@ $(document).ready(function () {
|
|||||||
toggleClass('#leds_prev_toggle_num', "btn-danger", "btn-success");
|
toggleClass('#leds_prev_toggle_num', "btn-danger", "btn-success");
|
||||||
});
|
});
|
||||||
|
|
||||||
// toggle live video
|
// toggle live video
|
||||||
$('#leds_prev_toggle_live_video').off().on("click", function() {
|
$('#leds_prev_toggle_live_video').off().on("click", function() {
|
||||||
setClassByBool('#leds_prev_toggle_live_video', window.imageStreamActive, "btn-success", "btn-danger");
|
setClassByBool('#leds_prev_toggle_live_video', window.imageStreamActive, "btn-success", "btn-danger");
|
||||||
if (window.imageStreamActive)
|
if (window.imageStreamActive)
|
||||||
{
|
{
|
||||||
requestLedImageStop();
|
requestLedImageStop();
|
||||||
imageCanvasNodeCtx.clear();
|
imageCanvasNodeCtx.clear();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
requestLedImageStart();
|
requestLedImageStart();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$(window.hyperion).on("cmd-ledcolors-imagestream-update",function(event){
|
$(window.hyperion).on("cmd-ledcolors-imagestream-update",function(event){
|
||||||
setClassByBool('#leds_prev_toggle_live_video', window.imageStreamActive, "btn-danger", "btn-success");
|
setClassByBool('#leds_prev_toggle_live_video', window.imageStreamActive, "btn-danger", "btn-success");
|
||||||
var imageData = (event.response.result.image);
|
var imageData = (event.response.result.image);
|
||||||
|
|
||||||
@ -584,7 +584,7 @@ $(document).ready(function () {
|
|||||||
imageCanvasNodeCtx.drawImage(image, 0, 0, imageCanvasNodeCtx.canvas.width, imageCanvasNodeCtx.canvas.height);
|
imageCanvasNodeCtx.drawImage(image, 0, 0, imageCanvasNodeCtx.canvas.width, imageCanvasNodeCtx.canvas.height);
|
||||||
};
|
};
|
||||||
image.src = imageData;
|
image.src = imageData;
|
||||||
});
|
});
|
||||||
|
|
||||||
// open checklist
|
// open checklist
|
||||||
$('#leds_prev_checklist').off().on("click", function () {
|
$('#leds_prev_checklist').off().on("click", function () {
|
||||||
@ -831,28 +831,30 @@ $(document).ready(function () {
|
|||||||
canSave = true;
|
canSave = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canIdentify) {
|
if (!conf_editor.validate().length) {
|
||||||
$("#btn_test_controller").removeClass('hidden');
|
|
||||||
$('#btn_test_controller').attr('disabled', false);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
$('#btn_test_controller').attr('disabled', true);
|
|
||||||
}
|
|
||||||
|
|
||||||
var hardwareLedCount = conf_editor.getEditor("root.generalOptions.hardwareLedCount").getValue();
|
if (canIdentify) {
|
||||||
if (hardwareLedCount < 1) {
|
$("#btn_test_controller").removeClass('hidden');
|
||||||
canSave = false;
|
$('#btn_test_controller').attr('disabled', false);
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$('#btn_test_controller').attr('disabled', true);
|
||||||
|
}
|
||||||
|
|
||||||
if (canSave) {
|
var hardwareLedCount = conf_editor.getEditor("root.generalOptions.hardwareLedCount").getValue();
|
||||||
if (!window.readOnlyMode) {
|
if (hardwareLedCount < 1) {
|
||||||
$('#btn_submit_controller').attr('disabled', false);
|
canSave = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (canSave) {
|
||||||
|
if (!window.readOnlyMode) {
|
||||||
|
$('#btn_submit_controller').attr('disabled', false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$('#btn_submit_controller').attr('disabled', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
$('#btn_submit_controller').attr('disabled', true);
|
|
||||||
}
|
|
||||||
|
|
||||||
window.readOnlyMode ? $('#btn_cl_save').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
window.readOnlyMode ? $('#btn_cl_save').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||||
window.readOnlyMode ? $('#btn_ma_save').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
window.readOnlyMode ? $('#btn_ma_save').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||||
window.readOnlyMode ? $('#leds_custom_save').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
window.readOnlyMode ? $('#leds_custom_save').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||||
|
@ -1839,7 +1839,7 @@ JSONEditor.AbstractEditor = Class.extend({
|
|||||||
this.parent = null;
|
this.parent = null;
|
||||||
},
|
},
|
||||||
getDefault: function() {
|
getDefault: function() {
|
||||||
if(this.schema["default"]) return this.schema["default"];
|
if(this.schema["default"]) return $.i18n(this.schema["default"]);
|
||||||
if(this.schema["enum"]) return this.schema["enum"][0];
|
if(this.schema["enum"]) return this.schema["enum"][0];
|
||||||
|
|
||||||
var type = this.schema.type || this.schema.oneOf;
|
var type = this.schema.type || this.schema.oneOf;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"available_devices": {
|
"available_devices": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "edt_conf_grabber_discovered_title",
|
"title": "edt_conf_grabber_discovered_title",
|
||||||
"default": "NONE",
|
"default": "edt_conf_grabber_discovery_inprogress",
|
||||||
"options": {
|
"options": {
|
||||||
"infoText": "edt_conf_grabber_discovered_title_info"
|
"infoText": "edt_conf_grabber_discovered_title_info"
|
||||||
},
|
},
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
"available_devices": {
|
"available_devices": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "edt_conf_grabber_discovered_title",
|
"title": "edt_conf_grabber_discovered_title",
|
||||||
"default": "NONE",
|
"default": "edt_conf_grabber_discovery_inprogress",
|
||||||
"options": {
|
"options": {
|
||||||
"infoText": "edt_conf_grabber_discovered_title_info"
|
"infoText": "edt_conf_grabber_discovered_title_info"
|
||||||
},
|
},
|
||||||
|
@ -5,9 +5,8 @@
|
|||||||
"hostList": {
|
"hostList": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "edt_dev_spec_devices_discovered_title",
|
"title": "edt_dev_spec_devices_discovered_title",
|
||||||
"enum": [ "NONE" ],
|
"default": "edt_dev_spec_devices_discovery_inprogress",
|
||||||
"options": {
|
"options": {
|
||||||
"enum_titles": [ "edt_dev_spec_devices_discovery_inprogress" ],
|
|
||||||
"infoText": "edt_dev_spec_devices_discovered_title_info"
|
"infoText": "edt_dev_spec_devices_discovered_title_info"
|
||||||
},
|
},
|
||||||
"required": true,
|
"required": true,
|
||||||
|
@ -5,9 +5,8 @@
|
|||||||
"hostList": {
|
"hostList": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "edt_dev_spec_devices_discovered_title",
|
"title": "edt_dev_spec_devices_discovered_title",
|
||||||
"enum": [ "NONE" ],
|
"default": "edt_dev_spec_devices_discovery_inprogress",
|
||||||
"options": {
|
"options": {
|
||||||
"enum_titles": [ "edt_dev_spec_devices_discovery_inprogress" ],
|
|
||||||
"infoText": "edt_dev_spec_devices_discovered_title_info"
|
"infoText": "edt_dev_spec_devices_discovered_title_info"
|
||||||
},
|
},
|
||||||
"required": true,
|
"required": true,
|
||||||
|
@ -6,9 +6,8 @@
|
|||||||
"hostList": {
|
"hostList": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"title": "edt_dev_spec_devices_discovered_title",
|
"title": "edt_dev_spec_devices_discovered_title",
|
||||||
"enum": [ "NONE" ],
|
"default": "edt_dev_spec_devices_discovery_inprogress",
|
||||||
"options": {
|
"options": {
|
||||||
"enum_titles": [ "edt_dev_spec_devices_discovery_inprogress" ],
|
|
||||||
"infoText": "edt_dev_spec_devices_discovered_title_info"
|
"infoText": "edt_dev_spec_devices_discovered_title_info"
|
||||||
},
|
},
|
||||||
"required": true,
|
"required": true,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user