Uploaded image for project: 'Magnolia Soft Locking Module'
  1. Magnolia Soft Locking Module
  2. MGNLSLOCK-9

Make jQuery.noConflict mode configurable

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • Major
    • 1.0.2
    • 1.0, 1.0.1
    • None

    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.
        });
      

      )

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              fgrilli Federico Grilli
              fgrilli Federico Grilli
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Task DoR