From 76d39ae315334ade9dcd24793626a86c6c85619f Mon Sep 17 00:00:00 2001 From: Lennart Brinkmann Date: Thu, 5 Sep 2024 22:10:56 +0200 Subject: [PATCH] fix more linter warnings. --- admin/adapter-settings.js | 13 ++++++------- admin/admin.js | 4 ++-- lib/backup.js | 1 - 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/admin/adapter-settings.js b/admin/adapter-settings.js index aaf6045b..5ba7c6c6 100644 --- a/admin/adapter-settings.js +++ b/admin/adapter-settings.js @@ -4,8 +4,8 @@ const parts = path.split('/'); parts.splice(-3); const socket = io.connect('/', { path: parts.join('/') + '/socket.io' }); -var query = (window.location.search || '').replace(/^\?/, '').replace(/#.*$/, ''); -var args = {}; +const query = (window.location.search || '').replace(/^\?/, '').replace(/#.*$/, ''); +const args = {}; let theme = null; // parse parameters @@ -14,7 +14,7 @@ query.trim().split('&').filter(function (t) { return t.trim(); }).forEach(functi if (!i && parts.length === 1 && !isNaN(parseInt(b, 10))) { args.instance = parseInt(b, 10); } - var name = parts[0]; + const name = parts[0]; args[name] = parts.length === 2 ? parts[1] : true; if (name === 'instance') { @@ -28,7 +28,7 @@ query.trim().split('&').filter(function (t) { return t.trim(); }).forEach(functi } }); -var instance = args.instance; +const instance = args.instance; let common = null; // common information of adapter const host = null; // host object on which the adapter runs @@ -97,7 +97,7 @@ function loadSettings(callback) { alert('Please implement save function in your admin/index.html'); } else { const _query = query.split('&'); - for (var q = 0; q < _query.length; q++) { + for (let q = 0; q < _query.length; q++) { if (_query[q].indexOf('react=') !== -1) { $('.adapter-container').addClass('react-' + _query[q].substring(6)); theme = 'react-' + _query[q].substring(6); @@ -207,9 +207,8 @@ function onChange(isChanged) { } function showMessage(message, title, icon) { - var $dialogMessage; // noinspection JSJQueryEfficiency - $dialogMessage = $('#dialog-message'); + let $dialogMessage = $('#dialog-message'); if (!$dialogMessage.length) { $('body').append( '