diff options
author | Andrew Dolgov <[email protected]> | 2011-11-08 20:40:44 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-11-08 20:40:44 +0400 |
commit | 81bea17aefb26859f825b9293c7c99192874806e (patch) | |
tree | fb244408ca271affa2899adb634788802c9a89d8 /lib/dojo/data/util | |
parent | 870a70e109ac9e80a88047044530de53d0404ec7 (diff) |
upgrade Dojo to 1.6.1
Diffstat (limited to 'lib/dojo/data/util')
-rw-r--r-- | lib/dojo/data/util/filter.js | 10 | ||||
-rw-r--r-- | lib/dojo/data/util/simpleFetch.js | 26 | ||||
-rw-r--r-- | lib/dojo/data/util/sorter.js | 22 |
3 files changed, 32 insertions, 26 deletions
diff --git a/lib/dojo/data/util/filter.js b/lib/dojo/data/util/filter.js index d23e63ade..909cc49bc 100644 --- a/lib/dojo/data/util/filter.js +++ b/lib/dojo/data/util/filter.js @@ -1,5 +1,5 @@ /* - Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. + Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ @@ -9,12 +9,14 @@ if(!dojo._hasResource["dojo.data.util.filter"]){ //_hasResource checks added by dojo._hasResource["dojo.data.util.filter"] = true; dojo.provide("dojo.data.util.filter"); +dojo.getObject("data.util.filter", true, dojo); + dojo.data.util.filter.patternToRegExp = function(/*String*/pattern, /*boolean?*/ ignoreCase){ - // summary: + // summary: // Helper function to convert a simple pattern to a regular expression for matching. // description: // Returns a regular expression object that conforms to the defined conversion rules. - // For example: + // For example: // ca* -> /^ca.*$/ // *ca* -> /^.*ca.*$/ // *c\*a* -> /^.*c\*a.*$/ @@ -26,7 +28,7 @@ dojo.data.util.filter.patternToRegExp = function(/*String*/pattern, /*boolean?*/ // * Means match anything, so ca* means match anything starting with ca // ? Means match single character. So, b?b will match to bob and bab, and so on. // \ is an escape character. So for example, \* means do not treat * as a match, but literal character *. - // To use a \ as a character in the string, it must be escaped. So in the pattern it should be + // To use a \ as a character in the string, it must be escaped. So in the pattern it should be // represented by \\ to be treated as an ordinary \ character instead of an escape. // // ignoreCase: diff --git a/lib/dojo/data/util/simpleFetch.js b/lib/dojo/data/util/simpleFetch.js index 0bfb19ec3..b3f859b48 100644 --- a/lib/dojo/data/util/simpleFetch.js +++ b/lib/dojo/data/util/simpleFetch.js @@ -1,5 +1,5 @@ /* - Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. + Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ @@ -10,30 +10,32 @@ dojo._hasResource["dojo.data.util.simpleFetch"] = true; dojo.provide("dojo.data.util.simpleFetch"); dojo.require("dojo.data.util.sorter"); +dojo.getObject("data.util.simpleFetch", true, dojo); + dojo.data.util.simpleFetch.fetch = function(/* Object? */ request){ // summary: // The simpleFetch mixin is designed to serve as a set of function(s) that can - // be mixed into other datastore implementations to accelerate their development. - // The simpleFetch mixin should work well for any datastore that can respond to a _fetchItems() + // be mixed into other datastore implementations to accelerate their development. + // The simpleFetch mixin should work well for any datastore that can respond to a _fetchItems() // call by returning an array of all the found items that matched the query. The simpleFetch mixin // is not designed to work for datastores that respond to a fetch() call by incrementally // loading items, or sequentially loading partial batches of the result - // set. For datastores that mixin simpleFetch, simpleFetch + // set. For datastores that mixin simpleFetch, simpleFetch // implements a fetch method that automatically handles eight of the fetch() // arguments -- onBegin, onItem, onComplete, onError, start, count, sort and scope // The class mixing in simpleFetch should not implement fetch(), - // but should instead implement a _fetchItems() method. The _fetchItems() - // method takes three arguments, the keywordArgs object that was passed + // but should instead implement a _fetchItems() method. The _fetchItems() + // method takes three arguments, the keywordArgs object that was passed // to fetch(), a callback function to be called when the result array is // available, and an error callback to be called if something goes wrong. // The _fetchItems() method should ignore any keywordArgs parameters for - // start, count, onBegin, onItem, onComplete, onError, sort, and scope. + // start, count, onBegin, onItem, onComplete, onError, sort, and scope. // The _fetchItems() method needs to correctly handle any other keywordArgs - // parameters, including the query parameter and any optional parameters - // (such as includeChildren). The _fetchItems() method should create an array of - // result items and pass it to the fetchHandler along with the original request object - // -- or, the _fetchItems() method may, if it wants to, create an new request object - // with other specifics about the request that are specific to the datastore and pass + // parameters, including the query parameter and any optional parameters + // (such as includeChildren). The _fetchItems() method should create an array of + // result items and pass it to the fetchHandler along with the original request object + // -- or, the _fetchItems() method may, if it wants to, create an new request object + // with other specifics about the request that are specific to the datastore and pass // that as the request object to the handler. // // For more information on this specific function, see dojo.data.api.Read.fetch() diff --git a/lib/dojo/data/util/sorter.js b/lib/dojo/data/util/sorter.js index c0261c848..539d3ca02 100644 --- a/lib/dojo/data/util/sorter.js +++ b/lib/dojo/data/util/sorter.js @@ -1,5 +1,5 @@ /* - Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved. + Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved. Available via Academic Free License >= 2.1 OR the modified BSD license. see: http://dojotoolkit.org/license for details */ @@ -9,11 +9,13 @@ if(!dojo._hasResource["dojo.data.util.sorter"]){ //_hasResource checks added by dojo._hasResource["dojo.data.util.sorter"] = true; dojo.provide("dojo.data.util.sorter"); -dojo.data.util.sorter.basicComparator = function( /*anything*/ a, +dojo.getObject("data.util.sorter", true, dojo); + +dojo.data.util.sorter.basicComparator = function( /*anything*/ a, /*anything*/ b){ - // summary: + // summary: // Basic comparision function that compares if an item is greater or less than another item - // description: + // description: // returns 1 if a > b, -1 if a < b, 0 if equal. // 'null' values (null, undefined) are treated as larger values so that they're pushed to the end of the list. // And compared to each other, null is equivalent to undefined. @@ -30,18 +32,18 @@ dojo.data.util.sorter.basicComparator = function( /*anything*/ a, b = undefined; } if(a == b){ - r = 0; + r = 0; }else if(a > b || a == null){ - r = 1; + r = 1; } return r; //int {-1,0,1} }; dojo.data.util.sorter.createSortFunction = function( /* attributes array */sortSpec, /*dojo.data.core.Read*/ store){ - // summary: + // summary: // Helper function to generate the sorting function based off the list of sort attributes. - // description: + // description: // The sort function creation will look for a property on the store called 'comparatorMap'. If it exists // it will look in the mapping for comparisons function for the attributes. If one is found, it will // use it instead of the basic comparator, which is typically used for strings, ints, booleans, and dates. @@ -83,7 +85,7 @@ dojo.data.util.sorter.createSortFunction = function( /* attributes array */sortS } comp = map[attr] || bc; } - sortFunctions.push(createSortFunction(attr, + sortFunctions.push(createSortFunction(attr, dir, comp, store)); } } @@ -95,7 +97,7 @@ dojo.data.util.sorter.createSortFunction = function( /* attributes array */sortS return ret;//int } } - return 0; //int + return 0; //int }; // Function }; |