Skip to content

Commit

Permalink
more firefox fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mart2070 committed May 14, 2024
1 parent fcef32e commit 9cb81b3
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions tdx-enhanced.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name tdx-enhanced
// @namespace ecn
// @version 2024-05-14-01
// @version 2024-05-14-02
// @description enhanced tdx coloring & formatting. follows system color scheme.
// @author Purdue STEM IT - it@purdue.edu
// @match https://service.purdue.edu/TDNext/*
Expand Down Expand Up @@ -474,7 +474,7 @@
setColorMode(mode)
}

function setColorMode(mode) {
function setColorMode(mode,store=true) {
if (!mode) {
mode = "auto"
}
Expand All @@ -495,7 +495,9 @@
document.documentElement.classList.add(mode)
}

localStorage.setItem("styles",storageMode)
if (store) {
localStorage.setItem("styles",storageMode)
}

}

Expand All @@ -522,13 +524,13 @@
if (localScheme != autoScheme && localScheme != "auto") {
setColorMode(localScheme)
} else {
setColorMode(autoScheme,"auto")
setColorMode(autoScheme,false)
}

addEventListener("storage", (event) => {
console.log("Storage event:",event)
if (event.key == "styles") {
setColorMode(event.newValue)
setColorMode(event.newValue,false)
}
});
}
Expand Down Expand Up @@ -716,12 +718,6 @@
--col-modified: var(--light-col-modified);
}
/*
::selection {
/* background: var(--bg-3); */
}
*/
/* Global */
.qBox {
Expand Down

0 comments on commit 9cb81b3

Please sign in to comment.