Changeset 11356

Show
Ignore:
Timestamp:
11/02/07 18:42:17 (13 months ago)
Author:
pottedmeat
Message:

Refs #4820. Documentation updates

Location:
dojo/trunk/_base
Files:
7 modified

Legend:

Unmodified
Added
Removed
  • dojo/trunk/_base/array.js

    r11140 r11356  
    8585                        //              information on this can be found here: 
    8686                        //                      http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:every 
    87                         // usage: 
    88                         //              dojo.every([1, 2, 3, 4], function(item){ return item>1; }); 
    89                         //              // returns false 
    90                         //              dojo.every([1, 2, 3, 4], function(item){ return item>0; }); 
    91                         //              // returns true  
     87                        // example: 
     88                        //      |       dojo.every([1, 2, 3, 4], function(item){ return item>1; }); 
     89                        //              returns false 
     90                        // example: 
     91                        //      |       dojo.every([1, 2, 3, 4], function(item){ return item>0; }); 
     92                        //              returns true  
    9293                        return this._everyOrSome(true, arr, callback, thisObject); // Boolean 
    9394                }, 
     
    122123                        //              provided by Array instances. For details on this, see: 
    123124                        //                      http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:map 
    124                         // usage: 
    125                         //              dojo.map([1, 2, 3, 4], function(item){ return item+1 }); 
    126                         //              // returns [2, 3, 4, 5] 
     125                        // example: 
     126                        //      |       dojo.map([1, 2, 3, 4], function(item){ return item+1 }); 
     127                        //              returns [2, 3, 4, 5] 
    127128                        var _p = _getParts(arr, obj, func); arr = _p[0]; 
    128129                        var outArr = ((arguments[3]) ? (new arguments[3]()) : []); 
     
    135136                filter: function(/*Array*/arr, /*Function*/callback, /*Object?*/obj){ 
    136137                        // summary: 
    137                         //              returns a new Array with those items from arr that match the 
     138                        //              Returns a new Array with those items from arr that match the 
    138139                        //              condition implemented by callback. ob may be used to 
    139140                        //              scope the call to callback. The function signature is derived 
  • dojo/trunk/_base/connect.js

    r11224 r11356  
    134134        // 
    135135        // example: 
    136         //              // when obj.onchange(), do ui.update() 
    137         //              dojo.connect(obj, "onchange", ui, "update"); 
    138         //              dojo.connect(obj, "onchange", ui, ui.update); // same 
    139         // 
    140         // example: 
    141         //              // using return value for disconnect 
    142         //              var link = dojo.connect(obj, "onchange", ui, "update"); 
    143         //              ... 
    144         //              dojo.disconnect(link); 
    145         // 
    146         // example: 
    147         //              // when onglobalevent executes, watcher.handler is invoked 
    148         //              dojo.connect(null, "onglobalevent", watcher, "handler"); 
    149         // 
    150         // example: 
    151         //              // when ob.onCustomEvent executes, customEventHandler is invoked 
    152         //              dojo.connect(ob, "onCustomEvent", null, "customEventHandler"); 
    153         //              dojo.connect(ob, "onCustomEvent", "customEventHandler"); // same 
    154         // 
    155         // example: 
    156         //              // when ob.onCustomEvent executes, customEventHandler is invoked 
    157         //              // with the same scope (this) 
    158         //              dojo.connect(ob, "onCustomEvent", null, customEventHandler); 
    159         //              dojo.connect(ob, "onCustomEvent", customEventHandler); // same 
    160         // 
    161         // example: 
    162         //              // when globalEvent executes, globalHandler is invoked 
    163         //              // with the same scope (this) 
    164         //              dojo.connect(null, "globalEvent", null, globalHandler); 
    165         //              dojo.connect("globalEvent", globalHandler); // same 
     136        //              When obj.onchange(), do ui.update(): 
     137        //      |       dojo.connect(obj, "onchange", ui, "update"); 
     138        //      |       dojo.connect(obj, "onchange", ui, ui.update); // same 
     139        // 
     140        // example: 
     141        //              Using return value for disconnect: 
     142        //      |       var link = dojo.connect(obj, "onchange", ui, "update"); 
     143        //      |       ... 
     144        //      |       dojo.disconnect(link); 
     145        // 
     146        // example: 
     147        //              When onglobalevent executes, watcher.handler is invoked: 
     148        //      |       dojo.connect(null, "onglobalevent", watcher, "handler"); 
     149        // 
     150        // example: 
     151        //              When ob.onCustomEvent executes, customEventHandler is invoked: 
     152        //      |       dojo.connect(ob, "onCustomEvent", null, "customEventHandler"); 
     153        //      |       dojo.connect(ob, "onCustomEvent", "customEventHandler"); // same 
     154        // 
     155        // example: 
     156        //              When ob.onCustomEvent executes, customEventHandler is invoked 
     157        //              with the same scope (this): 
     158        //      |       dojo.connect(ob, "onCustomEvent", null, customEventHandler); 
     159        //      |       dojo.connect(ob, "onCustomEvent", customEventHandler); // same 
     160        // 
     161        // example: 
     162        //              When globalEvent executes, globalHandler is invoked 
     163        //              with the same scope (this): 
     164        //      |       dojo.connect(null, "globalEvent", null, globalHandler); 
     165        //      |       dojo.connect("globalEvent", globalHandler); // same 
    166166 
    167167        // normalize arguments 
     
    219219        //      |       dojo.subscribe("alerts", null, function(caption, message){ alert(caption + "\n" + message); }; 
    220220        //      |       dojo.publish("alerts", [ "read this", "hello world" ]);                                                                                                                                  
    221          
     221 
    222222        // support for 2 argument invocation (omitting context) depends on hitch 
    223223        return [topic, dojo._listener.add(dojo._topics, topic, dojo.hitch(context, method))]; /*Handle*/ 
     
    249249        //      |       dojo.subscribe("alerts", null, function(caption, message){ alert(caption + "\n" + message); }; 
    250250        //      |       dojo.publish("alerts", [ "read this", "hello world" ]);  
    251          
     251 
    252252        // Note that args is an array, which is more efficient vs variable length 
    253253        // argument list.  Ideally, var args would be implemented via Array 
  • dojo/trunk/_base/declare.js

    r11340 r11356  
    77        //      summary:  
    88        //              Create a feature-rich constructor from compact notation 
    9         //      className: String 
     9        //      className: 
    1010        //              The name of the constructor (loosely, a "class") 
    1111        //              stored in the "declaredClass" property in the created prototype 
    12         //      superclass: Function||Array 
     12        //      superclass: 
    1313        //              May be null, a Function, or an Array of Functions. If an array,  
    1414        //              the first element is used as the prototypical ancestor and 
    1515        //              any following Functions become mixin ancestors. 
    16         //      props: Object 
     16        //      props: 
    1717        //              An object whose properties are copied to the 
    1818        //              created prototype. 
  • dojo/trunk/_base/Deferred.js

    r11140 r11356  
    120120        //              another kind of error), so the errbacks should be prepared to 
    121121        //              handle that error for cancellable Deferreds. 
     122        // example: 
     123        //      |       var deferred = new dojo.Deferred(); 
     124        //      |       setTimeout(function(){ deferred.callback({success: true}); }, 1000); 
     125        //      |       return deferred; 
    122126        // example: 
    123127        //              Deferred objects are often used when making code asynchronous. It 
     
    150154        //              |       }); 
    151155        //              |       // NOTE: no way to add another callback here!! 
    152         // 
     156        // example: 
    153157        //              Using a Deferred doesn't simplify the sending code any, but it 
    154158        //              provides a standard interface for callers and senders alike, 
     
    179183        //              |       // again, so we could chain adding callbacks or save the 
    180184        //              |       // deferred for later should we need to be notified again. 
    181         // 
     185        // example: 
    182186        //              In this example, renderLotsOfData is syncrhonous and so both 
    183187        //              versions are pretty artificial. Putting the data display on a 
  • dojo/trunk/_base/fx.js

    r11225 r11356  
    1515        //              dojo._Line is the object used to generate values from a start value 
    1616        //              to an end value 
    17         //      start:  
     17        //      start: int 
    1818        //              Beginning value for range 
    19         //      end: 
     19        //      end: int 
    2020        //              Ending value for range 
    2121        this.start = start; 
     
    6565        //      the time in milliseconds to wait before advancing to next frame  
    6666        //      (used as a fps timer: rate/1000 = fps) 
    67         rate: 10, // 100 fps 
     67        rate: 10 /* 100 fps */, 
    6868 
    6969/*=====  
  • dojo/trunk/_base/html.js

    r11339 r11356  
    2626                //              DOM id or DOM Node 
    2727                //      doc: 
    28                 //              optional, defaults to the current value of 
     28                //              Document to work in. Defaults to the current value of 
    2929                //              dojo.doc.  Can be used to retreive 
    3030                //              node references from other documents. 
     
    250250                //              Use the dojo.style() method for more consistent (pixelized) 
    251251                //              return values. 
    252                 //      node: 
     252                //      node: DOMNode 
    253253                //              a reference to a DOM node. Does NOT support taking an 
    254254                //              ID string for speed reasons. 
     
    344344                        //              set the opacity of the passed node portably. Returns the 
    345345                        //              new opacity of the node. 
    346                         //      node: 
     346                        //      node: DOMNode 
    347347                        //              a reference to a DOM node. Does NOT support taking an 
    348348                        //              ID string for performance reasons. 
    349                         //      opacity: 
    350                         //              Number between 0 and 1. 0 specifies transparent. 
     349                        //      opacity: Number 
     350                        //              A Number between 0 and 1. 0 specifies transparent. 
    351351                        //      return: Number between 0 and 1 
    352352        } 
  • dojo/trunk/_base/_loader/hostenv_browser.js

    r11005 r11356  
    128128                var hasBase = (base && base.length > 0); 
    129129 
    130                 d._getText = function(uri, fail_ok){ 
     130                d._getText = function(/*URI*/ uri, /*Boolean*/ fail_ok){ 
    131131                        // summary: Read the contents of the specified uri and return those contents. 
    132132                        // uri: