Changeset 7729

Show
Ignore:
Timestamp:
03/21/07 06:29:36 (22 months ago)
Author:
alex
Message:

adding docs to base loader. Refs #2500

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • dojo/trunk/dojo.js

    r7715 r7729  
     1// summary: 
     2//              This is the "source loader" for Dojo. This dojo.js ensures that all 
     3//              Base APIs are available once its execution is complete and attempts to 
     4//              automatically determine the correct host environment to use. 
     5// description: 
     6//              "dojo.js" is the basic entry point into the toolkit for all uses and 
     7//              users. The "source loader" is replaced by environment-specific builds 
     8//              and so you should not assume that built versions of the toolkit will 
     9//              function in all supported platforms (Browsers, Rhino, Spidermonkey, 
     10//              etc.). In most cases, users will receive pre-built dojo.js files which 
     11//              contain all of the Base APIs in a single file and which specialize for 
     12//              the Browser platform. After loading dojo.js, you will be able to do the 
     13//              following with the toolkit: 
     14//                      All platforms: 
     15//                              - load other packages (dojo core, dijit, dojox, and custom 
     16//                                modules) to better structure your code and take advantage of 
     17//                                the inventive capabilities developed by the broad Dojo 
     18//                                community 
     19//                              - perform basic network I/O 
     20//                              - use Dojo's powerful language supplementing APIs 
     21//                              - take advantage of the Dojo event system to better structure 
     22//                                your application 
     23//                      Browser only: 
     24//                              - use Dojo's powerful and blisteringly-fast CSS query engine to 
     25//                                upgrade and active your web pages without embedding 
     26//                                JavaScript in your markup 
     27//                              - get and set accurate information about element style  
     28//                              - shorten the time it takes to build and manipulate DOM 
     29//                                structures with Dojo's HTML handling APIs 
     30//                              - create more fluid UI transitions with Dojo's robust and 
     31//                                battle-tested animation facilities 
     32 
     33// NOTE: 
     34//              If you are reading this file, you have received a "source" build of 
     35//              Dojo. Unless you are a Dojo developer, it is very unlikely that this is 
     36//              what you want. While functionally identical to builds, source versions 
     37//              of Dojo load more slowly than pre-processed builds. 
     38// 
     39//              We strongly recommend that your applications always use a build of 
     40//              Dojo. To download such a build or find out how you can create 
     41//              customized, high-performance packages of Dojo suitable for use with 
     42//              your application, please visit: 
     43// 
     44//                      http://dojotoolkit.org 
     45// 
     46//              Regards, 
     47//              The Dojo Team 
     48 
    149if(typeof dojo == "undefined"){ 
     50        // only try to load Dojo if we don't already have one. Dojo always follows 
     51        // a "first Dojo wins" policy. 
    252        (function(){ 
     53                // we default to a browser environment if we can't figure it out 
    354                var hostEnv = "browser"; 
    455                var isRhino = false; 
     
    1162                        ) 
    1263                ){ 
     64                        // Rhino environments make Java code available via the Packages 
     65                        // object. Obviously, this check could be "juiced" if someone 
     66                        // creates a "Packages" object and a "load" function, but we've 
     67                        // never seen this happen in the wild yet. 
    1368                        var isRhino = true; 
    1469                        hostEnv = "rhino"; 
    1570                }else if(typeof this["load"] == "function"){ 
     71                        // Spidermonkey has a very spartan environment. The only thing we 
     72                        // can count on from it is a "load" function. 
    1673                        isSpidermonkey  = true; 
    1774                        hostEnv = "spidermonkey"; 
     
    3087         
    3188                if((this["djConfig"])&&(djConfig["baseUrl"])){ 
     89                        // if the user explicitly tells us where Dojo has been loaded from 
     90                        // (or should be loaded from) via djConfig, skip the auto-detection 
     91                        // routines. 
    3292                        var root = djConfig["baseUrl"]; 
    3393                }else{ 
     
    63123                        tmps[x] = root+"_base/_loader/"+tmps[x]; 
    64124                } 
     125                // the "_base.js" file ensures that the rest of Dojo Base is available. 
     126                // It counts on the package system functioning in order to work, so add 
     127                // it last 
    65128                tmps.push(root+"_base.js"); 
    66129