main.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. define("dojo/main", [
  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. "./_base/browser",
  16. "./_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. // the preferred way to load the dojo firebug console is by setting has("dojo-firebug") true in dojoConfig
  22. // the isDebug config switch is for backcompat and will work fine in sync loading mode; it works in
  23. // async mode too, but there's no guarantee when the module is loaded; therefore, if you need a firebug
  24. // console guarnanteed at a particular spot in an app, either set config.has["dojo-firebug"] true before
  25. // loading dojo.js or explicitly include dojo/_firebug/firebug in a dependency list.
  26. if(dojo.config.isDebug){
  27. require(["./_firebug/firebug"]);
  28. }
  29. // dojoConfig.require is deprecated; use the loader configuration property deps
  30. true || has.add("dojo-config-require", 1);
  31. if(1){
  32. var deps= dojo.config.require;
  33. if(deps){
  34. // dojo.config.require may be dot notation
  35. deps= array.map(lang.isArray(deps) ? deps : [deps], function(item){ return item.replace(/\./g, "/"); });
  36. if(dojo.isAsync){
  37. require(deps);
  38. }else{
  39. // this is a bit janky; in 1.6- dojo is defined before these requires are applied; but in 1.7+
  40. // dojo isn't defined until returning from this module; this is only a problem in sync mode
  41. // since we're in sync mode, we know we've got our loader with its priority ready queue
  42. ready(1, function(){require(deps);});
  43. }
  44. }
  45. }
  46. return dojo;
  47. });