diff options
author | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-14 15:39:19 +0000 |
---|---|---|
committer | mensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f> | 2008-11-14 15:39:19 +0000 |
commit | 1c5685d68f1b73270fb814fe04cbb490eb90ba5f (patch) | |
tree | 3d3ada08a934b96fc31531f1327690d7edc6f766 /includes/js/dojox/lang/functional/reversed.js | |
parent | 104d59099e048688c4dbac37d72137006e396558 (diff) | |
download | semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.gz semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.bz2 |
Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojox/lang/functional/reversed.js')
-rw-r--r-- | includes/js/dojox/lang/functional/reversed.js | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/includes/js/dojox/lang/functional/reversed.js b/includes/js/dojox/lang/functional/reversed.js deleted file mode 100644 index 4375948..0000000 --- a/includes/js/dojox/lang/functional/reversed.js +++ /dev/null @@ -1,79 +0,0 @@ -if(!dojo._hasResource["dojox.lang.functional.reversed"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["dojox.lang.functional.reversed"] = true; -dojo.provide("dojox.lang.functional.reversed"); - -dojo.require("dojox.lang.functional.lambda"); - -// This module adds high-level functions and related constructs: -// - reversed versions of array-processing functions similar to standard JS functions - -// Notes: -// - this module provides reversed versions of standard array-processing functions: -// forEachRev, mapRev, filterRev - -// Defined methods: -// - take any valid lambda argument as the functional argument -// - operate on dense arrays -// - take a string as the array argument - -(function(){ - var d = dojo, df = dojox.lang.functional; - - d.mixin(df, { - // JS 1.6 standard array functions, which can take a lambda as a parameter. - // Consider using dojo._base.array functions, if you don't need the lambda support. - filterRev: function(/*Array|String*/ a, /*Function|String|Array*/ f, /*Object?*/ o){ - // summary: creates a new array with all elements that pass the test - // implemented by the provided function. - if(typeof a == "string"){ a = a.split(""); } - o = o || d.global; f = df.lambda(f); - var t = [], v; - for(var i = a.length - 1; i >= 0; --i){ - v = a[i]; - if(f.call(o, v, i, a)){ t.push(v); } - } - return t; // Array - }, - forEachRev: function(/*Array|String*/ a, /*Function|String|Array*/ f, /*Object?*/ o){ - // summary: executes a provided function once per array element. - if(typeof a == "string"){ a = a.split(""); } - o = o || d.global; f = df.lambda(f); - for(var i = a.length - 1; i >= 0; f.call(o, a[i], i, a), --i); - }, - mapRev: function(/*Array|String*/ a, /*Function|String|Array*/ f, /*Object?*/ o){ - // summary: creates a new array with the results of calling - // a provided function on every element in this array. - if(typeof a == "string"){ a = a.split(""); } - o = o || d.global; f = df.lambda(f); - var n = a.length, t = new Array(n); - for(var i = n - 1, j = 0; i >= 0; t[j++] = f.call(o, a[i], i, a), --i); - return t; // Array - }, - everyRev: function(/*Array|String*/ a, /*Function|String|Array*/ f, /*Object?*/ o){ - // summary: tests whether all elements in the array pass the test - // implemented by the provided function. - if(typeof a == "string"){ a = a.split(""); } - o = o || d.global; f = df.lambda(f); - for(var i = a.length - 1; i >= 0; --i){ - if(!f.call(o, a[i], i, a)){ - return false; // Boolean - } - } - return true; // Boolean - }, - someRev: function(/*Array|String*/ a, /*Function|String|Array*/ f, /*Object?*/ o){ - // summary: tests whether some element in the array passes the test - // implemented by the provided function. - if(typeof a == "string"){ a = a.split(""); } - o = o || d.global; f = df.lambda(f); - for(var i = a.length - 1; i >= 0; --i){ - if(f.call(o, a[i], i, a)){ - return true; // Boolean - } - } - return false; // Boolean - } - }); -})(); - -} |