summaryrefslogtreecommitdiffstats
path: root/layouts/partials/scripts-front.html
diff options
context:
space:
mode:
authoramzrk22020-07-25 18:24:04 +0800
committeramzrk22020-07-25 18:24:04 +0800
commit73a776cccb9d1a993da6910c20166bafdd5c731e (patch)
treef4b38ce351315df6d13aa45ef303f49b2e2a6986 /layouts/partials/scripts-front.html
parent62ae83b7513c2c6c8bd857b7ed5f9f2f47512b43 (diff)
downloadhugo-theme-fuji-73a776cccb9d1a993da6910c20166bafdd5c731e.tar.gz
hugo-theme-fuji-73a776cccb9d1a993da6910c20166bafdd5c731e.tar.bz2
hugo-theme-fuji-73a776cccb9d1a993da6910c20166bafdd5c731e.zip
Update README
Diffstat (limited to 'layouts/partials/scripts-front.html')
-rw-r--r--layouts/partials/scripts-front.html34
1 files changed, 10 insertions, 24 deletions
diff --git a/layouts/partials/scripts-front.html b/layouts/partials/scripts-front.html
index 6b4d78b..c28912a 100644
--- a/layouts/partials/scripts-front.html
+++ b/layouts/partials/scripts-front.html
@@ -1,27 +1,13 @@
<script data-cfasync="false">
- // detect theme data in localStorage
- var fujiThemeData = localStorage.getItem('fuji_data-theme');
- // if first look, set theme mode to auto
- if (!fujiThemeData) {
- localStorage.setItem('fuji_data-theme', 'auto');
- } else {
- // if not auto mode, change the data-theme attribute of body
- if (fujiThemeData !== 'auto') {
- document.body.setAttribute('data-theme', fujiThemeData === 'dark' ? 'dark' : 'light');
- }
+ // detect theme data in localStorage
+ var fujiThemeData = localStorage.getItem('fuji_data-theme');
+ // if first look, set theme mode to auto
+ if (!fujiThemeData) {
+ localStorage.setItem('fuji_data-theme', 'auto');
+ } else {
+ // if not auto mode, change the data-theme attribute of body
+ if (fujiThemeData !== 'auto') {
+ document.body.setAttribute('data-theme', fujiThemeData === 'dark' ? 'dark' : 'light');
}
+ }
</script>
-<script data-cfasync="false">
- // ie detection
- function browserDetection(ua) {
- if (ua.indexOf('MSIE ') > 0 || ua.indexOf('Trident/') > 0) {
- return true;
- }
- return false;
- }
-
- var ua = window.navigator.userAgent;
- if (browserDetection(ua)) {
- window.location.href('{{ "/ie/" | absURL }}');
- }
-</script> \ No newline at end of file