diff options
author | Florian Pritz <bluewind@xinu.at> | 2012-10-29 00:01:40 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2012-10-29 00:01:40 +0100 |
commit | e36c3ab68634ef76ea06a6fed5b2cb0d5cbd97ed (patch) | |
tree | 5d2bedefeaa992d4bde1dd1d5d338411616503e5 /data/js | |
parent | b4e861155a122dd4871b6064c026efcefcc0f720 (diff) |
Add button to wrap long lines in code view
Since wrapping would break the line numbers we hide them.
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'data/js')
-rw-r--r-- | data/js/script.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/data/js/script.js b/data/js/script.js index 744722145..5faad3899 100644 --- a/data/js/script.js +++ b/data/js/script.js @@ -59,6 +59,18 @@ function fixedEncodeURIComponent (str) { return this; }); + window.lines_wrapped = false; + $('#linewrap').click(function() { + if (window.lines_wrapped == true) { + $(".content .numbers").show(); + $(".content .code > .highlight > pre").css("white-space", "pre"); + } else { + $(".content .numbers").hide(); + $(".content .code > .highlight > pre").css("white-space", "pre-wrap"); + } + window.lines_wrapped = !window.lines_wrapped; + }); + // check file size before uploading if browser support html5 if (window.File && window.FileList) { function checkFileUpload(evt) { |