source: Dev/trunk/src/client/dojo/main.js @ 493

Last change on this file since 493 was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

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