aboutsummaryrefslogtreecommitdiff
path: root/src/main/resources/js/fileview.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/resources/js/fileview.js')
-rw-r--r--src/main/resources/js/fileview.js17
1 files changed, 2 insertions, 15 deletions
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", '<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 = "";
- }
-});