From b400e641b359a322ad54a68eacc11c0ee82b6cb1 Mon Sep 17 00:00:00 2001 From: Allan Jardine Date: Fri, 18 Sep 2020 10:59:27 +0000 Subject: [PATCH] Remove use of deprcated $.trim --- features/searchHighlight/dataTables.searchHighlight.js | 4 ++-- sorting/date-euro.js | 4 ++-- sorting/datetime-moment.js | 4 ++-- sorting/persian.js | 2 +- type-detection/num-html.js | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/features/searchHighlight/dataTables.searchHighlight.js b/features/searchHighlight/dataTables.searchHighlight.js index d814f23..7d212cb 100644 --- a/features/searchHighlight/dataTables.searchHighlight.js +++ b/features/searchHighlight/dataTables.searchHighlight.js @@ -46,9 +46,9 @@ function highlight( body, table ) 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' } ); + column.nodes().flatten().to$().highlight( column.search().trim().split(/\s+/), { className: 'column_highlight' } ); } ); - body.highlight( $.trim( table.search() ).split(/\s+/) ); + body.highlight( table.search().trim().split(/\s+/) ); } } diff --git a/sorting/date-euro.js b/sorting/date-euro.js index 83aa8d2..326c812 100644 --- a/sorting/date-euro.js +++ b/sorting/date-euro.js @@ -25,8 +25,8 @@ "date-euro-pre": function ( a ) { var x; - if ( $.trim(a) !== '' ) { - var frDatea = $.trim(a).split(' '); + if ( a.trim() !== '' ) { + var frDatea = a.trim().split(' '); var frTimea = (undefined != frDatea[1]) ? frDatea[1].split(':') : [00,00,00]; var frDatea2 = frDatea[0].split('/'); x = (frDatea2[2] + frDatea2[1] + frDatea2[0] + frTimea[0] + frTimea[1] + ((undefined != frTimea[2]) ? frTimea[2] : 0)) * 1; diff --git a/sorting/datetime-moment.js b/sorting/datetime-moment.js index f937531..dd4aa93 100644 --- a/sorting/datetime-moment.js +++ b/sorting/datetime-moment.js @@ -40,7 +40,7 @@ $.fn.dataTable.moment = function ( format, locale, reverseEmpties ) { } // Strip out surrounding white space - d = $.trim( d ); + d = d.trim(); } // Null and empty values are acceptable @@ -62,7 +62,7 @@ $.fn.dataTable.moment = function ( format, locale, reverseEmpties ) { } // Strip out surrounding white space - d = $.trim( d ); + d = d.trim(); } return !moment(d, format, locale, true).isValid() ? diff --git a/sorting/persian.js b/sorting/persian.js index b5bf12a..21e3d5d 100644 --- a/sorting/persian.js +++ b/sorting/persian.js @@ -21,7 +21,7 @@ var persianSort = [ 'آ', 'ا', 'ب', 'پ', 'ت', 'ث', 'ج', 'چ', 'ح', 'خ', 'س', 'ش', 'ص', 'ط', 'ظ', 'ع', 'غ', 'ف', 'ق', 'ک', 'گ', 'ل', 'م', 'ن', 'و', 'ه', 'ی', 'ي' ]; function GetUniCode(source) { - source = $.trim(source); + source = source.trim(); var result = ''; var i, index; for (i = 0; i < source.length; i++) { diff --git a/type-detection/num-html.js b/type-detection/num-html.js index 077557d..eb2aea4 100644 --- a/type-detection/num-html.js +++ b/type-detection/num-html.js @@ -18,7 +18,7 @@ jQuery.fn.dataTableExt.aTypes.unshift( function ( sData ) { sData = typeof sData.replace == 'function' ? sData.replace( /<[\s\S]*?>/g, "" ) : sData; - sData = $.trim(sData); + sData = sData.trim(); var sValidFirstChars = "0123456789-"; var sValidChars = "0123456789.";