remove redundant whitespaces

This commit is contained in:
uwaa 2025-01-11 06:41:06 +00:00
parent afd8a5742b
commit f7773a3f1c

16
rot.js
View file

@ -48,7 +48,7 @@
function setMusic(url) {
if (audio.src == url || (!url && audio.src === window.location.toString()))
return;
audio.pause();
if (url) {
@ -97,7 +97,7 @@
//Callback
if (!resolve(element))
return;
//Clean up
for (const o of observers)
o.disconnect();
@ -116,13 +116,13 @@
function applyMainTheme() {
console.log("Applying main theme");
setMusic(null);
waitUntilSpecial('meta[name="pageMusic"]').then((pageMusic) => {
setMusic(pageMusic.content);
playMusic();
return true;
});
waitUntilSpecial("#pageMusic").then((pageMusic) => {
setMusic(pageMusic.getAttribute("href"));
playMusic();
@ -133,7 +133,7 @@
function applyUserTheme() {
console.log("Applying user theme");
setMusic(null);
waitUntilSpecial(".pin").then((pinnedPost) => {
if (pinnedPost.nextElementSibling
.querySelector(".StatusBody")
@ -142,7 +142,7 @@
.replace(/(<([^>]+)>)/ig, '')
.search(/profile theming post/ig) == -1)
return false;
let ptp = pinnedPost.nextElementSibling.querySelector(".StatusBody");
if (ptp) {
//Configured by post
@ -162,7 +162,7 @@
return false;
}
}, observers);
waitUntilSpecial(".user-profile-field-name").then(() => {
let fields = [...document.getElementsByClassName("user-profile-field-name")]
if (fields.length != 0) {
@ -245,7 +245,7 @@
audio.loop = true;
audio.id = "user-music";
audio.style = "display:none;";
localStorage.audiovolume = (audio.volume = localStorage.audiovolume ? localStorage.audiovolume / 100 : 0.5) * 100;
localStorage.audiovolume = (audio.volume = localStorage.audiovolume ? localStorage.audiovolume / 100 : 0.5) * 100;
//Initialize audio controls and event listeners
waitUntil("#music-controls").then((controls) => {