Merge branch 'master' into gh-pages

This commit is contained in:
Rob Garrison 2016-08-17 12:50:18 -05:00
commit b877dc168b
26 changed files with 5095 additions and 167 deletions

View File

@ -101,7 +101,17 @@ If you would like to contribute, please...
View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/Changes). View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/Changes).
#### <a name="v2.27.2">Version 2.27.2</a> (8/1/2016) #### <a name="v2.27.3">Version 2.27.3</a> (8/17/2016)
* Core: `getColumnData` now allows falsy values.
* Filter:
* Add delay to "filterFormatterUpdate". See [issue #1237](https://github.com/Mottie/tablesorter/issues/1237).
* `filter_liveSearch` now accepts an object.
* Pager: use ajax flag when calculating filtered rows.
* Readme: Fix date of last release.
* Testing: Update QUnit.
#### <a name="v2.27.2">Version 2.27.2</a> (8/2/2016)
* Docs: Update versions. * Docs: Update versions.
* Core: Allow leading zeros in the time parser. Fixes [issue #1269](https://github.com/Mottie/tablesorter/issues/1269). * Core: Allow leading zeros in the time parser. Fixes [issue #1269](https://github.com/Mottie/tablesorter/issues/1269).
@ -111,58 +121,3 @@ View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/C
* ColumnSelector: Fix undefined variable. * ColumnSelector: Fix undefined variable.
* Mark: Fix linting issues. * Mark: Fix linting issues.
#### <a name="v2.27.0">Version 2.27.0</a> (7/31/2016)
* Core:
* `updateCache` now ignores "remove-me" rows.
* Add column count to debug log.
* Tweak internal sortVars & sortReset. Fixes [#1137](https://github.com/Mottie/tablesorter/issues/1137).
* ColumnSelector:
* Add max/min visible columns settings.
* Set state to `null` for disabled columns - Fixes JSON issues with not storing `undefined` values.
* Fix null comparison & incorrect option.
* CurrentSort: Add `currentSort` widget. Fixes [issue #1208](https://github.com/Mottie/tablesorter/issues/1208).
* Filter:
* `getFilters` will now always return an array. Fixes [issue #1250](https://github.com/Mottie/tablesorter/issues/1250). **API change**
* Allow ES6 regex flags.
* Add rowIndex to filter data.
* Trigger filter formatters after update. See [issue #1237](https://github.com/Mottie/tablesorter/issues/1237).
* Selected column query works again. Fixes [issue #1267](https://github.com/Mottie/tablesorter/issues/1267); broken since [a6b25ae](https://github.com/Mottie/tablesorter/commit/a6b25ae4c0cc44dcf935568b2f100ae65117ea74).
* Grouping: Prevent js errors on non-string values.
* Mark: Add mark widget. Fixes [issue #1243](https://github.com/Mottie/tablesorter/issues/1243).
* Math:
* Add `data-math-target` attribute.
* Add `math-debug` option.
* Output:
* Automatically ignore widget added rows.
* Add "url" parameter to output_callback function.
* Scroller: Update when `applyWidgets` is used. See [issue #1261](https://github.com/Mottie/tablesorter/issues/1261).
* StickyHeaders: Add `appendTo` option.
* UITheme: jQuery v1.12.0 renamed "carat" to "caret". Fixes [issue #1257](https://github.com/Mottie/tablesorter/issues/1257).
* Parsers: Url parser now ignores "www" & removed parsed flag. The filter widget finds "http" querys.
* Docs:
* Fix docs javascript; some demos still using jQuery < 1.7.
* Add scroller widget RTL details. See [issue #906](https://github.com/Mottie/tablesorter/issues/906).
* Clarify & expand grouping widget usage.
* Include ajax type.
* Add ajax type example to main docs.
* Update jQuery UI & fix uitheme docs.
* Remove old syntax highlighter.
* Update theme switcher.
* Switch to use jQuery <3.0.0 for Bootstrap demos; later reverted this change after updating to Bootstrap v3.3.7.
* Add link to `cssIgnoreRow` example.
* Clarify column selector initial state.
* Fix HTML issues.
* Add filter event function parameter examples.
* Themes:
* Hide icon when column is disabled.
* Optimize PNGs in data URLs using ZopfliPNG as well.
* Compress PNG images further. See [pull #1251](https://github.com/Mottie/tablesorter/pull/1251); thanks [@Herst](https://github.com/Herst)!
* Add Materialize theme style. Fixes [issue #1242](https://github.com/Mottie/tablesorter/issues/1242).
* Meta:
* Grunt: Fix IIFE jQuery reference. Fixes [issue #1255](https://github.com/Mottie/tablesorter/issues/1255).
* Grunt: Update dependencies.
* Testing: Add filter anyMatch queries; Sadly unrelated to [issue #1267](https://github.com/Mottie/tablesorter/issues/1267).
* Bower: Oust meta warnings. Fixes [issue #1264](https://github.com/Mottie/tablesorter/issues/1264).
* Bower: Add recommending settings. Fixes [issue #1265](https://github.com/Mottie/tablesorter/issues/1265).

View File

@ -1,6 +1,6 @@
/*! /*!
* tablesorter (FORK) pager plugin * tablesorter (FORK) pager plugin
* updated 7/11/2016 (v2.26.6) * updated 8/17/2016 (v2.27.3)
*/ */
/*jshint browser:true, jquery:true, unused:false */ /*jshint browser:true, jquery:true, unused:false */
;(function($) { ;(function($) {
@ -145,7 +145,7 @@
var normalized, indx, len, var normalized, indx, len,
c = table.config, c = table.config,
hasFilters = c.$table.hasClass('hasFilters'); hasFilters = c.$table.hasClass('hasFilters');
if (hasFilters && !p.ajaxUrl) { if (hasFilters && !p.ajax) {
if (ts.isEmptyObject(c.cache)) { if (ts.isEmptyObject(c.cache)) {
// delayInit: true so nothing is in the cache // delayInit: true so nothing is in the cache
p.filteredRows = p.totalRows = c.$tbodies.eq(0).children('tr').not( p.countChildRows ? '' : '.' + c.cssChildRow ).length; p.filteredRows = p.totalRows = c.$tbodies.eq(0).children('tr').not( p.countChildRows ? '' : '.' + c.cssChildRow ).length;

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 08-02-2016 (v2.27.2)*/ /*! tablesorter (FORK) - updated 08-17-2016 (v2.27.3)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) { (function(factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
@ -10,7 +10,7 @@
} }
}(function(jQuery) { }(function(jQuery) {
/*! TableSorter (FORK) v2.27.2 *//* /*! TableSorter (FORK) v2.27.3 *//*
* Client-side table sorting with ease! * Client-side table sorting with ease!
* @requires jQuery v1.2.6+ * @requires jQuery v1.2.6+
* *
@ -34,7 +34,7 @@
'use strict'; 'use strict';
var ts = $.tablesorter = { var ts = $.tablesorter = {
version : '2.27.2', version : '2.27.3',
parsers : [], parsers : [],
widgets : [], widgets : [],
@ -2291,7 +2291,7 @@
// c.$headerIndexed is not defined initially // c.$headerIndexed is not defined initially
$cell = c.$headerIndexed && c.$headerIndexed[ indx ] || $cell = c.$headerIndexed && c.$headerIndexed[ indx ] ||
$cells.filter( '[data-column="' + indx + '"]:last' ); $cells.filter( '[data-column="' + indx + '"]:last' );
if ( obj[ indx ] ) { if ( typeof obj[ indx ] !== 'undefined' ) {
return getCell ? obj[ indx ] : obj[ $cells.index( $cell ) ]; return getCell ? obj[ indx ] : obj[ $cells.index( $cell ) ];
} }
for ( key in obj ) { for ( key in obj ) {
@ -3120,7 +3120,7 @@
})(jQuery); })(jQuery);
/*! Widget: filter - updated 7/31/2016 (v2.27.0) *//* /*! Widget: filter - updated 8/17/2016 (v2.27.3) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+ * Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison * by Rob Garrison
*/ */
@ -3559,8 +3559,10 @@
// force a new search since content has changed // force a new search since content has changed
c.lastCombinedFilter = null; c.lastCombinedFilter = null;
c.lastSearch = []; c.lastSearch = [];
// update filterFormatters after update - Fixes #1237 // update filterFormatters after update (& small delay) - Fixes #1237
c.$table.triggerHandler( 'filterFomatterUpdate' ); setTimeout(function(){
c.$table.triggerHandler( 'filterFomatterUpdate' );
}, 100);
} }
// pass true ( skipFirst ) to prevent the tablesorter.setFilters function from skipping the first // pass true ( skipFirst ) to prevent the tablesorter.setFilters function from skipping the first
// input ensures all inputs are updated when a search is triggered on the table // input ensures all inputs are updated when a search is triggered on the table
@ -3918,19 +3920,24 @@
}) })
.bind( 'keyup' + namespace, function( event ) { .bind( 'keyup' + namespace, function( event ) {
wo = table.config.widgetOptions; // make sure "wo" isn't cached wo = table.config.widgetOptions; // make sure "wo" isn't cached
var column = parseInt( $( this ).attr( 'data-column' ), 10 ); var column = parseInt( $( this ).attr( 'data-column' ), 10 ),
liveSearch = typeof wo.filter_liveSearch === 'boolean' ? wo.filter_liveSearch :
ts.getColumnData( table, wo.filter_liveSearch, column );
if ( typeof liveSearch === 'undefined' ) {
liveSearch = wo.filter_liveSearch.fallback || false;
}
$( this ).attr( 'data-lastSearchTime', new Date().getTime() ); $( this ).attr( 'data-lastSearchTime', new Date().getTime() );
// emulate what webkit does.... escape clears the filter // emulate what webkit does.... escape clears the filter
if ( event.which === tskeyCodes.escape ) { if ( event.which === tskeyCodes.escape ) {
// make sure to restore the last value on escape // make sure to restore the last value on escape
this.value = wo.filter_resetOnEsc ? '' : c.lastSearch[column]; this.value = wo.filter_resetOnEsc ? '' : c.lastSearch[column];
// live search // live search
} else if ( wo.filter_liveSearch === false ) { } else if ( liveSearch === false ) {
return; return;
// don't return if the search value is empty ( all rows need to be revealed ) // don't return if the search value is empty ( all rows need to be revealed )
} else if ( this.value !== '' && ( } else if ( this.value !== '' && (
// liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace // liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace
( typeof wo.filter_liveSearch === 'number' && this.value.length < wo.filter_liveSearch ) || ( typeof liveSearch === 'number' && this.value.length < liveSearch ) ||
// let return & backspace continue on, but ignore arrows & non-valid characters // let return & backspace continue on, but ignore arrows & non-valid characters
( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace && ( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace &&
( event.which < tskeyCodes.space || ( event.which >= tskeyCodes.left && event.which <= tskeyCodes.down ) ) ) ) ) { ( event.which < tskeyCodes.space || ( event.which >= tskeyCodes.left && event.which <= tskeyCodes.down ) ) ) ) ) {
@ -3952,18 +3959,31 @@
event.preventDefault(); event.preventDefault();
// init search with no delay // init search with no delay
$( this ).attr( 'data-lastSearchTime', new Date().getTime() ); $( this ).attr( 'data-lastSearchTime', new Date().getTime() );
tsf.searching( table, event.type !== 'keypress', true ); tsf.searching( table, event.type !== 'keypress', true, column );
} }
}); });
}, },
searching: function( table, filter, skipFirst ) { searching: function( table, filter, skipFirst, column ) {
var wo = table.config.widgetOptions; var liveSearch,
wo = table.config.widgetOptions;
if (typeof column === 'undefined') {
// no delay
liveSearch = false;
} else {
liveSearch = typeof wo.filter_liveSearch === 'boolean' ?
wo.filter_liveSearch :
// get column setting, or set to fallback value, or default to false
ts.getColumnData( table, wo.filter_liveSearch, column );
if ( typeof liveSearch !== 'undefined' ) {
liveSearch = wo.filter_liveSearch.fallback || false;
}
}
clearTimeout( wo.filter_searchTimer ); clearTimeout( wo.filter_searchTimer );
if ( typeof filter === 'undefined' || filter === true ) { if ( typeof filter === 'undefined' || filter === true ) {
// delay filtering // delay filtering
wo.filter_searchTimer = setTimeout( function() { wo.filter_searchTimer = setTimeout( function() {
tsf.checkFilters( table, filter, skipFirst ); tsf.checkFilters( table, filter, skipFirst );
}, wo.filter_liveSearch ? wo.filter_searchDelay : 10 ); }, liveSearch ? wo.filter_searchDelay : 10 );
} else { } else {
// skip delay // skip delay
tsf.checkFilters( table, filter, skipFirst ); tsf.checkFilters( table, filter, skipFirst );

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@
} }
}(function(jQuery) { }(function(jQuery) {
/*! TableSorter (FORK) v2.27.2 *//* /*! TableSorter (FORK) v2.27.3 *//*
* Client-side table sorting with ease! * Client-side table sorting with ease!
* @requires jQuery v1.2.6+ * @requires jQuery v1.2.6+
* *
@ -32,7 +32,7 @@
'use strict'; 'use strict';
var ts = $.tablesorter = { var ts = $.tablesorter = {
version : '2.27.2', version : '2.27.3',
parsers : [], parsers : [],
widgets : [], widgets : [],
@ -2289,7 +2289,7 @@
// c.$headerIndexed is not defined initially // c.$headerIndexed is not defined initially
$cell = c.$headerIndexed && c.$headerIndexed[ indx ] || $cell = c.$headerIndexed && c.$headerIndexed[ indx ] ||
$cells.filter( '[data-column="' + indx + '"]:last' ); $cells.filter( '[data-column="' + indx + '"]:last' );
if ( obj[ indx ] ) { if ( typeof obj[ indx ] !== 'undefined' ) {
return getCell ? obj[ indx ] : obj[ $cells.index( $cell ) ]; return getCell ? obj[ indx ] : obj[ $cells.index( $cell ) ];
} }
for ( key in obj ) { for ( key in obj ) {

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 08-02-2016 (v2.27.2)*/ /*! tablesorter (FORK) - updated 08-17-2016 (v2.27.3)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) { (function(factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
@ -376,7 +376,7 @@
})(jQuery); })(jQuery);
/*! Widget: filter - updated 7/31/2016 (v2.27.0) *//* /*! Widget: filter - updated 8/17/2016 (v2.27.3) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+ * Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison * by Rob Garrison
*/ */
@ -815,8 +815,10 @@
// force a new search since content has changed // force a new search since content has changed
c.lastCombinedFilter = null; c.lastCombinedFilter = null;
c.lastSearch = []; c.lastSearch = [];
// update filterFormatters after update - Fixes #1237 // update filterFormatters after update (& small delay) - Fixes #1237
c.$table.triggerHandler( 'filterFomatterUpdate' ); setTimeout(function(){
c.$table.triggerHandler( 'filterFomatterUpdate' );
}, 100);
} }
// pass true ( skipFirst ) to prevent the tablesorter.setFilters function from skipping the first // pass true ( skipFirst ) to prevent the tablesorter.setFilters function from skipping the first
// input ensures all inputs are updated when a search is triggered on the table // input ensures all inputs are updated when a search is triggered on the table
@ -1174,19 +1176,24 @@
}) })
.bind( 'keyup' + namespace, function( event ) { .bind( 'keyup' + namespace, function( event ) {
wo = table.config.widgetOptions; // make sure "wo" isn't cached wo = table.config.widgetOptions; // make sure "wo" isn't cached
var column = parseInt( $( this ).attr( 'data-column' ), 10 ); var column = parseInt( $( this ).attr( 'data-column' ), 10 ),
liveSearch = typeof wo.filter_liveSearch === 'boolean' ? wo.filter_liveSearch :
ts.getColumnData( table, wo.filter_liveSearch, column );
if ( typeof liveSearch === 'undefined' ) {
liveSearch = wo.filter_liveSearch.fallback || false;
}
$( this ).attr( 'data-lastSearchTime', new Date().getTime() ); $( this ).attr( 'data-lastSearchTime', new Date().getTime() );
// emulate what webkit does.... escape clears the filter // emulate what webkit does.... escape clears the filter
if ( event.which === tskeyCodes.escape ) { if ( event.which === tskeyCodes.escape ) {
// make sure to restore the last value on escape // make sure to restore the last value on escape
this.value = wo.filter_resetOnEsc ? '' : c.lastSearch[column]; this.value = wo.filter_resetOnEsc ? '' : c.lastSearch[column];
// live search // live search
} else if ( wo.filter_liveSearch === false ) { } else if ( liveSearch === false ) {
return; return;
// don't return if the search value is empty ( all rows need to be revealed ) // don't return if the search value is empty ( all rows need to be revealed )
} else if ( this.value !== '' && ( } else if ( this.value !== '' && (
// liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace // liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace
( typeof wo.filter_liveSearch === 'number' && this.value.length < wo.filter_liveSearch ) || ( typeof liveSearch === 'number' && this.value.length < liveSearch ) ||
// let return & backspace continue on, but ignore arrows & non-valid characters // let return & backspace continue on, but ignore arrows & non-valid characters
( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace && ( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace &&
( event.which < tskeyCodes.space || ( event.which >= tskeyCodes.left && event.which <= tskeyCodes.down ) ) ) ) ) { ( event.which < tskeyCodes.space || ( event.which >= tskeyCodes.left && event.which <= tskeyCodes.down ) ) ) ) ) {
@ -1208,18 +1215,31 @@
event.preventDefault(); event.preventDefault();
// init search with no delay // init search with no delay
$( this ).attr( 'data-lastSearchTime', new Date().getTime() ); $( this ).attr( 'data-lastSearchTime', new Date().getTime() );
tsf.searching( table, event.type !== 'keypress', true ); tsf.searching( table, event.type !== 'keypress', true, column );
} }
}); });
}, },
searching: function( table, filter, skipFirst ) { searching: function( table, filter, skipFirst, column ) {
var wo = table.config.widgetOptions; var liveSearch,
wo = table.config.widgetOptions;
if (typeof column === 'undefined') {
// no delay
liveSearch = false;
} else {
liveSearch = typeof wo.filter_liveSearch === 'boolean' ?
wo.filter_liveSearch :
// get column setting, or set to fallback value, or default to false
ts.getColumnData( table, wo.filter_liveSearch, column );
if ( typeof liveSearch !== 'undefined' ) {
liveSearch = wo.filter_liveSearch.fallback || false;
}
}
clearTimeout( wo.filter_searchTimer ); clearTimeout( wo.filter_searchTimer );
if ( typeof filter === 'undefined' || filter === true ) { if ( typeof filter === 'undefined' || filter === true ) {
// delay filtering // delay filtering
wo.filter_searchTimer = setTimeout( function() { wo.filter_searchTimer = setTimeout( function() {
tsf.checkFilters( table, filter, skipFirst ); tsf.checkFilters( table, filter, skipFirst );
}, wo.filter_liveSearch ? wo.filter_searchDelay : 10 ); }, liveSearch ? wo.filter_searchDelay : 10 );
} else { } else {
// skip delay // skip delay
tsf.checkFilters( table, filter, skipFirst ); tsf.checkFilters( table, filter, skipFirst );

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -102,7 +102,10 @@
// Set this option to false to make the searches case sensitive // Set this option to false to make the searches case sensitive
filter_ignoreCase : true, filter_ignoreCase : true,
// if true, search column content while the user types (with a delay) // if true, search column content while the user types (with a delay).
// In v2.27.3, this option can contain an
// object with column indexes or classnames; "fallback" is used
// for undefined columns
filter_liveSearch : true, filter_liveSearch : true,
// global query settings ('exact' or 'match'); overridden by "filter-match" or "filter-exact" class // global query settings ('exact' or 'match'); overridden by "filter-match" or "filter-exact" class
@ -248,6 +251,7 @@ $(function(){
<h3 id="notes"><a href="#">Notes</a></h3> <h3 id="notes"><a href="#">Notes</a></h3>
<div> <div>
<ul> <ul>
<li>In <span class="verison">v2.27.3</span>, <code>filter_liveSearch</code> will now accept an object containing zero-based column indexes or header class names.</li>
<li>In <span class="verison">v2.26.6</span>, the <a class="intlink" href="#filter-hidefilters"><code>hideFilters</code></a> setting will now accept a function to determine when to hide the filter row.</li> <li>In <span class="verison">v2.26.6</span>, the <a class="intlink" href="#filter-hidefilters"><code>hideFilters</code></a> setting will now accept a function to determine when to hide the filter row.</li>
<li>In <span class="version">v2.25.6</span>, added <a class="intlink" href="#methods"><code>filterResetSaved</code></a> method to clear stored filter values.</li> <li>In <span class="version">v2.25.6</span>, added <a class="intlink" href="#methods"><code>filterResetSaved</code></a> method to clear stored filter values.</li>
<li>In <span class="version">v2.25.2</span>, added <a class="intlink" href="#filter-resetonesc"><code>filter_resetOnEsc</code></a> option.</li> <li>In <span class="version">v2.25.2</span>, added <a class="intlink" href="#filter-resetonesc"><code>filter_resetOnEsc</code></a> option.</li>
@ -336,7 +340,7 @@ $(function(){
<h3><a href="#">Options</a></h3> <h3><a href="#">Options</a></h3>
<div> <div>
<h4>Filter widget defaults (added inside of tablesorter <code>widgetOptions</code>)</h4> <h4>Filter widget defaults (added inside of tablesorter <code>widgetOptions</code>)</h4>
<h5>This table includes very basic information about the filter options. For more extensive information &amp; links to demos, see the main page <a href="index.html#Widget-options">Widget &amp; Pager Options</a> section.</h5> <h4><span class="label warning">NOTE</span> This table includes very basic information about the filter options. For more extensive information &amp; links to demos, see the main page <a href="index.html#Widget-options">Widget &amp; Pager Options</a> section.</h4>
<div> <div>
<span class="label label-info">TIP!</span> Click on the link in the function column to reveal full details (or <a href="#" class="toggleAll">toggle</a>|<a href="#" class="showAll">show</a>|<a href="#" class="hideAll">hide</a> all) or double click to update the browser location. <span class="label label-info">TIP!</span> Click on the link in the function column to reveal full details (or <a href="#" class="toggleAll">toggle</a>|<a href="#" class="showAll">show</a>|<a href="#" class="hideAll">hide</a> all) or double click to update the browser location.
</div> </div>
@ -521,6 +525,7 @@ $(function(){
<ul> <ul>
<li>If <code>false</code>, the user must press enter to start the search.</li> <li>If <code>false</code>, the user must press enter to start the search.</li>
<li>If set to a number, when the length of the input text reaches this minimum length, a search will initiate.</li> <li>If set to a number, when the length of the input text reaches this minimum length, a search will initiate.</li>
<li>In <span class="version">v2.27.3</span>, this option can be set as an object containing column zero-based indexes or header class names. If a column isn't defined in the object, the "fallback" key is checked and if undefined, the value defaults to <code>false</code>.</li>
</ul> </ul>
</div> </div>
</td> </td>

View File

@ -460,7 +460,7 @@
<li><a href="example-widget-editable.html">Content editable widget</a> (v2.9; <span class="version updated">v2.25.5</span>).</li> <li><a href="example-widget-editable.html">Content editable widget</a> (v2.9; <span class="version updated">v2.25.5</span>).</li>
<li><a href="example-widget-current-sort.html">Current Sort Widget</a> (<span class="version">v2.27.0</span>).</li> <li><a href="example-widget-current-sort.html">Current Sort Widget</a> (<span class="version">v2.27.0</span>).</li>
<li><span class="label label-info">Beta</span> <a href="example-dragtable.html">Dragtable mod</a> - (jQuery UI widget for column reordering [<a class="external" href="http://stackoverflow.com/a/27770224/145346">ref</a>]; <span class="version">v2.24.0</span>).</li> <li><span class="label label-info">Beta</span> <a href="example-dragtable.html">Dragtable mod</a> - (jQuery UI widget for column reordering [<a class="external" href="http://stackoverflow.com/a/27770224/145346">ref</a>]; <span class="version">v2.24.0</span>).</li>
<li><span class="results">&dagger;</span> Filter widget (<span class="version updated">v2.27.0</span>): <li><span class="results">&dagger;</span> Filter widget (<span class="version updated">v2.27.3</span>):
<ul> <ul>
<li><a href="example-widget-filter.html">basic</a> (v2.0.18; <span class="version updated">v2.26.6</span>).</li> <li><a href="example-widget-filter.html">basic</a> (v2.0.18; <span class="version updated">v2.26.6</span>).</li>
<li><a href="example-widget-filter-any-match.html">external option (match any column)</a> (<span class="version">v2.13.3</span>; <span class="version updated">v2.26.2</span>).</li> <li><a href="example-widget-filter-any-match.html">external option (match any column)</a> (<span class="version">v2.13.3</span>; <span class="version updated">v2.26.2</span>).</li>
@ -491,9 +491,9 @@
<br><br> <br><br>
</li> </li>
<li>Pager plugin (<a href="example-pager.html">basic</a> &amp; <a href="example-pager-ajax.html">ajax</a> demos; <span class="version updated">v2.26.6</span>).</li> <li>Pager plugin (<a href="example-pager.html">basic</a> &amp; <a href="example-pager-ajax.html">ajax</a> demos; <span class="version updated">v2.27.3</span>).</li>
<li> <li>
Pager widget (<a href="example-widget-pager.html">basic</a> &amp; <a href="example-widget-pager-ajax.html">ajax</a> demos) (<span class="version">v2.12</span>; <span class="version updated">v2.26.6</span>).<br> Pager widget (<a href="example-widget-pager.html">basic</a> &amp; <a href="example-widget-pager-ajax.html">ajax</a> demos) (<span class="version">v2.12</span>; <span class="version updated">v2.27.3</span>).<br>
<br> <br>
</li> </li>
@ -1957,7 +1957,9 @@ $(function(){
// if true, search column content while the user types (with a delay) // if true, search column content while the user types (with a delay)
// or, set a minimum number of characters that must be present before // or, set a minimum number of characters that must be present before
// a search is initiated // a search is initiated. In v2.27.3, this option can contain an
// object with column indexes or classnames; "fallback" is used
// for undefined columns
filter_liveSearch: true, filter_liveSearch: true,
// global query settings ('exact' or 'match'); overridden by // global query settings ('exact' or 'match'); overridden by
@ -3050,15 +3052,34 @@ filter_cssFilter : [ '', 'hidden', '', 'hidden' ]</pre>
<tr id="widget-filter-livesearch"> <tr id="widget-filter-livesearch">
<td><a href="#" class="permalink">filter_liveSearch</a></td> <td><a href="#" class="permalink">filter_liveSearch</a></td>
<td>Boolean, or Number</td> <td>Boolean, Number or Object</td>
<td>true</td> <td>true</td>
<td> <td>
Filter widget: If <code>true</code>, a search of the column content will occur as the user types, with the delay set in the <code>filter_searchDelay</code> option (v2.9; <span class="version updated">v2.10</span>). Filter widget: If <code>true</code>, a search of the column content will occur as the user types, with the delay set in the <code>filter_searchDelay</code> option (v2.9; <span class="version updated">v2.27.3</span>).
<div class="collapsible"> <div class="collapsible">
<br> <br>
This option, when <code>false</code> allows you to disable the live search behavior, so that a filter is only applied when the user presses <kbd>Enter</kbd> (or uses <kbd>Esc</kbd> to clear and cancel the search).<br> This option, when <code>false</code> allows you to disable the live search behavior, so that a filter is only applied when the user presses <kbd>Enter</kbd> (or uses <kbd>Esc</kbd> to clear and cancel the search).<br>
<br> <br>
If this option is set to a number, e.g. <code>4</code>, a search of the column content will not initiate until this minimum number of characters are entered into the input. If this option is set to a number, e.g. <code>4</code>, a search of the column content will not initiate until this minimum number of characters are entered into the input.
<p>In <span class="version">v2.27.3</span>, this option can be set as an object containing specific column zero-based indexes, or class names. For undefined columns, include a <code>"fallback"</code> value otherwise undefined columns will be set as <code>false</code>.</p>
<pre class="prettyprint lang-js">$(function(){
$("table").tablesorter({
widgets: ["filter"],
widgetOptions : {
filter_liveSearch : {
// when false, the user must press enter to blur the input to trigger the search
3 : false,
// the query will initiate when 5 or more characters are entered into the filter
4 : 5,
// no live search on the last three columns (using a header class name)
'.last-3-columns' : false,
// for columns that aren't defined; this will set the fallback value
// otherwise the fallback defaults to false.
'fallback' : true
}
}
});
});</pre>
</div> </div>
</td> </td>
<td></td> <td></td>
@ -7920,7 +7941,7 @@ $.tablesorter.addHeaderResizeEvent( table, true );</pre>
</div> </div>
<!-- jQuery --> <!-- jQuery -->
<script src="js/jquery-3.0.0.min.js"></script> <script src="js/jquery-latest.min.js"></script>
<script src="js/jquery-migrate-3.0.0.min.js"></script> <script src="js/jquery-migrate-3.0.0.min.js"></script>
<script src="js/jquery-ui.min.js"></script> <script src="js/jquery-ui.min.js"></script>
<script src="js/prettify.js"></script> <script src="js/prettify.js"></script>

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*/ */
/*! tablesorter (FORK) - updated 08-02-2016 (v2.27.2)*/ /*! tablesorter (FORK) - updated 08-17-2016 (v2.27.3)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) { (function(factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
@ -16,7 +16,7 @@
} }
}(function(jQuery) { }(function(jQuery) {
/*! TableSorter (FORK) v2.27.2 *//* /*! TableSorter (FORK) v2.27.3 *//*
* Client-side table sorting with ease! * Client-side table sorting with ease!
* @requires jQuery v1.2.6+ * @requires jQuery v1.2.6+
* *
@ -40,7 +40,7 @@
'use strict'; 'use strict';
var ts = $.tablesorter = { var ts = $.tablesorter = {
version : '2.27.2', version : '2.27.3',
parsers : [], parsers : [],
widgets : [], widgets : [],
@ -2297,7 +2297,7 @@
// c.$headerIndexed is not defined initially // c.$headerIndexed is not defined initially
$cell = c.$headerIndexed && c.$headerIndexed[ indx ] || $cell = c.$headerIndexed && c.$headerIndexed[ indx ] ||
$cells.filter( '[data-column="' + indx + '"]:last' ); $cells.filter( '[data-column="' + indx + '"]:last' );
if ( obj[ indx ] ) { if ( typeof obj[ indx ] !== 'undefined' ) {
return getCell ? obj[ indx ] : obj[ $cells.index( $cell ) ]; return getCell ? obj[ indx ] : obj[ $cells.index( $cell ) ];
} }
for ( key in obj ) { for ( key in obj ) {
@ -3126,7 +3126,7 @@
})(jQuery); })(jQuery);
/*! Widget: filter - updated 7/31/2016 (v2.27.0) *//* /*! Widget: filter - updated 8/17/2016 (v2.27.3) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+ * Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison * by Rob Garrison
*/ */
@ -3565,8 +3565,10 @@
// force a new search since content has changed // force a new search since content has changed
c.lastCombinedFilter = null; c.lastCombinedFilter = null;
c.lastSearch = []; c.lastSearch = [];
// update filterFormatters after update - Fixes #1237 // update filterFormatters after update (& small delay) - Fixes #1237
c.$table.triggerHandler( 'filterFomatterUpdate' ); setTimeout(function(){
c.$table.triggerHandler( 'filterFomatterUpdate' );
}, 100);
} }
// pass true ( skipFirst ) to prevent the tablesorter.setFilters function from skipping the first // pass true ( skipFirst ) to prevent the tablesorter.setFilters function from skipping the first
// input ensures all inputs are updated when a search is triggered on the table // input ensures all inputs are updated when a search is triggered on the table
@ -3924,19 +3926,24 @@
}) })
.bind( 'keyup' + namespace, function( event ) { .bind( 'keyup' + namespace, function( event ) {
wo = table.config.widgetOptions; // make sure "wo" isn't cached wo = table.config.widgetOptions; // make sure "wo" isn't cached
var column = parseInt( $( this ).attr( 'data-column' ), 10 ); var column = parseInt( $( this ).attr( 'data-column' ), 10 ),
liveSearch = typeof wo.filter_liveSearch === 'boolean' ? wo.filter_liveSearch :
ts.getColumnData( table, wo.filter_liveSearch, column );
if ( typeof liveSearch === 'undefined' ) {
liveSearch = wo.filter_liveSearch.fallback || false;
}
$( this ).attr( 'data-lastSearchTime', new Date().getTime() ); $( this ).attr( 'data-lastSearchTime', new Date().getTime() );
// emulate what webkit does.... escape clears the filter // emulate what webkit does.... escape clears the filter
if ( event.which === tskeyCodes.escape ) { if ( event.which === tskeyCodes.escape ) {
// make sure to restore the last value on escape // make sure to restore the last value on escape
this.value = wo.filter_resetOnEsc ? '' : c.lastSearch[column]; this.value = wo.filter_resetOnEsc ? '' : c.lastSearch[column];
// live search // live search
} else if ( wo.filter_liveSearch === false ) { } else if ( liveSearch === false ) {
return; return;
// don't return if the search value is empty ( all rows need to be revealed ) // don't return if the search value is empty ( all rows need to be revealed )
} else if ( this.value !== '' && ( } else if ( this.value !== '' && (
// liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace // liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace
( typeof wo.filter_liveSearch === 'number' && this.value.length < wo.filter_liveSearch ) || ( typeof liveSearch === 'number' && this.value.length < liveSearch ) ||
// let return & backspace continue on, but ignore arrows & non-valid characters // let return & backspace continue on, but ignore arrows & non-valid characters
( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace && ( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace &&
( event.which < tskeyCodes.space || ( event.which >= tskeyCodes.left && event.which <= tskeyCodes.down ) ) ) ) ) { ( event.which < tskeyCodes.space || ( event.which >= tskeyCodes.left && event.which <= tskeyCodes.down ) ) ) ) ) {
@ -3958,18 +3965,31 @@
event.preventDefault(); event.preventDefault();
// init search with no delay // init search with no delay
$( this ).attr( 'data-lastSearchTime', new Date().getTime() ); $( this ).attr( 'data-lastSearchTime', new Date().getTime() );
tsf.searching( table, event.type !== 'keypress', true ); tsf.searching( table, event.type !== 'keypress', true, column );
} }
}); });
}, },
searching: function( table, filter, skipFirst ) { searching: function( table, filter, skipFirst, column ) {
var wo = table.config.widgetOptions; var liveSearch,
wo = table.config.widgetOptions;
if (typeof column === 'undefined') {
// no delay
liveSearch = false;
} else {
liveSearch = typeof wo.filter_liveSearch === 'boolean' ?
wo.filter_liveSearch :
// get column setting, or set to fallback value, or default to false
ts.getColumnData( table, wo.filter_liveSearch, column );
if ( typeof liveSearch !== 'undefined' ) {
liveSearch = wo.filter_liveSearch.fallback || false;
}
}
clearTimeout( wo.filter_searchTimer ); clearTimeout( wo.filter_searchTimer );
if ( typeof filter === 'undefined' || filter === true ) { if ( typeof filter === 'undefined' || filter === true ) {
// delay filtering // delay filtering
wo.filter_searchTimer = setTimeout( function() { wo.filter_searchTimer = setTimeout( function() {
tsf.checkFilters( table, filter, skipFirst ); tsf.checkFilters( table, filter, skipFirst );
}, wo.filter_liveSearch ? wo.filter_searchDelay : 10 ); }, liveSearch ? wo.filter_searchDelay : 10 );
} else { } else {
// skip delay // skip delay
tsf.checkFilters( table, filter, skipFirst ); tsf.checkFilters( table, filter, skipFirst );

View File

@ -1,4 +1,4 @@
/*! TableSorter (FORK) v2.27.2 *//* /*! TableSorter (FORK) v2.27.3 *//*
* Client-side table sorting with ease! * Client-side table sorting with ease!
* @requires jQuery v1.2.6+ * @requires jQuery v1.2.6+
* *
@ -22,7 +22,7 @@
'use strict'; 'use strict';
var ts = $.tablesorter = { var ts = $.tablesorter = {
version : '2.27.2', version : '2.27.3',
parsers : [], parsers : [],
widgets : [], widgets : [],
@ -2279,7 +2279,7 @@
// c.$headerIndexed is not defined initially // c.$headerIndexed is not defined initially
$cell = c.$headerIndexed && c.$headerIndexed[ indx ] || $cell = c.$headerIndexed && c.$headerIndexed[ indx ] ||
$cells.filter( '[data-column="' + indx + '"]:last' ); $cells.filter( '[data-column="' + indx + '"]:last' );
if ( obj[ indx ] ) { if ( typeof obj[ indx ] !== 'undefined' ) {
return getCell ? obj[ indx ] : obj[ $cells.index( $cell ) ]; return getCell ? obj[ indx ] : obj[ $cells.index( $cell ) ];
} }
for ( key in obj ) { for ( key in obj ) {

View File

@ -4,7 +4,7 @@
*/ */
/*! tablesorter (FORK) - updated 08-02-2016 (v2.27.2)*/ /*! tablesorter (FORK) - updated 08-17-2016 (v2.27.3)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) { (function(factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
@ -382,7 +382,7 @@
})(jQuery); })(jQuery);
/*! Widget: filter - updated 7/31/2016 (v2.27.0) *//* /*! Widget: filter - updated 8/17/2016 (v2.27.3) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+ * Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison * by Rob Garrison
*/ */
@ -821,8 +821,10 @@
// force a new search since content has changed // force a new search since content has changed
c.lastCombinedFilter = null; c.lastCombinedFilter = null;
c.lastSearch = []; c.lastSearch = [];
// update filterFormatters after update - Fixes #1237 // update filterFormatters after update (& small delay) - Fixes #1237
c.$table.triggerHandler( 'filterFomatterUpdate' ); setTimeout(function(){
c.$table.triggerHandler( 'filterFomatterUpdate' );
}, 100);
} }
// pass true ( skipFirst ) to prevent the tablesorter.setFilters function from skipping the first // pass true ( skipFirst ) to prevent the tablesorter.setFilters function from skipping the first
// input ensures all inputs are updated when a search is triggered on the table // input ensures all inputs are updated when a search is triggered on the table
@ -1180,19 +1182,24 @@
}) })
.bind( 'keyup' + namespace, function( event ) { .bind( 'keyup' + namespace, function( event ) {
wo = table.config.widgetOptions; // make sure "wo" isn't cached wo = table.config.widgetOptions; // make sure "wo" isn't cached
var column = parseInt( $( this ).attr( 'data-column' ), 10 ); var column = parseInt( $( this ).attr( 'data-column' ), 10 ),
liveSearch = typeof wo.filter_liveSearch === 'boolean' ? wo.filter_liveSearch :
ts.getColumnData( table, wo.filter_liveSearch, column );
if ( typeof liveSearch === 'undefined' ) {
liveSearch = wo.filter_liveSearch.fallback || false;
}
$( this ).attr( 'data-lastSearchTime', new Date().getTime() ); $( this ).attr( 'data-lastSearchTime', new Date().getTime() );
// emulate what webkit does.... escape clears the filter // emulate what webkit does.... escape clears the filter
if ( event.which === tskeyCodes.escape ) { if ( event.which === tskeyCodes.escape ) {
// make sure to restore the last value on escape // make sure to restore the last value on escape
this.value = wo.filter_resetOnEsc ? '' : c.lastSearch[column]; this.value = wo.filter_resetOnEsc ? '' : c.lastSearch[column];
// live search // live search
} else if ( wo.filter_liveSearch === false ) { } else if ( liveSearch === false ) {
return; return;
// don't return if the search value is empty ( all rows need to be revealed ) // don't return if the search value is empty ( all rows need to be revealed )
} else if ( this.value !== '' && ( } else if ( this.value !== '' && (
// liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace // liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace
( typeof wo.filter_liveSearch === 'number' && this.value.length < wo.filter_liveSearch ) || ( typeof liveSearch === 'number' && this.value.length < liveSearch ) ||
// let return & backspace continue on, but ignore arrows & non-valid characters // let return & backspace continue on, but ignore arrows & non-valid characters
( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace && ( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace &&
( event.which < tskeyCodes.space || ( event.which >= tskeyCodes.left && event.which <= tskeyCodes.down ) ) ) ) ) { ( event.which < tskeyCodes.space || ( event.which >= tskeyCodes.left && event.which <= tskeyCodes.down ) ) ) ) ) {
@ -1214,18 +1221,31 @@
event.preventDefault(); event.preventDefault();
// init search with no delay // init search with no delay
$( this ).attr( 'data-lastSearchTime', new Date().getTime() ); $( this ).attr( 'data-lastSearchTime', new Date().getTime() );
tsf.searching( table, event.type !== 'keypress', true ); tsf.searching( table, event.type !== 'keypress', true, column );
} }
}); });
}, },
searching: function( table, filter, skipFirst ) { searching: function( table, filter, skipFirst, column ) {
var wo = table.config.widgetOptions; var liveSearch,
wo = table.config.widgetOptions;
if (typeof column === 'undefined') {
// no delay
liveSearch = false;
} else {
liveSearch = typeof wo.filter_liveSearch === 'boolean' ?
wo.filter_liveSearch :
// get column setting, or set to fallback value, or default to false
ts.getColumnData( table, wo.filter_liveSearch, column );
if ( typeof liveSearch !== 'undefined' ) {
liveSearch = wo.filter_liveSearch.fallback || false;
}
}
clearTimeout( wo.filter_searchTimer ); clearTimeout( wo.filter_searchTimer );
if ( typeof filter === 'undefined' || filter === true ) { if ( typeof filter === 'undefined' || filter === true ) {
// delay filtering // delay filtering
wo.filter_searchTimer = setTimeout( function() { wo.filter_searchTimer = setTimeout( function() {
tsf.checkFilters( table, filter, skipFirst ); tsf.checkFilters( table, filter, skipFirst );
}, wo.filter_liveSearch ? wo.filter_searchDelay : 10 ); }, liveSearch ? wo.filter_searchDelay : 10 );
} else { } else {
// skip delay // skip delay
tsf.checkFilters( table, filter, skipFirst ); tsf.checkFilters( table, filter, skipFirst );

View File

@ -1,4 +1,4 @@
/*! Widget: filter - updated 7/31/2016 (v2.27.0) *//* /*! Widget: filter - updated 8/17/2016 (v2.27.3) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+ * Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison * by Rob Garrison
*/ */
@ -437,8 +437,10 @@
// force a new search since content has changed // force a new search since content has changed
c.lastCombinedFilter = null; c.lastCombinedFilter = null;
c.lastSearch = []; c.lastSearch = [];
// update filterFormatters after update - Fixes #1237 // update filterFormatters after update (& small delay) - Fixes #1237
c.$table.triggerHandler( 'filterFomatterUpdate' ); setTimeout(function(){
c.$table.triggerHandler( 'filterFomatterUpdate' );
}, 100);
} }
// pass true ( skipFirst ) to prevent the tablesorter.setFilters function from skipping the first // pass true ( skipFirst ) to prevent the tablesorter.setFilters function from skipping the first
// input ensures all inputs are updated when a search is triggered on the table // input ensures all inputs are updated when a search is triggered on the table
@ -796,19 +798,24 @@
}) })
.bind( 'keyup' + namespace, function( event ) { .bind( 'keyup' + namespace, function( event ) {
wo = table.config.widgetOptions; // make sure "wo" isn't cached wo = table.config.widgetOptions; // make sure "wo" isn't cached
var column = parseInt( $( this ).attr( 'data-column' ), 10 ); var column = parseInt( $( this ).attr( 'data-column' ), 10 ),
liveSearch = typeof wo.filter_liveSearch === 'boolean' ? wo.filter_liveSearch :
ts.getColumnData( table, wo.filter_liveSearch, column );
if ( typeof liveSearch === 'undefined' ) {
liveSearch = wo.filter_liveSearch.fallback || false;
}
$( this ).attr( 'data-lastSearchTime', new Date().getTime() ); $( this ).attr( 'data-lastSearchTime', new Date().getTime() );
// emulate what webkit does.... escape clears the filter // emulate what webkit does.... escape clears the filter
if ( event.which === tskeyCodes.escape ) { if ( event.which === tskeyCodes.escape ) {
// make sure to restore the last value on escape // make sure to restore the last value on escape
this.value = wo.filter_resetOnEsc ? '' : c.lastSearch[column]; this.value = wo.filter_resetOnEsc ? '' : c.lastSearch[column];
// live search // live search
} else if ( wo.filter_liveSearch === false ) { } else if ( liveSearch === false ) {
return; return;
// don't return if the search value is empty ( all rows need to be revealed ) // don't return if the search value is empty ( all rows need to be revealed )
} else if ( this.value !== '' && ( } else if ( this.value !== '' && (
// liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace // liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace
( typeof wo.filter_liveSearch === 'number' && this.value.length < wo.filter_liveSearch ) || ( typeof liveSearch === 'number' && this.value.length < liveSearch ) ||
// let return & backspace continue on, but ignore arrows & non-valid characters // let return & backspace continue on, but ignore arrows & non-valid characters
( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace && ( event.which !== tskeyCodes.enter && event.which !== tskeyCodes.backSpace &&
( event.which < tskeyCodes.space || ( event.which >= tskeyCodes.left && event.which <= tskeyCodes.down ) ) ) ) ) { ( event.which < tskeyCodes.space || ( event.which >= tskeyCodes.left && event.which <= tskeyCodes.down ) ) ) ) ) {
@ -830,18 +837,31 @@
event.preventDefault(); event.preventDefault();
// init search with no delay // init search with no delay
$( this ).attr( 'data-lastSearchTime', new Date().getTime() ); $( this ).attr( 'data-lastSearchTime', new Date().getTime() );
tsf.searching( table, event.type !== 'keypress', true ); tsf.searching( table, event.type !== 'keypress', true, column );
} }
}); });
}, },
searching: function( table, filter, skipFirst ) { searching: function( table, filter, skipFirst, column ) {
var wo = table.config.widgetOptions; var liveSearch,
wo = table.config.widgetOptions;
if (typeof column === 'undefined') {
// no delay
liveSearch = false;
} else {
liveSearch = typeof wo.filter_liveSearch === 'boolean' ?
wo.filter_liveSearch :
// get column setting, or set to fallback value, or default to false
ts.getColumnData( table, wo.filter_liveSearch, column );
if ( typeof liveSearch !== 'undefined' ) {
liveSearch = wo.filter_liveSearch.fallback || false;
}
}
clearTimeout( wo.filter_searchTimer ); clearTimeout( wo.filter_searchTimer );
if ( typeof filter === 'undefined' || filter === true ) { if ( typeof filter === 'undefined' || filter === true ) {
// delay filtering // delay filtering
wo.filter_searchTimer = setTimeout( function() { wo.filter_searchTimer = setTimeout( function() {
tsf.checkFilters( table, filter, skipFirst ); tsf.checkFilters( table, filter, skipFirst );
}, wo.filter_liveSearch ? wo.filter_searchDelay : 10 ); }, liveSearch ? wo.filter_searchDelay : 10 );
} else { } else {
// skip delay // skip delay
tsf.checkFilters( table, filter, skipFirst ); tsf.checkFilters( table, filter, skipFirst );

View File

@ -1,4 +1,4 @@
/*! Widget: Pager - updated 7/11/2016 (v2.26.6) */ /*! Widget: Pager - updated 8/17/2016 (v2.27.3) */
/* Requires tablesorter v2.8+ and jQuery 1.7+ /* Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison * by Rob Garrison
*/ */
@ -417,7 +417,7 @@
wo = c.widgetOptions, wo = c.widgetOptions,
p = c.pager, p = c.pager,
hasFilters = c.$table.hasClass( 'hasFilters' ); hasFilters = c.$table.hasClass( 'hasFilters' );
if ( hasFilters && !wo.pager_ajaxUrl ) { if ( hasFilters && !p.ajax ) {
if ( $.isEmptyObject( c.cache ) ) { if ( $.isEmptyObject( c.cache ) ) {
// delayInit: true so nothing is in the cache // delayInit: true so nothing is in the cache
p.filteredRows = p.totalRows = c.$tbodies.eq( 0 ) p.filteredRows = p.totalRows = c.$tbodies.eq( 0 )

View File

@ -1,7 +1,7 @@
{ {
"name": "tablesorter", "name": "tablesorter",
"title": "tablesorter", "title": "tablesorter",
"version": "2.27.2", "version": "2.27.3",
"description": "tablesorter (FORK) is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell.", "description": "tablesorter (FORK) is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell.",
"author": { "author": {
"name": "Christian Bach", "name": "Christian Bach",

View File

@ -1,7 +1,7 @@
{ {
"name": "tablesorter", "name": "tablesorter",
"title": "tablesorter", "title": "tablesorter",
"version": "2.27.2", "version": "2.27.3",
"description": "tablesorter is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell.\n\nThis forked version adds lots of new enhancements including: alphanumeric sorting, pager callback functons, multiple widgets providing column styling, ui theme application, sticky headers, column filters and resizer, as well as extended documentation with a lot more demos.", "description": "tablesorter is a jQuery plugin for turning a standard HTML table with THEAD and TBODY tags into a sortable table without page refreshes. tablesorter can successfully parse and sort many types of data including linked data in a cell.\n\nThis forked version adds lots of new enhancements including: alphanumeric sorting, pager callback functons, multiple widgets providing column styling, ui theme application, sticky headers, column filters and resizer, as well as extended documentation with a lot more demos.",
"author": { "author": {
"name": "Christian Bach", "name": "Christian Bach",

View File

@ -3,12 +3,11 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Tablesorter Testing (WIP)</title> <title>Tablesorter Testing (WIP)</title>
<link rel="stylesheet" href="testing/qunit-1.23.0.css"> <link rel="stylesheet" href="testing/qunit-2.0.1.css">
<link rel="stylesheet" href="testing/testing.css"> <link rel="stylesheet" href="testing/testing.css">
<script src="testing/qunit-1.23.0.js"></script> <script src="testing/qunit-2.0.1.js"></script>
<script src="docs/js/jquery-3.0.0.min.js"></script> <script src="docs/js/jquery-latest.min.js"></script>
<script src="docs/js/jquery-migrate-3.0.0.min.js"></script>
<script src="js/jquery.tablesorter.js"></script> <script src="js/jquery.tablesorter.js"></script>
<script src="js/widgets/widget-filter.js"></script> <script src="js/widgets/widget-filter.js"></script>

415
testing/qunit-2.0.1.css Normal file
View File

@ -0,0 +1,415 @@
/*!
* QUnit 2.0.1
* https://qunitjs.com/
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license
* https://jquery.org/license
*
* Date: 2016-07-23T19:39Z
*/
/** Font Family and Sizes */
#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult {
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
}
#qunit-testrunner-toolbar, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
#qunit-tests { font-size: smaller; }
/** Resets */
#qunit-tests, #qunit-header, #qunit-banner, #qunit-filteredTest, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
margin: 0;
padding: 0;
}
/** Header (excluding toolbar) */
#qunit-header {
padding: 0.5em 0 0.5em 1em;
color: #8699A4;
background-color: #0D3349;
font-size: 1.5em;
line-height: 1em;
font-weight: 400;
border-radius: 5px 5px 0 0;
}
#qunit-header a {
text-decoration: none;
color: #C2CCD1;
}
#qunit-header a:hover,
#qunit-header a:focus {
color: #FFF;
}
#qunit-banner {
height: 5px;
}
#qunit-filteredTest {
padding: 0.5em 1em 0.5em 1em;
color: #366097;
background-color: #F4FF77;
}
#qunit-userAgent {
padding: 0.5em 1em 0.5em 1em;
color: #FFF;
background-color: #2B81AF;
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
}
/** Toolbar */
#qunit-testrunner-toolbar {
padding: 0.5em 1em 0.5em 1em;
color: #5E740B;
background-color: #EEE;
}
#qunit-testrunner-toolbar .clearfix {
height: 0;
clear: both;
}
#qunit-testrunner-toolbar label {
display: inline-block;
}
#qunit-testrunner-toolbar input[type=checkbox],
#qunit-testrunner-toolbar input[type=radio] {
margin: 3px;
vertical-align: -2px;
}
#qunit-testrunner-toolbar input[type=text] {
box-sizing: border-box;
height: 1.6em;
}
.qunit-url-config,
.qunit-filter,
#qunit-modulefilter {
display: inline-block;
line-height: 2.1em;
}
.qunit-filter,
#qunit-modulefilter {
float: right;
position: relative;
margin-left: 1em;
}
.qunit-url-config label {
margin-right: 0.5em;
}
#qunit-modulefilter-search {
box-sizing: border-box;
width: 400px;
}
#qunit-modulefilter-search-container:after {
position: absolute;
right: 0.3em;
content: "\25bc";
color: black;
}
#qunit-modulefilter-dropdown {
/* align with #qunit-modulefilter-search */
box-sizing: border-box;
width: 400px;
position: absolute;
right: 0;
top: 50%;
margin-top: 0.8em;
border: 1px solid #D3D3D3;
border-top: none;
border-radius: 0 0 .25em .25em;
color: #000;
background-color: #F5F5F5;
z-index: 99;
}
#qunit-modulefilter-dropdown a {
color: inherit;
text-decoration: none;
}
#qunit-modulefilter-dropdown .clickable.checked {
font-weight: bold;
color: #000;
background-color: #D2E0E6;
}
#qunit-modulefilter-dropdown .clickable:hover {
color: #FFF;
background-color: #0D3349;
}
#qunit-modulefilter-actions {
display: block;
overflow: auto;
/* align with #qunit-modulefilter-dropdown-list */
font: smaller/1.5em sans-serif;
}
#qunit-modulefilter-dropdown #qunit-modulefilter-actions > * {
box-sizing: border-box;
max-height: 2.8em;
display: block;
padding: 0.4em;
}
#qunit-modulefilter-dropdown #qunit-modulefilter-actions > button {
float: right;
font: inherit;
}
#qunit-modulefilter-dropdown #qunit-modulefilter-actions > :last-child {
/* insert padding to align with checkbox margins */
padding-left: 3px;
}
#qunit-modulefilter-dropdown-list {
max-height: 200px;
overflow-y: auto;
margin: 0;
border-top: 2px groove threedhighlight;
padding: 0.4em 0 0;
font: smaller/1.5em sans-serif;
}
#qunit-modulefilter-dropdown-list li {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
#qunit-modulefilter-dropdown-list .clickable {
display: block;
padding-left: 0.15em;
}
/** Tests: Pass/Fail */
#qunit-tests {
list-style-position: inside;
}
#qunit-tests li {
padding: 0.4em 1em 0.4em 1em;
border-bottom: 1px solid #FFF;
list-style-position: inside;
}
#qunit-tests > li {
display: none;
}
#qunit-tests li.running,
#qunit-tests li.pass,
#qunit-tests li.fail,
#qunit-tests li.skipped {
display: list-item;
}
#qunit-tests.hidepass {
position: relative;
}
#qunit-tests.hidepass li.running,
#qunit-tests.hidepass li.pass {
visibility: hidden;
position: absolute;
width: 0;
height: 0;
padding: 0;
border: 0;
margin: 0;
}
#qunit-tests li strong {
cursor: pointer;
}
#qunit-tests li.skipped strong {
cursor: default;
}
#qunit-tests li a {
padding: 0.5em;
color: #C2CCD1;
text-decoration: none;
}
#qunit-tests li p a {
padding: 0.25em;
color: #6B6464;
}
#qunit-tests li a:hover,
#qunit-tests li a:focus {
color: #000;
}
#qunit-tests li .runtime {
float: right;
font-size: smaller;
}
.qunit-assert-list {
margin-top: 0.5em;
padding: 0.5em;
background-color: #FFF;
border-radius: 5px;
}
.qunit-source {
margin: 0.6em 0 0.3em;
}
.qunit-collapsed {
display: none;
}
#qunit-tests table {
border-collapse: collapse;
margin-top: 0.2em;
}
#qunit-tests th {
text-align: right;
vertical-align: top;
padding: 0 0.5em 0 0;
}
#qunit-tests td {
vertical-align: top;
}
#qunit-tests pre {
margin: 0;
white-space: pre-wrap;
word-wrap: break-word;
}
#qunit-tests del {
color: #374E0C;
background-color: #E0F2BE;
text-decoration: none;
}
#qunit-tests ins {
color: #500;
background-color: #FFCACA;
text-decoration: none;
}
/*** Test Counts */
#qunit-tests b.counts { color: #000; }
#qunit-tests b.passed { color: #5E740B; }
#qunit-tests b.failed { color: #710909; }
#qunit-tests li li {
padding: 5px;
background-color: #FFF;
border-bottom: none;
list-style-position: inside;
}
/*** Passing Styles */
#qunit-tests li li.pass {
color: #3C510C;
background-color: #FFF;
border-left: 10px solid #C6E746;
}
#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
#qunit-tests .pass .test-name { color: #366097; }
#qunit-tests .pass .test-actual,
#qunit-tests .pass .test-expected { color: #999; }
#qunit-banner.qunit-pass { background-color: #C6E746; }
/*** Failing Styles */
#qunit-tests li li.fail {
color: #710909;
background-color: #FFF;
border-left: 10px solid #EE5757;
white-space: pre;
}
#qunit-tests > li:last-child {
border-radius: 0 0 5px 5px;
}
#qunit-tests .fail { color: #000; background-color: #EE5757; }
#qunit-tests .fail .test-name,
#qunit-tests .fail .module-name { color: #000; }
#qunit-tests .fail .test-actual { color: #EE5757; }
#qunit-tests .fail .test-expected { color: #008000; }
#qunit-banner.qunit-fail { background-color: #EE5757; }
/*** Skipped tests */
#qunit-tests .skipped {
background-color: #EBECE9;
}
#qunit-tests .qunit-skipped-label {
background-color: #F4FF77;
display: inline-block;
font-style: normal;
color: #366097;
line-height: 1.8em;
padding: 0 0.5em;
margin: -0.4em 0.4em -0.4em 0;
}
/** Result */
#qunit-testresult {
padding: 0.5em 1em 0.5em 1em;
color: #2B81AF;
background-color: #D2E0E6;
border-bottom: 1px solid #FFF;
}
#qunit-testresult .module-name {
font-weight: 700;
}
/** Fixture */
#qunit-fixture {
position: absolute;
top: -10000px;
left: -10000px;
width: 1000px;
height: 1000px;
}

