1c85730e15
Thanks to Anthhony, I now have a better option 🙇 Using `<script>toggleTheme('dark')</script>` directly from the markdown given it's already availale from the head declaration. As a bonus, we don't mess with user's preferences for other pages.master
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||
const selectedTheme = localStorage.getItem('theme') | const selectedTheme = localStorage.getItem('theme') | ||||
if (selectedTheme && selectedTheme !== 'undefined') { | if (selectedTheme && selectedTheme !== 'undefined') { | ||||
form.querySelector(`[value="${selectedTheme}"]`).checked = true | form.querySelector(`[value="${selectedTheme}"]`).checked = true | ||||
// Also manually dispatch the event in case I want | |||||
// to force a default given theme from the article with: | |||||
// localStorage.setItem('theme', 'dark') | |||||
form.value = selectedTheme | |||||
const changeEvent = new Event('change') | |||||
form.dispatchEvent(changeEvent) | |||||
} | } | ||||
} | } | ||||