3 ms·
"if Django's bundled jQuery and your bundled MooTools each want to bind '$', who wins?" Yep. There needs to be a migration plan: 1. Announce that jQuery will
by Daniel_Newby 17y ago
"if Django's bundled jQuery and your bundled MooTools each want to bind '$', who wins?"
Yep. There needs to be a migration plan:
1. Announce that jQuery will temporarily use '$djq' (Django's jQuery) for jQuery starting in a few months. Don't let anything using '$' be committed during the migration period.
2. Immediately add JavaScript code to the bottom of every admin page that checks for the existence of '$djq'. If it is present, put a big flashing warning message on the page that says "Your Django admin page may break soon. Have your sysadmin look at this page [link goes here]."
3. The poor fools using '$djq' get a short chance to migrate their code. Probably nobody is using it anyway.
4. Start using '$djq'. You don't want to do this forever because it will confuse all the novices reading the jQuery tutorials and books.
5. Announce that the Django admin will switch to '$' for jQuery at the Django 1.1.0 release. (Or 1.2.0 if 1.1.0 is too soon.) '$djq' will be permanently left as an alias for '$', for compatibility with local admin code written during the migration period.
6. Put JavaScript code at the bottom of each admin page that checks if '$' is not jQuery and puts a giant blinking warning at the bottom of the admin page. Have a settings.py option to turn off the warning once the sysadmins learn what is going on. If somebody turns it off and doesn't develop a migration plan, that's their fault.
7. Shortly before 1.1.0, put in a new flashing warning that can't be turned off.
8. Substitute '$' for '$djq' for the pre-1.1.0 releases.