From 59b910056f2e171d60ef635d6bca7308b3c617d2 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Mon, 13 May 2019 20:40:46 +0200 Subject: Improved dark mode in editor/fileview Co-authored-by: LarsVomMars --- src/main/resources/js/fileview.js | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'src/main/resources/js/fileview.js') diff --git a/src/main/resources/js/fileview.js b/src/main/resources/js/fileview.js index 80686bc..c368219 100644 --- a/src/main/resources/js/fileview.js +++ b/src/main/resources/js/fileview.js @@ -7,7 +7,6 @@ const body = document.body; // buttons const raw = document.getElementById("raw"); const code = document.getElementById("code"); -const dark = document.getElementById("dark"); const settings = document.getElementById("settings"); const originalContent = content.innerText; @@ -15,9 +14,9 @@ const originalContent = content.innerText; if (extension === "html") { preview.src = "data:text/html;charset=utf-8," + encodeURI(originalContent); - preview.style.display = "block"; + preview.style.display = "none"; raw.style.display = "block"; - content.style.display = "none"; + content.style.display = "block"; raw.addEventListener("click", () => { if (preview.style.display === "block") { @@ -67,15 +66,3 @@ code.addEventListener("change", () => { 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 = ""; - } -}); -- cgit v1.2.3