使用 Aptana 在 Eclipse 中查看 dojo 的 javascript 源文件有什么好方法?

发布于 2024-07-11 00:10:35 字数 1298 浏览 7 评论 0原文

我在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

昔梦 2024-07-18 00:10:35

您应该能够在 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.

离线来电— 2024-07-18 00:10:35

您应该下载 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文