4437
testing/qunit-2.0.1.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -17,7 +17,7 @@ QUnit.extend(QUnit.assert, {
ipv6tests = function(){ ipv6tests = function(){
QUnit.test( "ipv6 parser", function(assert) { QUnit.test( "ipv6 parser", function(assert) {
expect(483); assert.expect(483);
// IPV6 tests by Rich Brown copied from http:// download.dartware.com/thirdparty/test-ipv6-regex.pl // IPV6 tests by Rich Brown copied from http:// download.dartware.com/thirdparty/test-ipv6-regex.pl
// modified to compare to canonical ipv6 output using http://www.v6decode.com/ to produce the result // modified to compare to canonical ipv6 output using http://www.v6decode.com/ to produce the result

View File

@ -149,7 +149,7 @@ jQuery(function($){
Filter widget Filter widget
************************************************/ ************************************************/
QUnit.test( 'Filter: init', function(assert) { QUnit.test( 'Filter: init', function(assert) {
expect(6); assert.expect(6);
assert.equal( this.init, true, 'Init event' ); assert.equal( this.init, true, 'Init event' );
assert.equal( this.$table.hasClass('hasFilters'), true, '`hasFilters` class applied' ); assert.equal( this.$table.hasClass('hasFilters'), true, '`hasFilters` class applied' );
@ -163,7 +163,7 @@ jQuery(function($){
}); });
QUnit.test( 'Filter column range', function(assert) { QUnit.test( 'Filter column range', function(assert) {
expect(10); assert.expect(10);
var range = $.tablesorter.filter.findRange, var range = $.tablesorter.filter.findRange,
c = { columns: 10 }; // psuedo table.config c = { columns: 10 }; // psuedo table.config
@ -180,7 +180,7 @@ jQuery(function($){
}); });
QUnit.test( 'Filter process filters', function(assert) { QUnit.test( 'Filter process filters', function(assert) {
expect(2); assert.expect(2);
var processFilters = this.ts.filter.processFilters, var processFilters = this.ts.filter.processFilters,
filters = [], filters = [],
results = []; results = [];
@ -198,7 +198,7 @@ jQuery(function($){
wo = this.wo, wo = this.wo,
$table = this.$table, $table = this.$table,
table = this.table; table = this.table;
expect(37); assert.expect(37);
return QUnit.SequentialRunner( return QUnit.SequentialRunner(
function(actions, assertions) { function(actions, assertions) {
@ -340,7 +340,7 @@ jQuery(function($){
}); });
QUnit.test( 'Filter: function & selectSource', function(assert) { QUnit.test( 'Filter: function & selectSource', function(assert) {
expect(3); assert.expect(3);
var $t, opts = []; var $t, opts = [];
$t = this.c.$table.find('.tablesorter-filter-row select:last'); $t = this.c.$table.find('.tablesorter-filter-row select:last');
@ -363,7 +363,7 @@ jQuery(function($){
ts = this.ts, ts = this.ts,
$table = this.$table, $table = this.$table,
table = this.table; table = this.table;
expect(3); assert.expect(3);
return QUnit.SequentialRunner( return QUnit.SequentialRunner(
function(actions, assertions) { function(actions, assertions) {