拙人新书《ASP.NET3.5前沿技术与实战案例精粹》上架,有问题的读者请到本页面论坛处提出。对此不便(需要先在IT168注册),表示真诚的歉意!

Prototype 1.6.0及script.aculo.us 1.8.0特征备忘录

上一篇 / 下一篇  2008-10-31 07:18:51 / 个人分类:Prototype

Prototype 1.6.0及script.aculo.us 1.8.0特征备忘录

作者  朱先忠


[注]我会尽快把内容翻译成中文!

Prototype 1.6.0 released

This version of Prototype brings a number of major enhancements to the core APIs as well as the usual slew of bug fixes and performance optimizations. For the full story, see theCHANGELOGand the release notes for1.6.0_rc0and1.6.0_rc1.APIhighlights include:

  • Ajax transport objects are now automatically wrapped in anAjax.Responseobject.
  • Ajax.Responseincludes support for accessingJSONresponse bodies as JavaScript. objects via theresponseJSONproperty.
  • The classAPInow includes full support for inheritance and superclass method calls. (SeeMislav’s tutorialfor more info.)
  • Class objects now have anaddMethodsmethod for adding instance methods after creation.
  • Elements can be created easily with thenew Element(...)syntax.
  • Element#insertprovides a unifiedAPItoDOMelement andHTMLfragment insertion.
  • Element#selectis an alias forgetElementsBySelectorand is now the preferred way to find elements by class name.
  • Element#wraplets you easily wrap an element inside another element in place.
  • Enumerablemethods onArrayare now backed by nativeArray#forEachimplementations when possible.
  • Enumerablenow has aliases for equivalent JavaScript. 1.6Arraymethods, and support for JavaScript. 1.6’s context parameter for automatic callback binding.
  • Enumerable#grepnow calls the match method on its first argument, so you can use it to e.g. filter an array ofDOMnodes byCSSselector.
  • Event objects are now automatically extended with instance methods, so you can write e.g.event.stop()instead ofEvent.stop(event).
  • Prototype’s eventAPInow supports firingDOM-based custom events withElement#fire.
  • The newdom:loadedcustom event fires when the entire document has loaded and is ready for manipulation.
  • Function#curryallows for partial application of function arguments.
  • Function#wrapfacilitates simple aspect-oriented programming and provides the basis for Prototype’s superclass method call mechanism.
  • Function#delaydelays invocation of the function by the given number of seconds.
  • Function#deferschedules the function to run as soon as the interpreter is idle.
  • TheHashAPI has changed, and you must now useHash#getandHash#setinstead of directly accessing properties onHashinstances.
  • String#interpolateis a shortcut for instantiating aTemplatefrom the string and callingevaluateon it.
  • Object properties can now be used in template replacement strings.

script.aculo.us 1.8.0 released

script.aculo.us 1.8.0 is fully compatible with Prototype 1.6.0 and includes several improvements since the last version; see theannouncement on Thomas’ blogfor more details. Here’s what’s new:

  • Complete rewrite of the in-place editing controls.
  • FullCSSinheritance support forEffect.Morph.
  • Support for tweening between two values of an element property or method call withEffect.Tween.
  • A new soundAPIfor playing interface sound effect MP3s.
  • Numerous bug fixes and performance improvements.


TAG: prototype

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2012-02-10  
   1234
567891011
12131415161718
19202122232425
26272829   

数据统计

  • 访问量: 176808
  • 日志数: 479
  • 图片数: 2
  • 文件数: 39
  • 书签数: 74
  • 建立时间: 2008-06-11
  • 更新时间: 2012-01-18

RSS订阅

Open Toolbar