YUI::loader proc require (public)

 YUI::loader[i] require [ -module module ] [ -version version ]

Defined in /var/www/openacs.org/packages/xowiki/tcl/yui-procs.tcl

This is the key function of the loader, that will be used by other packages.

Switches:
-module (optional)
The YUI Module to be loaded
-version (optional, defaults to "2.7.0b")

Testcases:
No testcase defined.
Source code:
switch -- [string tolower $module] {

  utilities {
    # utilities.js: The utilities.js aggregate combines the Yahoo Global Object,
    # Dom Collection, Event Utility, Element Utility, Connection Manager,
    # Drag & Drop Utility, Animation Utility, YUI Loader and the Get Utility.
    # Use this file to reduce HTTP requests whenever you are including more
    # than three of its constituent components.
    ::xo::Page requireJS urn:ad:js:yui2:yahoo-dom-event/yahoo-dom-event
    ::xo::Page requireJS urn:ad:js:yui2:utilities/utilities
  }
  menubar {
    #
    # We should not have two different versions of the YUI
    # library on one page, because YUI2 (afaik) doesn't support
    # "sandboxing". If we use e.g. the yui-hosted utilities.js file here
    # we may end up with two YAHOO object definitions, because e.g.
    # the tree-procs uses the local yahoo-dom-event.

    # In future, the YUI loader object should be capable of
    # resolving such conflicts. For now, the simple fix is to stick to
    # the local versions, because then the requireJS function takes care
    # of duplicates.
    #
    :require -module "utilities"
    # todo : this is more than necessary
    foreach jsFile {
      container/container-min
      treeview/treeview-min
      button/button-min
      menu/menu-min
      datasource/datasource-min
      autocomplete/autocomplete-min
      datatable/datatable-min
      selector/selector-min
    } {
      ::xo::Page requireJS urn:ad:js:yui2:$jsFile
    }

    :require -module "reset-fonts-grids"
    :require -module "base"

    foreach cssFile {
      container/assets/container
      datatable/assets/skins/sam/datatable
      button/assets/skins/sam/button
      assets/skins/sam/skin
      menu/assets/skins/sam/menu
      treeview/assets/folders/tree
    } {
      ::xo::Page requireCSS urn:ad:css:yui2:$cssFile
    }
  }
  datatable {
    # see comment above
    :require -module "utilities"
    # todo : this is more than necessary
    foreach jsFile {
      container/container-min
      treeview/treeview-min
      button/button-min
      menu/menu-min
      datasource/datasource-min
      autocomplete/autocomplete-min
      datatable/datatable-min
      selector/selector-min
    } {
      ::xo::Page requireJS urn:ad:js:yui2:$jsFile
    }

    :require -module "reset-fonts-grids"
    :require -module "base"

    foreach cssFile {
      container/assets/container
      datatable/assets/skins/sam/datatable
      button/assets/skins/sam/button
      assets/skins/sam/skin
      menu/assets/skins/sam/menu
    } {
      ::xo::Page requireCSS urn:ad:css:yui2:$cssFile
    }
  }
  reset {
    ::xo::Page requireCSS urn:ad:css:yui2:reset/reset
  }
  fonts {
    ::xo::Page requireCSS urn:ad:css:yui2:fonts/fonts-min
  }
  grids {
    ::xo::Page requireCSS urn:ad:css:yui2:grids/grids
  }
  base {
    ::xo::Page requireCSS urn:ad:css:yui2:base/base
  }
  "reset-fonts-grids" {
    ::xo::Page requireCSS urn:ad:css:yui2:reset-fonts-grids/reset-fonts-grids
  }
}
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: