mirror of
https://github.com/DataTables/DataTables.git
synced 2024-11-29 11:24:10 +01:00
Merge branch 'master' of github.com:DataTables/DataTables
This commit is contained in:
commit
de935de4c6
@ -1,4 +1,3 @@
|
||||
|
||||
/**
|
||||
* Provide a common method for plug-ins to check the version of DataTables being used, in order
|
||||
* to ensure compatibility.
|
||||
@ -16,7 +15,7 @@ DataTable.fnVersionCheck = function( sVersion )
|
||||
{
|
||||
var aThis = DataTable.ext.sVersion.split('.');
|
||||
var aThat = sVersion.split('.');
|
||||
var iThis, sThat;
|
||||
var iThis, iThat;
|
||||
|
||||
for ( var i=0, iLen=aThat.length ; i<iLen ; i++ ){
|
||||
iThis = parseInt( aThis[i], 10 ) || 0;
|
||||
|
@ -1,5 +1,4 @@
|
||||
|
||||
|
||||
/**
|
||||
* Generate the node required for filtering text
|
||||
* @returns {node} Filter control element
|
||||
@ -336,22 +335,19 @@ function _fnBuildSearchRow( oSettings, aData )
|
||||
*/
|
||||
function _fnFilterCreateSearch( sSearch, bRegex, bSmart, bCaseInsensitive )
|
||||
{
|
||||
var asSearch, sRegExpString;
|
||||
var asSearch,
|
||||
sRegExpString = bRegex ? sSearch : _fnEscapeRegex( sSearch );
|
||||
|
||||
if ( bSmart )
|
||||
{
|
||||
/* Generate the regular expression to use. Something along the lines of:
|
||||
* ^(?=.*?\bone\b)(?=.*?\btwo\b)(?=.*?\bthree\b).*$
|
||||
*/
|
||||
asSearch = bRegex ? sSearch.split( ' ' ) : _fnEscapeRegex( sSearch ).split( ' ' );
|
||||
asSearch = sRegExpString.split( ' ' );
|
||||
sRegExpString = '^(?=.*?'+asSearch.join( ')(?=.*?' )+').*$';
|
||||
return new RegExp( sRegExpString, bCaseInsensitive ? "i" : "" );
|
||||
}
|
||||
else
|
||||
{
|
||||
sSearch = bRegex ? sSearch : _fnEscapeRegex( sSearch );
|
||||
return new RegExp( sSearch, bCaseInsensitive ? "i" : "" );
|
||||
}
|
||||
|
||||
return new RegExp( sRegExpString, bCaseInsensitive ? "i" : "" );
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user