diff --git a/code-payload.js b/code-payload.js index e61ab0f..d258591 100644 --- a/code-payload.js +++ b/code-payload.js @@ -6,7 +6,7 @@ // @require http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js // @grant GM_addStyle // @grant GM_setClipboard -// @version 0.0.12 +// @version 0.0.13 // ==/UserScript== // draw frame @@ -1768,12 +1768,22 @@ function checkButtonColor(buttonName) { return color; }; function selectCheckbox(box) { - box.filter("A")[0].classList.add("checked"); - box.filter("INPUT")[0].checked = true; + try { + box.filter("A")[0].classList.add("checked"); + box.filter("INPUT")[0].checked = true; + } catch (e) { + console.log(box + " does not appear to exist"); + } + }; function deselectCheckbox(box) { - box.filter("A")[0].classList.remove("checked"); - box.filter("INPUT")[0].checked = false; + try { + box.filter("A")[0].classList.remove("checked"); + box.filter("INPUT")[0].checked = false; + } catch (e) { + console.log(box + " does not appear to exist"); + } + }; function apply() { if (debugFlag == true) { diff --git a/statusio-selector.user.js b/statusio-selector.user.js index 9b416fe..2b9cde7 100644 --- a/statusio-selector.user.js +++ b/statusio-selector.user.js @@ -4,7 +4,7 @@ // @description Effort to simplify configuration of incidents/maintenance windows // @require http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js // @require http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js -// @version 0.0.12 +// @version 0.0.13 // @downloadUrl https://gitea.frijole.lol/o0beaner/js-statusio-selector/raw/branch/main/statusio-selector.user.js // @updateURL https://gitea.frijole.lol/o0beaner/js-statusio-selector/raw/branch/main/statusio-selector.user.js // @include /^https?://app\.status\.io/dashboard/.*/?(maintenance|incident)/create$/ @@ -1804,12 +1804,22 @@ function checkButtonColor(buttonName) { return color; }; function selectCheckbox(box) { - box.filter("A")[0].classList.add("checked"); - box.filter("INPUT")[0].checked = true; + try { + box.filter("A")[0].classList.add("checked"); + box.filter("INPUT")[0].checked = true; + } catch (e) { + console.log(box + " does not appear to exist"); + } + }; function deselectCheckbox(box) { - box.filter("A")[0].classList.remove("checked"); - box.filter("INPUT")[0].checked = false; + try { + box.filter("A")[0].classList.remove("checked"); + box.filter("INPUT")[0].checked = false; + } catch (e) { + console.log(box + " does not appear to exist"); + } + }; function apply() { if (debugFlag == true) {