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

pull/295/head
Allan Jardine 8 years ago
commit f55e344856

@ -29,25 +29,28 @@ jQuery.fn.dataTableExt.oApi.fnSetFilteringDelay = function ( oSettings, iDelay )
} }
this.each( function ( i ) { this.each( function ( i ) {
$.fn.dataTableExt.iApiIndex = i; if ( typeof _that.fnSettings().aanFeatures.f !== 'undefined' )
var {
oTimerId = null, $.fn.dataTableExt.iApiIndex = i;
sPreviousSearch = null, var
anControl = $( 'input', _that.fnSettings().aanFeatures.f ); oTimerId = null,
sPreviousSearch = null,
anControl.unbind( 'keyup search input' ).bind( 'keyup search input', function() { anControl = $( 'input', _that.fnSettings().aanFeatures.f );
if (sPreviousSearch === null || sPreviousSearch != anControl.val()) { anControl.unbind( 'keyup search input' ).bind( 'keyup search input', function() {
window.clearTimeout(oTimerId);
sPreviousSearch = anControl.val(); if (sPreviousSearch === null || sPreviousSearch != anControl.val()) {
oTimerId = window.setTimeout(function() { window.clearTimeout(oTimerId);
$.fn.dataTableExt.iApiIndex = i; sPreviousSearch = anControl.val();
_that.fnFilter( anControl.val() ); oTimerId = window.setTimeout(function() {
}, iDelay); $.fn.dataTableExt.iApiIndex = i;
} _that.fnFilter( anControl.val() );
}); }, iDelay);
}
return this; });
return this;
}
} ); } );
return this; return this;
}; };

@ -2,5 +2,10 @@
table.dataTable span.highlight { table.dataTable span.highlight {
background-color: #FFFF88; background-color: #FFFF88;
border-radius: 0.28571429rem;
} }
table.dataTable span.column_highlight {
background-color: #ffcc99;
border-radius: 0.28571429rem;
}

