使用 Aptana 在 Eclipse 中查看 dojo 的 javascript 源文件有什么好方法?
我在 Eclipse 中安装了 Aptana。 我正在开发一个安装了 dojo 1.2 JavaScript 库的项目。
当我打开 dojo 的 dijit .js 文件之一时,代码的格式非常难以阅读。 Eclipse“大纲”视图显示名称为“_2”和“ew”的函数列表。 不太人性化。
我说的是看起来像这样的源代码:
dojo.declare("dijit.InlineEditBox",dijit._Widget,{编辑:false,autoSave:true,buttonSave:"",buttonCancel:"",renderAsHtml:false,editor:"dijit.form.TextBox", editorParams:{},onChange:function(_1){ },onCancel:函数(){ },宽度:"100%",值:"",noValueIndicator:" ✍ ",构造函数:function(){ this.editorParams={}; },postMixInProperties:函数(){ this.inherited(参数); 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,"按钮"); if(!this.displayNode.getAttribute("tabIndex")){ this.displayNode.setAttribute("tabIndex",0); } this.attr("值",this.value||this.displayNode.innerHTML); },setDisabled:函数(_4){ dojo.deprecated("dijit.InlineEditBox.setDisabled() 已弃用。请使用 attr('disabled', bool) 代替。","","2.0"); this.attr("已禁用",_4);
如何获得此类 .js 文件的更清晰、“更友好”的视图?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该能够在 dojotoolkit.org 下载该库的未压缩版本。
这里是1.2.2的源代码树。
You should be able to download uncompressed versions of the library at dojotoolkit.org.
Here is the source tree for 1.2.2.
您应该下载 dojo 源代码发行版,因为“标准”发行版是使用 dojo ShrinkSafe 工具(类似于基于 Rhino 的 yui 压缩方法)进行压缩的,该工具 100% 安全并节省约 20% 的空间使用量。 在源存档中,您将找到一个 Util 文件夹,其中包含用于单元测试、压缩、构建和记录的实用工具:)
http: //download.dojotoolkit.org/ - 在这里您将找到所有可下载发行版的列表
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