updated syntax to support refactored common file

This commit is contained in:
QuiteAFancyEmerald 2024-07-09 18:44:08 -07:00
parent 1cb8476968
commit 3f10060708

View file

@ -1,23 +1,29 @@
/* ----------------------------------------------- /* -----------------------------------------------
/* Authors: OlyB /* Authors: OlyB, QuiteAFancyEmerald
/* GNU Affero General Public License v3.0: https://www.gnu.org/licenses/agpl-3.0.en.html /* GNU Affero General Public License v3.0: https://www.gnu.org/licenses/agpl-3.0.en.html
/* prSet script /* prSet script
/* ----------------------------------------------- */ /* ----------------------------------------------- */
function prSet(type) { function prSet(type) {
var prUrl = document.getElementById("pr-url"), var prUrl = document.getElementById("pr-url");
prGo1 = document.getElementById("pr-go1"), var prGo1 = document.getElementById("pr-go1");
prGo2 = document.getElementById("pr-go2"); var prGo2 = document.getElementById("pr-go2");
prUrl.addEventListener("keydown", function(e) { prUrl.addEventListener("keydown", function(e) {
if (e.code == "Enter" && prUrl.value) goProx[type](prUrl.value); if (e.code === "Enter" && prUrl.value.trim() !== "") {
}, false); goProx[type](prUrl.value.trim());
}
});
prGo1.addEventListener("click", function() { prGo1.addEventListener("click", function() {
if (prUrl.value) goProx[type](prUrl.value); if (prUrl.value.trim() !== "") {
}, false); goProx[type](prUrl.value.trim(), "window"); // Classic Mode
}
});
prGo2.addEventListener("click", function() { prGo2.addEventListener("click", function() {
if (prUrl.value) goProx[type](prUrl.value, true); if (prUrl.value.trim() !== "") {
}, false); goProx[type](prUrl.value.trim(), "stealth"); // Stealth Mode
}
});
} }