Albirew/nyaa-pantsu
Albirew
/
nyaa-pantsu
Archivé
1
0
Bifurcation 0

Revert "Inline style-switching JS into <head>"

It was bullshit anyway
Cette révision appartient à :
sfan5 2017-05-07 23:13:04 +02:00
Parent e425d3d86b
révision f73d148dec
2 fichiers modifiés avec 6 ajouts et 9 suppressions

Voir le fichier

@ -1,4 +1,10 @@
// Night mode
var night = localStorage.getItem("night");
if (night == "true") {
$("#style")[0].href = "/css/style-night.css";
$("#nighticon")[0].src = "/img/sun.png";
}
function toggleNightMode() {
var night = localStorage.getItem("night");
if(night == "true") {

Voir le fichier

@ -27,15 +27,6 @@
<!-- Website CSS -->
<link rel="stylesheet" id="style" href="{{.URL.Parse "/css/style.css"}}">
<script type="text/javascript">
// Inlined here to allow early style switch
if (localStorage.getItem("night") == "true") {
document.getElementById("style").href = "/css/style-night.css";
document.body.addEventListener("load", function() {
document.getElementById("nighticon").src = "/img/sun.png";
}, false);
}
</script>
</head>
<body>
<nav class="navbar navbar-default" id="mainmenu">