1/** 2 3 * User: kjh 4 * Date: 13. 5. 21 5 * Time: ì¤í 12:17 6 * ìëì ìì¤ë WEVENì ì ìê¶ì´ ìì¼ë¯ë¡ ë¬´ë¨ ì¬ì© ë° ì¬ ë°°í¬ë¥¼ ê¸í©ëë¤. 7 */ 8 9 10bm.sort = { 11 12 /* í¸ì¶ë°©ë² : bm.sort.orderBy( "parentKey", "seq" ) */ 13 byProps : function () { 14 15 function dynamicSort(property) { 16 return function (obj1,obj2) { 17 return obj1[property] > obj2[property] ? 1 18 : obj1[property] < obj2[property] ? -1 : 0; 19 } 20 } 21 22 var props = arguments; 23 return function (obj1, obj2) { 24 var i = 0, result = 0, numberOfProperties = props.length; 25 while(result === 0 && i < numberOfProperties) { 26 result = dynamicSort(props[i])(obj1, obj2); 27 i++; 28 } 29 return result; 30 } 31 } 32 33 /* í¸ì¶ë°©ë² : bm.sort.orderBy( "parentKey asc", "seq asc" ... ) */ 34 ,orderBy : function() { 35 36 function cmp(x, y) { 37 return x > y ? 1 : x < y ? -1 : 0; 38 } 39 40 //var args = [].map.call(arguments, function(a) { 41 // var m = a.split(/\s+/); 42 // return [m[0], m[1] == 'asc' ? 1 : -1] 43 //}); 44 45 var args = []; 46 $.each(arguments, function( index, a ) { 47 var m = a.split(/\s+/); 48 args.push( [m[0], m[1] == 'asc' ? 1 : -1] ); 49 }); 50 51 return function(x, y) { 52 for (var i = 0; i < args.length; i++) { 53 var a = args[i], c = cmp(x[a[0]], y[a[0]]); 54 if (c) return c * a[1]; 55 } 56 return 0; 57 } 58 } 59}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.