From 52d527b95e4710f22ba2557f7e68a31cfd4fb51a Mon Sep 17 00:00:00 2001 From: Kyle Gunger Date: Tue, 16 Jul 2024 00:35:42 -0400 Subject: Hopefully work better on Archive.org --- scripts/theme.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'scripts/theme.js') diff --git a/scripts/theme.js b/scripts/theme.js index 1840e02..06d6811 100644 --- a/scripts/theme.js +++ b/scripts/theme.js @@ -1,8 +1,8 @@ 'use strict'; const BASE_THEMES = [[ - "/styles/themes/colors-base.css", - "/styles/themes/colors-dark.css" + "styles/themes/colors-base.css", + "styles/themes/colors-dark.css" ], [ "Light", @@ -17,7 +17,7 @@ class Theme{ static init() { - let uth = Cookies.getCookie("userThemes-" + APP_NAME).split(','); + let uth = window.Cookies.getCookie("userThemes-" + APP_NAME).split(','); for (let i = 1; i < uth.length; i += 2) { @@ -25,8 +25,8 @@ class Theme{ this.UserThemes[1].push(uth[i]); } - if(Cookies.getCookie("theme-" + APP_NAME) == ""){ - Cookies.setYearCookie("theme-" + APP_NAME, BASE_THEMES[0][0]); + if(window.Cookies.getCookie("theme-" + APP_NAME) == ""){ + window.Cookies.setYearCookie("theme-" + APP_NAME, BASE_THEMES[0][0]); } Theme.theme.setAttribute("href", Cookies.getCookie("theme-" + APP_NAME) + "?v=" + Date.now()); @@ -34,12 +34,12 @@ class Theme{ static set(sheet) { - Cookies.setYearCookie("theme-" + APP_NAME, sheet); + window.Cookies.setYearCookie("theme-" + APP_NAME, sheet); Theme.theme.setAttribute("href", sheet + "?v=" + Date.now()); } static get() { - return Cookies.getCookie("theme-" + APP_NAME); + return window.Cookies.getCookie("theme-" + APP_NAME); } static setUserThemes() { @@ -52,7 +52,7 @@ class Theme{ out = out + this.UserThemes[0][i] + "," + this.UserThemes[1][i]; } - Cookies.setYearCookie("userThemes-" + APP_NAME, out); + window.Cookies.setYearCookie("userThemes-" + APP_NAME, out); } static removeUserTheme (index) { @@ -68,4 +68,6 @@ class Theme{ } } -Theme.init(); \ No newline at end of file +window.Theme = Theme; + +window.Theme.init(); \ No newline at end of file -- cgit v1.2.3