[MGNLSLOCK-9] Make jQuery.noConflict mode configurable Created: 02/Feb/11  Updated: 13/Sep/11  Resolved: 07/Sep/11

Status: Closed
Project: Magnolia Soft Locking Module
Component/s: None
Affects Version/s: 1.0, 1.0.1
Fix Version/s: 1.0.2

Type: Task Priority: Major
Reporter: Federico Grilli Assignee: Federico Grilli
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoR:
Empty
Date of First Response:

 Description   

As more and more people upgraded to Magnolia 4.4.1 and 4.4.2, issues regarding different javascript libs conflicting with jQuery (which is the js framework used by this module) started to emerge. The $ function, in particular, is the source of most problems, as almost any js lib will define it in its own peculiar way, included Magnolia js itself. In short, the module should provide a way to make jQuery.noConflict mode configurable via the usual module config mechanism. It would probably also make sense to set the value as true by default. A concrete use case where the noConflict mode set to false would make sense is that of MediaCatalyst (see MGNLSLOCK-6). They only use jQuery and, of course, make heavy use of the $ alias. For them, setting the noConflict mode to true would mean replacing everywhere in their scripts $ with jQuery, (even though an alternative to this could be possibly wrapping and isolating jQuery code with something like this

  jQuery(document).ready(function($) {
    // Code that uses jQuery's $ can follow here.
  });

)



 Comments   
Comment by Jan Haderka [ 07/Sep/11 ]

is the "enabled" part still necessary?

Generated at Mon Feb 12 07:14:26 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.