WebUI: Use native function for selecting elements by ID

This commit is contained in:
skomerko
2025-04-12 11:57:27 +02:00
parent 7b3aa51bb1
commit 411ca0f668
48 changed files with 1303 additions and 1303 deletions

View File

@@ -36,37 +36,37 @@
// Tabs
MochaUI.initializeTabs("preferencesTabs");
$("PrefBehaviorLink").addEventListener("click", (e) => {
document.getElementById("PrefBehaviorLink").addEventListener("click", (e) => {
Array.prototype.forEach.call(document.querySelectorAll(".PrefTab"), (tab => tab.classList.add("invisible")));
$("BehaviorTab").classList.remove("invisible");
document.getElementById("BehaviorTab").classList.remove("invisible");
});
$("PrefDownloadsLink").addEventListener("click", (e) => {
document.getElementById("PrefDownloadsLink").addEventListener("click", (e) => {
Array.prototype.forEach.call(document.querySelectorAll(".PrefTab"), (tab => tab.classList.add("invisible")));
$("DownloadsTab").classList.remove("invisible");
document.getElementById("DownloadsTab").classList.remove("invisible");
});
$("PrefConnectionLink").addEventListener("click", (e) => {
document.getElementById("PrefConnectionLink").addEventListener("click", (e) => {
Array.prototype.forEach.call(document.querySelectorAll(".PrefTab"), (tab => tab.classList.add("invisible")));
$("ConnectionTab").classList.remove("invisible");
document.getElementById("ConnectionTab").classList.remove("invisible");
});
$("PrefSpeedLink").addEventListener("click", (e) => {
document.getElementById("PrefSpeedLink").addEventListener("click", (e) => {
Array.prototype.forEach.call(document.querySelectorAll(".PrefTab"), (tab => tab.classList.add("invisible")));
$("SpeedTab").classList.remove("invisible");
document.getElementById("SpeedTab").classList.remove("invisible");
});
$("PrefBittorrentLink").addEventListener("click", (e) => {
document.getElementById("PrefBittorrentLink").addEventListener("click", (e) => {
Array.prototype.forEach.call(document.querySelectorAll(".PrefTab"), (tab => tab.classList.add("invisible")));
$("BittorrentTab").classList.remove("invisible");
document.getElementById("BittorrentTab").classList.remove("invisible");
});
$("PrefRSSLink").addEventListener("click", (e) => {
document.getElementById("PrefRSSLink").addEventListener("click", (e) => {
Array.prototype.forEach.call(document.querySelectorAll(".PrefTab"), (tab => tab.classList.add("invisible")));
$("RSSTab").classList.remove("invisible");
document.getElementById("RSSTab").classList.remove("invisible");
});
$("PrefWebUILink").addEventListener("click", (e) => {
document.getElementById("PrefWebUILink").addEventListener("click", (e) => {
Array.prototype.forEach.call(document.querySelectorAll(".PrefTab"), (tab => tab.classList.add("invisible")));
$("WebUITab").classList.remove("invisible");
document.getElementById("WebUITab").classList.remove("invisible");
});
$("PrefAdvancedLink").addEventListener("click", (e) => {
document.getElementById("PrefAdvancedLink").addEventListener("click", (e) => {
Array.prototype.forEach.call(document.querySelectorAll(".PrefTab"), (tab => tab.classList.add("invisible")));
$("AdvancedTab").classList.remove("invisible");
document.getElementById("AdvancedTab").classList.remove("invisible");
});
})();
</script>