在推迟了一个月之后,dojo 1.2的Candidate版本终于发布了,
http://www.dojotoolkit.org/2008/09/19/dojo-1-2-proper-candidate
http://download.dojotoolkit.org/release-1.2.0rc1/
Dojo 1.2 的变化
向后兼容
Dojo V1.2添加了很多的新特性,并且做出了一些改动/删除.但最重要的是,Dojo V1.2的大部分都是和Dojo V1.0、 DojoV1.1版本相兼容的.至于不同的部分可以可以参考 “迁移部分”。
Dojo核心和相关的库文件
Keyboard 事件:
浏览器判断
- 改变了dojo.isIE, dojo.isFF, dojo.isSafari的返回值.
- 如果不是指定的浏览器,现在的返回值是 undefined (替代了之前的 0),如果是指定的浏览器,则返回版本号. 如果你不是直接用这些直接和0进行比较的话,并没有什么影响.所以,比较判断浏览器的方式建议是 if(!dojo.isIE){...}
dojo.cldr
- dojo.cldr 从 CLDR 版本 1.5.1 更新到 1.6.
- 更新了区域化表格。因此,dojo.date.locale, dojo.number、 dojo.currency 生成、格式化的字符串可能会与以前的版本有点不同.
djConfig.addOnLoad
- Adds a new callback via dojo.addOnLoad.
- Useful when Dojo is added after the page loads and djConfig.afterOnLoad is true.
- Supports the same arguments as dojo.addOnLoad.
- When using a function reference, use djConfig.addOnLoad = function(){};.
- For object with function name use djConfig.addOnLoad = [myObject, "functionName"];.
- For object with function reference use djConfig.addOnLoad = [myObject, function(){}];
try/catch behavior changed with djConfig.isDebug = true
- Some modules in Dojo Core (XHR, Deferred, dojo.addOnLoad callback code) would catch errors and either just report them in the console or did another throw which made it hard to track the origin of the error. This was done to keep the code robust and running in the page. However, for development scenarios it made it hard to track down the origin of the error.
- Now, those modules let the original exception bubble up, stopping JavaScript execution if djConfig.isDebug is set to true.
- If djConfig.isDebug is set to false (or undefined) then a try/catch is used and the error is logged to the console.
dojo.fx.easing
- The former known dojox.fx.easing has been promoted to Dojo Core, and is available by dojo.require("dojo.fx.easing").
- An API shim is in place for users of dojox.fx.easing, and deprecation warnings are being thrown.
dojo.html.set()
- feature added to use ContentPane like functionality outside of ContentPane.
Dijit 的改进
可用性/外观的改进
- With V1.2 there comes major improvements to the visual polish and the usability of the Dijit component set.
_Widget.attributeMap
- attributeMap can now handle innerHTML and class names too.
- You should think of attributeMap as a binding from widget attribute to DOM nodes.
- See the blog post for details.
_Widget.placeAt
- placeAt() is a new domNode manipulation function, which allows you to chain and place the widget's domNode (or addChild() it to another widget) easily.
- See: [#14602] for details.
动画:
- The default animation time for widgets was sped up.
- Animations are now controllable through dojo.config.defaultDuration.
BorderContainer:
- Fixed layout issues with panes resulting in missing borders or double borders.
按钮Button:
- 修正了垂直对齐和各种显示的问题.
复选框CheckBox:
- Fixed rollover effect of focused checkboxes.
- Indicate focus on FF/Safari the same as IE (via a hatched box around the label).
ComboBox:
- Highlighting of search results.
- See also [#6461] for details.
FilteringSelect
- No longer need to put blank value in drop down list in order for user to be able to clear the value; they can clear it w/backspace or delete key now.
See also [#5974] for details. - Highlighting of search results.
See: [#6461] for details.
表单验证Form validation:
- Form widgets have been enhanced so that they won't turn yellow while the user is typing because the value they have