source: Dev/branches/rest-dojo-ui/client/dojo/main.js @ 256

Last change on this file since 256 was 256, checked in by hendrikvanantwerpen, 13 years ago

Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).

File size: 1.8 KB
RevLine 
[256]1define([
2        "./_base/kernel",
3        "./has",
4        "require",
5        "./_base/sniff",
6        "./_base/lang",
7        "./_base/array",
8        "./ready",
9        "./_base/declare",
10        "./_base/connect",
11        "./_base/Deferred",
12        "./_base/json",
13        "./_base/Color",
14        "./has!dojo-firebug?./_firebug/firebug",
15        "./has!host-browser?./_base/browser",
16        "./has!dojo-sync-loader?./_base/loader"], function(dojo, has, require, sniff, lang, array, ready){
17        // module:
18        //              dojo/main
19        // summary:
20        //              This is the package main module for the dojo package; it loads dojo base appropriate for the execution environment.
21
22        // the preferred way to load the dojo firebug console is by setting has("dojo-firebug") true in dojoConfig
23        // the isDebug config switch is for backcompat and will work fine in sync loading mode; it works in
24        // async mode too, but there's no guarantee when the module is loaded; therefore, if you need a firebug
25        // console guarnanteed at a particular spot in an app, either set config.has["dojo-firebug"] true before
26        // loading dojo.js or explicitly include dojo/_firebug/firebug in a dependency list.
27        if(dojo.config.isDebug){
28                require(["./_firebug/firebug"]);
29        }
30
31        // dojoConfig.require is deprecated; use the loader configuration property deps
32        has.add("dojo-config-require", 1);
33        if(has("dojo-config-require")){
34                var deps= dojo.config.require;
35                if(deps){
36                        // dojo.config.require may be dot notation
37                        deps= array.map(lang.isArray(deps) ? deps : [deps], function(item){ return item.replace(/\./g, "/"); });
38                        if(dojo.isAsync){
39                                require(deps);
40                        }else{
41                                // this is a bit janky; in 1.6- dojo is defined before these requires are applied; but in 1.7+
42                                // dojo isn't defined until returning from this module; this is only a problem in sync mode
43                                // since we're in sync mode, we know we've got our loader with its priority ready queue
44                                ready(1, function(){require(deps);});
45                        }
46                }
47        }
48
49        return dojo;
50});
Note: See TracBrowser for help on using the repository browser.