a:12:{s:9:"#provides";s:4:"dojo";s:9:"#resource";s:14:"_base/array.js";s:9:"#requires";a:1:{i:0;a:2:{i:0;s:6:"common";i:1;s:15:"dojo._base.lang";}}s:12:"dojo.indexOf";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:4:{s:5:"array";a:1:{s:4:"type";s:5:"Array";}s:5:"value";a:1:{s:4:"type";s:6:"Object";}s:9:"fromIndex";a:2:{s:8:"optional";b:1;s:4:"type";s:7:"Integer";}s:8:"findLast";a:2:{s:8:"optional";b:1;s:4:"type";s:7:"Boolean";}}s:6:"source";s:304:" var step = 1, end = array.length || 0, i = 0; if(findLast){ i = end - 1; step = end = -1; } if(fromIndex != undefined){ i = fromIndex; } if((findLast && i > end) || i < end){ for(; i != end; i += step){ if(array[i] == value){ return i; } } } return -1; // Number";s:7:"summary";s:109:"locates the first index of the provided value in the passed array. If the value is not found, -1 is returned.";s:11:"description";s:128:"For details on this method, see: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:indexOf";s:7:"returns";s:6:"Number";}s:16:"dojo.lastIndexOf";a:6:{s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:5:"array";a:1:{s:4:"type";s:5:"Array";}s:5:"value";a:1:{s:4:"type";s:6:"Object";}s:9:"fromIndex";a:2:{s:8:"optional";b:1;s:4:"type";s:7:"Integer";}}s:6:"source";s:64:" return dojo.indexOf(array, value, fromIndex, true); // Number";s:7:"summary";s:108:"locates the last index of the provided value in the passed array. If the value is not found, -1 is returned.";s:11:"description";s:132:"For details on this method, see: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:lastIndexOf";s:7:"returns";s:6:"Number";}s:12:"dojo.forEach";a:7:{s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:3:"arr";a:2:{s:4:"type";s:12:"Array|String";s:7:"summary";s:74:"the array to iterate over. If a string, operates on individual characters.";}s:8:"callback";a:2:{s:4:"type";s:15:"Function|String";s:7:"summary";s:66:"a function is invoked with three arguments: item, index, and array";}s:10:"thisObject";a:3:{s:8:"optional";b:1;s:4:"type";s:6:"Object";s:7:"summary";s:41:"may be used to scope the call to callback";}}s:6:"source";s:3735:"dojo.require("dojo._base.lang"); dojo.provide("dojo._base.array"); //>>excludeStart("webkitMobile", kwArgs.webkitMobile); (function(){ var _getParts = function(arr, obj, cb){ return [ dojo.isString(arr) ? arr.split("") : arr, obj || dojo.global, // FIXME: cache the anonymous functions we create here? dojo.isString(cb) ? new Function("item", "index", "array", cb) : cb ]; }; dojo.mixin(dojo, { indexOf: function( /*Array*/ array, /*Object*/ value, /*Integer?*/ fromIndex, /*Boolean?*/ findLast){ // summary: // locates the first index of the provided value in the // passed array. If the value is not found, -1 is returned. // description: // For details on this method, see: // http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:indexOf var step = 1, end = array.length || 0, i = 0; if(findLast){ i = end - 1; step = end = -1; } if(fromIndex != undefined){ i = fromIndex; } if((findLast && i > end) || i < end){ for(; i != end; i += step){ if(array[i] == value){ return i; } } } return -1; // Number }, lastIndexOf: function(/*Array*/array, /*Object*/value, /*Integer?*/fromIndex){ // summary: // locates the last index of the provided value in the passed // array. If the value is not found, -1 is returned. // description: // For details on this method, see: // http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:lastIndexOf return dojo.indexOf(array, value, fromIndex, true); // Number }, forEach: function(/*Array|String*/arr, /*Function|String*/callback, /*Object?*/thisObject){ // summary: // for every item in arr, callback is invoked. Return values are ignored. // arr: // the array to iterate over. If a string, operates on individual characters. // callback: // a function is invoked with three arguments: item, index, and array // thisObject: // may be used to scope the call to callback // description: // This function corresponds to the JavaScript 1.6 // Array.forEach() method. For more details, see: // http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:forEach // example: // | // log out all members of the array: // | dojo.forEach( // | [ "thinger", "blah", "howdy", 10 ], // | function(item){ // | console.log(item); // | } // | ); // example: // | // log out the members and their indexes // | dojo.forEach( // | [ "thinger", "blah", "howdy", 10 ], // | function(item, idx, arr){ // | console.log(item, "at index:", idx); // | } // | ); // example: // | // use a scoped object member as the callback // | // | var obj = { // | prefix: "logged via obj.callback:", // | callback: function(item){ // | console.log(this.prefix, item); // | } // | }; // | // | // specifying the scope function executes the callback in that scope // | dojo.forEach( // | [ "thinger", "blah", "howdy", 10 ], // | obj.callback, // | obj // | ); // | // | // alternately, we can accomplish the same thing with dojo.hitch() // | dojo.forEach( // | [ "thinger", "blah", "howdy", 10 ], // | dojo.hitch(obj, "callback") // | ); // match the behavior of the built-in forEach WRT empty arrs if(!arr || !arr.length){ return; } // FIXME: there are several ways of handilng thisObject. Is // dojo.global always the default context? var _p = _getParts(arr, thisObject, callback); arr = _p[0]; for(var i=0,l=arr.length; i1; });";i:1;s:79:" // returns true dojo.every([1, 2, 3, 4], function(item){ return item>0; });";}}s:9:"dojo.some";a:7:{s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:3:"arr";a:2:{s:4:"type";s:12:"Array|String";s:7:"summary";s:74:"the array to iterate over. If a string, operates on individual characters.";}s:8:"callback";a:2:{s:4:"type";s:15:"Function|String";s:7:"summary";s:108:"a function is invoked with three arguments: item, index, and array and returns true if the condition is met.";}s:10:"thisObject";a:3:{s:8:"optional";b:1;s:4:"type";s:6:"Object";s:7:"summary";s:41:"may be used to scope the call to callback";}}s:6:"source";s:73:" return dojo._everyOrSome(false, arr, callback, thisObject); // Boolean";s:7:"summary";s:90:"Determines whether or not any item in arr satisfies the condition implemented by callback.";s:11:"description";s:184:"This function corresponds to the JavaScript 1.6 Array.some() method. For more details, see: http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:some";s:7:"returns";s:7:"Boolean";s:8:"examples";a:2:{i:0;s:73:" // is true dojo.some([1, 2, 3, 4], function(item){ return item>1; });";i:1;s:74:" // is false dojo.some([1, 2, 3, 4], function(item){ return item<1; });";}}s:8:"dojo.map";a:7:{s:4:"type";s:8:"Function";s:10:"parameters";a:3:{s:3:"arr";a:2:{s:4:"type";s:12:"Array|String";s:7:"summary";s:72:"the array to iterate on. If a string, operates on individual characters.";}s:8:"callback";a:2:{s:4:"type";s:15:"Function|String";s:7:"summary";s:86:"a function is invoked with three arguments, (item, index, array), and returns a value";}s:10:"thisObject";a:3:{s:8:"optional";b:1;s:4:"type";s:8:"Function";s:7:"summary";s:41:"may be used to scope the call to callback";}}s:6:"source";s:246:" var _p = _getParts(arr, thisObject, callback); arr = _p[0]; var outArr = (arguments[3] ? (new arguments[3]()) : []); for(var i=0,l=arr.length; i1; });";}}s:4:"dojo";a:2:{s:4:"type";s:6:"Object";s:7:"summary";s:0:"";}}