From c1424fac91d93f4c45e49a1206be3b439bc5ca1f Mon Sep 17 00:00:00 2001 From: NinjaCheetah <58050615+NinjaCheetah@users.noreply.github.com> Date: Sat, 23 Apr 2022 20:33:22 -0400 Subject: [PATCH] Auto update the copyright year --- JS/main.js | 17 +++++++++++++++++ JS/theme.js | 14 +++++++++++--- _includes/footer.html | 2 +- _includes/nav.html | 1 + _layouts/default.html | 1 + products/icons.html | 26 ++++++++++++++++++++++++++ 6 files changed, 57 insertions(+), 4 deletions(-) create mode 100644 JS/main.js create mode 100644 products/icons.html diff --git a/JS/main.js b/JS/main.js new file mode 100644 index 0000000..3288a14 --- /dev/null +++ b/JS/main.js @@ -0,0 +1,17 @@ +if (window.addEventListener) // W3C standard +{ + window.addEventListener('load', setFooterDate, false); +} +else if (window.attachEvent) // Microsoft +{ + window.attachEvent('onload', setFooterDate); +} + +function setFooterDate() { + var footerDate = document.getElementById("footerDate"); + let date = new Date().getFullYear(); + + footerDate.textContent = date; + + return; +} \ No newline at end of file diff --git a/JS/theme.js b/JS/theme.js index 2daa80a..90c6124 100644 --- a/JS/theme.js +++ b/JS/theme.js @@ -1,5 +1,14 @@ -window.onload = function() { - showTheme() +if (window.addEventListener) // W3C standard +{ + window.addEventListener('load', themeButtons, false); +} +else if (window.attachEvent) // Microsoft +{ + window.attachEvent('onload', themeButtons); +} + +function themeButtons() { + showTheme(); var lightButton = document.getElementById("lightTheme"); var roseButton = document.getElementById("roseTheme"); @@ -32,7 +41,6 @@ window.onload = function() { return false; } } - function swapStyleSheet(sheet) { document.getElementById("pagestyle").setAttribute("href", sheet); } diff --git a/_includes/footer.html b/_includes/footer.html index 50b9a50..0afb8a6 100644 --- a/_includes/footer.html +++ b/_includes/footer.html @@ -1,2 +1,2 @@
- + diff --git a/_includes/nav.html b/_includes/nav.html index f9151a2..01afc54 100644 --- a/_includes/nav.html +++ b/_includes/nav.html @@ -4,6 +4,7 @@ +