mirror of
https://git.rape.pet/ulith/amputoma-fe.git
synced 2025-01-31 08:33:22 +01:00
whitespace cleanup
This commit is contained in:
parent
0ad709c9f3
commit
e323fa404b
1 changed files with 24 additions and 24 deletions
|
@ -58,7 +58,7 @@
|
|||
const txtElm = document.querySelector('.volume-percentage');
|
||||
if (txtElm)
|
||||
txtElm.innerHTML = percentage;
|
||||
|
||||
|
||||
const slider = document.querySelector('.volume-slider');
|
||||
if (slider) {
|
||||
const thumb = slider.querySelector('.volume-thumb');
|
||||
|
@ -122,15 +122,15 @@
|
|||
let p = pinnedPost.nextElementSibling;
|
||||
if (!p)
|
||||
return false;
|
||||
|
||||
|
||||
let statusBody = p.querySelector(".StatusBody");
|
||||
if (!statusBody)
|
||||
return false;
|
||||
|
||||
|
||||
let txtElm = statusBody.querySelector(".text");
|
||||
if (!txtElm)
|
||||
return false;
|
||||
|
||||
|
||||
if (txtElm.innerHTML.replace(/(<([^>]+)>)/ig, '').search(/profile them/ig) == -1)
|
||||
return false;
|
||||
|
||||
|
@ -257,65 +257,65 @@
|
|||
|
||||
addEventListener('locationchange', updateRot);
|
||||
addEventListener('popstate', updateRot);
|
||||
|
||||
|
||||
function createAudioControls() {
|
||||
let NavPanel = document.querySelector('.NavPanel');
|
||||
let sideDrawer = document.querySelector('.side-drawer');
|
||||
if (!NavPanel && !sideDrawer)
|
||||
return;
|
||||
|
||||
|
||||
if (document.querySelector('.audioControl'))
|
||||
return;
|
||||
|
||||
|
||||
//Initialize audio controls and event listeners
|
||||
console.log("Adding music controls");
|
||||
const panel = document.createElement("div");
|
||||
panel.className = "panel panel-default";
|
||||
|
||||
|
||||
const panelHeading = document.createElement("div");
|
||||
panelHeading.className = "panel-heading";
|
||||
panel.appendChild(panelHeading);
|
||||
|
||||
|
||||
const title = document.createElement("div");
|
||||
title.className = "title";
|
||||
title.innerText = "Music Controls";
|
||||
panelHeading.appendChild(title);
|
||||
|
||||
|
||||
const panelBody = document.createElement("div");
|
||||
panelBody.className = "panel-body";
|
||||
panel.appendChild(panelBody);
|
||||
|
||||
|
||||
const audioControl = document.createElement("div");
|
||||
audioControl.className = "audioControl";
|
||||
panelBody.appendChild(audioControl);
|
||||
|
||||
|
||||
const mutebutton = document.createElement("label");
|
||||
mutebutton.className = "mutebutton";
|
||||
audioControl.appendChild(mutebutton);
|
||||
|
||||
|
||||
const musicmute = document.createElement("input");
|
||||
musicmute.className = "music-mute";
|
||||
musicmute.setAttribute("type", "checkbox");
|
||||
musicmute.checked = true;
|
||||
mutebutton.appendChild(musicmute);
|
||||
|
||||
|
||||
const mutecheck = document.createElement("span");
|
||||
mutecheck.className = "mutecheck";
|
||||
mutecheck.title = "Mute music";
|
||||
mutebutton.appendChild(mutecheck);
|
||||
|
||||
|
||||
const volumeSlider = document.createElement("div");
|
||||
volumeSlider.className = "volume-slider";
|
||||
audioControl.appendChild(volumeSlider);
|
||||
|
||||
|
||||
const volumeTrack = document.createElement("div");
|
||||
volumeTrack.className = "volume-track";
|
||||
volumeSlider.appendChild(volumeTrack);
|
||||
|
||||
|
||||
const volumeFill = document.createElement("div");
|
||||
volumeFill.className = "volume-fill";
|
||||
volumeTrack.appendChild(volumeFill);
|
||||
|
||||
|
||||
const volumeThumb = document.createElement("div");
|
||||
volumeThumb.className = "volume-thumb";
|
||||
volumeSlider.appendChild(volumeThumb);
|
||||
|
@ -329,16 +329,16 @@
|
|||
volumeStepUp.className = "volume-button-up button-default";
|
||||
volumeStepUp.innerText = "";
|
||||
audioControl.appendChild(volumeStepUp);
|
||||
|
||||
|
||||
const volumePercentage = document.createElement("div");
|
||||
volumePercentage.className = "volume-percentage";
|
||||
audioControl.appendChild(volumePercentage);
|
||||
|
||||
|
||||
if (NavPanel)
|
||||
NavPanel.insertAdjacentElement('afterend', panel);
|
||||
else if (sideDrawer)
|
||||
sideDrawer.insertAdjacentElement('beforeend', audioControl);
|
||||
|
||||
|
||||
{
|
||||
let isDragging = false;
|
||||
|
||||
|
@ -372,7 +372,7 @@
|
|||
|
||||
volumeSlider.addEventListener('mousedown', onMouseDown);
|
||||
}
|
||||
|
||||
|
||||
audio.muted = musicmute.checked = localStorage.audiomuted === "true";
|
||||
musicmute.addEventListener('click', () => {
|
||||
localStorage.audiomuted = audio.muted = musicmute.checked;
|
||||
|
@ -391,10 +391,10 @@
|
|||
|
||||
updateVolumeLabel();
|
||||
}
|
||||
|
||||
|
||||
createAudioControls();
|
||||
window.addEventListener('resize', createAudioControls);
|
||||
|
||||
|
||||
new MutationObserver((mutationRecords, observer) => {
|
||||
createAudioControls();
|
||||
}).observe(document.body, {
|
||||
|
|
Loading…
Reference in a new issue