Scaffold containerized Django/Wagtail app with core features
This commit is contained in:
13
static/js/consent.js
Normal file
13
static/js/consent.js
Normal file
@@ -0,0 +1,13 @@
|
||||
(function () {
|
||||
function parseCookieValue(name) {
|
||||
const match = document.cookie.match(new RegExp('(?:^|;)\\s*' + name + '\\s*=\\s*([^;]+)'));
|
||||
if (!match) return {};
|
||||
try {
|
||||
return Object.fromEntries(new URLSearchParams(match[1]));
|
||||
} catch (_e) {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
const c = parseCookieValue('nhAiConsent');
|
||||
window.__nhConsent = { analytics: c.a === '1', advertising: c.d === '1' };
|
||||
})();
|
||||
1
static/js/prism.js
Normal file
1
static/js/prism.js
Normal file
@@ -0,0 +1 @@
|
||||
/* placeholder for Prism.js bundle */
|
||||
7
static/js/theme.js
Normal file
7
static/js/theme.js
Normal file
@@ -0,0 +1,7 @@
|
||||
(function () {
|
||||
window.toggleTheme = function toggleTheme() {
|
||||
const root = document.documentElement;
|
||||
root.classList.toggle('dark');
|
||||
localStorage.setItem('theme', root.classList.contains('dark') ? 'dark' : 'light');
|
||||
};
|
||||
})();
|
||||
Reference in New Issue
Block a user