@ -10,7 +10,7 @@
* @author SpryMedia Ltd (www.sprymedia.co.uk) * @author SpryMedia Ltd (www.sprymedia.co.uk)
* @contact www.sprymedia.co.uk/contact * @contact www.sprymedia.co.uk/contact
* @copyright Copyright 2014 SpryMedia Ltd. * @copyright Copyright 2014 SpryMedia Ltd.
* *
* License MIT - http://datatables.net/license/mit * License MIT - http://datatables.net/license/mit
* *
* This feature plug-in for DataTables will highlight search terms in the * This feature plug-in for DataTables will highlight search terms in the
@ -43,10 +43,16 @@ function highlight( body, table )
// Don't highlight the "not found" row, so we get the rows using the api // Don't highlight the "not found" row, so we get the rows using the api
if ( table.rows( { filter: 'applied' } ).data().length ) { if ( table.rows( { filter: 'applied' } ).data().length ) {
table.columns().every( function () {
var column = this;
column.nodes().flatten().to$().unhighlight({ className: 'column_highlight' });
column.nodes().flatten().to$().highlight( $.trim( column.search() ).split(/\s+/), { className: 'column_highlight' } );
} );
body.highlight( $.trim( table.search() ).split(/\s+/) ); body.highlight( $.trim( table.search() ).split(/\s+/) );
} }
} }
// Listen for DataTables initialisations // Listen for DataTables initialisations
$(document).on( 'init.dt.dth', function (e, settings, json) { $(document).on( 'init.dt.dth', function (e, settings, json) {
if ( e.namespace !== 'dt' ) { if ( e.namespace !== 'dt' ) {

@ -0,0 +1,30 @@
/**
* Pashto translation
* @name Pashto
* @anchor Pashto
* @author <a href="http://mbrig.com/">MBrig | Muhammad Nasir Rahimi</a>
*/
{
"sEmptyTable": "جدول خالي دی",
"sInfo": "د _START_ څخه تر _END_ پوري، له ټولو _TOTAL_ څخه",
"sInfoEmpty": "د 0 څخه تر 0 پوري، له ټولو 0 څخه",
"sInfoFiltered": "(لټول سوي له ټولو _MAX_ څخه)",
"sInfoPostFix": "",
"sInfoThousands": ",",
"sLengthMenu": "_MENU_ کتاره وښايه",
"sLoadingRecords": "منتظر اوسئ...",
"sProcessing": "منتظر اوسئ...",
"sSearch": "لټون:",
"sZeroRecords": "د لټون مطابق معلومات و نه موندل سول",
"oPaginate": {
"sFirst": "لومړۍ",
"sLast": "وروستۍ",
"sNext": "بله",
"sPrevious": "شاته"
},
"oAria": {
"sSortAscending": ": په صعودي ډول مرتبول",
"sSortDescending": ": په نزولي ډول مرتبول"
}
}

@ -0,0 +1,29 @@
/**
* Telugu translation (te, te-IN)
* @name Telugu
* @anchor Telugu
* @author <a href="https://in.linkedin.com/in/srinivas-rathikrindi-0405973a">Srinivas Rathikrindi</a>
**/
{
"sEmptyTable": "పట్టికలో డేటా లేదు.",
"sInfo": "మొత్తం _TOTAL_ ఎంట్రీలులో _START_ నుండి _END_ వరకు చూపిస్తున్నాం",
"sInfoEmpty": "చూపిస్తున్నాం 0 నుండి 0 వరకు 0 ఎంట్రీలు లో",
"sInfoFiltered": "( _MAX_ ఎంట్రీలులో నుండి వడపోయాబడినవి)",
"sInfoPostFix": "",
"sInfoThousands": ",",
"sLengthMenu": " _MENU_ ఎంట్రీలు చూపించు",
"sLoadingRecords": "లోడ్ అవుతుంది ...",
"sProcessing": "ప్రాసెస్ చేయబడుతుంది...",
"sSearch": "వెతుకు:",
"sZeroRecords": "మ్యాచింగ్ రికార్డులు లేవు",
"oPaginate": {
"sFirst": "మొదటి",
"sLast": "చివరి",
"sNext": "తర్వాత",
"sPrevious": "మునుపటి"
},
"oAria": {
"sSortAscending": ": నిలువరుసను ఆరోహణ క్రమం అమర్చండి",
"sSortDescending": ": నిలువరుసను అవరోహణ క్రమం అమర్చండి"
}
}

@ -0,0 +1,42 @@
/**
* This plug-in will add automatic negative currency detection for currency columns to
* DataTables. Note that only $, c, £ and symbols are detected with this code,
* This plugin has also been updated to automatically detect negative values either those
* using '-' as well as numbers using '()' to specify negatives.
* This plugin also includes automatic type detection
*
* @name brackets-negative
* @summary Detect data of currency type with a leading currency symbol as well at detect two types of negative number formatting
* @author [Tom Buckle](http://sprymedia.co.uk)
*/
(function(){
// Change this list to the valid characters you want to be detected
var validChars = "$£€c" + "0123456789" + ".-,()'";
// Init the regex just once for speed - it is "closure locked"
var
str = jQuery.fn.dataTableExt.oApi._fnEscapeRegex( validChars ),re = new RegExp('[^'+str+']');
$.fn.dataTableExt.aTypes.unshift(
function ( data )
{
if ( typeof data !== 'string' || re.test(data) ) {
return null;
}
return 'currency';
}
);
$.fn.dataTable.ext.type.order['currency-pre'] = function ( data ) {
//Check if its in the proper format
if(data.match(/[\()]/g)){
if( data.match(/[\-]/g) !== true){
//It matched - strip out parentheses & any characters we dont want and append - at front
data = '-' + data.replace(/[\$£€c\(\),]/g,'');
}else{
//Already has a '-' so just strip out non-numeric charactors exluding '-'
data = data.replace(/[^\d\-\.]/g,'');
}
}else{
data = data.replace(/[\$£€\,]/g,'');
}
return parseInt( data, 10 );
};
}());

@ -29,7 +29,11 @@
var deDatea = jQuery.trim(a).split(' '); var deDatea = jQuery.trim(a).split(' ');
var deTimea = deDatea[1].split(':'); var deTimea = deDatea[1].split(':');
var deDatea2 = deDatea[0].split('.'); var deDatea2 = deDatea[0].split('.');
x = (deDatea2[2] + deDatea2[1] + deDatea2[0] + deTimea[0] + deTimea[1]) * 1; if(typeof deTimea[2] != 'undefined') {
x = (deDatea2[2] + deDatea2[1] + deDatea2[0] + deTimea[0] + deTimea[1] + deTimea[2]) * 1;
} else {
x = (deDatea2[2] + deDatea2[1] + deDatea2[0] + deTimea[0] + deTimea[1]) * 1;
}
} else { } else {
x = Infinity; // = l'an 1000 ... x = Infinity; // = l'an 1000 ...
} }
@ -38,7 +42,11 @@
var deDateb = jQuery.trim(b).split(' '); var deDateb = jQuery.trim(b).split(' ');
var deTimeb = deDateb[1].split(':'); var deTimeb = deDateb[1].split(':');
deDateb = deDateb[0].split('.'); deDateb = deDateb[0].split('.');
y = (deDateb[2] + deDateb[1] + deDateb[0] + deTimeb[0] + deTimeb[1]) * 1; if(typeof deTimeb[2] != 'undefined') {
y = (deDateb[2] + deDateb[1] + deDateb[0] + deTimeb[0] + deTimeb[1] + deTimeb[2]) * 1;
} else {
y = (deDateb[2] + deDateb[1] + deDateb[0] + deTimeb[0] + deTimeb[1]) * 1;
}
} else { } else {
y = Infinity; y = Infinity;
} }
@ -52,7 +60,11 @@
var deDatea = jQuery.trim(a).split(' '); var deDatea = jQuery.trim(a).split(' ');
var deTimea = deDatea[1].split(':'); var deTimea = deDatea[1].split(':');
var deDatea2 = deDatea[0].split('.'); var deDatea2 = deDatea[0].split('.');
x = (deDatea2[2] + deDatea2[1] + deDatea2[0] + deTimea[0] + deTimea[1]) * 1; if(typeof deTimea[2] != 'undefined') {
x = (deDatea2[2] + deDatea2[1] + deDatea2[0] + deTimea[0] + deTimea[1] + deTimea[2]) * 1;
} else {
x = (deDatea2[2] + deDatea2[1] + deDatea2[0] + deTimea[0] + deTimea[1]) * 1;
}
} else { } else {
x = Infinity; x = Infinity;
} }
@ -61,7 +73,11 @@
var deDateb = jQuery.trim(b).split(' '); var deDateb = jQuery.trim(b).split(' ');
var deTimeb = deDateb[1].split(':'); var deTimeb = deDateb[1].split(':');
deDateb = deDateb[0].split('.'); deDateb = deDateb[0].split('.');
y = (deDateb[2] + deDateb[1] + deDateb[0] + deTimeb[0] + deTimeb[1]) * 1; if(typeof deTimeb[2] != 'undefined') {
y = (deDateb[2] + deDateb[1] + deDateb[0] + deTimeb[0] + deTimeb[1] + deTimeb[2]) * 1;
} else {
y = (deDateb[2] + deDateb[1] + deDateb[0] + deTimeb[0] + deTimeb[1]) * 1;
}
} else { } else {
y = Infinity; y = Infinity;
} }
@ -107,4 +123,3 @@
return z; return z;
} }
} ); } );

Loading…
Cancel
Save