corrade-nucleus-nucleons – Blame information for rev 2
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
2 | office | 1 | <html> |
2 | <!-- |
||
3 | The MIT License (MIT) |
||
4 | |||
5 | Copyright (c) 2007-2017 Einar Lielmanis, Liam Newman, and contributors. |
||
6 | |||
7 | Permission is hereby granted, free of charge, to any person |
||
8 | obtaining a copy of this software and associated documentation files |
||
9 | (the "Software"), to deal in the Software without restriction, |
||
10 | including without limitation the rights to use, copy, modify, merge, |
||
11 | publish, distribute, sublicense, and/or sell copies of the Software, |
||
12 | and to permit persons to whom the Software is furnished to do so, |
||
13 | subject to the following conditions: |
||
14 | |||
15 | The above copyright notice and this permission notice shall be |
||
16 | included in all copies or substantial portions of the Software. |
||
17 | |||
18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
||
19 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
||
20 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
||
21 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS |
||
22 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN |
||
23 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
||
24 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
||
25 | SOFTWARE. |
||
26 | --> |
||
27 | |||
28 | <head> |
||
29 | <!-- if you feel an urge to move this to bootstrap or something, you're most welcome --> |
||
30 | <meta charset="utf-8"> |
||
31 | <title>Online JavaScript beautifier</title> |
||
32 | <link rel="icon" href="web/favicon.png" type="image/png"> |
||
33 | <link rel="stylesheet" href="web/third-party/codemirror/lib/codemirror.css"> |
||
34 | |||
35 | <script src="web/third-party/codemirror/lib/codemirror.js"></script> |
||
36 | <script src="web/third-party/codemirror/mode/javascript/javascript.js"></script> |
||
37 | |||
38 | <style> |
||
39 | body { |
||
40 | background: #eee; |
||
41 | color: #333; |
||
42 | } |
||
43 | img { |
||
44 | border: 0; |
||
45 | } |
||
46 | a.self { |
||
47 | font-weight: bold; |
||
48 | text-decoration: none; |
||
49 | color: #444; |
||
50 | border-bottom: 1px solid #aaa |
||
51 | } |
||
52 | p, select, label, .blurb, a.turn-off-codemirror { |
||
53 | font:13px/1.231 arial, sans-serif; |
||
54 | *font-size:small; |
||
55 | } |
||
56 | a.turn-off-codemirror { |
||
57 | margin-left: 25px; |
||
58 | } |
||
59 | button.submit { |
||
60 | width: 100%; |
||
61 | padding: 10px 0; |
||
62 | cursor: pointer; |
||
63 | margin: 0; |
||
64 | } |
||
65 | button.submit em { |
||
66 | font-size: 11px; |
||
67 | font-style: normal; |
||
68 | color: #999; |
||
69 | } |
||
70 | label { |
||
71 | cursor: pointer; |
||
72 | } |
||
73 | select { |
||
74 | width: 220px; |
||
75 | } |
||
76 | table#options { |
||
77 | float: right; |
||
78 | } |
||
79 | table#options td { |
||
80 | vertical-align: top; |
||
81 | padding-left: 10px; |
||
82 | } |
||
83 | .col-6 { |
||
84 | width: 50%; |
||
85 | float: left; |
||
86 | } |
||
87 | #about { |
||
88 | float: left; |
||
89 | } |
||
90 | #about p { |
||
91 | margin: 0 6px 6px 0; |
||
92 | } |
||
93 | .uses li { |
||
94 | padding-top: 3px; |
||
95 | line-height: 150%; |
||
96 | } |
||
97 | .uses li.sep { |
||
98 | margin-top: 8px; |
||
99 | } |
||
100 | #testresults { |
||
101 | display: none; |
||
102 | font-family: monaco, "lucida console", "courier new", monospace; |
||
103 | } |
||
104 | .CodeMirror { |
||
105 | border: 1px solid #ccc; |
||
106 | height: 450px; |
||
107 | font-size: 90%; |
||
108 | margin-bottom: 6px; |
||
109 | background: white; |
||
110 | } |
||
111 | p { |
||
112 | margin-left: 40px; |
||
113 | margin-right: 40px; |
||
114 | } |
||
115 | a { |
||
116 | white-space: nowrap; |
||
117 | color: #36d; |
||
118 | } |
||
119 | .contributor-sep { |
||
120 | clear: left; |
||
121 | border-top: 1px solid #ccc; |
||
122 | padding-top: 8px; |
||
123 | } |
||
124 | h2 { |
||
125 | margin-top: 32px; |
||
126 | margin-left: 40px; |
||
127 | margin-bottom: 0; |
||
128 | font-size: 20px; |
||
129 | font-weight: normal; |
||
130 | } |
||
131 | </style> |
||
132 | |||
133 | <script src="web/third-party/jquery/jquery.js"></script> |
||
134 | <script src="web/third-party/jquery/jquery.cookie.js"></script> |
||
135 | |||
136 | <script src="js/lib/beautify.js"></script> |
||
137 | <script src="js/lib/beautify-css.js"></script> |
||
138 | <script src="js/lib/beautify-html.js"></script> |
||
139 | <script src="js/test/sanitytest.js"></script> |
||
140 | <script src="js/test/generated/beautify-javascript-tests.js"></script> |
||
141 | <script src="js/test/generated/beautify-css-tests.js"></script> |
||
142 | <script src="js/test/generated/beautify-html-tests.js"></script> |
||
143 | <script src="js/lib/unpackers/javascriptobfuscator_unpacker.js"></script> |
||
144 | <script src="js/lib/unpackers/urlencode_unpacker.js"></script> |
||
145 | <script src="js/lib/unpackers/p_a_c_k_e_r_unpacker.js"></script> |
||
146 | <script src="js/lib/unpackers/myobfuscate_unpacker.js"></script> |
||
147 | |||
148 | <script> |
||
149 | var the = { |
||
150 | use_codemirror: (!window.location.href.match(/without-codemirror/)), |
||
151 | beautify_in_progress: false, |
||
152 | editor: null // codemirror editor |
||
153 | }; |
||
154 | |||
155 | function run_tests() { |
||
156 | var st = new SanityTest(); |
||
157 | run_javascript_tests(st, Urlencoded, js_beautify, html_beautify, css_beautify); |
||
158 | run_css_tests(st, Urlencoded, js_beautify, html_beautify, css_beautify); |
||
159 | run_html_tests(st, Urlencoded, js_beautify, html_beautify, css_beautify); |
||
160 | JavascriptObfuscator.run_tests(st); |
||
161 | P_A_C_K_E_R.run_tests(st); |
||
162 | Urlencoded.run_tests(st); |
||
163 | MyObfuscate.run_tests(st); |
||
164 | var results = st.results_raw() |
||
165 | .replace(/&/g, '&') |
||
166 | .replace(/g, '<') |
||
167 | .replace(/>/g, '>') |
||
168 | .replace(/ /g, ' ') |
||
169 | .replace(/\r/g, '·') |
||
170 | .replace(/\n/g, '<br>'); |
||
171 | $('#testresults').html(results).show(); |
||
172 | } |
||
173 | |||
174 | |||
175 | function any(a, b) { |
||
176 | return a || b; |
||
177 | } |
||
178 | |||
179 | function read_settings_from_cookie() { |
||
180 | $('#tabsize').val(any($.cookie('tabsize'), '4')); |
||
181 | $('#brace-style').val(any($.cookie('brace-style'), 'collapse')); |
||
182 | $('#detect-packers').prop('checked', $.cookie('detect-packers') !== 'off'); |
||
183 | $('#max-preserve-newlines').val(any($.cookie('max-preserve-newlines'), '5')); |
||
184 | $('#keep-array-indentation').prop('checked', $.cookie('keep-array-indentation') === 'on'); |
||
185 | $('#break-chained-methods').prop('checked', $.cookie('break-chained-methods') === 'on'); |
||
186 | $('#indent-scripts').val(any($.cookie('indent-scripts'), 'normal')); |
||
187 | $('#space-before-conditional').prop('checked', $.cookie('space-before-conditional') !== 'off'); |
||
188 | $('#wrap-line-length').val(any($.cookie('wrap-line-length'), '0')); |
||
189 | $('#unescape-strings').prop('checked', $.cookie('unescape-strings') === 'on'); |
||
190 | $('#jslint-happy').prop('checked', $.cookie('jslint-happy') === 'on'); |
||
191 | $('#end-with-newline').prop('checked', $.cookie('end-with-newline') === 'on'); |
||
192 | $('#indent-inner-html').prop('checked', $.cookie('indent-inner-html') === 'on'); |
||
193 | $('#comma-first').prop('checked', $.cookie('comma-first') === 'on'); |
||
194 | $('#e4x').prop('checked', $.cookie('e4x') === 'on'); |
||
195 | } |
||
196 | |||
197 | function store_settings_to_cookie() { |
||
198 | var opts = { |
||
199 | expires: 360 |
||
200 | }; |
||
201 | $.cookie('tabsize', $('#tabsize').val(), opts); |
||
202 | $.cookie('brace-style', $('#brace-style').val(), opts); |
||
203 | $.cookie('detect-packers', $('#detect-packers').prop('checked') ? 'on' : 'off', opts); |
||
204 | $.cookie('max-preserve-newlines', $('#max-preserve-newlines').val(), opts); |
||
205 | $.cookie('keep-array-indentation', $('#keep-array-indentation').prop('checked') ? 'on' : 'off', opts); |
||
206 | $.cookie('break-chained-methods', $('#break-chained-methods').prop('checked') ? 'on' : 'off', opts); |
||
207 | $.cookie('space-before-conditional', $('#space-before-conditional').prop('checked') ? 'on' : 'off', |
||
208 | opts); |
||
209 | $.cookie('unescape-strings', $('#unescape-strings').prop('checked') ? 'on' : 'off', opts); |
||
210 | $.cookie('jslint-happy', $('#jslint-happy').prop('checked') ? 'on' : 'off', opts); |
||
211 | $.cookie('end-with-newline', $('#end-with-newline').prop('checked') ? 'on' : 'off', opts); |
||
212 | $.cookie('wrap-line-length', $('#wrap-line-length').val(), opts); |
||
213 | $.cookie('indent-scripts', $('#indent-scripts').val(), opts); |
||
214 | $.cookie('indent-inner-html', $('#indent-inner-html').prop('checked') ? 'on' : 'off', opts); |
||
215 | $.cookie('comma-first', $('#comma-first').prop('checked') ? 'on' : 'off', opts); |
||
216 | $.cookie('e4x', $('#e4x').prop('checked') ? 'on' : 'off', opts); |
||
217 | |||
218 | } |
||
219 | |||
220 | function unpacker_filter(source) { |
||
221 | var trailing_comments = '', |
||
222 | comment = '', |
||
223 | unpacked = '', |
||
224 | found = false; |
||
225 | |||
226 | // cut trailing comments |
||
227 | do { |
||
228 | found = false; |
||
229 | if (/^\s*\/\*/.test(source)) { |
||
230 | found = true; |
||
231 | comment = source.substr(0, source.indexOf('*/') + 2); |
||
232 | source = source.substr(comment.length).replace(/^\s+/, ''); |
||
233 | trailing_comments += comment + "\n"; |
||
234 | } else if (/^\s*\/\//.test(source)) { |
||
235 | found = true; |
||
236 | comment = source.match(/^\s*\/\/.*/)[0]; |
||
237 | source = source.substr(comment.length).replace(/^\s+/, ''); |
||
238 | trailing_comments += comment + "\n"; |
||
239 | } |
||
240 | } while (found); |
||
241 | |||
242 | var unpackers = [P_A_C_K_E_R, Urlencoded, JavascriptObfuscator/*, MyObfuscate*/]; |
||
243 | for (var i = 0; i < unpackers.length; i++) { |
||
244 | if (unpackers[i].detect(source)) { |
||
245 | unpacked = unpackers[i].unpack(source); |
||
246 | if (unpacked != source) { |
||
247 | source = unpacker_filter(unpacked); |
||
248 | } |
||
249 | } |
||
250 | } |
||
251 | |||
252 | return trailing_comments + source; |
||
253 | } |
||
254 | |||
255 | |||
256 | function beautify() { |
||
257 | if (the.beautify_in_progress) return; |
||
258 | |||
259 | store_settings_to_cookie(); |
||
260 | |||
261 | the.beautify_in_progress = true; |
||
262 | |||
263 | var source = the.editor ? the.editor.getValue() : $('#source').val(), |
||
264 | output, |
||
265 | opts = {}; |
||
266 | |||
267 | opts.indent_size = $('#tabsize').val(); |
||
268 | opts.indent_char = opts.indent_size == 1 ? '\t' : ' '; |
||
269 | opts.max_preserve_newlines = $('#max-preserve-newlines').val(); |
||
270 | opts.preserve_newlines = opts.max_preserve_newlines !== "-1"; |
||
271 | opts.keep_array_indentation = $('#keep-array-indentation').prop('checked'); |
||
272 | opts.break_chained_methods = $('#break-chained-methods').prop('checked'); |
||
273 | opts.indent_scripts = $('#indent-scripts').val(); |
||
274 | opts.brace_style = $('#brace-style').val() + ($('#brace-preserve-inline').prop('checked') ? ",preserve-inline" : ""); |
||
275 | opts.space_before_conditional = $('#space-before-conditional').prop('checked'); |
||
276 | opts.unescape_strings = $('#unescape-strings').prop('checked'); |
||
277 | opts.jslint_happy = $('#jslint-happy').prop('checked'); |
||
278 | opts.end_with_newline = $('#end-with-newline').prop('checked'); |
||
279 | opts.wrap_line_length = $('#wrap-line-length').val(); |
||
280 | opts.indent_inner_html = $('#indent-inner-html').prop('checked'); |
||
281 | opts.comma_first = $('#comma-first').prop('checked'); |
||
282 | opts.e4x = $('#e4x').prop('checked'); |
||
283 | |||
284 | if (looks_like_html(source)) { |
||
285 | output = html_beautify(source, opts); |
||
286 | } else { |
||
287 | if ($('#detect-packers').prop('checked')) { |
||
288 | source = unpacker_filter(source); |
||
289 | } |
||
290 | output = js_beautify(source, opts); |
||
291 | } |
||
292 | if (the.editor) { |
||
293 | the.editor.setValue(output); |
||
294 | } else { |
||
295 | $('#source').val(output); |
||
296 | } |
||
297 | |||
298 | the.beautify_in_progress = false; |
||
299 | } |
||
300 | |||
301 | function looks_like_html(source) { |
||
302 | // <foo> - looks like html |
||
303 | var trimmed = source.replace(/^[ \t\n\r]+/, ''); |
||
304 | return trimmed && (trimmed.substring(0, 1) === '<'); |
||
305 | } |
||
306 | </script> |
||
307 | </head> |
||
308 | |||
309 | <body> |
||
310 | |||
311 | <div id="about"> |
||
312 | <p> |
||
313 | <a class="self" href="./">Beautify, unpack or deobfuscate JavaScript and HTML, make JSON/JSONP readable, etc.</a> |
||
314 | </p> |
||
315 | <p> |
||
316 | All of the source code is completely free and open, available on <a href="https://github.com/beautify-web/js-beautify">GitHub</a> under MIT licence, |
||
317 | <br>and we have a command-line version, python library and a <a href="https://npmjs.org/package/js-beautify">node package</a> as well. |
||
318 | </p> |
||
319 | </div> |
||
320 | |||
321 | |||
322 | <table id="options"> |
||
323 | <tr> |
||
324 | <td> |
||
325 | <select name="tabsize" id="tabsize"> |
||
326 | <option value="1">Indent with a tab character</option> |
||
327 | <option value="2">Indent with 2 spaces</option> |
||
328 | <option value="3">Indent with 3 spaces</option> |
||
329 | <option value="4">Indent with 4 spaces</option> |
||
330 | <option value="8">Indent with 8 spaces</option> |
||
331 | </select> |
||
332 | <br> |
||
333 | |||
334 | <select name="max-preserve-newlines" id="max-preserve-newlines"> |
||
335 | <option value="-1">Remove all extra newlines</option> |
||
336 | <option value="1">Allow 1 newline between tokens</option> |
||
337 | <option value="2">Allow 2 newlines between tokens</option> |
||
338 | <option value="5">Allow 5 newlines between tokens</option> |
||
339 | <option value="10">Allow 10 newlines between tokens</option> |
||
340 | <option value="0">Allow unlimited newlines between tokens</option> |
||
341 | </select> |
||
342 | <br> |
||
343 | |||
344 | <select name="wrap-line-length" id="wrap-line-length"> |
||
345 | <option value="0">Do not wrap lines</option> |
||
346 | <option value="40">Wrap lines near 40 characters</option> |
||
347 | <option value="70">Wrap lines near 70 characters</option> |
||
348 | <option value="80">Wrap lines near 80 characters</option> |
||
349 | <option value="110">Wrap lines near 110 characters</option> |
||
350 | <option value="120">Wrap lines near 120 characters</option> |
||
351 | <option value="160">Wrap lines near 160 characters</option> |
||
352 | </select> |
||
353 | <br> |
||
354 | |||
355 | <select id="brace-style"> |
||
356 | <option value="collapse">Braces with control statement</option> |
||
357 | <option value="expand">Braces on own line</option> |
||
358 | <option value="end-expand">End braces on own line</option> |
||
359 | <option value="none">Attempt to keep braces where they are</option> |
||
360 | </select> |
||
361 | |||
362 | <p style="margin:6px 0 0 0">HTML <style>, <script> formatting:</p> |
||
363 | <select id="indent-scripts"> |
||
364 | <option value="keep">Keep indent level of the tag</option> |
||
365 | <option value="normal">Add one indent level</option> |
||
366 | <option value="separate">Separate indentation</option> |
||
367 | </select> |
||
368 | |||
369 | </td> |
||
370 | <td> |
||
371 | <input class="checkbox" type="checkbox" id="end-with-newline"> |
||
372 | <label for="end-with-newline">End script and style with newline?</label> |
||
373 | <br> |
||
374 | <input class="checkbox" type="checkbox" id="e4x"> |
||
375 | <label for="e4x">Support e4x/jsx syntax</label> |
||
376 | <br> |
||
377 | <input class="checkbox" type="checkbox" id="comma-first"> |
||
378 | <label for="comma-first">Use comma-first list style?</label> |
||
379 | <br> |
||
380 | <input class="checkbox" type="checkbox" id="detect-packers"> |
||
381 | <label for="detect-packers">Detect packers and obfuscators?</label> |
||
382 | <br> |
||
383 | <input class="checkbox" type="checkbox" id="brace-preserve-inline"> |
||
384 | <label for="brace-preserve-inline">Preserve inline braces/code blocks?</label> |
||
385 | <br> |
||
386 | <input class="checkbox" type="checkbox" id="keep-array-indentation"> |
||
387 | <label for="keep-array-indentation">Keep array indentation?</label> |
||
388 | <br> |
||
389 | <input class="checkbox" type="checkbox" id="break-chained-methods"> |
||
390 | <label for="break-chained-methods">Break lines on chained methods?</label> |
||
391 | <br> |
||
392 | <input class="checkbox" type="checkbox" id="space-before-conditional"> |
||
393 | <label for="space-before-conditional">Space before conditional: "if(x)" / "if (x)"</label> |
||
394 | <br> |
||
395 | <input class="checkbox" type="checkbox" id="unescape-strings"> |
||
396 | <label for="unescape-strings">Unescape printable chars encoded as \xNN or \uNNNN?</label> |
||
397 | <br> |
||
398 | <input class="checkbox" type="checkbox" id="jslint-happy"> |
||
399 | <label for="jslint-happy">Use JSLint-happy formatting tweaks?</label> |
||
400 | <br> |
||
401 | <input class="checkbox" type="checkbox" id="indent-inner-html"> |
||
402 | <label for="indent-inner-html">Indent <head> and <body> sections?</label> |
||
403 | <br><a href="?without-codemirror" class="turn-off-codemirror">Use a simple textarea for code input?</a> |
||
404 | |||
405 | |||
406 | </td> |
||
407 | </tr> |
||
408 | </table> |
||
409 | |||
410 | <div style="line-height: 0"> |
||
411 | <button class="submit"><strong>Beautify JavaScript or HTML</strong> <em>(ctrl-enter)</em> |
||
412 | </button> |
||
413 | <textarea id="source" rows="30" cols="160"></textarea> |
||
414 | <button class="submit"><strong>Beautify JavaScript or HTML</strong> <em>(ctrl-enter)</em> |
||
415 | </button> |
||
416 | </div> |
||
417 | |||
418 | <div class="blurb"> |
||
419 | |||
420 | <h2>Browser extensions and other uses</h2> |
||
421 | <div class="col-6"> |
||
422 | <ul class="uses"> |
||
423 | |||
424 | <li>A <a href="javascript:(function(){s=document.getElementsByTagName('SCRIPT');tx='';sr=[];for(i=0;i<s.length;i++){with(s.item(i)){t=text;if(t){tx+=t;}else{sr.push(src)};}};with(window.open()){document.write('<textarea id="t">'+(sr.join("\n"))+"\n\n-----\n\n"+tx+'</textarea><script src="http://jsbeautifier.org/beautify.js"></script><script>with(document.getElementById("t")){value=js_beautify(value);with(style){width="99%";height="99%";borderStyle="none";}};</script>');document.close();}})();"><strong>bookmarklet</strong></a> (drag |
||
425 | it to your bookmarks) by Ichiro Hiroshi to see all scripts used on the page,</li> |
||
426 | |||
427 | <li><strong>Chrome</strong>, in case the built-in CSS and javascript formatting isn't enough for you:<br> |
||
428 | — <a href="https://chrome.google.com/webstore/detail/cfmcghennfbpmhemnnfjhkdmnbidpanb">Quick source viewer</a> by Tomi Mickelsson (<a href="https://github.com/tomimick/chrome-ext-view-src">github</a>, <a href="http://tomicloud.com/2012/07/viewsrc-chrome-ext">blog</a>),<br> |
||
429 | — <a href="https://chrome.google.com/webstore/detail/javascript-and-css-code-b/iiglodndmmefofehaibmaignglbpdald">Javascript and CSS Code beautifier</a> by c7sky,<br> |
||
430 | — <a href="https://chrome.google.com/webstore/detail/jsbeautify-for-google-chr/kkioiolcacgoihiiekambdciinadbpfk">jsbeautify-for-chrome</a> by Tom Rix (<a href="https://github.com/rixth/jsbeautify-for-chrome">github</a>),<br> |
||
431 | — <a href="https://chrome.google.com/webstore/detail/piekbefgpgdecckjcpffhnacjflfoddg">Pretty Beautiful JavaScript</a> by Will McSweeney<br> |
||
432 | — <a href="https://chrome.google.com/webstore/detail/stackoverflow-code-beauti/pljeafjjkkbacckkollfejkciddacmeb">Stackoverflow Code Beautify</a> by Making Odd Edit Studios (<a href="https://github.com/MakingOddEdit/CodeBeautify">github</a>). |
||
433 | </li> |
||
434 | <li><strong>Firefox</strong>: <a href="https://addons.mozilla.org/en-US/firefox/addon/javascript-deminifier/">Javascript deminifier</a> by Ben Murphy, to be |
||
435 | used together with the firebug (<a href="https://github.com/benmmurphy/jsdeminifier_xpi/">github</a>),</li> |
||
436 | <li><strong>Safari</strong>: <a href="http://spadin.github.com/js-beautify-safari-extension">Safari extension</a> by Sandro Padin,</li> |
||
437 | <li><strong>Opera</strong>: <a href="https://addons.opera.com/addons/extensions/details/readable-javascript/">Readable JavaScript</a> |
||
438 | (<a href="https://github.com/Dither/readable-javascript">github</a>) by Dither,</li> |
||
439 | <li><strong>Opera</strong>: <a href="https://addons.opera.com/addons/extensions/details/source/">Source</a> extension by Deathamns,</li> |
||
440 | <li><strong>Sublime Text 2/3:</strong> <a href="https://github.com/akalongman/sublimetext-codeformatter">CodeFormatter</a>, a python plugin by Avtandil Kikabidze, supports HTML, CSS, JS and a bunch of other languages,</li> |
||
441 | <li><strong>Sublime Text 2/3:</strong> <a href="https://github.com/victorporof/Sublime-HTMLPrettify">HTMLPrettify</a>, a javascript plugin by Victor Porof,</li> |
||
442 | <li><strong>Sublime Text 2:</strong> <a href="https://github.com/jdc0589/JsFormat">JsFormat</a>, a javascript formatting plugin for this nice editor by Davis |
||
443 | Clark,</li> |
||
444 | <li><strong>vim:</strong> <a href="https://github.com/michalliu/sourcebeautify.vim">sourcebeautify.vim</a>, a plugin by michalliu (requires node.js, V8, SpiderMonkey |
||
445 | or cscript js engine),</li> |
||
446 | <li><strong>vim:</strong> <a href="https://github.com/maksimr/vim-jsbeautify">vim-jsbeautify</a>, a plugin by Maksim Ryzhikov (node.js or V8 required),</li> |
||
447 | |||
448 | <li><strong>Emacs:</strong> <a href="https://github.com/yasuyk/web-beautify">Web-beautify</a> formatting package by Yasuyuki Oka,</li> |
||
449 | <li><strong>Komodo IDE:</strong> <a href="http://komodoide.com/packages/addons/beautify-js/">Beautify-js</a> addon by Bob de Haas (<a href="https://github.com/babobski/Beautify-js">github</a>),</li> |
||
450 | <li><strong>C#:</strong> ghost6991 <a href="https://github.com/ghost6991/Jsbeautifier">ported the javascript formatter to C#</a>, |
||
451 | <li><strong>Go:</strong> ditashi has <a href="https://github.com/ditashi/jsbeautifier-go">ported the javascript formatter to golang</a>, |
||
452 | </ul> |
||
453 | </div> |
||
454 | <div class="col-6"> |
||
455 | <ul class="uses"> |
||
456 | <li><a href="https://marketplace.visualstudio.com/items/HookyQR.beautify">Beautify plugin</a> (<a href="https://github.com/HookyQR/VSCodeBeautify">github</a>) by HookyQR for the <a href="https://code.visualstudio.com/">Visual Studio Code</a> IDE</a>, |
||
457 | <li><a href="http://fiddler2.com/">Fiddler</a> proxy: <a href="http://fiddler2.com/Fiddler2/extensions.asp">JavaScript Formatter addon</a>, |
||
458 | <li><a href="https://github.com/nagaozen/gedit-tunnings/">gEdit tips</a> by Fabio Nagao,</li> |
||
459 | <li><a href="http://akelpad.sourceforge.net/forum/viewtopic.php?p=11246#11246">Akelpad extension</a> by Infocatcher,</li> |
||
460 | <li>Beautifier in <a href="http://sethmason.com/2011/04/28/jsbeautify-in-emacs.html">Emacs</a> write-up by Seth Mason,</li> |
||
461 | <li><a href="http://c9.io">Cloud9</a>, a lovely IDE running in a browser, working in the node/cloud, uses jsbeautifier (<a href="https://github.com/ajaxorg/cloud9">github</a>),</li> |
||
462 | <li><a href="https://www.comment-devenir-un-hacker.com/app.html">Devenir Hacker App</a>, a non-free JavaScript packer for Mac,</li> |
||
463 | <li><a href="http://www.restconsole.com/">REST Console</a>, a request debugging tool for Chrome, beautifies JSON responses (<a href="https://github.com/codeinchaos/rest-console">github</a>),</li> |
||
464 | <li><a href="http://mitmproxy.org/">mitmproxy</a>, a nifty SSL-capable HTTP proxy, provides pretty javascript responses (<a href="https://github.com/cortesi/mitmproxy">github</a>).</li> |
||
465 | <li><a href="http://www.wakanda.org/">wakanda</a>, a neat IDE for web and mobile applications has a <a href="http://forum.wakanda.org/showthread.php?1483-3-new-extensions-JSLint-Beautifier-and-Snippet">Beautifier extension</a> |
||
466 | (<a href="https://github.com/Wakanda/wakanda-extensions/tree/master/Beautifier">github</a>).</li> |
||
467 | <li><a href="http://portswigger.net/burp/">Burp Suite</a> now has a <a href="https://github.com/irsdl/BurpSuiteJSBeautifier/">beautfier extension</a>, |
||
468 | thanks to Soroush Dalili,</li> |
||
469 | <li><a href="http://plugins.netbeans.org/plugin/43263/jsbeautify">Netbeans jsbeautify</a> plugin by Drew Hamlett |
||
470 | (<a href="https://github.com/drewhjava/netbeans-jsbeautify">github</a>).</li> |
||
471 | <li><a href="https://github.com/drewhjava/brackets-beautify">brackets-beautify-extension</a> for <a href="http://brackets.io">Adobe Brackets</a> by Drew |
||
472 | Hamlett (<a href="https://github.com/drewhjava/brackets-beautify">github</a>),</li> |
||
473 | <li><a href="http://codecaddy.net/">codecaddy.net</a>, a collection of webdev-related tools, assembled by Darik Hall, |
||
474 | <li><a href="http://www.editey.com/">editey.com</a>, an interesting and free Google-Drive oriented editor uses this beautifier, |
||
475 | <li><a href="https://github.com/vkadam/grunt-jsbeautifier">a beautifier plugin for Grunt</a> by Vishal Kadam, |
||
476 | <li><a href="http://www.uvviewsoft.com/synwrite/">SynWrite</a> editor has a JsFormat plugin (<a href="https://sourceforge.net/projects/synwrite-addons/files/PyPlugins/Alexey.JsFormat/">rar</a>, <a href="http://synwrite.sourceforge.net/forums/viewtopic.php?f=19&t=865">readme</a>), |
||
477 | <li><a href="http://liveditor.com/">LIVEditor</a>, a live-editing HTML/CSS/JS IDE (commercial, Windows-only) uses the library, |
||
478 | </ul> |
||
479 | </div> |
||
480 | <p>Doing anything interesting? Write us to <b>team@jsbeautifier.org</b> so we can add your project to the list.</p> |
||
481 | |||
482 | <p class="contributor-sep">Written by <a href="https://github.com/einars">Einar Lielmanis</a>, maintained and evolved by <a href="https://github.com/bitwiseman/">Liam Newman</a>.</p> |
||
483 | <p>We use the wonderful <a href="http://codemirror.net">CodeMirror</a> syntax highlighting editor, written by Marijn Haverbeke. |
||
484 | </p> |
||
485 | <p class="contributors">Made with a great help of Jason Diamond, Patrick Hof, Nochum Sossonko, Andreas Schneider, |
||
486 | <br>Dave Vasilevsky, |
||
487 | <a href="https://moikrug.ru/vital">Vital Batmanov</a>, Ron Baldwin, Gabriel Harrison, |
||
488 | <a href="http://shullian.com">Chris J. Shull</a>, |
||
489 | <a href="http://mathiasbynens.be/">Mathias Bynens</a>, |
||
490 | <br> |
||
491 | <a href="https://www.vittgam.net/">Vittorio Gambaletta</a>, |
||
492 | <a href="https://github.com/esseks">Stefano Sanfilippo</a> and |
||
493 | <a href="https://github.com/evocateur">Daniel Stockman</a>. |
||
494 | </p> |
||
495 | |||
496 | <p style="text-align:right"> |
||
497 | <a href="#" style="color: #ccc; border-bottom: 1px dashed #ccc; text-decoration: none;" onclick="run_tests(); return false;">Run the tests</a> |
||
498 | </p> |
||
499 | |||
500 | </div> |
||
501 | <div id="testresults"></div> |
||
502 | <script> |
||
503 | $(function () { |
||
504 | |||
505 | read_settings_from_cookie(); |
||
506 | |||
507 | var default_text = |
||
508 | "// This is just a sample script. Paste your real code (javascript or HTML) here.\n\nif ('this_is'==/an_example/){of_beautifier();}else{var a=b?(c%d):e[f];}"; |
||
509 | var textArea = $('#source')[0]; |
||
510 | |||
511 | if (the.use_codemirror && typeof CodeMirror !== 'undefined') { |
||
512 | the.editor = CodeMirror.fromTextArea(textArea, { |
||
513 | theme: 'default', |
||
514 | lineNumbers: true |
||
515 | }); |
||
516 | the.editor.focus(); |
||
517 | |||
518 | the.editor.setValue(default_text); |
||
519 | $('.CodeMirror').click(function () { |
||
520 | if (the.editor.getValue() == default_text) { |
||
521 | the.editor.setValue(''); |
||
522 | } |
||
523 | }); |
||
524 | } else { |
||
525 | $('#source').val(default_text).bind('click focus', function () { |
||
526 | if ($(this).val() == default_text) { |
||
527 | $(this).val(''); |
||
528 | } |
||
529 | }).bind('blur', function () { |
||
530 | if (!$(this).val()) { |
||
531 | $(this).val(default_text); |
||
532 | } |
||
533 | }); |
||
534 | } |
||
535 | |||
536 | |||
537 | $(window).bind('keydown', function (e) { |
||
538 | if (e.ctrlKey && e.keyCode == 13) { |
||
539 | beautify(); |
||
540 | } |
||
541 | }) |
||
542 | $('.submit').click(beautify); |
||
543 | $('select').change(beautify); |
||
544 | |||
545 | |||
546 | }); |
||
547 | </script> |
||
548 | <script> |
||
549 | var _gaq = [ |
||
550 | ['_setAccount', 'UA-7409939-1'], |
||
551 | ['_trackPageview'] |
||
552 | ]; |
||
553 | (function (d, t) { |
||
554 | var g = d.createElement(t), |
||
555 | s = d.getElementsByTagName(t)[0]; |
||
556 | g.src = '//www.google-analytics.com/ga.js'; |
||
557 | s.parentNode.insertBefore(g, s); |
||
558 | }(document, 'script')); |
||
559 | </script> |
||
560 | </body> |
||
561 | |||
562 | </html> |