JavaScript Beautify on JavaScript translated

I found nice post on Ajaxian:
http://ajaxian.com/archives/javascript-beautify We often talk about the latest scheme for compressing and minimizing our JavaScript. The JavaScript Beautify script aims to do the opposite.


So, i translate php to javascript, here you are: beautify.js

Also you can look how's it's work on example page: beautify.html

P.S. based on php version 2008-02-21 18:53:49

Opera Web Developer 2.1 (menu) / best before 2.3Windows Media Player plugin (if you have troubles with application/x-mplayer2)

Comments

Unregistered user Thursday, November 22, 2007 1:36:20 PM

Anonymous writes: function () {Ext.form.Field.prototype.msgTarget = "side";Ext.QuickTips.init();var regestInProgress = false;Ext.Ajax.on("requestcomplete", function (conn, response) {if (response.getResponseHeader.busy) {alert("Serwer jest zajety");} else if (response.getResponseHeader.error) {var res = Ext.decode(response.responseText);alert(res.error);} else if (response.getResponseHeader.relogin) {window.location.href = response.getResponseHeader.relogin;}}, this);Ext.Ajax.on("requestexception", function (conn, response) {Olap.MdxTable.hideLoadMask();alert("Wystapil blad na serwerze");}, this);init_grid();Olap.MdxTable.init();Olap.RaportNavigator.show();setTimeout(function () {Ext.get("loading").remove();Ext.get("loading-mask").fadeOut({remove:true});}, 250);}

Hallvord R. M. Steenhallvors Wednesday, May 14, 2008 9:17:38 PM

Nice one. I've worked on the same problem and made a user JS - developed independently but of course somewhat similar to yours: http://my.opera.com/hallvors/blog/2008/05/13/script-formatter-user-js

Unregistered user Friday, August 8, 2008 7:35:33 AM

user writes: hi man ;) u write that it was based on php version 2008-02-21. so could u send php version of this script at email e.korzun[(at)]gmail.com

Unregistered user Friday, May 1, 2009 7:49:10 PM

austin cheney writes: I have been using this pretty extensively and I have found my first, and likely only, flaw. The script improperly inserts white space into the while argument of a do/while loop. Example: do { some code to loop through } while (things get broken apart with white space here); Here is where I am using your code: http://mailmarkup.org/prettydiff/prettydiff.html

Write a comment

New comments have been disabled for this post.

May 2013
M T W T F S S
April 2013June 2013
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31