diff options
author | Marvin Borner | 2019-04-09 21:11:27 +0200 |
---|---|---|
committer | Marvin Borner | 2019-04-09 21:11:27 +0200 |
commit | 3640f9b944431b25c50b4c2dc80f80a100c54f53 (patch) | |
tree | 52c8e5375012beaf807f21355959d58c3e5d67d9 | |
parent | 40a3c3fa35c6ab6c852f6a996f77410c635a200c (diff) |
Made options accessible from normal fileviews
-rw-r--r-- | src/main/resources/css/fileview.css | 2 | ||||
-rw-r--r-- | src/main/resources/js/fileview.js | 54 |
2 files changed, 28 insertions, 28 deletions
diff --git a/src/main/resources/css/fileview.css b/src/main/resources/css/fileview.css index 349980b..60aa9c9 100644 --- a/src/main/resources/css/fileview.css +++ b/src/main/resources/css/fileview.css @@ -1,4 +1,4 @@ -.preview, .switch, .settings { +.preview, .switch { display: none; } diff --git a/src/main/resources/js/fileview.js b/src/main/resources/js/fileview.js index b0ceaf5..039d618 100644 --- a/src/main/resources/js/fileview.js +++ b/src/main/resources/js/fileview.js @@ -33,32 +33,32 @@ if (extension === "md" || extension === "html") { settings.style.display = "none"; } }); +} - code.addEventListener("change", () => { - if (code.checked) { - content.classList.remove("prettyprinted"); - content.innerHTML = ""; - content.classList.add("linenums"); - content.innerHTML = originalContent; - PR.prettyPrint(); - } else { - content.classList.remove("prettyprinted"); - content.innerHTML = ""; - content.classList.remove("linenums"); - content.innerHTML = originalContent; - PR.prettyPrint(); - } - }); +code.addEventListener("change", () => { + if (code.checked) { + content.classList.remove("prettyprinted"); + content.innerHTML = ""; + content.classList.add("linenums"); + content.innerHTML = originalContent; + PR.prettyPrint(); + } else { + content.classList.remove("prettyprinted"); + content.innerHTML = ""; + content.classList.remove("linenums"); + content.innerHTML = originalContent; + PR.prettyPrint(); + } +}); - dark.addEventListener("change", () => { - if (dark.checked) { - document.getElementsByTagName("head")[0] - .insertAdjacentHTML("beforeend", '<link id="darkTheme" href="/css/darkTheme.css" rel="stylesheet" />'); - document.getElementById("lightTheme").outerHTML = ""; - } else { - document.getElementsByTagName("head")[0] - .insertAdjacentHTML("beforeend", '<link id="lightTheme" href="/css/lightTheme.css" rel="stylesheet" />'); - document.getElementById("darkTheme").outerHTML = ""; - } - }); -} +dark.addEventListener("change", () => { + if (dark.checked) { + document.getElementsByTagName("head")[0] + .insertAdjacentHTML("beforeend", '<link id="darkTheme" href="/css/darkTheme.css" rel="stylesheet" />'); + document.getElementById("lightTheme").outerHTML = ""; + } else { + document.getElementsByTagName("head")[0] + .insertAdjacentHTML("beforeend", '<link id="lightTheme" href="/css/lightTheme.css" rel="stylesheet" />'); + document.getElementById("darkTheme").outerHTML = ""; + } +}); |