From 10e7b1370731fcfbcb78d44eaf50dbe14119f49a Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Mon, 12 Feb 2018 15:05:50 -0500 Subject: [PATCH] Update the language on the webapp to use confirms to prevent errant clicks --- app/www/static/js/intval.mobile.js | 12 ++++++------ app/www/static/js/intval.web.js | 6 ++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/www/static/js/intval.mobile.js b/app/www/static/js/intval.mobile.js index 2125717..e1ac4f3 100644 --- a/app/www/static/js/intval.mobile.js +++ b/app/www/static/js/intval.mobile.js @@ -623,8 +623,8 @@ mobile.EV = function (fstop, shutter) { }; mobile.reset = function () { - const reset = confirm(`Reset INTVAL3 to default settings and clear counter?`); - if (!reset) return false; + const proceed = confirm(`Reset INTVAL3 to default settings and clear counter?`); + if (!proceed) return false; let opts = { type : 'reset' }; @@ -644,8 +644,8 @@ mobile.resetSuccess = function () { }; mobile.update = function () { - const update = confirm(`Check for updates? You will be disconnected from the INTVAL3 during this process.`); - if (!update) return false; + const proceed = confirm(`Check for updates? You will be disconnected from the INTVAL3 during this process.`); + if (!proceed) return false; let opts = { type : 'update' }; @@ -662,8 +662,8 @@ mobile.updateSuccess = function () { }; mobile.restart = function () { - const restart = confirm(`Restart the INTVAL3? You will be disconnected from it during this process.`); - if (!restart) return false; + const proceed = confirm(`Restart the INTVAL3? You will be disconnected from it during this process.`); + if (!proceed) return false; let opts = { type : 'restart' }; diff --git a/app/www/static/js/intval.web.js b/app/www/static/js/intval.web.js index d798cff..1f294ce 100644 --- a/app/www/static/js/intval.web.js +++ b/app/www/static/js/intval.web.js @@ -166,6 +166,8 @@ web.reset = function () { headers : web._header, body : JSON.stringify({}) } + const proceed = confirm(`Reset INTVAL3 to default settings and clear counter?`); + if (!proceed) return false fetch('/reset', opts) .then(web.useJson) .then(setState) @@ -180,6 +182,8 @@ web.restart = function () { headers : web._header, body : JSON.stringify({}) } + const proceed = confirm(`Restart the INTVAL3? You will be disconnected from it during this process.`); + if (!proceed) return false; fetch('/restart', opts) .then(web.useJson) .then(web.restartSuccess) @@ -197,6 +201,8 @@ web.update = function () { headers : web._header, body : JSON.stringify({}) } + const proceed = confirm(`Check for updates? You will be disconnected from the INTVAL3 during this process.`); + if (!proceed) return false; fetch('/update', opts) .then(web.useJson) .then(web.updateSuccess)