diff --git a/data/js-view.js b/data/js-view.js index ce2301c..41d3a81 100644 --- a/data/js-view.js +++ b/data/js-view.js @@ -11,22 +11,34 @@ self.port.on("processSource", function () { (content === 'application/json') }; - if (contentIsAcceptable(content)) { + if (contentIsAcceptable(content)) { + var dontBeautify = false; + + if(window["JSViewAPI_jid1-u9RbFp9JcoEGGw"]) { + if(window["JSViewAPI_jid1-u9RbFp9JcoEGGw"].dontBeautify) + dontBeautify = true; + } + pre.setAttribute('class', 'line-numbers'); code.setAttribute('class', 'language-javascript'); - code.textContent = js_beautify(pre1.textContent, { - 'unescape_strings': true, - 'jslint_happy': true, - 'brace_style': 'collapse', - 'break_chained_methods': false, - 'indent_scripts': 'normal', - 'indent_size': 4, - 'keep_array_indentation': false, - 'preserve_newlines': true, - 'space_after_anon_function': true, - 'space_before_conditional': true - }); - + + if(!dontBeautify) { + code.textContent = js_beautify(pre1.textContent, { + 'unescape_strings': true, + 'jslint_happy': true, + 'brace_style': 'collapse', + 'break_chained_methods': false, + 'indent_scripts': 'normal', + 'indent_size': 4, + 'keep_array_indentation': false, + 'preserve_newlines': true, + 'space_after_anon_function': true, + 'space_before_conditional': true + }); + } else { + code.textContent = pre1.textContent; + } + pre.appendChild(code); body.replaceChild(pre, pre1);