From 3640f9b944431b25c50b4c2dc80f80a100c54f53 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Tue, 9 Apr 2019 21:11:27 +0200 Subject: Made options accessible from normal fileviews --- src/main/resources/css/fileview.css | 2 +- src/main/resources/js/fileview.js | 54 ++++++++++++++++++------------------- 2 files changed, 28 insertions(+), 28 deletions(-) (limited to 'src/main') 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", ''); - document.getElementById("lightTheme").outerHTML = ""; - } else { - document.getElementsByTagName("head")[0] - .insertAdjacentHTML("beforeend", ''); - document.getElementById("darkTheme").outerHTML = ""; - } - }); -} +dark.addEventListener("change", () => { + if (dark.checked) { + document.getElementsByTagName("head")[0] + .insertAdjacentHTML("beforeend", ''); + document.getElementById("lightTheme").outerHTML = ""; + } else { + document.getElementsByTagName("head")[0] + .insertAdjacentHTML("beforeend", ''); + document.getElementById("darkTheme").outerHTML = ""; + } +}); -- cgit v1.2.3