From cc3ed697106e23a94bdfbb7696c09cdc6776f333 Mon Sep 17 00:00:00 2001 From: ksamuel Date: Thu, 13 Aug 2020 17:17:46 +0200 Subject: [PATCH] Replace pre reader mode by a div --- zerobin/static/css/style.css | 19 +++++++++++-------- zerobin/static/js/behavior.js | 2 +- zerobin/views/paste.tpl | 6 +++--- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/zerobin/static/css/style.css b/zerobin/static/css/style.css index 93d812f..c9ae342 100644 --- a/zerobin/static/css/style.css +++ b/zerobin/static/css/style.css @@ -196,7 +196,7 @@ input.hide-upload { margin: 8px 0 8px 0; } -.paste-wrapper img{ +.paste-wrapper img { width: 94%; } @@ -264,12 +264,12 @@ pre { border-bottom-left-radius: 3px !important; } -.download-link a{ - color: #eee; +.download-link a { + color: #eee; } -.download-link a:hover{ - text-decoration: none; +.download-link a:hover { + text-decoration: none; } .select-date { @@ -323,7 +323,6 @@ form textarea { clear: both; } - html.local-storage .no-local-storage { display: none; } @@ -503,6 +502,10 @@ nav ul li a:hover { font-size: 70%; } - - +} + +/* reader mode */ + +#readable-paste-content { + white-space: pre; } diff --git a/zerobin/static/js/behavior.js b/zerobin/static/js/behavior.js index 774800b..5f43a78 100644 --- a/zerobin/static/js/behavior.js +++ b/zerobin/static/js/behavior.js @@ -71,7 +71,6 @@ const app = new Vue({ toggleReaderMode: function () { if (!this.readerMode) { this.messages = []; - this.currentPaste.content = zerobin.getPasteContent(); } this.readerMode = !this.readerMode; @@ -758,6 +757,7 @@ if (content && key) { /* Decrypted content goes back to initial container*/ document.querySelector('#paste-content').innerText = content; + app.currentPaste.content = content if (content.indexOf('data:image') == 0) { // Display Image diff --git a/zerobin/views/paste.tpl b/zerobin/views/paste.tpl index d5c0bda..7b1c14c 100644 --- a/zerobin/views/paste.tpl +++ b/zerobin/views/paste.tpl @@ -60,9 +60,9 @@ -
-      {% currentPaste.content %}
-    
+
+ fsdqfd{% currentPaste.content %} +