mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Merge branch 'master' into gh-pages
This commit is contained in:
commit
225fafc5d8
12
.gitattributes
vendored
12
.gitattributes
vendored
@ -10,14 +10,14 @@
|
|||||||
*.dbproj merge=union
|
*.dbproj merge=union
|
||||||
|
|
||||||
# Standard to msysgit
|
# Standard to msysgit
|
||||||
*.doc diff=astextplain
|
*.doc diff=astextplain
|
||||||
*.DOC diff=astextplain
|
*.DOC diff=astextplain
|
||||||
*.docx diff=astextplain
|
*.docx diff=astextplain
|
||||||
*.DOCX diff=astextplain
|
*.DOCX diff=astextplain
|
||||||
*.dot diff=astextplain
|
*.dot diff=astextplain
|
||||||
*.DOT diff=astextplain
|
*.DOT diff=astextplain
|
||||||
*.pdf diff=astextplain
|
*.pdf diff=astextplain
|
||||||
*.PDF diff=astextplain
|
*.PDF diff=astextplain
|
||||||
*.rtf diff=astextplain
|
*.rtf diff=astextplain
|
||||||
*.RTF diff=astextplain
|
*.RTF diff=astextplain
|
||||||
*.md diss=astextplain
|
*.md diss=astextplain
|
||||||
|
23
README.md
23
README.md
@ -101,6 +101,24 @@ 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.7">Version 2.27.7</a> (9/23/2016)
|
||||||
|
|
||||||
|
* Core:
|
||||||
|
* Include version in log.
|
||||||
|
* Remove space from debug message.
|
||||||
|
* Docs: update jQuery.
|
||||||
|
* Filter:
|
||||||
|
* Include "input" event for searches. See [issue #1280](https://github.com/Mottie/tablesorter/issues/1280).
|
||||||
|
* Add support for descending sort on selectSources values.
|
||||||
|
* Mark: Remove internal case matching.
|
||||||
|
* Pager:
|
||||||
|
* Allow for optional output callback in favour of parsable string. See [pull #1283](https://github.com/Mottie/tablesorter/pull/1283); thanks [@joelperry93](https://github.com/joelperry93)!
|
||||||
|
* Add output function support to pager widget. See [pull #1283](https://github.com/Mottie/tablesorter/pull/1283).
|
||||||
|
* Maintain `pageDisplay` ID, if one exists. Fixes [issue #1288](https://github.com/Mottie/tablesorter/issues/1288).
|
||||||
|
* RepeatHeaders:
|
||||||
|
* Repeat HTML content instead of only text. See [pull #1282](https://github.com/Mottie/tablesorter/pull/1282); thanks [@Milania1](https://github.com/Milania1)!
|
||||||
|
* Testing: update jQuery usage.
|
||||||
|
|
||||||
#### <a name="v2.27.6">Version 2.27.6</a> (9/1/2016)
|
#### <a name="v2.27.6">Version 2.27.6</a> (9/1/2016)
|
||||||
|
|
||||||
* Core: `textSorter` option now accepts class names. See [Stackoverflow](http://stackoverflow.com/q/39259954/145346).
|
* Core: `textSorter` option now accepts class names. See [Stackoverflow](http://stackoverflow.com/q/39259954/145346).
|
||||||
@ -128,8 +146,3 @@ View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/C
|
|||||||
* Docs: Correct usage of Sugar v2.0+ `sortCollage`.
|
* Docs: Correct usage of Sugar v2.0+ `sortCollage`.
|
||||||
* Filter: Add any match search by column text - see [updated demo](https://mottie.github.io/tablesorter/docs/example-widget-filter-any-match.html#anymatch_searches).
|
* Filter: Add any match search by column text - see [updated demo](https://mottie.github.io/tablesorter/docs/example-widget-filter-any-match.html#anymatch_searches).
|
||||||
* Parser: Fix JSHint issue.
|
* Parser: Fix JSHint issue.
|
||||||
|
|
||||||
#### <a name="v2.27.4">Version 2.27.4</a> (8/18/2016)
|
|
||||||
|
|
||||||
* Docs & parser: Update Sugar library v2.0+. Fixes [issue #1275](https://github.com/Mottie/tablesorter/issues/1275).
|
|
||||||
* Docs: Add `sortStable` example.
|
|
||||||
|
@ -39,4 +39,4 @@ td.tablesorter-pager {
|
|||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
filter: alpha(opacity=50);
|
filter: alpha(opacity=50);
|
||||||
cursor: default;
|
cursor: default;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* tablesorter (FORK) pager plugin
|
* tablesorter (FORK) pager plugin
|
||||||
* updated 8/17/2016 (v2.27.3)
|
* updated 9/23/2016 (v2.27.7)
|
||||||
*/
|
*/
|
||||||
/*jshint browser:true, jquery:true, unused:false */
|
/*jshint browser:true, jquery:true, unused:false */
|
||||||
;(function($) {
|
;(function($) {
|
||||||
@ -182,27 +182,33 @@
|
|||||||
p.startRow = (t) ? sz * p.page + 1 : (p.filteredRows === 0 ? 0 : sz * p.page + 1);
|
p.startRow = (t) ? sz * p.page + 1 : (p.filteredRows === 0 ? 0 : sz * p.page + 1);
|
||||||
p.endRow = Math.min( p.filteredRows, p.totalRows, sz * ( p.page + 1 ) );
|
p.endRow = Math.min( p.filteredRows, p.totalRows, sz * ( p.page + 1 ) );
|
||||||
$out = p.$container.find(p.cssPageDisplay);
|
$out = p.$container.find(p.cssPageDisplay);
|
||||||
// form the output string (can now get a new output string from the server)
|
|
||||||
s = ( p.ajaxData && p.ajaxData.output ? p.ajaxData.output || p.output : p.output )
|
// Output param can be callback for custom rendering or string
|
||||||
// {page} = one-based index; {page+#} = zero based index +/- value
|
if (typeof p.output === 'function') {
|
||||||
.replace(/\{page([\-+]\d+)?\}/gi, function(m, n){
|
s = p.output(table, p);
|
||||||
return p.totalPages ? p.page + (n ? parseInt(n, 10) : 1) : 0;
|
} else {
|
||||||
})
|
// form the output string (can now get a new output string from the server)
|
||||||
// {totalPages}, {extra}, {extra:0} (array) or {extra : key} (object)
|
s = ( p.ajaxData && p.ajaxData.output ? p.ajaxData.output || p.output : p.output )
|
||||||
.replace(/\{\w+(\s*:\s*\w+)?\}/gi, function(m){
|
// {page} = one-based index; {page+#} = zero based index +/- value
|
||||||
var len, indx,
|
.replace(/\{page([\-+]\d+)?\}/gi, function(m, n){
|
||||||
str = m.replace(/[{}\s]/g, ''),
|
return p.totalPages ? p.page + (n ? parseInt(n, 10) : 1) : 0;
|
||||||
extra = str.split(':'),
|
})
|
||||||
data = p.ajaxData,
|
// {totalPages}, {extra}, {extra:0} (array) or {extra : key} (object)
|
||||||
// return zero for default page/row numbers
|
.replace(/\{\w+(\s*:\s*\w+)?\}/gi, function(m){
|
||||||
deflt = /(rows?|pages?)$/i.test(str) ? 0 : '';
|
var len, indx,
|
||||||
if (/(startRow|page)/.test(extra[0]) && extra[1] === 'input') {
|
str = m.replace(/[{}\s]/g, ''),
|
||||||
len = ('' + (extra[0] === 'page' ? p.totalPages : p.totalRows)).length;
|
extra = str.split(':'),
|
||||||
indx = extra[0] === 'page' ? p.page + 1 : p.startRow;
|
data = p.ajaxData,
|
||||||
return '<input type="text" class="ts-' + extra[0] + '" style="max-width:' + len + 'em" value="' + indx + '"/>';
|
// return zero for default page/row numbers
|
||||||
}
|
deflt = /(rows?|pages?)$/i.test(str) ? 0 : '';
|
||||||
return extra.length > 1 && data && data[extra[0]] ? data[extra[0]][extra[1]] : p[str] || (data ? data[str] : deflt) || deflt;
|
if (/(startRow|page)/.test(extra[0]) && extra[1] === 'input') {
|
||||||
});
|
len = ('' + (extra[0] === 'page' ? p.totalPages : p.totalRows)).length;
|
||||||
|
indx = extra[0] === 'page' ? p.page + 1 : p.startRow;
|
||||||
|
return '<input type="text" class="ts-' + extra[0] + '" style="max-width:' + len + 'em" value="' + indx + '"/>';
|
||||||
|
}
|
||||||
|
return extra.length > 1 && data && data[extra[0]] ? data[extra[0]][extra[1]] : p[str] || (data ? data[str] : deflt) || deflt;
|
||||||
|
});
|
||||||
|
}
|
||||||
if ( p.$goto.length ) {
|
if ( p.$goto.length ) {
|
||||||
t = '';
|
t = '';
|
||||||
options = buildPageSelect( table, p );
|
options = buildPageSelect( table, p );
|
||||||
@ -865,7 +871,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
enablePager = function(table, p, triggered) {
|
enablePager = function(table, p, triggered) {
|
||||||
var info, size,
|
var info, size, $el,
|
||||||
c = table.config;
|
c = table.config;
|
||||||
p.$size.add(p.$goto).add(p.$container.find('.ts-startRow, .ts-page'))
|
p.$size.add(p.$goto).add(p.$container.find('.ts-startRow, .ts-page'))
|
||||||
.removeClass(p.cssDisabled)
|
.removeClass(p.cssDisabled)
|
||||||
@ -878,10 +884,15 @@
|
|||||||
p.$size.val( p.size ); // set page size
|
p.$size.val( p.size ); // set page size
|
||||||
p.totalPages = p.size === 'all' ? 1 : Math.ceil( getTotalPages( table, p ) / p.size );
|
p.totalPages = p.size === 'all' ? 1 : Math.ceil( getTotalPages( table, p ) / p.size );
|
||||||
// if table id exists, include page display with aria info
|
// if table id exists, include page display with aria info
|
||||||
if ( table.id ) {
|
if ( table.id && !c.$table.attr( 'aria-describedby' ) ) {
|
||||||
info = table.id + '_pager_info';
|
$el = p.$container.find( p.cssPageDisplay );
|
||||||
p.$container.find(p.cssPageDisplay).attr('id', info);
|
info = $el.attr( 'id' );
|
||||||
c.$table.attr('aria-describedby', info);
|
if ( !info ) {
|
||||||
|
// only add pageDisplay id if it doesn't exist - see #1288
|
||||||
|
info = table.id + '_pager_info';
|
||||||
|
$el.attr( 'id', info );
|
||||||
|
}
|
||||||
|
c.$table.attr( 'aria-describedby', info );
|
||||||
}
|
}
|
||||||
changeHeight(table, p);
|
changeHeight(table, p);
|
||||||
if ( triggered ) {
|
if ( triggered ) {
|
||||||
|
File diff suppressed because one or more lines are too long
23
dist/js/jquery.tablesorter.combined.js
vendored
23
dist/js/jquery.tablesorter.combined.js
vendored
@ -1,4 +1,4 @@
|
|||||||
/*! tablesorter (FORK) - updated 09-01-2016 (v2.27.6)*/
|
/*! tablesorter (FORK) - updated 09-23-2016 (v2.27.7)*/
|
||||||
/* 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.6 *//*
|
/*! TableSorter (FORK) v2.27.7 *//*
|
||||||
* 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.6',
|
version : '2.27.7',
|
||||||
|
|
||||||
parsers : [],
|
parsers : [],
|
||||||
widgets : [],
|
widgets : [],
|
||||||
@ -245,7 +245,7 @@
|
|||||||
// save the settings where they read
|
// save the settings where they read
|
||||||
$.data( table, 'tablesorter', c );
|
$.data( table, 'tablesorter', c );
|
||||||
if ( c.debug ) {
|
if ( c.debug ) {
|
||||||
console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter' );
|
console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter v' + ts.version );
|
||||||
$.data( table, 'startoveralltimer', new Date() );
|
$.data( table, 'startoveralltimer', new Date() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,7 +347,7 @@
|
|||||||
table.hasInitialized = true;
|
table.hasInitialized = true;
|
||||||
table.isProcessing = false;
|
table.isProcessing = false;
|
||||||
if ( c.debug ) {
|
if ( c.debug ) {
|
||||||
console.log( 'Overall initialization time: ' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
|
console.log( 'Overall initialization time:' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
|
||||||
if ( c.debug && console.groupEnd ) { console.groupEnd(); }
|
if ( c.debug && console.groupEnd ) { console.groupEnd(); }
|
||||||
}
|
}
|
||||||
$table.triggerHandler( 'tablesorter-initialized', table );
|
$table.triggerHandler( 'tablesorter-initialized', table );
|
||||||
@ -3131,7 +3131,7 @@
|
|||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
|
||||||
/*! Widget: filter - updated 8/22/2016 (v2.27.5) *//*
|
/*! Widget: filter - updated 9/23/2016 (v2.27.7) *//*
|
||||||
* Requires tablesorter v2.8+ and jQuery 1.7+
|
* Requires tablesorter v2.8+ and jQuery 1.7+
|
||||||
* by Rob Garrison
|
* by Rob Garrison
|
||||||
*/
|
*/
|
||||||
@ -3964,9 +3964,9 @@
|
|||||||
// don't allow 'change' event to process if the input value is the same - fixes #685
|
// don't allow 'change' event to process if the input value is the same - fixes #685
|
||||||
if ( table.config.widgetOptions.filter_initialized &&
|
if ( table.config.widgetOptions.filter_initialized &&
|
||||||
( event.which === tskeyCodes.enter || event.type === 'search' ||
|
( event.which === tskeyCodes.enter || event.type === 'search' ||
|
||||||
( event.type === 'change' ) && this.value !== c.lastSearch[column] ) ||
|
( event.type === 'change' || event.type === 'input' ) &&
|
||||||
// only "input" event fires in MS Edge when clicking the "x" to clear the search
|
this.value !== c.lastSearch[column] )
|
||||||
( event.type === 'input' && this.value === '' ) ) {
|
) {
|
||||||
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() );
|
||||||
@ -4681,6 +4681,7 @@
|
|||||||
var cts, txt, indx, len, parsedTxt, str,
|
var cts, txt, indx, len, parsedTxt, str,
|
||||||
c = table.config,
|
c = table.config,
|
||||||
validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns,
|
validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns,
|
||||||
|
direction = validColumn ? c.$headerIndexed[ column ].hasClass( 'filter-select-sort-desc' ) : false,
|
||||||
parsed = [];
|
parsed = [];
|
||||||
// get unique elements and sort the list
|
// get unique elements and sort the list
|
||||||
// if $.tablesorter.sortText exists ( not in the original tablesorter ),
|
// if $.tablesorter.sortText exists ( not in the original tablesorter ),
|
||||||
@ -4721,8 +4722,8 @@
|
|||||||
// sort parsed select options
|
// sort parsed select options
|
||||||
cts = c.textSorter || '';
|
cts = c.textSorter || '';
|
||||||
parsed.sort( function( a, b ) {
|
parsed.sort( function( a, b ) {
|
||||||
var x = a.parsed,
|
var x = direction ? b.parsed : a.parsed,
|
||||||
y = b.parsed;
|
y = direction ? a.parsed : b.parsed;
|
||||||
if ( validColumn && typeof cts === 'function' ) {
|
if ( validColumn && typeof cts === 'function' ) {
|
||||||
// custom OVERALL text sorter
|
// custom OVERALL text sorter
|
||||||
return cts( x, y, true, column, table );
|
return cts( x, y, true, column, table );
|
||||||
|
8
dist/js/jquery.tablesorter.combined.min.js
vendored
8
dist/js/jquery.tablesorter.combined.min.js
vendored
File diff suppressed because one or more lines are too long
8
dist/js/jquery.tablesorter.js
vendored
8
dist/js/jquery.tablesorter.js
vendored
@ -8,7 +8,7 @@
|
|||||||
}
|
}
|
||||||
}(function(jQuery) {
|
}(function(jQuery) {
|
||||||
|
|
||||||
/*! TableSorter (FORK) v2.27.6 *//*
|
/*! TableSorter (FORK) v2.27.7 *//*
|
||||||
* 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.6',
|
version : '2.27.7',
|
||||||
|
|
||||||
parsers : [],
|
parsers : [],
|
||||||
widgets : [],
|
widgets : [],
|
||||||
@ -243,7 +243,7 @@
|
|||||||
// save the settings where they read
|
// save the settings where they read
|
||||||
$.data( table, 'tablesorter', c );
|
$.data( table, 'tablesorter', c );
|
||||||
if ( c.debug ) {
|
if ( c.debug ) {
|
||||||
console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter' );
|
console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter v' + ts.version );
|
||||||
$.data( table, 'startoveralltimer', new Date() );
|
$.data( table, 'startoveralltimer', new Date() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -345,7 +345,7 @@
|
|||||||
table.hasInitialized = true;
|
table.hasInitialized = true;
|
||||||
table.isProcessing = false;
|
table.isProcessing = false;
|
||||||
if ( c.debug ) {
|
if ( c.debug ) {
|
||||||
console.log( 'Overall initialization time: ' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
|
console.log( 'Overall initialization time:' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
|
||||||
if ( c.debug && console.groupEnd ) { console.groupEnd(); }
|
if ( c.debug && console.groupEnd ) { console.groupEnd(); }
|
||||||
}
|
}
|
||||||
$table.triggerHandler( 'tablesorter-initialized', table );
|
$table.triggerHandler( 'tablesorter-initialized', table );
|
||||||
|
2
dist/js/jquery.tablesorter.min.js
vendored
2
dist/js/jquery.tablesorter.min.js
vendored
File diff suppressed because one or more lines are too long
15
dist/js/jquery.tablesorter.widgets.js
vendored
15
dist/js/jquery.tablesorter.widgets.js
vendored
@ -1,4 +1,4 @@
|
|||||||
/*! tablesorter (FORK) - updated 09-01-2016 (v2.27.6)*/
|
/*! tablesorter (FORK) - updated 09-23-2016 (v2.27.7)*/
|
||||||
/* 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 8/22/2016 (v2.27.5) *//*
|
/*! Widget: filter - updated 9/23/2016 (v2.27.7) *//*
|
||||||
* Requires tablesorter v2.8+ and jQuery 1.7+
|
* Requires tablesorter v2.8+ and jQuery 1.7+
|
||||||
* by Rob Garrison
|
* by Rob Garrison
|
||||||
*/
|
*/
|
||||||
@ -1209,9 +1209,9 @@
|
|||||||
// don't allow 'change' event to process if the input value is the same - fixes #685
|
// don't allow 'change' event to process if the input value is the same - fixes #685
|
||||||
if ( table.config.widgetOptions.filter_initialized &&
|
if ( table.config.widgetOptions.filter_initialized &&
|
||||||
( event.which === tskeyCodes.enter || event.type === 'search' ||
|
( event.which === tskeyCodes.enter || event.type === 'search' ||
|
||||||
( event.type === 'change' ) && this.value !== c.lastSearch[column] ) ||
|
( event.type === 'change' || event.type === 'input' ) &&
|
||||||
// only "input" event fires in MS Edge when clicking the "x" to clear the search
|
this.value !== c.lastSearch[column] )
|
||||||
( event.type === 'input' && this.value === '' ) ) {
|
) {
|
||||||
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() );
|
||||||
@ -1926,6 +1926,7 @@
|
|||||||
var cts, txt, indx, len, parsedTxt, str,
|
var cts, txt, indx, len, parsedTxt, str,
|
||||||
c = table.config,
|
c = table.config,
|
||||||
validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns,
|
validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns,
|
||||||
|
direction = validColumn ? c.$headerIndexed[ column ].hasClass( 'filter-select-sort-desc' ) : false,
|
||||||
parsed = [];
|
parsed = [];
|
||||||
// get unique elements and sort the list
|
// get unique elements and sort the list
|
||||||
// if $.tablesorter.sortText exists ( not in the original tablesorter ),
|
// if $.tablesorter.sortText exists ( not in the original tablesorter ),
|
||||||
@ -1966,8 +1967,8 @@
|
|||||||
// sort parsed select options
|
// sort parsed select options
|
||||||
cts = c.textSorter || '';
|
cts = c.textSorter || '';
|
||||||
parsed.sort( function( a, b ) {
|
parsed.sort( function( a, b ) {
|
||||||
var x = a.parsed,
|
var x = direction ? b.parsed : a.parsed,
|
||||||
y = b.parsed;
|
y = direction ? a.parsed : b.parsed;
|
||||||
if ( validColumn && typeof cts === 'function' ) {
|
if ( validColumn && typeof cts === 'function' ) {
|
||||||
// custom OVERALL text sorter
|
// custom OVERALL text sorter
|
||||||
return cts( x, y, true, column, table );
|
return cts( x, y, true, column, table );
|
||||||
|
6
dist/js/jquery.tablesorter.widgets.min.js
vendored
6
dist/js/jquery.tablesorter.widgets.min.js
vendored
File diff suppressed because one or more lines are too long
4
dist/js/widgets/widget-filter.min.js
vendored
4
dist/js/widgets/widget-filter.min.js
vendored
File diff suppressed because one or more lines are too long
4
dist/js/widgets/widget-mark.min.js
vendored
4
dist/js/widgets/widget-mark.min.js
vendored
@ -1,2 +1,2 @@
|
|||||||
/*! Widget: mark.js - updated 9/1/2016 (v2.27.6) */
|
/*! Widget: mark.js - updated 9/23/2016 (v2.27.7) */
|
||||||
!function(a){"use strict";var b=a.tablesorter;b.mark={init:function(c){if("function"==typeof a.fn.mark){var d,e=c.widgetOptions.mark_tsUpdate;c.$table.on("filterEnd.tsmark pagerComplete.tsmark"+(e?" "+e:""),function(a,d){b.mark.update(c,a.type===e?d:"")}),d="(?:<|=|>|\\||\"|\\'|\\s+(?:&&|-|"+(b.language.and||"and")+"|"+(b.language.or||"or")+"|"+(b.language.to||"to")+")\\s+)",b.mark.regex.filter=new RegExp(d,"gim")}else console.warn('Widget-mark not initialized: missing "jquery.mark.js"')},regex:{mark:/^mark_(.+)$/,pure:/^\/((?:\\\/|[^\/])+)\/([mig]{0,3})?$/},checkRegex:function(a){if(a instanceof RegExp){var b="".match(a);return null===b||b.length<5}return!1},cleanMatches:function(a){for(var b=[],c=a&&a.length||0;c--;)""!==a[c]&&(b[b.length]=a[c]);return b},ignoreColumns:function(b){for(var c=b.widgetOptions,d=b.columns,e=[];d--;)(c.mark_tsIgnore[d]||a(b.$headerIndexed[d]).hasClass("mark-ignore"))&&(e[e.length]=":nth-child("+(d+1)+")");return e.length?":not("+e.join(",")+")":""},update:function(c,d){var e={},f=c.widgetOptions,g="undefined"==typeof f.filter_ignoreCase||f.filter_ignoreCase,h=b.mark.regex,i=c.$table.find("tbody tr").unmark().not("."+(c.widgetOptions.filter_filteredRow||"filtered"));d=d||a.tablesorter.getFilters(c.$table),a.each(c.widgetOptions,function(a,b){var c=a.match(h.mark);c&&"undefined"!=typeof c[1]&&(e[c[1]]=b)}),a.each(d,function(d,j){if(j&&!a(c.$headerIndexed[d]).hasClass("mark-ignore")&&!f.mark_tsIgnore[d]){var k=null,l=j,m=!1,n=d===c.columns?b.mark.ignoreColumns(c):":nth-child("+(d+1)+")";if(h.pure.test(j)){l=h.pure.exec(j),".*"===l[1]&&(l[1]="");try{k=new RegExp(l[1],"gim"),l=new RegExp(l[1],l[2])}catch(a){l=null}return void(b.mark.checkRegex(k)&&i.children(n).markRegExp(l,e))}0===j.indexOf("~")?(m=!0,l=j.replace(/~/g,"").split("")):(j.indexOf("?")>-1&&(m=!0,j=j.replace(/\?/g,"\\S{1}")),j.indexOf("*")>-1&&(m=!0,j=j.replace(/\*/g,"\\S*")),l=j.split(h.filter)),m&&l&&l.length?(l=new RegExp(b.mark.cleanMatches(l).join(".*"),"gm"+(g?"i":"")),b.mark.checkRegex(l)&&i.children(n).markRegExp(l,e)):i.children(n).mark(b.mark.cleanMatches(l),e)}})}},b.addWidget({id:"mark",options:{mark_tsUpdate:"markUpdate",mark_tsIgnore:{}},init:function(a,c,d,e){b.mark.init(d,e)},remove:function(a,b){var c=b.widgetOptions.mark_tsUpdate;b.$table.off("filterEnd.tsmark pagerComplete.tsmark"+(c?" "+c:""))}})}(jQuery);
|
!function(a){"use strict";var b=a.tablesorter;b.mark={init:function(c){if("function"==typeof a.fn.mark){var d,e=c.widgetOptions.mark_tsUpdate;c.$table.on("filterEnd.tsmark pagerComplete.tsmark"+(e?" "+e:""),function(a,d){b.mark.update(c,a.type===e?d:"")}),d="(?:<|=|>|\\||\"|\\'|\\s+(?:&&|-|"+(b.language.and||"and")+"|"+(b.language.or||"or")+"|"+(b.language.to||"to")+")\\s+)",b.mark.regex.filter=new RegExp(d,"gim")}else console.warn('Widget-mark not initialized: missing "jquery.mark.js"')},regex:{mark:/^mark_(.+)$/,pure:/^\/((?:\\\/|[^\/])+)\/([mig]{0,3})?$/},checkRegex:function(a){if(a instanceof RegExp){var b="".match(a);return null===b||b.length<5}return!1},cleanMatches:function(a){for(var b=[],c=a&&a.length||0;c--;)""!==a[c]&&(b[b.length]=a[c]);return b},ignoreColumns:function(b){for(var c=b.widgetOptions,d=b.columns,e=[];d--;)(c.mark_tsIgnore[d]||a(b.$headerIndexed[d]).hasClass("mark-ignore"))&&(e[e.length]=":nth-child("+(d+1)+")");return e.length?":not("+e.join(",")+")":""},update:function(c,d){var e={},f=c.widgetOptions,g=b.mark.regex,h=c.$table.find("tbody tr").unmark().not("."+(c.widgetOptions.filter_filteredRow||"filtered"));d=d||a.tablesorter.getFilters(c.$table),a.each(c.widgetOptions,function(a,b){var c=a.match(g.mark);c&&"undefined"!=typeof c[1]&&(e[c[1]]=b)}),a.each(d,function(d,i){if(i&&!a(c.$headerIndexed[d]).hasClass("mark-ignore")&&!f.mark_tsIgnore[d]){var j=null,k=i,l=!1,m=d===c.columns?b.mark.ignoreColumns(c):":nth-child("+(d+1)+")";if(g.pure.test(i)){k=g.pure.exec(i),".*"===k[1]&&(k[1]="");try{j=new RegExp(k[1],"gim"),k=new RegExp(k[1],k[2])}catch(a){k=null}return void(b.mark.checkRegex(j)&&h.children(m).markRegExp(k,e))}0===i.indexOf("~")?(l=!0,k=i.replace(/~/g,"").split("")):(i.indexOf("?")>-1&&(l=!0,i=i.replace(/\?/g,"\\S{1}")),i.indexOf("*")>-1&&(l=!0,i=i.replace(/\*/g,"\\S*")),k=i.split(g.filter)),l&&k&&k.length?(k=new RegExp(b.mark.cleanMatches(k).join(".*"),"gm"),b.mark.checkRegex(k)&&h.children(m).markRegExp(k,e)):h.children(m).mark(b.mark.cleanMatches(k),e)}})}},b.addWidget({id:"mark",options:{mark_tsUpdate:"markUpdate",mark_tsIgnore:{}},init:function(a,c,d,e){b.mark.init(d,e)},remove:function(a,b){var c=b.widgetOptions.mark_tsUpdate;b.$table.off("filterEnd.tsmark pagerComplete.tsmark"+(c?" "+c:""))}})}(jQuery);
|
4
dist/js/widgets/widget-pager.min.js
vendored
4
dist/js/widgets/widget-pager.min.js
vendored
File diff suppressed because one or more lines are too long
4
dist/js/widgets/widget-repeatheaders.min.js
vendored
4
dist/js/widgets/widget-repeatheaders.min.js
vendored
@ -1,2 +1,2 @@
|
|||||||
/*! Widget: repeatHeaders - updated 2/7/2015 (v2.19.0) */
|
/*! Widget: repeatHeaders - updated 9/23/2016 (v2.27.7) */
|
||||||
!function(a){"use strict";a.tablesorter.addWidget({id:"repeatHeaders",priority:10,options:{rowsToSkip:4},format:function(b,c,d){var e,f,g,h,i="";if(!d.repeatHeaders){for(i='<tr class="repeated-header '+c.selectorRemove.slice(1)+'">',e=0;e<c.columns;e++)i+="<th>"+a.trim(c.$headers.eq(e).text())+"</th>";d.repeatHeaders=i+"</tr>"}for(h=d&&d.rowsToSkip||4,c.$table.find("tr.repeated-header").remove(),f=c.$tbodies.find("tr"),g=f.length,e=h;e<g;e+=h)f.eq(e).before(d.repeatHeaders)},remove:function(a,b,c){c.repeatHeaders="",b.$table.find("tr.repeated-header").remove()}})}(jQuery);
|
!function(a){"use strict";a.tablesorter.addWidget({id:"repeatHeaders",priority:10,options:{rowsToSkip:4},format:function(b,c,d){var e,f,g,h,i="";if(!d.repeatHeaders){for(i='<tr class="repeated-header '+c.selectorRemove.slice(1)+'">',e=0;e<c.columns;e++)i+="<th>"+a.trim(c.$headers.eq(e).html())+"</th>";d.repeatHeaders=i+"</tr>"}for(h=d&&d.rowsToSkip||4,c.$table.find("tr.repeated-header").remove(),f=c.$tbodies.find("tr"),g=f.length,e=h;e<g;e+=h)f.eq(e).before(d.repeatHeaders)},remove:function(a,b,c){c.repeatHeaders="",b.$table.find("tr.repeated-header").remove()}})}(jQuery);
|
@ -156,4 +156,4 @@
|
|||||||
"District": "Noord-Holland",
|
"District": "Noord-Holland",
|
||||||
"Population": 110722
|
"Population": 110722
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
|
@ -37,4 +37,4 @@
|
|||||||
<td>$13.19</td>
|
<td>$13.19</td>
|
||||||
<td>11%</td>
|
<td>11%</td>
|
||||||
<td>Jan 18, 2007 9:12 AM</td>
|
<td>Jan 18, 2007 9:12 AM</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -34,4 +34,4 @@
|
|||||||
"data-info": "This row likes turtles"
|
"data-info": "This row likes turtles"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -6,4 +6,4 @@ Down In It,Nine Inch Nails,$3.00
|
|||||||
Broken,Nine Inch Nails,$6.00
|
Broken,Nine Inch Nails,$6.00
|
||||||
Muse,Black Holes and Revelations,$7.00
|
Muse,Black Holes and Revelations,$7.00
|
||||||
Anon,"fake album, with comma", $1.00
|
Anon,"fake album, with comma", $1.00
|
||||||
Album,Artist,Price ($)
|
Album,Artist,Price ($)
|
||||||
|
@ -56,6 +56,8 @@
|
|||||||
// output string - default is '{page}/{totalPages}'
|
// output string - default is '{page}/{totalPages}'
|
||||||
// possible variables: {size}, {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows}
|
// possible variables: {size}, {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows}
|
||||||
// also {page:input} & {startRow:input} will add a modifiable input in place of the value
|
// also {page:input} & {startRow:input} will add a modifiable input in place of the value
|
||||||
|
// In v2.27.7, this can be set as a function
|
||||||
|
// output: function(table, pager) { return 'page ' + pager.startRow + ' - ' + pager.endRow; }
|
||||||
output: '{startRow:input} to {endRow} ({totalRows})',
|
output: '{startRow:input} to {endRow} ({totalRows})',
|
||||||
|
|
||||||
// apply disabled classname (cssDisabled option) to the pager arrows when the rows
|
// apply disabled classname (cssDisabled option) to the pager arrows when the rows
|
||||||
|
@ -639,6 +639,7 @@ $(function(){
|
|||||||
<li><code>filter-false</code> - disable the filter for a specific header column.</li>
|
<li><code>filter-false</code> - disable the filter for a specific header column.</li>
|
||||||
<li><code>filter-select</code> - build a default select box for a column (shows unique column content). See the <a href="example-widget-filter-custom.html">custom filter widget</a> demo for an example.</li>
|
<li><code>filter-select</code> - build a default select box for a column (shows unique column content). See the <a href="example-widget-filter-custom.html">custom filter widget</a> demo for an example.</li>
|
||||||
<li><code>filter-select-nosort</code> - when a default select box is built, this option prevents the sorting of select options leaving them in their original table order (<span class="version">v2.16.3</span>).</li>
|
<li><code>filter-select-nosort</code> - when a default select box is built, this option prevents the sorting of select options leaving them in their original table order (<span class="version">v2.16.3</span>).</li>
|
||||||
|
<li><code>filter-select-sort-desc</code> - when a default select box is built, it is automatically set to an ascending sort. Adding this class name will perform a descending sort on the values (<span class="version">v2.27.7</span>).</li>
|
||||||
<li><code>filter-match</code> - applies to "filter-select" columns and columns where the user can use the logical "or" search. Makes the filter/select match the column contents instead of exactly matching.</li>
|
<li><code>filter-match</code> - applies to "filter-select" columns and columns where the user can use the logical "or" search. Makes the filter/select match the column contents instead of exactly matching.</li>
|
||||||
<li><code>filter-parsed</code> - set a column to filter through parsed data instead of the actual table cell content.</li>
|
<li><code>filter-parsed</code> - set a column to filter through parsed data instead of the actual table cell content.</li>
|
||||||
<li><code>filter-onlyAvail</code>
|
<li><code>filter-onlyAvail</code>
|
||||||
|
@ -11,9 +11,11 @@
|
|||||||
<link class="ui-theme" rel="stylesheet" href="css/jquery-ui.min.css">
|
<link class="ui-theme" rel="stylesheet" href="css/jquery-ui.min.css">
|
||||||
<script src="js/jquery-ui.min.js"></script>
|
<script src="js/jquery-ui.min.js"></script>
|
||||||
<link rel="stylesheet" href="css/jq.css">
|
<link rel="stylesheet" href="css/jq.css">
|
||||||
|
<link href="css/tipsy.css" rel="stylesheet">
|
||||||
<link href="css/prettify.css" rel="stylesheet">
|
<link href="css/prettify.css" rel="stylesheet">
|
||||||
<script src="js/prettify.js"></script>
|
<script src="js/prettify.js"></script>
|
||||||
<script src="js/docs.js"></script>
|
<script src="js/docs.js"></script>
|
||||||
|
<script src="js/jquery.tipsy.min.js"></script>
|
||||||
|
|
||||||
<!-- Tablesorter: required -->
|
<!-- Tablesorter: required -->
|
||||||
<link rel="stylesheet" href="../css/theme.blue.css">
|
<link rel="stylesheet" href="../css/theme.blue.css">
|
||||||
@ -32,7 +34,7 @@ th.tablesorter-header.ignore, .ignore { background-color: #e6bf99; }
|
|||||||
<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>
|
||||||
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.0.0/jquery.mark.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.1.1/jquery.mark.js"></script>
|
||||||
<script src="../js/widgets/widget-mark.js"></script>
|
<script src="../js/widgets/widget-mark.js"></script>
|
||||||
|
|
||||||
<script id="js">$(function() {
|
<script id="js">$(function() {
|
||||||
@ -58,6 +60,7 @@ th.tablesorter-header.ignore, .ignore { background-color: #e6bf99; }
|
|||||||
},
|
},
|
||||||
// *** default settings for non-regular expression searches only
|
// *** default settings for non-regular expression searches only
|
||||||
mark_accuracy: 'partially',
|
mark_accuracy: 'partially',
|
||||||
|
mark_caseSensitive: false,
|
||||||
mark_diacritics: true,
|
mark_diacritics: true,
|
||||||
mark_separateWordSearch: true,
|
mark_separateWordSearch: true,
|
||||||
mark_synonyms: {},
|
mark_synonyms: {},
|
||||||
@ -83,10 +86,12 @@ th.tablesorter-header.ignore, .ignore { background-color: #e6bf99; }
|
|||||||
// preset searches for the first table
|
// preset searches for the first table
|
||||||
$('button[data-filter-column]').click(function(){
|
$('button[data-filter-column]').click(function(){
|
||||||
var filters = [],
|
var filters = [],
|
||||||
|
config = $table[0].config,
|
||||||
$t = $(this),
|
$t = $(this),
|
||||||
col = $t.data('filter-column'), // zero-based index, or "all" column
|
col = $t.data('filter-column'), // zero-based index, or "all" column
|
||||||
txt = $t.data('filter-text') || $t.text(); // text to add to filter
|
txt = $t.data('filter-text') || $t.text(); // text to add to filter
|
||||||
filters[col === "all" ? $table[0].config.columns : col] = txt;
|
filters[col === "all" ? config.columns : col] = txt;
|
||||||
|
config.widgetOptions.mark_caseSensitive = $t.data('mark-case') || false;
|
||||||
$.tablesorter.setFilters( $table, filters );
|
$.tablesorter.setFilters( $table, filters );
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
@ -113,22 +118,31 @@ th.tablesorter-header.ignore, .ignore { background-color: #e6bf99; }
|
|||||||
$('button.table2').click(function(){
|
$('button.table2').click(function(){
|
||||||
// check for reset
|
// check for reset
|
||||||
var query = $(this).hasClass('reset2') ? '' : this.textContent;
|
var query = $(this).hasClass('reset2') ? '' : this.textContent;
|
||||||
|
config = $table2[0].config;
|
||||||
|
config.widgetOptions.mark_caseSensitive = $(this).data('mark-case') || false;
|
||||||
$('#table2-search')
|
$('#table2-search')
|
||||||
.val(query)
|
.val(query)
|
||||||
.trigger('input');
|
.trigger('input');
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#table2-search').on('input', function() {
|
$('#table2-search').on('input', function(event) {
|
||||||
var config = $table2[0].config,
|
var config = $table2[0].config,
|
||||||
filters = [];
|
filters = [];
|
||||||
// still target the "any" match column
|
// still target the "any" match column
|
||||||
filters[config.columns] = this.value;
|
filters[config.columns] = this.value;
|
||||||
|
// if input was not triggered by a button click, reset caseSensitive
|
||||||
|
if (!event.isTrigger) {
|
||||||
|
config.widgetOptions.mark_caseSensitive = false;
|
||||||
|
}
|
||||||
// trigger a mark update
|
// trigger a mark update
|
||||||
$table2.trigger('markUpdate', [filters]);
|
$table2.trigger('markUpdate', [filters]);
|
||||||
// or call the function directly
|
// or call the function directly
|
||||||
// $.tablesorter.mark.update(config, filters);
|
// $.tablesorter.mark.update(config, filters);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// add tooltip
|
||||||
|
$('.tooltip').tipsy({ gravity: 's' });
|
||||||
|
|
||||||
});</script>
|
});</script>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
@ -148,6 +162,7 @@ th.tablesorter-header.ignore, .ignore { background-color: #e6bf99; }
|
|||||||
<h3 id="notes"><a href="#">Notes</a></h3>
|
<h3 id="notes"><a href="#">Notes</a></h3>
|
||||||
<div>
|
<div>
|
||||||
<ul>
|
<ul>
|
||||||
|
<li>Updated <span class="verison">v2.27.7</span>, removed internal case matching as mark.js v8.1.1 now has a <code>caseSensitive</code> option (set using <code>mark_caseSensitive</code> widget option).</li>
|
||||||
<li>Updated <span class="verison">v2.27.6</span>
|
<li>Updated <span class="verison">v2.27.6</span>
|
||||||
<ul>
|
<ul>
|
||||||
<li>The mark widget properly applies after a pager change has occured.</li>
|
<li>The mark widget properly applies after a pager change has occured.</li>
|
||||||
@ -285,6 +300,11 @@ $('button.update').click(function(){
|
|||||||
<td>"partially"</td>
|
<td>"partially"</td>
|
||||||
<td>Use "partially", "complementary", "exactly" or object - see markjs docs for details.</td>
|
<td>Use "partially", "complementary", "exactly" or object - see markjs docs for details.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr id="mark-casesensitive">
|
||||||
|
<td><span class="permalink">mark_caseSensitive</span></td>
|
||||||
|
<td>false</td>
|
||||||
|
<td>If <code>true</code>, only case sensitive marks are applied.</td>
|
||||||
|
</tr>
|
||||||
<tr id="mark-diacritics">
|
<tr id="mark-diacritics">
|
||||||
<td><span class="permalink">mark_diacritics</span></td>
|
<td><span class="permalink">mark_diacritics</span></td>
|
||||||
<td>true</td>
|
<td>true</td>
|
||||||
@ -362,8 +382,9 @@ $('button.update').click(function(){
|
|||||||
<button class="bad" type="button" data-filter-column="all" title="See "Notes" on why the second row isn't highlighted">~ee</button>
|
<button class="bad" type="button" data-filter-column="all" title="See "Notes" on why the second row isn't highlighted">~ee</button>
|
||||||
<button type="button" data-filter-column="all">br?n</button>
|
<button type="button" data-filter-column="all">br?n</button>
|
||||||
<button type="button" data-filter-column="all">br*n</button>
|
<button type="button" data-filter-column="all">br*n</button>
|
||||||
<button type="button" data-filter-column="all">aaron|bruce</button>
|
|
||||||
<button type="button" data-filter-column="all">aaron && 2</button>
|
<button type="button" data-filter-column="all">aaron && 2</button>
|
||||||
|
<button type="button" data-filter-column="all">aaron|bruce</button>
|
||||||
|
<button type="button" class="sens tooltip" title="Case Sensitive Mark" data-filter-column="all" data-mark-case="true">aaron|Bruce</button>
|
||||||
<table id="table" class="tablesorter">
|
<table id="table" class="tablesorter">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
@ -401,8 +422,9 @@ $('button.update').click(function(){
|
|||||||
<button class="table2 bad" type="button" title="See "Notes" on why the "005 Bruce Almighty" row isn't highlighted">~ee</button>
|
<button class="table2 bad" type="button" title="See "Notes" on why the "005 Bruce Almighty" row isn't highlighted">~ee</button>
|
||||||
<button class="table2" type="button">br?n</button>
|
<button class="table2" type="button">br?n</button>
|
||||||
<button class="table2" type="button">br*n</button>
|
<button class="table2" type="button">br*n</button>
|
||||||
<button class="table2" type="button">aaron|bruce</button>
|
|
||||||
<button class="table2" type="button">aaron && 2</button>
|
<button class="table2" type="button">aaron && 2</button>
|
||||||
|
<button class="table2" type="button">aaron|bruce</button>
|
||||||
|
<button class="table2 sens tooltip" type="button" title="Case Sensitive Mark" data-filter-column="all" data-mark-case="true">aaron|Bruce</button>
|
||||||
|
|
||||||
<table id="table2" class="tablesorter">
|
<table id="table2" class="tablesorter">
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -491,9 +491,9 @@
|
|||||||
<br><br>
|
<br><br>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<li>Pager plugin (<a href="example-pager.html">basic</a> & <a href="example-pager-ajax.html">ajax</a> demos; <span class="version updated">v2.27.3</span>).</li>
|
<li>Pager plugin (<a href="example-pager.html">basic</a> & <a href="example-pager-ajax.html">ajax</a> demos; <span class="version updated">v2.27.7</span>).</li>
|
||||||
<li>
|
<li>
|
||||||
Pager widget (<a href="example-widget-pager.html">basic</a> & <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>
|
Pager widget (<a href="example-widget-pager.html">basic</a> & <a href="example-widget-pager-ajax.html">ajax</a> demos) (<span class="version">v2.12</span>; <span class="version updated">v2.27.7</span>).<br>
|
||||||
<br>
|
<br>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@ -3314,8 +3314,12 @@ $('table').trigger('search', false);</pre></div>
|
|||||||
<li><span class="label warning">*NOTE*</span> because this example is providing a fixed select option source, it can not support "filter-onlyAvail" (only show available options after filtering).</li>
|
<li><span class="label warning">*NOTE*</span> because this example is providing a fixed select option source, it can not support "filter-onlyAvail" (only show available options after filtering).</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
In <span class="version updated">v2.21.5</span>, this option will now override the <code>filter_function</code> options (<em>so you need to add them back!</em>), allowing the addition of custom select options and still maintain basic filtering action - see <a href="http://jsfiddle.net/Mottie/856bzzeL/117/">this demo</a> (<a class="external" href="http://stackoverflow.com/a/29506523/145346">ref</a>).<br>
|
<p>
|
||||||
<br>
|
In <span class="version updated">v2.27.7</span>, an option to have a descending sort applied to this data can be done by adding a <code>"filter-select-sort-desc"</code> to the header cell. Adding a <code>"filter-select-nosort"</code> class name to a header to prevent sorting has been available since v2.16.3.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
In <span class="version updated">v2.21.5</span>, this option will now override the <code>filter_function</code> options (<em>so you need to add them back!</em>), allowing the addition of custom select options and still maintain basic filtering action - see <a href="http://jsfiddle.net/Mottie/856bzzeL/117/">this demo</a> (<a class="external" href="http://stackoverflow.com/a/29506523/145346">ref</a>).
|
||||||
|
</p>
|
||||||
In <span class="version updated">v2.17.0</span>, the <code>filter_selectSource</code> column can also be referenced by using a jQuery selector (e.g. class name or ID) that points to a table <em>header</em> cell.<br>
|
In <span class="version updated">v2.17.0</span>, the <code>filter_selectSource</code> column can also be referenced by using a jQuery selector (e.g. class name or ID) that points to a table <em>header</em> cell.<br>
|
||||||
<pre class="prettyprint lang-js">filter_selectSource : {
|
<pre class="prettyprint lang-js">filter_selectSource : {
|
||||||
".model-number" : [ "abc", "def", "ghi", "xyz" ]
|
".model-number" : [ "abc", "def", "ghi", "xyz" ]
|
||||||
@ -4507,11 +4511,15 @@ $('table').trigger('search', false);</pre></div>
|
|||||||
<td><a href="#" class="permalink">output</a></td>
|
<td><a href="#" class="permalink">output</a></td>
|
||||||
<td>String</td>
|
<td>String</td>
|
||||||
<td>"{page}/<wbr>{totalPages}"</td>
|
<td>"{page}/<wbr>{totalPages}"</td>
|
||||||
<td>This option allows you to format the output display which can show the current page, total pages, filtered pages, current start and end rows, total rows and filtered rows (v2.0.9; <span class="version">v2.17.6</span>).
|
<td>This option allows you to format the output display which can show the current page, total pages, filtered pages, current start and end rows, total rows and filtered rows (v2.0.9; <span class="version">v2.27.7</span>).
|
||||||
<div class="collapsible">
|
<div class="collapsible">
|
||||||
<br>
|
<br>
|
||||||
<span class="label label-info">Note</span> The pager widget equivalent option is within the <code>widgetOptions</code> and accessed via <code>widgetOptions.pager_output</code><br>
|
<span class="label label-info">Note</span> The pager widget equivalent option is within the <code>widgetOptions</code> and accessed via <code>widgetOptions.pager_output</code><br>
|
||||||
<br>
|
<br>
|
||||||
|
In <span class="version updated">v2.27.7</span>, this option can also be set as a function
|
||||||
|
<pre class="prettyprint lang-js">output: function(table, pager) {
|
||||||
|
return 'page ' + pager.startRow + ' - ' + pager.endRow;
|
||||||
|
}</pre>
|
||||||
This option replaced the original <code>separator</code> option, which only separated the page number from the total number of pages. The formatted output from this option is placed inside the information block targeted by the <code>cssPageDisplay</code> option.<br>
|
This option replaced the original <code>separator</code> option, which only separated the page number from the total number of pages. The formatted output from this option is placed inside the information block targeted by the <code>cssPageDisplay</code> option.<br>
|
||||||
<br>
|
<br>
|
||||||
Use it as follows:
|
Use it as follows:
|
||||||
@ -7711,6 +7719,7 @@ $('select.external').html( opts );</pre>
|
|||||||
The <code>column</code> parameter is optional, but if included it is used:
|
The <code>column</code> parameter is optional, but if included it is used:
|
||||||
<ul>
|
<ul>
|
||||||
<li>To check the column header for a <code>filter-select-nosort</code> class name to prevent the sorting of options.</li>
|
<li>To check the column header for a <code>filter-select-nosort</code> class name to prevent the sorting of options.</li>
|
||||||
|
<li>To check the column header for a <code>filter-select-sort-desc</code> class name to preform a descending sort of options.</li>
|
||||||
<li>To check tablesorter's <code>textSorter</code> option in case there are column specific sorting algorhithms set.</li>
|
<li>To check tablesorter's <code>textSorter</code> option in case there are column specific sorting algorhithms set.</li>
|
||||||
</ul>
|
</ul>
|
||||||
See the <a href="#function-getoptions"><code>getOptions</code></a> function description or the <a href="#widget-filter-selectsource"><code>filter_selectSource</code></a> option (under "An object containing column keys"; getJSON) for examples which use this function.
|
See the <a href="#function-getoptions"><code>getOptions</code></a> function description or the <a href="#widget-filter-selectsource"><code>filter_selectSource</code></a> option (under "An object containing column keys"; getJSON) for examples which use this function.
|
||||||
|
8
docs/js/jquery-latest.min.js
vendored
8
docs/js/jquery-latest.min.js
vendored
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
|||||||
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
||||||
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
||||||
*/
|
*/
|
||||||
/*! tablesorter (FORK) - updated 09-01-2016 (v2.27.6)*/
|
/*! tablesorter (FORK) - updated 09-23-2016 (v2.27.7)*/
|
||||||
/* 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.6 *//*
|
/*! TableSorter (FORK) v2.27.7 *//*
|
||||||
* 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.6',
|
version : '2.27.7',
|
||||||
|
|
||||||
parsers : [],
|
parsers : [],
|
||||||
widgets : [],
|
widgets : [],
|
||||||
@ -251,7 +251,7 @@
|
|||||||
// save the settings where they read
|
// save the settings where they read
|
||||||
$.data( table, 'tablesorter', c );
|
$.data( table, 'tablesorter', c );
|
||||||
if ( c.debug ) {
|
if ( c.debug ) {
|
||||||
console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter' );
|
console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter v' + ts.version );
|
||||||
$.data( table, 'startoveralltimer', new Date() );
|
$.data( table, 'startoveralltimer', new Date() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -353,7 +353,7 @@
|
|||||||
table.hasInitialized = true;
|
table.hasInitialized = true;
|
||||||
table.isProcessing = false;
|
table.isProcessing = false;
|
||||||
if ( c.debug ) {
|
if ( c.debug ) {
|
||||||
console.log( 'Overall initialization time: ' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
|
console.log( 'Overall initialization time:' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
|
||||||
if ( c.debug && console.groupEnd ) { console.groupEnd(); }
|
if ( c.debug && console.groupEnd ) { console.groupEnd(); }
|
||||||
}
|
}
|
||||||
$table.triggerHandler( 'tablesorter-initialized', table );
|
$table.triggerHandler( 'tablesorter-initialized', table );
|
||||||
@ -3137,7 +3137,7 @@
|
|||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
|
||||||
/*! Widget: filter - updated 8/22/2016 (v2.27.5) *//*
|
/*! Widget: filter - updated 9/23/2016 (v2.27.7) *//*
|
||||||
* Requires tablesorter v2.8+ and jQuery 1.7+
|
* Requires tablesorter v2.8+ and jQuery 1.7+
|
||||||
* by Rob Garrison
|
* by Rob Garrison
|
||||||
*/
|
*/
|
||||||
@ -3970,9 +3970,9 @@
|
|||||||
// don't allow 'change' event to process if the input value is the same - fixes #685
|
// don't allow 'change' event to process if the input value is the same - fixes #685
|
||||||
if ( table.config.widgetOptions.filter_initialized &&
|
if ( table.config.widgetOptions.filter_initialized &&
|
||||||
( event.which === tskeyCodes.enter || event.type === 'search' ||
|
( event.which === tskeyCodes.enter || event.type === 'search' ||
|
||||||
( event.type === 'change' ) && this.value !== c.lastSearch[column] ) ||
|
( event.type === 'change' || event.type === 'input' ) &&
|
||||||
// only "input" event fires in MS Edge when clicking the "x" to clear the search
|
this.value !== c.lastSearch[column] )
|
||||||
( event.type === 'input' && this.value === '' ) ) {
|
) {
|
||||||
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() );
|
||||||
@ -4687,6 +4687,7 @@
|
|||||||
var cts, txt, indx, len, parsedTxt, str,
|
var cts, txt, indx, len, parsedTxt, str,
|
||||||
c = table.config,
|
c = table.config,
|
||||||
validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns,
|
validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns,
|
||||||
|
direction = validColumn ? c.$headerIndexed[ column ].hasClass( 'filter-select-sort-desc' ) : false,
|
||||||
parsed = [];
|
parsed = [];
|
||||||
// get unique elements and sort the list
|
// get unique elements and sort the list
|
||||||
// if $.tablesorter.sortText exists ( not in the original tablesorter ),
|
// if $.tablesorter.sortText exists ( not in the original tablesorter ),
|
||||||
@ -4727,8 +4728,8 @@
|
|||||||
// sort parsed select options
|
// sort parsed select options
|
||||||
cts = c.textSorter || '';
|
cts = c.textSorter || '';
|
||||||
parsed.sort( function( a, b ) {
|
parsed.sort( function( a, b ) {
|
||||||
var x = a.parsed,
|
var x = direction ? b.parsed : a.parsed,
|
||||||
y = b.parsed;
|
y = direction ? a.parsed : b.parsed;
|
||||||
if ( validColumn && typeof cts === 'function' ) {
|
if ( validColumn && typeof cts === 'function' ) {
|
||||||
// custom OVERALL text sorter
|
// custom OVERALL text sorter
|
||||||
return cts( x, y, true, column, table );
|
return cts( x, y, true, column, table );
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*! TableSorter (FORK) v2.27.6 *//*
|
/*! TableSorter (FORK) v2.27.7 *//*
|
||||||
* 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.6',
|
version : '2.27.7',
|
||||||
|
|
||||||
parsers : [],
|
parsers : [],
|
||||||
widgets : [],
|
widgets : [],
|
||||||
@ -233,7 +233,7 @@
|
|||||||
// save the settings where they read
|
// save the settings where they read
|
||||||
$.data( table, 'tablesorter', c );
|
$.data( table, 'tablesorter', c );
|
||||||
if ( c.debug ) {
|
if ( c.debug ) {
|
||||||
console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter' );
|
console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter v' + ts.version );
|
||||||
$.data( table, 'startoveralltimer', new Date() );
|
$.data( table, 'startoveralltimer', new Date() );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -335,7 +335,7 @@
|
|||||||
table.hasInitialized = true;
|
table.hasInitialized = true;
|
||||||
table.isProcessing = false;
|
table.isProcessing = false;
|
||||||
if ( c.debug ) {
|
if ( c.debug ) {
|
||||||
console.log( 'Overall initialization time: ' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
|
console.log( 'Overall initialization time:' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
|
||||||
if ( c.debug && console.groupEnd ) { console.groupEnd(); }
|
if ( c.debug && console.groupEnd ) { console.groupEnd(); }
|
||||||
}
|
}
|
||||||
$table.triggerHandler( 'tablesorter-initialized', table );
|
$table.triggerHandler( 'tablesorter-initialized', table );
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
|
||||||
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
█████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
|
||||||
*/
|
*/
|
||||||
/*! tablesorter (FORK) - updated 09-01-2016 (v2.27.6)*/
|
/*! tablesorter (FORK) - updated 09-23-2016 (v2.27.7)*/
|
||||||
/* 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 8/22/2016 (v2.27.5) *//*
|
/*! Widget: filter - updated 9/23/2016 (v2.27.7) *//*
|
||||||
* Requires tablesorter v2.8+ and jQuery 1.7+
|
* Requires tablesorter v2.8+ and jQuery 1.7+
|
||||||
* by Rob Garrison
|
* by Rob Garrison
|
||||||
*/
|
*/
|
||||||
@ -1215,9 +1215,9 @@
|
|||||||
// don't allow 'change' event to process if the input value is the same - fixes #685
|
// don't allow 'change' event to process if the input value is the same - fixes #685
|
||||||
if ( table.config.widgetOptions.filter_initialized &&
|
if ( table.config.widgetOptions.filter_initialized &&
|
||||||
( event.which === tskeyCodes.enter || event.type === 'search' ||
|
( event.which === tskeyCodes.enter || event.type === 'search' ||
|
||||||
( event.type === 'change' ) && this.value !== c.lastSearch[column] ) ||
|
( event.type === 'change' || event.type === 'input' ) &&
|
||||||
// only "input" event fires in MS Edge when clicking the "x" to clear the search
|
this.value !== c.lastSearch[column] )
|
||||||
( event.type === 'input' && this.value === '' ) ) {
|
) {
|
||||||
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() );
|
||||||
@ -1932,6 +1932,7 @@
|
|||||||
var cts, txt, indx, len, parsedTxt, str,
|
var cts, txt, indx, len, parsedTxt, str,
|
||||||
c = table.config,
|
c = table.config,
|
||||||
validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns,
|
validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns,
|
||||||
|
direction = validColumn ? c.$headerIndexed[ column ].hasClass( 'filter-select-sort-desc' ) : false,
|
||||||
parsed = [];
|
parsed = [];
|
||||||
// get unique elements and sort the list
|
// get unique elements and sort the list
|
||||||
// if $.tablesorter.sortText exists ( not in the original tablesorter ),
|
// if $.tablesorter.sortText exists ( not in the original tablesorter ),
|
||||||
@ -1972,8 +1973,8 @@
|
|||||||
// sort parsed select options
|
// sort parsed select options
|
||||||
cts = c.textSorter || '';
|
cts = c.textSorter || '';
|
||||||
parsed.sort( function( a, b ) {
|
parsed.sort( function( a, b ) {
|
||||||
var x = a.parsed,
|
var x = direction ? b.parsed : a.parsed,
|
||||||
y = b.parsed;
|
y = direction ? a.parsed : b.parsed;
|
||||||
if ( validColumn && typeof cts === 'function' ) {
|
if ( validColumn && typeof cts === 'function' ) {
|
||||||
// custom OVERALL text sorter
|
// custom OVERALL text sorter
|
||||||
return cts( x, y, true, column, table );
|
return cts( x, y, true, column, table );
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*! Widget: filter - updated 8/22/2016 (v2.27.5) *//*
|
/*! Widget: filter - updated 9/23/2016 (v2.27.7) *//*
|
||||||
* Requires tablesorter v2.8+ and jQuery 1.7+
|
* Requires tablesorter v2.8+ and jQuery 1.7+
|
||||||
* by Rob Garrison
|
* by Rob Garrison
|
||||||
*/
|
*/
|
||||||
@ -831,9 +831,9 @@
|
|||||||
// don't allow 'change' event to process if the input value is the same - fixes #685
|
// don't allow 'change' event to process if the input value is the same - fixes #685
|
||||||
if ( table.config.widgetOptions.filter_initialized &&
|
if ( table.config.widgetOptions.filter_initialized &&
|
||||||
( event.which === tskeyCodes.enter || event.type === 'search' ||
|
( event.which === tskeyCodes.enter || event.type === 'search' ||
|
||||||
( event.type === 'change' ) && this.value !== c.lastSearch[column] ) ||
|
( event.type === 'change' || event.type === 'input' ) &&
|
||||||
// only "input" event fires in MS Edge when clicking the "x" to clear the search
|
this.value !== c.lastSearch[column] )
|
||||||
( event.type === 'input' && this.value === '' ) ) {
|
) {
|
||||||
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() );
|
||||||
@ -1548,6 +1548,7 @@
|
|||||||
var cts, txt, indx, len, parsedTxt, str,
|
var cts, txt, indx, len, parsedTxt, str,
|
||||||
c = table.config,
|
c = table.config,
|
||||||
validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns,
|
validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns,
|
||||||
|
direction = validColumn ? c.$headerIndexed[ column ].hasClass( 'filter-select-sort-desc' ) : false,
|
||||||
parsed = [];
|
parsed = [];
|
||||||
// get unique elements and sort the list
|
// get unique elements and sort the list
|
||||||
// if $.tablesorter.sortText exists ( not in the original tablesorter ),
|
// if $.tablesorter.sortText exists ( not in the original tablesorter ),
|
||||||
@ -1588,8 +1589,8 @@
|
|||||||
// sort parsed select options
|
// sort parsed select options
|
||||||
cts = c.textSorter || '';
|
cts = c.textSorter || '';
|
||||||
parsed.sort( function( a, b ) {
|
parsed.sort( function( a, b ) {
|
||||||
var x = a.parsed,
|
var x = direction ? b.parsed : a.parsed,
|
||||||
y = b.parsed;
|
y = direction ? a.parsed : b.parsed;
|
||||||
if ( validColumn && typeof cts === 'function' ) {
|
if ( validColumn && typeof cts === 'function' ) {
|
||||||
// custom OVERALL text sorter
|
// custom OVERALL text sorter
|
||||||
return cts( x, y, true, column, table );
|
return cts( x, y, true, column, table );
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*! Widget: mark.js - updated 9/1/2016 (v2.27.6) *//*
|
/*! Widget: mark.js - updated 9/23/2016 (v2.27.7) *//*
|
||||||
* Requires tablesorter v2.8+ and jQuery 1.7+
|
* Requires tablesorter v2.8+ and jQuery 1.7+
|
||||||
* by Rob Garrison
|
* by Rob Garrison
|
||||||
*/
|
*/
|
||||||
@ -70,8 +70,6 @@
|
|||||||
update : function( c, filters ) {
|
update : function( c, filters ) {
|
||||||
var options = {},
|
var options = {},
|
||||||
wo = c.widgetOptions,
|
wo = c.widgetOptions,
|
||||||
setIgnoreCase = typeof wo.filter_ignoreCase === 'undefined' ? true :
|
|
||||||
wo.filter_ignoreCase,
|
|
||||||
regex = ts.mark.regex,
|
regex = ts.mark.regex,
|
||||||
$rows = c.$table
|
$rows = c.$table
|
||||||
.find( 'tbody tr' )
|
.find( 'tbody tr' )
|
||||||
@ -139,7 +137,7 @@
|
|||||||
if ( useRegex && matches && matches.length ) {
|
if ( useRegex && matches && matches.length ) {
|
||||||
matches = new RegExp(
|
matches = new RegExp(
|
||||||
ts.mark.cleanMatches( matches ).join( '.*' ),
|
ts.mark.cleanMatches( matches ).join( '.*' ),
|
||||||
'gm' + ( setIgnoreCase ? 'i' : '' )
|
'gm'
|
||||||
);
|
);
|
||||||
if ( ts.mark.checkRegex( matches ) ) {
|
if ( ts.mark.checkRegex( matches ) ) {
|
||||||
$rows.children( col ).markRegExp( matches, options );
|
$rows.children( col ).markRegExp( matches, options );
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*! Widget: Pager - updated 8/17/2016 (v2.27.3) */
|
/*! Widget: Pager - updated 9/23/2016 (v2.27.7) */
|
||||||
/* Requires tablesorter v2.8+ and jQuery 1.7+
|
/* Requires tablesorter v2.8+ and jQuery 1.7+
|
||||||
* by Rob Garrison
|
* by Rob Garrison
|
||||||
*/
|
*/
|
||||||
@ -464,30 +464,36 @@
|
|||||||
p.startRow = t ? sz * p.page + 1 : ( p.filteredRows === 0 ? 0 : sz * p.page + 1 );
|
p.startRow = t ? sz * p.page + 1 : ( p.filteredRows === 0 ? 0 : sz * p.page + 1 );
|
||||||
p.endRow = Math.min( p.filteredRows, p.totalRows, sz * ( p.page + 1 ) );
|
p.endRow = Math.min( p.filteredRows, p.totalRows, sz * ( p.page + 1 ) );
|
||||||
$out = p.$container.find( wo.pager_selectors.pageDisplay );
|
$out = p.$container.find( wo.pager_selectors.pageDisplay );
|
||||||
// form the output string (can now get a new output string from the server)
|
|
||||||
s = ( p.ajaxData && p.ajaxData.output ? p.ajaxData.output || wo.pager_output : wo.pager_output )
|
// Output param can be callback for custom rendering or string
|
||||||
// {page} = one-based index; {page+#} = zero based index +/- value
|
if ( typeof wo.pager_output === 'function' ) {
|
||||||
.replace( /\{page([\-+]\d+)?\}/gi, function( m, n ) {
|
s = wo.pager_output( table, p );
|
||||||
return p.totalPages ? p.page + ( n ? parseInt( n, 10 ) : 1 ) : 0;
|
} else {
|
||||||
})
|
// form the output string (can now get a new output string from the server)
|
||||||
// {totalPages}, {extra}, {extra:0} (array) or {extra : key} (object)
|
s = ( p.ajaxData && p.ajaxData.output ? p.ajaxData.output || wo.pager_output : wo.pager_output )
|
||||||
.replace( /\{\w+(\s*:\s*\w+)?\}/gi, function( m ) {
|
// {page} = one-based index; {page+#} = zero based index +/- value
|
||||||
var len, indx,
|
.replace( /\{page([\-+]\d+)?\}/gi, function( m, n ) {
|
||||||
str = m.replace( /[{}\s]/g, '' ),
|
return p.totalPages ? p.page + ( n ? parseInt( n, 10 ) : 1 ) : 0;
|
||||||
extra = str.split( ':' ),
|
})
|
||||||
data = p.ajaxData,
|
// {totalPages}, {extra}, {extra:0} (array) or {extra : key} (object)
|
||||||
// return zero for default page/row numbers
|
.replace( /\{\w+(\s*:\s*\w+)?\}/gi, function( m ) {
|
||||||
deflt = /(rows?|pages?)$/i.test( str ) ? 0 : '';
|
var len, indx,
|
||||||
if ( /(startRow|page)/.test( extra[ 0 ] ) && extra[ 1 ] === 'input' ) {
|
str = m.replace( /[{}\s]/g, '' ),
|
||||||
len = ( '' + ( extra[ 0 ] === 'page' ? p.totalPages : p.totalRows ) ).length;
|
extra = str.split( ':' ),
|
||||||
indx = extra[ 0 ] === 'page' ? p.page + 1 : p.startRow;
|
data = p.ajaxData,
|
||||||
return '<input type="text" class="ts-' + extra[ 0 ] +
|
// return zero for default page/row numbers
|
||||||
'" style="max-width:' + len + 'em" value="' + indx + '"/>';
|
deflt = /(rows?|pages?)$/i.test( str ) ? 0 : '';
|
||||||
}
|
if ( /(startRow|page)/.test( extra[ 0 ] ) && extra[ 1 ] === 'input' ) {
|
||||||
return extra.length > 1 && data && data[ extra[ 0 ] ] ?
|
len = ( '' + ( extra[ 0 ] === 'page' ? p.totalPages : p.totalRows ) ).length;
|
||||||
data[ extra[ 0 ] ][ extra[ 1 ] ] :
|
indx = extra[ 0 ] === 'page' ? p.page + 1 : p.startRow;
|
||||||
p[ str ] || ( data ? data[ str ] : deflt ) || deflt;
|
return '<input type="text" class="ts-' + extra[ 0 ] +
|
||||||
});
|
'" style="max-width:' + len + 'em" value="' + indx + '"/>';
|
||||||
|
}
|
||||||
|
return extra.length > 1 && data && data[ extra[ 0 ] ] ?
|
||||||
|
data[ extra[ 0 ] ][ extra[ 1 ] ] :
|
||||||
|
p[ str ] || ( data ? data[ str ] : deflt ) || deflt;
|
||||||
|
});
|
||||||
|
}
|
||||||
if ( p.$goto.length ) {
|
if ( p.$goto.length ) {
|
||||||
t = '';
|
t = '';
|
||||||
options = tsp.buildPageSelect( c, p );
|
options = tsp.buildPageSelect( c, p );
|
||||||
@ -1199,7 +1205,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
enablePager: function( c, triggered ) {
|
enablePager: function( c, triggered ) {
|
||||||
var info, size,
|
var info, size, $el,
|
||||||
table = c.table,
|
table = c.table,
|
||||||
p = c.pager;
|
p = c.pager;
|
||||||
p.isDisabled = false;
|
p.isDisabled = false;
|
||||||
@ -1210,9 +1216,14 @@
|
|||||||
p.totalPages = p.size === 'all' ? 1 : Math.ceil( tsp.getTotalPages( c, p ) / p.size );
|
p.totalPages = p.size === 'all' ? 1 : Math.ceil( tsp.getTotalPages( c, p ) / p.size );
|
||||||
c.$table.removeClass( 'pagerDisabled' );
|
c.$table.removeClass( 'pagerDisabled' );
|
||||||
// if table id exists, include page display with aria info
|
// if table id exists, include page display with aria info
|
||||||
if ( table.id ) {
|
if ( table.id && !c.$table.attr( 'aria-describedby' ) ) {
|
||||||
info = table.id + '_pager_info';
|
$el = p.$container.find( c.widgetOptions.pager_selectors.pageDisplay );
|
||||||
p.$container.find( c.widgetOptions.pager_selectors.pageDisplay ).attr( 'id', info );
|
info = $el.attr( 'id' );
|
||||||
|
if ( !info ) {
|
||||||
|
// only add pageDisplay id if it doesn't exist - see #1288
|
||||||
|
info = table.id + '_pager_info';
|
||||||
|
$el.attr( 'id', info );
|
||||||
|
}
|
||||||
c.$table.attr( 'aria-describedby', info );
|
c.$table.attr( 'aria-describedby', info );
|
||||||
}
|
}
|
||||||
tsp.changeHeight( c );
|
tsp.changeHeight( c );
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
/*! Widget: repeatHeaders - updated 2/7/2015 (v2.19.0) *//*
|
/*! Widget: repeatHeaders - updated 9/23/2016 (v2.27.7) *//*
|
||||||
* Requires tablesorter v2.8+ and jQuery 1.7+
|
* Requires tablesorter v2.8+ and jQuery 1.7+
|
||||||
* Original by Christian Bach from the example-widgets.html demo
|
* Original by Christian Bach from the example-widgets.html demo
|
||||||
*/
|
*/
|
||||||
@ -19,8 +19,8 @@
|
|||||||
if (!wo.repeatHeaders) {
|
if (!wo.repeatHeaders) {
|
||||||
h = '<tr class="repeated-header ' + c.selectorRemove.slice(1) + '">';
|
h = '<tr class="repeated-header ' + c.selectorRemove.slice(1) + '">';
|
||||||
for (i = 0; i < c.columns; i++) {
|
for (i = 0; i < c.columns; i++) {
|
||||||
// only get the headerContent text
|
// repeat the content of the current header (including child elements)
|
||||||
h += '<th>' + $.trim( c.$headers.eq(i).text() ) + '</th>';
|
h += '<th>' + $.trim( c.$headers.eq(i).html() ) + '</th>';
|
||||||
}
|
}
|
||||||
// 'remove-me' class was added in case the table needs to be updated, the 'remove-me' rows will be
|
// 'remove-me' class was added in case the table needs to be updated, the 'remove-me' rows will be
|
||||||
// removed prior to the update to prevent including the rows in the update - see 'selectorRemove' option
|
// removed prior to the update to prevent including the rows in the update - see 'selectorRemove' option
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "tablesorter",
|
"name": "tablesorter",
|
||||||
"title": "tablesorter",
|
"title": "tablesorter",
|
||||||
"version": "2.27.6",
|
"version": "2.27.7",
|
||||||
"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",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "tablesorter",
|
"name": "tablesorter",
|
||||||
"title": "tablesorter",
|
"title": "tablesorter",
|
||||||
"version": "2.27.6",
|
"version": "2.27.7",
|
||||||
"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",
|
||||||
|
@ -162,7 +162,7 @@ jQuery(function($){
|
|||||||
undef, c1, c2, c3, c4, e, i, t;
|
undef, c1, c2, c3, c4, e, i, t;
|
||||||
|
|
||||||
$table1
|
$table1
|
||||||
.bind('tablesorter-initialized', function(){
|
.on('tablesorter-initialized', function(){
|
||||||
init = true;
|
init = true;
|
||||||
})
|
})
|
||||||
.tablesorter();
|
.tablesorter();
|
||||||
@ -727,7 +727,7 @@ jQuery(function($){
|
|||||||
QUnit.test( 'sort Events', function(assert) {
|
QUnit.test( 'sort Events', function(assert) {
|
||||||
assert.expect(1);
|
assert.expect(1);
|
||||||
|
|
||||||
$table1.add($table5).bind( events.join('.testing '), function(e){
|
$table1.add($table5).on( events.join('.testing '), function(e){
|
||||||
if (e.type === events[sortIndx%3]) {
|
if (e.type === events[sortIndx%3]) {
|
||||||
sortIndx++;
|
sortIndx++;
|
||||||
}
|
}
|
||||||
@ -739,7 +739,7 @@ jQuery(function($){
|
|||||||
// ensure all sort events fire on an empty table
|
// ensure all sort events fire on an empty table
|
||||||
$table5.trigger('sorton', [ [[0,0]] ]);
|
$table5.trigger('sorton', [ [[0,0]] ]);
|
||||||
|
|
||||||
$table1.add($table5).unbind( events.join('.testing ') );
|
$table1.add($table5).off( events.join('.testing ') );
|
||||||
|
|
||||||
// table1 sorted twice in the above test; sortIndx = 9 then empty table5 x1 (total = 3 events x 3)
|
// table1 sorted twice in the above test; sortIndx = 9 then empty table5 x1 (total = 3 events x 3)
|
||||||
assert.equal( sortIndx, 9, 'sortStart, sortBegin & sortEnd fired in order x2; including empty table' );
|
assert.equal( sortIndx, 9, 'sortStart, sortBegin & sortEnd fired in order x2; including empty table' );
|
||||||
@ -755,7 +755,7 @@ jQuery(function($){
|
|||||||
// updateAll
|
// updateAll
|
||||||
$table1
|
$table1
|
||||||
.trigger('sorton', [ [[0,1]] ])
|
.trigger('sorton', [ [[0,1]] ])
|
||||||
.bind('updateComplete.testing', function(){ updateIndx++; })
|
.on('updateComplete.testing', function(){ updateIndx++; })
|
||||||
.find('th:eq(1)').removeAttr('class').html('num').end()
|
.find('th:eq(1)').removeAttr('class').html('num').end()
|
||||||
.find('td:nth-child(2)').html(function(i,h){
|
.find('td:nth-child(2)').html(function(i,h){
|
||||||
return h.substring(1);
|
return h.substring(1);
|
||||||
@ -832,13 +832,13 @@ jQuery(function($){
|
|||||||
}]);
|
}]);
|
||||||
|
|
||||||
$table5
|
$table5
|
||||||
.bind('updateComplete.testing', function(){ updateIndx++; })
|
.on('updateComplete.testing', function(){ updateIndx++; })
|
||||||
.trigger('update', [true, function(){
|
.trigger('update', [true, function(){
|
||||||
updateCallback++;
|
updateCallback++;
|
||||||
assert.cacheCompare( table5, 'all', [], 'update method on empty table' );
|
assert.cacheCompare( table5, 'all', [], 'update method on empty table' );
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
$table1.add($table5).unbind('updateComplete.testing');
|
$table1.add($table5).off('updateComplete.testing');
|
||||||
|
|
||||||
// table1 updated 4x in the above test
|
// table1 updated 4x in the above test
|
||||||
// table5 updated 1x
|
// table5 updated 1x
|
||||||
|
Loading…
Reference in New Issue
Block a user