@ -9,33 +9,20 @@
* /
* /
jQuery . extend ( jQuery . fn . dataTableExt . oSort , {
jQuery . extend ( jQuery . fn . dataTableExt . oSort , {
"file-size- asc ": function ( a , b ) {
"file-size- pre ": function ( a ) {
var x = a . substring ( 0 , a . length - 2 ) ;
var x = a . substring ( 0 , a . length - 2 ) ;
var y = b . substring ( 0 , b . length - 2 ) ;
var x _unit = ( a . substring ( a . length - 2 , a . length ) == "MB" ?
var x _unit = ( a . substring ( a . length - 2 , a . length ) == "MB" ?
1000 : ( a . substring ( a . length - 2 , a . length ) == "GB" ? 1000000 : 1 ) ) ;
1000 : ( a . substring ( a . length - 2 , a . length ) == "GB" ? 1000000 : 1 ) ) ;
var y _unit = ( b . substring ( b . length - 2 , b . length ) == "MB" ?
1000 : ( b . substring ( b . length - 2 , b . length ) == "GB" ? 1000000 : 1 ) ) ;
x = parseInt ( x * x _unit ) ;
return parseInt ( x * x _unit , 10 ) ;
y = parseInt ( y * y _unit ) ;
} ,
return ( ( x < y ) ? - 1 : ( ( x > y ) ? 1 : 0 ) ) ;
"file-size-asc" : function ( a , b ) {
return ( ( a < b ) ? - 1 : ( ( a > b ) ? 1 : 0 ) ) ;
} ,
} ,
"file-size-desc" : function ( a , b ) {
"file-size-desc" : function ( a , b ) {
var x = a . substring ( 0 , a . length - 2 ) ;
return ( ( a < b ) ? 1 : ( ( a > b ) ? - 1 : 0 ) ) ;
var y = b . substring ( 0 , b . length - 2 ) ;
var x _unit = ( a . substring ( a . length - 2 , a . length ) == "MB" ?
1000 : ( a . substring ( a . length - 2 , a . length ) == "GB" ? 1000000 : 1 ) ) ;
var y _unit = ( b . substring ( b . length - 2 , b . length ) == "MB" ?
1000 : ( b . substring ( b . length - 2 , b . length ) == "GB" ? 1000000 : 1 ) ) ;
x = parseInt ( x * x _unit ) ;
y = parseInt ( y * y _unit ) ;
return ( ( x < y ) ? 1 : ( ( x > y ) ? - 1 : 0 ) ) ;
}
}
} ) ;
} ) ;