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