wrap select/deselect funcs in try/catch block
This commit is contained in:
parent
d53a714ad2
commit
01b8d12979
|
|
@ -6,7 +6,7 @@
|
||||||
// @require http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js
|
// @require http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.min.js
|
||||||
// @grant GM_addStyle
|
// @grant GM_addStyle
|
||||||
// @grant GM_setClipboard
|
// @grant GM_setClipboard
|
||||||
// @version 0.0.12
|
// @version 0.0.13
|
||||||
// ==/UserScript==
|
// ==/UserScript==
|
||||||
|
|
||||||
// draw frame
|
// draw frame
|
||||||
|
|
@ -1768,12 +1768,22 @@ function checkButtonColor(buttonName) {
|
||||||
return color;
|
return color;
|
||||||
};
|
};
|
||||||
function selectCheckbox(box) {
|
function selectCheckbox(box) {
|
||||||
|
try {
|
||||||
box.filter("A")[0].classList.add("checked");
|
box.filter("A")[0].classList.add("checked");
|
||||||
box.filter("INPUT")[0].checked = true;
|
box.filter("INPUT")[0].checked = true;
|
||||||
|
} catch (e) {
|
||||||
|
console.log(box + " does not appear to exist");
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
function deselectCheckbox(box) {
|
function deselectCheckbox(box) {
|
||||||
|
try {
|
||||||
box.filter("A")[0].classList.remove("checked");
|
box.filter("A")[0].classList.remove("checked");
|
||||||
box.filter("INPUT")[0].checked = false;
|
box.filter("INPUT")[0].checked = false;
|
||||||
|
} catch (e) {
|
||||||
|
console.log(box + " does not appear to exist");
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
function apply() {
|
function apply() {
|
||||||
if (debugFlag == true) {
|
if (debugFlag == true) {
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
// @description Effort to simplify configuration of incidents/maintenance windows
|
// @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/jquery/1.6.2/jquery.min.js
|
||||||
// @require http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.1/jquery-ui.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
|
// @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
|
// @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$/
|
// @include /^https?://app\.status\.io/dashboard/.*/?(maintenance|incident)/create$/
|
||||||
|
|
@ -1804,12 +1804,22 @@ function checkButtonColor(buttonName) {
|
||||||
return color;
|
return color;
|
||||||
};
|
};
|
||||||
function selectCheckbox(box) {
|
function selectCheckbox(box) {
|
||||||
|
try {
|
||||||
box.filter("A")[0].classList.add("checked");
|
box.filter("A")[0].classList.add("checked");
|
||||||
box.filter("INPUT")[0].checked = true;
|
box.filter("INPUT")[0].checked = true;
|
||||||
|
} catch (e) {
|
||||||
|
console.log(box + " does not appear to exist");
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
function deselectCheckbox(box) {
|
function deselectCheckbox(box) {
|
||||||
|
try {
|
||||||
box.filter("A")[0].classList.remove("checked");
|
box.filter("A")[0].classList.remove("checked");
|
||||||
box.filter("INPUT")[0].checked = false;
|
box.filter("INPUT")[0].checked = false;
|
||||||
|
} catch (e) {
|
||||||
|
console.log(box + " does not appear to exist");
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
function apply() {
|
function apply() {
|
||||||
if (debugFlag == true) {
|
if (debugFlag == true) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue