commit e45ea4e4ac460d23636e5673367ac3b7c9429da1
parent bcce8ad8afc798112164823298f8d13041365407
Author: Oscar Benedito <oscar@oscarbenedito.com>
Date:   Tue, 28 Jul 2020 19:46:07 +0200

Remove theme JavaScript

There will no longer be an option to change the theme, it will be set by
computer defaults only. This also gets rid of all the JavaScript on all
pages except the posts that need MathJax.

Diffstat:
Massets/css/style.scss | 6------
Dassets/js/main.js | 33---------------------------------
Mcontent/jsweblabels.html | 1-
Mlayouts/partials/scripts.html | 2--
4 files changed, 0 insertions(+), 42 deletions(-)

diff --git a/assets/css/style.scss b/assets/css/style.scss @@ -89,12 +89,6 @@ permission notice: @include darkcolors; } } -.toggled { - @include darkcolors; - @media (prefers-color-scheme: dark) { - @include lightcolors; - } -} /* Reset -------------------------------------------------- */ *, diff --git a/assets/js/main.js b/assets/js/main.js @@ -1,33 +0,0 @@ -/* -Copyright (C) 2019 Oscar Benedito - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU Affero General Public License as -published by the Free Software Foundation, either version 3 of the -License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Affero General Public License for more details. - -You should have received a copy of the GNU Affero General Public License -along with this program. If not, see <https://www.gnu.org/licenses/>. -*/ -'use strict'; -function toggleTheme() { - if (localStorage && localStorage.getItem('theme') === 'toggled') { - localStorage.removeItem('theme'); - } else if (localStorage) { - localStorage.setItem('theme', 'toggled'); - } - document.body.classList.toggle('toggled'); -} - -if (localStorage && localStorage.getItem('theme') === 'toggled') { - document.body.classList.toggle('toggled'); -} - -function openMenu() { - document.getElementById('navbar').classList.toggle('show'); -} diff --git a/content/jsweblabels.html b/content/jsweblabels.html @@ -16,7 +16,6 @@ type: page </tr> </thead> <tbody> - {{< js-label asset="js/main.js" license-slug="GNU-AGPL-3.0-or-later" license-url="http://www.gnu.org/licenses/agpl-3.0.html" >}} {{< js-label asset="js/composer.js" license-slug="GNU-AGPL-3.0-or-later" license-url="http://www.gnu.org/licenses/agpl-3.0.html" >}} <tr> <td><a href="/js/mathjax-3.0.1/tex-chtml.js">/js/mathjax-3.0.1/tex-chtml.js</a></td> diff --git a/layouts/partials/scripts.html b/layouts/partials/scripts.html @@ -1,5 +1,3 @@ -{{ $js := resources.Get "js/main.js" | minify | fingerprint -}} -<script type="text/javascript" src="{{ $js.RelPermalink }}"></script> {{- with .File }} {{- if eq .Ext "pdc" }} <script id="MathJax-script" async src="/js/mathjax-3.0.1/tex-chtml.js"></script>