Uploaded image for project: 'Sakai'
  1. Sakai
  2. SAK-28162

Namespace the Portal's copy of jQuery

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: CLOSED
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 10.2
    • Fix Version/s: 11.0
    • Component/s: Portal
    • Labels:
      None

      Description

      As we move toward morpheus and the inlined portal, we will be mixing tool markup with the background document. Some tools are stuck on old versions of jQuery and it hard to upgrade the jQuery in the tool. As an example, both the preferences tool and Lessons use Infusion - which includes a full copy of jQuery bundled in Infusion and infusion does not work with later copies of jQuery. And these tools do things like load jQuery, add plugins to jQuery, register handlers, and then make global scoped functions that access global variables like $ and jQuery.

      Using jQuery.noConflict() it is possible to run two copies of jQuery at the same time as long as you keep things straight. One of the versions lives in $ and jQuery and the other version lives in a variable like "$old_jquery".

      So either the tools or the portal need to access a jQuery through one of these other variables. While it might sound like a good idea to fix the tools, it is actually more reliable to teach the portal and portal scripts not to use $ or jQuery and instead use our own global variable to access jQuery in the portal.

      The first part is to introduce a variable $PBJQ to be used within portal scripts to access the latest jQuery loaded by the portal with all the plugins that are loaded by the portal.

      References:

      https://forum.jquery.com/topic/multiple-versions-of-jquery-on-the-same-page
      http://stackoverflow.com/questions/1566595/can-i-use-multiple-versions-of-jquery-on-the-same-page

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  csev Charles Severance
                  Reporter:
                  csev Charles Severance
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Git Source Code