mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Added assets + dependencies
This commit is contained in:
BIN
bower_components/datatables-plugins/sorting/.DS_Store
vendored
Executable file
BIN
bower_components/datatables-plugins/sorting/.DS_Store
vendored
Executable file
Binary file not shown.
30
bower_components/datatables-plugins/sorting/alt-string.js
vendored
Executable file
30
bower_components/datatables-plugins/sorting/alt-string.js
vendored
Executable file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Sort on the 'alt' tag of images in a column. This is particularly useful if
|
||||
* you have a column of images (ticks and crosses for example) and you want to
|
||||
* control the sorting using the alt tag.
|
||||
*
|
||||
* @name Alt string
|
||||
* @summary Use the `alt` attribute of an image tag as the data to sort upon.
|
||||
* @author _Jumpy_
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'alt-string', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"alt-string-pre": function ( a ) {
|
||||
return a.match(/alt="(.*?)"/)[1].toLowerCase();
|
||||
},
|
||||
|
||||
"alt-string-asc": function( a, b ) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"alt-string-desc": function(a,b) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
} );
|
31
bower_components/datatables-plugins/sorting/anti-the.js
vendored
Executable file
31
bower_components/datatables-plugins/sorting/anti-the.js
vendored
Executable file
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* Often a list of data which has titles in it (books, albums etc) will have
|
||||
* the word "the" at the start of some individual titles, which you don't want
|
||||
* to include in your sorting order. This plug-in will strip the word "the"
|
||||
* from the start of a string and sort on what is left.
|
||||
*
|
||||
* @name Anti-"the"
|
||||
* @summary Sort with the prefixed word `dt-string The` removed, if present
|
||||
* @author [Allan Jardine](http://sprymedia.co.uk)
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'anti-the', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"anti-the-pre": function ( a ) {
|
||||
return a.replace(/^the /i, "");
|
||||
},
|
||||
|
||||
"anti-the-asc": function ( a, b ) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"anti-the-desc": function ( a, b ) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
} );
|
30
bower_components/datatables-plugins/sorting/chinese-string.js
vendored
Executable file
30
bower_components/datatables-plugins/sorting/chinese-string.js
vendored
Executable file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Sorting in Javascript for Chinese Character. The Chinese Characters are
|
||||
* sorted on the radical and number of strokes. This plug-in performs sorting
|
||||
* for Chinese characters using the Javascript [localeCompare](https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/localeCompare)
|
||||
* function.
|
||||
*
|
||||
* Please note that `localeCompare` is not implemented in the same way in all
|
||||
* browsers, potentially leading to different results (particularly in IE).
|
||||
*
|
||||
* @name Chinese (string)
|
||||
* @summary Sort Chinese characters
|
||||
* @author [Patrik Lindström](http://www.lcube.se/sorting-chinese-characters-in-javascript/)
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'chinese-string', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"chinese-string-asc" : function (s1, s2) {
|
||||
return s1.localeCompare(s2);
|
||||
},
|
||||
|
||||
"chinese-string-desc" : function (s1, s2) {
|
||||
return s2.localeCompare(s1);
|
||||
}
|
||||
} );
|
36
bower_components/datatables-plugins/sorting/currency.js
vendored
Executable file
36
bower_components/datatables-plugins/sorting/currency.js
vendored
Executable file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* This plug-in will provide numeric sorting for currency columns (either
|
||||
* detected automatically with the currency type detection plug-in or set
|
||||
* manually) while taking account of the currency symbol ($ or £ by default).
|
||||
*
|
||||
* DataTables 1.10+ has currency sorting abilities built-in and will be
|
||||
* automatically detected. As such this plug-in is marked as deprecated, but
|
||||
* might be useful when working with old versions of DataTables.
|
||||
*
|
||||
* @name Currency
|
||||
* @summary Sort data numerically when it has a leading currency symbol.
|
||||
* @deprecated
|
||||
* @author [Allan Jardine](http://sprymedia.co.uk)
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'currency', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"currency-pre": function ( a ) {
|
||||
a = (a==="-") ? 0 : a.replace( /[^\d\-\.]/g, "" );
|
||||
return parseFloat( a );
|
||||
},
|
||||
|
||||
"currency-asc": function ( a, b ) {
|
||||
return a - b;
|
||||
},
|
||||
|
||||
"currency-desc": function ( a, b ) {
|
||||
return b - a;
|
||||
}
|
||||
} );
|
15
bower_components/datatables-plugins/sorting/custom-data-source/dom-checkbox.js
vendored
Executable file
15
bower_components/datatables-plugins/sorting/custom-data-source/dom-checkbox.js
vendored
Executable file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* Read information from a column of checkboxes (input elements with type
|
||||
* checkbox) and return an array to use as a basis for sorting.
|
||||
*
|
||||
* @summary Sort based on the checked state of checkboxes in a column
|
||||
* @name Checkbox data source
|
||||
* @author [Allan Jardine](http://sprymedia.co.uk)
|
||||
*/
|
||||
|
||||
$.fn.dataTable.ext.order['dom-checkbox'] = function ( settings, col )
|
||||
{
|
||||
return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
|
||||
return $('input', td).prop('checked') ? '1' : '0';
|
||||
} );
|
||||
};
|
16
bower_components/datatables-plugins/sorting/custom-data-source/dom-select.js
vendored
Executable file
16
bower_components/datatables-plugins/sorting/custom-data-source/dom-select.js
vendored
Executable file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Read information from a column of select (drop down) menus and return an
|
||||
* array to use as a basis for sorting.
|
||||
*
|
||||
* @summary Sort based on the value of the `dt-tag select` options in a column
|
||||
* @name Select menu data source
|
||||
* @requires DataTables 1.10+
|
||||
* @author [Allan Jardine](http://sprymedia.co.uk)
|
||||
*/
|
||||
|
||||
$.fn.dataTable.ext.order['dom-select'] = function ( settings, col )
|
||||
{
|
||||
return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
|
||||
return $('select', td).val();
|
||||
} );
|
||||
};
|
16
bower_components/datatables-plugins/sorting/custom-data-source/dom-text.js
vendored
Executable file
16
bower_components/datatables-plugins/sorting/custom-data-source/dom-text.js
vendored
Executable file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* Read information from a column of input (type text) elements and return an
|
||||
* array to use as a basis for sorting.
|
||||
*
|
||||
* @summary Sorting based on the values of `dt-tag input` elements in a column.
|
||||
* @name Input element data source
|
||||
* @requires DataTables 1.10+
|
||||
* @author [Allan Jardine](http://sprymedia.co.uk)
|
||||
*/
|
||||
|
||||
$.fn.dataTable.ext.order['dom-text'] = function ( settings, col )
|
||||
{
|
||||
return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
|
||||
return $('input', td).val();
|
||||
} );
|
||||
};
|
63
bower_components/datatables-plugins/sorting/date-dd-MMM-yyyy.js
vendored
Executable file
63
bower_components/datatables-plugins/sorting/date-dd-MMM-yyyy.js
vendored
Executable file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Adds a new sorting option to dataTables called `date-dd-mmm-yyyy`. Also
|
||||
* includes a type detection plug-in. Matches and sorts date strings in
|
||||
* the format: `dd/mmm/yyyy`. For example:
|
||||
*
|
||||
* * 02-FEB-1978
|
||||
* * 17-MAY-2013
|
||||
* * 31-JAN-2014
|
||||
*
|
||||
* Please note that this plug-in is **deprecated*. The
|
||||
* [datetime](//datatables.net/blog/2014-12-18) plug-in provides enhanced
|
||||
* functionality and flexibility.
|
||||
*
|
||||
* @name Date (dd-mmm-yyyy)
|
||||
* @summary Sort dates in the format `dd-mmm-yyyy`
|
||||
* @author [Jeromy French](http://www.appliedinter.net/jeromy_works/)
|
||||
* @deprecated
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'date-dd-mmm-yyyy', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
||||
var customDateDDMMMYYYYToOrd = function (date) {
|
||||
"use strict"; //let's avoid tom-foolery in this function
|
||||
// Convert to a number YYYYMMDD which we can use to order
|
||||
var dateParts = date.split(/-/);
|
||||
return (dateParts[2] * 10000) + ($.inArray(dateParts[1].toUpperCase(), ["JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"]) * 100) + (dateParts[0]*1);
|
||||
};
|
||||
|
||||
// This will help DataTables magic detect the "dd-MMM-yyyy" format; Unshift
|
||||
// so that it's the first data type (so it takes priority over existing)
|
||||
jQuery.fn.dataTableExt.aTypes.unshift(
|
||||
function (sData) {
|
||||
"use strict"; //let's avoid tom-foolery in this function
|
||||
if (/^([0-2]?\d|3[0-1])-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)-\d{4}/i.test(sData)) {
|
||||
return 'date-dd-mmm-yyyy';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
);
|
||||
|
||||
// define the sorts
|
||||
jQuery.fn.dataTableExt.oSort['date-dd-mmm-yyyy-asc'] = function (a, b) {
|
||||
"use strict"; //let's avoid tom-foolery in this function
|
||||
var ordA = customDateDDMMMYYYYToOrd(a),
|
||||
ordB = customDateDDMMMYYYYToOrd(b);
|
||||
return (ordA < ordB) ? -1 : ((ordA > ordB) ? 1 : 0);
|
||||
};
|
||||
|
||||
jQuery.fn.dataTableExt.oSort['date-dd-mmm-yyyy-desc'] = function (a, b) {
|
||||
"use strict"; //let's avoid tom-foolery in this function
|
||||
var ordA = customDateDDMMMYYYYToOrd(a),
|
||||
ordB = customDateDDMMMYYYYToOrd(b);
|
||||
return (ordA < ordB) ? 1 : ((ordA > ordB) ? -1 : 0);
|
||||
};
|
||||
|
||||
})();
|
110
bower_components/datatables-plugins/sorting/date-de.js
vendored
Executable file
110
bower_components/datatables-plugins/sorting/date-de.js
vendored
Executable file
@@ -0,0 +1,110 @@
|
||||
/**
|
||||
* This sorting plug-in for DataTables will correctly sort data in date time or date
|
||||
* format typically used in Germany:
|
||||
* date and time:`dd.mm.YYYY HH:mm`
|
||||
* just date:`dd.mm.YYYY`.
|
||||
*
|
||||
* Please note that this plug-in is **deprecated*. The
|
||||
* [datetime](//datatables.net/blog/2014-12-18) plug-in provides enhanced
|
||||
* functionality and flexibility.
|
||||
*
|
||||
* @name Date (dd.mm.YYYY) or date and time (dd.mm.YYYY HH:mm)
|
||||
* @summary Sort date / time in the format `dd.mm.YYYY HH:mm` or `dd.mm.YYYY`.
|
||||
* @author [Ronny Vedrilla](http://www.ambient-innovation.com)
|
||||
* @deprecated
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'de_datetime', targets: 0 },
|
||||
* { type: 'de_date', targets: 1 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"de_datetime-asc": function ( a, b ) {
|
||||
var x, y;
|
||||
if (jQuery.trim(a) !== '') {
|
||||
var deDatea = jQuery.trim(a).split(' ');
|
||||
var deTimea = deDatea[1].split(':');
|
||||
var deDatea2 = deDatea[0].split('.');
|
||||
x = (deDatea2[2] + deDatea2[1] + deDatea2[0] + deTimea[0] + deTimea[1]) * 1;
|
||||
} else {
|
||||
x = Infinity; // = l'an 1000 ...
|
||||
}
|
||||
|
||||
if (jQuery.trim(b) !== '') {
|
||||
var deDateb = jQuery.trim(b).split(' ');
|
||||
var deTimeb = deDateb[1].split(':');
|
||||
deDateb = deDateb[0].split('.');
|
||||
y = (deDateb[2] + deDateb[1] + deDateb[0] + deTimeb[0] + deTimeb[1]) * 1;
|
||||
} else {
|
||||
y = Infinity;
|
||||
}
|
||||
var z = ((x < y) ? -1 : ((x > y) ? 1 : 0));
|
||||
return z;
|
||||
},
|
||||
|
||||
"de_datetime-desc": function ( a, b ) {
|
||||
var x, y;
|
||||
if (jQuery.trim(a) !== '') {
|
||||
var deDatea = jQuery.trim(a).split(' ');
|
||||
var deTimea = deDatea[1].split(':');
|
||||
var deDatea2 = deDatea[0].split('.');
|
||||
x = (deDatea2[2] + deDatea2[1] + deDatea2[0] + deTimea[0] + deTimea[1]) * 1;
|
||||
} else {
|
||||
x = Infinity;
|
||||
}
|
||||
|
||||
if (jQuery.trim(b) !== '') {
|
||||
var deDateb = jQuery.trim(b).split(' ');
|
||||
var deTimeb = deDateb[1].split(':');
|
||||
deDateb = deDateb[0].split('.');
|
||||
y = (deDateb[2] + deDateb[1] + deDateb[0] + deTimeb[0] + deTimeb[1]) * 1;
|
||||
} else {
|
||||
y = Infinity;
|
||||
}
|
||||
var z = ((x < y) ? 1 : ((x > y) ? -1 : 0));
|
||||
return z;
|
||||
},
|
||||
|
||||
"de_date-asc": function ( a, b ) {
|
||||
var x, y;
|
||||
if (jQuery.trim(a) !== '') {
|
||||
var deDatea = jQuery.trim(a).split('.');
|
||||
x = (deDatea[2] + deDatea[1] + deDatea[0]) * 1;
|
||||
} else {
|
||||
x = Infinity; // = l'an 1000 ...
|
||||
}
|
||||
|
||||
if (jQuery.trim(b) !== '') {
|
||||
var deDateb = jQuery.trim(b).split('.');
|
||||
y = (deDateb[2] + deDateb[1] + deDateb[0]) * 1;
|
||||
} else {
|
||||
y = Infinity;
|
||||
}
|
||||
var z = ((x < y) ? -1 : ((x > y) ? 1 : 0));
|
||||
return z;
|
||||
},
|
||||
|
||||
"de_date-desc": function ( a, b ) {
|
||||
var x, y;
|
||||
if (jQuery.trim(a) !== '') {
|
||||
var deDatea = jQuery.trim(a).split('.');
|
||||
x = (deDatea[2] + deDatea[1] + deDatea[0]) * 1;
|
||||
} else {
|
||||
x = Infinity;
|
||||
}
|
||||
|
||||
if (jQuery.trim(b) !== '') {
|
||||
var deDateb = jQuery.trim(b).split('.');
|
||||
y = (deDateb[2] + deDateb[1] + deDateb[0]) * 1;
|
||||
} else {
|
||||
y = Infinity;
|
||||
}
|
||||
var z = ((x < y) ? 1 : ((x > y) ? -1 : 0));
|
||||
return z;
|
||||
}
|
||||
} );
|
||||
|
69
bower_components/datatables-plugins/sorting/date-eu.js
vendored
Executable file
69
bower_components/datatables-plugins/sorting/date-eu.js
vendored
Executable file
@@ -0,0 +1,69 @@
|
||||
/**
|
||||
* Similar to the Date (dd/mm/YY) data sorting plug-in, this plug-in offers
|
||||
* additional flexibility with support for spaces between the values and
|
||||
* either . or / notation for the separators.
|
||||
*
|
||||
* Please note that this plug-in is **deprecated*. The
|
||||
* [datetime](//datatables.net/blog/2014-12-18) plug-in provides enhanced
|
||||
* functionality and flexibility.
|
||||
*
|
||||
* @name Date (dd . mm[ . YYYY])
|
||||
* @summary Sort dates in the format `dd/mm/YY[YY]` (with optional spaces)
|
||||
* @author [Robert Sedovšek](http://galjot.si/)
|
||||
* @deprecated
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'date-eu', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"date-eu-pre": function ( date ) {
|
||||
date = date.replace(" ", "");
|
||||
var eu_date, year;
|
||||
|
||||
if (date == '') {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (date.indexOf('.') > 0) {
|
||||
/*date a, format dd.mn.(yyyy) ; (year is optional)*/
|
||||
eu_date = date.split('.');
|
||||
} else {
|
||||
/*date a, format dd/mn/(yyyy) ; (year is optional)*/
|
||||
eu_date = date.split('/');
|
||||
}
|
||||
|
||||
/*year (optional)*/
|
||||
if (eu_date[2]) {
|
||||
year = eu_date[2];
|
||||
} else {
|
||||
year = 0;
|
||||
}
|
||||
|
||||
/*month*/
|
||||
var month = eu_date[1];
|
||||
if (month.length == 1) {
|
||||
month = 0+month;
|
||||
}
|
||||
|
||||
/*day*/
|
||||
var day = eu_date[0];
|
||||
if (day.length == 1) {
|
||||
day = 0+day;
|
||||
}
|
||||
|
||||
return (year + month + day) * 1;
|
||||
},
|
||||
|
||||
"date-eu-asc": function ( a, b ) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"date-eu-desc": function ( a, b ) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
} );
|
48
bower_components/datatables-plugins/sorting/date-euro.js
vendored
Executable file
48
bower_components/datatables-plugins/sorting/date-euro.js
vendored
Executable file
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* This plug-in will provide date sorting for the "dd/mm/YYY hh:ii:ss"
|
||||
* formatting, which is common in France and other European countries. It can
|
||||
* also be quickly adapted for other formatting as required. Furthermore, this
|
||||
* date sorting plug-in allows for empty values in the column.
|
||||
*
|
||||
* Please note that this plug-in is **deprecated*. The
|
||||
* [datetime](//datatables.net/blog/2014-12-18) plug-in provides enhanced
|
||||
* functionality and flexibility.
|
||||
*
|
||||
* @name Date (dd/mm/YYY hh:ii:ss)
|
||||
* @summary Sort date / time in the format `dd/mm/YYY hh:ii:ss`
|
||||
* @author [Ronan Guilloux](http://coolforest.net/)
|
||||
* @deprecated
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'date-euro', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"date-euro-pre": function ( a ) {
|
||||
var x;
|
||||
|
||||
if ( $.trim(a) !== '' ) {
|
||||
var frDatea = $.trim(a).split(' ');
|
||||
var frTimea = frDatea[1].split(':');
|
||||
var frDatea2 = frDatea[0].split('/');
|
||||
x = (frDatea2[2] + frDatea2[1] + frDatea2[0] + frTimea[0] + frTimea[1] + frTimea[2]) * 1;
|
||||
}
|
||||
else {
|
||||
x = Infinity;
|
||||
}
|
||||
|
||||
return x;
|
||||
},
|
||||
|
||||
"date-euro-asc": function ( a, b ) {
|
||||
return a - b;
|
||||
},
|
||||
|
||||
"date-euro-desc": function ( a, b ) {
|
||||
return b - a;
|
||||
}
|
||||
} );
|
42
bower_components/datatables-plugins/sorting/date-uk.js
vendored
Executable file
42
bower_components/datatables-plugins/sorting/date-uk.js
vendored
Executable file
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* DataTables internal date sorting replies on `Date.parse()` which is part of
|
||||
* the Javascript language, but you may wish to sort on dates which is doesn't
|
||||
* recognise. The following is a plug-in for sorting dates in the format
|
||||
* `dd/mm/yy`.
|
||||
*
|
||||
* An automatic type detection plug-in is available for this sorting plug-in.
|
||||
*
|
||||
* Please note that this plug-in is **deprecated*. The
|
||||
* [datetime](//datatables.net/blog/2014-12-18) plug-in provides enhanced
|
||||
* functionality and flexibility.
|
||||
*
|
||||
* @name Date (dd/mm/YY)
|
||||
* @summary Sort dates in the format `dd/mm/YY`
|
||||
* @author Andy McMaster
|
||||
* @deprecated
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'date-uk', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"date-uk-pre": function ( a ) {
|
||||
if (a == null || a == "") {
|
||||
return 0;
|
||||
}
|
||||
var ukDatea = a.split('/');
|
||||
return (ukDatea[2] + ukDatea[1] + ukDatea[0]) * 1;
|
||||
},
|
||||
|
||||
"date-uk-asc": function ( a, b ) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"date-uk-desc": function ( a, b ) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
} );
|
41
bower_components/datatables-plugins/sorting/datetime-moment.js
vendored
Executable file
41
bower_components/datatables-plugins/sorting/datetime-moment.js
vendored
Executable file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* This plug-in for DataTables represents the ultimate option in extensibility
|
||||
* for sorting date / time strings correctly. It uses
|
||||
* [Moment.js](http://momentjs.com) to create automatic type detection and
|
||||
* sorting plug-ins for DataTables based on a given format. This way, DataTables
|
||||
* will automatically detect your temporal information and sort it correctly.
|
||||
*
|
||||
* For usage instructions, please see the DataTables blog
|
||||
* post that [introduces it](//datatables.net/blog/2014-12-18).
|
||||
*
|
||||
* @name Ultimate Date / Time sorting
|
||||
* @summary Sort date and time in any format using Moment.js
|
||||
* @author [Allan Jardine](//datatables.net)
|
||||
* @depends DataTables 1.10+, Moment.js 1.7+
|
||||
*
|
||||
* @example
|
||||
* $.fn.dataTable.moment( 'HH:mm MMM D, YY' );
|
||||
* $.fn.dataTable.moment( 'dddd, MMMM Do, YYYY' );
|
||||
*
|
||||
* $('#example').DataTable();
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
|
||||
$.fn.dataTable.moment = function ( format, locale ) {
|
||||
var types = $.fn.dataTable.ext.type;
|
||||
|
||||
// Add type detection
|
||||
types.detect.unshift( function ( d ) {
|
||||
return moment( d, format, locale, true ).isValid() ?
|
||||
'moment-'+format :
|
||||
null;
|
||||
} );
|
||||
|
||||
// Add sorting method - use an integer for the sorting
|
||||
types.order[ 'moment-'+format+'-pre' ] = function ( d ) {
|
||||
return moment( d, format, locale, true ).unix();
|
||||
};
|
||||
};
|
||||
|
||||
}(jQuery));
|
86
bower_components/datatables-plugins/sorting/datetime-us.js
vendored
Executable file
86
bower_components/datatables-plugins/sorting/datetime-us.js
vendored
Executable file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
* Adds a new sorting option to dataTables called `datetime-us`.
|
||||
*
|
||||
* Also included is a type detection plug-in. Matches and sorts date / time
|
||||
* strings in the format: `(m)m/(d)d/(yy)yy (h)h/m(m) (am|pm)`. For example:
|
||||
*
|
||||
* * 1/1/13 1:4 pm
|
||||
* * 01/01/2013 01:04 PM
|
||||
* * 1/1/2013 1:04 Pm
|
||||
*
|
||||
* Please note that this plug-in is **deprecated*. The
|
||||
* [datetime](//datatables.net/blog/2014-12-18) plug-in provides enhanced
|
||||
* functionality and flexibility.
|
||||
*
|
||||
* @name Date / time - US
|
||||
* @summary Sort date / time in the format `m/d/yy h:m am|pm`
|
||||
* @author [Kevin Gravier](http://mrkmg.com/)
|
||||
* @deprecated
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'datetime-us', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
jQuery.extend(jQuery.fn.dataTableExt.oSort, {
|
||||
"datetime-us-pre": function (a) {
|
||||
var b = a.match(/(\d{1,2})\/(\d{1,2})\/(\d{2,4}) (\d{1,2}):(\d{1,2}) (am|pm|AM|PM|Am|Pm)/),
|
||||
month = b[1],
|
||||
day = b[2],
|
||||
year = b[3],
|
||||
hour = b[4],
|
||||
min = b[5],
|
||||
ap = b[6].toLowerCase();
|
||||
|
||||
if (hour == '12') {
|
||||
hour = '0';
|
||||
if (ap == 'pm') {
|
||||
hour = parseInt(hour, 10) + 12;
|
||||
}
|
||||
|
||||
if (year.length == 2) {
|
||||
if (parseInt(year, 10) < 70) {
|
||||
year = '20' + year;
|
||||
}
|
||||
else {
|
||||
year = '19' + year;
|
||||
}
|
||||
}
|
||||
if (month.length == 1) {
|
||||
month = '0' + month;
|
||||
}
|
||||
if (day.length == 1) {
|
||||
day = '0' + day;
|
||||
}
|
||||
if (hour.length == 1) {
|
||||
hour = '0' + hour;
|
||||
}
|
||||
if (min.length == 1) {
|
||||
min = '0' + min;
|
||||
}
|
||||
|
||||
var tt = year + month + day + hour + min;
|
||||
return tt;
|
||||
}
|
||||
},
|
||||
|
||||
"datetime-us-asc": function (a, b) {
|
||||
return a - b;
|
||||
},
|
||||
|
||||
"datetime-us-desc": function (a, b) {
|
||||
return b - a;
|
||||
}
|
||||
});
|
||||
|
||||
jQuery.fn.dataTableExt.aTypes.unshift(
|
||||
function (sData) {
|
||||
if (sData !== null && sData.match(/\d{1,2}\/\d{1,2}\/\d{2,4} \d{1,2}:\d{1,2} (am|pm|AM|PM|Am|Pm)/)) {
|
||||
|
||||
return 'datetime-us';
|
||||
}
|
||||
return null;
|
||||
}
|
||||
);
|
37
bower_components/datatables-plugins/sorting/enum.js
vendored
Executable file
37
bower_components/datatables-plugins/sorting/enum.js
vendored
Executable file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Sort by priority through an enumerated list. In this case the words _High_,
|
||||
* _Medium_ and _Low_ are used and thus sorted in priority order. This works
|
||||
* by converting the works to a numerical value and then sorting based on that
|
||||
* value.
|
||||
*
|
||||
* @name enum
|
||||
* @summary Sort an enumerated list of options
|
||||
* @author [Allan Jardine](http://sprymedia.co.uk)
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'enum', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"enum-pre": function ( a ) {
|
||||
// Add / alter the switch statement below to match your enum list
|
||||
switch( a ) {
|
||||
case "High": return 1;
|
||||
case "Medium": return 2;
|
||||
case "Low": return 3;
|
||||
default: return 4;
|
||||
}
|
||||
},
|
||||
|
||||
"enum-asc": function ( a, b ) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"enum-desc": function ( a, b ) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
} );
|
37
bower_components/datatables-plugins/sorting/file-size.js
vendored
Executable file
37
bower_components/datatables-plugins/sorting/file-size.js
vendored
Executable file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* When dealing with computer file sizes, it is common to append a post fix
|
||||
* such as KB, MB or GB to a string in order to easily denote the order of
|
||||
* magnitude of the file size. This plug-in allows sorting to take these
|
||||
* indicates of size into account. A counterpart type detection plug-in
|
||||
* is also available.
|
||||
*
|
||||
* @name File size
|
||||
* @summary Sort abbreviated file sizes correctly (8MB, 4KB etc)
|
||||
* @author _anjibman_
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'file-size', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"file-size-pre": function ( a ) {
|
||||
var x = a.substring(0,a.length - 2);
|
||||
|
||||
var x_unit = (a.substring(a.length - 2, a.length) == "MB" ?
|
||||
1000 : (a.substring(a.length - 2, a.length) == "GB" ? 1000000 : 1));
|
||||
|
||||
return parseInt( x * x_unit, 10 );
|
||||
},
|
||||
|
||||
"file-size-asc": function ( a, b ) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"file-size-desc": function ( a, b ) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
} );
|
40
bower_components/datatables-plugins/sorting/formatted-numbers.js
vendored
Executable file
40
bower_components/datatables-plugins/sorting/formatted-numbers.js
vendored
Executable file
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* This plug-in will provide numeric sorting for numeric columns which have
|
||||
* extra formatting, such as thousands separators, currency symbols or any other
|
||||
* non-numeric data.
|
||||
*
|
||||
* By default when a cell is found to have no numeric data its value is sorted
|
||||
* numerically as if its value were 0. This could also be altered to be Inifnity
|
||||
* or -Infinity as required.
|
||||
*
|
||||
* DataTables 1.10+ has formatted number detection and sorting abilities built-
|
||||
* in. As such this plug-in is marked as deprecated, but might be useful when
|
||||
* working with old versions of DataTables.
|
||||
*
|
||||
* @name Formatted numbers
|
||||
* @summary Sort numbers which are displayed with thousand separators
|
||||
* @deprecated
|
||||
* @author [Allan Jardine](http://sprymedia.co.uk)
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'formatted-num', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"formatted-num-pre": function ( a ) {
|
||||
a = (a === "-" || a === "") ? 0 : a.replace( /[^\d\-\.]/g, "" );
|
||||
return parseFloat( a );
|
||||
},
|
||||
|
||||
"formatted-num-asc": function ( a, b ) {
|
||||
return a - b;
|
||||
},
|
||||
|
||||
"formatted-num-desc": function ( a, b ) {
|
||||
return b - a;
|
||||
}
|
||||
} );
|
84
bower_components/datatables-plugins/sorting/index.html
vendored
Executable file
84
bower_components/datatables-plugins/sorting/index.html
vendored
Executable file
@@ -0,0 +1,84 @@
|
||||
|
||||
<h2>Sorting plug-ins</h2>
|
||||
|
||||
<p>DataTables provides two APIs for sorting information in a table: <a href="/development/sorting#type_based">type based sorting</a> and <a href="/development/sorting#data_source">custom data source sorting</a>. They can be used together or independently, and are fully described on the <a href="/development/sorting">sorting development page</a>. By far the most commonly used of these two types is "type based sorting" and is the one you are most likely to want to use if just starting out with DataTables.</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="#how_to_type">How to use type based sorting plug-ins</a> - sorting based on the <a href="/usage/columns#sType">sType</a> of the column.</li>
|
||||
<li><a href="#functions_type">Type based column sorting plug-ins</a></li>
|
||||
<li><a href="#how_to_data_source">How to use custom data source sorting plug-ins</a> - sorting applied to data supplied by either a plug-in or custom function.</li>
|
||||
<li><a href="#functions_data_source">Custom data source sorting plug-ins</a></li>
|
||||
</ul>
|
||||
|
||||
|
||||
<a name="how_to_type"></a>
|
||||
<h3>How to use DataTables plug-in sorting functions functions (type based)</h3>
|
||||
|
||||
<p>To add the ability to sort specific data types, using the plug-in functions below, you simply need to include the plug-in's code in the Javascript available for your page, after you load the DataTables library, but before you initialise the DataTable. Then using the <a href="/usage/columns#sType">sType</a> parameter for that column, set it to the value needed for the plug-in. If sType is not given for a column, DataTables will attempt to detect the type automatically. The following example shows how the <a href="#numeric_comma">numeric comma sorting plug-in</a> (saved to a file) can be used with a DataTable, sorting on the fourth column (<a href="/examples/plug-ins/sorting_sType.html">live example</a>):</p>
|
||||
|
||||
<pre class="brush: html"><script type="text/javascript" src="jquery.dataTables.js"></script>
|
||||
<script type="text/javascript" src="dataTables.numericComma.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#example').dataTable( {
|
||||
"aoColumns": [
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
{ "sType": "numeric-comma" },
|
||||
null
|
||||
]
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
</pre>
|
||||
|
||||
|
||||
<a name="functions_type"></a>
|
||||
<h3>Sorting functions (type based column sorting)</h3>
|
||||
|
||||
<p>The main DataTables package includes sorting functions for string, date and numeric data, but you may very well wish to order data in some other manner (for example currency, formatting numbers, multi-part data etc). The sorting function pairs below provide a wealth of different sorting methods.</p>
|
||||
|
||||
<p>It is also worth noting that sorting function go hand-in-hand with <a href="/plug-ins/type-detection">type detection</a> functions, and many of the function pairs below has a corresponding type detection function to make installation very easy.</p>
|
||||
|
||||
include(`build.1.inc')
|
||||
|
||||
|
||||
|
||||
<a name="how_to_data_source"></a>
|
||||
<h3>How to use custom data source sorting plug-ins</h3>
|
||||
|
||||
<p>Custom data source sorting plug-ins complement type based sorting by adding a method to DataTables to retrieve data live from the DOM just prior to the table being sorted. As such, you can use type based sorting, in-combination with custom data source sorting. This is particularly useful if dealing with DOM information in a table which can change dynamically, such as form inputs, but it can add a little extra overhead to the sorting.</p>
|
||||
|
||||
<p>To make use of the plug-ins below, you simply need to include the plug-in's code in the Javascript available for your page, after you load the DataTables library, but before you initialise the DataTable. You also need to specify the <a href="/usage/columns#sSortDataType">sSortDataType</a> parameter for the column, to tell it which plug-in function to use.</p>
|
||||
|
||||
<p>The example below shows the use of multiple custom data source plug-ins, and also it's use in-combination with sType (<a href="/examples/plug-ins/dom_sort.html">live example</a>):</p>
|
||||
|
||||
<pre class="brush: html"><script type="text/javascript" src="jquery.dataTables.js"></script>
|
||||
<script type="text/javascript" src="dataTables.dataSourcePlugins.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#example').dataTable( {
|
||||
"aoColumns": [
|
||||
null,
|
||||
null,
|
||||
{ "sSortDataType": "dom-text" },
|
||||
{ "sSortDataType": "dom-text", "sType": "numeric" },
|
||||
{ "sSortDataType": "dom-select" },
|
||||
{ "sSortDataType": "dom-checkbox" }
|
||||
]
|
||||
} );
|
||||
} );
|
||||
</script>
|
||||
</pre>
|
||||
|
||||
|
||||
|
||||
<a name="functions_data_source"></a>
|
||||
<h3>Custom data source sorting</h3>
|
||||
|
||||
<p>The custom data source functions are used to update the cached data in DataTables, so sorting can occur on columns with user input information.</p>
|
||||
|
||||
include(`build.2.inc')
|
||||
|
||||
|
44
bower_components/datatables-plugins/sorting/ip-address.js
vendored
Executable file
44
bower_components/datatables-plugins/sorting/ip-address.js
vendored
Executable file
@@ -0,0 +1,44 @@
|
||||
/**
|
||||
* Sorts a column containing IP addresses in typical dot notation. This can
|
||||
* be most useful when using DataTables for a networking application, and
|
||||
* reporting information containing IP address. Also has a matching type
|
||||
* detection plug-in for automatic type detection.
|
||||
*
|
||||
* @name IP addresses
|
||||
* @summary Sort IP addresses numerically
|
||||
* @author Brad Wasson
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'ip-address', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"ip-address-pre": function ( a ) {
|
||||
var m = a.split("."), x = "";
|
||||
|
||||
for(var i = 0; i < m.length; i++) {
|
||||
var item = m[i];
|
||||
if(item.length == 1) {
|
||||
x += "00" + item;
|
||||
} else if(item.length == 2) {
|
||||
x += "0" + item;
|
||||
} else {
|
||||
x += item;
|
||||
}
|
||||
}
|
||||
|
||||
return x;
|
||||
},
|
||||
|
||||
"ip-address-asc": function ( a, b ) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"ip-address-desc": function ( a, b ) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
} );
|
36
bower_components/datatables-plugins/sorting/monthYear.js
vendored
Executable file
36
bower_components/datatables-plugins/sorting/monthYear.js
vendored
Executable file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* This sorting plug-in will sort, in calendar order, data which
|
||||
* is in the format "MM YY".
|
||||
*
|
||||
* Please note that this plug-in is **deprecated*. The
|
||||
* [datetime](//datatables.net/blog/2014-12-18) plug-in provides enhanced
|
||||
* functionality and flexibility.
|
||||
*
|
||||
* @name Date (MM YY)
|
||||
* @anchor Sort dates in the format `MM YY`
|
||||
* @author Michael Motek
|
||||
* @deprecated
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'monthYear', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"monthYear-pre": function ( s ) {
|
||||
var a = s.split(' ');
|
||||
// Date uses the American "MM DD YY" format
|
||||
return new Date(a[0]+' 01 '+a[1]);
|
||||
},
|
||||
|
||||
"monthYear-asc": function ( a, b ) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"monthYear-desc": function ( a, b ) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
} );
|
90
bower_components/datatables-plugins/sorting/natural.js
vendored
Executable file
90
bower_components/datatables-plugins/sorting/natural.js
vendored
Executable file
@@ -0,0 +1,90 @@
|
||||
/**
|
||||
* Data can often be a complicated mix of numbers and letters (file names
|
||||
* are a common example) and sorting them in a natural manner is quite a
|
||||
* difficult problem.
|
||||
*
|
||||
* Fortunately a deal of work has already been done in this area by other
|
||||
* authors - the following plug-in uses the [naturalSort() function by Jim
|
||||
* Palmer](http://www.overset.com/2008/09/01/javascript-natural-sort-algorithm-with-unicode-support) to provide natural sorting in DataTables.
|
||||
*
|
||||
* @name Natural sorting
|
||||
* @summary Sort data with a mix of numbers and letters _naturally_.
|
||||
* @author [Jim Palmer](http://www.overset.com/2008/09/01/javascript-natural-sort-algorithm-with-unicode-support)
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'natural', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
(function() {
|
||||
|
||||
/*
|
||||
* Natural Sort algorithm for Javascript - Version 0.7 - Released under MIT license
|
||||
* Author: Jim Palmer (based on chunking idea from Dave Koelle)
|
||||
* Contributors: Mike Grier (mgrier.com), Clint Priest, Kyle Adams, guillermo
|
||||
* See: http://js-naturalsort.googlecode.com/svn/trunk/naturalSort.js
|
||||
*/
|
||||
function naturalSort (a, b) {
|
||||
var re = /(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,
|
||||
sre = /(^[ ]*|[ ]*$)/g,
|
||||
dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,
|
||||
hre = /^0x[0-9a-f]+$/i,
|
||||
ore = /^0/,
|
||||
// convert all to strings and trim()
|
||||
x = a.toString().replace(sre, '') || '',
|
||||
y = b.toString().replace(sre, '') || '',
|
||||
// chunk/tokenize
|
||||
xN = x.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'),
|
||||
yN = y.replace(re, '\0$1\0').replace(/\0$/,'').replace(/^\0/,'').split('\0'),
|
||||
// numeric, hex or date detection
|
||||
xD = parseInt(x.match(hre), 10) || (xN.length !== 1 && x.match(dre) && Date.parse(x)),
|
||||
yD = parseInt(y.match(hre), 10) || xD && y.match(dre) && Date.parse(y) || null;
|
||||
|
||||
// first try and sort Hex codes or Dates
|
||||
if (yD) {
|
||||
if ( xD < yD ) {
|
||||
return -1;
|
||||
}
|
||||
else if ( xD > yD ) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
// natural sorting through split numeric strings and default strings
|
||||
for(var cLoc=0, numS=Math.max(xN.length, yN.length); cLoc < numS; cLoc++) {
|
||||
// find floats not starting with '0', string or 0 if not defined (Clint Priest)
|
||||
var oFxNcL = !(xN[cLoc] || '').match(ore) && parseFloat(xN[cLoc], 10) || xN[cLoc] || 0;
|
||||
var oFyNcL = !(yN[cLoc] || '').match(ore) && parseFloat(yN[cLoc], 10) || yN[cLoc] || 0;
|
||||
// handle numeric vs string comparison - number < string - (Kyle Adams)
|
||||
if (isNaN(oFxNcL) !== isNaN(oFyNcL)) {
|
||||
return (isNaN(oFxNcL)) ? 1 : -1;
|
||||
}
|
||||
// rely on string comparison if different types - i.e. '02' < 2 != '02' < '2'
|
||||
else if (typeof oFxNcL !== typeof oFyNcL) {
|
||||
oFxNcL += '';
|
||||
oFyNcL += '';
|
||||
}
|
||||
if (oFxNcL < oFyNcL) {
|
||||
return -1;
|
||||
}
|
||||
if (oFxNcL > oFyNcL) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"natural-asc": function ( a, b ) {
|
||||
return naturalSort(a,b);
|
||||
},
|
||||
|
||||
"natural-desc": function ( a, b ) {
|
||||
return naturalSort(a,b) * -1;
|
||||
}
|
||||
} );
|
||||
|
||||
}());
|
38
bower_components/datatables-plugins/sorting/num-html.js
vendored
Executable file
38
bower_components/datatables-plugins/sorting/num-html.js
vendored
Executable file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* This sorting plug-in allows for HTML tags with numeric data. With the 'html'
|
||||
* type it will strip the HTML and then sorts by strings, with this type it
|
||||
* strips the HTML and then sorts by numbers. Note also that this sorting
|
||||
* plug-in has an equivalent type detection plug-in which can make integration
|
||||
* easier.
|
||||
*
|
||||
* DataTables 1.10+ has HTML numeric data type detection and sorting abilities
|
||||
* built-in. As such this plug-in is marked as deprecated, but might be useful
|
||||
* when working with old versions of DataTables.
|
||||
*
|
||||
* @name Numbers with HTML
|
||||
* @summary Sort data which is a mix of HTML and numeric data.
|
||||
* @deprecated
|
||||
* @author [Allan Jardine](http://sprymedia.co.uk)
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'num-html', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"num-html-pre": function ( a ) {
|
||||
var x = String(a).replace( /<[\s\S]*?>/g, "" );
|
||||
return parseFloat( x );
|
||||
},
|
||||
|
||||
"num-html-asc": function ( a, b ) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"num-html-desc": function ( a, b ) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
} );
|
37
bower_components/datatables-plugins/sorting/numeric-comma.js
vendored
Executable file
37
bower_components/datatables-plugins/sorting/numeric-comma.js
vendored
Executable file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* It is not uncommon for non-English speaking countries to use a comma for a
|
||||
* decimal place. This sorting plug-in shows how that can be taken account of in
|
||||
* sorting by adding the type `numeric-comma` to DataTables. A type detection
|
||||
* plug-in for this sorting method is provided below.
|
||||
*
|
||||
* Please note that the 'Formatted numbers' type detection and sorting plug-ins
|
||||
* offer greater flexibility that this plug-in and should be used in preference
|
||||
* to this method.
|
||||
*
|
||||
* @name Commas for decimal place
|
||||
* @summary Sort numbers correctly which use a common as the decimal place.
|
||||
* @deprecated
|
||||
* @author [Allan Jardine](http://sprymedia.co.uk)
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'numeric-comma', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"numeric-comma-pre": function ( a ) {
|
||||
var x = (a == "-") ? 0 : a.replace( /,/, "." );
|
||||
return parseFloat( x );
|
||||
},
|
||||
|
||||
"numeric-comma-asc": function ( a, b ) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"numeric-comma-desc": function ( a, b ) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
} );
|
34
bower_components/datatables-plugins/sorting/percent.js
vendored
Executable file
34
bower_components/datatables-plugins/sorting/percent.js
vendored
Executable file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Sort numeric data which has a percent sign with it.
|
||||
*
|
||||
* DataTables 1.10+ has percentage data type detection and sorting abilities
|
||||
* built-in. As such this plug-in is marked as deprecated, but might be useful
|
||||
* when working with old versions of DataTables.
|
||||
*
|
||||
* @name Percentage
|
||||
* @summary Sort numeric data with a postfixed percentage symbol
|
||||
* @deprecated
|
||||
* @author [Jonathan Romley](http://jonathanromley.org/)
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'percent', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"percent-pre": function ( a ) {
|
||||
var x = (a == "-") ? 0 : a.replace( /%/, "" );
|
||||
return parseFloat( x );
|
||||
},
|
||||
|
||||
"percent-asc": function ( a, b ) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"percent-desc": function ( a, b ) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
} );
|
59
bower_components/datatables-plugins/sorting/persian.js
vendored
Executable file
59
bower_components/datatables-plugins/sorting/persian.js
vendored
Executable file
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Sorting in Javascript can be difficult to get right with non-Roman
|
||||
* characters - for which special consideration must be made. This plug-in
|
||||
* performs correct sorting on Persian characters.
|
||||
*
|
||||
* @name Persian
|
||||
* @summary Sort Persian strings alphabetically
|
||||
* @author [Afshin Mehrabani](http://www.afshinblog.com/)
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'pstring', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
(function(){
|
||||
|
||||
var persianSort = [ 'آ', 'ا', 'ب', 'پ', 'ت', 'ث', 'ج', 'چ', 'ح', 'خ', 'د', 'ذ', 'ر', 'ز', 'ژ',
|
||||
'س', 'ش', 'ص', 'ط', 'ظ', 'ع', 'غ', 'ف', 'ق', 'ک', 'گ', 'ل', 'م', 'ن', 'و', 'ه', 'ی', 'ي' ];
|
||||
|
||||
function GetUniCode(source) {
|
||||
source = $.trim(source);
|
||||
var result = '';
|
||||
var i, index;
|
||||
for (i = 0; i < source.length; i++) {
|
||||
//Check and fix IE indexOf bug
|
||||
if (!Array.indexOf) {
|
||||
index = jQuery.inArray(source.charAt(i), persianSort);
|
||||
}else{
|
||||
index = persianSort.indexOf(source.charAt(i));
|
||||
}
|
||||
if (index < 0) {
|
||||
index = source.charCodeAt(i);
|
||||
}
|
||||
if (index < 10) {
|
||||
index = '0' + index;
|
||||
}
|
||||
result += '00' + index;
|
||||
}
|
||||
return 'a' + result;
|
||||
}
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"pstring-pre": function ( a ) {
|
||||
return GetUniCode(a.toLowerCase());
|
||||
},
|
||||
|
||||
"pstring-asc": function ( a, b ) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"pstring-desc": function ( a, b ) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
} );
|
||||
|
||||
}());
|
29
bower_components/datatables-plugins/sorting/scientific.js
vendored
Executable file
29
bower_components/datatables-plugins/sorting/scientific.js
vendored
Executable file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* This plug-in will treat numbers which are in scientific notation (for
|
||||
* example `1E-10`, `1.2E6` etc) and sort them numerically.
|
||||
*
|
||||
* @name Scientific notation sorting
|
||||
* @summary Sort data which is written in exponential notation.
|
||||
* @author [Nick Schurch](http://datatables.net/forums/profile/21757/nickschurch)
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'scientific', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"scientific-pre": function ( a ) {
|
||||
return parseFloat(a);
|
||||
},
|
||||
|
||||
"scientific-asc": function ( a, b ) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"scientific-desc": function ( a, b ) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
} );
|
30
bower_components/datatables-plugins/sorting/signed-num.js
vendored
Executable file
30
bower_components/datatables-plugins/sorting/signed-num.js
vendored
Executable file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Although DataTables' internal numeric sorting works no problem on negative
|
||||
* numbers, it does not accept positively signed numbers. This plug-in will
|
||||
* sort just such data numerically.
|
||||
*
|
||||
* @name Fully signed numbers sorting
|
||||
* @summary Sort data numerically with a leading `+` symbol (as well as `-`).
|
||||
* @author [Allan Jardine](http://sprymedia.co.uk)
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'signed-num', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"signed-num-pre": function ( a ) {
|
||||
return (a=="-" || a==="") ? 0 : a.replace('+','')*1;
|
||||
},
|
||||
|
||||
"signed-num-asc": function ( a, b ) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"signed-num-desc": function ( a, b ) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
} );
|
51
bower_components/datatables-plugins/sorting/stringMonthYear.js
vendored
Executable file
51
bower_components/datatables-plugins/sorting/stringMonthYear.js
vendored
Executable file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* This sorting plug-in will sort, in calendar order, data which
|
||||
* is in the format "MMM yyyy" or "MMMM yyyy". Inspired by forum discussion:
|
||||
* http://datatables.net/forums/discussion/1242/sorting-dates-with-only-month-and-year
|
||||
*
|
||||
* Please note that this plug-in is **deprecated*. The
|
||||
* [datetime](//datatables.net/blog/2014-12-18) plug-in provides enhanced
|
||||
* functionality and flexibility.
|
||||
*
|
||||
* @name Date (MMM yyyy) or (MMMM yyyy)
|
||||
* @anchor Sort dates in the format `MMM yyyy` or `MMMM yyyy`
|
||||
* @author Phil Hurwitz
|
||||
* @deprecated
|
||||
*
|
||||
* @example
|
||||
* $('#example').DataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'stringMonthYear', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend(jQuery.fn.dataTableExt.oSort, {
|
||||
"stringMonthYear-pre": function (s) {
|
||||
var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
|
||||
|
||||
var dateComponents = s.split(" ");
|
||||
dateComponents[0] = dateComponents[0].replace(",", "");
|
||||
dateComponents[1] = jQuery.trim(dateComponents[1]);
|
||||
|
||||
var year = dateComponents[1];
|
||||
|
||||
var month = 0;
|
||||
for (var i = 0; i < months.length; i++) {
|
||||
if (months[i].toLowerCase() == dateComponents[0].toLowerCase().substring(0,3)) {
|
||||
month = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return new Date(year, month, 1);
|
||||
},
|
||||
|
||||
"stringMonthYear-asc": function (a, b) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"stringMonthYear-desc": function (a, b) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
});
|
56
bower_components/datatables-plugins/sorting/time.js
vendored
Executable file
56
bower_components/datatables-plugins/sorting/time.js
vendored
Executable file
@@ -0,0 +1,56 @@
|
||||
/**
|
||||
* This plug-in provides the ability to sort columns that contains time
|
||||
* information in the most common formats used. It will automatically detect
|
||||
* those date types.
|
||||
*
|
||||
* Please note that this plug-in is **deprecated*. The
|
||||
* [datetime](//datatables.net/blog/2014-12-18) plug-in provides enhanced
|
||||
* functionality and flexibility.
|
||||
*
|
||||
* @name Time (dd/mm/YY)
|
||||
* @summary Sort Times in the formats: `hh:mm, hh:mm:ss, hh:mm tt, hh:mm:ss tt`
|
||||
* e.g. '22:50, 22:50:40, 10:50 pm, 10:50:40 pm'
|
||||
* am and pm are not case sensitive. white space is not compulsory
|
||||
* @author David Stoneham
|
||||
* @deprecated
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'time-uni', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend(jQuery.fn.dataTableExt.oSort, {
|
||||
"time-uni-pre": function (a) {
|
||||
var uniTime;
|
||||
|
||||
if (a.toLowerCase().indexOf("am") > -1 || (a.toLowerCase().indexOf("pm") > -1 && Number(a.split(":")[0]) === 12)) {
|
||||
uniTime = a.toLowerCase().split("pm")[0].split("am")[0];
|
||||
while (uniTime.indexOf(":") > -1) {
|
||||
uniTime = uniTime.replace(":", "");
|
||||
}
|
||||
} else if (a.toLowerCase().indexOf("pm") > -1 || (a.toLowerCase().indexOf("am") > -1 && Number(a.split(":")[0]) === 12)) {
|
||||
uniTime = Number(a.split(":")[0]) + 12;
|
||||
var leftTime = a.toLowerCase().split("pm")[0].split("am")[0].split(":");
|
||||
for (var i = 1; i < leftTime.length; i++) {
|
||||
uniTime = uniTime + leftTime[i].trim().toString();
|
||||
}
|
||||
} else {
|
||||
uniTime = a.replace(":", "");
|
||||
while (uniTime.indexOf(":") > -1) {
|
||||
uniTime = uniTime.replace(":", "");
|
||||
}
|
||||
}
|
||||
return Number(uniTime);
|
||||
},
|
||||
|
||||
"time-uni-asc": function (a, b) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"time-uni-desc": function (a, b) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
});
|
40
bower_components/datatables-plugins/sorting/title-numeric.js
vendored
Executable file
40
bower_components/datatables-plugins/sorting/title-numeric.js
vendored
Executable file
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* An alternative to the formatted number sorting function above (particularly
|
||||
* useful when considering localisation which uses dots / periods for 10^3
|
||||
* separation rather than decimal places). Another method of overcoming it
|
||||
* difficulties of sorting formatted numbers is to have the data to be sorted
|
||||
* upon separate from the visual data. This sorting function pair will use the
|
||||
* 'title' attribute of en empty span element (or anything else) to sort
|
||||
* numerically (for example `<span title="1000000"><span>1'000'000`).
|
||||
*
|
||||
* Note that the HTML5 `data-sort` attribute can be [used to supply sorting data
|
||||
* to DataTables](//datatables.net/manual/orthogonal-data) and is preferable to
|
||||
* using this method, which is therefore marked as deprecated.
|
||||
*
|
||||
* @name Hidden title numeric sorting
|
||||
* @summary Sort data numerically based on an attribute on an empty element.
|
||||
* @deprecated
|
||||
* @author [Allan Jardine](http://sprymedia.co.uk)
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'title-numeric', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"title-numeric-pre": function ( a ) {
|
||||
var x = a.match(/title="*(-?[0-9\.]+)/)[1];
|
||||
return parseFloat( x );
|
||||
},
|
||||
|
||||
"title-numeric-asc": function ( a, b ) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"title-numeric-desc": function ( a, b ) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
} );
|
36
bower_components/datatables-plugins/sorting/title-string.js
vendored
Executable file
36
bower_components/datatables-plugins/sorting/title-string.js
vendored
Executable file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Just like the _hidden title numeric sorting_ plug-in, this sorting plug-in
|
||||
* will take the information to be sorted on from the title attribute of a span
|
||||
* element. The only difference is that it is string based sorting rather than
|
||||
* numeric.
|
||||
*
|
||||
* Note that the HTML5 `data-sort` attribute can be [used to supply sorting data
|
||||
* to DataTables](//datatables.net/manual/orthogonal-data) and is preferable to
|
||||
* using this method, which is therefore marked as deprecated.
|
||||
*
|
||||
* @name Hidden title string sorting
|
||||
* @summary Sort data as a string based on an attribute on an empty element.
|
||||
* @author [Allan Jardine](http://sprymedia.co.uk)
|
||||
* @deprecated
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable( {
|
||||
* columnDefs: [
|
||||
* { type: 'title-string', targets: 0 }
|
||||
* ]
|
||||
* } );
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"title-string-pre": function ( a ) {
|
||||
return a.match(/title="(.*?)"/)[1].toLowerCase();
|
||||
},
|
||||
|
||||
"title-string-asc": function ( a, b ) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"title-string-desc": function ( a, b ) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
} );
|
33
bower_components/datatables-plugins/sorting/turkish-string.js
vendored
Executable file
33
bower_components/datatables-plugins/sorting/turkish-string.js
vendored
Executable file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Sorting in Javascript for Turkish Characters. This plug-in will replace the special
|
||||
* turkish letters (non english characters) and replace in English.
|
||||
*
|
||||
*
|
||||
* @name Turkish
|
||||
* @summary Sort Turkish characters
|
||||
* @author [Yuksel Beyti](http://yukselbeyti.com)
|
||||
*
|
||||
* @example
|
||||
* $('#example').dataTable({
|
||||
* 'aoColumns' : [
|
||||
* {'sType' : 'turkish'}
|
||||
* ]
|
||||
* });
|
||||
*/
|
||||
|
||||
jQuery.extend( jQuery.fn.dataTableExt.oSort, {
|
||||
"turkish-pre": function ( a ) {
|
||||
var special_letters = { "İ": "ib", "I": "ia", "Ş": "sa", "Ğ": "ga", "Ü": "ua", "Ö": "oa", "Ç": "ca", "i": "ia", "ı": "ia", "ş": "sa", "ğ": "ga", "ü": "ua", "ö": "oa", "ç": "ca" };
|
||||
for (var val in special_letters)
|
||||
a = a.split(val).join(special_letters[val]).toLowerCase();
|
||||
return a;
|
||||
},
|
||||
|
||||
"turkish-asc": function ( a, b ) {
|
||||
return ((a < b) ? -1 : ((a > b) ? 1 : 0));
|
||||
},
|
||||
|
||||
"turkish-desc": function ( a, b ) {
|
||||
return ((a < b) ? 1 : ((a > b) ? -1 : 0));
|
||||
}
|
||||
} );
|
Reference in New Issue
Block a user