diff --git a/zerobin/default_settings.py b/zerobin/default_settings.py index f4e00bf..edab738 100644 --- a/zerobin/default_settings.py +++ b/zerobin/default_settings.py @@ -9,7 +9,7 @@ PORT = "3255" # Names/links to insert in the footer. # MENU = ( - ("Create paste", "/"), # First link will be highlighted + ("Create paste", "/"), ("Github", "https://github.com/Tygs/0bin"), ("Faq", "/faq/"), # You probably want to keep this # Any link with "mailto:" will be escaped to limit spam, but displayed diff --git a/zerobin/static/js/behavior.js b/zerobin/static/js/behavior.js index cf0499e..774800b 100644 --- a/zerobin/static/js/behavior.js +++ b/zerobin/static/js/behavior.js @@ -26,11 +26,13 @@ const app = new Vue({ downloadLink: {}, displayBottomToolBar: false, openPreviousPastesMenu: false, + readerMode: false, isUploading: false, currentPaste: { ownerKey: '', id: '', type: '', + content: '' }, newPaste: { expiration: '1_day', @@ -66,6 +68,28 @@ const app = new Vue({ }, methods: { + toggleReaderMode: function () { + if (!this.readerMode) { + this.messages = []; + this.currentPaste.content = zerobin.getPasteContent(); + } + + this.readerMode = !this.readerMode; + }, + + increaseFontSize: function (amount) { + let readableModeContent = document.getElementById('readable-paste-content') + + let fontSize = window.getComputedStyle(readableModeContent, null).getPropertyValue('font-size'); + + amount = amount || 5; + readableModeContent.style.fontSize = (parseFloat(fontSize) + amount) + "px"; + }, + + decreaseFontSize: function () { + this.increaseFontSize(-5); + }, + formatEmail: (email) => { return "mailto:" + email.replace('__AT__', '@'); }, diff --git a/zerobin/views/base.tpl b/zerobin/views/base.tpl index fd4bb1f..f251b35 100644 --- a/zerobin/views/base.tpl +++ b/zerobin/views/base.tpl @@ -11,6 +11,7 @@ + %if not settings.DEBUG: %else: @@ -26,7 +27,7 @@