Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// <reference path="def/require.d.ts" />
- /// <reference path="Init.class.ts" />
- /**
- * paths List of the files to load. (Cannot contains references TS classes)
- * key: New reference name of the file.
- * path: Relative path to /public/js/ of the file.
- *
- * shim Config about the libraries (dependencies and more).
- * See http://requirejs.org/docs/api.html#config-shim
- */
- require.config({
- //urlArgs: "t=" + (new Date()).getTime(),
- paths: {
- 'jquery': 'lib/jquery-1.10.2.min',
- 'jqueryUiCore': 'lib/jquery.ui.core.min',
- 'jqueryUiEffect': 'lib/jquery.ui.effect.min',
- 'shared': '_shared.min'
- },
- shim: {
- 'jquery': {
- exports: '$'
- },
- 'jqueryUiCore': {
- deps: ["jquery"],
- exports: '$'
- },
- 'jqueryUiEffect': {
- deps: ["jquery"],
- exports: "$"
- },
- 'shared': {
- exports: "shared"
- }
- }
- });
- /**
- * [] Array of name that should be the same than those defined in the config.paths. Exception for the TS classes with reference in this file.
- */
- require(['jquery', 'jqueryUiCore', 'jqueryUiEffect', 'Init.class', 'shared'],
- ($, jqueryUiCore, jqueryUiEffect, _init, shared) => {
- // Initialization.
- var init = new _init.Init();
- // Make them public.
- _exports([
- shared.Message,
- shared.ValidatorMessage
- ]);
- /**
- * Export an array of object to made them public on the browser.
- * @param objects - Array of objects. Class of function basically.
- * @private
- */
- function _exports(objects){
- for(var i in objects){
- _export(objects[i]);
- }
- }
- /**
- *Export an object to the browser to make it public.
- * @param o Object to export.
- * @param name Customise the name. Optional.
- * @private
- */
- function _export(o: any, name: any = ''){
- if(!name){
- name = o.name;
- }
- window[name] = o;
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement