Changeset 11356
- Timestamp:
- 11/02/07 18:42:17 (13 months ago)
- Location:
- dojo/trunk/_base
- Files:
-
- 7 modified
-
array.js (modified) (3 diffs)
-
connect.js (modified) (3 diffs)
-
declare.js (modified) (1 diff)
-
Deferred.js (modified) (3 diffs)
-
fx.js (modified) (2 diffs)
-
html.js (modified) (3 diffs)
-
_loader/hostenv_browser.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
dojo/trunk/_base/array.js
r11140 r11356 85 85 // information on this can be found here: 86 86 // 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 92 93 return this._everyOrSome(true, arr, callback, thisObject); // Boolean 93 94 }, … … 122 123 // provided by Array instances. For details on this, see: 123 124 // 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] 127 128 var _p = _getParts(arr, obj, func); arr = _p[0]; 128 129 var outArr = ((arguments[3]) ? (new arguments[3]()) : []); … … 135 136 filter: function(/*Array*/arr, /*Function*/callback, /*Object?*/obj){ 136 137 // summary: 137 // returns a new Array with those items from arr that match the138 // Returns a new Array with those items from arr that match the 138 139 // condition implemented by callback. ob may be used to 139 140 // scope the call to callback. The function signature is derived -
dojo/trunk/_base/connect.js
r11224 r11356 134 134 // 135 135 // example: 136 // // when obj.onchange(), do ui.update()137 // dojo.connect(obj, "onchange", ui, "update");138 // dojo.connect(obj, "onchange", ui, ui.update); // same139 // 140 // example: 141 // // using return value for disconnect142 // var link = dojo.connect(obj, "onchange", ui, "update");143 // ...144 // dojo.disconnect(link);145 // 146 // example: 147 // // when onglobalevent executes, watcher.handler is invoked148 // dojo.connect(null, "onglobalevent", watcher, "handler");149 // 150 // example: 151 // // when ob.onCustomEvent executes, customEventHandler is invoked152 // dojo.connect(ob, "onCustomEvent", null, "customEventHandler");153 // dojo.connect(ob, "onCustomEvent", "customEventHandler"); // same154 // 155 // example: 156 // // when ob.onCustomEvent executes, customEventHandler is invoked157 // // with the same scope (this)158 // dojo.connect(ob, "onCustomEvent", null, customEventHandler);159 // dojo.connect(ob, "onCustomEvent", customEventHandler); // same160 // 161 // example: 162 // // when globalEvent executes, globalHandler is invoked163 // // with the same scope (this)164 // dojo.connect(null, "globalEvent", null, globalHandler);165 // dojo.connect("globalEvent", globalHandler); // same136 // 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 166 166 167 167 // normalize arguments … … 219 219 // | dojo.subscribe("alerts", null, function(caption, message){ alert(caption + "\n" + message); }; 220 220 // | dojo.publish("alerts", [ "read this", "hello world" ]); 221 221 222 222 // support for 2 argument invocation (omitting context) depends on hitch 223 223 return [topic, dojo._listener.add(dojo._topics, topic, dojo.hitch(context, method))]; /*Handle*/ … … 249 249 // | dojo.subscribe("alerts", null, function(caption, message){ alert(caption + "\n" + message); }; 250 250 // | dojo.publish("alerts", [ "read this", "hello world" ]); 251 251 252 252 // Note that args is an array, which is more efficient vs variable length 253 253 // argument list. Ideally, var args would be implemented via Array -
dojo/trunk/_base/declare.js
r11340 r11356 7 7 // summary: 8 8 // Create a feature-rich constructor from compact notation 9 // className: String9 // className: 10 10 // The name of the constructor (loosely, a "class") 11 11 // stored in the "declaredClass" property in the created prototype 12 // superclass: Function||Array12 // superclass: 13 13 // May be null, a Function, or an Array of Functions. If an array, 14 14 // the first element is used as the prototypical ancestor and 15 15 // any following Functions become mixin ancestors. 16 // props: Object16 // props: 17 17 // An object whose properties are copied to the 18 18 // created prototype. -
dojo/trunk/_base/Deferred.js
r11140 r11356 120 120 // another kind of error), so the errbacks should be prepared to 121 121 // 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; 122 126 // example: 123 127 // Deferred objects are often used when making code asynchronous. It … … 150 154 // | }); 151 155 // | // NOTE: no way to add another callback here!! 152 // 156 // example: 153 157 // Using a Deferred doesn't simplify the sending code any, but it 154 158 // provides a standard interface for callers and senders alike, … … 179 183 // | // again, so we could chain adding callbacks or save the 180 184 // | // deferred for later should we need to be notified again. 181 // 185 // example: 182 186 // In this example, renderLotsOfData is syncrhonous and so both 183 187 // versions are pretty artificial. Putting the data display on a -
dojo/trunk/_base/fx.js
r11225 r11356 15 15 // dojo._Line is the object used to generate values from a start value 16 16 // to an end value 17 // start: 17 // start: int 18 18 // Beginning value for range 19 // end: 19 // end: int 20 20 // Ending value for range 21 21 this.start = start; … … 65 65 // the time in milliseconds to wait before advancing to next frame 66 66 // (used as a fps timer: rate/1000 = fps) 67 rate: 10 , // 100 fps67 rate: 10 /* 100 fps */, 68 68 69 69 /*===== -
dojo/trunk/_base/html.js
r11339 r11356 26 26 // DOM id or DOM Node 27 27 // doc: 28 // optional, defaults to the current value of28 // Document to work in. Defaults to the current value of 29 29 // dojo.doc. Can be used to retreive 30 30 // node references from other documents. … … 250 250 // Use the dojo.style() method for more consistent (pixelized) 251 251 // return values. 252 // node: 252 // node: DOMNode 253 253 // a reference to a DOM node. Does NOT support taking an 254 254 // ID string for speed reasons. … … 344 344 // set the opacity of the passed node portably. Returns the 345 345 // new opacity of the node. 346 // node: 346 // node: DOMNode 347 347 // a reference to a DOM node. Does NOT support taking an 348 348 // 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. 351 351 // return: Number between 0 and 1 352 352 } -
dojo/trunk/_base/_loader/hostenv_browser.js
r11005 r11356 128 128 var hasBase = (base && base.length > 0); 129 129 130 d._getText = function( uri,fail_ok){130 d._getText = function(/*URI*/ uri, /*Boolean*/ fail_ok){ 131 131 // summary: Read the contents of the specified uri and return those contents. 132 132 // uri: