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

Should moodle be adding JS to Yahoo's namespace?

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.3
    • 2.0
    • Gradebook, JavaScript
    • None
    • MOODLE_20_STABLE
    • MOODLE_23_STABLE

      Putting Moodle Javascript in Yahoo's namespace doesn't cause any problems but it doesn't seem quite right. Doing a search through the moodle 2 codebase for "YAHOO.namespace(" shows there are 12 points where we are adding stuff to Yahoo's namespace. There are several options:

      1) Move to the global namespace or our own namespace and provide some infrastructure to flag name collisions. Yahoo's code is currently doing this for us.

      2) Continue to use Yahoo's name space but use a consistent naming scheme that makes collisions extremely unlikely. In some places we use names like "moodle.container.calendarpanels" while in others we just use "graderreport". "moodle.blah" makes it exceptionally unlikely any collisions will ever occur and logically groups our code.

      any other options?

            dobedobedoh Andrew Lyons
            andyjdavis Andrew Davis
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.