config.js 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. define("dojo/_base/config", ["../has", "require"], function(has, require){
  2. // module:
  3. // dojo/_base/config
  4. // summary:
  5. // This module defines the user configuration during bootstrap.
  6. // description:
  7. // By defining user configuration as a module value, an entire configuration can be specified in a build,
  8. // thereby eliminating the need for sniffing and or explicitly setting in the global variable dojoConfig.
  9. // Also, when multiple instances of dojo exist in a single application, each will necessarily be located
  10. // at an unique absolute module identifier as given by the package configuration. Implementing configuration
  11. // as a module allows for specifying unique, per-instance configurations.
  12. // example:
  13. // Create a second instance of dojo with a different, instance-uniqe configuration (assume the loader and
  14. // dojo.js are already loaded).
  15. // | // specify a configuration that creates a new instance of dojo at the absolute module identifier "myDojo"
  16. // | require({
  17. // | packages:[{
  18. // | name:"myDojo",
  19. // | location:".", //assume baseUrl points to dojo.js
  20. // | }]
  21. // | });
  22. // |
  23. // | // specify a configuration for the myDojo instance
  24. // | define("myDojo/config", {
  25. // | // normal configuration variables go here, e.g.,
  26. // | locale:"fr-ca"
  27. // | });
  28. // |
  29. // | // load and use the new instance of dojo
  30. // | require(["myDojo"], function(dojo) {
  31. // | // dojo is the new instance of dojo
  32. // | // use as required
  33. // | });
  34. var result = {};
  35. if(1){
  36. // must be the dojo loader; take a shallow copy of require.rawConfig
  37. var src = require.rawConfig, p;
  38. for(p in src){
  39. result[p] = src[p];
  40. }
  41. }else{
  42. var global = (function () { return this; })();
  43. var adviseHas = function(featureSet, prefix, booting){
  44. for(p in featureSet){
  45. p!="has" && has.add(prefix + p, featureSet[p], 0, booting);
  46. }
  47. };
  48. result = 1 ?
  49. // must be a built version of the dojo loader; all config stuffed in require.rawConfig
  50. require.rawConfig :
  51. // a foreign loader
  52. global.dojoConfig || global.djConfig || {};
  53. adviseHas(result, "config", 1);
  54. adviseHas(result.has, "", 1);
  55. }
  56. return result;
  57. /*=====
  58. // note:
  59. // 'dojoConfig' does not exist under 'dojo.*' so that it can be set before the
  60. // 'dojo' variable exists.
  61. // note:
  62. // Setting any of these variables *after* the library has loaded does
  63. // nothing at all.
  64. // FIXME: can we document these on dojo.config object and explain they must be set via djConfig/dojoConfig global prior to loading dojo.js
  65. dojoConfig = {
  66. // summary:
  67. // Application code can set the global 'dojoConfig' prior to loading
  68. // the library to control certain global settings for how dojo works.
  69. //
  70. // isDebug: Boolean
  71. // Defaults to `false`. If set to `true`, ensures that Dojo provides
  72. // extended debugging feedback via Firebug. If Firebug is not available
  73. // on your platform, setting `isDebug` to `true` will force Dojo to
  74. // pull in (and display) the version of Firebug Lite which is
  75. // integrated into the Dojo distribution, thereby always providing a
  76. // debugging/logging console when `isDebug` is enabled. Note that
  77. // Firebug's `console.*` methods are ALWAYS defined by Dojo. If
  78. // `isDebug` is false and you are on a platform without Firebug, these
  79. // methods will be defined as no-ops.
  80. isDebug: false,
  81. // locale: String
  82. // The locale to assume for loading localized resources in this page,
  83. // specified according to [RFC 3066](http://www.ietf.org/rfc/rfc3066.txt).
  84. // Must be specified entirely in lowercase, e.g. `en-us` and `zh-cn`.
  85. // See the documentation for `dojo.i18n` and `dojo.requireLocalization`
  86. // for details on loading localized resources. If no locale is specified,
  87. // Dojo assumes the locale of the user agent, according to `navigator.userLanguage`
  88. // or `navigator.language` properties.
  89. locale: undefined,
  90. // extraLocale: Array
  91. // No default value. Specifies additional locales whose
  92. // resources should also be loaded alongside the default locale when
  93. // calls to `dojo.requireLocalization()` are processed.
  94. extraLocale: undefined,
  95. // baseUrl: String
  96. // The directory in which `dojo.js` is located. Under normal
  97. // conditions, Dojo auto-detects the correct location from which it
  98. // was loaded. You may need to manually configure `baseUrl` in cases
  99. // where you have renamed `dojo.js` or in which `<base>` tags confuse
  100. // some browsers (e.g. IE 6). The variable `dojo.baseUrl` is assigned
  101. // either the value of `djConfig.baseUrl` if one is provided or the
  102. // auto-detected root if not. Other modules are located relative to
  103. // this path. The path should end in a slash.
  104. baseUrl: undefined,
  105. // modulePaths: Object
  106. // A map of module names to paths relative to `dojo.baseUrl`. The
  107. // key/value pairs correspond directly to the arguments which
  108. // `dojo.registerModulePath` accepts. Specifiying
  109. // `djConfig.modulePaths = { "foo": "../../bar" }` is the equivalent
  110. // of calling `dojo.registerModulePath("foo", "../../bar");`. Multiple
  111. // modules may be configured via `djConfig.modulePaths`.
  112. modulePaths: {},
  113. // afterOnLoad: Boolean
  114. // Indicates Dojo was added to the page after the page load. In this case
  115. // Dojo will not wait for the page DOMContentLoad/load events and fire
  116. // its dojo.addOnLoad callbacks after making sure all outstanding
  117. // dojo.required modules have loaded. Only works with a built dojo.js,
  118. // it does not work the dojo.js directly from source control.
  119. afterOnLoad: false,
  120. // addOnLoad: Function or Array
  121. // Adds a callback via dojo.addOnLoad. Useful when Dojo is added after
  122. // the page loads and djConfig.afterOnLoad is true. Supports the same
  123. // arguments as dojo.addOnLoad. When using a function reference, use
  124. // `djConfig.addOnLoad = function(){};`. For object with function name use
  125. // `djConfig.addOnLoad = [myObject, "functionName"];` and for object with
  126. // function reference use
  127. // `djConfig.addOnLoad = [myObject, function(){}];`
  128. addOnLoad: null,
  129. // require: Array
  130. // An array of module names to be loaded immediately after dojo.js has been included
  131. // in a page.
  132. require: [],
  133. // defaultDuration: Array
  134. // Default duration, in milliseconds, for wipe and fade animations within dijits.
  135. // Assigned to dijit.defaultDuration.
  136. defaultDuration: 200,
  137. // dojoBlankHtmlUrl: String
  138. // Used by some modules to configure an empty iframe. Used by dojo.io.iframe and
  139. // dojo.back, and dijit popup support in IE where an iframe is needed to make sure native
  140. // controls do not bleed through the popups. Normally this configuration variable
  141. // does not need to be set, except when using cross-domain/CDN Dojo builds.
  142. // Save dojo/resources/blank.html to your domain and set `djConfig.dojoBlankHtmlUrl`
  143. // to the path on your domain your copy of blank.html.
  144. dojoBlankHtmlUrl: undefined,
  145. // ioPublish: Boolean?
  146. // Set this to true to enable publishing of topics for the different phases of
  147. // IO operations. Publishing is done via dojo.publish. See dojo.__IoPublish for a list
  148. // of topics that are published.
  149. ioPublish: false,
  150. // useCustomLogger: Anything?
  151. // If set to a value that evaluates to true such as a string or array and
  152. // isDebug is true and Firebug is not available or running, then it bypasses
  153. // the creation of Firebug Lite allowing you to define your own console object.
  154. useCustomLogger: undefined,
  155. // transparentColor: Array
  156. // Array containing the r, g, b components used as transparent color in dojo.Color;
  157. // if undefined, [255,255,255] (white) will be used.
  158. transparentColor: undefined,
  159. // skipIeDomLoaded: Boolean
  160. // For IE only, skip the DOMContentLoaded hack used. Sometimes it can cause an Operation
  161. // Aborted error if the rest of the page triggers script defers before the DOM is ready.
  162. // If this is config value is set to true, then dojo.addOnLoad callbacks will not be
  163. // triggered until the page load event, which is after images and iframes load. If you
  164. // want to trigger the callbacks sooner, you can put a script block in the bottom of
  165. // your HTML that calls dojo._loadInit();. If you are using multiversion support, change
  166. // "dojo." to the appropriate scope name for dojo.
  167. skipIeDomLoaded: false
  168. }
  169. =====*/
  170. });