`
zhyi_12
  • 浏览: 98932 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

jQuery UI v1.5 Released,代码重构到不认识

阅读更多

官方博客:jQuery UI v1.5 Released, Focus on Consistent API and Effects
http://jquery.com/blog/2008/06/09/jquery-ui-v15-released-focus-on-consistent-api-and-effects/
    粗粗的翻了几个UI的代码,第一感觉是变了,变得不认识了,整个UI的写法变得很不熟悉了,完全的重构了。
不得不佩服这帮哥们重构的决心和毅力。

  When we first started with the UI project, we set out to build a generic, basic, and simple way of adding and extending core interaction to DOM elements. However, we soon found that our approach wasn’t working for UI. Using the “simple” approach, we were only able to serve simple interaction modules, but not full featured UI widgets. The second problem was that some plugins came from external sources making the UI suite seem disjointed and inconsistent.

   一些变化:

   1  统一UI的构建方法($.widget),每一个UI提供统一的初始化调用方法init(),下面的这种方式现在已经整合到$.widget方法中,

不再像1.5(b4)中的每一个UI中都有一段处理的代码。

  • $(”div”).draggable() creates a draggable
  • $(”div”).draggable(”destroy”) destroys it
  • $(”div”).draggable(”method”) calls another method on the plugin

    2  貌似要稳定了

Stability, Debugging, Testing and jquery.simulate
  It was extremely important that jQuery UI v1.5 was not only feature-rich but also stable. We took several steps to greatly improve our debugging and testing including the setup of our own dedicated bugtracker with jQuery UI specific version and milestone targeting. We also invested a lot of time into new unit tests that make use of the jQuery test suite Qunit. Finally, we created jquery.simulate.js, a plugin specifically designed to fire true browser events. This means, you can actually tell the plugin to pick up your draggable, move it to a certain position and release it again, just if you’d be talking to a real testing person.

 

    3 这个好像有点意思

   Roll Your Own Themes: ThemeRoller!
ThemeRoller offers a unique approach to theming UI components specifically built for jQuery UI. With ThemeRoller, you can create your very own theme for your project within minutes. It’s completely intuitive, comes wich rich controls to change the color and design of each state, and then previews your theme with the actual UI components as you work!

    jquery UI 在代码重构的彻底上可以看出他的决心,放出少许期待之心.呵呵,先好好看看这次的代码去.

 

分享到:
评论
4 楼 quaff 2008-06-19  
已经用上了,datepicker有点丑
3 楼 zhyi_12 2008-06-19  
文档变化不会很大,主要是进行了代码层面的重构,看以前的文档就行了
2 楼 KKFC 2008-06-18  
oo,唯有OO才能打救复杂的代码
1 楼 ayeah 2008-06-18  
文档好像还没出来,搞得我折腾了一个晚上还搞不定个dialog。。。

相关推荐

Global site tag (gtag.js) - Google Analytics