]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - include/javascript/yui3/build/arraysort/arraysort.js
Release 6.2.2
[Github/sugarcrm.git] / include / javascript / yui3 / build / arraysort / arraysort.js
1 /*
2  Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3  Code licensed under the BSD License:
4  http://developer.yahoo.com/yui/license.html
5  version: 3.3.0
6  build: 3167
7  */
8 YUI.add('arraysort',function(Y){var LANG=Y.Lang,ISVALUE=LANG.isValue,ISSTRING=LANG.isString;Y.ArraySort={compare:function(a,b,desc){if(!ISVALUE(a)){if(!ISVALUE(b)){return 0;}
9 else{return 1;}}
10 else if(!ISVALUE(b)){return-1;}
11 if(ISSTRING(a)){a=a.toLowerCase();}
12 if(ISSTRING(b)){b=b.toLowerCase();}
13 if(a<b){return(desc)?1:-1;}
14 else if(a>b){return(desc)?-1:1;}
15 else{return 0;}}};},'3.3.0',{requires:['yui-base']});