Merget branch 'master' of github.com:DataTables/Plugins

pull/254/head
Allan Jardine 9 years ago
commit adcf5512f6

@ -25,7 +25,7 @@
"sPrevious": "Forrige", "sPrevious": "Forrige",
"sNext": "Neste", "sNext": "Neste",
"sLast": "Siste" "sLast": "Siste"
} },
"oAria": { "oAria": {
"sSortAscending": ": aktiver for å sortere kolonnen stigende", "sSortAscending": ": aktiver for å sortere kolonnen stigende",
"sSortDescending": ": aktiver for å sortere kolonnen synkende" "sSortDescending": ": aktiver for å sortere kolonnen synkende"

@ -0,0 +1,59 @@
/**
* Plug-in offers the same functionality as `full_numbers` pagination type
* (see `pagingType` option) but without ellipses.
*
* See [example](http://www.gyrocode.com/articles/jquery-datatables-pagination-without-ellipses) for demonstration.
*
* @name Full Numbers - No Ellipses
* @summary Same pagination as 'full_numbers' but without ellipses
* @author [Michael Ryvkin](http://www.gyrocode.com)
*
* @example
* $(document).ready(function() {
* $('#example').dataTable( {
* "pagingType": "full_numbers_no_ellipses"
* } );
* } );
*/
$.fn.DataTable.ext.pager.full_numbers_no_ellipses = function(page, pages){
var numbers = [];
var buttons = $.fn.DataTable.ext.pager.numbers_length;
var half = Math.floor( buttons / 2 );
var _range = function ( len, start ){
var end;
if ( typeof start === "undefined" ){
start = 0;
end = len;
} else {
end = start;
start = len;
}
var out = [];
for ( var i = start ; i < end; i++ ){ out.push(i); }
return out;
};
if ( pages <= buttons ) {
numbers = _range( 0, pages );
} else if ( page <= half ) {
numbers = _range( 0, buttons);
} else if ( page >= pages - 1 - half ) {
numbers = _range( pages - buttons, pages );
} else {
numbers = _range( page - half, page + half + 1);
}
numbers.DT_el = 'span';
return [ 'first', 'previous', numbers, 'next', 'last' ];
};

@ -0,0 +1,59 @@
/**
* Plug-in offers the same functionality as `simple_numbers` pagination type
* (see `pagingType` option) but without ellipses.
*
* See [example](http://www.gyrocode.com/articles/jquery-datatables-pagination-without-ellipses) for demonstration.
*
* @name Simple Numbers - No Ellipses
* @summary Same pagination as 'simple_numbers' but without ellipses
* @author [Michael Ryvkin](http://www.gyrocode.com)
*
* @example
* $(document).ready(function() {
* $('#example').dataTable( {
* "pagingType": "simple_numbers_no_ellipses"
* } );
* } );
*/
$.fn.DataTable.ext.pager.simple_numbers_no_ellipses = function(page, pages){
var numbers = [];
var buttons = $.fn.DataTable.ext.pager.numbers_length;
var half = Math.floor( buttons / 2 );
var _range = function ( len, start ){
var end;
if ( typeof start === "undefined" ){
start = 0;
end = len;
} else {
end = start;
start = len;
}
var out = [];
for ( var i = start ; i < end; i++ ){ out.push(i); }
return out;
};
if ( pages <= buttons ) {
numbers = _range( 0, pages );
} else if ( page <= half ) {
numbers = _range( 0, buttons);
} else if ( page >= pages - 1 - half ) {
numbers = _range( pages - buttons, pages );
} else {
numbers = _range( page - half, page + half + 1);
}
numbers.DT_el = 'span';
return [ 'previous', numbers, 'next' ];
};

@ -29,6 +29,10 @@ jQuery.fn.dataTable.ext.type.order['file-size-pre'] = function ( data ) {
pb: 1000000000000000 pb: 1000000000000000
}; };
var multiplier = multipliers[matches[2].toLowerCase()]; if (matches) {
return parseFloat( matches[1] ) * multiplier; var multiplier = multipliers[matches[2].toLowerCase()];
return parseFloat( matches[1] ) * multiplier;
} else {
return -1;
};
}; };

Loading…
Cancel
Save