From fda8f218061da71648d2774b314108dbe03e3931 Mon Sep 17 00:00:00 2001 From: mattpass Date: Sun, 31 May 2020 14:14:19 +0100 Subject: [PATCH] ES6 in properties.php --- lib/properties.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/properties.php b/lib/properties.php index a98c4e5..288229e 100644 --- a/lib/properties.php +++ b/lib/properties.php @@ -127,20 +127,20 @@ permValues = [4, 2, 1]; permTypes = ['read', 'write', 'exec']; function changePerms(val) { - var permText = document.getElementById('permText').value; + const permText = document.getElementById('permText').value; // change checkboxes if (val) { // set values if (3 === permText.length) { - for (var i = 0; i <= 2; i++) { - for (var j = 0; j <= 2; j++) { + for (let i = 0; i <= 2; i++) { + for (let j = 0; j <= 2; j++) { document.getElementById(permGroups[i] + permValues[j]).checked = window[permTypes[j] + 'Vars'].indexOf(permText.split("")[i] * 1) > -1; } } // clear values } else { - for (var i = 0; i <= 2; i++) { - for (var j = 0; j <= 2; j++) { + for (let i = 0; i <= 2; i++) { + for (let j = 0; j <= 2; j++) { document.getElementById(permGroups[i]+permValues[j]).checked = false; } } @@ -154,12 +154,12 @@ function changePerms(val) { } } -var showButton = function() { +const showButton = function() { document.getElementById('updateButton').style.opacity = "1"; } -var validatePerms = function() { - var permText = document.getElementById('permText').value; +const validatePerms = function() { + const permText = document.getElementById('permText').value; canUpdate = true; if (3 !== permText.length || isNaN(permText)) {canUpdate = false} if (