]> git.wh0rd.org - tt-rss.git/blobdiff - lib/dojo/data/util/sorter.js
upgrade Dojo to 1.6.1
[tt-rss.git] / lib / dojo / data / util / sorter.js
index c0261c848bfc431a5477e5c0cf86f85d235901b1..539d3ca02c8b70222518c65b04058c8d99a6f448 100644 (file)
@@ -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
 };