mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
Update UI JS Libraries (#1441)
* Update Gijgo to 1.9.13 * Update DOMPurify 2.3.6 * Update Marked 4.0.12 * Update metismenu 3.0.7 * Issue Update Priority, if first LED changes for COLOR update (to reflect color correctly in UI) * Add Yeelight W3 MultiColor * Update to jquery 3.6.0
This commit is contained in:
@@ -482,7 +482,7 @@ $(document).ready(function () {
|
||||
$('#leds_wl').append('<p style="font-weight:bold">' + $.i18n('general_wiki_moreto', $.i18n('conf_leds_nav_label_ledlayout')) + buildWL("user/advanced/Advanced.html#led-layout", "Wiki") + '</p>');
|
||||
|
||||
// bind change event to all inputs
|
||||
$('.ledCLconstr').bind("change", function () {
|
||||
$('.ledCLconstr').on("change", function () {
|
||||
|
||||
//Ensure Values are in min/max ranges
|
||||
if ($(this).val() < $(this).attr('min') * 1) { $(this).val($(this).attr('min')); }
|
||||
@@ -543,7 +543,7 @@ $(document).ready(function () {
|
||||
createClassicLeds();
|
||||
});
|
||||
|
||||
$('.ledMAconstr').bind("change", function () {
|
||||
$('.ledMAconstr').on("change", function () {
|
||||
valValue(this.id, this.value, this.min, this.max);
|
||||
createMatrixLeds();
|
||||
});
|
||||
@@ -587,16 +587,16 @@ $(document).ready(function () {
|
||||
}
|
||||
|
||||
if (success) {
|
||||
$('#leds_custom_updsim').attr("disabled", false);
|
||||
$('#leds_custom_save').attr("disabled", false);
|
||||
$('#leds_custom_updsim').prop("disabled", false);
|
||||
$('#leds_custom_save').prop("disabled", false);
|
||||
}
|
||||
else {
|
||||
$('#leds_custom_updsim').attr("disabled", true);
|
||||
$('#leds_custom_save').attr("disabled", true);
|
||||
$('#leds_custom_updsim').prop("disabled", true);
|
||||
$('#leds_custom_save').prop("disabled", true);
|
||||
}
|
||||
|
||||
if (window.readOnlyMode) {
|
||||
$('#leds_custom_save').attr('disabled', true);
|
||||
$('#leds_custom_save').prop('disabled', true);
|
||||
}
|
||||
}
|
||||
}, finalLedArray);
|
||||
@@ -604,8 +604,8 @@ $(document).ready(function () {
|
||||
//TODO: HACK! No callback for schema validation - Add it!
|
||||
setInterval(function () {
|
||||
if ($('#aceedit table').hasClass('jsoneditor-text-errors')) {
|
||||
$('#leds_custom_updsim').attr("disabled", true);
|
||||
$('#leds_custom_save').attr("disabled", true);
|
||||
$('#leds_custom_updsim').prop("disabled", true);
|
||||
$('#leds_custom_save').prop("disabled", true);
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
@@ -701,7 +701,7 @@ $(document).ready(function () {
|
||||
}
|
||||
|
||||
// change save button state based on validation result
|
||||
blacklist_editor.validate().length || window.readOnlyMode ? $('#btn_bl_save').attr('disabled', true) : $('#btn_bl_save').attr('disabled', false);
|
||||
blacklist_editor.validate().length || window.readOnlyMode ? $('#btn_bl_save').prop('disabled', true) : $('#btn_bl_save').prop('disabled', false);
|
||||
});
|
||||
|
||||
});
|
||||
@@ -751,14 +751,14 @@ $(document).ready(function () {
|
||||
$("#info_container_text").html(infoTextDefault);
|
||||
|
||||
// change save button state based on validation result
|
||||
conf_editor.validate().length || window.readOnlyMode ? $('#btn_submit_controller').attr('disabled', true) : $('#btn_submit_controller').attr('disabled', false);
|
||||
conf_editor.validate().length || window.readOnlyMode ? $('#btn_submit_controller').prop('disabled', true) : $('#btn_submit_controller').prop('disabled', false);
|
||||
|
||||
// led controller sepecific wizards
|
||||
$('#btn_wiz_holder').html("");
|
||||
$('#btn_led_device_wiz').off();
|
||||
|
||||
if (ledType == "philipshue") {
|
||||
$('#root_specificOptions_useEntertainmentAPI').bind("change", function () {
|
||||
$('#root_specificOptions_useEntertainmentAPI').on("change", function () {
|
||||
var ledWizardType = (this.checked) ? "philipshueentertainment" : ledType;
|
||||
var data = { type: ledWizardType };
|
||||
var hue_title = (this.checked) ? 'wiz_hue_e_title' : 'wiz_hue_title';
|
||||
@@ -936,10 +936,10 @@ $(document).ready(function () {
|
||||
if (!conf_editor.validate().length) {
|
||||
if (canIdentify) {
|
||||
$("#btn_test_controller").show();
|
||||
$('#btn_test_controller').attr('disabled', false);
|
||||
$('#btn_test_controller').prop('disabled', false);
|
||||
} else {
|
||||
$('#btn_test_controller').hide();
|
||||
$('#btn_test_controller').attr('disabled', true);
|
||||
$('#btn_test_controller').prop('disabled', true);
|
||||
}
|
||||
} else {
|
||||
canSave = false;
|
||||
@@ -947,16 +947,16 @@ $(document).ready(function () {
|
||||
|
||||
if (canSave) {
|
||||
if (!window.readOnlyMode) {
|
||||
$('#btn_submit_controller').attr('disabled', false);
|
||||
$('#btn_submit_controller').prop('disabled', false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
$('#btn_submit_controller').attr('disabled', true);
|
||||
$('#btn_submit_controller').prop('disabled', true);
|
||||
}
|
||||
|
||||
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 ? $('#leds_custom_save').attr('disabled', true) : $('#btn_submit').attr('disabled', false);
|
||||
window.readOnlyMode ? $('#btn_cl_save').prop('disabled', true) : $('#btn_submit').prop('disabled', false);
|
||||
window.readOnlyMode ? $('#btn_ma_save').prop('disabled', true) : $('#btn_submit').prop('disabled', false);
|
||||
window.readOnlyMode ? $('#leds_custom_save').prop('disabled', true) : $('#btn_submit').prop('disabled', false);
|
||||
});
|
||||
|
||||
conf_editor.watch('root.specificOptions.hostList', () => {
|
||||
@@ -1040,8 +1040,8 @@ $(document).ready(function () {
|
||||
var output = conf_editor.getEditor("root.specificOptions.output").getValue();
|
||||
if (output === "NONE" || output === "SELECT" || output === "") {
|
||||
|
||||
$('#btn_submit_controller').attr('disabled', true);
|
||||
$('#btn_test_controller').attr('disabled', true);
|
||||
$('#btn_submit_controller').prop('disabled', true);
|
||||
$('#btn_test_controller').prop('disabled', true);
|
||||
$('#btn_test_controller').hide();
|
||||
|
||||
conf_editor.getEditor("root.generalOptions.hardwareLedCount").setValue(1);
|
||||
@@ -1080,13 +1080,13 @@ $(document).ready(function () {
|
||||
if (!conf_editor.validate().length) {
|
||||
if (canIdentify) {
|
||||
$("#btn_test_controller").show();
|
||||
$('#btn_test_controller').attr('disabled', false);
|
||||
$('#btn_test_controller').prop('disabled', false);
|
||||
} else {
|
||||
$('#btn_test_controller').hide();
|
||||
$('#btn_test_controller').attr('disabled', true);
|
||||
$('#btn_test_controller').prop('disabled', true);
|
||||
}
|
||||
if (!window.readOnlyMode) {
|
||||
$('#btn_submit_controller').attr('disabled', false);
|
||||
$('#btn_submit_controller').prop('disabled', false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1522,7 +1522,7 @@ var updateSelectList = function (ledType, discoveryInfo) {
|
||||
if (discoveryInfo.devices.length == 0) {
|
||||
enumVals.push("NONE");
|
||||
enumTitelVals.push($.i18n('edt_dev_spec_devices_discovered_none'));
|
||||
$('#btn_submit_controller').attr('disabled', true);
|
||||
$('#btn_submit_controller').prop('disabled', true);
|
||||
showAllDeviceInputOptions(key, false);
|
||||
}
|
||||
else {
|
||||
@@ -1564,7 +1564,7 @@ var updateSelectList = function (ledType, discoveryInfo) {
|
||||
if (discoveryInfo.devices.length == 0) {
|
||||
enumVals.push("NONE");
|
||||
enumTitelVals.push($.i18n('edt_dev_spec_devices_discovered_none'));
|
||||
$('#btn_submit_controller').attr('disabled', true);
|
||||
$('#btn_submit_controller').prop('disabled', true);
|
||||
showAllDeviceInputOptions(key, false);
|
||||
}
|
||||
else {
|
||||
@@ -1606,7 +1606,7 @@ var updateSelectList = function (ledType, discoveryInfo) {
|
||||
if (discoveryInfo.devices.length == 0) {
|
||||
enumVals.push("NONE");
|
||||
enumTitelVals.push($.i18n('edt_dev_spec_devices_discovered_none'));
|
||||
$('#btn_submit_controller').attr('disabled', true);
|
||||
$('#btn_submit_controller').prop('disabled', true);
|
||||
showAllDeviceInputOptions(key, false);
|
||||
|
||||
$("#info_container_text").html($.i18n("conf_leds_info_ws281x"));
|
||||
@@ -1622,7 +1622,7 @@ var updateSelectList = function (ledType, discoveryInfo) {
|
||||
|
||||
async function discover_device(ledType, params) {
|
||||
|
||||
$('#btn_submit_controller').attr('disabled', true);
|
||||
$('#btn_submit_controller').prop('disabled', true);
|
||||
|
||||
const result = await requestLedDeviceDiscovery(ledType, params);
|
||||
|
||||
@@ -1642,7 +1642,7 @@ async function discover_device(ledType, params) {
|
||||
|
||||
async function getProperties_device(ledType, key, params) {
|
||||
// Take care that connfig cannot be saved during background processing
|
||||
$('#btn_submit_controller').attr('disabled', true);
|
||||
$('#btn_submit_controller').prop('disabled', true);
|
||||
|
||||
//Create ledType cache entry
|
||||
if (!devicesProperties[ledType]) {
|
||||
@@ -1659,13 +1659,13 @@ async function getProperties_device(ledType, key, params) {
|
||||
devicesProperties[ledType][key] = ledDeviceProperties;
|
||||
|
||||
if (!window.readOnlyMode) {
|
||||
$('#btn_submit_controller').attr('disabled', false);
|
||||
$('#btn_submit_controller').prop('disabled', false);
|
||||
}
|
||||
}
|
||||
else {
|
||||
showNotification('warning', $.i18n('conf_leds_error_get_properties_text'), $.i18n('conf_leds_error_get_properties_title'))
|
||||
$('#btn_submit_controller').attr('disabled', true);
|
||||
$('#btn_test_controller').attr('disabled', true);
|
||||
$('#btn_submit_controller').prop('disabled', true);
|
||||
$('#btn_test_controller').prop('disabled', true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1675,14 +1675,14 @@ async function getProperties_device(ledType, key, params) {
|
||||
|
||||
async function identify_device(type, params) {
|
||||
// Take care that connfig cannot be saved and identification cannot be retriggerred during background processing
|
||||
$('#btn_submit_controller').attr('disabled', true);
|
||||
$('#btn_test_controller').attr('disabled', true);
|
||||
$('#btn_submit_controller').prop('disabled', true);
|
||||
$('#btn_test_controller').prop('disabled', true);
|
||||
|
||||
await requestLedDeviceIdentification(type, params);
|
||||
|
||||
$('#btn_test_controller').attr('disabled', false);
|
||||
$('#btn_test_controller').prop('disabled', false);
|
||||
if (!window.readOnlyMode) {
|
||||
$('#btn_submit_controller').attr('disabled', false);
|
||||
$('#btn_submit_controller').prop('disabled', false);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user