jQuery UI v1.5 代码重构的还不到位
官方博客: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.jsvOP184FSZ, 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, justNJM2902 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 在代码重构的彻底上可以看出他的决心,放出少许期待之心.呵呵,先好好看看这次的代码去.