square-one / square-one-cms

Square one is a light distribution of Joomla!
http://squareonecms.org/
GNU General Public License v2.0
51 stars 9 forks source link

Initial proof of concept for JavaScript libraries plugin #110

Closed jlleblanc closed 12 years ago

jlleblanc commented 12 years ago

This is a working proof of concept, with one major missing feature: Currently no way of designating libraries as CDN copies, nor is there any "CDN mode." We might possibly assume that anything beginning with 'http' is a CDN version, but then we will also need to keep track of the minimum local version and the minimum remote version.

jlleblanc commented 12 years ago

Added a mechanism for automatically adding jQuery.noConflict() immediately after jQuery is loaded, as seen in www.designvsdevelop.com/jquery-in-joomla-i-was-wrong/

gnomeontherun commented 12 years ago

Is there any reason you might want to not use noConflict and if another script already calls it is there any reason calling it more than once can hurt?

jlleblanc commented 12 years ago

Possibly. If you know for sure that you're not loading another library that uses $ (MooTools, Zepto, etc...), you might prefer to use $ instead of wrapping everything in a closure. You might also have some edge case where you need to debug and don't want to call noConflict.

I don't think calling it twice hurts, but the script is only being added once the manager confirms that jQuery hasn't already been loaded.

Regardless, I'll add a flag allowing someone to opt-out of noConflict().

On Mar 10, 2012, at 10:32 AM, Jeremy Wilken wrote:

Is there any reason you might want to not use noConflict and if another script already calls it is there any reason calling it more than once can hurt?


Reply to this email directly or view it on GitHub: https://github.com/square-one/square-one-cms/pull/110#issuecomment-4432129