From 40019624fd05b850cf33d280a8b788aea4e48cfa Mon Sep 17 00:00:00 2001 From: El RIDO Date: Sun, 18 Oct 2015 22:16:15 +0200 Subject: [PATCH] wrap long lines in plaintext format but force horizontal scroll on syntaxhighlighting, resolves #45 --- js/zerobin.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/js/zerobin.js b/js/zerobin.js index 149e455..bfe7ccc 100644 --- a/js/zerobin.js +++ b/js/zerobin.js @@ -578,14 +578,20 @@ $(function() { break; case 'syntaxhighlighting': if (typeof prettyPrint == 'function') prettyPrint(); + this.prettyMessage.css('overflow', 'auto'); default: // Convert URLs to clickable links. helper.urls2links(this.clearText); helper.urls2links(this.prettyPrint); this.clearText.addClass('hidden'); + if (format == 'plaintext') + { + this.prettyPrint.css('white-space', 'pre-wrap'); + this.prettyPrint.css('word-break', 'normal'); + this.prettyPrint.removeClass('prettyprint'); + } this.prettyMessage.removeClass('hidden'); } - if (format == 'plaintext') this.prettyPrint.removeClass('prettyprint'); }, /**