views:

390

answers:

2

I have Aptana installed within Eclipse. I'm working on a project with the dojo 1.2 JavaScript library installed.

When I open one of dojo's dijit .js files, the code is formatted in a rather difficult to read way. The Eclipse "Outline" view shows a list of functions with names like "_2" and "ew". Not very human friendly.

I'm talking about source code that looks like this:

dojo.declare("dijit.InlineEditBox",dijit._Widget,{editing:false,autoSave:true,buttonSave:"",buttonCancel:"",renderAsHtml:false,editor:"dijit.form.TextBox",editorParams:{},onChange:function(_1){ },onCancel:function(){ },width:"100%",value:"",noValueIndicator:"    ✍    ",constructor:function(){ this.editorParams={}; },postMixInProperties:function(){ this.inherited(arguments); this.displayNode=this.srcNodeRef; var _2={ondijitclick:"_onClick",onmouseover:"_onMouseOver",onmouseout:"_onMouseOut",onfocus:"_onMouseOver",onblur:"_onMouseOut"}; for(var _3 in _2){ this.connect(this.displayNode,_3,_2[_3]); } dijit.setWaiRole(this.displayNode,"button"); if(!this.displayNode.getAttribute("tabIndex")){ this.displayNode.setAttribute("tabIndex",0); } this.attr("value",this.value||this.displayNode.innerHTML); },setDisabled:function(_4){ dojo.deprecated("dijit.InlineEditBox.setDisabled() is deprecated. Use attr('disabled', bool) instead.","","2.0"); this.attr("disabled",_4);

How do I get a clearer, "friendlier" view of such a .js file?

+1  A: 

You should be able to download uncompressed versions of the library at dojotoolkit.org. Here is the source tree for 1.2.2.

tvanfosson
A: 

You should download the dojo source distribution because the "standard" release is compressed with dojo ShrinkSafe tool (something similar to yui compress method based on Rhino) that is 100% safe and saves about 20% space usage. Within the source archive you will find an Util folder full with utils tools for unit testing, compressing, building and documenting :)

http://download.dojotoolkit.org/ - here you will find a list of all downloadable distributions