Dojo 1.2 Candidate 发布

在推迟了一个月之后,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 事件:

  • 增加 charOrCode属性,删除keyChar属性, 这样,可输出的和不可输出的都度可以在同一个switch中处理.
  • See [#13544] and [#13547] for details.

浏览器判断

  • 改变了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 is incomplete.
    However they will still turn yellow instantly if the value they are typing isn't valid (and can't be made valid by typing more characters)... should provide good feedback to users w/out crying wolf.
  • Also,[#14161] add onValidStateChange connect point to dijit.form.Form widget so that custom behavior like disabled submit buttons (when the form is invalid) can be created.

菜单Menu

  • 新增 可选菜单项.(选/不选两种状态)

单选按钮RadioButton:

  • Indicate focus on FF/Safari the same as IE (via a hatched box around the label).

树Tree:

  • Fixed issues with horizontal scrolling and made each row white-space:nowrap,so that the label doesn't wrap around.
  • Also fixed vertical alignment issue between icons and text.

时间文本框TimeTextBox:

提示框Tooltip:

  • 缩小了箭头

DojoX

DojoX 的改进

dojox.Charting

  • new tooltips
  • new animations
  • support for events
  • legends for charts
  • New charts:
    • Bubble plotter [#13248]
    • intersection
    • financial plotting
  • Theme improvements,including simpler series color generation
  • Large set of new themes

dojox.color

  • dojox.color.Palette: a 5-color palette object. Includes the following:
    • A palette generator using a base color,based loosely on the rules at Kuler
    • The ability to create "color transformations",using specific HSL/HSV,CMY/CMYK,or RGB color models.

dojox.gfx

  • dojox.gfx.VectorFont: the ability to load SVG font definitions and use them with dojox.gfx has been added.
  • The Silverlight renderer is reworked,numerous bug fixes,it doesn't require 3rd-party files any more.

dojox.html

  • dojox.html.set: a generic content setter,including adding new stylesheets and evaluating scripts (was part of ContentPane loaders,now separated for generic usage)
  • dojox.html.metrics
    • Formerly private to dojox.gfx,now available in dojox.html
    • Includes translation of relative CSS values (such as medium,small,x-small,etc.) to actual pixel values
    • Translate other CSS units (such as em,pt) to pixel values
    • Scrollbar sizes (width and height)
    • Ability to detect font resizing
  • dojox.html.styles
    • Insert and remove CSS rules.
    • Search document for style sheets.
    • Toggle sheets on and off (based on the W3C spec).

New/Enhanced DojoX Widgets

dojox.Editor

  • dijit.Editor has had a major refactor,which isn't quite finished yet,but the current code is available in dojox.editor.
  • The refactored editor only uses an iframe now for FF2,and otherwise uses contentEditable div.
  • There are also new plugins in dojox.editor for creating/modifying tables and uploading images.

dojox.form.BusyButton

  • A new Button with progresss indicator built in,for indicating processing after you press the button.

dojox.form.FileUploader

  • A new multi-file uploader that shows progress as the files are uploading.
  • Turns most any button into a multi-file uploader by either utilizing a SWF from the new Deft project,or in the case of non_Flash users,degrades to laying a transparent FileInput over the top of it.

dojox.Grid

  • The new Grid 1.2 widget is available. It offers new features and performance improvements over the existing grid including
    • better Dojo data integration,
    • simplified layout structures,and
    • the ability to enable editing much more easily.
  • The new grid is called dojox.grid.DataGrid.
  • See the new grid documentation page and the blog post for details.
  • Note that the API for the new grid has changed,compared to the old grid (and may change more in the future).
  • For backwards compatibility,the old grid is still there under it's original name,dojox.Grid (but there's no maintenance going on for it).

dojox.image.Badge

  • A new fun prototype widget of looping proportions.
  • Attach images or background images,and let loop.
  • Coming next: dojo.data readyness.

dojox.layout.GridContainer

  • The Grid Container is a container of children elements that are placed in a kind of grid. It displays the children elements by column (ie: the children widths are fixed by the column width of the grid but the childs heights are free). Each child is movable by drag and drop inside the Grid Container. The position of other children is automatically calculated when a child is moved.
  • You can dynamically add/remove columns.
  • You can use keyboard to navigate and move children.
  • See also [#6837] for details.

dojox.layout.RotatorContainer

  • New widget submitted by Chris Barber.
  • Updates to RadioGroupSlide to include z-index tracking and slideFrom direction control.

dojox.widget.Wizard

  • The formerly known dojox.widget.WizardContainer (provided by Wizard.js) has been renamed to be simply "dojox.widget.Wizard".
  • The relationship of a dojox.widget.WizardPane to a Wizard is unchanged. Simply remove the "Container" from your dojoType or class name.

dojox.xml.widgetParser

  • A new XML parser for widget markup. Reads XML and instantiates dojo components.
  • Element names refer to the dojo component to be created,attributes refer to properties or event handlers.
  • XML can be included directly within <script/> tags or externally referenced via the script tags src attribute.
  • See also [#5766] for details.

新的Dojo数据存储

dojox.data.JsonRestStore

  • dojox.data.JsonRestStore is a lightweight datastore implementation of a RESTful client.
  • Provides full read,write,and notification capabilities through standards based HTTP/REST interaction with the server using GET,PUT,POST,and DELETE commands.
  • Supports JSON Referencing so objects can contain cyclic,multiple,cross-message,cross-table,and even cross-site references,which can be used for lazy loading.
  • JsonRestStore is a subclass of ServiceStore
  • See also the blog post for details.

dojox.data.CouchDBRestStore

  • dojox.data.CouchDBRestStore is an extension of JsonRestStore to handle CouchDB's idiosyncrasies,special features,and deviations from standard HTTP Rest.
  • NOTE: CouchDB is not designed to be run on a public facing network. There is no access control on database documents,and you should NOT rely on client side control to implement security.
  • CouchDBRestStore is a subclass of JsonRestStore

dojox.data.GoogleFeedStore

  • A Google AJAX API powered data store for retrieving RSS and Atom feeds from Google.
  • The feeds can come from any source,which is specified in the "url" parameter of the query passed to the "fetch" function.

dojox.data.GoogleSearchStore

  • Data stores to interface Google's AJAX search services.
  • There are many subclasses of this store for particular types of searches:
    • dojox.data.GoogleWebSearchStore
    • dojox.data.GoogleBlogSearchStore
    • dojox.data.GoogleLocalSearchStore
    • dojox.data.GoogleVideoSearchStore
    • dojox.data.GoogleNewsSearchStore
    • dojox.data.GoogleBookSearchStore
    • dojox.data.GoogleImageSearchStore
  • Includes a preconfigured SMD for use with dojox.rpc.Service

dojox.data.PersevereStore

  • dojox.data.PersevereStore is an extension of JsonRestStore to Persevere's special features.
  • PersevereStore is a subclass of JsonRestStore
  • See also the blog post for details.

dojox.data.S3Store

  • dojox.data.S3Store is an extension of JsonRestStore to handle Amazon's S3 service using JSON data
  • S3Store is a subclass of JsonRestStore
  • See also the blog post for details.

dojox.data.ServiceStore

  • ServiceStore and it's subclasses are a dojo.data implementation for any webservice.
  • Fetches are routed through the service and the returned results are used as the data behind the API.
  • See also the blog post and [#5987] for details.

New Datastore Helpers

dojox.analytics.Urchin

  • A Google-analytics helper,which supports lazy-loading the Google Analytics API at any point during a page lifecycle.
  • Allows you to post-onload include Google Analytics helper,and track Ajax-y pages via a simple API,with a very small overhead.

dojox.data.ClientFilter

  • ClientFilter is an abstract class that can be used by remote data services for doing partial client side filtering,sorting,and paging,and can utilize these facilities for caching previous fetch results and querying the cached results for subsequent "narrower" queries.
  • ClientFilter can update previous fetch result sets in response to data change notifications. This allows widgets to determine if and how to update a UI after a data notification.
  • The ClientFilter is used by JsonRestStore/ServiceStore if it has been loaded.

dojox.rpc.OfflineRest/dojox.rpc.LocalStorageRest

  • dojox.rpc.OfflineRest provides auto-synchronization and caching of data for REST based applications. In particular,it is built for JsonRestStore to be used in offline mode,and it will save all data changes locally and synchronize/persist the changes to the server when connectivity is available.

新的Dojox项目

dojox.av

  • New project for Audio/Video elements
  • dojox.av.FLVideo: a player for Flash video files
  • dojox.av.widget.Player: Dijit-based object for playing Flash media

dojox.embed

  • A set of utilities that allow you to load/include Objects such as Flash and Quicktime.
  • dojox.embed.Flash for Flash movies
    • Create proxy information for Flash movies implementing ExternalInterface through dojox.embed.Flash.proxy
  • dojox.embed.Quicktime for Quicktime movies
  • dojox.embed.Object—a Dijit that can be used via markup for any dojox.embed objects available.

dojox.io.windowName

  • Provides secure cross-domain request capability. Sends a request using an iframe (POST or GET) and reads the response through the frame's window.name.

dojox.io.xhrPlugins

  • This is a registry for creating alternate XHR handlers,for example you can register to use IE8's XDomainRequest or a proxy server to handle cross-domain requests.

dojox.lang.aspect

  • dojox.lang.aspect is a new AOP library module for before/around/etc advice and other AOP features.
  • See the blog post for details.

dojox.lang.observable

  • Provides a form of getter/setter support to objects. Observable objects can be created such that all property reads,writes,and method calls will trigger listener functions so that you can create APIs where property interaction can be controlled and monitored.
  • This relies on VBScript hacks for IE and is somewhat limited in functionality.

dojox.json.query

  • JSONQuery is a new module intended to succeed and improve upon the JSONPath module introduced in Dojo 1.1.
  • JSONQuery provides a comprehensive set of data querying tools including filtering,recursive search,mapping,range selection,and flexible expressions with wildcard string comparisons and various operators.
  • See the blog post for details.

dojox.json.ref

  • This module provides serialization and parsing of data structures with circular,and cross-domain references using JSON Referencing.
  • This module supports path-based,id-based,and combined referencing techniques,and can be used for indexing purposes for data stores (JsonRest/JsonRestStore utilizes this module).
  • See the blog post for details.

dojox.json.schema

  • This module provides JSON Schema validation.
  • This can be used by data stores (JsonRestStore will use the validator if it has been loaded and a schema has been defined) to maintain data integrity.
  • See the blog post for details.

dojox.secure.capability

  • This provides object-capability JavaScript validation.
  • This is a validator to run before eval to ensure that a script can't access or modify any objects (like global objects) outside of those specifically provided to it.

dojox.secure.DOM

  • Provides a DOM facade that restricts access to a specified subtree of the DOM.
  • The DOM facade uses getters/setters and lettables to emulate the DOM API.

dojox.secure.sandbox

  • Provides support for loading web pages,JSON,and scripts from other domains using XHR (and XHR plugins) with a safe subset library and sandboxed access to the DOM.

Util

util/buildscripts

stripConsole

  • There is a new build option that will strip console.* calls in all JavaScript files that are in the build.
    • stripConsole=normal will strip all console.* calls except console.warn and console.error.
    • stripConsole=all will strip all console.* calls.

DOH:单元测试框架

A doh.robot package has been added to do,allowing writing of unit tests for visual components like DnD and widgets.

There are also a few examples of those tests within dijit/tests/form/robot,etc.

迁移的部分

This sections details changes you might need to make if upgrading your app from Dojo Toolkit V1.1 to Dojo Toolkit V1.2

Links to download files or execute javascript (dojo.addOnUnload() vs. dojo.addOnWindowUnload())

  • Callbacks registered via dojo.addOnUnload() were previously not always fired in IE. This is now fixed,but it exposed a problem with clicking on links to download files or javascript: links -- those types of links trigger the window.onbeforeunload event,which is what triggers dojo.addOnUnload callbacks. However those types of links do not actually destroy the page. So you should be careful doing destructive operations in dojo.addOnUnload().
  • If you need to do things like clean up circular reference to prevent IE leaks (over and above what dojo already does for you),then you can use the dojo.addOnWindowUnload() (new in Dojo 1.2),which triggers the callbacks on window.onunload. It works the same as dojo.addOnUnload,but it just fires on window.onunload,when the page is really unloading. Be careful trying to do DOM and JavaScript property access during a dojo.addOnWindowLoad() callback -- the state of the page may not be stable.

Editor

  • Use with TEXTAREA deprecated for security reasons; use DIV instead.
  • See also [#2140] for details.

Widget.attr()

  • Widget.attr() is now the standard interface for setting/getting all widgets attributes.
  • Old methods like setValue(),setAttribute(),and setTitle() still exist but have been deprecated.
  • Read the blog post for details,but basically Widget.attr() works like dojo.attr().

dijit._Widget.destroy()

  • There was technically an API change around _Widget's .destroy() method. Previously,it had documented a "finalize" parameter that did nothing. We've changed that parameter to become "preserveDom",a boolean to toggle weather destroy() will remove the domNode associated with the _Widget(this.domNode). Pass "true" and the dom will be preserved.
  • Included is a simple test,and we've updated the FisheyeLite test to show how you can effectively start and stop the effect using .destroy().
  • See also [#6668] for details.

dojo.isGears moved to dojo.gears.available

  • Gears detection was moved to the dojo.gears module resource,so do dojo.require("dojo.gears") to get it. Then,use dojo.gears.available to get a boolean result that tells you if Gears is installed.

dojo.xhr calls that use handleAs: "json-comment-filtered" are deprecated

  • If you use handleAs: "json-comment-filtered" you will get a warning in the console about it.
  • To suppress the warning,set djConfig.useCommentedJson to true.
  • This also means djConfig.usePlainJson flag has been removed,since plain JSON is preferred,and no warning is given now for using it.

some dojox.widgets moved to dojox.form

  • The following form-based widgets have been moved to dojox.form:
    • dojox.form.FileInput
    • dojox.form.MultiComboBox
    • dojox.form.Rating
    • dojox.form.TimeSpinner
  • The dojox.widget project uses a convention for its resources like: dojox/widget/WidgetName/WidgetName.css ... When migrating,you will need to adjust your path to the external CSS files: FileInput.css and Rating.css both now reside in dojox/form/resources/ ...
  • These widgets have been moved without deprecation into the dojox.form project as a permanent home more suited to the functionality.

修正的Bug列表

  • Here is the list of bugs fixed in 1.2.
  • Note that many of those bug reports aren't bugs in 1.0 or 1.1,but rather just refactoring work,enhancements,or bugs that appeared after the 1.1 release.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


我有一个网格,可以根据更大的树结构编辑小块数据.为了更容易知道用户保存了什么,我希望当用户第一次看到网格时,网格处于不可编辑状态.当用户准备好后,他们可以单击编辑按钮,这将使网格的某些部分可编辑.然后,有一个保存或取消按钮可以保存更改或还原.在大多数情况下它是有效的.但
我即将开始开发一款教育性的视频游戏.我已经决定以一种我可以轻松打包为Web,Mobiles和可能的Standalone版本的方式来实现这一目标.我不想使用Flash.因此,我确信(无论如何我会听取建议)使用JavaScript和SVG.我正在对这个问题进行大量研究,但我很难把各个部分放在一起.我知道Raphae
我正在使用带有Grails2.3.9的Dojo1.9.DojoNumberTextBox小部件–我在表单中使用–将固定格式(JavaScript基本格式)的实数值(例如:12.56)设置为HTML表单输入字段(但根据浏览器区域设置显示/编辑它们,所以用户总是看到格式正确的数字).另一方面,Grails期望输入字段根据浏览器
1.引言鉴于个人需求的转变,本系列将记录自学arcgisapiforjavaScript的学习历程,本篇将从最开始的arcgisapiforjavaScript部署开始,个人声明:博文不在传道受业解惑,旨在方便日后复习查阅。由于是自学,文章中可能会出现一些纰漏,请留言指出,不必留有情面哦!2.下载ArcGISforDe
我正在阅读使用dojo’sdeclare进行类创建的语法.描述令人困惑:Thedeclarefunctionisdefinedinthedojo/_base/declaremodule.declareacceptsthreearguments:className,superClass,andproperties.ClassNameTheclassNameargumentrepresentsthenameofthec
我的团队由更多的java人员和JavaScript经验丰富组成.我知道这个问题曾多次被问到,但为了弄清楚我的事实,我需要澄清一些事情,因为我在客户端技术方面的经验非常有限.我们决定使用GWT而不是纯JavaScript框架构建我们的解决方案(假设有更多的Java经验).这些是支持我的决定的事实.>
路由dojo/framework/srcouting/README.mdcommitb682b06ace25eea86d190e56dd81042565b35ed1Dojo应用程序的路由路由FeaturesRoute配置路径参数RouterHistoryManagersHashHistoryStateHistoryMemoryHistoryOutletEventRouterContextInjectionOutl
请原谅我的无知,因为我对jquery并不熟悉.是否有dojo.connect()的等价物?我找到了这个解决方案:http:/hink-robot.com/2009/06/hitch-object-oriented-event-handlers-with-jquery/但是没有断开功能!你知道jquery的其他解决方案吗?有jquery.connect但这个插件在我的测试中不起作用.
与java类一样,在dojo里也可以定义constructor 构造函数,在创建一个实例时可以对需要的属性进行初始化。//定义一个类mqsy_yjvar mqsy_yj=declare(null,{     //thedefaultusername    username: "yanjun",          //theconstructor   
我一直在寻找一些最佳实践,并想知道Dojo是否具有框架特定的最佳实践,还是最好只使用通用的Javascript标准?特别是我主要是寻找一些功能和类评论的指导方针?解决方法:对于初学者来说,这是项目的风格指南:DojoStyleGuide
我有’05/17/2010’的价值我想通过使用dojo.date.locale将其作为“2010年5月17日”.我尝试过使用dojo.date.locale.parse,如下所示:x='05/17/2010'varx=dojo.date.locale.parse(x,{datePattern:"MM/dd/yyyy",selector:"date"});alert(x)这并没有给我所需的日期
我正在尝试创建一个包含函数的dojo类,这些函数又调用此类中的其他函数,如下所示:dojo.provide("my.drawing");dojo.declare("my.drawing",null,{constructor:function(/*Object*/args){dojo.safeMixin(this,args);this.container=args[0];
我知道你可以使用jQuery.noConflict为jQuery做这件事.有没有办法与Dojo做类似的事情?解决方法:我相信你可以.有关在页面上运行多个版本的Dojo,请参阅thispage.它很繁琐,但似乎是你正在寻找的东西.一般来说,Dojo和jQuery都非常小心,不会破坏彼此或其他任何人的变量名.
我有一个EnhancedGrid,用户经常使用复杂的过滤器.有没有办法允许用户保存或标记过滤器,以便将来可以轻松地重新应用它?我知道我可以通过编程方式设置过滤器,但我无法预测用户想要的过滤器.谢谢!编辑:自己做了一些进展…使用grid.getFilter()返回过滤器的JSON表示,然后使用json.strin
我有这个代码:dojo.declare("City",null,{constructor:function(cityid,cityinfo){}});dojo.declare("TPolyline",GPolyline,{constructor:function(points,color){},initialize:function(map){});应该是什
我遇到的问题是我的所有javascript错误似乎来自dojo.xd.js或子模块.我正在使用chrome调试器和许多dijit功能,如dijit.declaration和dojo.parser.这有点烦人,因为它很难找到简单的错误或滑倒.我希望我可以添加一个选项,允许我的调试器在我的非dojo代码中显示选项会发生的位置.我是
我正在使用DojoToolkit数字/解析函数来处理格式化和使用ICU模式语法解析字符串.有没有人知道有可能采取任意ICU模式字符串并以某种方式使用Dojo(或其他)库将其分解为它的部分(例如,对于数字模式,它可以被分解为小数位数,数千个分组等…).我希望这样做,而不需要让我的代码密切了
我有两个看似相关的问题,访问在不同的地方定义的javascript函数.我遇到的第一个问题是调用我在firgbug或safari控制台中定义的函数.我定义了一个名为getRed的函数,如下所示:functiongetRed(row,col){//dosomethingstuffandreturntheredvalueasa
我想添加一个在Ajax调用中指定的外部样式表.我已经找到了一种方法来使用jQuery(参见下面的示例),但是我需要使该方法适应dojoJavaScript框架.JQuery示例$('head').append('<linkrel="stylesheet"type="text/css"href="lightbox_stylesheet.css">');谢谢.解决方法:一旦你
我正在尝试使用dojo.connect将onMouseDown事件连接到图像,如:dojo.connect(dojo.byId("workpic"),"onMouseDown",workpicDown);functionworkpicDown(){alert("mousedown");}类似的代码几行后,我将onMouse*事件连接到dojo.body确实完全正常工作.但是当我点击图像时