Advertisement
Guest User

main.js

a guest
Apr 18th, 2013
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*jslint browser: true, devel: true */
  2.  
  3. (function () {
  4.         'use strict';
  5.  
  6.         requirejs.config({
  7.           "paths": {
  8.                 "jquery" : [
  9.                     "https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min", //fetch jQuery from CDN
  10.                "lib/jquery"  //Fallback to local copy
  11.                 ],
  12.               "swiper": "plugin/idangerous.swiper.min",
  13.               "imagesLoaded": "plugin/jquery.imagesloaded",
  14.               "endecaAutoSuggest": "global/endeca-auto-suggest",
  15.               "jquery.form": "module/jquery.form",
  16.               "validation-base": "plugin/jquery.validate",
  17.               "validation": "global/validation_config",
  18.               "bootstrap": "lib/bootstrap",
  19.               "gist": "module/gist-localstorage-polyfill",
  20.               "underscore": "lib/underscore",
  21.               "breakpoints": "plugin/breakpoints",
  22.               "cookie": "lib/jquery.cookie",
  23.               "menuAim": "plugin/jquery.menu-aim"
  24.           },
  25.           "shim": {
  26.                 "imagesLoaded": {"deps": ["jquery"], "exports": "$.fn.imagesLoaded"},
  27.                 "jquery.form": {"deps": ["jquery"], "exports": "$.fn.jqueryForm"},
  28.                 "endecaAutoSuggest": {"deps": ["jquery"], "exports": "$.fn.endecaSearchSuggest"},
  29.                 "validation-base": {"deps": ["jquery"], "exports": "$.fn.validate"},
  30.                 "bootstrap": {"deps": ["jquery"], "exports": "$.fn.modal"},
  31.                 "gist": {"exports": "window.localStorage"},
  32.                 "underscore": {"exports": "_"},
  33.                 "breakpoints": {"deps": ["jquery"], "exports": "$.fn.setBreakpoints"},
  34.                 "plugin/jquery.fancybox.pack": {"deps": ["jquery"], "exports": "$.fn.fancybox"},
  35.                 "plugin/jquery.placeholder.min": {"exports": "$.fn.placeholder"},
  36.                 "cookie": {"deps": ["jquery"], "exports": "$.fn.cookie"},
  37.                 "menuAim": {"deps": ["jquery"], "exports": "$.fn.menuAim"}
  38.             }
  39.         });
  40.  
  41.         //libs
  42.         require(["jquery"], function ($) {
  43.             //Bring in all global modules
  44.             require(["global/global"]);
  45.  
  46.             //Parse script tag for page definition, and load approriate module
  47.             var pageModule = $("script[data-main][data-controller]").attr("data-controller");
  48.  
  49.             if (pageModule) {
  50.                 require([pageModule]);
  51.             }
  52.       });
  53. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement