Improve Led Device on/off and background effect (#1502)

* Queue On-Off calls

* Do not switch-off LED-device when Background effect is enabled

* Fix LGTM Warnings

* Address LGTM findings
This commit is contained in:
LordGrey
2022-08-14 23:02:30 +02:00
committed by GitHub
parent e17ce6cd4e
commit a2266b177f
8 changed files with 54 additions and 36 deletions

View File

@@ -182,8 +182,9 @@ $(document).ready(function () {
// Disable or enable Delete Effect Button
$('#effectsdellist').off().on('change', function () {
$(this).val() == null ? $('#btn_edit, #btn_delete').prop('disabled', true) : "";
$(this).val().startsWith("int_") ? $('#btn_delete').prop('disabled', true) : $('#btn_delete').prop('disabled', false);
var value = $(this).val();
value == null ? $('#btn_edit, #btn_delete').prop('disabled', true) : "";
value.startsWith("int_") ? $('#btn_delete').prop('disabled', true) : $('#btn_delete').prop('disabled', false);
});
// Load Effect

View File

@@ -272,7 +272,7 @@ $(document).ready(function () {
function updateForwarderServiceSections(type) {
var editorPath = "root.forwarder." + type
var editorPath = "root.forwarder." + type;
var selectedServices = conf_editor_forw.getEditor(editorPath + "select").getValue();
if (jQuery.isEmptyObject(selectedServices) || selectedServices[0] === "NONE") {
@@ -301,7 +301,7 @@ $(document).ready(function () {
function updateForwarderSelectList(type) {
var selectionElement = type + "select"
var selectionElement = type + "select";
var enumVals = [];
var enumTitelVals = [];

View File

@@ -226,7 +226,7 @@ function pluralRuleParser(rule, number) {
return result;
}
result = parseFloat(number, 10);
result = parseFloat(number, 10); //lgtm [js/superfluous-trailing-arguments]
debug(' -- passed n ', result);
return result;

View File

@@ -1310,7 +1310,7 @@ function isValidIPv6(value) {
function isValidHostname(value) {
if (value.match(
'^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[_a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$'
'^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])(.([a-zA-Z0-9]|[_a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$' //lgtm [js/redos]
))
return true;
else
@@ -1319,7 +1319,7 @@ function isValidHostname(value) {
function isValidServicename(value) {
if (value.match(
'^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9 \-]{0,61}[a-zA-Z0-9])(\.([a-zA-Z0-9]|[_a-zA-Z0-9][a-zA-Z0-9\-]{0,61}[a-zA-Z0-9]))*$'
'^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9 -]{0,61}[a-zA-Z0-9])(.([a-zA-Z0-9]|[_a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9]))*$' //lgtm [js/redos]
))
return true;
else

View File

@@ -466,7 +466,7 @@ function startWizardCC() {
$('#wiz_cc_kodiip').off().on('change', function () {
kodiAddress = $(this).val().trim();
kodiAddress = encodeURIComponent($(this).val().trim());
$('#kodi_status').html('');
if (kodiAddress !== "") {