refactor(front): better wukkoDragonEmoji checkbox handler

ну, что п-3, заебался? я может тоже заебался, но я же бегу!
This commit is contained in:
synzr 2024-02-15 18:39:28 +05:00
parent 555549f67c
commit 70506d41ff

View File

@ -292,12 +292,15 @@ function checkbox(action) {
case "reduceTransparency": eid("cobalt-body").classList.toggle('no-transparency'); break; case "reduceTransparency": eid("cobalt-body").classList.toggle('no-transparency'); break;
case "disableAnimations": eid("cobalt-body").classList.toggle('no-animation'); break; case "disableAnimations": eid("cobalt-body").classList.toggle('no-animation'); break;
case "wukkoDragonEmoji": case "wukkoDragonEmoji":
for (const emoji of document.getElementsByClassName("emoji")) document.getElementsByClassName("emoji").forEach((emoji) => {
if (emoji.attributes.src.value.match(/emoji\/dragon_face(?:_wukko)?\.svg/) !== null) if (emoji.attributes.src.value.match(/emoji\/dragon_face(?:_wukko)?\.svg/) === null) {
if (sGet("wukkoDragonEmoji") === "true") return;
emoji.attributes.src.value = "emoji/dragon_face_wukko.svg"; }
else
emoji.attributes.src.value = "emoji/dragon_face.svg"; emoji.attributes.src.value = sGet("wukkoDragonEmoji") === "true"
? "emoji/dragon_face_wukko.svg"
: "emoji/dragon_face.svg";
});
break; break;
} }
action === "disableChangelog" && sGet(action) === "true" ? notificationCheck("disable") : notificationCheck(); action === "disableChangelog" && sGet(action) === "true" ? notificationCheck("disable") : notificationCheck();