Hi All, I am looking at integrating some JQuery components into Click. Some things we have used at my workplace JQuery DesktopMenu by Bob and probably some form of datepicker (http://jqueryui.com/demos/datepicker/).
Probably in the package: org.apache.click.extras.jquery There are a couple of things I would like to discuss, and get some opinions on: #1 Dependency Management These controls will have various JQuery JS dependencies and assets which we can package in the distribution, or let people declare explicitly in their HTML page template. Traditionally we have packages up all the JS dependencies with Click as we want to make it easy for people to use. However now with peoples extensive use of these libraries extensively in their applications, so we will have potential issues with different versions. My thought on this is to include a properties file which declares the various controls dependencies. People can then potentially edit this properties file and override the default values: jquery.core.js= http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js # Desktop Menu components jquery.desktopmenu.css=/click/jquery/desktopmenu/desktopmenu.css jquery.desktopmenu.js=/click/jquery/desktopmenu/jquery.menu.js jquery.desktopmenu.template=/click/jquery/desktopmenu/desktopmenu.template.js The main problem I have with this, is that the properties file would be buried deep in the package structure: /org/apache/click/extras/jquery/jquery-control.properties. Alternatively we could have this in the package root and call it something like: click-jquery-control.properties #2 Prototype and JQuery Traditionally these libraries are not compatible, as prototype modifies the DOM. In Click Extras we have a number of prototype controls, where were popular before JQuery came to dominate (showing our age here). Not sure if this is fixed now, I have read about a JQuery.noConflict() function. We have quite a few prototype controls, which I think should be moved into their own package so its clear they have a prototype dependency. This change would require people to change their package imports, but other than that it would be a pretty painless change. Keen to hear peoples thoughts on this. regards
