aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--css/style.css17
-rw-r--r--loggedin.js7
2 files changed, 19 insertions, 5 deletions
diff --git a/css/style.css b/css/style.css
index bc625a6..09456a3 100644
--- a/css/style.css
+++ b/css/style.css
@@ -307,6 +307,10 @@ input[type=submit]:hover {
background: white;
}
+.filecontents {
+ font-family: monospace;
+}
+
.filecontents.imgview {
background-color: black;
background-repeat: no-repeat;
@@ -319,8 +323,17 @@ input[type=submit]:hover {
}
.filecontents {
- padding: 0.8rem;
- font-size: 1.1rem;
+ overflow-y: scroll;
+}
+[contenteditable] {
+ outline: 0px solid transparent;
+}
+
+pre {
+ font-size: 1.3rem;
+ min-height: 100%;
+ margin: 0.3rem;
+ box-sizing: border-box;
}
.window h3,
diff --git a/loggedin.js b/loggedin.js
index 33721e7..9efbb75 100644
--- a/loggedin.js
+++ b/loggedin.js
@@ -318,8 +318,6 @@ function openfile_nondir() {
xhr.responseType = 'arraybuffer';
xhr.onload = function () {
let b = `data:image/png;base64,${base64ArrayBuffer(xhr.response)}`;
-
-
focus.filecontents.style.backgroundImage = `url('${b}')`;
focus.filecontents.classList.add('imgview');
focus.filecontents.innerText = "asdf";
@@ -329,8 +327,11 @@ function openfile_nondir() {
focus.filecontents.classList.remove('imgview');
focus.filecontents.style.backgroundImage = "unset";
+ var pre = mk(focus.filecontents, 'pre');
+
xhr.onload = function () {
- focus.filecontents.innerText = xhr.responseText;
+ pre.innerText = xhr.responseText;
+ pre.contentEditable = "true";
};
}