Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-43525

Allow add-ons to include YUI gallery modules

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Note: Please test with yuicomboloading both enabled, and disabled.

      • git clone https://github.com/yui/yui3-gallery.git
      • copy a gallery module or two in to your intended victim (I used mod/assign)
        • cp ~/git/yui/yui3-gallery/build/gallery-sm-menu-* mod/assign/yui/gallery/build/
      • purge caches
      • open any page in Moodle and open the developer tools
      • open the Network tab, and clear anything that's there
      • switch to the console (or press escape in Chrome)
      • run:

        YUI().use('gallery-sm-menu');
        

      • Confirm that:
        • The JS for the module was loaded from the correct source
        • The file content for each loaded file was present
        • Any relevant CSS was loaded too
      • Now load gallery-sm-treeview to confirm we didn't break anything:

        YUI().use('gallery-sm-treeview');
        

      • Confirm that:
        • The JS for the module was loaded from the correct source
        • The file content for each loaded file was present
        • Any relevant CSS was loaded too
      • Add some meta-data to the modules you included:

        for d in mod/assign/yui/gallery/build/gallery-sm-menu-*; do cp ~/git/yui/yui3-gallery/src/gallery-sm-menu/meta/sm-menu.json "$d"/meta.json
        

      • Purge Moodle caches
      • Reload the sm-menu gallery module

        YUI().use('gallery-sm-menu');
        

      • Confirm that:
        • The module was loaded again, but this time with fewer requests (only if yuicombloading = true)
        • Any relevant CSS was loaded too
      Show
      Note: Please test with yuicomboloading both enabled, and disabled. git clone https://github.com/yui/yui3-gallery.git copy a gallery module or two in to your intended victim (I used mod/assign) cp ~/git/yui/yui3-gallery/build/gallery-sm-menu-* mod/assign/yui/gallery/build/ purge caches open any page in Moodle and open the developer tools open the Network tab, and clear anything that's there switch to the console (or press escape in Chrome) run: YUI().use('gallery-sm-menu'); Confirm that : The JS for the module was loaded from the correct source The file content for each loaded file was present Any relevant CSS was loaded too Now load gallery-sm-treeview to confirm we didn't break anything: YUI().use('gallery-sm-treeview'); Confirm that : The JS for the module was loaded from the correct source The file content for each loaded file was present Any relevant CSS was loaded too Add some meta-data to the modules you included: for d in mod/assign/yui/gallery/build/gallery-sm-menu-*; do cp ~/git/yui/yui3-gallery/src/gallery-sm-menu/meta/sm-menu.json "$d"/meta.json Purge Moodle caches Reload the sm-menu gallery module YUI().use('gallery-sm-menu'); Confirm that: The module was loaded again, but this time with fewer requests (only if yuicombloading = true) Any relevant CSS was loaded too
    • Affected Branches:
      MOODLE_27_STABLE
    • Pull Master Branch:
      MDL-43525-master
    • Story Points:
      20
    • Sprint:
      FRONTEND Sprint 7

      Description

      As a follow-on from MDL-36334, it would be useful if add-ons could specify their own gallery modules to include.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dobedobedoh Andrew Nicols
              Reporter:
              dobedobedoh Andrew Nicols
              Peer reviewer:
              Petr Skoda
              Integrator:
              Damyon Wiese
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: