On Fri, Feb 19, 2010 at 8:58 AM, Luke Plant <l.plant...@cantab.net> wrote:
> IMO, using 'library agnostic' javascript in the admin will mean we
> just end up implementing our own library, which will end up being an
> ad hoc, informally-specified, bug-ridden, slow implementation of half
> of jQuery/dojo/etc, and even less likely to be able to interop with
> other libraries.

I agree.  And now that jQuery is in the admin, it seems like there's a
decision point...

1) Do we put jQuery in base.html and have Django's widgets and plugins
assume it will be there?

* Benefits: Javascript admin customizations are simpler and can use
the jQuery already on the page.
* Trade off: If someone wants to override base.html and put in
mootools, e.g., Django's widgets break.

2) Or do we put jQuery in each widget's media setting and encapsulate
both jQuery and the plugin code in a closure?  Which seems like where
Django has been heading by default and the one I would advocate.

* Benefit: Users can override base.html and add their own JS library
of choice, even if it's jQuery for easy development or things outside
of widgets.
* Trade off: A bit trickier to develop admin widgets.  But perhaps
this could be worked on -- something like jQuery UI's widget factory
methods?

-Rob

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-develop...@googlegroups.com.
To unsubscribe from this group, send email to 
django-developers+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to