Merge branch 'master' into gh-pages

This commit is contained in:
Rob Garrison 2018-03-18 09:39:55 -05:00
commit caf82cd349
171 changed files with 1600 additions and 1416 deletions

5
.eslintignore Normal file
View File

@ -0,0 +1,5 @@
_test*.js
*.min.js
*mod.js
*.metadata.js
semver.js

31
.eslintrc Normal file
View File

@ -0,0 +1,31 @@
{
"env": {
"browser": true,
"jquery": true
},
"rules": {
"curly": 1,
"dot-location": [2, "property"],
"eqeqeq": 1,
"linebreak-style": [2, "unix"],
"no-else-return": 0,
"no-eval": 2,
"no-octal": 2,
"no-with": 2,
"radix": 2,
"brace-style": 0,
"camelcase": 0,
"indent": 0,
"no-array-constructor": 2,
"quotes": [2, "single", {
"allowTemplateLiterals": true,
"avoidEscape": true
}],
"spaced-comment": 0,
"space-before-blocks": 1,
"keyword-spacing": 1,
"arrow-spacing": 2,
"no-var": 0,
"no-unused-vars": 1
}
}

View File

@ -4,8 +4,6 @@ module.exports = function( grunt ) {
var pkg = grunt.file.readJSON( 'package.json' ), var pkg = grunt.file.readJSON( 'package.json' ),
tasks, tasks,
widgetFilePrefix,
widgetFileSuffix,
defaults = { defaults = {
dependencies : { dependencies : {
@ -428,7 +426,7 @@ module.exports = function( grunt ) {
}); });
function escapeRegExp(str) { function escapeRegExp(str) {
return str.replace(/[$()*+\-.\/?[\\\]^{|}]/g, "\\$&"); return str.replace(/[$()*+\-.\/?[\\\]^{|}]/g, '\\$&');
} }
// update tablesorter.jquery.json file version numbers to match the package.json version // update tablesorter.jquery.json file version numbers to match the package.json version

View File

@ -104,6 +104,23 @@ 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.30.0">Version 2.30.0</a> (2018-03-18)
* Core:
* [Debug](https://mottie.github.io/tablesorter/docs/#debug) now allows you to debug components separately; set to `true` as usual, or set to `'core filter'` to only show the core and filter widget debug logs.
* Change pager `removeRows` check. Fixes issues [#1525](https://github.com/Mottie/tablesorter/issues/1525) &amp; [#1466](https://github.com/Mottie/tablesorter/issues/1466).
* Filter:
* Make `onlyAvail` work with showProcessing. Fixes [issue #1518](https://github.com/Mottie/tablesorter/issues/1518).
* Escape quotes in select options. See [issue #1527](https://github.com/Mottie/tablesorter/issues/1527).
* Pager:
* Change pager `removeRows` check. Fixes issues [#1525](https://github.com/Mottie/tablesorter/issues/1525) &amp; [#1466](https://github.com/Mottie/tablesorter/issues/1466).
* Global:
* Add editor eslint &amp; fix issues. File versions were not updated for this change!
* Docs:
* Update Bootstrap v4.0.0.
* Adjust (accordion) link position.
* Fix scroller fixed column border alignment.
#### <a name="v2.29.6">Version 2.29.6</a> (2018-02-25) #### <a name="v2.29.6">Version 2.29.6</a> (2018-02-25)
* Docs: * Docs:
@ -129,14 +146,3 @@ View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/C
* Fix version numbering. * Fix version numbering.
* Parser: * Parser:
* Add radio parser. See [issue #1502](https://github.com/Mottie/tablesorter/issues/1502). * Add radio parser. See [issue #1502](https://github.com/Mottie/tablesorter/issues/1502).
#### <a name="v2.29.4">Version 2.29.4</a> (2018-01-18)
* Docs:
* Downgrade Bootstrap JS (v3.3.7) in demos.
* Filter:
* Add `filter_filterLabel` to support filter input ARIA labels. See [issue #1495](https://github.com/Mottie/tablesorter/issues/1495).
* Change filter row role from "row" to "search".
* Fix select2 issue. Closes [issue #1497](https://github.com/Mottie/tablesorter/issues/1497).
* Meta:
* Change date format in file comments to "YYYY-MM-DD".

View File

@ -1,6 +1,6 @@
/*! /*!
* tablesorter (FORK) pager plugin * tablesorter (FORK) pager plugin
* updated 4/18/2017 (v2.28.8) * updated 2018-03-18 (v2.30.0)
*/ */
/*jshint browser:true, jquery:true, unused:false */ /*jshint browser:true, jquery:true, unused:false */
;(function($) { ;(function($) {
@ -27,7 +27,7 @@
customAjaxUrl: function(table, url) { return url; }, customAjaxUrl: function(table, url) { return url; },
// ajax error callback from $.tablesorter.showError function // ajax error callback from $.tablesorter.showError function
// ajaxError: function( config, xhr, settings, exception ){ return exception; }; // ajaxError: function( config, xhr, settings, exception ) { return exception; };
// returning false will abort the error message // returning false will abort the error message
ajaxError: null, ajaxError: null,
@ -52,7 +52,7 @@
// ], // ],
// [ "header1", "header2", ... "headerN" ] // optional // [ "header1", "header2", ... "headerN" ] // optional
// ] // ]
ajaxProcessing: function(ajax){ return [ 0, [], null ]; }, ajaxProcessing: function( /* ajax */ ) { return [ 0, [], null ]; },
// output default: '{page}/{totalPages}' // output default: '{page}/{totalPages}'
// possible variables: {size}, {page}, {totalPages}, {filteredPages}, {startRow}, // possible variables: {size}, {page}, {totalPages}, {filteredPages}, {startRow},
@ -139,12 +139,12 @@
if ( p.updateArrows ) { if ( p.updateArrows ) {
tmp = p.$container.find(p.cssFirst + ',' + p.cssPrev); tmp = p.$container.find(p.cssFirst + ',' + p.cssPrev);
tmp[ first ? a : r ](d); // toggle disabled class tmp[ first ? a : r ](d); // toggle disabled class
tmp.each(function(){ tmp.each(function() {
this.ariaDisabled = first; this.ariaDisabled = first;
}); });
tmp = p.$container.find(p.cssNext + ',' + p.cssLast); tmp = p.$container.find(p.cssNext + ',' + p.cssLast);
tmp[ last ? a : r ](d); tmp[ last ? a : r ](d);
tmp.each(function(){ tmp.each(function() {
this.ariaDisabled = last; this.ariaDisabled = last;
}); });
} }
@ -203,11 +203,11 @@
// form the output string (can now get a new output string from the server) // form the output string (can now get a new output string from the server)
s = ( p.ajaxData && p.ajaxData.output ? p.ajaxData.output || output : output ) s = ( p.ajaxData && p.ajaxData.output ? p.ajaxData.output || output : output )
// {page} = one-based index; {page+#} = zero based index +/- value // {page} = one-based index; {page+#} = zero based index +/- value
.replace(/\{page([\-+]\d+)?\}/gi, function(m, n){ .replace(/\{page([\-+]\d+)?\}/gi, function(m, n) {
return p.totalPages ? p.page + (n ? parseInt(n, 10) : 1) : 0; return p.totalPages ? p.page + (n ? parseInt(n, 10) : 1) : 0;
}) })
// {totalPages}, {extra}, {extra:0} (array) or {extra : key} (object) // {totalPages}, {extra}, {extra:0} (array) or {extra : key} (object)
.replace(/\{\w+(\s*:\s*\w+)?\}/gi, function(m){ .replace(/\{\w+(\s*:\s*\w+)?\}/gi, function(m) {
var len, indx, var len, indx,
str = m.replace(/[{}\s]/g, ''), str = m.replace(/[{}\s]/g, ''),
extra = str.split(':'), extra = str.split(':'),
@ -236,7 +236,7 @@
if ($out.length) { if ($out.length) {
$out[ ($out[0].nodeName === 'INPUT') ? 'val' : 'html' ](s); $out[ ($out[0].nodeName === 'INPUT') ? 'val' : 'html' ](s);
// rebind startRow/page inputs // rebind startRow/page inputs
$out.find('.ts-startRow, .ts-page').unbind('change' + namespace).bind('change' + namespace, function(){ $out.find('.ts-startRow, .ts-page').unbind('change' + namespace).bind('change' + namespace, function() {
var v = $(this).val(), var v = $(this).val(),
pg = $(this).hasClass('ts-startRow') ? Math.floor( v / sz ) + 1 : v; pg = $(this).hasClass('ts-startRow') ? Math.floor( v / sz ) + 1 : v;
c.$table.triggerHandler('pageSet' + namespace, [ pg ]); c.$table.triggerHandler('pageSet' + namespace, [ pg ]);
@ -246,8 +246,8 @@
pagerArrows( table, p ); pagerArrows( table, p );
fixHeight(table, p); fixHeight(table, p);
if (p.initialized && completed !== false) { if (p.initialized && completed !== false) {
if (c.debug) { if (ts.debug(c, 'pager')) {
console.log('Pager: Triggering pagerComplete'); console.log('Pager >> Triggering pagerComplete');
} }
c.$table.triggerHandler('pagerComplete', p); c.$table.triggerHandler('pagerComplete', p);
// save pager info to storage // save pager info to storage
@ -357,7 +357,7 @@
$.data(table, 'pagerLastSize', p.size); $.data(table, 'pagerLastSize', p.size);
}, },
hideRows = function(table, p){ hideRows = function(table, p) {
if (!p.ajaxUrl) { if (!p.ajaxUrl) {
var i, var i,
lastIndex = 0, lastIndex = 0,
@ -370,7 +370,7 @@
last = 0, // for cache indexing last = 0, // for cache indexing
j = 0; // size counter j = 0; // size counter
p.cacheIndex = []; p.cacheIndex = [];
for ( i = 0; i < l; i++ ){ for ( i = 0; i < l; i++ ) {
if ( !p.regexFiltered.test(rows[i].className) ) { if ( !p.regexFiltered.test(rows[i].className) ) {
if (j === s && rows[i].className.match(c.cssChildRow)) { if (j === s && rows[i].className.match(c.cssChildRow)) {
// hide child rows @ start of pager (if already visible) // hide child rows @ start of pager (if already visible)
@ -398,19 +398,19 @@
} }
}, },
hideRowsSetup = function(table, p){ hideRowsSetup = function(table, p) {
p.size = parsePageSize( p, p.$container.find(p.cssPageSize).val(), 'get' ); p.size = parsePageSize( p, p.$container.find(p.cssPageSize).val(), 'get' );
setPageSize( table, p.size, p ); setPageSize( table, p.size, p );
pagerArrows( table, p ); pagerArrows( table, p );
if ( !p.removeRows ) { if ( !p.removeRows ) {
hideRows(table, p); hideRows(table, p);
$(table).bind('sortEnd filterEnd '.split(' ').join(table.config.namespace + 'pager '), function(){ $(table).bind('sortEnd filterEnd '.split(' ').join(table.config.namespace + 'pager '), function() {
hideRows(table, p); hideRows(table, p);
}); });
} }
}, },
renderAjax = function(data, table, p, xhr, settings, exception){ renderAjax = function(data, table, p, xhr, settings, exception) {
// process data // process data
if ( typeof p.ajaxProcessing === 'function' ) { if ( typeof p.ajaxProcessing === 'function' ) {
@ -424,15 +424,13 @@
c = table.config, c = table.config,
$table = c.$table, $table = c.$table,
tds = '', tds = '',
result = p.ajaxProcessing(data, table, xhr) || [ 0, [] ], result = p.ajaxProcessing(data, table, xhr) || [ 0, [] ];
hl = $table.find('thead th').length;
// Clean up any previous error. // Clean up any previous error.
ts.showError( table ); ts.showError( table );
if ( exception ) { if ( exception ) {
if (c.debug) { if (ts.debug(c, 'pager')) {
console.error('Pager: >> Ajax Error', xhr, settings, exception); console.error('Pager >> Ajax Error', xhr, settings, exception);
} }
ts.showError( table, xhr, settings, exception ); ts.showError( table, xhr, settings, exception );
c.$tbodies.eq(0).children('tr').detach(); c.$tbodies.eq(0).children('tr').detach();
@ -524,13 +522,13 @@
p.last.sortList = (c.sortList || []).join(','); p.last.sortList = (c.sortList || []).join(',');
updatePageDisplay(table, p, false); updatePageDisplay(table, p, false);
// tablesorter core updateCache (not pager) // tablesorter core updateCache (not pager)
ts.updateCache( c, function(){ ts.updateCache( c, function() {
if (p.initialized) { if (p.initialized) {
// apply widgets after table has rendered & after a delay to prevent // apply widgets after table has rendered & after a delay to prevent
// multiple applyWidget blocking code from blocking this trigger // multiple applyWidget blocking code from blocking this trigger
setTimeout(function(){ setTimeout(function() {
if (c.debug) { if (ts.debug(c, 'pager')) {
console.log('Pager: Triggering pagerChange'); console.log('Pager >> Triggering pagerChange');
} }
$table.triggerHandler( 'pagerChange', p ); $table.triggerHandler( 'pagerChange', p );
ts.applyWidget( table ); ts.applyWidget( table );
@ -566,7 +564,7 @@
p.ajaxObject.url = url; // from the ajaxUrl option and modified by customAjaxUrl p.ajaxObject.url = url; // from the ajaxUrl option and modified by customAjaxUrl
p.ajaxObject.success = function(data, status, jqxhr) { p.ajaxObject.success = function(data, status, jqxhr) {
// Refuse to process old ajax commands that were overwritten by new ones - see #443 // Refuse to process old ajax commands that were overwritten by new ones - see #443
if (counter < p.ajaxCounter){ if (counter < p.ajaxCounter) {
return; return;
} }
renderAjax(data, table, p, jqxhr); renderAjax(data, table, p, jqxhr);
@ -575,8 +573,8 @@
p.oldAjaxSuccess(data); p.oldAjaxSuccess(data);
} }
}; };
if (c.debug) { if (ts.debug(c, 'pager')) {
console.log('Pager: Ajax initialized', p.ajaxObject); console.log('Pager >> Ajax initialized', p.ajaxObject);
} }
$.ajax(p.ajaxObject); $.ajax(p.ajaxObject);
} }
@ -587,7 +585,7 @@
c = table.config, c = table.config,
url = (p.ajaxUrl) ? p.ajaxUrl url = (p.ajaxUrl) ? p.ajaxUrl
// allow using "{page+1}" in the url string to switch to a non-zero based index // allow using "{page+1}" in the url string to switch to a non-zero based index
.replace(/\{page([\-+]\d+)?\}/, function(s, n){ return p.page + (n ? parseInt(n, 10) : 0); }) .replace(/\{page([\-+]\d+)?\}/, function(s, n) { return p.page + (n ? parseInt(n, 10) : 0); })
// this will pass "all" to server when size is set to "all" // this will pass "all" to server when size is set to "all"
.replace(/\{size\}/g, p.size) : '', .replace(/\{size\}/g, p.size) : '',
sortList = c.sortList, sortList = c.sortList,
@ -620,8 +618,8 @@
if ( typeof p.customAjaxUrl === 'function' ) { if ( typeof p.customAjaxUrl === 'function' ) {
url = p.customAjaxUrl(table, url); url = p.customAjaxUrl(table, url);
} }
if (c.debug) { if (ts.debug(c, 'pager')) {
console.log('Pager: Ajax url = ' + url); console.log('Pager >> Ajax url = ' + url);
} }
return url; return url;
}, },
@ -630,13 +628,14 @@
var $tb, index, count, added, var $tb, index, count, added,
$t = $(table), $t = $(table),
c = table.config, c = table.config,
debug = ts.debug(c, 'pager'),
f = c.$table.hasClass('hasFilters'), f = c.$table.hasClass('hasFilters'),
l = rows && rows.length || 0, // rows may be undefined l = rows && rows.length || 0, // rows may be undefined
e = p.size === 'all' ? p.totalRows : p.size, e = p.size === 'all' ? p.totalRows : p.size,
s = ( p.page * e ); s = ( p.page * e );
if ( l < 1 ) { if ( l < 1 ) {
if (c.debug) { if (debug) {
console.warn('Pager: >> No rows for pager to render'); console.warn('Pager >> No rows for pager to render');
} }
// empty table, abort! // empty table, abort!
return; return;
@ -648,8 +647,8 @@
p.cacheIndex = []; p.cacheIndex = [];
p.isDisabled = false; // needed because sorting will change the page and re-enable the pager p.isDisabled = false; // needed because sorting will change the page and re-enable the pager
if (p.initialized) { if (p.initialized) {
if (c.debug) { if (debug) {
console.log('Pager: Triggering pagerChange'); console.log('Pager >> Triggering pagerChange');
} }
$t.triggerHandler( 'pagerChange', p ); $t.triggerHandler( 'pagerChange', p );
} }
@ -664,7 +663,7 @@
count = f ? 0 : s; count = f ? 0 : s;
added = 0; added = 0;
while (added < e && index < rows.length) { while (added < e && index < rows.length) {
if (!f || !p.regexFiltered.test(rows[index][0].className)){ if (!f || !p.regexFiltered.test(rows[index][0].className)) {
count++; count++;
if (count > s && added <= e) { if (count > s && added <= e) {
added++; added++;
@ -678,8 +677,8 @@
} }
updatePageDisplay(table, p); updatePageDisplay(table, p);
if (table.isUpdating) { if (table.isUpdating) {
if (c.debug) { if (debug) {
console.log('Pager: Triggering updateComplete'); console.log('Pager >> Triggering updateComplete');
} }
$t.triggerHandler('updateComplete', [ table, true ]); $t.triggerHandler('updateComplete', [ table, true ]);
} }
@ -702,8 +701,8 @@
renderTable(table, table.config.rowsCopy, p); renderTable(table, table.config.rowsCopy, p);
p.isDisabled = true; p.isDisabled = true;
ts.applyWidget( table ); ts.applyWidget( table );
if (table.config.debug) { if (ts.debug(table.config, 'pager')) {
console.log('Pager: Disabled'); console.log('Pager >> Disabled');
} }
} }
// disable size selector // disable size selector
@ -720,7 +719,7 @@
var c = table.config, var c = table.config,
p = c.pager; p = c.pager;
// tablesorter core updateCache (not pager) // tablesorter core updateCache (not pager)
ts.updateCache( c, function(){ ts.updateCache( c, function() {
var i, var i,
rows = [], rows = [],
n = table.config.cache[0].normalized; n = table.config.cache[0].normalized;
@ -736,9 +735,10 @@
moveToPage = function(table, p, pageMoved) { moveToPage = function(table, p, pageMoved) {
if ( p.isDisabled ) { return; } if ( p.isDisabled ) { return; }
var tmp, var tmp,
c = table.config, c = table.config,
$t = $(table), debug = ts.debug(c, 'pager'),
l = p.last; $t = $(table),
l = p.last;
if ( pageMoved !== false && p.initialized && ts.isEmptyObject(c.cache)) { if ( pageMoved !== false && p.initialized && ts.isEmptyObject(c.cache)) {
return updateCache(table); return updateCache(table);
} }
@ -758,8 +758,8 @@
// & ajax url option changes (dynamically add/remove/rename sort & filter parameters) // & ajax url option changes (dynamically add/remove/rename sort & filter parameters)
(l.optAjaxUrl || '') === (p.ajaxUrl || '') && (l.optAjaxUrl || '') === (p.ajaxUrl || '') &&
l.sortList === (c.sortList || []).join(',') ) { return; } l.sortList === (c.sortList || []).join(',') ) { return; }
if (c.debug) { if (debug) {
console.log('Pager: Changing to page ' + p.page); console.log('Pager >> Changing to page ' + p.page);
} }
p.last = { p.last = {
page : p.page, page : p.page,
@ -776,9 +776,9 @@
p.processAjaxOnInit = true; p.processAjaxOnInit = true;
tmp = p.initialRows; tmp = p.initialRows;
p.totalRows = typeof tmp.total !== 'undefined' ? tmp.total : p.totalRows = typeof tmp.total !== 'undefined' ? tmp.total :
( c.debug ? console.error('Pager: no initial total page set!') || 0 : 0 ); ( debug ? console.error('Pager >> No initial total page set!') || 0 : 0 );
p.filteredRows = typeof tmp.filtered !== 'undefined' ? tmp.filtered : p.filteredRows = typeof tmp.filtered !== 'undefined' ? tmp.filtered :
( c.debug ? console.error('Pager: no initial filtered page set!') || 0 : 0 ); ( debug ? console.error('Pager >> No initial filtered page set!') || 0 : 0 );
pagerInitialized( table, p ); pagerInitialized( table, p );
} else { } else {
getAjax(table, p); getAjax(table, p);
@ -788,14 +788,14 @@
} }
$.data(table, 'pagerLastPage', p.page); $.data(table, 'pagerLastPage', p.page);
if (p.initialized && pageMoved !== false) { if (p.initialized && pageMoved !== false) {
if (c.debug) { if (debug) {
console.log('Pager: Triggering pageMoved'); console.log('Pager >> Triggering pageMoved');
} }
$t.triggerHandler('pageMoved', p); $t.triggerHandler('pageMoved', p);
ts.applyWidget( table ); ts.applyWidget( table );
if (table.isUpdating) { if (table.isUpdating) {
if (c.debug) { if (debug) {
console.log('Pager: Triggering updateComplete'); console.log('Pager >> Triggering updateComplete');
} }
$t.triggerHandler('updateComplete', [ table, true ]); $t.triggerHandler('updateComplete', [ table, true ]);
} }
@ -868,8 +868,8 @@
pagerInitialized = function(table, p) { pagerInitialized = function(table, p) {
p.initialized = true; p.initialized = true;
p.initializing = false; p.initializing = false;
if (table.config.debug) { if (ts.debug(table.config, 'pager')) {
console.log('Pager: Triggering pagerInitialized'); console.log('Pager >> Triggering pagerInitialized');
} }
$(table).triggerHandler( 'pagerInitialized', p ); $(table).triggerHandler( 'pagerInitialized', p );
ts.applyWidget( table ); ts.applyWidget( table );
@ -908,7 +908,7 @@
p.$container.find(p.cssGoto + ',' + p.cssPageSize + ',.ts-startRow, .ts-page') p.$container.find(p.cssGoto + ',' + p.cssPageSize + ',.ts-startRow, .ts-page')
.removeClass(p.cssDisabled) .removeClass(p.cssDisabled)
.removeAttr('disabled') .removeAttr('disabled')
.each(function(){ .each(function() {
this.ariaDisabled = false; this.ariaDisabled = false;
}); });
p.isDisabled = false; p.isDisabled = false;
@ -936,16 +936,17 @@
setPageSize(table, p.size, p); setPageSize(table, p.size, p);
moveToPage(table, p); moveToPage(table, p);
hideRowsSetup(table, p); hideRowsSetup(table, p);
if (c.debug) { if (ts.debug(c, 'pager')) {
console.log('Pager: Enabled'); console.log('Pager >> Enabled');
} }
} }
}, },
init = function(table, settings) { init = function(table, settings) {
var t, ctrls, fxn, size, $el, var t, ctrls, fxn, $el,
c = table.config, c = table.config,
wo = c.widgetOptions, wo = c.widgetOptions,
debug = ts.debug(c, 'pager'),
p = c.pager = $.extend( true, {}, $.tablesorterPager.defaults, settings ), p = c.pager = $.extend( true, {}, $.tablesorterPager.defaults, settings ),
$t = c.$table, $t = c.$table,
namespace = c.namespace + 'pager', namespace = c.namespace + 'pager',
@ -953,8 +954,8 @@
pager = p.$container = $(p.container).addClass('tablesorter-pager').show(); pager = p.$container = $(p.container).addClass('tablesorter-pager').show();
// save a copy of the original settings // save a copy of the original settings
p.settings = $.extend( true, {}, $.tablesorterPager.defaults, settings ); p.settings = $.extend( true, {}, $.tablesorterPager.defaults, settings );
if (c.debug) { if (debug) {
console.log('Pager: Initializing'); console.log('Pager >> Initializing');
} }
p.oldAjaxSuccess = p.oldAjaxSuccess || p.ajaxObject.success; p.oldAjaxSuccess = p.oldAjaxSuccess || p.ajaxObject.success;
c.appender = $this.appender; c.appender = $this.appender;
@ -1003,23 +1004,23 @@
ts.applyWidget( table ); ts.applyWidget( table );
} }
}) })
.bind('disablePager' + namespace, function(e){ .bind('disablePager' + namespace, function(e) {
e.stopPropagation(); e.stopPropagation();
showAllRows(table, p); showAllRows(table, p);
}) })
.bind('enablePager' + namespace, function(e){ .bind('enablePager' + namespace, function(e) {
e.stopPropagation(); e.stopPropagation();
enablePager(table, p, true); enablePager(table, p, true);
}) })
.bind('destroyPager' + namespace, function(e){ .bind('destroyPager' + namespace, function(e) {
e.stopPropagation(); e.stopPropagation();
destroyPager(table, p); destroyPager(table, p);
}) })
.bind('resetToLoadState' + namespace, function(e){ .bind('resetToLoadState' + namespace, function(e) {
e.stopPropagation(); e.stopPropagation();
resetState(table, p); resetState(table, p);
}) })
.bind('updateComplete' + namespace, function(e, table, triggered){ .bind('updateComplete' + namespace, function(e, table, triggered) {
e.stopPropagation(); e.stopPropagation();
// table can be unintentionally undefined in tablesorter v2.17.7 and earlier // table can be unintentionally undefined in tablesorter v2.17.7 and earlier
// don't recalculate total rows/pages if using ajax // don't recalculate total rows/pages if using ajax
@ -1038,14 +1039,14 @@
changeHeight(table, p); changeHeight(table, p);
updatePageDisplay(table, p, true); updatePageDisplay(table, p, true);
}) })
.bind('pageSize refreshComplete '.split(' ').join(namespace + ' '), function(e, size){ .bind('pageSize refreshComplete '.split(' ').join(namespace + ' '), function(e, size) {
e.stopPropagation(); e.stopPropagation();
setPageSize(table, parsePageSize( p, size, 'get' ), p); setPageSize(table, parsePageSize( p, size, 'get' ), p);
moveToPage(table, p); moveToPage(table, p);
hideRows(table, p); hideRows(table, p);
updatePageDisplay(table, p, false); updatePageDisplay(table, p, false);
}) })
.bind('pageSet pagerUpdate '.split(' ').join(namespace + ' '), function(e, num){ .bind('pageSet pagerUpdate '.split(' ').join(namespace + ' '), function(e, num) {
e.stopPropagation(); e.stopPropagation();
// force pager refresh // force pager refresh
if (e.type === 'pagerUpdate') { if (e.type === 'pagerUpdate') {
@ -1056,7 +1057,7 @@
moveToPage(table, p, true); moveToPage(table, p, true);
updatePageDisplay(table, p, false); updatePageDisplay(table, p, false);
}) })
.bind('pageAndSize' + namespace, function(e, page, size){ .bind('pageAndSize' + namespace, function(e, page, size) {
e.stopPropagation(); e.stopPropagation();
p.page = (parseInt(page, 10) || 1) - 1; p.page = (parseInt(page, 10) || 1) - 1;
setPageSize(table, parsePageSize( p, size, 'get' ), p); setPageSize(table, parsePageSize( p, size, 'get' ), p);
@ -1068,13 +1069,13 @@
// clicked controls // clicked controls
ctrls = [ p.cssFirst, p.cssPrev, p.cssNext, p.cssLast ]; ctrls = [ p.cssFirst, p.cssPrev, p.cssNext, p.cssLast ];
fxn = [ moveToFirstPage, moveToPrevPage, moveToNextPage, moveToLastPage ]; fxn = [ moveToFirstPage, moveToPrevPage, moveToNextPage, moveToLastPage ];
if (c.debug && !pager.length) { if (debug && !pager.length) {
console.warn('Pager: >> Container not found'); console.warn('Pager >> "container" not found');
} }
pager.find(ctrls.join(',')) pager.find(ctrls.join(','))
.attr('tabindex', 0) .attr('tabindex', 0)
.unbind('click' + namespace) .unbind('click' + namespace)
.bind('click' + namespace, function(e){ .bind('click' + namespace, function(e) {
e.stopPropagation(); e.stopPropagation();
var i, $t = $(this), l = ctrls.length; var i, $t = $(this), l = ctrls.length;
if ( !$t.hasClass(p.cssDisabled) ) { if ( !$t.hasClass(p.cssDisabled) ) {
@ -1092,13 +1093,13 @@
if ( $el.length ) { if ( $el.length ) {
$el $el
.unbind('change' + namespace) .unbind('change' + namespace)
.bind('change' + namespace, function(){ .bind('change' + namespace, function() {
p.page = $(this).val() - 1; p.page = $(this).val() - 1;
moveToPage(table, p, true); moveToPage(table, p, true);
updatePageDisplay(table, p, false); updatePageDisplay(table, p, false);
}); });
} else if (c.debug) { } else if (debug) {
console.warn('Pager: >> Goto selector not found'); console.warn('Pager >> "goto" selector not found');
} }
// page size selector // page size selector
$el = pager.find(p.cssPageSize); $el = pager.find(p.cssPageSize);
@ -1115,8 +1116,8 @@
} }
return false; return false;
}); });
} else if (c.debug) { } else if (debug) {
console.warn('Pager: >> Size selector not found'); console.warn('Pager >> "size" selector not found');
} }
// clear initialized flag // clear initialized flag
@ -1147,8 +1148,8 @@
// update page size on init // update page size on init
setPageSize(table, p.size, p); setPageSize(table, p.size, p);
moveToPage(table, p); moveToPage(table, p);
if (c.debug) { if (debug) {
console.log('Pager: Triggering pagerInitialized'); console.log('Pager >> Triggering pagerInitialized');
} }
c.$table.triggerHandler( 'pagerInitialized', p ); c.$table.triggerHandler( 'pagerInitialized', p );
if ( !( c.widgetOptions.filter_initialized && ts.hasWidget(table, 'filter') ) ) { if ( !( c.widgetOptions.filter_initialized && ts.hasWidget(table, 'filter') ) ) {
@ -1187,8 +1188,7 @@
// see #486 // see #486
ts.showError = function( table, xhr, settings, exception ) { ts.showError = function( table, xhr, settings, exception ) {
var $row, var $table = $( table ),
$table = $( table ),
c = $table[0].config, c = $table[0].config,
wo = c && c.widgetOptions, wo = c && c.widgetOptions,
errorRow = c.pager && c.pager.cssErrorRow || errorRow = c.pager && c.pager.cssErrorRow ||
@ -1197,7 +1197,7 @@
typ = typeof xhr, typ = typeof xhr,
valid = true, valid = true,
message = '', message = '',
removeRow = function(){ removeRow = function() {
c.$table.find( 'thead' ).find( c.selectorRemove ).remove(); c.$table.find( 'thead' ).find( c.selectorRemove ).remove();
}; };
@ -1243,7 +1243,7 @@
} }
// allow message to include entire row HTML! // allow message to include entire row HTML!
$row = ( /tr\>/.test(message) ? $(message) : $('<tr><td colspan="' + c.columns + '">' + message + '</td></tr>') ) $( /tr\>/.test(message) ? message : '<tr><td colspan="' + c.columns + '">' + message + '</td></tr>' )
.click( function() { .click( function() {
$( this ).remove(); $( this ).remove();
}) })

View File

@ -4,8 +4,8 @@
*/ */
/*jshint browser:true, jquery:true, unused:false */ /*jshint browser:true, jquery:true, unused:false */
/*global jQuery: false */ /*global jQuery: false */
;(function($){ ;(function($) {
"use strict"; 'use strict';
$.tablesorter.addWidget({ $.tablesorter.addWidget({
id: 'reorder', id: 'reorder',
@ -22,14 +22,13 @@ $.tablesorter.addWidget({
init: function(table, thisWidget, c, wo) { init: function(table, thisWidget, c, wo) {
var i, timer, $helper, $bar, clickOffset, var i, timer, $helper, $bar, clickOffset,
lastIndx = -1, lastIndx = -1,
ts = $.tablesorter,
endIndex = -1, endIndex = -1,
startIndex = -1, startIndex = -1,
t = wo.reorder_blocked.split(' '), t = wo.reorder_blocked.split(' '),
noReorderLeft = t[0] || 'reorder-block-left', noReorderLeft = t[0] || 'reorder-block-left',
noReorderLast = t[1] || 'reorder-block-end', noReorderLast = t[1] || 'reorder-block-end',
lastOffset = c.$headers.not('.' + noReorderLeft).first(), lastOffset = c.$headers.not('.' + noReorderLeft).first(),
offsets = c.$headers.map(function(i){ offsets = c.$headers.map(function() {
var s, $t = $(this); var s, $t = $(this);
if ($t.hasClass(noReorderLeft)) { if ($t.hasClass(noReorderLeft)) {
s = lastOffset; s = lastOffset;
@ -40,7 +39,7 @@ $.tablesorter.addWidget({
return $t.offset().left; return $t.offset().left;
}).get(), }).get(),
len = offsets.length, len = offsets.length,
startReorder = function(e, $th){ startReorder = function(e, $th) {
var p = $th.position(), var p = $th.position(),
r = $th.parent().position(), r = $th.parent().position(),
i = startIndex = $th.index(); i = startIndex = $th.index();
@ -68,7 +67,7 @@ $.tablesorter.addWidget({
positionBar(e); positionBar(e);
lastIndx = endIndex; lastIndx = endIndex;
}, },
positionBar = function(e){ positionBar = function(e) {
for (i = 0; i <= len; i++) { for (i = 0; i <= len; i++) {
if ( i > 0 && e.pageX < offsets[i-1] + (offsets[i] - offsets[i-1])/2 && !c.$headers.eq(i).hasClass(noReorderLeft) ) { if ( i > 0 && e.pageX < offsets[i-1] + (offsets[i] - offsets[i-1])/2 && !c.$headers.eq(i).hasClass(noReorderLeft) ) {
endIndex = i - 1; endIndex = i - 1;
@ -87,7 +86,7 @@ $.tablesorter.addWidget({
$bar.css('left', offsets[len]); $bar.css('left', offsets[len]);
} }
}, },
finishReorder = function(){ finishReorder = function() {
$helper.remove(); $helper.remove();
$bar.remove(); $bar.remove();
// finish reorder // finish reorder
@ -95,7 +94,7 @@ $.tablesorter.addWidget({
rows = c.$table.find('tr'), rows = c.$table.find('tr'),
cols; cols;
startIndex = -1; // stop mousemove updates startIndex = -1; // stop mousemove updates
if ( s > -1 && endIndex > -1 && s != endIndex && s + 1 !== endIndex ) { if ( s > -1 && endIndex > -1 && s !== endIndex && s + 1 !== endIndex ) {
adj = endIndex !== 0; adj = endIndex !== 0;
if (c.debug) { if (c.debug) {
console.log( 'Inserting column ' + s + (adj ? ' after' : ' before') + ' column ' + (endIndex - adj ? 1 : 0) ); console.log( 'Inserting column ' + s + (adj ? ' after' : ' before') + ' column ' + (endIndex - adj ? 1 : 0) );
@ -123,10 +122,10 @@ $.tablesorter.addWidget({
} }
endIndex = -1; endIndex = -1;
}, },
mdown = function(e, el){ mdown = function(e, el) {
var $t = $(el), evt = e; var $t = $(el), evt = e;
if ($t.hasClass(wo.reorder_noReorder)) { return; } if ($t.hasClass(wo.reorder_noReorder)) { return; }
timer = setTimeout(function(){ timer = setTimeout(function() {
$t.addClass('tablesorter-reorder'); $t.addClass('tablesorter-reorder');
startReorder(evt, $t); startReorder(evt, $t);
}, wo.reorder_delay); }, wo.reorder_delay);
@ -140,13 +139,13 @@ $.tablesorter.addWidget({
offsets.push( c.$table.offset().left + c.$table.outerWidth() ); offsets.push( c.$table.offset().left + c.$table.outerWidth() );
} }
c.$headers.not('.' + wo.reorder_noReorder).bind('mousedown.reorder', function(e){ c.$headers.not('.' + wo.reorder_noReorder).bind('mousedown.reorder', function(e) {
mdown(e, this); mdown(e, this);
}); });
$(document) $(document)
.bind('mousemove.reorder', function(e){ .bind('mousemove.reorder', function(e) {
if (startIndex !== -1){ if (startIndex !== -1) {
var c = { left : e.pageX - clickOffset[0] }; var c = { left : e.pageX - clickOffset[0] };
endIndex = -1; endIndex = -1;
if (/y/.test(wo.reorder_axis)) { if (/y/.test(wo.reorder_axis)) {
@ -157,9 +156,9 @@ $.tablesorter.addWidget({
} }
}) })
.add( c.$headers ) .add( c.$headers )
.bind('mouseup.reorder', function(){ .bind('mouseup.reorder', function() {
clearTimeout(timer); clearTimeout(timer);
if (startIndex !== -1 && endIndex !== -1){ if (startIndex !== -1 && endIndex !== -1) {
finishReorder(); finishReorder();
} else { } else {
startIndex = -1; startIndex = -1;
@ -167,8 +166,8 @@ $.tablesorter.addWidget({
}); });
// has sticky headers? // has sticky headers?
c.$table.bind('stickyHeadersInit', function(){ c.$table.bind('stickyHeadersInit', function() {
wo.$sticky.find('thead').children().not('.' + wo.reorder_noReorder).bind('mousedown.reorder', function(e){ wo.$sticky.find('thead').children().not('.' + wo.reorder_noReorder).bind('mousedown.reorder', function(e) {
mdown(e, this); mdown(e, this);
}); });
}); });
@ -177,6 +176,6 @@ $.tablesorter.addWidget({
}); });
// add mouse coordinates // add mouse coordinates
$x = $('#main h1:last'); $(document).mousemove(function(e){ $x.html( e.pageX ); }); $x = $('#main h1:last'); $(document).mousemove(function(e) { $x.html( e.pageX ); });
})(jQuery); })(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 2018-02-25 (v2.29.6)*/ /*! tablesorter (FORK) - updated 2018-03-18 (v2.30.0)*/
/* 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.29.6 *//* /*! TableSorter (FORK) v2.30.0 *//*
* 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.29.6', version : '2.30.0',
parsers : [], parsers : [],
widgets : [], widgets : [],
@ -46,8 +46,8 @@
showProcessing : false, // show an indeterminate timer icon in the header when the table is sorted or filtered. showProcessing : false, // show an indeterminate timer icon in the header when the table is sorted or filtered.
headerTemplate : '{content}',// header layout template (HTML ok); {content} = innerHTML, {icon} = <i/> // class from cssIcon headerTemplate : '{content}',// header layout template (HTML ok); {content} = innerHTML, {icon} = <i/> // class from cssIcon
onRenderTemplate : null, // function( index, template ){ return template; }, // template is a string onRenderTemplate : null, // function( index, template ) { return template; }, // template is a string
onRenderHeader : null, // function( index ){}, // nothing to return onRenderHeader : null, // function( index ) {}, // nothing to return
// *** functionality // *** functionality
cancelSelection : true, // prevent text selection in the header cancelSelection : true, // prevent text selection in the header
@ -76,7 +76,7 @@
emptyTo : 'bottom', // sort empty cell to bottom, top, none, zero, emptyMax, emptyMin emptyTo : 'bottom', // sort empty cell to bottom, top, none, zero, emptyMax, emptyMin
stringTo : 'max', // sort strings in numerical column as max, min, top, bottom, zero stringTo : 'max', // sort strings in numerical column as max, min, top, bottom, zero
duplicateSpan : true, // colspan cells in the tbody will have duplicated content in the cache for each spanned column duplicateSpan : true, // colspan cells in the tbody will have duplicated content in the cache for each spanned column
textExtraction : 'basic', // text extraction method/function - function( node, table, cellIndex ){} textExtraction : 'basic', // text extraction method/function - function( node, table, cellIndex ) {}
textAttribute : 'data-text',// data-attribute that contains alternate cell text (used in default textExtraction function) textAttribute : 'data-text',// data-attribute that contains alternate cell text (used in default textExtraction function)
textSorter : null, // choose overall or specific column sorter function( a, b, direction, table, columnIndex ) [alt: ts.sortText] textSorter : null, // choose overall or specific column sorter function( a, b, direction, table, columnIndex ) [alt: ts.sortText]
numberSorter : null, // choose overall numeric sorter function( a, b, direction, maxColumnValue ) numberSorter : null, // choose overall numeric sorter function( a, b, direction, maxColumnValue )
@ -90,7 +90,7 @@
}, },
// *** callbacks // *** callbacks
initialized : null, // function( table ){}, initialized : null, // function( table ) {},
// *** extra css class names // *** extra css class names
tableClass : '', tableClass : '',
@ -228,7 +228,7 @@
setup : function( table, c ) { setup : function( table, c ) {
// if no thead or tbody, or tablesorter is already present, quit // if no thead or tbody, or tablesorter is already present, quit
if ( !table || !table.tHead || table.tBodies.length === 0 || table.hasInitialized === true ) { if ( !table || !table.tHead || table.tBodies.length === 0 || table.hasInitialized === true ) {
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
if ( table.hasInitialized ) { if ( table.hasInitialized ) {
console.warn( 'Stopping initialization. Tablesorter has already been initialized' ); console.warn( 'Stopping initialization. Tablesorter has already been initialized' );
} else { } else {
@ -249,7 +249,7 @@
table.config = c; table.config = c;
// save the settings where they read // save the settings where they read
$.data( table, 'tablesorter', c ); $.data( table, 'tablesorter', c );
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter v' + ts.version ); console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter v' + ts.version );
$.data( table, 'startoveralltimer', new Date() ); $.data( table, 'startoveralltimer', new Date() );
} }
@ -355,9 +355,9 @@
// initialized // initialized
table.hasInitialized = true; table.hasInitialized = true;
table.isProcessing = false; table.isProcessing = false;
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
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 ( ts.debug(c, 'core') && console.groupEnd ) { console.groupEnd(); }
} }
$table.triggerHandler( 'tablesorter-initialized', table ); $table.triggerHandler( 'tablesorter-initialized', table );
if ( typeof c.initialized === 'function' ) { if ( typeof c.initialized === 'function' ) {
@ -554,7 +554,7 @@
c.headerList = []; c.headerList = [];
c.headerContent = []; c.headerContent = [];
c.sortVars = []; c.sortVars = [];
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
timer = new Date(); timer = new Date();
} }
// children tr in tfoot - see issue #196 & #547 // children tr in tfoot - see issue #196 & #547
@ -649,7 +649,7 @@
}); });
// enable/disable sorting // enable/disable sorting
ts.updateHeader( c ); ts.updateHeader( c );
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
console.log( 'Built headers:' + ts.benchmark( timer ) ); console.log( 'Built headers:' + ts.benchmark( timer ) );
console.log( c.$headers ); console.log( c.$headers );
} }
@ -672,14 +672,15 @@
noParser, parser, extractor, time, tbody, len, noParser, parser, extractor, time, tbody, len,
table = c.table, table = c.table,
tbodyIndex = 0, tbodyIndex = 0,
debug = {}; debug = ts.debug(c, 'core'),
debugOutput = {};
// update table bodies in case we start with an empty table // update table bodies in case we start with an empty table
c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' ); c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' );
tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies; tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies;
len = tbody.length; len = tbody.length;
if ( len === 0 ) { if ( len === 0 ) {
return c.debug ? console.warn( 'Warning: *Empty table!* Not building a parser cache' ) : ''; return debug ? console.warn( 'Warning: *Empty table!* Not building a parser cache' ) : '';
} else if ( c.debug ) { } else if ( debug ) {
time = new Date(); time = new Date();
console[ console.group ? 'group' : 'log' ]( 'Detecting parsers for each column' ); console[ console.group ? 'group' : 'log' ]( 'Detecting parsers for each column' );
} }
@ -721,8 +722,8 @@
if ( !parser ) { if ( !parser ) {
parser = ts.detectParserForColumn( c, rows, -1, colIndex ); parser = ts.detectParserForColumn( c, rows, -1, colIndex );
} }
if ( c.debug ) { if ( debug ) {
debug[ '(' + colIndex + ') ' + header.text() ] = { debugOutput[ '(' + colIndex + ') ' + header.text() ] = {
parser : parser.id, parser : parser.id,
extractor : extractor ? extractor.id : 'none', extractor : extractor ? extractor.id : 'none',
string : c.strings[ colIndex ], string : c.strings[ colIndex ],
@ -748,9 +749,9 @@
} }
tbodyIndex += ( list.parsers.length ) ? len : 1; tbodyIndex += ( list.parsers.length ) ? len : 1;
} }
if ( c.debug ) { if ( debug ) {
if ( !ts.isEmptyObject( debug ) ) { if ( !ts.isEmptyObject( debugOutput ) ) {
console[ console.table ? 'table' : 'log' ]( debug ); console[ console.table ? 'table' : 'log' ]( debugOutput );
} else { } else {
console.warn( ' No parsers detected!' ); console.warn( ' No parsers detected!' );
} }
@ -776,7 +777,7 @@
}, },
getParserById : function( name ) { getParserById : function( name ) {
/*jshint eqeqeq:false */ /*jshint eqeqeq:false */ // eslint-disable-next-line eqeqeq
if ( name == 'false' ) { return false; } if ( name == 'false' ) { return false; }
var indx, var indx,
len = ts.parsers.length; len = ts.parsers.length;
@ -793,6 +794,7 @@
indx = ts.parsers.length, indx = ts.parsers.length,
node = false, node = false,
nodeValue = '', nodeValue = '',
debug = ts.debug(c, 'core'),
keepLooking = true; keepLooking = true;
while ( nodeValue === '' && keepLooking ) { while ( nodeValue === '' && keepLooking ) {
rowIndex++; rowIndex++;
@ -803,7 +805,7 @@
node = rows[ rowIndex ].cells[ cellIndex ]; node = rows[ rowIndex ].cells[ cellIndex ];
nodeValue = ts.getElementText( c, node, cellIndex ); nodeValue = ts.getElementText( c, node, cellIndex );
$node = $( node ); $node = $( node );
if ( c.debug ) { if ( debug ) {
console.log( 'Checking if value was empty on row ' + rowIndex + ', column: ' + console.log( 'Checking if value was empty on row ' + rowIndex + ', column: ' +
cellIndex + ': "' + nodeValue + '"' ); cellIndex + ': "' + nodeValue + '"' );
} }
@ -885,7 +887,8 @@
cols, $cells, cell, cacheTime, totalRows, rowData, prevRowData, cols, $cells, cell, cacheTime, totalRows, rowData, prevRowData,
colMax, span, cacheIndex, hasParser, max, len, index, colMax, span, cacheIndex, hasParser, max, len, index,
table = c.table, table = c.table,
parsers = c.parsers; parsers = c.parsers,
debug = ts.debug(c, 'core');
// update tbody variable // update tbody variable
c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' ); c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' );
$tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies, $tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies,
@ -893,9 +896,9 @@
c.totalRows = 0; c.totalRows = 0;
// if no parsers found, return - it's an empty table. // if no parsers found, return - it's an empty table.
if ( !parsers ) { if ( !parsers ) {
return c.debug ? console.warn( 'Warning: *Empty table!* Not building a cache' ) : ''; return debug ? console.warn( 'Warning: *Empty table!* Not building a cache' ) : '';
} }
if ( c.debug ) { if ( debug ) {
cacheTime = new Date(); cacheTime = new Date();
} }
// processing icon // processing icon
@ -964,7 +967,7 @@
cell = $row[ 0 ].cells[ colIndex ]; cell = $row[ 0 ].cells[ colIndex ];
if ( cell && cacheIndex < c.columns ) { if ( cell && cacheIndex < c.columns ) {
hasParser = typeof parsers[ cacheIndex ] !== 'undefined'; hasParser = typeof parsers[ cacheIndex ] !== 'undefined';
if ( !hasParser && c.debug ) { if ( !hasParser && debug ) {
console.warn( 'No parser found for row: ' + rowIndex + ', column: ' + colIndex + console.warn( 'No parser found for row: ' + rowIndex + ', column: ' + colIndex +
'; cell containing: "' + $(cell).text() + '"; does it have a header?' ); '; cell containing: "' + $(cell).text() + '"; does it have a header?' );
} }
@ -1012,7 +1015,7 @@
if ( c.showProcessing ) { if ( c.showProcessing ) {
ts.isProcessing( table ); // remove processing icon ts.isProcessing( table ); // remove processing icon
} }
if ( c.debug ) { if ( debug ) {
len = Math.min( 5, c.cache[ 0 ].normalized.length ); len = Math.min( 5, c.cache[ 0 ].normalized.length );
console[ console.group ? 'group' : 'log' ]( 'Building cache for ' + c.totalRows + console[ console.group ? 'group' : 'log' ]( 'Building cache for ' + c.totalRows +
' rows (showing ' + len + ' rows in log) and ' + c.columns + ' columns' + ' rows (showing ' + len + ' rows in log) and ' + c.columns + ' columns' +
@ -1043,7 +1046,7 @@
data = { raw : [], parsed: [], $cell: [] }, data = { raw : [], parsed: [], $cell: [] },
c = table.config; c = table.config;
if ( ts.isEmptyObject( c ) ) { if ( ts.isEmptyObject( c ) ) {
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
console.warn( 'No cache found - aborting getColumnText function!' ); console.warn( 'No cache found - aborting getColumnText function!' );
} }
} else { } else {
@ -1137,8 +1140,8 @@
// direction = 2 means reset! // direction = 2 means reset!
if ( list[ indx ][ 1 ] !== 2 ) { if ( list[ indx ][ 1 ] !== 2 ) {
// multicolumn sorting updating - see #1005 // multicolumn sorting updating - see #1005
// .not(function(){}) needs jQuery 1.4 // .not(function() {}) needs jQuery 1.4
// filter(function(i, el){}) <- el is undefined in jQuery v1.2.6 // filter(function(i, el) {}) <- el is undefined in jQuery v1.2.6
$sorted = c.$headers.filter( function( i ) { $sorted = c.$headers.filter( function( i ) {
// only include headers that are in the sortList (this includes colspans) // only include headers that are in the sortList (this includes colspans)
var include = true, var include = true,
@ -1387,7 +1390,7 @@
ts.resortComplete( c, callback ); ts.resortComplete( c, callback );
} }
} else { } else {
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
console.error( 'updateCell aborted, tbody missing or not within the indicated table' ); console.error( 'updateCell aborted, tbody missing or not within the indicated table' );
} }
c.table.isUpdating = false; c.table.isUpdating = false;
@ -1410,7 +1413,7 @@
// row contained in the table? // row contained in the table?
( ts.getClosest( $row, 'table' )[ 0 ] !== c.table ) ( ts.getClosest( $row, 'table' )[ 0 ] !== c.table )
) { ) {
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
console.error( 'addRows method requires (1) a jQuery selector reference to rows that have already ' + console.error( 'addRows method requires (1) a jQuery selector reference to rows that have already ' +
'been added to the table, or (2) row HTML string to be added to a table with only one tbody' ); 'been added to the table, or (2) row HTML string to be added to a table with only one tbody' );
} }
@ -1482,7 +1485,6 @@
appendCache : function( c, init ) { appendCache : function( c, init ) {
var parsed, totalRows, $tbody, $curTbody, rowIndex, tbodyIndex, appendTime, var parsed, totalRows, $tbody, $curTbody, rowIndex, tbodyIndex, appendTime,
table = c.table, table = c.table,
wo = c.widgetOptions,
$tbodies = c.$tbodies, $tbodies = c.$tbodies,
rows = [], rows = [],
cache = c.cache; cache = c.cache;
@ -1492,7 +1494,7 @@
return c.appender ? c.appender( table, rows ) : return c.appender ? c.appender( table, rows ) :
table.isUpdating ? c.$table.triggerHandler( 'updateComplete', table ) : ''; // Fixes #532 table.isUpdating ? c.$table.triggerHandler( 'updateComplete', table ) : ''; // Fixes #532
} }
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
appendTime = new Date(); appendTime = new Date();
} }
for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) { for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
@ -1505,7 +1507,7 @@
for ( rowIndex = 0; rowIndex < totalRows; rowIndex++ ) { for ( rowIndex = 0; rowIndex < totalRows; rowIndex++ ) {
rows[rows.length] = parsed[ rowIndex ][ c.columns ].$row; rows[rows.length] = parsed[ rowIndex ][ c.columns ].$row;
// removeRows used by the pager plugin; don't render if using ajax - fixes #411 // removeRows used by the pager plugin; don't render if using ajax - fixes #411
if ( !c.appender || ( c.pager && ( !c.pager.removeRows || !wo.pager_removeRows ) && !c.pager.ajax ) ) { if ( !c.appender || ( c.pager && !c.pager.removeRows && !c.pager.ajax ) ) {
$curTbody.append( parsed[ rowIndex ][ c.columns ].$row ); $curTbody.append( parsed[ rowIndex ][ c.columns ].$row );
} }
} }
@ -1516,7 +1518,7 @@
if ( c.appender ) { if ( c.appender ) {
c.appender( table, rows ); c.appender( table, rows );
} }
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
console.log( 'Rebuilt table' + ts.benchmark( appendTime ) ); console.log( 'Rebuilt table' + ts.benchmark( appendTime ) );
} }
// apply table widgets; but not before ajax completes // apply table widgets; but not before ajax completes
@ -1547,7 +1549,7 @@
initSort : function( c, cell, event ) { initSort : function( c, cell, event ) {
if ( c.table.isUpdating ) { if ( c.table.isUpdating ) {
// let any updates complete before initializing a sort // let any updates complete before initializing a sort
return setTimeout( function(){ return setTimeout( function() {
ts.initSort( c, cell, event ); ts.initSort( c, cell, event );
}, 50 ); }, 50 );
} }
@ -1698,7 +1700,7 @@
// empty table - fixes #206/#346 // empty table - fixes #206/#346
return; return;
} }
if ( c.debug ) { sortTime = new Date(); } if ( ts.debug(c, 'core') ) { sortTime = new Date(); }
// cache textSorter to optimize speed // cache textSorter to optimize speed
if ( typeof textSorter === 'object' ) { if ( typeof textSorter === 'object' ) {
colMax = c.columns; colMax = c.columns;
@ -1760,7 +1762,7 @@
return a[ c.columns ].order - b[ c.columns ].order; return a[ c.columns ].order - b[ c.columns ].order;
}); });
} }
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
console.log( 'Applying sort ' + sortList.toString() + ts.benchmark( sortTime ) ); console.log( 'Applying sort ' + sortList.toString() + ts.benchmark( sortTime ) );
} }
}, },
@ -2013,6 +2015,7 @@
var applied, time, name, var applied, time, name,
c = table.config, c = table.config,
wo = c.widgetOptions, wo = c.widgetOptions,
debug = ts.debug(c, 'core'),
widget = ts.getWidgetById( id ); widget = ts.getWidgetById( id );
if ( widget ) { if ( widget ) {
name = widget.id; name = widget.id;
@ -2021,7 +2024,7 @@
if ( $.inArray( name, c.widgets ) < 0 ) { if ( $.inArray( name, c.widgets ) < 0 ) {
c.widgets[ c.widgets.length ] = name; c.widgets[ c.widgets.length ] = name;
} }
if ( c.debug ) { time = new Date(); } if ( debug ) { time = new Date(); }
if ( init || !( c.widgetInit[ name ] ) ) { if ( init || !( c.widgetInit[ name ] ) ) {
// set init flag first to prevent calling init more than once (e.g. pager) // set init flag first to prevent calling init more than once (e.g. pager)
@ -2032,7 +2035,7 @@
} }
if ( typeof widget.init === 'function' ) { if ( typeof widget.init === 'function' ) {
applied = true; applied = true;
if ( c.debug ) { if ( debug ) {
console[ console.group ? 'group' : 'log' ]( 'Initializing ' + name + ' widget' ); console[ console.group ? 'group' : 'log' ]( 'Initializing ' + name + ' widget' );
} }
widget.init( table, widget, c, wo ); widget.init( table, widget, c, wo );
@ -2040,12 +2043,12 @@
} }
if ( !init && typeof widget.format === 'function' ) { if ( !init && typeof widget.format === 'function' ) {
applied = true; applied = true;
if ( c.debug ) { if ( debug ) {
console[ console.group ? 'group' : 'log' ]( 'Updating ' + name + ' widget' ); console[ console.group ? 'group' : 'log' ]( 'Updating ' + name + ' widget' );
} }
widget.format( table, c, wo, false ); widget.format( table, c, wo, false );
} }
if ( c.debug ) { if ( debug ) {
if ( applied ) { if ( applied ) {
console.log( 'Completed ' + ( init ? 'initializing ' : 'applying ' ) + name + ' widget' + ts.benchmark( time ) ); console.log( 'Completed ' + ( init ? 'initializing ' : 'applying ' ) + name + ' widget' + ts.benchmark( time ) );
if ( console.groupEnd ) { console.groupEnd(); } if ( console.groupEnd ) { console.groupEnd(); }
@ -2058,12 +2061,13 @@
table = $( table )[ 0 ]; // in case this is called externally table = $( table )[ 0 ]; // in case this is called externally
var indx, len, names, widget, time, var indx, len, names, widget, time,
c = table.config, c = table.config,
debug = ts.debug(c, 'core'),
widgets = []; widgets = [];
// prevent numerous consecutive widget applications // prevent numerous consecutive widget applications
if ( init !== false && table.hasInitialized && ( table.isApplyingWidgets || table.isUpdating ) ) { if ( init !== false && table.hasInitialized && ( table.isApplyingWidgets || table.isUpdating ) ) {
return; return;
} }
if ( c.debug ) { time = new Date(); } if ( debug ) { time = new Date(); }
ts.addWidgetFromClass( table ); ts.addWidgetFromClass( table );
// prevent "tablesorter-ready" from firing multiple times in a row // prevent "tablesorter-ready" from firing multiple times in a row
clearTimeout( c.timerReady ); clearTimeout( c.timerReady );
@ -2082,7 +2086,7 @@
// set priority to 10 if not defined // set priority to 10 if not defined
if ( !widget.priority ) { widget.priority = 10; } if ( !widget.priority ) { widget.priority = 10; }
widgets[ indx ] = widget; widgets[ indx ] = widget;
} else if ( c.debug ) { } else if ( debug ) {
console.warn( '"' + names[ indx ] + '" was enabled, but the widget code has not been loaded!' ); console.warn( '"' + names[ indx ] + '" was enabled, but the widget code has not been loaded!' );
} }
} }
@ -2092,7 +2096,7 @@
}); });
// add/update selected widgets // add/update selected widgets
len = widgets.length; len = widgets.length;
if ( c.debug ) { if ( debug ) {
console[ console.group ? 'group' : 'log' ]( 'Start ' + ( init ? 'initializing' : 'applying' ) + ' widgets' ); console[ console.group ? 'group' : 'log' ]( 'Start ' + ( init ? 'initializing' : 'applying' ) + ' widgets' );
} }
for ( indx = 0; indx < len; indx++ ) { for ( indx = 0; indx < len; indx++ ) {
@ -2101,7 +2105,7 @@
ts.applyWidgetId( table, widget.id, init ); ts.applyWidgetId( table, widget.id, init );
} }
} }
if ( c.debug && console.groupEnd ) { console.groupEnd(); } if ( debug && console.groupEnd ) { console.groupEnd(); }
} }
c.timerReady = setTimeout( function() { c.timerReady = setTimeout( function() {
table.isApplyingWidgets = false; table.isApplyingWidgets = false;
@ -2111,7 +2115,7 @@
if ( !init && typeof callback === 'function' ) { if ( !init && typeof callback === 'function' ) {
callback( table ); callback( table );
} }
if ( c.debug ) { if ( debug ) {
widget = c.widgets.length; widget = c.widgets.length;
console.log( 'Completed ' + console.log( 'Completed ' +
( init === true ? 'initializing ' : 'applying ' ) + widget + ( init === true ? 'initializing ' : 'applying ' ) + widget +
@ -2148,7 +2152,7 @@
c.widgets.splice( indx, 1 ); c.widgets.splice( indx, 1 );
} }
if ( widget && widget.remove ) { if ( widget && widget.remove ) {
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
console.log( ( refreshing ? 'Refreshing' : 'Removing' ) + ' "' + name[ index ] + '" widget' ); console.log( ( refreshing ? 'Refreshing' : 'Removing' ) + ' "' + name[ index ] + '" widget' );
} }
widget.remove( table, c, c.widgetOptions, refreshing ); widget.remove( table, c, c.widgetOptions, refreshing );
@ -2202,6 +2206,12 @@
log : function() { log : function() {
console.log( arguments ); console.log( arguments );
}, },
debug : function(c, name) {
return c && (
c.debug === true ||
typeof c.debug === 'string' && c.debug.indexOf(name) > -1
);
},
// $.isEmptyObject from jQuery v1.4 // $.isEmptyObject from jQuery v1.4
isEmptyObject : function( obj ) { isEmptyObject : function( obj ) {
@ -2507,7 +2517,7 @@
ignore = 'headers sortForce sortList sortAppend widgets'.split( ' ' ), ignore = 'headers sortForce sortList sortAppend widgets'.split( ' ' ),
orig = c.originalSettings; orig = c.originalSettings;
if ( orig ) { if ( orig ) {
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
timer = new Date(); timer = new Date();
} }
for ( setting in orig ) { for ( setting in orig ) {
@ -2523,7 +2533,7 @@
} }
} }
} }
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
console.log( 'validate options time:' + ts.benchmark( timer ) ); console.log( 'validate options time:' + ts.benchmark( timer ) );
} }
} }
@ -2554,7 +2564,6 @@
var events, var events,
$t = $( table ), $t = $( table ),
c = table.config, c = table.config,
debug = c.debug,
$h = $t.find( 'thead:first' ), $h = $t.find( 'thead:first' ),
$r = $h.find( 'tr.' + ts.css.headerRow ).removeClass( ts.css.headerRow + ' ' + c.cssHeaderRow ), $r = $h.find( 'tr.' + ts.css.headerRow ).removeClass( ts.css.headerRow + ' ' + c.cssHeaderRow ),
$f = $t.find( 'tfoot:first > tr' ).children( 'th, td' ); $f = $t.find( 'tfoot:first > tr' ).children( 'th, td' );
@ -2592,7 +2601,7 @@
if ( typeof callback === 'function' ) { if ( typeof callback === 'function' ) {
callback( table ); callback( table );
} }
if ( debug ) { if ( ts.debug(c, 'core') ) {
console.log( 'tablesorter has been removed' ); console.log( 'tablesorter has been removed' );
} }
} }
@ -2709,7 +2718,7 @@
is : function( str ) { is : function( str ) {
return ts.regex.isoDate.test( str ); return ts.regex.isoDate.test( str );
}, },
format : function( str, table ) { format : function( str ) {
var date = str ? new Date( str.replace( ts.regex.dash, '/' ) ) : str; var date = str ? new Date( str.replace( ts.regex.dash, '/' ) ) : str;
return date instanceof Date && isFinite( date ) ? date.getTime() : str; return date instanceof Date && isFinite( date ) ? date.getTime() : str;
}, },
@ -2752,7 +2761,7 @@
// Jan 01, 2013 12:34:56 PM or 01 Jan 2013 // Jan 01, 2013 12:34:56 PM or 01 Jan 2013
return ts.regex.usLongDateTest1.test( str ) || ts.regex.usLongDateTest2.test( str ); return ts.regex.usLongDateTest1.test( str ) || ts.regex.usLongDateTest2.test( str );
}, },
format : function( str, table ) { format : function( str ) {
var date = str ? new Date( str.replace( ts.regex.dateReplace, '$1 $2' ) ) : str; var date = str ? new Date( str.replace( ts.regex.dateReplace, '$1 $2' ) ) : str;
return date instanceof Date && isFinite( date ) ? date.getTime() : str; return date instanceof Date && isFinite( date ) ? date.getTime() : str;
}, },
@ -2813,7 +2822,7 @@
is : function( str ) { is : function( str ) {
return ts.regex.timeTest.test( str ); return ts.regex.timeTest.test( str );
}, },
format : function( str, table ) { format : function( str ) {
// isolate time... ignore month, day and year // isolate time... ignore month, day and year
var temp, var temp,
timePart = ( str || '' ).match( ts.regex.timeMatch ), timePart = ( str || '' ).match( ts.regex.timeMatch ),
@ -2880,7 +2889,7 @@
var tbodyIndex, $tbody, var tbodyIndex, $tbody,
$tbodies = c.$tbodies, $tbodies = c.$tbodies,
toRemove = ( wo.zebra || [ 'even', 'odd' ] ).join( ' ' ); toRemove = ( wo.zebra || [ 'even', 'odd' ] ).join( ' ' );
for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ){ for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
$tbody = ts.processTbody( table, $tbodies.eq( tbodyIndex ), true ); // remove tbody $tbody = ts.processTbody( table, $tbodies.eq( tbodyIndex ), true ); // remove tbody
$tbody.children().removeClass( toRemove ); $tbody.children().removeClass( toRemove );
ts.processTbody( table, $tbody, false ); // restore tbody ts.processTbody( table, $tbody, false ); // restore tbody
@ -2890,7 +2899,7 @@
})( jQuery ); })( jQuery );
/*! Widget: storage - updated 4/18/2017 (v2.28.8) */ /*! Widget: storage - updated 2018-03-18 (v2.30.0) */
/*global JSON:false */ /*global JSON:false */
;(function ($, window, document) { ;(function ($, window, document) {
'use strict'; 'use strict';
@ -2936,6 +2945,7 @@
values = {}, values = {},
c = table.config, c = table.config,
wo = c && c.widgetOptions, wo = c && c.widgetOptions,
debug = ts.debug(c, 'storage'),
storageType = ( storageType = (
( options && options.storageType ) || ( wo && wo.storage_storageType ) ( options && options.storageType ) || ( wo && wo.storage_storageType )
).toString().charAt(0).toLowerCase(), ).toString().charAt(0).toLowerCase(),
@ -2964,14 +2974,12 @@
hasStorage = true; hasStorage = true;
window[storageType].removeItem('_tmptest'); window[storageType].removeItem('_tmptest');
} catch (error) { } catch (error) {
if (c && c.debug) { console.warn( storageType + ' is not supported in this browser' );
console.warn( storageType + ' is not supported in this browser' );
}
} }
} }
} }
if (c.debug) { if (debug) {
console.log('Storage widget using', hasStorage ? storageType : 'cookies'); console.log('Storage >> Using', hasStorage ? storageType : 'cookies');
} }
// *** get value *** // *** get value ***
if ($.parseJSON) { if ($.parseJSON) {
@ -3007,7 +3015,7 @@
})(jQuery, window, document); })(jQuery, window, document);
/*! Widget: uitheme - updated 9/27/2017 (v2.29.0) */ /*! Widget: uitheme - updated 2018-03-18 (v2.30.0) */
;(function ($) { ;(function ($) {
'use strict'; 'use strict';
var ts = $.tablesorter || {}; var ts = $.tablesorter || {};
@ -3072,8 +3080,9 @@
theme = c.theme || 'jui', theme = c.theme || 'jui',
themes = themesAll[theme] || {}, themes = themesAll[theme] || {},
remove = $.trim( [ themes.sortNone, themes.sortDesc, themes.sortAsc, themes.active ].join( ' ' ) ), remove = $.trim( [ themes.sortNone, themes.sortDesc, themes.sortAsc, themes.active ].join( ' ' ) ),
iconRmv = $.trim( [ themes.iconSortNone, themes.iconSortDesc, themes.iconSortAsc ].join( ' ' ) ); iconRmv = $.trim( [ themes.iconSortNone, themes.iconSortDesc, themes.iconSortAsc ].join( ' ' ) ),
if (c.debug) { time = new Date(); } debug = ts.debug(c, 'uitheme');
if (debug) { time = new Date(); }
// initialization code - run once // initialization code - run once
if (!$table.hasClass('tablesorter-' + theme) || c.theme !== c.appliedTheme || !wo.uitheme_applied) { if (!$table.hasClass('tablesorter-' + theme) || c.theme !== c.appliedTheme || !wo.uitheme_applied) {
wo.uitheme_applied = true; wo.uitheme_applied = true;
@ -3118,7 +3127,7 @@
$(this)[ event.type === 'mouseenter' ? 'addClass' : 'removeClass' ](themes.hover || ''); $(this)[ event.type === 'mouseenter' ? 'addClass' : 'removeClass' ](themes.hover || '');
}); });
$headers.each(function(){ $headers.each(function() {
var $this = $(this); var $this = $(this);
if (!$this.find('.' + ts.css.wrapper).length) { if (!$this.find('.' + ts.css.wrapper).length) {
// Firefox needs this inner div to position the icon & resizer correctly // Firefox needs this inner div to position the icon & resizer correctly
@ -3176,8 +3185,8 @@
} }
} }
} }
if (c.debug) { if (debug) {
console.log('Applying ' + theme + ' theme' + ts.benchmark(time)); console.log('uitheme >> Applied ' + theme + ' theme' + ts.benchmark(time));
} }
}, },
remove: function(table, c, wo, refreshing) { remove: function(table, c, wo, refreshing) {
@ -3282,7 +3291,7 @@
})(jQuery); })(jQuery);
/*! Widget: filter - updated 2018-01-30 (v2.29.5) *//* /*! Widget: filter - updated 2018-03-18 (v2.30.0) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+ * Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison * by Rob Garrison
*/ */
@ -3564,6 +3573,7 @@
if ( tsfRegex.exact.test( data.iFilter ) ) { if ( tsfRegex.exact.test( data.iFilter ) ) {
var txt = data.iFilter.replace( tsfRegex.exact, '' ), var txt = data.iFilter.replace( tsfRegex.exact, '' ),
filter = tsf.parseFilter( c, txt, data ) || ''; filter = tsf.parseFilter( c, txt, data ) || '';
// eslint-disable-next-line eqeqeq
return data.anyMatch ? $.inArray( filter, data.rowArray ) >= 0 : filter == data.iExact; return data.anyMatch ? $.inArray( filter, data.rowArray ) >= 0 : filter == data.iExact;
} }
return null; return null;
@ -3737,7 +3747,7 @@
c.lastCombinedFilter = null; c.lastCombinedFilter = null;
c.lastSearch = []; c.lastSearch = [];
// update filterFormatters after update (& small delay) - Fixes #1237 // update filterFormatters after update (& small delay) - Fixes #1237
setTimeout(function(){ setTimeout(function() {
c.$table.triggerHandler( 'filterFomatterUpdate' ); c.$table.triggerHandler( 'filterFomatterUpdate' );
}, 100); }, 100);
} }
@ -3831,7 +3841,7 @@
// show processing icon // show processing icon
if ( c.showProcessing ) { if ( c.showProcessing ) {
txt = 'filterStart filterEnd '.split( ' ' ).join( c.namespace + 'filter ' ); txt = 'filterStart filterEnd '.split( ' ' ).join( c.namespace + 'filter-sp ' );
c.$table c.$table
.unbind( txt.replace( ts.regex.spaces, ' ' ) ) .unbind( txt.replace( ts.regex.spaces, ' ' ) )
.bind( txt, function( event, columns ) { .bind( txt, function( event, columns ) {
@ -3910,6 +3920,9 @@
c.lastSearch = c.$table.data( 'lastSearch' ); c.lastSearch = c.$table.data( 'lastSearch' );
c.$table.triggerHandler( 'filterInit', c ); c.$table.triggerHandler( 'filterInit', c );
tsf.findRows( c.table, c.lastSearch || [] ); tsf.findRows( c.table, c.lastSearch || [] );
if (ts.debug(c, 'filter')) {
console.log('Filter >> Widget initialized');
}
}; };
if ( $.isEmptyObject( wo.filter_formatter ) ) { if ( $.isEmptyObject( wo.filter_formatter ) ) {
completed(); completed();
@ -4610,6 +4623,7 @@
storedFilters = $.extend( [], filters ), storedFilters = $.extend( [], filters ),
c = table.config, c = table.config,
wo = c.widgetOptions, wo = c.widgetOptions,
debug = ts.debug(c, 'filter'),
// data object passed to filters; anyMatch is a flag for the filters // data object passed to filters; anyMatch is a flag for the filters
data = { data = {
anyMatch: false, anyMatch: false,
@ -4626,7 +4640,6 @@
defaultColFilter : [], defaultColFilter : [],
defaultAnyFilter : ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) || '' defaultAnyFilter : ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) || ''
}; };
// parse columns after formatter, in case the class is added at that point // parse columns after formatter, in case the class is added at that point
data.parsed = []; data.parsed = [];
for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) { for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) {
@ -4648,8 +4661,8 @@
( ts.getColumnData( table, wo.filter_excludeFilter, columnIndex, true ) || '' ).split( /\s+/ ); ( ts.getColumnData( table, wo.filter_excludeFilter, columnIndex, true ) || '' ).split( /\s+/ );
} }
if ( c.debug ) { if ( debug ) {
console.log( 'Filter: Starting filter widget search', filters ); console.log( 'Filter >> Starting filter widget search', filters );
time = new Date(); time = new Date();
} }
// filtered rows count // filtered rows count
@ -4747,8 +4760,8 @@
notFiltered = $rows.not( '.' + wo.filter_filteredRow ).length; notFiltered = $rows.not( '.' + wo.filter_filteredRow ).length;
// can't search when all rows are hidden - this happens when looking for exact matches // can't search when all rows are hidden - this happens when looking for exact matches
if ( searchFiltered && notFiltered === 0 ) { searchFiltered = false; } if ( searchFiltered && notFiltered === 0 ) { searchFiltered = false; }
if ( c.debug ) { if ( debug ) {
console.log( 'Filter: Searching through ' + console.log( 'Filter >> Searching through ' +
( searchFiltered && notFiltered < len ? notFiltered : 'all' ) + ' rows' ); ( searchFiltered && notFiltered < len ? notFiltered : 'all' ) + ' rows' );
} }
if ( data.anyMatchFlag ) { if ( data.anyMatchFlag ) {
@ -4851,8 +4864,8 @@
if ( wo.filter_saveFilters && ts.storage ) { if ( wo.filter_saveFilters && ts.storage ) {
ts.storage( table, 'tablesorter-filters', tsf.processFilters( storedFilters, true ) ); ts.storage( table, 'tablesorter-filters', tsf.processFilters( storedFilters, true ) );
} }
if ( c.debug ) { if ( debug ) {
console.log( 'Completed filter widget search' + ts.benchmark(time) ); console.log( 'Filter >> Completed search' + ts.benchmark(time) );
} }
if ( wo.filter_initialized ) { if ( wo.filter_initialized ) {
c.$table.triggerHandler( 'filterBeforeEnd', c ); c.$table.triggerHandler( 'filterBeforeEnd', c );
@ -5067,13 +5080,13 @@
options += '<option'; options += '<option';
for ( val in option ) { for ( val in option ) {
if ( option.hasOwnProperty( val ) && val !== 'text' ) { if ( option.hasOwnProperty( val ) && val !== 'text' ) {
options += ' ' + val + '="' + option[ val ] + '"'; options += ' ' + val + '="' + option[ val ].replace( tsfRegex.quote, '&quot;' ) + '"';
} }
} }
if ( !option.value ) { if ( !option.value ) {
options += ' value="' + option.text + '"'; options += ' value="' + option.text.replace( tsfRegex.quote, '&quot;' ) + '"';
} }
options += '>' + option.text + '</option>'; options += '>' + option.text.replace( tsfRegex.quote, '&quot;' ) + '</option>';
// above code is needed in jQuery < v1.8 // above code is needed in jQuery < v1.8
// make sure we don't turn an object into a string (objects without a "text" property) // make sure we don't turn an object into a string (objects without a "text" property)
@ -5357,7 +5370,7 @@
$stickyThead = $stickyTable.children('thead:first'), $stickyThead = $stickyTable.children('thead:first'),
$stickyCells, $stickyCells,
laststate = '', laststate = '',
setWidth = function($orig, $clone){ setWidth = function($orig, $clone) {
var index, width, border, $cell, $this, var index, width, border, $cell, $this,
$cells = $orig.filter(':visible'), $cells = $orig.filter(':visible'),
len = $cells.length; len = $cells.length;
@ -5498,7 +5511,7 @@
}); });
c.$table c.$table
.unbind('stickyHeadersUpdate' + namespace) .unbind('stickyHeadersUpdate' + namespace)
.bind('stickyHeadersUpdate' + namespace, function(){ .bind('stickyHeadersUpdate' + namespace, function() {
scrollSticky( true ); scrollSticky( true );
}); });
@ -5574,7 +5587,7 @@
}); });
// Add extra scroller css // Add extra scroller css
$(function(){ $(function() {
var s = '<style>' + var s = '<style>' +
'body.' + ts.css.resizableNoSelect + ' { -ms-user-select: none; -moz-user-select: -moz-none;' + 'body.' + ts.css.resizableNoSelect + ' { -ms-user-select: none; -moz-user-select: -moz-none;' +
'-khtml-user-select: none; -webkit-user-select: none; user-select: none; }' + '-khtml-user-select: none; -webkit-user-select: none; user-select: none; }' +
@ -5719,7 +5732,7 @@
if ( ts.hasWidget( c.table, 'scroller' ) ) { if ( ts.hasWidget( c.table, 'scroller' ) ) {
tableHeight = 0; tableHeight = 0;
c.$table.closest( '.' + ts.css.scrollerWrap ).children().each(function(){ c.$table.closest( '.' + ts.css.scrollerWrap ).children().each(function() {
var $this = $(this); var $this = $(this);
// center table has a max-height set // center table has a max-height set
tableHeight += $this.filter('[style*="height"]').length ? $this.height() : $this.children('table').height(); tableHeight += $this.filter('[style*="height"]').length ? $this.height() : $this.children('table').height();
@ -5941,7 +5954,7 @@
}); });
ts.resizableReset = function( table, refreshing ) { ts.resizableReset = function( table, refreshing ) {
$( table ).each(function(){ $( table ).each(function() {
var index, $t, var index, $t,
c = this.config, c = this.config,
wo = c && c.widgetOptions, wo = c && c.widgetOptions,
@ -5975,7 +5988,7 @@
})( jQuery, window ); })( jQuery, window );
/*! Widget: saveSort - updated 10/31/2015 (v2.24.0) *//* /*! Widget: saveSort - updated 2018-03-18 (v2.30.0) *//*
* Requires tablesorter v2.16+ * Requires tablesorter v2.16+
* by Rob Garrison * by Rob Garrison
*/ */
@ -5983,6 +5996,15 @@
'use strict'; 'use strict';
var ts = $.tablesorter || {}; var ts = $.tablesorter || {};
function getStoredSortList(c) {
var stored = ts.storage( c.table, 'tablesorter-savesort' );
return (stored && stored.hasOwnProperty('sortList') && $.isArray(stored.sortList)) ? stored.sortList : '';
}
function sortListChanged(c, sortList) {
return (sortList || getStoredSortList(c)).join(',') !== c.sortList.join(',');
}
// this widget saves the last sort only if the // this widget saves the last sort only if the
// saveSort widget option is true AND the // saveSort widget option is true AND the
// $.tablesorter.storage function is included // $.tablesorter.storage function is included
@ -5998,18 +6020,19 @@
thisWidget.format(table, c, wo, true); thisWidget.format(table, c, wo, true);
}, },
format: function(table, c, wo, init) { format: function(table, c, wo, init) {
var stored, time, var time,
$table = c.$table, $table = c.$table,
saveSort = wo.saveSort !== false, // make saveSort active/inactive; default to true saveSort = wo.saveSort !== false, // make saveSort active/inactive; default to true
sortList = { 'sortList' : c.sortList }; sortList = { 'sortList' : c.sortList },
if (c.debug) { debug = ts.debug(c, 'saveSort');
if (debug) {
time = new Date(); time = new Date();
} }
if ($table.hasClass('hasSaveSort')) { if ($table.hasClass('hasSaveSort')) {
if (saveSort && table.hasInitialized && ts.storage) { if (saveSort && table.hasInitialized && ts.storage && sortListChanged(c)) {
ts.storage( table, 'tablesorter-savesort', sortList ); ts.storage( table, 'tablesorter-savesort', sortList );
if (c.debug) { if (debug) {
console.log('saveSort widget: Saving last sort: ' + c.sortList + ts.benchmark(time)); console.log('saveSort >> Saving last sort: ' + c.sortList + ts.benchmark(time));
} }
} }
} else { } else {
@ -6018,10 +6041,9 @@
sortList = ''; sortList = '';
// get data // get data
if (ts.storage) { if (ts.storage) {
stored = ts.storage( table, 'tablesorter-savesort' ); sortList = getStoredSortList(c);
sortList = (stored && stored.hasOwnProperty('sortList') && $.isArray(stored.sortList)) ? stored.sortList : ''; if (debug) {
if (c.debug) { console.log('saveSort >> Last sort loaded: "' + sortList + '"' + ts.benchmark(time));
console.log('saveSort: Last sort loaded: "' + sortList + '"' + ts.benchmark(time));
} }
$table.bind('saveSortReset', function(event) { $table.bind('saveSortReset', function(event) {
event.stopPropagation(); event.stopPropagation();
@ -6034,7 +6056,9 @@
c.sortList = sortList; c.sortList = sortList;
} else if (table.hasInitialized && sortList && sortList.length > 0) { } else if (table.hasInitialized && sortList && sortList.length > 0) {
// update sort change // update sort change
ts.sortOn( c, sortList ); if (sortListChanged(c, sortList)) {
ts.sortOn(c, sortList);
}
} }
} }
}, },

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@
} }
}(function(jQuery) { }(function(jQuery) {
/*! TableSorter (FORK) v2.29.6 *//* /*! TableSorter (FORK) v2.30.0 *//*
* 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.29.6', version : '2.30.0',
parsers : [], parsers : [],
widgets : [], widgets : [],
@ -44,8 +44,8 @@
showProcessing : false, // show an indeterminate timer icon in the header when the table is sorted or filtered. showProcessing : false, // show an indeterminate timer icon in the header when the table is sorted or filtered.
headerTemplate : '{content}',// header layout template (HTML ok); {content} = innerHTML, {icon} = <i/> // class from cssIcon headerTemplate : '{content}',// header layout template (HTML ok); {content} = innerHTML, {icon} = <i/> // class from cssIcon
onRenderTemplate : null, // function( index, template ){ return template; }, // template is a string onRenderTemplate : null, // function( index, template ) { return template; }, // template is a string
onRenderHeader : null, // function( index ){}, // nothing to return onRenderHeader : null, // function( index ) {}, // nothing to return
// *** functionality // *** functionality
cancelSelection : true, // prevent text selection in the header cancelSelection : true, // prevent text selection in the header
@ -74,7 +74,7 @@
emptyTo : 'bottom', // sort empty cell to bottom, top, none, zero, emptyMax, emptyMin emptyTo : 'bottom', // sort empty cell to bottom, top, none, zero, emptyMax, emptyMin
stringTo : 'max', // sort strings in numerical column as max, min, top, bottom, zero stringTo : 'max', // sort strings in numerical column as max, min, top, bottom, zero
duplicateSpan : true, // colspan cells in the tbody will have duplicated content in the cache for each spanned column duplicateSpan : true, // colspan cells in the tbody will have duplicated content in the cache for each spanned column
textExtraction : 'basic', // text extraction method/function - function( node, table, cellIndex ){} textExtraction : 'basic', // text extraction method/function - function( node, table, cellIndex ) {}
textAttribute : 'data-text',// data-attribute that contains alternate cell text (used in default textExtraction function) textAttribute : 'data-text',// data-attribute that contains alternate cell text (used in default textExtraction function)
textSorter : null, // choose overall or specific column sorter function( a, b, direction, table, columnIndex ) [alt: ts.sortText] textSorter : null, // choose overall or specific column sorter function( a, b, direction, table, columnIndex ) [alt: ts.sortText]
numberSorter : null, // choose overall numeric sorter function( a, b, direction, maxColumnValue ) numberSorter : null, // choose overall numeric sorter function( a, b, direction, maxColumnValue )
@ -88,7 +88,7 @@
}, },
// *** callbacks // *** callbacks
initialized : null, // function( table ){}, initialized : null, // function( table ) {},
// *** extra css class names // *** extra css class names
tableClass : '', tableClass : '',
@ -226,7 +226,7 @@
setup : function( table, c ) { setup : function( table, c ) {
// if no thead or tbody, or tablesorter is already present, quit // if no thead or tbody, or tablesorter is already present, quit
if ( !table || !table.tHead || table.tBodies.length === 0 || table.hasInitialized === true ) { if ( !table || !table.tHead || table.tBodies.length === 0 || table.hasInitialized === true ) {
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
if ( table.hasInitialized ) { if ( table.hasInitialized ) {
console.warn( 'Stopping initialization. Tablesorter has already been initialized' ); console.warn( 'Stopping initialization. Tablesorter has already been initialized' );
} else { } else {
@ -247,7 +247,7 @@
table.config = c; table.config = c;
// save the settings where they read // save the settings where they read
$.data( table, 'tablesorter', c ); $.data( table, 'tablesorter', c );
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter v' + ts.version ); console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter v' + ts.version );
$.data( table, 'startoveralltimer', new Date() ); $.data( table, 'startoveralltimer', new Date() );
} }
@ -353,9 +353,9 @@
// initialized // initialized
table.hasInitialized = true; table.hasInitialized = true;
table.isProcessing = false; table.isProcessing = false;
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
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 ( ts.debug(c, 'core') && console.groupEnd ) { console.groupEnd(); }
} }
$table.triggerHandler( 'tablesorter-initialized', table ); $table.triggerHandler( 'tablesorter-initialized', table );
if ( typeof c.initialized === 'function' ) { if ( typeof c.initialized === 'function' ) {
@ -552,7 +552,7 @@
c.headerList = []; c.headerList = [];
c.headerContent = []; c.headerContent = [];
c.sortVars = []; c.sortVars = [];
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
timer = new Date(); timer = new Date();
} }
// children tr in tfoot - see issue #196 & #547 // children tr in tfoot - see issue #196 & #547
@ -647,7 +647,7 @@
}); });
// enable/disable sorting // enable/disable sorting
ts.updateHeader( c ); ts.updateHeader( c );
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
console.log( 'Built headers:' + ts.benchmark( timer ) ); console.log( 'Built headers:' + ts.benchmark( timer ) );
console.log( c.$headers ); console.log( c.$headers );
} }
@ -670,14 +670,15 @@
noParser, parser, extractor, time, tbody, len, noParser, parser, extractor, time, tbody, len,
table = c.table, table = c.table,
tbodyIndex = 0, tbodyIndex = 0,
debug = {}; debug = ts.debug(c, 'core'),
debugOutput = {};
// update table bodies in case we start with an empty table // update table bodies in case we start with an empty table
c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' ); c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' );
tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies; tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies;
len = tbody.length; len = tbody.length;
if ( len === 0 ) { if ( len === 0 ) {
return c.debug ? console.warn( 'Warning: *Empty table!* Not building a parser cache' ) : ''; return debug ? console.warn( 'Warning: *Empty table!* Not building a parser cache' ) : '';
} else if ( c.debug ) { } else if ( debug ) {
time = new Date(); time = new Date();
console[ console.group ? 'group' : 'log' ]( 'Detecting parsers for each column' ); console[ console.group ? 'group' : 'log' ]( 'Detecting parsers for each column' );
} }
@ -719,8 +720,8 @@
if ( !parser ) { if ( !parser ) {
parser = ts.detectParserForColumn( c, rows, -1, colIndex ); parser = ts.detectParserForColumn( c, rows, -1, colIndex );
} }
if ( c.debug ) { if ( debug ) {
debug[ '(' + colIndex + ') ' + header.text() ] = { debugOutput[ '(' + colIndex + ') ' + header.text() ] = {
parser : parser.id, parser : parser.id,
extractor : extractor ? extractor.id : 'none', extractor : extractor ? extractor.id : 'none',
string : c.strings[ colIndex ], string : c.strings[ colIndex ],
@ -746,9 +747,9 @@
} }
tbodyIndex += ( list.parsers.length ) ? len : 1; tbodyIndex += ( list.parsers.length ) ? len : 1;
} }
if ( c.debug ) { if ( debug ) {
if ( !ts.isEmptyObject( debug ) ) { if ( !ts.isEmptyObject( debugOutput ) ) {
console[ console.table ? 'table' : 'log' ]( debug ); console[ console.table ? 'table' : 'log' ]( debugOutput );
} else { } else {
console.warn( ' No parsers detected!' ); console.warn( ' No parsers detected!' );
} }
@ -774,7 +775,7 @@
}, },
getParserById : function( name ) { getParserById : function( name ) {
/*jshint eqeqeq:false */ /*jshint eqeqeq:false */ // eslint-disable-next-line eqeqeq
if ( name == 'false' ) { return false; } if ( name == 'false' ) { return false; }
var indx, var indx,
len = ts.parsers.length; len = ts.parsers.length;
@ -791,6 +792,7 @@
indx = ts.parsers.length, indx = ts.parsers.length,
node = false, node = false,
nodeValue = '', nodeValue = '',
debug = ts.debug(c, 'core'),
keepLooking = true; keepLooking = true;
while ( nodeValue === '' && keepLooking ) { while ( nodeValue === '' && keepLooking ) {
rowIndex++; rowIndex++;
@ -801,7 +803,7 @@
node = rows[ rowIndex ].cells[ cellIndex ]; node = rows[ rowIndex ].cells[ cellIndex ];
nodeValue = ts.getElementText( c, node, cellIndex ); nodeValue = ts.getElementText( c, node, cellIndex );
$node = $( node ); $node = $( node );
if ( c.debug ) { if ( debug ) {
console.log( 'Checking if value was empty on row ' + rowIndex + ', column: ' + console.log( 'Checking if value was empty on row ' + rowIndex + ', column: ' +
cellIndex + ': "' + nodeValue + '"' ); cellIndex + ': "' + nodeValue + '"' );
} }
@ -883,7 +885,8 @@
cols, $cells, cell, cacheTime, totalRows, rowData, prevRowData, cols, $cells, cell, cacheTime, totalRows, rowData, prevRowData,
colMax, span, cacheIndex, hasParser, max, len, index, colMax, span, cacheIndex, hasParser, max, len, index,
table = c.table, table = c.table,
parsers = c.parsers; parsers = c.parsers,
debug = ts.debug(c, 'core');
// update tbody variable // update tbody variable
c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' ); c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' );
$tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies, $tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies,
@ -891,9 +894,9 @@
c.totalRows = 0; c.totalRows = 0;
// if no parsers found, return - it's an empty table. // if no parsers found, return - it's an empty table.
if ( !parsers ) { if ( !parsers ) {
return c.debug ? console.warn( 'Warning: *Empty table!* Not building a cache' ) : ''; return debug ? console.warn( 'Warning: *Empty table!* Not building a cache' ) : '';
} }
if ( c.debug ) { if ( debug ) {
cacheTime = new Date(); cacheTime = new Date();
} }
// processing icon // processing icon
@ -962,7 +965,7 @@
cell = $row[ 0 ].cells[ colIndex ]; cell = $row[ 0 ].cells[ colIndex ];
if ( cell && cacheIndex < c.columns ) { if ( cell && cacheIndex < c.columns ) {
hasParser = typeof parsers[ cacheIndex ] !== 'undefined'; hasParser = typeof parsers[ cacheIndex ] !== 'undefined';
if ( !hasParser && c.debug ) { if ( !hasParser && debug ) {
console.warn( 'No parser found for row: ' + rowIndex + ', column: ' + colIndex + console.warn( 'No parser found for row: ' + rowIndex + ', column: ' + colIndex +
'; cell containing: "' + $(cell).text() + '"; does it have a header?' ); '; cell containing: "' + $(cell).text() + '"; does it have a header?' );
} }
@ -1010,7 +1013,7 @@
if ( c.showProcessing ) { if ( c.showProcessing ) {
ts.isProcessing( table ); // remove processing icon ts.isProcessing( table ); // remove processing icon
} }
if ( c.debug ) { if ( debug ) {
len = Math.min( 5, c.cache[ 0 ].normalized.length ); len = Math.min( 5, c.cache[ 0 ].normalized.length );
console[ console.group ? 'group' : 'log' ]( 'Building cache for ' + c.totalRows + console[ console.group ? 'group' : 'log' ]( 'Building cache for ' + c.totalRows +
' rows (showing ' + len + ' rows in log) and ' + c.columns + ' columns' + ' rows (showing ' + len + ' rows in log) and ' + c.columns + ' columns' +
@ -1041,7 +1044,7 @@
data = { raw : [], parsed: [], $cell: [] }, data = { raw : [], parsed: [], $cell: [] },
c = table.config; c = table.config;
if ( ts.isEmptyObject( c ) ) { if ( ts.isEmptyObject( c ) ) {
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
console.warn( 'No cache found - aborting getColumnText function!' ); console.warn( 'No cache found - aborting getColumnText function!' );
} }
} else { } else {
@ -1135,8 +1138,8 @@
// direction = 2 means reset! // direction = 2 means reset!
if ( list[ indx ][ 1 ] !== 2 ) { if ( list[ indx ][ 1 ] !== 2 ) {
// multicolumn sorting updating - see #1005 // multicolumn sorting updating - see #1005
// .not(function(){}) needs jQuery 1.4 // .not(function() {}) needs jQuery 1.4
// filter(function(i, el){}) <- el is undefined in jQuery v1.2.6 // filter(function(i, el) {}) <- el is undefined in jQuery v1.2.6
$sorted = c.$headers.filter( function( i ) { $sorted = c.$headers.filter( function( i ) {
// only include headers that are in the sortList (this includes colspans) // only include headers that are in the sortList (this includes colspans)
var include = true, var include = true,
@ -1385,7 +1388,7 @@
ts.resortComplete( c, callback ); ts.resortComplete( c, callback );
} }
} else { } else {
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
console.error( 'updateCell aborted, tbody missing or not within the indicated table' ); console.error( 'updateCell aborted, tbody missing or not within the indicated table' );
} }
c.table.isUpdating = false; c.table.isUpdating = false;
@ -1408,7 +1411,7 @@
// row contained in the table? // row contained in the table?
( ts.getClosest( $row, 'table' )[ 0 ] !== c.table ) ( ts.getClosest( $row, 'table' )[ 0 ] !== c.table )
) { ) {
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
console.error( 'addRows method requires (1) a jQuery selector reference to rows that have already ' + console.error( 'addRows method requires (1) a jQuery selector reference to rows that have already ' +
'been added to the table, or (2) row HTML string to be added to a table with only one tbody' ); 'been added to the table, or (2) row HTML string to be added to a table with only one tbody' );
} }
@ -1480,7 +1483,6 @@
appendCache : function( c, init ) { appendCache : function( c, init ) {
var parsed, totalRows, $tbody, $curTbody, rowIndex, tbodyIndex, appendTime, var parsed, totalRows, $tbody, $curTbody, rowIndex, tbodyIndex, appendTime,
table = c.table, table = c.table,
wo = c.widgetOptions,
$tbodies = c.$tbodies, $tbodies = c.$tbodies,
rows = [], rows = [],
cache = c.cache; cache = c.cache;
@ -1490,7 +1492,7 @@
return c.appender ? c.appender( table, rows ) : return c.appender ? c.appender( table, rows ) :
table.isUpdating ? c.$table.triggerHandler( 'updateComplete', table ) : ''; // Fixes #532 table.isUpdating ? c.$table.triggerHandler( 'updateComplete', table ) : ''; // Fixes #532
} }
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
appendTime = new Date(); appendTime = new Date();
} }
for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) { for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
@ -1503,7 +1505,7 @@
for ( rowIndex = 0; rowIndex < totalRows; rowIndex++ ) { for ( rowIndex = 0; rowIndex < totalRows; rowIndex++ ) {
rows[rows.length] = parsed[ rowIndex ][ c.columns ].$row; rows[rows.length] = parsed[ rowIndex ][ c.columns ].$row;
// removeRows used by the pager plugin; don't render if using ajax - fixes #411 // removeRows used by the pager plugin; don't render if using ajax - fixes #411
if ( !c.appender || ( c.pager && ( !c.pager.removeRows || !wo.pager_removeRows ) && !c.pager.ajax ) ) { if ( !c.appender || ( c.pager && !c.pager.removeRows && !c.pager.ajax ) ) {
$curTbody.append( parsed[ rowIndex ][ c.columns ].$row ); $curTbody.append( parsed[ rowIndex ][ c.columns ].$row );
} }
} }
@ -1514,7 +1516,7 @@
if ( c.appender ) { if ( c.appender ) {
c.appender( table, rows ); c.appender( table, rows );
} }
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
console.log( 'Rebuilt table' + ts.benchmark( appendTime ) ); console.log( 'Rebuilt table' + ts.benchmark( appendTime ) );
} }
// apply table widgets; but not before ajax completes // apply table widgets; but not before ajax completes
@ -1545,7 +1547,7 @@
initSort : function( c, cell, event ) { initSort : function( c, cell, event ) {
if ( c.table.isUpdating ) { if ( c.table.isUpdating ) {
// let any updates complete before initializing a sort // let any updates complete before initializing a sort
return setTimeout( function(){ return setTimeout( function() {
ts.initSort( c, cell, event ); ts.initSort( c, cell, event );
}, 50 ); }, 50 );
} }
@ -1696,7 +1698,7 @@
// empty table - fixes #206/#346 // empty table - fixes #206/#346
return; return;
} }
if ( c.debug ) { sortTime = new Date(); } if ( ts.debug(c, 'core') ) { sortTime = new Date(); }
// cache textSorter to optimize speed // cache textSorter to optimize speed
if ( typeof textSorter === 'object' ) { if ( typeof textSorter === 'object' ) {
colMax = c.columns; colMax = c.columns;
@ -1758,7 +1760,7 @@
return a[ c.columns ].order - b[ c.columns ].order; return a[ c.columns ].order - b[ c.columns ].order;
}); });
} }
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
console.log( 'Applying sort ' + sortList.toString() + ts.benchmark( sortTime ) ); console.log( 'Applying sort ' + sortList.toString() + ts.benchmark( sortTime ) );
} }
}, },
@ -2011,6 +2013,7 @@
var applied, time, name, var applied, time, name,
c = table.config, c = table.config,
wo = c.widgetOptions, wo = c.widgetOptions,
debug = ts.debug(c, 'core'),
widget = ts.getWidgetById( id ); widget = ts.getWidgetById( id );
if ( widget ) { if ( widget ) {
name = widget.id; name = widget.id;
@ -2019,7 +2022,7 @@
if ( $.inArray( name, c.widgets ) < 0 ) { if ( $.inArray( name, c.widgets ) < 0 ) {
c.widgets[ c.widgets.length ] = name; c.widgets[ c.widgets.length ] = name;
} }
if ( c.debug ) { time = new Date(); } if ( debug ) { time = new Date(); }
if ( init || !( c.widgetInit[ name ] ) ) { if ( init || !( c.widgetInit[ name ] ) ) {
// set init flag first to prevent calling init more than once (e.g. pager) // set init flag first to prevent calling init more than once (e.g. pager)
@ -2030,7 +2033,7 @@
} }
if ( typeof widget.init === 'function' ) { if ( typeof widget.init === 'function' ) {
applied = true; applied = true;
if ( c.debug ) { if ( debug ) {
console[ console.group ? 'group' : 'log' ]( 'Initializing ' + name + ' widget' ); console[ console.group ? 'group' : 'log' ]( 'Initializing ' + name + ' widget' );
} }
widget.init( table, widget, c, wo ); widget.init( table, widget, c, wo );
@ -2038,12 +2041,12 @@
} }
if ( !init && typeof widget.format === 'function' ) { if ( !init && typeof widget.format === 'function' ) {
applied = true; applied = true;
if ( c.debug ) { if ( debug ) {
console[ console.group ? 'group' : 'log' ]( 'Updating ' + name + ' widget' ); console[ console.group ? 'group' : 'log' ]( 'Updating ' + name + ' widget' );
} }
widget.format( table, c, wo, false ); widget.format( table, c, wo, false );
} }
if ( c.debug ) { if ( debug ) {
if ( applied ) { if ( applied ) {
console.log( 'Completed ' + ( init ? 'initializing ' : 'applying ' ) + name + ' widget' + ts.benchmark( time ) ); console.log( 'Completed ' + ( init ? 'initializing ' : 'applying ' ) + name + ' widget' + ts.benchmark( time ) );
if ( console.groupEnd ) { console.groupEnd(); } if ( console.groupEnd ) { console.groupEnd(); }
@ -2056,12 +2059,13 @@
table = $( table )[ 0 ]; // in case this is called externally table = $( table )[ 0 ]; // in case this is called externally
var indx, len, names, widget, time, var indx, len, names, widget, time,
c = table.config, c = table.config,
debug = ts.debug(c, 'core'),
widgets = []; widgets = [];
// prevent numerous consecutive widget applications // prevent numerous consecutive widget applications
if ( init !== false && table.hasInitialized && ( table.isApplyingWidgets || table.isUpdating ) ) { if ( init !== false && table.hasInitialized && ( table.isApplyingWidgets || table.isUpdating ) ) {
return; return;
} }
if ( c.debug ) { time = new Date(); } if ( debug ) { time = new Date(); }
ts.addWidgetFromClass( table ); ts.addWidgetFromClass( table );
// prevent "tablesorter-ready" from firing multiple times in a row // prevent "tablesorter-ready" from firing multiple times in a row
clearTimeout( c.timerReady ); clearTimeout( c.timerReady );
@ -2080,7 +2084,7 @@
// set priority to 10 if not defined // set priority to 10 if not defined
if ( !widget.priority ) { widget.priority = 10; } if ( !widget.priority ) { widget.priority = 10; }
widgets[ indx ] = widget; widgets[ indx ] = widget;
} else if ( c.debug ) { } else if ( debug ) {
console.warn( '"' + names[ indx ] + '" was enabled, but the widget code has not been loaded!' ); console.warn( '"' + names[ indx ] + '" was enabled, but the widget code has not been loaded!' );
} }
} }
@ -2090,7 +2094,7 @@
}); });
// add/update selected widgets // add/update selected widgets
len = widgets.length; len = widgets.length;
if ( c.debug ) { if ( debug ) {
console[ console.group ? 'group' : 'log' ]( 'Start ' + ( init ? 'initializing' : 'applying' ) + ' widgets' ); console[ console.group ? 'group' : 'log' ]( 'Start ' + ( init ? 'initializing' : 'applying' ) + ' widgets' );
} }
for ( indx = 0; indx < len; indx++ ) { for ( indx = 0; indx < len; indx++ ) {
@ -2099,7 +2103,7 @@
ts.applyWidgetId( table, widget.id, init ); ts.applyWidgetId( table, widget.id, init );
} }
} }
if ( c.debug && console.groupEnd ) { console.groupEnd(); } if ( debug && console.groupEnd ) { console.groupEnd(); }
} }
c.timerReady = setTimeout( function() { c.timerReady = setTimeout( function() {
table.isApplyingWidgets = false; table.isApplyingWidgets = false;
@ -2109,7 +2113,7 @@
if ( !init && typeof callback === 'function' ) { if ( !init && typeof callback === 'function' ) {
callback( table ); callback( table );
} }
if ( c.debug ) { if ( debug ) {
widget = c.widgets.length; widget = c.widgets.length;
console.log( 'Completed ' + console.log( 'Completed ' +
( init === true ? 'initializing ' : 'applying ' ) + widget + ( init === true ? 'initializing ' : 'applying ' ) + widget +
@ -2146,7 +2150,7 @@
c.widgets.splice( indx, 1 ); c.widgets.splice( indx, 1 );
} }
if ( widget && widget.remove ) { if ( widget && widget.remove ) {
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
console.log( ( refreshing ? 'Refreshing' : 'Removing' ) + ' "' + name[ index ] + '" widget' ); console.log( ( refreshing ? 'Refreshing' : 'Removing' ) + ' "' + name[ index ] + '" widget' );
} }
widget.remove( table, c, c.widgetOptions, refreshing ); widget.remove( table, c, c.widgetOptions, refreshing );
@ -2200,6 +2204,12 @@
log : function() { log : function() {
console.log( arguments ); console.log( arguments );
}, },
debug : function(c, name) {
return c && (
c.debug === true ||
typeof c.debug === 'string' && c.debug.indexOf(name) > -1
);
},
// $.isEmptyObject from jQuery v1.4 // $.isEmptyObject from jQuery v1.4
isEmptyObject : function( obj ) { isEmptyObject : function( obj ) {
@ -2505,7 +2515,7 @@
ignore = 'headers sortForce sortList sortAppend widgets'.split( ' ' ), ignore = 'headers sortForce sortList sortAppend widgets'.split( ' ' ),
orig = c.originalSettings; orig = c.originalSettings;
if ( orig ) { if ( orig ) {
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
timer = new Date(); timer = new Date();
} }
for ( setting in orig ) { for ( setting in orig ) {
@ -2521,7 +2531,7 @@
} }
} }
} }
if ( c.debug ) { if ( ts.debug(c, 'core') ) {
console.log( 'validate options time:' + ts.benchmark( timer ) ); console.log( 'validate options time:' + ts.benchmark( timer ) );
} }
} }
@ -2552,7 +2562,6 @@
var events, var events,
$t = $( table ), $t = $( table ),
c = table.config, c = table.config,
debug = c.debug,
$h = $t.find( 'thead:first' ), $h = $t.find( 'thead:first' ),
$r = $h.find( 'tr.' + ts.css.headerRow ).removeClass( ts.css.headerRow + ' ' + c.cssHeaderRow ), $r = $h.find( 'tr.' + ts.css.headerRow ).removeClass( ts.css.headerRow + ' ' + c.cssHeaderRow ),
$f = $t.find( 'tfoot:first > tr' ).children( 'th, td' ); $f = $t.find( 'tfoot:first > tr' ).children( 'th, td' );
@ -2590,7 +2599,7 @@
if ( typeof callback === 'function' ) { if ( typeof callback === 'function' ) {
callback( table ); callback( table );
} }
if ( debug ) { if ( ts.debug(c, 'core') ) {
console.log( 'tablesorter has been removed' ); console.log( 'tablesorter has been removed' );
} }
} }
@ -2707,7 +2716,7 @@
is : function( str ) { is : function( str ) {
return ts.regex.isoDate.test( str ); return ts.regex.isoDate.test( str );
}, },
format : function( str, table ) { format : function( str ) {
var date = str ? new Date( str.replace( ts.regex.dash, '/' ) ) : str; var date = str ? new Date( str.replace( ts.regex.dash, '/' ) ) : str;
return date instanceof Date && isFinite( date ) ? date.getTime() : str; return date instanceof Date && isFinite( date ) ? date.getTime() : str;
}, },
@ -2750,7 +2759,7 @@
// Jan 01, 2013 12:34:56 PM or 01 Jan 2013 // Jan 01, 2013 12:34:56 PM or 01 Jan 2013
return ts.regex.usLongDateTest1.test( str ) || ts.regex.usLongDateTest2.test( str ); return ts.regex.usLongDateTest1.test( str ) || ts.regex.usLongDateTest2.test( str );
}, },
format : function( str, table ) { format : function( str ) {
var date = str ? new Date( str.replace( ts.regex.dateReplace, '$1 $2' ) ) : str; var date = str ? new Date( str.replace( ts.regex.dateReplace, '$1 $2' ) ) : str;
return date instanceof Date && isFinite( date ) ? date.getTime() : str; return date instanceof Date && isFinite( date ) ? date.getTime() : str;
}, },
@ -2811,7 +2820,7 @@
is : function( str ) { is : function( str ) {
return ts.regex.timeTest.test( str ); return ts.regex.timeTest.test( str );
}, },
format : function( str, table ) { format : function( str ) {
// isolate time... ignore month, day and year // isolate time... ignore month, day and year
var temp, var temp,
timePart = ( str || '' ).match( ts.regex.timeMatch ), timePart = ( str || '' ).match( ts.regex.timeMatch ),
@ -2878,7 +2887,7 @@
var tbodyIndex, $tbody, var tbodyIndex, $tbody,
$tbodies = c.$tbodies, $tbodies = c.$tbodies,
toRemove = ( wo.zebra || [ 'even', 'odd' ] ).join( ' ' ); toRemove = ( wo.zebra || [ 'even', 'odd' ] ).join( ' ' );
for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ){ for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
$tbody = ts.processTbody( table, $tbodies.eq( tbodyIndex ), true ); // remove tbody $tbody = ts.processTbody( table, $tbodies.eq( tbodyIndex ), true ); // remove tbody
$tbody.children().removeClass( toRemove ); $tbody.children().removeClass( toRemove );
ts.processTbody( table, $tbody, false ); // restore tbody ts.processTbody( table, $tbody, false ); // restore tbody

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 2018-02-25 (v2.29.6)*/ /*! tablesorter (FORK) - updated 2018-03-18 (v2.30.0)*/
/* 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) {
/*! Widget: storage - updated 4/18/2017 (v2.28.8) */ /*! Widget: storage - updated 2018-03-18 (v2.30.0) */
/*global JSON:false */ /*global JSON:false */
;(function ($, window, document) { ;(function ($, window, document) {
'use strict'; 'use strict';
@ -56,6 +56,7 @@
values = {}, values = {},
c = table.config, c = table.config,
wo = c && c.widgetOptions, wo = c && c.widgetOptions,
debug = ts.debug(c, 'storage'),
storageType = ( storageType = (
( options && options.storageType ) || ( wo && wo.storage_storageType ) ( options && options.storageType ) || ( wo && wo.storage_storageType )
).toString().charAt(0).toLowerCase(), ).toString().charAt(0).toLowerCase(),
@ -84,14 +85,12 @@
hasStorage = true; hasStorage = true;
window[storageType].removeItem('_tmptest'); window[storageType].removeItem('_tmptest');
} catch (error) { } catch (error) {
if (c && c.debug) { console.warn( storageType + ' is not supported in this browser' );
console.warn( storageType + ' is not supported in this browser' );
}
} }
} }
} }
if (c.debug) { if (debug) {
console.log('Storage widget using', hasStorage ? storageType : 'cookies'); console.log('Storage >> Using', hasStorage ? storageType : 'cookies');
} }
// *** get value *** // *** get value ***
if ($.parseJSON) { if ($.parseJSON) {
@ -127,7 +126,7 @@
})(jQuery, window, document); })(jQuery, window, document);
/*! Widget: uitheme - updated 9/27/2017 (v2.29.0) */ /*! Widget: uitheme - updated 2018-03-18 (v2.30.0) */
;(function ($) { ;(function ($) {
'use strict'; 'use strict';
var ts = $.tablesorter || {}; var ts = $.tablesorter || {};
@ -192,8 +191,9 @@
theme = c.theme || 'jui', theme = c.theme || 'jui',
themes = themesAll[theme] || {}, themes = themesAll[theme] || {},
remove = $.trim( [ themes.sortNone, themes.sortDesc, themes.sortAsc, themes.active ].join( ' ' ) ), remove = $.trim( [ themes.sortNone, themes.sortDesc, themes.sortAsc, themes.active ].join( ' ' ) ),
iconRmv = $.trim( [ themes.iconSortNone, themes.iconSortDesc, themes.iconSortAsc ].join( ' ' ) ); iconRmv = $.trim( [ themes.iconSortNone, themes.iconSortDesc, themes.iconSortAsc ].join( ' ' ) ),
if (c.debug) { time = new Date(); } debug = ts.debug(c, 'uitheme');
if (debug) { time = new Date(); }
// initialization code - run once // initialization code - run once
if (!$table.hasClass('tablesorter-' + theme) || c.theme !== c.appliedTheme || !wo.uitheme_applied) { if (!$table.hasClass('tablesorter-' + theme) || c.theme !== c.appliedTheme || !wo.uitheme_applied) {
wo.uitheme_applied = true; wo.uitheme_applied = true;
@ -238,7 +238,7 @@
$(this)[ event.type === 'mouseenter' ? 'addClass' : 'removeClass' ](themes.hover || ''); $(this)[ event.type === 'mouseenter' ? 'addClass' : 'removeClass' ](themes.hover || '');
}); });
$headers.each(function(){ $headers.each(function() {
var $this = $(this); var $this = $(this);
if (!$this.find('.' + ts.css.wrapper).length) { if (!$this.find('.' + ts.css.wrapper).length) {
// Firefox needs this inner div to position the icon & resizer correctly // Firefox needs this inner div to position the icon & resizer correctly
@ -296,8 +296,8 @@
} }
} }
} }
if (c.debug) { if (debug) {
console.log('Applying ' + theme + ' theme' + ts.benchmark(time)); console.log('uitheme >> Applied ' + theme + ' theme' + ts.benchmark(time));
} }
}, },
remove: function(table, c, wo, refreshing) { remove: function(table, c, wo, refreshing) {
@ -402,7 +402,7 @@
})(jQuery); })(jQuery);
/*! Widget: filter - updated 2018-01-30 (v2.29.5) *//* /*! Widget: filter - updated 2018-03-18 (v2.30.0) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+ * Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison * by Rob Garrison
*/ */
@ -684,6 +684,7 @@
if ( tsfRegex.exact.test( data.iFilter ) ) { if ( tsfRegex.exact.test( data.iFilter ) ) {
var txt = data.iFilter.replace( tsfRegex.exact, '' ), var txt = data.iFilter.replace( tsfRegex.exact, '' ),
filter = tsf.parseFilter( c, txt, data ) || ''; filter = tsf.parseFilter( c, txt, data ) || '';
// eslint-disable-next-line eqeqeq
return data.anyMatch ? $.inArray( filter, data.rowArray ) >= 0 : filter == data.iExact; return data.anyMatch ? $.inArray( filter, data.rowArray ) >= 0 : filter == data.iExact;
} }
return null; return null;
@ -857,7 +858,7 @@
c.lastCombinedFilter = null; c.lastCombinedFilter = null;
c.lastSearch = []; c.lastSearch = [];
// update filterFormatters after update (& small delay) - Fixes #1237 // update filterFormatters after update (& small delay) - Fixes #1237
setTimeout(function(){ setTimeout(function() {
c.$table.triggerHandler( 'filterFomatterUpdate' ); c.$table.triggerHandler( 'filterFomatterUpdate' );
}, 100); }, 100);
} }
@ -951,7 +952,7 @@
// show processing icon // show processing icon
if ( c.showProcessing ) { if ( c.showProcessing ) {
txt = 'filterStart filterEnd '.split( ' ' ).join( c.namespace + 'filter ' ); txt = 'filterStart filterEnd '.split( ' ' ).join( c.namespace + 'filter-sp ' );
c.$table c.$table
.unbind( txt.replace( ts.regex.spaces, ' ' ) ) .unbind( txt.replace( ts.regex.spaces, ' ' ) )
.bind( txt, function( event, columns ) { .bind( txt, function( event, columns ) {
@ -1030,6 +1031,9 @@
c.lastSearch = c.$table.data( 'lastSearch' ); c.lastSearch = c.$table.data( 'lastSearch' );
c.$table.triggerHandler( 'filterInit', c ); c.$table.triggerHandler( 'filterInit', c );
tsf.findRows( c.table, c.lastSearch || [] ); tsf.findRows( c.table, c.lastSearch || [] );
if (ts.debug(c, 'filter')) {
console.log('Filter >> Widget initialized');
}
}; };
if ( $.isEmptyObject( wo.filter_formatter ) ) { if ( $.isEmptyObject( wo.filter_formatter ) ) {
completed(); completed();
@ -1730,6 +1734,7 @@
storedFilters = $.extend( [], filters ), storedFilters = $.extend( [], filters ),
c = table.config, c = table.config,
wo = c.widgetOptions, wo = c.widgetOptions,
debug = ts.debug(c, 'filter'),
// data object passed to filters; anyMatch is a flag for the filters // data object passed to filters; anyMatch is a flag for the filters
data = { data = {
anyMatch: false, anyMatch: false,
@ -1746,7 +1751,6 @@
defaultColFilter : [], defaultColFilter : [],
defaultAnyFilter : ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) || '' defaultAnyFilter : ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) || ''
}; };
// parse columns after formatter, in case the class is added at that point // parse columns after formatter, in case the class is added at that point
data.parsed = []; data.parsed = [];
for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) { for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) {
@ -1768,8 +1772,8 @@
( ts.getColumnData( table, wo.filter_excludeFilter, columnIndex, true ) || '' ).split( /\s+/ ); ( ts.getColumnData( table, wo.filter_excludeFilter, columnIndex, true ) || '' ).split( /\s+/ );
} }
if ( c.debug ) { if ( debug ) {
console.log( 'Filter: Starting filter widget search', filters ); console.log( 'Filter >> Starting filter widget search', filters );
time = new Date(); time = new Date();
} }
// filtered rows count // filtered rows count
@ -1867,8 +1871,8 @@
notFiltered = $rows.not( '.' + wo.filter_filteredRow ).length; notFiltered = $rows.not( '.' + wo.filter_filteredRow ).length;
// can't search when all rows are hidden - this happens when looking for exact matches // can't search when all rows are hidden - this happens when looking for exact matches
if ( searchFiltered && notFiltered === 0 ) { searchFiltered = false; } if ( searchFiltered && notFiltered === 0 ) { searchFiltered = false; }
if ( c.debug ) { if ( debug ) {
console.log( 'Filter: Searching through ' + console.log( 'Filter >> Searching through ' +
( searchFiltered && notFiltered < len ? notFiltered : 'all' ) + ' rows' ); ( searchFiltered && notFiltered < len ? notFiltered : 'all' ) + ' rows' );
} }
if ( data.anyMatchFlag ) { if ( data.anyMatchFlag ) {
@ -1971,8 +1975,8 @@
if ( wo.filter_saveFilters && ts.storage ) { if ( wo.filter_saveFilters && ts.storage ) {
ts.storage( table, 'tablesorter-filters', tsf.processFilters( storedFilters, true ) ); ts.storage( table, 'tablesorter-filters', tsf.processFilters( storedFilters, true ) );
} }
if ( c.debug ) { if ( debug ) {
console.log( 'Completed filter widget search' + ts.benchmark(time) ); console.log( 'Filter >> Completed search' + ts.benchmark(time) );
} }
if ( wo.filter_initialized ) { if ( wo.filter_initialized ) {
c.$table.triggerHandler( 'filterBeforeEnd', c ); c.$table.triggerHandler( 'filterBeforeEnd', c );
@ -2187,13 +2191,13 @@
options += '<option'; options += '<option';
for ( val in option ) { for ( val in option ) {
if ( option.hasOwnProperty( val ) && val !== 'text' ) { if ( option.hasOwnProperty( val ) && val !== 'text' ) {
options += ' ' + val + '="' + option[ val ] + '"'; options += ' ' + val + '="' + option[ val ].replace( tsfRegex.quote, '&quot;' ) + '"';
} }
} }
if ( !option.value ) { if ( !option.value ) {
options += ' value="' + option.text + '"'; options += ' value="' + option.text.replace( tsfRegex.quote, '&quot;' ) + '"';
} }
options += '>' + option.text + '</option>'; options += '>' + option.text.replace( tsfRegex.quote, '&quot;' ) + '</option>';
// above code is needed in jQuery < v1.8 // above code is needed in jQuery < v1.8
// make sure we don't turn an object into a string (objects without a "text" property) // make sure we don't turn an object into a string (objects without a "text" property)
@ -2477,7 +2481,7 @@
$stickyThead = $stickyTable.children('thead:first'), $stickyThead = $stickyTable.children('thead:first'),
$stickyCells, $stickyCells,
laststate = '', laststate = '',
setWidth = function($orig, $clone){ setWidth = function($orig, $clone) {
var index, width, border, $cell, $this, var index, width, border, $cell, $this,
$cells = $orig.filter(':visible'), $cells = $orig.filter(':visible'),
len = $cells.length; len = $cells.length;
@ -2618,7 +2622,7 @@
}); });
c.$table c.$table
.unbind('stickyHeadersUpdate' + namespace) .unbind('stickyHeadersUpdate' + namespace)
.bind('stickyHeadersUpdate' + namespace, function(){ .bind('stickyHeadersUpdate' + namespace, function() {
scrollSticky( true ); scrollSticky( true );
}); });
@ -2694,7 +2698,7 @@
}); });
// Add extra scroller css // Add extra scroller css
$(function(){ $(function() {
var s = '<style>' + var s = '<style>' +
'body.' + ts.css.resizableNoSelect + ' { -ms-user-select: none; -moz-user-select: -moz-none;' + 'body.' + ts.css.resizableNoSelect + ' { -ms-user-select: none; -moz-user-select: -moz-none;' +
'-khtml-user-select: none; -webkit-user-select: none; user-select: none; }' + '-khtml-user-select: none; -webkit-user-select: none; user-select: none; }' +
@ -2839,7 +2843,7 @@
if ( ts.hasWidget( c.table, 'scroller' ) ) { if ( ts.hasWidget( c.table, 'scroller' ) ) {
tableHeight = 0; tableHeight = 0;
c.$table.closest( '.' + ts.css.scrollerWrap ).children().each(function(){ c.$table.closest( '.' + ts.css.scrollerWrap ).children().each(function() {
var $this = $(this); var $this = $(this);
// center table has a max-height set // center table has a max-height set
tableHeight += $this.filter('[style*="height"]').length ? $this.height() : $this.children('table').height(); tableHeight += $this.filter('[style*="height"]').length ? $this.height() : $this.children('table').height();
@ -3061,7 +3065,7 @@
}); });
ts.resizableReset = function( table, refreshing ) { ts.resizableReset = function( table, refreshing ) {
$( table ).each(function(){ $( table ).each(function() {
var index, $t, var index, $t,
c = this.config, c = this.config,
wo = c && c.widgetOptions, wo = c && c.widgetOptions,
@ -3095,7 +3099,7 @@
})( jQuery, window ); })( jQuery, window );
/*! Widget: saveSort - updated 10/31/2015 (v2.24.0) *//* /*! Widget: saveSort - updated 2018-03-18 (v2.30.0) *//*
* Requires tablesorter v2.16+ * Requires tablesorter v2.16+
* by Rob Garrison * by Rob Garrison
*/ */
@ -3103,6 +3107,15 @@
'use strict'; 'use strict';
var ts = $.tablesorter || {}; var ts = $.tablesorter || {};
function getStoredSortList(c) {
var stored = ts.storage( c.table, 'tablesorter-savesort' );
return (stored && stored.hasOwnProperty('sortList') && $.isArray(stored.sortList)) ? stored.sortList : '';
}
function sortListChanged(c, sortList) {
return (sortList || getStoredSortList(c)).join(',') !== c.sortList.join(',');
}
// this widget saves the last sort only if the // this widget saves the last sort only if the
// saveSort widget option is true AND the // saveSort widget option is true AND the
// $.tablesorter.storage function is included // $.tablesorter.storage function is included
@ -3118,18 +3131,19 @@
thisWidget.format(table, c, wo, true); thisWidget.format(table, c, wo, true);
}, },
format: function(table, c, wo, init) { format: function(table, c, wo, init) {
var stored, time, var time,
$table = c.$table, $table = c.$table,
saveSort = wo.saveSort !== false, // make saveSort active/inactive; default to true saveSort = wo.saveSort !== false, // make saveSort active/inactive; default to true
sortList = { 'sortList' : c.sortList }; sortList = { 'sortList' : c.sortList },
if (c.debug) { debug = ts.debug(c, 'saveSort');
if (debug) {
time = new Date(); time = new Date();
} }
if ($table.hasClass('hasSaveSort')) { if ($table.hasClass('hasSaveSort')) {
if (saveSort && table.hasInitialized && ts.storage) { if (saveSort && table.hasInitialized && ts.storage && sortListChanged(c)) {
ts.storage( table, 'tablesorter-savesort', sortList ); ts.storage( table, 'tablesorter-savesort', sortList );
if (c.debug) { if (debug) {
console.log('saveSort widget: Saving last sort: ' + c.sortList + ts.benchmark(time)); console.log('saveSort >> Saving last sort: ' + c.sortList + ts.benchmark(time));
} }
} }
} else { } else {
@ -3138,10 +3152,9 @@
sortList = ''; sortList = '';
// get data // get data
if (ts.storage) { if (ts.storage) {
stored = ts.storage( table, 'tablesorter-savesort' ); sortList = getStoredSortList(c);
sortList = (stored && stored.hasOwnProperty('sortList') && $.isArray(stored.sortList)) ? stored.sortList : ''; if (debug) {
if (c.debug) { console.log('saveSort >> Last sort loaded: "' + sortList + '"' + ts.benchmark(time));
console.log('saveSort: Last sort loaded: "' + sortList + '"' + ts.benchmark(time));
} }
$table.bind('saveSortReset', function(event) { $table.bind('saveSortReset', function(event) {
event.stopPropagation(); event.stopPropagation();
@ -3154,7 +3167,9 @@
c.sortList = sortList; c.sortList = sortList;
} else if (table.hasInitialized && sortList && sortList.length > 0) { } else if (table.hasInitialized && sortList && sortList.length > 0) {
// update sort change // update sort change
ts.sortOn( c, sortList ); if (sortListChanged(c, sortList)) {
ts.sortOn(c, sortList);
}
} }
} }
}, },

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*! Parser: network - updated 2018-01-10 (v2.29.3) */ /*! Parser: network - updated 2018-01-10 (v2.29.3) */
!function(d){"use strict";var e,t,a=d.tablesorter;/*! IPv6 Address parser (WIP) */ !function(d){"use strict";var e,t,a=d.tablesorter;/*! IPv6 Address parser (WIP) */
d.extend(a.regex,{},{ipv4Validate:/((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})/,ipv4Extract:/([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/,ipv6Validate:/^\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/i}),a.defaults.ipv6HexFormat=!1,a.addParser({id:"ipv6Address",is:function(d){return a.regex.ipv6Validate.test(d)},format:function(d,e){var t,r,i,f,s,n=!!e&&("boolean"==typeof e?e:e&&e.config.ipv6HexFormat||!1),p="",o="";if(d=d.replace(/\s*/g,""),a.regex.ipv4Validate.test(d)){for(f=d.match(a.regex.ipv4Extract),r="",t=1;t<f.length;t++)r+=("00"+parseInt(f[t],10).toString(16)).slice(-2)+(2===t?":":"");d=d.replace(a.regex.ipv4Extract,r)}if(-1==d.indexOf("::"))p=d;else{for(i=d.split("::"),s=0,t=0;t<i.length;t++)s+=i[t].split(":").length;for(p+=i[0]+":",t=0;t<8-s;t++)p+="0000:";p+=i[1]}for(f=p.split(":"),t=0;t<8;t++)f[t]=n?("0000"+f[t]).slice(-4):("00000"+(parseInt(f[t],16)||0)).slice(-5),o+=7!=t?f[t]+":":f[t];return o},type:"text"}),t=function(d){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(d)},e=function(d){var e,t=d?d.split("."):"",a=[],r=t.length;for(e=0;e<r;e++)a.push(("000"+t[e]).slice(-3));return d?a.join("."):d},/*! Parser: ipv4Address (a.k.a. ipAddress) */ d.extend(a.regex,{},{ipv4Validate:/((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})/,ipv4Extract:/([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/,ipv6Validate:/^\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/i}),a.defaults.ipv6HexFormat=!1,a.addParser({id:"ipv6Address",is:function(d){return a.regex.ipv6Validate.test(d)},format:function(d,e){var t,r,i,f,s,n=!!e&&("boolean"==typeof e?e:e&&e.config.ipv6HexFormat||!1),p="",o="";if(d=d.replace(/\s*/g,""),a.regex.ipv4Validate.test(d)){for(f=d.match(a.regex.ipv4Extract),r="",t=1;t<f.length;t++)r+=("00"+parseInt(f[t],10).toString(16)).slice(-2)+(2===t?":":"");d=d.replace(a.regex.ipv4Extract,r)}if(-1===d.indexOf("::"))p=d;else{for(i=d.split("::"),s=0,t=0;t<i.length;t++)s+=i[t].split(":").length;for(p+=i[0]+":",t=0;t<8-s;t++)p+="0000:";p+=i[1]}for(f=p.split(":"),t=0;t<8;t++)f[t]=n?("0000"+f[t]).slice(-4):("00000"+(parseInt(f[t],16)||0)).slice(-5),o+=7!==t?f[t]+":":f[t];return o},type:"text"}),t=function(d){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(d)},e=function(d){var e,t=d?d.split("."):"",a=[],r=t.length;for(e=0;e<r;e++)a.push(("000"+t[e]).slice(-3));return d?a.join("."):d},/*! Parser: ipv4Address (a.k.a. ipAddress) */
a.addParser({id:"ipAddress",is:t,format:e,type:"text"}),a.addParser({id:"ipv4Address",is:t,format:e,type:"text"}),/*! Parser: MAC address */ a.addParser({id:"ipAddress",is:t,format:e,type:"text"}),a.addParser({id:"ipv4Address",is:t,format:e,type:"text"}),/*! Parser: MAC address */
a.addParser({id:"MAC",is:function(){return!1},format:function(d){var e,t,a=[],r=(d||"").replace(/[:.-]/g,"").match(/\w{2}/g);if(r){for(t=r.length,e=0;e<t;e++)a.push(("000"+parseInt(r[e],16)).slice(-3));return a.join(".")}return d},type:"text"})}(jQuery); a.addParser({id:"MAC",is:function(){return!1},format:function(d){var e,t,a=[],r=(d||"").replace(/[:.-]/g,"").match(/\w{2}/g);if(r){for(t=r.length,e=0;e<t;e++)a.push(("000"+parseInt(r[e],16)).slice(-3));return a.join(".")}return d},type:"text"})}(jQuery);

View File

@ -1,2 +1,2 @@
/*! Parser: roman - updated 6/28/MMXIV (v2.17.3) */ /*! Parser: roman - updated 6/28/MMXIV (v2.17.3) */
!function(r){"use strict";var t=/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/i,e=/\b([MCDLXVI]+\b)/gi,n={I:1,V:5,X:10,L:50,C:100,D:500,M:1e3};r.tablesorter.addParser({id:"roman",is:function(){return!1},format:function(r){var e,i=r.toUpperCase().split(""),a=0;if(!r||!t.test(r))return r;for(;i.length;)a+=(e=n[i.shift()])*(e<n[i[0]]?-1:1);return a},type:"numeric"}),r.tablesorter.addParser({id:"roman-ignore",is:function(){return!1},format:function(i,a,o,s){var u,f,c=a.config,p=r.isArray(c.roman_ignore)?c.roman_ignore[s]:0,m=(isNaN(p)?r.trim(i.replace(p,"")):r.trim(i.substring(0,i.length-p))).match(e),l=0;if(!t.test(m))return i;for(m=(f=m[0]).toUpperCase().split("");m.length;)(u=n[m.shift()])&&(l+=u*(u<n[m[0]]?-1:1));return l?i.replace(f,l):i},type:"text"}),r.tablesorter.addParser({id:"roman-extract",is:function(){return!1},format:function(i){var a,o=r.grep(i.split(/\b/),function(r,e){return t.test(r)?r:""}).join("").match(e),s=0;if(!(o?t.test(o):0))return i;for(o=o[0].toUpperCase().split("");o.length;)(a=n[o.shift()])&&(s+=a*(a<n[o[0]]?-1:1));return s||i},type:"numeric"})}(jQuery); !function(r){"use strict";var t=/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/i,e=/\b([MCDLXVI]+\b)/gi,n={I:1,V:5,X:10,L:50,C:100,D:500,M:1e3};r.tablesorter.addParser({id:"roman",is:function(){return!1},format:function(r){var e,i=r.toUpperCase().split(""),a=0;if(!r||!t.test(r))return r;for(;i.length;)a+=(e=n[i.shift()])*(e<n[i[0]]?-1:1);return a},type:"numeric"}),r.tablesorter.addParser({id:"roman-ignore",is:function(){return!1},format:function(i,a,o,s){var u,f,c=a.config,p=r.isArray(c.roman_ignore)?c.roman_ignore[s]:0,m=(isNaN(p)?r.trim(i.replace(p,"")):r.trim(i.substring(0,i.length-p))).match(e),l=0;if(!t.test(m))return i;for(m=(f=m[0]).toUpperCase().split("");m.length;)(u=n[m.shift()])&&(l+=u*(u<n[m[0]]?-1:1));return l?i.replace(f,l):i},type:"text"}),r.tablesorter.addParser({id:"roman-extract",is:function(){return!1},format:function(i){var a,o=r.grep(i.split(/\b/),function(r){return t.test(r)?r:""}).join("").match(e),s=0;if(!(o?t.test(o):0))return i;for(o=o[0].toUpperCase().split("");o.length;)(a=n[o.shift()])&&(s+=a*(a<n[o[0]]?-1:1));return s||i},type:"numeric"})}(jQuery);

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

File diff suppressed because one or more lines are too long

View File

@ -1,5 +1,5 @@
/*! Widget: lazyload (BETA) - 4/1/2016 (v2.25.7) */ /*! Widget: lazyload (BETA) - 4/1/2016 (v2.25.7) */
!function(t,e){"use strict";var o=t.tablesorter;o.lazyload={init:function(l,a){"scrollstop"!==a.lazyload_event||o.addScrollStopDone||(o.addScrollStop(),o.addScrollStopDone=!0,t.event.special.scrollstop.latency=a.lazyload_latency||250),o.lazyload.update(l,a);var i=l.namespace+"lazyload ",n=[a.lazyload_update,"pagerUpdate",a.columnSelector_updated||"columnUpdate",""].join(i);l.$table.on(n,function(){o.lazyload.update(l,l.widgetOptions)}).on("filterEnd"+i,function(){t(e).scroll()})},update:function(o,l){var a=(/(\.|#)/.test(l.lazyload_imageClass)?"":".")+l.lazyload_imageClass;o.$table.find(a).lazyload({threshold:l.lazyload_threshold,failure_limit:l.lazyload_failure_limit,event:l.lazyload_event,effect:l.lazyload_effect,container:l.lazyload_container,data_attribute:l.lazyload_data_attribute,skip_invisible:l.lazyload_skip_invisible,appear:l.lazyload_appear,load:l.lazyload_load,placeholder:l.lazyload_placeholder}),setTimeout(function(){t(e).scroll()},1)},remove:function(t,e){t.$table.off(t.namespace+"lazyload")}},o.addWidget({id:"lazyload",options:{lazyload_imageClass:"lazy",lazyload_update:"lazyloadUpdate",lazyload_latency:250,lazyload_threshold:0,lazyload_failure_limit:0,lazyload_event:"scrollstop",lazyload_effect:"show",lazyload_container:e,lazyload_data_attribute:"original",lazyload_skip_invisible:!0,lazyload_appear:null,lazyload_load:null,lazyload_placeholder:"data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="},init:function(t,e,l,a){o.lazyload.init(l,a)},remove:function(t,e,l){o.lazyload.remove(e,l)}}),o.addScrollStop=function(){var e=t.event.dispatch||t.event.handle,o=t.event.special,l="D"+ +new Date,a="D"+(+new Date+1);o.scrollstart={setup:function(a){var i,n=t.extend({latency:o.scrollstop.latency},a),r=function(t){var o=this,l=arguments;i?clearTimeout(i):(t.type="scrollstart",e.apply(o,l)),i=setTimeout(function(){i=null},n.latency)};t(this).bind("scroll",r).data(l,r)},teardown:function(){t(this).unbind("scroll",t(this).data(l))}},o.scrollstop={latency:250,setup:function(l){var i,n=t.extend({latency:o.scrollstop.latency},l),r=function(t){var o=this,l=arguments;i&&clearTimeout(i),i=setTimeout(function(){i=null,t.type="scrollstop",e.apply(o,l)},n.latency)};t(this).bind("scroll",r).data(a,r)},teardown:function(){t(this).unbind("scroll",t(this).data(a))}}}}(jQuery,window),/*! !function(t,e){"use strict";var o=t.tablesorter;o.lazyload={init:function(l,a){"scrollstop"!==a.lazyload_event||o.addScrollStopDone||(o.addScrollStop(),o.addScrollStopDone=!0,t.event.special.scrollstop.latency=a.lazyload_latency||250),o.lazyload.update(l,a);var i=l.namespace+"lazyload ",n=[a.lazyload_update,"pagerUpdate",a.columnSelector_updated||"columnUpdate",""].join(i);l.$table.on(n,function(){o.lazyload.update(l,l.widgetOptions)}).on("filterEnd"+i,function(){t(e).scroll()})},update:function(o,l){var a=(/(\.|#)/.test(l.lazyload_imageClass)?"":".")+l.lazyload_imageClass;o.$table.find(a).lazyload({threshold:l.lazyload_threshold,failure_limit:l.lazyload_failure_limit,event:l.lazyload_event,effect:l.lazyload_effect,container:l.lazyload_container,data_attribute:l.lazyload_data_attribute,skip_invisible:l.lazyload_skip_invisible,appear:l.lazyload_appear,load:l.lazyload_load,placeholder:l.lazyload_placeholder}),setTimeout(function(){t(e).scroll()},1)},remove:function(t){t.$table.off(t.namespace+"lazyload")}},o.addWidget({id:"lazyload",options:{lazyload_imageClass:"lazy",lazyload_update:"lazyloadUpdate",lazyload_latency:250,lazyload_threshold:0,lazyload_failure_limit:0,lazyload_event:"scrollstop",lazyload_effect:"show",lazyload_container:e,lazyload_data_attribute:"original",lazyload_skip_invisible:!0,lazyload_appear:null,lazyload_load:null,lazyload_placeholder:"data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="},init:function(t,e,l,a){o.lazyload.init(l,a)},remove:function(t,e,l){o.lazyload.remove(e,l)}}),o.addScrollStop=function(){var e=t.event.dispatch||t.event.handle,o=t.event.special,l="D"+ +new Date,a="D"+(+new Date+1);o.scrollstart={setup:function(a){var i,n=t.extend({latency:o.scrollstop.latency},a),r=function(t){var o=this,l=arguments;i?clearTimeout(i):(t.type="scrollstart",e.apply(o,l)),i=setTimeout(function(){i=null},n.latency)};t(this).bind("scroll",r).data(l,r)},teardown:function(){t(this).unbind("scroll",t(this).data(l))}},o.scrollstop={latency:250,setup:function(l){var i,n=t.extend({latency:o.scrollstop.latency},l),r=function(t){var o=this,l=arguments;i&&clearTimeout(i),i=setTimeout(function(){i=null,t.type="scrollstop",e.apply(o,l)},n.latency)};t(this).bind("scroll",r).data(a,r)},teardown:function(){t(this).unbind("scroll",t(this).data(a))}}}}(jQuery,window),/*!
* Lazy Load - jQuery plugin for lazy loading images * Lazy Load - jQuery plugin for lazy loading images
* *
* Copyright (c) 2007-2015 Mika Tuupola * Copyright (c) 2007-2015 Mika Tuupola
@ -27,4 +27,4 @@ function(t,e,o,l){var a=t(e);t.fn.lazyload=function(l){function i(){var e=0;r.ea
* Version: 1.9.7 * Version: 1.9.7
* *
*/ */
return l&&(void 0!==l.failurelimit&&(l.failure_limit=l.failurelimit,delete l.failurelimit),void 0!==l.effectspeed&&(l.effect_speed=l.effectspeed,delete l.effectspeed),t.extend(d,l)),n=void 0===d.container||d.container===e?a:t(d.container),0===d.event.indexOf("scroll")&&n.bind(d.event,function(){return i()}),this.each(function(){var e=this,o=t(e);e.loaded=!1,void 0!==o.attr("src")&&!1!==o.attr("src")||o.is("img")&&o.attr("src",d.placeholder),o.one("appear",function(){if(!this.loaded){if(d.appear){var l=r.length;d.appear.call(e,l,d)}t("<img />").bind("load",function(){var l=o.attr("data-"+d.data_attribute);o.hide(),o.is("img")?o.attr("src",l):o.css("background-image","url('"+l+"')"),o[d.effect](d.effect_speed),e.loaded=!0;var a=t.grep(r,function(t){return!t.loaded});if(r=t(a),d.load){var i=r.length;d.load.call(e,i,d)}}).attr("src",o.attr("data-"+d.data_attribute))}}),0!==d.event.indexOf("scroll")&&o.bind(d.event,function(){e.loaded||o.trigger("appear")})}),a.bind("resize",function(){i()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&a.bind("pageshow",function(e){e.originalEvent&&e.originalEvent.persisted&&r.each(function(){t(this).trigger("appear")})}),t(o).ready(function(){i()}),this},t.belowthefold=function(o,l){return(void 0===l.container||l.container===e?(e.innerHeight?e.innerHeight:a.height())+a.scrollTop():t(l.container).offset().top+t(l.container).height())<=t(o).offset().top-l.threshold},t.rightoffold=function(o,l){return(void 0===l.container||l.container===e?a.width()+a.scrollLeft():t(l.container).offset().left+t(l.container).width())<=t(o).offset().left-l.threshold},t.abovethetop=function(o,l){return(void 0===l.container||l.container===e?a.scrollTop():t(l.container).offset().top)>=t(o).offset().top+l.threshold+t(o).height()},t.leftofbegin=function(o,l){return(void 0===l.container||l.container===e?a.scrollLeft():t(l.container).offset().left)>=t(o).offset().left+l.threshold+t(o).width()},t.inviewport=function(e,o){return!(t.rightoffold(e,o)||t.leftofbegin(e,o)||t.belowthefold(e,o)||t.abovethetop(e,o))},t.extend(t.expr[":"],{"below-the-fold":function(e){return t.belowthefold(e,{threshold:0})},"above-the-top":function(e){return!t.belowthefold(e,{threshold:0})},"right-of-screen":function(e){return t.rightoffold(e,{threshold:0})},"left-of-screen":function(e){return!t.rightoffold(e,{threshold:0})},"in-viewport":function(e){return t.inviewport(e,{threshold:0})},"above-the-fold":function(e){return!t.belowthefold(e,{threshold:0})},"right-of-fold":function(e){return t.rightoffold(e,{threshold:0})},"left-of-fold":function(e){return!t.rightoffold(e,{threshold:0})}})}(jQuery,window,document); return l&&(void 0!==l.failurelimit&&(l.failure_limit=l.failurelimit,delete l.failurelimit),void 0!==l.effectspeed&&(l.effect_speed=l.effectspeed,delete l.effectspeed),t.extend(d,l)),n=void 0===d.container||d.container===e?a:t(d.container),0===d.event.indexOf("scroll")&&n.bind(d.event,function(){return i()}),this.each(function(){var e=this,o=t(e);e.loaded=!1,void 0!==o.attr("src")&&!1!==o.attr("src")||o.is("img")&&o.attr("src",d.placeholder),o.one("appear",function(){if(!this.loaded){if(d.appear){var l=r.length;d.appear.call(e,l,d)}t("<img />").bind("load",function(){var l=o.attr("data-"+d.data_attribute);o.hide(),o.is("img")?o.attr("src",l):o.css("background-image",'url("'+l+'")'),o[d.effect](d.effect_speed),e.loaded=!0;var a=t.grep(r,function(t){return!t.loaded});if(r=t(a),d.load){var i=r.length;d.load.call(e,i,d)}}).attr("src",o.attr("data-"+d.data_attribute))}}),0!==d.event.indexOf("scroll")&&o.bind(d.event,function(){e.loaded||o.trigger("appear")})}),a.bind("resize",function(){i()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&a.bind("pageshow",function(e){e.originalEvent&&e.originalEvent.persisted&&r.each(function(){t(this).trigger("appear")})}),t(o).ready(function(){i()}),this},t.belowthefold=function(o,l){return(void 0===l.container||l.container===e?(e.innerHeight?e.innerHeight:a.height())+a.scrollTop():t(l.container).offset().top+t(l.container).height())<=t(o).offset().top-l.threshold},t.rightoffold=function(o,l){return(void 0===l.container||l.container===e?a.width()+a.scrollLeft():t(l.container).offset().left+t(l.container).width())<=t(o).offset().left-l.threshold},t.abovethetop=function(o,l){return(void 0===l.container||l.container===e?a.scrollTop():t(l.container).offset().top)>=t(o).offset().top+l.threshold+t(o).height()},t.leftofbegin=function(o,l){return(void 0===l.container||l.container===e?a.scrollLeft():t(l.container).offset().left)>=t(o).offset().left+l.threshold+t(o).width()},t.inviewport=function(e,o){return!(t.rightoffold(e,o)||t.leftofbegin(e,o)||t.belowthefold(e,o)||t.abovethetop(e,o))},t.extend(t.expr[":"],{"below-the-fold":function(e){return t.belowthefold(e,{threshold:0})},"above-the-top":function(e){return!t.belowthefold(e,{threshold:0})},"right-of-screen":function(e){return t.rightoffold(e,{threshold:0})},"left-of-screen":function(e){return!t.rightoffold(e,{threshold:0})},"in-viewport":function(e){return t.inviewport(e,{threshold:0})},"above-the-fold":function(e){return!t.belowthefold(e,{threshold:0})},"right-of-fold":function(e){return t.rightoffold(e,{threshold:0})},"left-of-fold":function(e){return!t.rightoffold(e,{threshold:0})}})}(jQuery,window,document);

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

@ -1,2 +1,2 @@
/*! Widget: saveSort - updated 10/31/2015 (v2.24.0) */ /*! Widget: saveSort - updated 2018-03-18 (v2.30.0) */
!function(t){"use strict";var s=t.tablesorter||{};s.addWidget({id:"saveSort",priority:20,options:{saveSort:!0},init:function(t,s,o,e){s.format(t,o,e,!0)},format:function(o,e,r,a){var i,n,l=e.$table,g=!1!==r.saveSort,v={sortList:e.sortList};e.debug&&(n=new Date),l.hasClass("hasSaveSort")?g&&o.hasInitialized&&s.storage&&(s.storage(o,"tablesorter-savesort",v),e.debug&&console.log("saveSort widget: Saving last sort: "+e.sortList+s.benchmark(n))):(l.addClass("hasSaveSort"),v="",s.storage&&(v=(i=s.storage(o,"tablesorter-savesort"))&&i.hasOwnProperty("sortList")&&t.isArray(i.sortList)?i.sortList:"",e.debug&&console.log('saveSort: Last sort loaded: "'+v+'"'+s.benchmark(n)),l.bind("saveSortReset",function(t){t.stopPropagation(),s.storage(o,"tablesorter-savesort","")})),a&&v&&v.length>0?e.sortList=v:o.hasInitialized&&v&&v.length>0&&s.sortOn(e,v))},remove:function(t,o){o.$table.removeClass("hasSaveSort"),s.storage&&s.storage(t,"tablesorter-savesort","")}})}(jQuery); !function(t){"use strict";function s(s){var o=r.storage(s.table,"tablesorter-savesort");return o&&o.hasOwnProperty("sortList")&&t.isArray(o.sortList)?o.sortList:""}function o(t,o){return(o||s(t)).join(",")!==t.sortList.join(",")}var r=t.tablesorter||{};r.addWidget({id:"saveSort",priority:20,options:{saveSort:!0},init:function(t,s,o,r){s.format(t,o,r,!0)},format:function(t,a,e,i){var n,l=a.$table,v=!1!==e.saveSort,g={sortList:a.sortList},S=r.debug(a,"saveSort");S&&(n=new Date),l.hasClass("hasSaveSort")?v&&t.hasInitialized&&r.storage&&o(a)&&(r.storage(t,"tablesorter-savesort",g),S&&console.log("saveSort >> Saving last sort: "+a.sortList+r.benchmark(n))):(l.addClass("hasSaveSort"),g="",r.storage&&(g=s(a),S&&console.log('saveSort >> Last sort loaded: "'+g+'"'+r.benchmark(n)),l.bind("saveSortReset",function(s){s.stopPropagation(),r.storage(t,"tablesorter-savesort","")})),i&&g&&g.length>0?a.sortList=g:t.hasInitialized&&g&&g.length>0&&o(a,g)&&r.sortOn(a,g))},remove:function(t,s){s.$table.removeClass("hasSaveSort"),r.storage&&r.storage(t,"tablesorter-savesort","")}})}(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
/*! Widget: sort2Hash (BETA) - updated 9/27/2017 (v2.29.0) */ /*! Widget: sort2Hash (BETA) - updated 9/27/2017 (v2.29.0) */
!function(e){"use strict";var t=e.tablesorter||{},a=t.sort2Hash={init:function(r,o){var s,n,i,h,l=r.table,d=r.pager,c=t.hasWidget(l,"saveSort"),H=a.decodeHash(r,o,"sort");(H&&!c||H&&c&&o.sort2Hash_overrideSaveSort)&&a.convertString2Sort(r,o,H),t.hasWidget(r.table,"pager")&&(n=parseInt(a.decodeHash(r,o,"page"),10),i=d.page=n<0?0:n>d.totalPages?d.totalPages-1:n,h=d.size=parseInt(a.decodeHash(r,o,"size"),10)),t.hasWidget(l,"filter")&&(s=a.decodeHash(r,o,"filter"))&&(s=s.split(o.sort2Hash_separator),r.$table.one("tablesorter-ready",function(){setTimeout(function(){r.$table.one("filterEnd",function(){e(this).triggerHandler("pageAndSize",[i,h])}),(n=t.filter.equalFilters?t.filter.equalFilters(r,r.lastSearch,s):(r.lastSearch||[]).join("")!==(s||[]).join(""))||e.tablesorter.setFilters(l,s,!0)},100)})),s||r.$table.one("tablesorter-ready",function(){r.$table.triggerHandler("pageAndSize",[i,h])}),r.$table.on("sortEnd.sort2hash filterEnd.sort2hash pagerComplete.sort2Hash",function(){this.hasInitialized&&a.setHash(this.config,this.config.widgetOptions)})},getTableId:function(t,a){return a.sort2Hash_tableId||t.table.id||"table"+e("table").index(t.$table)},regexEscape:function(e){return e.replace(/([\.\^\$\*\+\-\?\(\)\[\]\{\}\\\|])/g,"\\$1")},convertString2Sort:function(e,t,r){for(var o,s,n,i,h,l,d=r.split(t.sort2Hash_separator),c=0,H=d.length,g=[];c<H;){if(s=d[c++],i=parseInt(s,10),isNaN(i)||i>e.columns)for(o=new RegExp("("+a.regexEscape(s)+")","i"),h=0;h<e.columns;h++)l=e.$headerIndexed[h],o.test(l.attr(t.sort2Hash_headerTextAttr))&&(s=h,h=e.columns);n=d[c++],void 0!==s&&void 0!==n&&(isNaN(n)&&(n=n.indexOf(t.sort2Hash_directionText[1])>-1?1:0),g.push([s,n]))}g.length&&(e.sortList=g)},convertSort2String:function(t,a){var r,o,s,n,i=[],h=t.sortList||[],l=h.length;for(r=0;r<l;r++)s=h[r][0],o=e.trim(t.$headerIndexed[s].attr(a.sort2Hash_headerTextAttr)),i.push(""!==o?encodeURIComponent(o):s),n=a.sort2Hash_directionText[h[r][1]],i.push(n);return i.join(a.sort2Hash_separator)},convertFilter2String:function(t,a){var r,o,s,n,i=[],h=t.sortList||[],l=h.length;for(r=0;r<l;r++)s=h[r][0],s=void 0!==(o=e.trim(t.$headerIndexed[s].attr(a.sort2Hash_headerTextAttr)))?encodeURIComponent(o):s,i.push(s),n=a.sort2Hash_directionText[h[r][1]],i.push(n);return i.join(a.sort2Hash_separator)},getParam:function(e,t,r){t||(t=window.location.hash);var o=new RegExp("[\\?&]"+a.regexEscape(e)+"=([^&#]*)"),s=o.exec(t);return r?o:null===s?"":decodeURIComponent(s[1])},removeParam:function(e,t){t||(t=window.location.hash);var r,o=a.getParam(e,t,!0),s=[],n=t.split("&"),i=n.length;for(r=0;r<i;r++)o.test("&"+n[r])||s.push(n[r]);return s.length?s.join("&"):""},encodeHash:function(e,t,r,o,s){var n=!1,i=a.getTableId(e,t);return"function"==typeof t.sort2Hash_encodeHash&&(n=t.sort2Hash_encodeHash(e,i,r,o,s||o)),!1===n&&(n="&"+r+"["+i+"]="+o),n},decodeHash:function(e,t,r){var o=!1,s=a.getTableId(e,t);return"function"==typeof t.sort2Hash_decodeHash&&(o=t.sort2Hash_decodeHash(e,s,r)),!1===o&&(o=a.getParam(r+"["+s+"]")),o||""},cleanHash:function(e,t,r,o){var s=!1,n=a.getTableId(e,t);return"function"==typeof t.sort2Hash_cleanHash&&(s=t.sort2Hash_cleanHash(e,n,r,o)),!1===s&&(s=a.removeParam(r+"["+n+"]",o)),s||""},setHash:function(r,o){var s="",n=window.location.hash,i=t.hasWidget(r.table,"pager"),h=t.hasWidget(r.table,"filter"),l=a.convertSort2String(r,o),d=h&&""!==r.lastSearch.join("")?r.lastSearch:[],c=encodeURIComponent(d.join(r.widgetOptions.sort2Hash_separator)),H={sort:l?a.encodeHash(r,o,"sort",l,r.sortList):"",page:i?a.encodeHash(r,o,"page",r.pager.page+1):"",size:i?a.encodeHash(r,o,"size",r.pager.size):"",filter:c?a.encodeHash(r,o,"filter",c,d):""};e.each(H,function(e,t){n=a.cleanHash(r,o,e,n),s+=t});var g=o.sort2Hash_hash,p=((window.location.hash||"").replace(g,"").length?n:g)+s;if(o.sort2Hash_replaceHistory){var u=window.location.href.split(g)[0];p[0]!=g&&(p=g+p),window.location.replace(u+p)}else window.location.hash=p}};t.addWidget({id:"sort2Hash",priority:60,options:{sort2Hash_hash:"#",sort2Hash_separator:"-",sort2Hash_headerTextAttr:"data-header",sort2Hash_directionText:[0,1],sort2Hash_overrideSaveSort:!1,sort2Hash_replaceHistory:!1,sort2Hash_tableId:null,sort2Hash_encodeHash:null,sort2Hash_decodeHash:null,sort2Hash_cleanHash:null},init:function(e,t,r,o){a.init(r,o)},remove:function(e,t){t.$table.off(".sort2hash")}})}(jQuery); !function(e){"use strict";var t=e.tablesorter||{},a=t.sort2Hash={init:function(r,o){var s,n,i,h,l=r.table,d=r.pager,c=t.hasWidget(l,"saveSort"),H=a.decodeHash(r,o,"sort");(H&&!c||H&&c&&o.sort2Hash_overrideSaveSort)&&a.convertString2Sort(r,o,H),t.hasWidget(r.table,"pager")&&(n=parseInt(a.decodeHash(r,o,"page"),10),i=d.page=n<0?0:n>d.totalPages?d.totalPages-1:n,h=d.size=parseInt(a.decodeHash(r,o,"size"),10)),t.hasWidget(l,"filter")&&(s=a.decodeHash(r,o,"filter"))&&(s=s.split(o.sort2Hash_separator),r.$table.one("tablesorter-ready",function(){setTimeout(function(){r.$table.one("filterEnd",function(){e(this).triggerHandler("pageAndSize",[i,h])}),(n=t.filter.equalFilters?t.filter.equalFilters(r,r.lastSearch,s):(r.lastSearch||[]).join("")!==(s||[]).join(""))||e.tablesorter.setFilters(l,s,!0)},100)})),s||r.$table.one("tablesorter-ready",function(){r.$table.triggerHandler("pageAndSize",[i,h])}),r.$table.on("sortEnd.sort2hash filterEnd.sort2hash pagerComplete.sort2Hash",function(){this.hasInitialized&&a.setHash(this.config,this.config.widgetOptions)})},getTableId:function(t,a){return a.sort2Hash_tableId||t.table.id||"table"+e("table").index(t.$table)},regexEscape:function(e){return e.replace(/([\.\^\$\*\+\-\?\(\)\[\]\{\}\\\|])/g,"\\$1")},convertString2Sort:function(e,t,r){for(var o,s,n,i,h,l,d=r.split(t.sort2Hash_separator),c=0,H=d.length,g=[];c<H;){if(s=d[c++],i=parseInt(s,10),isNaN(i)||i>e.columns)for(o=new RegExp("("+a.regexEscape(s)+")","i"),h=0;h<e.columns;h++)l=e.$headerIndexed[h],o.test(l.attr(t.sort2Hash_headerTextAttr))&&(s=h,h=e.columns);n=d[c++],void 0!==s&&void 0!==n&&(isNaN(n)&&(n=n.indexOf(t.sort2Hash_directionText[1])>-1?1:0),g.push([s,n]))}g.length&&(e.sortList=g)},convertSort2String:function(t,a){var r,o,s,n,i=[],h=t.sortList||[],l=h.length;for(r=0;r<l;r++)s=h[r][0],o=e.trim(t.$headerIndexed[s].attr(a.sort2Hash_headerTextAttr)),i.push(""!==o?encodeURIComponent(o):s),n=a.sort2Hash_directionText[h[r][1]],i.push(n);return i.join(a.sort2Hash_separator)},convertFilter2String:function(t,a){var r,o,s,n,i=[],h=t.sortList||[],l=h.length;for(r=0;r<l;r++)s=h[r][0],s=void 0!==(o=e.trim(t.$headerIndexed[s].attr(a.sort2Hash_headerTextAttr)))?encodeURIComponent(o):s,i.push(s),n=a.sort2Hash_directionText[h[r][1]],i.push(n);return i.join(a.sort2Hash_separator)},getParam:function(e,t,r){t||(t=window.location.hash);var o=new RegExp("[\\?&]"+a.regexEscape(e)+"=([^&#]*)"),s=o.exec(t);return r?o:null===s?"":decodeURIComponent(s[1])},removeParam:function(e,t){t||(t=window.location.hash);var r,o=a.getParam(e,t,!0),s=[],n=t.split("&"),i=n.length;for(r=0;r<i;r++)o.test("&"+n[r])||s.push(n[r]);return s.length?s.join("&"):""},encodeHash:function(e,t,r,o,s){var n=!1,i=a.getTableId(e,t);return"function"==typeof t.sort2Hash_encodeHash&&(n=t.sort2Hash_encodeHash(e,i,r,o,s||o)),!1===n&&(n="&"+r+"["+i+"]="+o),n},decodeHash:function(e,t,r){var o=!1,s=a.getTableId(e,t);return"function"==typeof t.sort2Hash_decodeHash&&(o=t.sort2Hash_decodeHash(e,s,r)),!1===o&&(o=a.getParam(r+"["+s+"]")),o||""},cleanHash:function(e,t,r,o){var s=!1,n=a.getTableId(e,t);return"function"==typeof t.sort2Hash_cleanHash&&(s=t.sort2Hash_cleanHash(e,n,r,o)),!1===s&&(s=a.removeParam(r+"["+n+"]",o)),s||""},setHash:function(r,o){var s="",n=window.location.hash,i=t.hasWidget(r.table,"pager"),h=t.hasWidget(r.table,"filter"),l=a.convertSort2String(r,o),d=h&&""!==r.lastSearch.join("")?r.lastSearch:[],c=encodeURIComponent(d.join(r.widgetOptions.sort2Hash_separator)),H={sort:l?a.encodeHash(r,o,"sort",l,r.sortList):"",page:i?a.encodeHash(r,o,"page",r.pager.page+1):"",size:i?a.encodeHash(r,o,"size",r.pager.size):"",filter:c?a.encodeHash(r,o,"filter",c,d):""};e.each(H,function(e,t){n=a.cleanHash(r,o,e,n),s+=t});var g=o.sort2Hash_hash,p=((window.location.hash||"").replace(g,"").length?n:g)+s;if(o.sort2Hash_replaceHistory){var u=window.location.href.split(g)[0];p[0]!==g&&(p=g+p),window.location.replace(u+p)}else window.location.hash=p}};t.addWidget({id:"sort2Hash",priority:60,options:{sort2Hash_hash:"#",sort2Hash_separator:"-",sort2Hash_headerTextAttr:"data-header",sort2Hash_directionText:[0,1],sort2Hash_overrideSaveSort:!1,sort2Hash_replaceHistory:!1,sort2Hash_tableId:null,sort2Hash_encodeHash:null,sort2Hash_decodeHash:null,sort2Hash_cleanHash:null},init:function(e,t,r,o){a.init(r,o)},remove:function(e,t){t.$table.off(".sort2hash")}})}(jQuery);

View File

@ -3,4 +3,4 @@
* by Rob Garrison * by Rob Garrison
* Contributors: Chris Rogers * Contributors: Chris Rogers
*/ */
!function(t){"use strict";var o=t.tablesorter;o.sortTbodies={init:function(r,e){var s,n,i,d,a,b=r.namespace+"sortTbody",l=r.$table.children("tbody"),c=l.length;for(e.sortTbody_original_serverSideSorting=r.serverSideSorting,e.sortTbody_original_cssInfoBlock=r.cssInfoBlock,r.cssInfoBlock=e.sortTbody_noSort,o.sortTbodies.setTbodies(r,e),s=0;s<c;s++)l.eq(s).attr("data-ts-original-order",s);for(r.$table.unbind("sortBegin updateComplete ".split(" ").join(b+" ")).bind("sortBegin"+b,function(){o.sortTbodies.sorter(r)}).bind("updateComplete"+b,function(){o.sortTbodies.setTbodies(r,e),o.updateCache(r,null,r.$tbodies)}).bind("sortEnd",function(){var o=e.sortTbody_primaryRow;e.sortTbody_lockHead&&o&&r.$table.find(o).each(function(){t(this).parents("tbody").prepend(this)})}),(t.isEmptyObject(r.parsers)||r.$tbodies.length!==l.length)&&(o.sortTbodies.setTbodies(r,e),o.updateCache(r,null,r.$tbodies)),c=(a=l.children("tr")).length,s=0;s<r.columns;s++){if(d=0,"numeric"===r.parsers[s].type)for(n=0;n<c;n++)i=o.getParsedText(r,a.eq(n).children()[s],s),d=Math.max(Math.abs(i)||0,d);r.$headerIndexed[s].attr("data-ts-col-max-value",d)}},setTbodies:function(t,o){t.$tbodies=t.$table.children("tbody").not("."+o.sortTbody_noSort)},sorter:function(r){var e=r.$table,s=r.widgetOptions;if(!0!==s.sortTbody_busy){s.sortTbody_busy=!0;var n=e.children("tbody").not("."+s.sortTbody_noSort),i=s.sortTbody_primaryRow||"tr:eq(0)",d=r.sortList||[],a=d.length;a&&(r.serverSideSorting=!s.sortTbody_sortRows,n.sort(function(e,s){var n,b,l,c,y,T,p,f,u,g,h,_,m=r.table,S=r.parsers,v=r.textSorter||"",$=t(e),x=t(s),q=$.find(i).children("td, th"),B=x.find(i).children("td, th");for(n=0;n<a;n++){if(p=d[n][0],f=d[n][1],l=0===f,b=o.getElementText(r,q.eq(p),p),u=S[p].format(b,m,q[p],p),b=o.getElementText(r,B.eq(p),p),g=S[p].format(b,m,B[p],p),r.sortStable&&u===g&&1===a)return $.attr("data-ts-original-order")-x.attr("data-ts-original-order");if(c=/n/i.test(S&&S[p]?S[p].type||"":""),c&&r.strings[p]?(y=r.$headerIndexed[p].attr("data-ts-col-max-value")||1.79e308,c="boolean"==typeof o.string[r.strings[p]]?(l?1:-1)*(o.string[r.strings[p]]?-1:1):r.strings[p]?o.string[r.strings[p]]||0:0,T=r.numberSorter?r.numberSorter(u,g,l,y,m):o["sortNumeric"+(l?"Asc":"Desc")](u,g,c,y,p,r)):(h=l?u:g,_=l?g:u,T="function"==typeof v?v(h,_,l,p,m):"object"==typeof v&&v.hasOwnProperty(p)?v[p](h,_,l,p,m):o["sortNatural"+(l?"Asc":"Desc")](u,g,p,r)),T)return T}return $.attr("data-ts-original-order")-x.attr("data-ts-original-order")}),o.sortTbodies.restoreTbodies(r,s,n),s.sortTbody_busy=!1)}},restoreTbodies:function(t,o,r){var e,s,n,i,d,a,b,l=t.$table,c=!0,y=0;if(l.hide(),r.appendTo(l),s=l.children("tbody"),i=s.length,e=s.filter("."+o.sortTbody_noSort).appendTo(l),d=e.length)for(;c&&y<d;){for(c=!1,a=0;a<d;a++)(b=(b=parseInt(e.eq(a).attr("data-ts-original-order"),10))>=i?i:b<0?0:b)!==e.eq(a).index()&&(c=!0,n=e.eq(a).detach(),b>=i?n.appendTo(l):0===b?n.prependTo(l):n.insertBefore(l.children("tbody:eq("+b+")")));y++}l.show()}},o.addWidget({id:"sortTbody",priority:40,options:{sortTbody_lockHead:!1,sortTbody_primaryRow:null,sortTbody_sortRows:!1,sortTbody_noSort:"tablesorter-no-sort-tbody"},init:function(t,r,e,s){o.sortTbodies.init(e,s)},remove:function(t,o,r,e){o.$table.unbind("sortBegin updateComplete ".split(" ").join(o.namespace+"sortTbody ")),o.serverSideSorting=r.sortTbody_original_serverSideSorting,o.cssInfoBlock=r.sortTbody_original_cssInfoBlock}})}(jQuery); !function(t){"use strict";var o=t.tablesorter;o.sortTbodies={init:function(r,e){var s,n,i,d,a,b=r.namespace+"sortTbody",l=r.$table.children("tbody"),c=l.length;for(e.sortTbody_original_serverSideSorting=r.serverSideSorting,e.sortTbody_original_cssInfoBlock=r.cssInfoBlock,r.cssInfoBlock=e.sortTbody_noSort,o.sortTbodies.setTbodies(r,e),s=0;s<c;s++)l.eq(s).attr("data-ts-original-order",s);for(r.$table.unbind("sortBegin updateComplete ".split(" ").join(b+" ")).bind("sortBegin"+b,function(){o.sortTbodies.sorter(r)}).bind("updateComplete"+b,function(){o.sortTbodies.setTbodies(r,e),o.updateCache(r,null,r.$tbodies)}).bind("sortEnd",function(){var o=e.sortTbody_primaryRow;e.sortTbody_lockHead&&o&&r.$table.find(o).each(function(){t(this).parents("tbody").prepend(this)})}),(t.isEmptyObject(r.parsers)||r.$tbodies.length!==l.length)&&(o.sortTbodies.setTbodies(r,e),o.updateCache(r,null,r.$tbodies)),c=(a=l.children("tr")).length,s=0;s<r.columns;s++){if(d=0,"numeric"===r.parsers[s].type)for(n=0;n<c;n++)i=o.getParsedText(r,a.eq(n).children()[s],s),d=Math.max(Math.abs(i)||0,d);r.$headerIndexed[s].attr("data-ts-col-max-value",d)}},setTbodies:function(t,o){t.$tbodies=t.$table.children("tbody").not("."+o.sortTbody_noSort)},sorter:function(r){var e=r.$table,s=r.widgetOptions;if(!0!==s.sortTbody_busy){s.sortTbody_busy=!0;var n=e.children("tbody").not("."+s.sortTbody_noSort),i=s.sortTbody_primaryRow||"tr:eq(0)",d=r.sortList||[],a=d.length;a&&(r.serverSideSorting=!s.sortTbody_sortRows,n.sort(function(e,s){var n,b,l,c,y,T,p,f,u,g,h,_,m=r.table,S=r.parsers,v=r.textSorter||"",$=t(e),x=t(s),q=$.find(i).children("td, th"),B=x.find(i).children("td, th");for(n=0;n<a;n++){if(p=d[n][0],f=d[n][1],l=0===f,b=o.getElementText(r,q.eq(p),p),u=S[p].format(b,m,q[p],p),b=o.getElementText(r,B.eq(p),p),g=S[p].format(b,m,B[p],p),r.sortStable&&u===g&&1===a)return $.attr("data-ts-original-order")-x.attr("data-ts-original-order");if(c=/n/i.test(S&&S[p]?S[p].type||"":""),c&&r.strings[p]?(y=r.$headerIndexed[p].attr("data-ts-col-max-value")||1.79e308,c="boolean"==typeof o.string[r.strings[p]]?(l?1:-1)*(o.string[r.strings[p]]?-1:1):r.strings[p]?o.string[r.strings[p]]||0:0,T=r.numberSorter?r.numberSorter(u,g,l,y,m):o["sortNumeric"+(l?"Asc":"Desc")](u,g,c,y,p,r)):(h=l?u:g,_=l?g:u,T="function"==typeof v?v(h,_,l,p,m):"object"==typeof v&&v.hasOwnProperty(p)?v[p](h,_,l,p,m):o["sortNatural"+(l?"Asc":"Desc")](u,g,p,r)),T)return T}return $.attr("data-ts-original-order")-x.attr("data-ts-original-order")}),o.sortTbodies.restoreTbodies(r,s,n),s.sortTbody_busy=!1)}},restoreTbodies:function(t,o,r){var e,s,n,i,d,a,b,l=t.$table,c=!0,y=0;if(l.hide(),r.appendTo(l),s=l.children("tbody"),i=s.length,e=s.filter("."+o.sortTbody_noSort).appendTo(l),d=e.length)for(;c&&y<d;){for(c=!1,a=0;a<d;a++)(b=(b=parseInt(e.eq(a).attr("data-ts-original-order"),10))>=i?i:b<0?0:b)!==e.eq(a).index()&&(c=!0,n=e.eq(a).detach(),b>=i?n.appendTo(l):0===b?n.prependTo(l):n.insertBefore(l.children("tbody:eq("+b+")")));y++}l.show()}},o.addWidget({id:"sortTbody",priority:40,options:{sortTbody_lockHead:!1,sortTbody_primaryRow:null,sortTbody_sortRows:!1,sortTbody_noSort:"tablesorter-no-sort-tbody"},init:function(t,r,e,s){o.sortTbodies.init(e,s)},remove:function(t,o,r){o.$table.unbind("sortBegin updateComplete ".split(" ").join(o.namespace+"sortTbody ")),o.serverSideSorting=r.sortTbody_original_serverSideSorting,o.cssInfoBlock=r.sortTbody_original_cssInfoBlock}})}(jQuery);

View File

@ -1,2 +1,2 @@
/*! Widget: storage - updated 4/18/2017 (v2.28.8) */ /*! Widget: storage - updated 2018-03-18 (v2.30.0) */
!function(e,t,r){"use strict";var o=e.tablesorter||{};e.extend(!0,o.defaults,{fixedUrl:"",widgetOptions:{storage_fixedUrl:"",storage_group:"",storage_page:"",storage_storageType:"",storage_tableId:"",storage_useSessionStorage:""}}),o.storage=function(o,s,a,i){var g,n,p,l=!1,d={},u=(o=e(o)[0]).config,S=u&&u.widgetOptions,c=(i&&i.storageType||S&&S.storage_storageType).toString().charAt(0).toLowerCase(),_=c?"":i&&i.useSessionStorage||S&&S.storage_useSessionStorage,f=e(o),m=i&&i.id||f.attr(i&&i.group||S&&S.storage_group||"data-table-group")||S&&S.storage_tableId||o.id||e(".tablesorter").index(f),w=i&&i.url||f.attr(i&&i.page||S&&S.storage_page||"data-table-page")||S&&S.storage_fixedUrl||u&&u.fixedUrl||t.location.pathname;if("c"!==c&&(c="s"===c||_?"sessionStorage":"localStorage")in t)try{t[c].setItem("_tmptest","temp"),l=!0,t[c].removeItem("_tmptest")}catch(e){u&&u.debug&&console.warn(c+" is not supported in this browser")}if(u.debug&&console.log("Storage widget using",l?c:"cookies"),e.parseJSON&&(l?d=e.parseJSON(t[c][s]||"null")||{}:(n=r.cookie.split(/[;\s|=]/),d=0!==(g=e.inArray(s,n)+1)?e.parseJSON(n[g]||"null")||{}:{})),void 0===a||!t.JSON||!JSON.hasOwnProperty("stringify"))return d&&d[w]?d[w][m]:"";d[w]||(d[w]={}),d[w][m]=a,l?t[c][s]=JSON.stringify(d):((p=new Date).setTime(p.getTime()+31536e6),r.cookie=s+"="+JSON.stringify(d).replace(/\"/g,'"')+"; expires="+p.toGMTString()+"; path=/")}}(jQuery,window,document); !function(e,t,r){"use strict";var o=e.tablesorter||{};e.extend(!0,o.defaults,{fixedUrl:"",widgetOptions:{storage_fixedUrl:"",storage_group:"",storage_page:"",storage_storageType:"",storage_tableId:"",storage_useSessionStorage:""}}),o.storage=function(s,a,i,g){var n,p,l,d=!1,u={},S=(s=e(s)[0]).config,c=S&&S.widgetOptions,_=o.debug(S,"storage"),f=(g&&g.storageType||c&&c.storage_storageType).toString().charAt(0).toLowerCase(),m=f?"":g&&g.useSessionStorage||c&&c.storage_useSessionStorage,y=e(s),O=g&&g.id||y.attr(g&&g.group||c&&c.storage_group||"data-table-group")||c&&c.storage_tableId||s.id||e(".tablesorter").index(y),w=g&&g.url||y.attr(g&&g.page||c&&c.storage_page||"data-table-page")||c&&c.storage_fixedUrl||S&&S.fixedUrl||t.location.pathname;if("c"!==f&&(f="s"===f||m?"sessionStorage":"localStorage")in t)try{t[f].setItem("_tmptest","temp"),d=!0,t[f].removeItem("_tmptest")}catch(e){console.warn(f+" is not supported in this browser")}if(_&&console.log("Storage >> Using",d?f:"cookies"),e.parseJSON&&(d?u=e.parseJSON(t[f][a]||"null")||{}:(p=r.cookie.split(/[;\s|=]/),u=0!==(n=e.inArray(a,p)+1)?e.parseJSON(p[n]||"null")||{}:{})),void 0===i||!t.JSON||!JSON.hasOwnProperty("stringify"))return u&&u[w]?u[w][O]:"";u[w]||(u[w]={}),u[w][O]=i,d?t[f][a]=JSON.stringify(u):((l=new Date).setTime(l.getTime()+31536e6),r.cookie=a+"="+JSON.stringify(u).replace(/\"/g,'"')+"; expires="+l.toGMTString()+"; path=/")}}(jQuery,window,document);

View File

@ -1,2 +1,2 @@
/*! Widget: uitheme - updated 9/27/2017 (v2.29.0) */ /*! Widget: uitheme - updated 2018-03-18 (v2.30.0) */
!function(e){"use strict";var o=e.tablesorter||{};o.themes={bootstrap:{table:"table table-bordered table-striped",caption:"caption",header:"bootstrap-header",sortNone:"",sortAsc:"",sortDesc:"",active:"",hover:"",icons:"",iconSortNone:"bootstrap-icon-unsorted",iconSortAsc:"glyphicon glyphicon-chevron-up",iconSortDesc:"glyphicon glyphicon-chevron-down",filterRow:"",footerRow:"",footerCells:"",even:"",odd:""},jui:{table:"ui-widget ui-widget-content ui-corner-all",caption:"ui-widget-content",header:"ui-widget-header ui-corner-all ui-state-default",sortNone:"",sortAsc:"",sortDesc:"",active:"ui-state-active",hover:"ui-state-hover",icons:"ui-icon",iconSortNone:"ui-icon-carat-2-n-s ui-icon-caret-2-n-s",iconSortAsc:"ui-icon-carat-1-n ui-icon-caret-1-n",iconSortDesc:"ui-icon-carat-1-s ui-icon-caret-1-s",filterRow:"",footerRow:"",footerCells:"",even:"ui-widget-content",odd:"ui-state-default"}},e.extend(o.css,{wrapper:"tablesorter-wrapper"}),o.addWidget({id:"uitheme",priority:10,format:function(t,s,r){var i,a,n,c,l,d,h,m,u,p,v,f,b,C=o.themes,w=s.$table.add(e(s.namespace+"_extra_table")),g=s.$headers.add(e(s.namespace+"_extra_headers")),S=s.theme||"jui",j=C[S]||{},D=e.trim([j.sortNone,j.sortDesc,j.sortAsc,j.active].join(" ")),A=e.trim([j.iconSortNone,j.iconSortDesc,j.iconSortAsc].join(" "));for(s.debug&&(l=new Date),w.hasClass("tablesorter-"+S)&&s.theme===s.appliedTheme&&r.uitheme_applied||(r.uitheme_applied=!0,p=C[s.appliedTheme]||{},v=(b=!e.isEmptyObject(p))?[p.sortNone,p.sortDesc,p.sortAsc,p.active].join(" "):"",f=b?[p.iconSortNone,p.iconSortDesc,p.iconSortAsc].join(" "):"",b&&(r.zebra[0]=e.trim(" "+r.zebra[0].replace(" "+p.even,"")),r.zebra[1]=e.trim(" "+r.zebra[1].replace(" "+p.odd,"")),s.$tbodies.children().removeClass([p.even,p.odd].join(" "))),j.even&&(r.zebra[0]+=" "+j.even),j.odd&&(r.zebra[1]+=" "+j.odd),w.children("caption").removeClass(p.caption||"").addClass(j.caption),m=w.removeClass((s.appliedTheme?"tablesorter-"+(s.appliedTheme||""):"")+" "+(p.table||"")).addClass("tablesorter-"+S+" "+(j.table||"")).children("tfoot"),s.appliedTheme=s.theme,m.length&&m.children("tr").removeClass(p.footerRow||"").addClass(j.footerRow).children("th, td").removeClass(p.footerCells||"").addClass(j.footerCells),g.removeClass((b?[p.header,p.hover,v].join(" "):"")||"").addClass(j.header).not(".sorter-false").unbind("mouseenter.tsuitheme mouseleave.tsuitheme").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(o){e(this)["mouseenter"===o.type?"addClass":"removeClass"](j.hover||"")}),g.each(function(){var t=e(this);t.find("."+o.css.wrapper).length||t.wrapInner('<div class="'+o.css.wrapper+'" style="position:relative;height:100%;width:100%"></div>')}),s.cssIcon&&g.find("."+o.css.icon).removeClass(b?[p.icons,f].join(" "):"").addClass(j.icons||""),o.hasWidget(s.table,"filter")&&(a=function(){w.children("thead").children("."+o.css.filterRow).removeClass(b?p.filterRow||"":"").addClass(j.filterRow||"")},r.filter_initialized?a():w.one("filterInit",function(){a()}))),i=0;i<s.columns;i++)d=s.$headers.add(e(s.namespace+"_extra_headers")).not(".sorter-false").filter('[data-column="'+i+'"]'),h=o.css.icon?d.find("."+o.css.icon):e(),(u=g.not(".sorter-false").filter('[data-column="'+i+'"]:last')).length&&(d.removeClass(D),h.removeClass(A),u[0].sortDisabled?h.removeClass(j.icons||""):(n=j.sortNone,c=j.iconSortNone,u.hasClass(o.css.sortAsc)?(n=[j.sortAsc,j.active].join(" "),c=j.iconSortAsc):u.hasClass(o.css.sortDesc)&&(n=[j.sortDesc,j.active].join(" "),c=j.iconSortDesc),d.addClass(n),h.addClass(c||"")));s.debug&&console.log("Applying "+S+" theme"+o.benchmark(l))},remove:function(e,t,s,r){if(s.uitheme_applied){var i=t.$table,a=t.appliedTheme||"jui",n=o.themes[a]||o.themes.jui,c=i.children("thead").children(),l=n.sortNone+" "+n.sortDesc+" "+n.sortAsc,d=n.iconSortNone+" "+n.iconSortDesc+" "+n.iconSortAsc;i.removeClass("tablesorter-"+a+" "+n.table),s.uitheme_applied=!1,r||(i.find(o.css.header).removeClass(n.header),c.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(n.hover+" "+l+" "+n.active).filter("."+o.css.filterRow).removeClass(n.filterRow),c.find("."+o.css.icon).removeClass(n.icons+" "+d))}}})}(jQuery); !function(e){"use strict";var o=e.tablesorter||{};o.themes={bootstrap:{table:"table table-bordered table-striped",caption:"caption",header:"bootstrap-header",sortNone:"",sortAsc:"",sortDesc:"",active:"",hover:"",icons:"",iconSortNone:"bootstrap-icon-unsorted",iconSortAsc:"glyphicon glyphicon-chevron-up",iconSortDesc:"glyphicon glyphicon-chevron-down",filterRow:"",footerRow:"",footerCells:"",even:"",odd:""},jui:{table:"ui-widget ui-widget-content ui-corner-all",caption:"ui-widget-content",header:"ui-widget-header ui-corner-all ui-state-default",sortNone:"",sortAsc:"",sortDesc:"",active:"ui-state-active",hover:"ui-state-hover",icons:"ui-icon",iconSortNone:"ui-icon-carat-2-n-s ui-icon-caret-2-n-s",iconSortAsc:"ui-icon-carat-1-n ui-icon-caret-1-n",iconSortDesc:"ui-icon-carat-1-s ui-icon-caret-1-s",filterRow:"",footerRow:"",footerCells:"",even:"ui-widget-content",odd:"ui-state-default"}},e.extend(o.css,{wrapper:"tablesorter-wrapper"}),o.addWidget({id:"uitheme",priority:10,format:function(t,s,r){var i,a,n,c,l,d,h,m,u,p,v,f,b,C=o.themes,w=s.$table.add(e(s.namespace+"_extra_table")),S=s.$headers.add(e(s.namespace+"_extra_headers")),g=s.theme||"jui",j=C[g]||{},D=e.trim([j.sortNone,j.sortDesc,j.sortAsc,j.active].join(" ")),A=e.trim([j.iconSortNone,j.iconSortDesc,j.iconSortAsc].join(" ")),N=o.debug(s,"uitheme");for(N&&(l=new Date),w.hasClass("tablesorter-"+g)&&s.theme===s.appliedTheme&&r.uitheme_applied||(r.uitheme_applied=!0,p=C[s.appliedTheme]||{},v=(b=!e.isEmptyObject(p))?[p.sortNone,p.sortDesc,p.sortAsc,p.active].join(" "):"",f=b?[p.iconSortNone,p.iconSortDesc,p.iconSortAsc].join(" "):"",b&&(r.zebra[0]=e.trim(" "+r.zebra[0].replace(" "+p.even,"")),r.zebra[1]=e.trim(" "+r.zebra[1].replace(" "+p.odd,"")),s.$tbodies.children().removeClass([p.even,p.odd].join(" "))),j.even&&(r.zebra[0]+=" "+j.even),j.odd&&(r.zebra[1]+=" "+j.odd),w.children("caption").removeClass(p.caption||"").addClass(j.caption),m=w.removeClass((s.appliedTheme?"tablesorter-"+(s.appliedTheme||""):"")+" "+(p.table||"")).addClass("tablesorter-"+g+" "+(j.table||"")).children("tfoot"),s.appliedTheme=s.theme,m.length&&m.children("tr").removeClass(p.footerRow||"").addClass(j.footerRow).children("th, td").removeClass(p.footerCells||"").addClass(j.footerCells),S.removeClass((b?[p.header,p.hover,v].join(" "):"")||"").addClass(j.header).not(".sorter-false").unbind("mouseenter.tsuitheme mouseleave.tsuitheme").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(o){e(this)["mouseenter"===o.type?"addClass":"removeClass"](j.hover||"")}),S.each(function(){var t=e(this);t.find("."+o.css.wrapper).length||t.wrapInner('<div class="'+o.css.wrapper+'" style="position:relative;height:100%;width:100%"></div>')}),s.cssIcon&&S.find("."+o.css.icon).removeClass(b?[p.icons,f].join(" "):"").addClass(j.icons||""),o.hasWidget(s.table,"filter")&&(a=function(){w.children("thead").children("."+o.css.filterRow).removeClass(b?p.filterRow||"":"").addClass(j.filterRow||"")},r.filter_initialized?a():w.one("filterInit",function(){a()}))),i=0;i<s.columns;i++)d=s.$headers.add(e(s.namespace+"_extra_headers")).not(".sorter-false").filter('[data-column="'+i+'"]'),h=o.css.icon?d.find("."+o.css.icon):e(),(u=S.not(".sorter-false").filter('[data-column="'+i+'"]:last')).length&&(d.removeClass(D),h.removeClass(A),u[0].sortDisabled?h.removeClass(j.icons||""):(n=j.sortNone,c=j.iconSortNone,u.hasClass(o.css.sortAsc)?(n=[j.sortAsc,j.active].join(" "),c=j.iconSortAsc):u.hasClass(o.css.sortDesc)&&(n=[j.sortDesc,j.active].join(" "),c=j.iconSortDesc),d.addClass(n),h.addClass(c||"")));N&&console.log("uitheme >> Applied "+g+" theme"+o.benchmark(l))},remove:function(e,t,s,r){if(s.uitheme_applied){var i=t.$table,a=t.appliedTheme||"jui",n=o.themes[a]||o.themes.jui,c=i.children("thead").children(),l=n.sortNone+" "+n.sortDesc+" "+n.sortAsc,d=n.iconSortNone+" "+n.iconSortDesc+" "+n.iconSortAsc;i.removeClass("tablesorter-"+a+" "+n.table),s.uitheme_applied=!1,r||(i.find(o.css.header).removeClass(n.header),c.unbind("mouseenter.tsuitheme mouseleave.tsuitheme").removeClass(n.hover+" "+l+" "+n.active).filter("."+o.css.filterRow).removeClass(n.filterRow),c.find("."+o.css.icon).removeClass(n.icons+" "+d))}}})}(jQuery);

View File

@ -1,2 +1,2 @@
/*! Widget: vertical-group (BETA) - updated 12/13/2017 (v2.29.1) */ /*! Widget: vertical-group (BETA) - updated 12/13/2017 (v2.29.1) */
!function(r){"use strict";function e(r){r.removeClass(i.verticalGroupHide+" "+i.verticalGroupShow)}function a(r,e,a){e.parent().removeClass(r.zebra[(a+1)%2]).addClass(r.zebra[a%2])}function o(o,l,s,c){var u=-1,v=o.tBodies[0].rows,d=(o.tHead.rows,t.hasWidget(o,"zebra")),p=[],n=[];if(!s.vertical_group_lock){if(s.vertical_group_lock=!0,""===(p=r.map(l.$headerIndexed,function(r){return r.hasClass(i.verticalGroupHeader)?1:""})).join(""))return e(r(v).find("."+i.verticalGroupHide+",."+i.verticalGroupShow)),void(s.vertical_group_lock=!1);for(var h=0;h<v.length;h++)for(var G=!1,f=0;f<l.columns;f++)if(p[f]&&v[h].cells[f]){var g=r(v[h].cells[f]),C=t.isValueInArray(f,l.sortList),w=g.html();C<0?e(g):G||w!==n[f]?0===C&&(G=!0,g.hasClass(i.verticalGroupShow)||g.addClass(i.verticalGroupShow),g.removeClass(i.verticalGroupHide),d&&a(s,g,C?u:++u)):(g.hasClass(i.verticalGroupHide)||g.addClass(i.verticalGroupHide),d&&a(s,g,u),g.removeClass(i.verticalGroupShow)),n[f]=w}else u++;s.vertical_group_lock=!1}}var t=r.tablesorter,i=t.css;r.extend(t.css,{verticalGroupHeader:"tablesorter-vertical-group",verticalGroupHide:"tablesorter-vertical-group-hide",verticalGroupShow:"tablesorter-vertical-group-show"}),t.addWidget({id:"vertical-group",priority:99,init:o,format:o})}(jQuery); !function(r){"use strict";function e(r){r.removeClass(t.verticalGroupHide+" "+t.verticalGroupShow)}function a(r,e,a){e.parent().removeClass(r.zebra[(a+1)%2]).addClass(r.zebra[a%2])}function o(o,l,s){var c=-1,u=o.tBodies[0].rows,v=i.hasWidget(o,"zebra"),d=[],p=[];if(!s.vertical_group_lock){if(s.vertical_group_lock=!0,""===(d=r.map(l.$headerIndexed,function(r){return r.hasClass(t.verticalGroupHeader)?1:""})).join(""))return e(r(u).find("."+t.verticalGroupHide+",."+t.verticalGroupShow)),void(s.vertical_group_lock=!1);for(var n=0;n<u.length;n++)for(var h=!1,G=0;G<l.columns;G++)if(d[G]&&u[n].cells[G]){var f=r(u[n].cells[G]),g=i.isValueInArray(G,l.sortList),C=f.html();g<0?e(f):h||C!==p[G]?0===g&&(h=!0,f.hasClass(t.verticalGroupShow)||f.addClass(t.verticalGroupShow),f.removeClass(t.verticalGroupHide),v&&a(s,f,g?c:++c)):(f.hasClass(t.verticalGroupHide)||f.addClass(t.verticalGroupHide),v&&a(s,f,c),f.removeClass(t.verticalGroupShow)),p[G]=C}else c++;s.vertical_group_lock=!1}}var i=r.tablesorter,t=i.css;r.extend(i.css,{verticalGroupHeader:"tablesorter-vertical-group",verticalGroupHide:"tablesorter-vertical-group-hide",verticalGroupShow:"tablesorter-vertical-group-show"}),i.addWidget({id:"vertical-group",priority:99,init:o,format:o})}(jQuery);

View File

@ -1 +1 @@
!function(e){"use strict";var t,i,a,o=e.tablesorter,n=!1,l=o.view={copyCaption:function(t,i){l.removeCaption(t,i),t.$table.find("caption").length>0&&e(i.view_caption).text(t.$table.find("caption").text())},removeCaption:function(t,i){e(i.view_caption).empty()},buildToolBar:function(t,i){l.removeToolBar(t,i),l.copyCaption(t,i);var a=e(i.view_toolbar);e.each(i.view_layouts,function(t,o){var n=i.view_switcher_class;t==i.view_layout&&(n+=" active");var l=e("<a>",{href:"#","class":n,"data-view-type":t,title:o.title});l.append(e("<i>",{"class":o.icon})),a.append(l)}),a.find("."+i.view_switcher_class).on("click",function(o){if(o.preventDefault(),e(this).hasClass("active"))return!1;a.find("."+i.view_switcher_class).removeClass("active"),e(this).addClass("active"),i.view_layout=e(this).attr("data-view-type"),!0===i.view_layouts[i.view_layout].raw?(l.remove(t,i),l.buildToolBar(t,i)):(!1===n&&l.hideTable(t,i),l.buildView(t,i))})},removeToolBar:function(t,i){e(i.view_toolbar).empty(),l.removeCaption(t,i)},buildView:function(t,i){l.removeView(t,i);var a=i.view_layouts[i.view_layout],n=e(a.container,{"class":i.view_layout});o.getColumnText(t.$table,0,function(t){var i=a.tmpl;e.each(e(t.$row).find("td"),function(t,a){var o={},n="{col"+t+"}";e.each(a.attributes,function(e,t){o[t.nodeName]=t.nodeValue});var l=e(a).html(),r=e("<span />").append(e("<span/>",o).append(l));i=i.replace(new RegExp(n,"g"),r.html()),n="{col"+t+":raw}",i=i.replace(new RegExp(n,"g"),e(a).text())});var o=e(i);e.each(t.$row[0].attributes,function(e,t){"class"==t.nodeName?o.attr(t.nodeName,o.attr(t.nodeName)+" "+t.nodeValue):o.attr(t.nodeName,t.nodeValue)}),n.append(o)}),e(i.view_container).append(n),t.$table.triggerHandler("viewComplete")},removeView:function(t,i){e(i.view_container).empty()},hideTable:function(e,o){t=e.$table.css("position"),i=e.$table.css("bottom"),a=e.$table.css("left"),e.$table.css({position:"absolute",top:"-10000px",left:"-10000px"}),n=!0},init:function(e,t){!1!==t.view_layout&&void 0!==t.view_layouts[t.view_layout]&&(!1===n&&l.hideTable(e,t),e.$table.on("tablesorter-ready",function(){l.buildToolBar(e,t),l.buildView(e,t)}))},remove:function(e,o){l.removeToolBar(e,o),l.removeView(e,o),e.$table.css({position:t,top:i,left:a}),n=!1}};o.addWidget({id:"view",options:{view_toolbar:"#ts-view-toolbar",view_container:"#ts-view",view_caption:"#ts-view-caption",view_switcher_class:"ts-view-switcher",view_layout:!1,view_layouts:{}},init:function(e,t,i,a){l.init(i,a)},remove:function(e,t,i){l.remove(t,i)}})}(jQuery); !function(e){"use strict";var t,i,a,o=e.tablesorter,n=!1,l=o.view={copyCaption:function(t,i){l.removeCaption(t,i),t.$table.find("caption").length>0&&e(i.view_caption).text(t.$table.find("caption").text())},removeCaption:function(t,i){e(i.view_caption).empty()},buildToolBar:function(t,i){l.removeToolBar(t,i),l.copyCaption(t,i);var a=e(i.view_toolbar);e.each(i.view_layouts,function(t,o){var n=i.view_switcher_class;t===i.view_layout&&(n+=" active");var l=e("<a>",{href:"#","class":n,"data-view-type":t,title:o.title});l.append(e("<i>",{"class":o.icon})),a.append(l)}),a.find("."+i.view_switcher_class).on("click",function(o){if(o.preventDefault(),e(this).hasClass("active"))return!1;a.find("."+i.view_switcher_class).removeClass("active"),e(this).addClass("active"),i.view_layout=e(this).attr("data-view-type"),!0===i.view_layouts[i.view_layout].raw?(l.remove(t,i),l.buildToolBar(t,i)):(!1===n&&l.hideTable(t,i),l.buildView(t,i))})},removeToolBar:function(t,i){e(i.view_toolbar).empty(),l.removeCaption(t,i)},buildView:function(t,i){l.removeView(t,i);var a=i.view_layouts[i.view_layout],n=e(a.container,{"class":i.view_layout});o.getColumnText(t.$table,0,function(t){var i=a.tmpl;e.each(e(t.$row).find("td"),function(t,a){var o={},n="{col"+t+"}";e.each(a.attributes,function(e,t){o[t.nodeName]=t.nodeValue});var l=e(a).html(),r=e("<span />").append(e("<span/>",o).append(l));i=i.replace(new RegExp(n,"g"),r.html()),n="{col"+t+":raw}",i=i.replace(new RegExp(n,"g"),e(a).text())});var o=e(i);e.each(t.$row[0].attributes,function(e,t){"class"===t.nodeName?o.attr(t.nodeName,o.attr(t.nodeName)+" "+t.nodeValue):o.attr(t.nodeName,t.nodeValue)}),n.append(o)}),e(i.view_container).append(n),t.$table.triggerHandler("viewComplete")},removeView:function(t,i){e(i.view_container).empty()},hideTable:function(e){t=e.$table.css("position"),i=e.$table.css("bottom"),a=e.$table.css("left"),e.$table.css({position:"absolute",top:"-10000px",left:"-10000px"}),n=!0},init:function(e,t){!1!==t.view_layout&&void 0!==t.view_layouts[t.view_layout]&&(!1===n&&l.hideTable(e,t),e.$table.on("tablesorter-ready",function(){l.buildToolBar(e,t),l.buildView(e,t)}))},remove:function(e,o){l.removeToolBar(e,o),l.removeView(e,o),e.$table.css({position:t,top:i,left:a}),n=!1}};o.addWidget({id:"view",options:{view_toolbar:"#ts-view-toolbar",view_container:"#ts-view",view_caption:"#ts-view-caption",view_switcher_class:"ts-view-switcher",view_layout:!1,view_layouts:{}},init:function(e,t,i,a){l.init(i,a)},remove:function(e,t,i){l.remove(t,i)}})}(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -92,7 +92,7 @@ span.alert { padding: 1px 3px; }
#main .ui-accordion-header a, #main .ui-accordion-content { font-size: 14px; } #main .ui-accordion-header a, #main .ui-accordion-content { font-size: 14px; }
#banner small { font-size: 16px; vertical-align: super; } #banner small { font-size: 16px; vertical-align: super; }
.accordion { position: relative; } .accordion { position: relative; }
.accordion .accordion-link { position: absolute; right: 1%; margin-top: 16px; z-index: 1; width: 12px; height: 12px;} .accordion .accordion-link { position: absolute; right: 1%; margin-top: 0.9em; z-index: 1; width: 12px; height: 12px;}
.accordion .accordion .accordion-link { margin-top: 12px; } /* nested accordion */ .accordion .accordion .accordion-link { margin-top: 12px; } /* nested accordion */
.tablesorter .accordion .accordion-link { margin-top: 11px; } .tablesorter .accordion .accordion-link { margin-top: 11px; }
.remark, .error { font-weight: bold; color: red; font-size: 18px; } .remark, .error { font-weight: bold; color: red; font-size: 18px; }

View File

@ -28,7 +28,7 @@
// Add two new rows using the "addRows" method // Add two new rows using the "addRows" method
// the "update" method doesn't work here because not all // the "update" method doesn't work here because not all
// rows are present in the table when the pager is applied // rows are present in the table when the pager is applied
$('button').click(function(){ $('button').click(function() {
// add two rows // add two rows
var row = '<tr><td>Frank</td><td>Smith</td><td>53</td><td>$39.95</td><td>22%</td><td>Mar 22, 2011 9:33 AM</td></tr>' + var row = '<tr><td>Frank</td><td>Smith</td><td>53</td><td>$39.95</td><td>22%</td><td>Mar 22, 2011 9:33 AM</td></tr>' +
'<tr><td>Inigo</td><td>Montoya</td><td>34</td><td>$19.99</td><td>15%</td><td>Sep 25, 1987 12:00PM</td></tr>', '<tr><td>Inigo</td><td>Montoya</td><td>34</td><td>$19.99</td><td>15%</td><td>Sep 25, 1987 12:00PM</td></tr>',

View File

@ -23,7 +23,7 @@
// call the tablesorter plugin // call the tablesorter plugin
$('table').tablesorter({ theme : 'blue' }); $('table').tablesorter({ theme : 'blue' });
$('button.applyid').click(function(){ $('button.applyid').click(function() {
// This method adds the 'columns' widget & sorts the table to make it visible // This method adds the 'columns' widget & sorts the table to make it visible
$('table') $('table')
.trigger('applyWidgetId', 'columns') .trigger('applyWidgetId', 'columns')
@ -31,7 +31,7 @@
return false; return false;
}); });
$('button.apply').click(function(){ $('button.apply').click(function() {
// This method reapplies the widgets listed in table.config.widgets // This method reapplies the widgets listed in table.config.widgets
// it won't appear to do anything unless we add 'zebra' to the widgets option // it won't appear to do anything unless we add 'zebra' to the widgets option
$('table').data('tablesorter').widgets = ['zebra']; $('table').data('tablesorter').widgets = ['zebra'];
@ -39,7 +39,7 @@
return false; return false;
}); });
$('button.remove').click(function(){ $('button.remove').click(function() {
// This method removes both the zebra & columns widget entirely // This method removes both the zebra & columns widget entirely
$('table').trigger('removeWidget', 'zebra columns'); $('table').trigger('removeWidget', 'zebra columns');
return false; return false;

View File

@ -151,7 +151,7 @@
}); });
// Toggle filter_childByColumn option // Toggle filter_childByColumn option
$( 'button.toggle-byColumn' ).click(function(){ $( 'button.toggle-byColumn' ).click(function() {
var wo = $table2[0].config.widgetOptions, var wo = $table2[0].config.widgetOptions,
o = !wo.filter_childByColumn; o = !wo.filter_childByColumn;
wo.filter_childByColumn = o; wo.filter_childByColumn = o;

View File

@ -36,7 +36,7 @@
positionFixed: false positionFixed: false
}); });
/* no longer needed! /* no longer needed!
.bind('pagerChange', function(){ .bind('pagerChange', function() {
// hide child rows after pager update // hide child rows after pager update
$('.tablesorter-childRow td').hide(); $('.tablesorter-childRow td').hide();
}); });
@ -45,7 +45,7 @@
// Toggle child row content (td), not hiding the row since we are using rowspan // Toggle child row content (td), not hiding the row since we are using rowspan
// Using delegate because the pager plugin rebuilds the table after each page change // Using delegate because the pager plugin rebuilds the table after each page change
// "delegate" works in jQuery 1.4.2+; use "live" back to v1.3; for older jQuery - SOL // "delegate" works in jQuery 1.4.2+; use "live" back to v1.3; for older jQuery - SOL
$('.tablesorter').delegate('.toggle', 'click' ,function(){ $('.tablesorter').delegate('.toggle', 'click' ,function() {
// use "nextUntil" to toggle multiple child rows // use "nextUntil" to toggle multiple child rows
// toggle table cells instead of the row // toggle table cells instead of the row

View File

@ -21,7 +21,7 @@
<script src="../js/widgets/widget-filter.js"></script> <script src="../js/widgets/widget-filter.js"></script>
<script> <script>
$(function(){ $(function() {
var dupe = true; var dupe = true;
$( '#dupe' ).click( function() { $( '#dupe' ).click( function() {
dupe = !dupe; dupe = !dupe;
@ -32,7 +32,7 @@
$('table').on('filterEnd', function( event, c ) { $('table').on('filterEnd', function( event, c ) {
$( '#show-filter' ).html( '[ "' + c.lastSearch.join('", "') + '" ]' ); $( '#show-filter' ).html( '[ "' + c.lastSearch.join('", "') + '" ]' );
}); });
$('.search').click(function(){ $('.search').click(function() {
var $this = $(this), var $this = $(this),
filter = [], filter = [],
col = $this.attr( 'data-column' ); col = $this.attr( 'data-column' );

View File

@ -343,16 +343,16 @@ table.focus-highlight td:before {
<script> <script>
/* highlight hover & focus selectors in the syntax highlighted code */ /* highlight hover & focus selectors in the syntax highlighted code */
$(window).on('load', function(){ $(window).on('load', function() {
setTimeout(function(){ setTimeout(function() {
// css // css
$('.pln:contains(highlight)').each(function(){ $('.pln:contains(highlight)').each(function() {
var $this = $(this), var $this = $(this),
$prev = $this.prev().prev(), $prev = $this.prev().prev(),
text = $prev.text() || '', text = $prev.text() || '',
type = /hover/.test(text) ? 'hover-hl' : /focus/.test(text) ? 'focus-hl' : ''; type = /hover/.test(text) ? 'hover-hl' : /focus/.test(text) ? 'focus-hl' : '';
if (type) { if (type) {
$this.html(function(i,h){ $this.html(function(i,h) {
return h.replace('highlight', '<span>highlight</span>'); return h.replace('highlight', '<span>highlight</span>');
}); });
// "highlight".. "-" .... "hover"/"focus" ... "." // "highlight".. "-" .... "hover"/"focus" ... "."

View File

@ -62,7 +62,7 @@ div.table-handle-disabled {
// this option MUST match the tablesorter selectorSort option! // this option MUST match the tablesorter selectorSort option!
sortClass: '.sorter', sortClass: '.sorter',
// this function is called after everything has been updated // this function is called after everything has been updated
tablesorterComplete: function(table){}, tablesorterComplete: function(table) {},
// *** original dragtable settings (non-default) *** // *** original dragtable settings (non-default) ***
dragaccept: '.drag-enable', // class name of draggable cols -> default null = all columns draggable dragaccept: '.drag-enable', // class name of draggable cols -> default null = all columns draggable

View File

@ -25,7 +25,7 @@
widgets: ['zebra'] widgets: ['zebra']
}); });
$('button').click(function(){ $('button').click(function() {
$('table').trigger('sortReset'); $('table').trigger('sortReset');
return false; return false;
}); });

View File

@ -45,7 +45,7 @@
// alphanumeric sort from sugar v2.0+ (https://sugarjs.com/docs/#/Array/getOption) // alphanumeric sort from sugar v2.0+ (https://sugarjs.com/docs/#/Array/getOption)
1 : Sugar.Array.getOption('sortCollate'), 1 : Sugar.Array.getOption('sortCollate'),
// function parameters were previously (a, b, table, column) - *** THEY HAVE CHANGED!!! *** // function parameters were previously (a, b, table, column) - *** THEY HAVE CHANGED!!! ***
2 : function(a, b, direction, column, table){ 2 : function(a, b, direction, column, table) {
// this is the original sort method from tablesorter 2.0.3 // this is the original sort method from tablesorter 2.0.3
if (table.config.sortLocaleCompare) { return a.localeCompare(b); } if (table.config.sortLocaleCompare) { return a.localeCompare(b); }
return ((a < b) ? -1 : ((a > b) ? 1 : 0)); return ((a < b) ? -1 : ((a > b) ? 1 : 0));

View File

@ -16,14 +16,18 @@
<!-- Tablesorter: required --> <!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/theme.blue.css"> <link rel="stylesheet" href="../css/theme.blue.css">
<script src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<script src="../js/widgets/widget-filter.js"></script>
<script id="js">$(function() { <script id="js">$(function() {
// call the tablesorter plugin // call the tablesorter plugin
$("table").tablesorter({ $("table").tablesorter({
theme : 'blue', theme : 'blue',
// enable debug mode // enable debug mode;
debug: true // debug: true => all debugging
// debug: "filter" => filter widget debugging only
debug: "core filter", // => core and filter widget debugging
widgets: ["filter"]
}); });
});</script> });</script>
@ -39,7 +43,7 @@
<div id="main"> <div id="main">
<p class="tip"> <p class="tip">
<em>NOTE!</em> If firebug is installed the debuging information will be displayed in the firebug console. <em>NOTE!</em> Debugging information will be displayed in the development console (Press <kbd>F12</kbd> and select the console tab).
</p> </p>
<h1>Demo</h1> <h1>Demo</h1>

View File

@ -34,7 +34,7 @@
$("table").tablesorter({ $("table").tablesorter({
theme : 'blue', theme : 'blue',
headerTemplate: '{content} {icon}', headerTemplate: '{content} {icon}',
onRenderHeader: function(index){ onRenderHeader: function(index) {
// the TH content is wrapped with a div.tablesorter-header-inner by default, so just add the new class // the TH content is wrapped with a div.tablesorter-header-inner by default, so just add the new class
$(this).find('div').addClass('roundedCorners header' + index ); $(this).find('div').addClass('roundedCorners header' + index );
} }

View File

@ -25,7 +25,7 @@
// {icon} isn't used by the blue theme; it is optional here // {icon} isn't used by the blue theme; it is optional here
headerTemplate : '{icon}{content}', headerTemplate : '{icon}{content}',
// manipulate the template string after is it created // manipulate the template string after is it created
onRenderTemplate : function(i, t){ onRenderTemplate : function(i, t) {
// add the column number to the beginning // add the column number to the beginning
// it's a zero-based index, so we add one // it's a zero-based index, so we add one
return '<em>' + (i+1) + ':</em> ' + t; return '<em>' + (i+1) + ':</em> ' + t;

View File

@ -22,7 +22,7 @@
<script src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<script src="../js/jquery.tablesorter.widgets.js"></script> <script src="../js/jquery.tablesorter.widgets.js"></script>
<script id="js">$(function(){ <script id="js">$(function() {
var t, start, var t, start,
vis = false; vis = false;
@ -53,12 +53,12 @@
$("#display").append(t).find('li:first').remove(); $("#display").append(t).find('li:first').remove();
}); });
$('.toggle').click(function(){ $('.toggle').click(function() {
vis = !vis; vis = !vis;
$.tablesorter.isProcessing($("table"), vis); $.tablesorter.isProcessing($("table"), vis);
}); });
$('[data-search]').click(function(){ $('[data-search]').click(function() {
var search = $(this).attr('data-search').split(','); var search = $(this).attr('data-search').split(',');
$('table').trigger('search', [search]); $('table').trigger('search', [search]);
return false; return false;

View File

@ -43,7 +43,7 @@
<script> <script>
$(function() { $(function() {
// show sortList // show sortList
$('table').on('sortEnd', function(){ $('table').on('sortEnd', function() {
var indx, var indx,
list = '&nbsp;[ ', list = '&nbsp;[ ',
sortList = this.config.sortList, sortList = this.config.sortList,

View File

@ -28,8 +28,8 @@
});</script> });</script>
<script> <script>
$(function(){ $(function() {
$('select').change(function(){ $('select').change(function() {
var t = $('table'), var t = $('table'),
v = $(this).val(); v = $(this).val();
t[0].config.emptyTo = v; t[0].config.emptyTo = v;

View File

@ -33,12 +33,12 @@
// In this example, textExtraction 1-5 functions don't really need to // In this example, textExtraction 1-5 functions don't really need to
// be defined, since they can also be obtained using `$(node).text()` // be defined, since they can also be obtained using `$(node).text()`
textExtraction: { textExtraction: {
0: function(node, table, cellIndex){ return $(node).find("strong").text(); }, 0: function(node, table, cellIndex) { return $(node).find("strong").text(); },
1: function(node, table, cellIndex){ return $(node).find("div").text(); }, 1: function(node, table, cellIndex) { return $(node).find("div").text(); },
2: function(node, table, cellIndex){ return $(node).find("span").text(); }, 2: function(node, table, cellIndex) { return $(node).find("span").text(); },
3: function(node, table, cellIndex){ return $(node).find("em").text(); }, 3: function(node, table, cellIndex) { return $(node).find("em").text(); },
4: function(node, table, cellIndex){ return $(node).find("a").text(); }, 4: function(node, table, cellIndex) { return $(node).find("a").text(); },
'.date' : function(node, table, cellIndex){ return $(node).find("u").text(); } '.date' : function(node, table, cellIndex) { return $(node).find("u").text(); }
} }
}); });

View File

@ -39,12 +39,12 @@
} }
}, },
// extra code to highlight invalid semver numbers // extra code to highlight invalid semver numbers
initialized : function(table){ initialized : function(table) {
var $cell, var $cell,
c = table.config, c = table.config,
column = 1; // search second column (zero-based index) column = 1; // search second column (zero-based index)
if (window.semver) { if (window.semver) {
c.$tbodies.each(function(tbindex, tb){ c.$tbodies.each(function(tbindex, tb) {
$(tb).children('tr').each(function(rowindex, tr) { $(tb).children('tr').each(function(rowindex, tr) {
$cell = $(tr).children().eq(column); $cell = $(tr).children().eq(column);
if (semver.valid( $.trim( $cell.text() ) ) === null) { if (semver.valid( $.trim( $cell.text() ) ) === null) {

View File

@ -25,7 +25,7 @@
<script id="js">$(function() { <script id="js">$(function() {
// NOTE: $.tablesorter.theme.bootstrap is ALREADY INCLUDED in the jquery.tablesorter.widgets.js // NOTE: $.tablesorter.themes.bootstrap is ALREADY INCLUDED in the jquery.tablesorter.widgets.js
// file for Bootstrap v3.x; it is included here because of class name differences in Bootstrap v2 // file for Bootstrap v3.x; it is included here because of class name differences in Bootstrap v2
// for version 2.x (the iconSortAsc & iconSortDesc use different classes) // for version 2.x (the iconSortAsc & iconSortDesc use different classes)
$.tablesorter.themes.bootstrap = { $.tablesorter.themes.bootstrap = {
@ -103,10 +103,10 @@
});</script> });</script>
<script> <script>
$(function(){ $(function() {
// filter button demo code // filter button demo code
$('button.filter').click(function(){ $('button.filter').click(function() {
var col = $(this).data('column'), var col = $(this).data('column'),
txt = $(this).data('filter'); txt = $(this).data('filter');
$('table').find('.tablesorter-filter').val('').eq(col).val(txt); $('table').find('.tablesorter-filter').val('').eq(col).val(txt);
@ -115,7 +115,7 @@
}); });
// toggle zebra widget // toggle zebra widget
$('button.zebra').click(function(){ $('button.zebra').click(function() {
var t = $(this).hasClass('btn-success'); var t = $(this).hasClass('btn-success');
// if (t) { // if (t) {
// removing classes applied by the zebra widget // removing classes applied by the zebra widget
@ -297,7 +297,7 @@
<div class="next-up"> <div class="next-up">
<hr /> <hr />
Next up: <a href="example-widget-resizable.html">Resizable Columns widget &rsaquo;&rsaquo;</a> Next up: <a href="example-widget-vertical-group.html">Vertical group widget &rsaquo;&rsaquo;</a>
</div> </div>
</div> </div>

View File

@ -25,7 +25,7 @@
<script id="js">$(function() { <script id="js">$(function() {
// NOTE: $.tablesorter.theme.bootstrap is ALREADY INCLUDED in the jquery.tablesorter.widgets.js // NOTE: $.tablesorter.themes.bootstrap is ALREADY INCLUDED in the jquery.tablesorter.widgets.js
// file; it is included here to show how you can modify the default classes // file; it is included here to show how you can modify the default classes
$.tablesorter.themes.bootstrap = { $.tablesorter.themes.bootstrap = {
// these classes are added to the table. To see other table classes available, // these classes are added to the table. To see other table classes available,
@ -106,10 +106,10 @@
});</script> });</script>
<script> <script>
$(function(){ $(function() {
// filter button demo code // filter button demo code
$('button.filter').click(function(){ $('button.filter').click(function() {
var col = $(this).data('column'), var col = $(this).data('column'),
txt = $(this).data('filter'); txt = $(this).data('filter');
$('table').find('.tablesorter-filter').val('').eq(col).val(txt); $('table').find('.tablesorter-filter').val('').eq(col).val(txt);
@ -118,7 +118,7 @@
}); });
// toggle zebra widget // toggle zebra widget
$('button.zebra').click(function(){ $('button.zebra').click(function() {
var t = $(this).hasClass('btn-success'); var t = $(this).hasClass('btn-success');
// if (t) { // if (t) {
// removing classes applied by the zebra widget // removing classes applied by the zebra widget

View File

@ -85,10 +85,10 @@
});</script> });</script>
<script> <script>
$(function(){ $(function() {
// filter button demo code // filter button demo code
$('button.filter').click(function(){ $('button.filter').click(function() {
var col = $(this).data('column'), var col = $(this).data('column'),
txt = $(this).data('filter'); txt = $(this).data('filter');
$('table').find('.tablesorter-filter').val('').eq(col).val(txt); $('table').find('.tablesorter-filter').val('').eq(col).val(txt);
@ -97,7 +97,7 @@
}); });
// toggle zebra widget // toggle zebra widget
$('button.zebra').click(function(){ $('button.zebra').click(function() {
var t = $(this).hasClass('btn-success'); var t = $(this).hasClass('btn-success');
$('table') $('table')
.toggleClass('table-striped')[0] .toggleClass('table-striped')[0]

View File

@ -74,10 +74,10 @@ ul { padding-left: 20px; }
});</script> });</script>
<script> <script>
$(function(){ $(function() {
// filter button demo code // filter button demo code
$('button.filter').click(function(){ $('button.filter').click(function() {
var col = $(this).data('column'), var col = $(this).data('column'),
txt = $(this).data('filter'); txt = $(this).data('filter');
$('table').find('.tablesorter-filter').val('').eq(col).val(txt); $('table').find('.tablesorter-filter').val('').eq(col).val(txt);
@ -86,7 +86,7 @@ ul { padding-left: 20px; }
}); });
// toggle zebra widget // toggle zebra widget
$('button.zebra').click(function(){ $('button.zebra').click(function() {
var t = $(this).hasClass('green'); var t = $(this).hasClass('green');
$('table') $('table')
.toggleClass('striped')[0] .toggleClass('striped')[0]

View File

@ -28,7 +28,7 @@
color: #fff; color: #fff;
}</style> }</style>
<script id="js">$(function(){ <script id="js">$(function() {
$("table") $("table")
.tablesorter({ .tablesorter({

View File

@ -17,7 +17,7 @@
<link rel="stylesheet" href="../css/theme.blue.css"> <link rel="stylesheet" href="../css/theme.blue.css">
<script src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<script id="js">$(function(){ <script id="js">$(function() {
$("table").tablesorter({ $("table").tablesorter({
theme : 'blue', theme : 'blue',
// pass the headers argument and passing a object // pass the headers argument and passing a object

View File

@ -17,7 +17,7 @@
<link rel="stylesheet" href="../css/theme.blue.css"> <link rel="stylesheet" href="../css/theme.blue.css">
<script src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<script id="js">$(function(){ <script id="js">$(function() {
$("table").tablesorter({ $("table").tablesorter({
theme : 'blue', theme : 'blue',

View File

@ -18,8 +18,8 @@
<script src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<script> <script>
$(function(){ $(function() {
$('table').on('tablesorter-initialized', function(){ $('table').on('tablesorter-initialized', function() {
var i, j, t = [], var i, j, t = [],
cache = this.config.cache[0].normalized; cache = this.config.cache[0].normalized;
for (i = 0; i < cache.length; i++) { for (i = 0; i < cache.length; i++) {
@ -30,7 +30,7 @@
}); });
</script> </script>
<script id="js">$(function(){ <script id="js">$(function() {
$("table").tablesorter({ $("table").tablesorter({
theme : 'blue', theme : 'blue',

View File

@ -17,7 +17,7 @@
<link rel="stylesheet" href="../css/theme.blue.css"> <link rel="stylesheet" href="../css/theme.blue.css">
<script src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<script id="js">$(function(){ <script id="js">$(function() {
// BONUS TIP: disable a column using jQuery data directly // BONUS TIP: disable a column using jQuery data directly
// but do it before the table initializes // but do it before the table initializes

View File

@ -26,7 +26,7 @@
<!-- Tablesorter: optional --> <!-- Tablesorter: optional -->
<script src="../js/jquery.tablesorter.widgets.js"></script> <script src="../js/jquery.tablesorter.widgets.js"></script>
<script id="js">$(function(){ <script id="js">$(function() {
// Initialize tablesorter // Initialize tablesorter
// *********************** // ***********************
@ -72,7 +72,7 @@
}, },
// ajax error callback from $.tablesorter.showError function // ajax error callback from $.tablesorter.showError function
// ajaxError: function( config, xhr, settings, exception ){ return exception; }; // ajaxError: function( config, xhr, settings, exception ) { return exception; };
// returning false will abort the error message // returning false will abort the error message
ajaxError: null, ajaxError: null,
@ -98,7 +98,7 @@
// ] // ]
// OR // OR
// return [ total_rows, $rows (jQuery object; optional), headers (array; optional) ] // return [ total_rows, $rows (jQuery object; optional), headers (array; optional) ]
ajaxProcessing: function(data){ ajaxProcessing: function(data) {
if (data && data.hasOwnProperty('rows')) { if (data && data.hasOwnProperty('rows')) {
var indx, r, row, c, d = data.rows, var indx, r, row, c, d = data.rows,
// total number of rows (required) // total number of rows (required)
@ -465,11 +465,11 @@ var $url = $('#url');
$('table') $('table')
// show current URL for the DEMO ONLY // show current URL for the DEMO ONLY
.on('changingUrl', function(e, url){ .on('changingUrl', function(e, url) {
$url.html(url); $url.html(url);
}) })
.on('pagerInitialized', function(){ .on('pagerInitialized', function() {
// allow THIS demo to sort the content; this variable is automatically set to true when ajax // allow THIS demo to sort the content; this variable is automatically set to true when ajax
// is used as there isn't any way to sort the server side data from the client side. // is used as there isn't any way to sort the server side data from the client side.
this.config.serverSideSorting = false; this.config.serverSideSorting = false;

View File

@ -22,7 +22,7 @@
<script src="../addons/pager/jquery.tablesorter.pager.js"></script> <script src="../addons/pager/jquery.tablesorter.pager.js"></script>
<script src="../js/jquery.tablesorter.widgets.js"></script> <script src="../js/jquery.tablesorter.widgets.js"></script>
<script id="js">$(function(){ <script id="js">$(function() {
var $table = $('table'), var $table = $('table'),
// define pager options // define pager options
@ -64,9 +64,9 @@
var r, $row, num = 50, var r, $row, num = 50,
row = '<tr><td>Student{i}</td><td>{m}</td><td>{g}</td><td>{r}</td><td>{r}</td><td>{r}</td><td>{r}</td><td><button type="button" class="remove" title="Remove this row">X</button></td></tr>' + row = '<tr><td>Student{i}</td><td>{m}</td><td>{g}</td><td>{r}</td><td>{r}</td><td>{r}</td><td>{r}</td><td><button type="button" class="remove" title="Remove this row">X</button></td></tr>' +
'<tr><td>Student{j}</td><td>{m}</td><td>{g}</td><td>{r}</td><td>{r}</td><td>{r}</td><td>{r}</td><td><button type="button" class="remove" title="Remove this row">X</button></td></tr>'; '<tr><td>Student{j}</td><td>{m}</td><td>{g}</td><td>{r}</td><td>{r}</td><td>{r}</td><td>{r}</td><td><button type="button" class="remove" title="Remove this row">X</button></td></tr>';
$('button:contains(Add)').click(function(){ $('button:contains(Add)').click(function() {
// add two rows of random data! // add two rows of random data!
r = row.replace(/\{[gijmr]\}/g, function(m){ r = row.replace(/\{[gijmr]\}/g, function(m) {
return { return {
'{i}' : num + 1, '{i}' : num + 1,
'{j}' : num + 2, '{j}' : num + 2,
@ -85,7 +85,7 @@
// Delete a row // Delete a row
// ************* // *************
$table.delegate('button.remove', 'click' ,function(){ $table.delegate('button.remove', 'click' ,function() {
// NOTE this special treatment is only needed if `removeRows` is `true` // NOTE this special treatment is only needed if `removeRows` is `true`
// disabling the pager will restore all table rows // disabling the pager will restore all table rows
$table.trigger('disablePager'); $table.trigger('disablePager');
@ -97,10 +97,10 @@
// Destroy pager / Restore pager // Destroy pager / Restore pager
// ************** // **************
$('button:contains(Destroy)').click(function(){ $('button:contains(Destroy)').click(function() {
// Exterminate, annhilate, destroy! http://www.youtube.com/watch?v=LOqn8FxuyFs // Exterminate, annhilate, destroy! http://www.youtube.com/watch?v=LOqn8FxuyFs
var $t = $(this); var $t = $(this);
if (/Destroy/.test( $t.text() )){ if (/Destroy/.test( $t.text() )) {
$table.trigger('destroyPager'); $table.trigger('destroyPager');
$t.text('Restore Pager'); $t.text('Restore Pager');
} else { } else {
@ -112,14 +112,14 @@
// Disable / Enable // Disable / Enable
// ************** // **************
$('.toggle').click(function(){ $('.toggle').click(function() {
var mode = /Disable/.test( $(this).text() ); var mode = /Disable/.test( $(this).text() );
// triggering disablePager or enablePager // triggering disablePager or enablePager
$table.trigger( (mode ? 'disable' : 'enable') + 'Pager'); $table.trigger( (mode ? 'disable' : 'enable') + 'Pager');
$(this).text( ( mode ? 'Enable' : 'Disable' ) + ' Pager'); $(this).text( ( mode ? 'Enable' : 'Disable' ) + ' Pager');
return false; return false;
}); });
$table.bind('pagerChange', function(){ $table.bind('pagerChange', function() {
// pager automatically enables when table is sorted. // pager automatically enables when table is sorted.
$('.toggle').text( 'Disable Pager' ); $('.toggle').text( 'Disable Pager' );
}); });

View File

@ -22,7 +22,7 @@
<link rel="stylesheet" href="../addons/pager/jquery.tablesorter.pager.css"> <link rel="stylesheet" href="../addons/pager/jquery.tablesorter.pager.css">
<script src="../addons/pager/jquery.tablesorter.pager.js"></script> <script src="../addons/pager/jquery.tablesorter.pager.js"></script>
<script id="js">$(function(){ <script id="js">$(function() {
// ********************************** // **********************************
// Description of ALL pager options // Description of ALL pager options
@ -39,7 +39,7 @@
customAjaxUrl: function(table, url) { return url; }, customAjaxUrl: function(table, url) { return url; },
// ajax error callback from $.tablesorter.showError function // ajax error callback from $.tablesorter.showError function
// ajaxError: function( config, xhr, settings, exception ){ return exception; }; // ajaxError: function( config, xhr, settings, exception ) { return exception; };
// returning false will abort the error message // returning false will abort the error message
ajaxError: null, ajaxError: null,
@ -121,7 +121,7 @@
// bind to pager events // bind to pager events
// ********************* // *********************
.bind('pagerChange pagerComplete pagerInitialized pageMoved', function(e, c){ .bind('pagerChange pagerComplete pagerInitialized pageMoved', function(e, c) {
var msg = '"</span> event triggered, ' + (e.type === 'pagerChange' ? 'going to' : 'now on') + var msg = '"</span> event triggered, ' + (e.type === 'pagerChange' ? 'going to' : 'now on') +
' page <span class="typ">' + (c.page + 1) + '/' + c.totalPages + '</span>'; ' page <span class="typ">' + (c.page + 1) + '/' + c.totalPages + '</span>';
$('#display') $('#display')
@ -140,9 +140,9 @@
var r, $row, num = 50, var r, $row, num = 50,
row = '<tr><td>Student{i}</td><td>{m}</td><td>{g}</td><td>{r}</td><td>{r}</td><td>{r}</td><td>{r}</td><td><button type="button" class="remove" title="Remove this row">X</button></td></tr>' + row = '<tr><td>Student{i}</td><td>{m}</td><td>{g}</td><td>{r}</td><td>{r}</td><td>{r}</td><td>{r}</td><td><button type="button" class="remove" title="Remove this row">X</button></td></tr>' +
'<tr><td>Student{j}</td><td>{m}</td><td>{g}</td><td>{r}</td><td>{r}</td><td>{r}</td><td>{r}</td><td><button type="button" class="remove" title="Remove this row">X</button></td></tr>'; '<tr><td>Student{j}</td><td>{m}</td><td>{g}</td><td>{r}</td><td>{r}</td><td>{r}</td><td>{r}</td><td><button type="button" class="remove" title="Remove this row">X</button></td></tr>';
$('button:contains(Add)').click(function(){ $('button:contains(Add)').click(function() {
// add two rows of random data! // add two rows of random data!
r = row.replace(/\{[gijmr]\}/g, function(m){ r = row.replace(/\{[gijmr]\}/g, function(m) {
return { return {
'{i}' : num + 1, '{i}' : num + 1,
'{j}' : num + 2, '{j}' : num + 2,
@ -161,7 +161,7 @@
// Delete a row // Delete a row
// ************* // *************
$('table').delegate('button.remove', 'click' ,function(){ $('table').delegate('button.remove', 'click' ,function() {
var t = $('table'); var t = $('table');
// disabling the pager will restore all table rows // disabling the pager will restore all table rows
// t.trigger('disablePager'); // t.trigger('disablePager');
@ -175,10 +175,10 @@
// Destroy pager / Restore pager // Destroy pager / Restore pager
// ************** // **************
$('button:contains(Destroy)').click(function(){ $('button:contains(Destroy)').click(function() {
// Exterminate, annhilate, destroy! http://www.youtube.com/watch?v=LOqn8FxuyFs // Exterminate, annhilate, destroy! http://www.youtube.com/watch?v=LOqn8FxuyFs
var $t = $(this); var $t = $(this);
if (/Destroy/.test( $t.text() )){ if (/Destroy/.test( $t.text() )) {
$('table').trigger('destroyPager'); $('table').trigger('destroyPager');
$t.text('Restore Pager'); $t.text('Restore Pager');
} else { } else {
@ -190,26 +190,26 @@
// Disable / Enable // Disable / Enable
// ************** // **************
$('.toggle').click(function(){ $('.toggle').click(function() {
var mode = /Disable/.test( $(this).text() ); var mode = /Disable/.test( $(this).text() );
$('table').trigger( (mode ? 'disable' : 'enable') + 'Pager'); $('table').trigger( (mode ? 'disable' : 'enable') + 'Pager');
$(this).text( (mode ? 'Enable' : 'Disable') + 'Pager'); $(this).text( (mode ? 'Enable' : 'Disable') + 'Pager');
return false; return false;
}); });
$('table').bind('pagerChange', function(){ $('table').bind('pagerChange', function() {
// pager automatically enables when table is sorted. // pager automatically enables when table is sorted.
$('.toggle').text('Disable Pager'); $('.toggle').text('Disable Pager');
}); });
// clear storage (page & size) // clear storage (page & size)
$('.clear-pager-data').click(function(){ $('.clear-pager-data').click(function() {
// clears user set page & size from local storage, so on page // clears user set page & size from local storage, so on page
// reload the page & size resets to the original settings // reload the page & size resets to the original settings
$.tablesorter.storage( $('table'), 'tablesorter-pager', '' ); $.tablesorter.storage( $('table'), 'tablesorter-pager', '' );
}); });
// go to page 1 showing 10 rows // go to page 1 showing 10 rows
$('.goto').click(function(){ $('.goto').click(function() {
// triggering "pageAndSize" without parameters will reset the // triggering "pageAndSize" without parameters will reset the
// pager to page 1 and the original set size (10 by default) // pager to page 1 and the original set size (10 by default)
// $('table').trigger('pageAndSize') // $('table').trigger('pageAndSize')
@ -218,8 +218,8 @@
});</script> });</script>
<script> <script>
$(function(){ $(function() {
$('.clear').click(function(){ $('.clear').click(function() {
$('#display').html( new Array(6).join('<li>&nbsp;</li>') ); $('#display').html( new Array(6).join('<li>&nbsp;</li>') );
}); });
}); });

View File

@ -18,7 +18,7 @@
<script src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<script id="js">// add parser through the tablesorter addParser method <script id="js">// add parser through the tablesorter addParser method
$(function(){ $(function() {
$.tablesorter.addParser({ $.tablesorter.addParser({
// set a unique id // set a unique id

View File

@ -17,7 +17,7 @@
<link rel="stylesheet" href="../css/theme.blue.css"> <link rel="stylesheet" href="../css/theme.blue.css">
<script src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<script id="js">$(function(){ <script id="js">$(function() {
$("table").tablesorter({ theme: 'blue' }); $("table").tablesorter({ theme: 'blue' });
});</script> });</script>
</head> </head>

View File

@ -35,7 +35,7 @@
}); });
// filter buttons // filter buttons
$('button').on('click', function(){ $('button').on('click', function() {
var $this = $(this), var $this = $(this),
filter = [], filter = [],
column = $this.attr('data-column'); column = $this.attr('data-column');

View File

@ -196,7 +196,7 @@
.params { font-size: 0.8em; } .params { font-size: 0.8em; }
</style> </style>
<script> <script>
$(function(){ $(function() {
var tdy = $('.tdy'), // two digit year var tdy = $('.tdy'), // two digit year
a = $('.result'), // answer a = $('.result'), // answer
r = $('.range'), // range r = $('.range'), // range
@ -206,7 +206,7 @@ $(function(){
tdy.val( (y + 20).toString().slice(-2) ); // use this year + 20 tdy.val( (y + 20).toString().slice(-2) ); // use this year + 20
c.val( y ); c.val( y );
$('input').on('change', function(){ $('input').on('change', function() {
var y = parseInt(tdy.val(), 10), var y = parseInt(tdy.val(), 10),
result = 1900 + y, result = 1900 + y,
range = parseInt(r.val(), 10); range = parseInt(r.val(), 10);

View File

@ -148,12 +148,12 @@
</div> </div>
<script> <script>
$(function(){ $(function() {
var $table = $('table'), var $table = $('table'),
len = $table[0].config.durationLength, len = $table[0].config.durationLength,
regex = new RegExp('(\\d{' + len + '})', 'g'); regex = new RegExp('(\\d{' + len + '})', 'g');
// add parsed values to order & value column // add parsed values to order & value column
addParsedValues( $table, [1,2], function(v){ addParsedValues( $table, [1,2], function(v) {
var t = v.replace(regex, '$1|'); var t = v.replace(regex, '$1|');
return t.substring(0, t.length - 1); return t.substring(0, t.length - 1);
}); });

View File

@ -117,9 +117,9 @@
</div> </div>
<script> <script>
$(function(){ $(function() {
// add parsed values to columns [0,1] // add parsed values to columns [0,1]
addParsedValues($('table'), [0,1], function(num){ return Math.round(num * 100)/100; }); addParsedValues($('table'), [0,1], function(num) { return Math.round(num * 100)/100; });
}); });
</script> </script>

View File

@ -170,8 +170,8 @@ $.tablesorter.fileTypes.equivalents["Fonts"] += '|svg'; // just add it to the en
<script> <script>
/* DEMO ONLY CODE */ /* DEMO ONLY CODE */
$(function(){ $(function() {
$('button').click(function(){ $('button').click(function() {
$('#media').toggleClass('group-separator-1 group-separator-2'); $('#media').toggleClass('group-separator-1 group-separator-2');
$('table').trigger('sorton', [ [[3,0]] ]); $('table').trigger('sorton', [ [[3,0]] ]);
}); });

View File

@ -59,7 +59,7 @@
</ul> </ul>
</li> </li>
<li>If the parser doesn't auto-detect which column has IPv6 addresses, use the headers sorter option to set it: <li>If the parser doesn't auto-detect which column has IPv6 addresses, use the headers sorter option to set it:
<pre class="prettyprint lang-javascript">$(function(){ <pre class="prettyprint lang-javascript">$(function() {
$('table').tablesorter({ $('table').tablesorter({
headers: { headers: {
1: { sorter: 'MAC' }, 1: { sorter: 'MAC' },
@ -130,7 +130,7 @@ $(function() {
</div> </div>
<script> <script>
$(function(){ $(function() {
// add parsed values to columns [0,1] // add parsed values to columns [0,1]
addParsedValues($('table'), [1,2,3]); addParsedValues($('table'), [1,2,3]);
}); });

View File

@ -17,7 +17,7 @@
<link rel="stylesheet" href="../css/theme.blue.css"> <link rel="stylesheet" href="../css/theme.blue.css">
<script src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<script id="js">$(function(){ <script id="js">$(function() {
// set Discount column parser using jQuery data (either 'digit' or 'percent' will work) // set Discount column parser using jQuery data (either 'digit' or 'percent' will work)
$('th.discount').data('sorter', 'digit'); $('th.discount').data('sorter', 'digit');
// set an initial sort on the table using jQuery data // set an initial sort on the table using jQuery data

View File

@ -111,7 +111,7 @@
</div> </div>
<script> <script>
$(function(){ $(function() {
// add parsed values to columns [0,1] // add parsed values to columns [0,1]
addParsedValues($('table'), [0, 1, 2, 3]); addParsedValues($('table'), [0, 1, 2, 3]);
}); });

View File

@ -124,9 +124,9 @@
</div> </div>
<script> <script>
$(function(){ $(function() {
// add parsed values to columns [0,1] // add parsed values to columns [0,1]
addParsedValues($('table'), [0,1], function(num){ return num.toExponential(); }); addParsedValues($('table'), [0,1], function(num) { return num.toExponential(); });
}); });
</script> </script>

View File

@ -167,7 +167,7 @@
</div> </div>
<script> <script>
$(function(){ $(function() {
// add parsed values to columns [0,1] // add parsed values to columns [0,1]
addParsedValues($('table'), [0,1]); addParsedValues($('table'), [0,1]);
}); });

View File

@ -228,7 +228,7 @@
</div> </div>
<script> <script>
$(function(){ $(function() {
// add parsed values to order & value column // add parsed values to order & value column
addParsedValues($('table'), [0,1,2,3,4]); addParsedValues($('table'), [0,1,2,3,4]);
}); });

View File

@ -51,13 +51,13 @@
}); });
// sort using data-sort attribute value // sort using data-sort attribute value
$('button[data-sort]').click(function(){ $('button[data-sort]').click(function() {
var sort = $(this).data('sort'); var sort = $(this).data('sort');
$(this).closest('.block').find('table').trigger('sorton', [ sort ]); $(this).closest('.block').find('table').trigger('sorton', [ sort ]);
return false; return false;
}); });
$('.sortReset-toggle').click(function(){ $('.sortReset-toggle').click(function() {
var c = $(this).closest('.block').find('table')[0].config; var c = $(this).closest('.block').find('table')[0].config;
c.sortReset = !c.sortReset; c.sortReset = !c.sortReset;
$(this).next().html('' + c.sortReset); $(this).next().html('' + c.sortReset);
@ -74,7 +74,7 @@
<script> <script>
// demo stuff (update pre with current sort) // demo stuff (update pre with current sort)
$(function() { $(function() {
$('button[data-sort]').click(function(){ $('button[data-sort]').click(function() {
var $this = $(this), var $this = $(this),
$box = $this.closest('.box'), $box = $this.closest('.box'),
sort = $this.data('sort'), sort = $this.data('sort'),

View File

@ -17,7 +17,7 @@
<link rel="stylesheet" href="../css/theme.blue.css"> <link rel="stylesheet" href="../css/theme.blue.css">
<script src="../js/jquery.tablesorter.js"></script> <script src="../js/jquery.tablesorter.js"></script>
<script id="js">$(function(){ <script id="js">$(function() {
var start; var start;
// call the tablesorter plugin, the magic happens in the markup // call the tablesorter plugin, the magic happens in the markup
@ -29,12 +29,12 @@
}) })
// assign the sortStart event // assign the sortStart event
.bind("sortStart",function(e, t){ .bind("sortStart",function(e, t) {
start = e.timeStamp; start = e.timeStamp;
$("#display").append('<li>Sort Started</li>').find('li:first').remove(); $("#display").append('<li>Sort Started</li>').find('li:first').remove();
}) })
.bind("sortEnd",function(e, t){ .bind("sortEnd",function(e, t) {
$("#display").append('<li>Sort Ended after ' + ( (e.timeStamp - start)/1000 ).toFixed(2) + ' seconds</li>').find('li:first').remove(); $("#display").append('<li>Sort Ended after ' + ( (e.timeStamp - start)/1000 ).toFixed(2) + ' seconds</li>').find('li:first').remove();
}); });

View File

@ -31,12 +31,12 @@
// append new html to thead & tbody // append new html to thead & tbody
$("table thead th:eq(2)").html("Age"); $("table thead th:eq(2)").html("Age");
$("table tbody").find('td:nth-child(3)').html(function(i,h){ $("table tbody").find('td:nth-child(3)').html(function(i,h) {
return h.substring(1); // remove x & y prefix return h.substring(1); // remove x & y prefix
}); });
var resort = true, // re-apply the current sort var resort = true, // re-apply the current sort
callback = function(){ callback = function() {
// do something after the updateAll method has completed // do something after the updateAll method has completed
}; };

View File

@ -30,7 +30,7 @@
// randomize a number // randomize a number
var resort = "", // resort variable set to anything BUT false (without quotes) will trigger the automatic resort var resort = "", // resort variable set to anything BUT false (without quotes) will trigger the automatic resort
discount = '$' + Math.round(Math.random() * Math.random() * 100) + '.' + ('0' + Math.round(Math.random() * Math.random() * 100)).slice(-2), discount = '$' + Math.round(Math.random() * Math.random() * 100) + '.' + ('0' + Math.round(Math.random() * Math.random() * 100)).slice(-2),
callback = function(table){ /* do something */ }; callback = function(table) { /* do something */ };
$(this).text(discount); $(this).text(discount);
// set resort flag to false to prevent automatic resort // set resort flag to false to prevent automatic resort

View File

@ -391,7 +391,7 @@ td:nth-child(3) .ts-align-right i {
<script> <script>
/* DEMO ONLY CODE */ /* DEMO ONLY CODE */
$(function(){ $(function() {
var $table = $('#demo table'), var $table = $('#demo table'),
c = $table[0].config, c = $table[0].config,
$animals = c.$headers.eq(2), $animals = c.$headers.eq(2),
@ -403,7 +403,7 @@ $(function(){
min: 0, min: 0,
max: 3, max: 3,
step: 1, step: 1,
create: function(){ create: function() {
$animals.find('span').html( $animals.attr('data-align-index') ); $animals.find('span').html( $animals.attr('data-align-index') );
}, },
slide: function( event, ui ) { slide: function( event, ui ) {
@ -419,7 +419,7 @@ $(function(){
min: 0, min: 0,
max: 4, max: 4,
step: 1, step: 1,
create: function(){ create: function() {
$sites.find('span').html( $sites.attr('data-align-index') ); $sites.find('span').html( $sites.attr('data-align-index') );
}, },
slide: function( event, ui ) { slide: function( event, ui ) {
@ -435,7 +435,7 @@ $(function(){
min: -30, min: -30,
max: 30, max: 30,
step: 5, step: 5,
create: function(){ create: function() {
$sites.find('span').html( $sites.attr('data-align-index') ); $sites.find('span').html( $sites.attr('data-align-index') );
}, },
slide: function( event, ui ) { slide: function( event, ui ) {

View File

@ -152,7 +152,7 @@
Add a function that returns a useable build_type. (e.g. string to array) Add a function that returns a useable build_type. (e.g. string to array)
<div class="collapsible"><br> <div class="collapsible"><br>
The function receives two parameters: <code>data</code> which contains the obtained data and <code>wo</code> which is the widget options (<code>table.config.widgetOptions</code>).<br> The function receives two parameters: <code>data</code> which contains the obtained data and <code>wo</code> which is the widget options (<code>table.config.widgetOptions</code>).<br>
Example: <code>build_processing: function(data, wo){ return data.split(';'); }</code> Example: <code>build_processing: function(data, wo) { return data.split(';'); }</code>
</div> </div>
</td> </td>
</tr> </tr>

View File

@ -521,7 +521,7 @@ FusionCharts.ready(function () {
packages: ["bar", "corechart", "line"] packages: ["bar", "corechart", "line"]
}); });
$(function(){ $(function() {
/* Initial settings */ /* Initial settings */
var $table = $('#table'), var $table = $('#table'),
$chart = $('#chart'), $chart = $('#chart'),
@ -629,7 +629,7 @@ $(function(){
} }
$icons.removeClass('active'); $icons.removeClass('active');
var $t = $(this).addClass('active'); var $t = $(this).addClass('active');
$.each(types, function(i, v){ $.each(types, function(i, v) {
if ($t.hasClass(v.icon)) { if ($t.hasClass(v.icon)) {
settings.type = i; settings.type = i;
} }
@ -637,7 +637,7 @@ $(function(){
drawChart(); drawChart();
}); });
$rowType.on('change', function(){ $rowType.on('change', function() {
$table[0].config.widgetOptions.chart_incRows = $rowType.filter(':checked').attr('data-type'); $table[0].config.widgetOptions.chart_incRows = $rowType.filter(':checked').attr('data-type');
// update data, then draw new chart // update data, then draw new chart
$table.trigger('chartData'); $table.trigger('chartData');
@ -686,15 +686,14 @@ $(function(){
pager_output: 'Showing {startRow} to {endRow} of {filteredRows} results', pager_output: 'Showing {startRow} to {endRow} of {filteredRows} results',
pager_size: 5, pager_size: 5,
chart_incRows: 'f', chart_incRows: 'f',
chart_useSelector: true, chart_useSelector: true
chart_hideTable: false
} }
}); });
});</script> });</script>
<script> <script>
$(function(){ $(function() {
$('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="tooltip"]').tooltip();
}); });
</script> </script>

View File

@ -108,7 +108,7 @@
// container layout // container layout
columnSelector_layout : '<label><input type="checkbox">{name}</label>', columnSelector_layout : '<label><input type="checkbox">{name}</label>',
// layout customizer callback called for each column // layout customizer callback called for each column
// function($cell, name, column){ return name || $cell.html(); } // function($cell, name, column) { return name || $cell.html(); }
columnSelector_layoutCustomizer : null, columnSelector_layoutCustomizer : null,
// data attribute containing column name to use in the selector container // data attribute containing column name to use in the selector container
columnSelector_name : 'data-selector-name', columnSelector_name : 'data-selector-name',
@ -552,7 +552,7 @@
<div class="collapsible"> <div class="collapsible">
<br> <br>
<p>Bind to this event if you to need to perform an action after the columnSelector has finished hiding or showing columns.</p> <p>Bind to this event if you to need to perform an action after the columnSelector has finished hiding or showing columns.</p>
Use it as follows<pre class="prettyprint lang-js">$('table').on('columnUpdate', function(){ Use it as follows<pre class="prettyprint lang-js">$('table').on('columnUpdate', function() {
// set ascending sort on first column // set ascending sort on first column
$(this).trigger('sorton', [ [[0,0]] ]); $(this).trigger('sorton', [ [[0,0]] ]);
});</pre> });</pre>

View File

@ -62,7 +62,7 @@ $(function() {
} }
$('select') $('select')
.html(o) .html(o)
.change(function(){ .change(function() {
var theme = $(this).val().toLowerCase(); var theme = $(this).val().toLowerCase();
$('table') $('table')
.removeClass('tablesorter-' + t.join(' tablesorter-')) .removeClass('tablesorter-' + t.join(' tablesorter-'))

View File

@ -56,7 +56,7 @@
<script src="../js/jquery.tablesorter.widgets.js"></script> <script src="../js/jquery.tablesorter.widgets.js"></script>
<script src="../js/widgets/widget-cssStickyHeaders.js"></script> <script src="../js/widgets/widget-cssStickyHeaders.js"></script>
<script id="js">$(function(){ <script id="js">$(function() {
$('.open-popup-link').magnificPopup({ $('.open-popup-link').magnificPopup({
type: 'inline', type: 'inline',
@ -114,7 +114,7 @@
});</script> });</script>
<script> <script>
$(function() { $(function() {
$('link.theme').each(function(){ this.disabled = true; }); $('link.theme').each(function() { this.disabled = true; });
var themes = 'default blue green grey ice black-ice dark dropbox', var themes = 'default blue green grey ice black-ice dark dropbox',
i, o = '', t = themes.split(' '); i, o = '', t = themes.split(' ');
@ -124,12 +124,12 @@ $(function() {
$('select:first') $('select:first')
.append(o) .append(o)
.change(function(){ .change(function() {
var theme = $(this).val().toLowerCase(), var theme = $(this).val().toLowerCase(),
files = $('link.theme').each(function(){ files = $('link.theme').each(function() {
this.disabled = true; this.disabled = true;
}) })
files.filter('[href$="theme.' + theme + '.css"]').each(function(){ files.filter('[href$="theme.' + theme + '.css"]').each(function() {
this.disabled = false; this.disabled = false;
}); });
$('table') $('table')
@ -138,10 +138,10 @@ $(function() {
}).change(); }).change();
window.addCaption = true; window.addCaption = true;
$('.caption').on('click', function(){ $('.caption').on('click', function() {
addCaption = !addCaption; addCaption = !addCaption;
$(this).html( '' + addCaption ); $(this).html( '' + addCaption );
$('#table0, #table1, #table2, #table3, .nested').each(function(){ $('#table0, #table1, #table2, #table3, .nested').each(function() {
if (this.config) { if (this.config) {
this.config.widgetOptions.cssStickyHeaders_addCaption = addCaption; this.config.widgetOptions.cssStickyHeaders_addCaption = addCaption;
} }

View File

@ -21,7 +21,7 @@
#display li:last-child { color: #008080; } #display li:last-child { color: #008080; }
</style> </style>
<script id="js">$(function(){ <script id="js">$(function() {
$.tablesorter.currentSortLanguage = { $.tablesorter.currentSortLanguage = {
0: 'asc', 0: 'asc',

View File

@ -58,7 +58,7 @@ td.editable_updated {
editable_enterToAccept : true, // press enter to accept content, or click outside if false editable_enterToAccept : true, // press enter to accept content, or click outside if false
editable_autoAccept : true, // accepts any changes made to the table cell automatically (v2.17.6) editable_autoAccept : true, // accepts any changes made to the table cell automatically (v2.17.6)
editable_autoResort : false, // auto resort after the content has changed. editable_autoResort : false, // auto resort after the content has changed.
editable_validate : null, // return a valid string: function(text, original, columnIndex){ return text; } editable_validate : null, // return a valid string: function(text, original, columnIndex) { return text; }
editable_focused : function(txt, columnIndex, $element) { editable_focused : function(txt, columnIndex, $element) {
// $element is the div, not the td // $element is the div, not the td
// to get the td, use $element.closest('td') // to get the td, use $element.closest('td')
@ -69,7 +69,7 @@ td.editable_updated {
// to get the td, use $element.closest('td') // to get the td, use $element.closest('td')
$element.removeClass('focused'); $element.removeClass('focused');
}, },
editable_selectAll : function(txt, columnIndex, $element){ editable_selectAll : function(txt, columnIndex, $element) {
// note $element is the div inside of the table cell, so use $element.closest('td') to get the cell // note $element is the div inside of the table cell, so use $element.closest('td') to get the cell
// only select everthing within the element when the content starts with the letter "B" // only select everthing within the element when the content starts with the letter "B"
return /^b/i.test(txt) && columnIndex === 0; return /^b/i.test(txt) && columnIndex === 0;
@ -81,7 +81,7 @@ td.editable_updated {
} }
}) })
// config event variable new in v2.17.6 // config event variable new in v2.17.6
.children('tbody').on('editComplete', 'td', function(event, config){ .children('tbody').on('editComplete', 'td', function(event, config) {
var $this = $(this), var $this = $(this),
newContent = $this.text(), newContent = $this.text(),
cellIndex = this.cellIndex, // there shouldn't be any colspans in the tbody cellIndex = this.cellIndex, // there shouldn't be any colspans in the tbody
@ -90,7 +90,7 @@ td.editable_updated {
// Do whatever you want here to indicate // Do whatever you want here to indicate
// that the content was updated // that the content was updated
$this.addClass( 'editable_updated' ); // green background + white text $this.addClass( 'editable_updated' ); // green background + white text
setTimeout(function(){ setTimeout(function() {
$this.removeClass( 'editable_updated' ); $this.removeClass( 'editable_updated' );
}, 500); }, 500);
@ -285,7 +285,7 @@ td.editable_updated {
<td>Event fired after the table content has been edited <td>Event fired after the table content has been edited
<div class="collapsible"> <div class="collapsible">
<br> <br>
<pre class="prettyprint lang-js">$(function(){ <pre class="prettyprint lang-js">$(function() {
$('#table') $('#table')
.tablesorter({ .tablesorter({
@ -295,7 +295,7 @@ td.editable_updated {
} }
}) })
// use delegated event binding // use delegated event binding
.on('giterdone', 'td', function(event, config){ .on('giterdone', 'td', function(event, config) {
// this = td; the event bubble up // this = td; the event bubble up
console.log( 'new content = ' + $(this).text() ); console.log( 'new content = ' + $(this).text() );
}); });
@ -312,16 +312,16 @@ td.editable_updated {
<div class="collapsible"> <div class="collapsible">
<br> <br>
Set this function to manipulate or adjust the content when the content editable is focused Set this function to manipulate or adjust the content when the content editable is focused
<pre class="prettyprint lang-js">$(function(){ <pre class="prettyprint lang-js">$(function() {
$('#table').tablesorter({ $('#table').tablesorter({
widgets : ['editable'], widgets : ['editable'],
widgetOptions : { widgetOptions : {
editable_focused : function(txt, columnIndex, $element){ editable_focused : function(txt, columnIndex, $element) {
// note $element is the div inside of the table cell, so use $element.closest('td') to get the cell // note $element is the div inside of the table cell, so use $element.closest('td') to get the cell
$element.closest('td').addClass('focused'); $element.closest('td').addClass('focused');
}, },
editable_blur : function(txt, columnIndex, $element){ editable_blur : function(txt, columnIndex, $element) {
$element.closest('td').removeClass('focused'); $element.closest('td').removeClass('focused');
} }
} }
@ -339,16 +339,16 @@ td.editable_updated {
<div class="collapsible"> <div class="collapsible">
<br> <br>
Set this function to manipulate or adjust the content when the content editable is blurred Set this function to manipulate or adjust the content when the content editable is blurred
<pre class="prettyprint lang-js">$(function(){ <pre class="prettyprint lang-js">$(function() {
$('#table').tablesorter({ $('#table').tablesorter({
widgets : ['editable'], widgets : ['editable'],
widgetOptions : { widgetOptions : {
editable_focused : function(txt, columnIndex, $element){ editable_focused : function(txt, columnIndex, $element) {
// note $element is the div inside of the table cell, so use $element.closest('td') to get the cell // note $element is the div inside of the table cell, so use $element.closest('td') to get the cell
$element.closest('td').addClass('focused'); $element.closest('td').addClass('focused');
}, },
editable_blur : function(txt, columnIndex, $element){ editable_blur : function(txt, columnIndex, $element) {
$element.closest('td').removeClass('focused'); $element.closest('td').removeClass('focused');
} }
} }
@ -371,12 +371,12 @@ td.editable_updated {
<li>When <code>false</code>, no selection is made.</li> <li>When <code>false</code>, no selection is made.</li>
<li>When this option contains a function, return either <code>true</code> to select all of the text within the element, or <code>false</code> to not select any text.</li> <li>When this option contains a function, return either <code>true</code> to select all of the text within the element, or <code>false</code> to not select any text.</li>
</ul> </ul>
<pre class="prettyprint lang-js">$(function(){ <pre class="prettyprint lang-js">$(function() {
$('#table').tablesorter({ $('#table').tablesorter({
widgets : ['editable'], widgets : ['editable'],
widgetOptions : { widgetOptions : {
editable_selectAll : function(txt, columnIndex, $element){ editable_selectAll : function(txt, columnIndex, $element) {
// note $element is the div inside of the table cell, so use $element.closest('td') to get the cell // note $element is the div inside of the table cell, so use $element.closest('td') to get the cell
// only select everthing within the element when the content starts with the letter "B" // only select everthing within the element when the content starts with the letter "B"
return /^b/i.test(txt) && columnIndex === 0; return /^b/i.test(txt) && columnIndex === 0;
@ -404,13 +404,13 @@ td.editable_updated {
<li>A <code>$element</code> parameter has been included which contains the contenteditable element. To get the table cell, use <code>$element.closest('td');</code></li> <li>A <code>$element</code> parameter has been included which contains the contenteditable element. To get the table cell, use <code>$element.closest('td');</code></li>
</ul> </ul>
This function must return either a string containing the modified content or <code>false</code> to revert the content back to it's original value. Example: This function must return either a string containing the modified content or <code>false</code> to revert the content back to it's original value. Example:
<pre class="prettyprint lang-js">$(function(){ <pre class="prettyprint lang-js">$(function() {
$('#table1').tablesorter({ $('#table1').tablesorter({
widgets : ['editable'], widgets : ['editable'],
widgetOptions : { widgetOptions : {
// global validate function // global validate function
editable_validate : function(txt, orig, columnIndex, $element){ editable_validate : function(txt, orig, columnIndex, $element) {
// only allow one word // only allow one word
var t = /\s/.test(txt) ? txt.split(/\s/)[0] : txt; var t = /\s/.test(txt) ? txt.split(/\s/)[0] : txt;
return t || false; return t || false;
@ -423,7 +423,7 @@ td.editable_updated {
widgetOptions : { widgetOptions : {
// validate function per column // validate function per column
editable_validate : { editable_validate : {
0 : function(txt, orig, columnIndex, $element){ 0 : function(txt, orig, columnIndex, $element) {
// allow up to two words // allow up to two words
var t = txt.split(' '); var t = txt.split(' ');
return t.length > 2 ? t[0] + (t[1] ? ' ' + t[1] : '') : txt; return t.length > 2 ? t[0] + (t[1] ? ' ' + t[1] : '') : txt;
@ -455,7 +455,7 @@ td.editable_updated {
If this option is <code>true</code>, this widget will trim content <em>upon initialization</em>; this is necessary if you need cleaned it up content before editing, like with an autocomplete script.<br> If this option is <code>true</code>, this widget will trim content <em>upon initialization</em>; this is necessary if you need cleaned it up content before editing, like with an autocomplete script.<br>
<br> <br>
Use this option as follows: Use this option as follows:
<pre class="prettyprint lang-js">$(function(){ <pre class="prettyprint lang-js">$(function() {
$('#table').tablesorter({ $('#table').tablesorter({
widgets : ['editable'], widgets : ['editable'],
@ -482,7 +482,7 @@ td.editable_updated {
<li>If the cell already has children (one or more) immediately inside of the table cell, no wrapping occurs and the child element(s) that don't have the class name set in <code>editable_noEdit</code>, will have the "contenteditable" attribute enabled.</li> <li>If the cell already has children (one or more) immediately inside of the table cell, no wrapping occurs and the child element(s) that don't have the class name set in <code>editable_noEdit</code>, will have the "contenteditable" attribute enabled.</li>
</ul> </ul>
Note: that this option uses jQuery's <code>wrapInner</code>, so this option can be set to a html string or selector, jQuery object, DOM element, or a function (jQuery 1.4+) Note: that this option uses jQuery's <code>wrapInner</code>, so this option can be set to a html string or selector, jQuery object, DOM element, or a function (jQuery 1.4+)
<pre class="prettyprint lang-js">$(function(){ <pre class="prettyprint lang-js">$(function() {
$('#table').tablesorter({ $('#table').tablesorter({
widgets : ['editable'], widgets : ['editable'],
@ -583,11 +583,11 @@ td.editable_updated {
<script> <script>
$(function() { $(function() {
var wo = $('#table')[0].config.widgetOptions; var wo = $('#table')[0].config.widgetOptions;
$('.enter').click(function(){ $('.enter').click(function() {
var t = wo.editable_enterToAccept = !wo.editable_enterToAccept; var t = wo.editable_enterToAccept = !wo.editable_enterToAccept;
$(this).next().find('span').html('' + t); $(this).next().find('span').html('' + t);
}); });
$('.auto').click(function(){ $('.auto').click(function() {
var t = wo.editable_autoAccept = !wo.editable_autoAccept; var t = wo.editable_autoAccept = !wo.editable_autoAccept;
$(this).next().find('span').html('' + t); $(this).next().find('span').html('' + t);
}); });

View File

@ -42,7 +42,7 @@
}); });
// make demo search buttons work // make demo search buttons work
$('button[data-column]').on('click', function(){ $('button[data-column]').on('click', function() {
var $this = $(this), var $this = $(this),
totalColumns = $table[0].config.columns, totalColumns = $table[0].config.columns,
col = $this.data('column'), // zero-based index or "all" col = $this.data('column'), // zero-based index or "all"

View File

@ -99,7 +99,7 @@ tr.group-header.collapsed td i {
return false; return false;
}); });
$('.toggle').click(function(){ $('.toggle').click(function() {
var wo = $table[0].config.widgetOptions, var wo = $table[0].config.widgetOptions,
set = !wo.filter_childWithSibs; set = !wo.filter_childWithSibs;
wo.filter_childWithSibs = set; wo.filter_childWithSibs = set;
@ -108,7 +108,7 @@ tr.group-header.collapsed td i {
$table.trigger( 'search', false ); $table.trigger( 'search', false );
}); });
$('.search').click(function(){ $('.search').click(function() {
var filter = [], var filter = [],
$this = $(this), $this = $(this),
col = parseInt( $this.attr('data-column'), 10 ); col = parseInt( $this.attr('data-column'), 10 );

View File

@ -24,7 +24,7 @@
#types { width: 100%; } #types { width: 100%; }
</style> </style>
<script> <script>
$(function(){ $(function() {
$('#types').tablesorter(); $('#types').tablesorter();
}); });
</script> </script>
@ -70,7 +70,7 @@ $(function() {
// External search // External search
// buttons set up like this: // buttons set up like this:
// <button type="button" class="search" data-filter-column="4" data-filter-text="2?%">Saved Search</button> // <button type="button" class="search" data-filter-column="4" data-filter-text="2?%">Saved Search</button>
$('button').click(function(){ $('button').click(function() {
var $t = $(this), var $t = $(this),
col = $t.data('filter-column'), // zero-based index col = $t.data('filter-column'), // zero-based index
filter = []; filter = [];
@ -211,7 +211,7 @@ $.tablesorter.filter.types.start = function( config, data ) {
<div> <div>
<ul> <ul>
<li>If one of the built-in search types is interfering or bothersome to your users, then you can remove it using the following command (using fuzzy search as an example): <li>If one of the built-in search types is interfering or bothersome to your users, then you can remove it using the following command (using fuzzy search as an example):
<pre class="prettyprint lang-js">$(function(){ <pre class="prettyprint lang-js">$(function() {
// Remove fuzzy search // Remove fuzzy search
delete $.tablesorter.filter.types.fuzzy; delete $.tablesorter.filter.types.fuzzy;

View File

@ -44,8 +44,8 @@
});</script> });</script>
<script> <script>
$(function(){ $(function() {
$('button').on('click', function(){ $('button').on('click', function() {
var $this = $(this), var $this = $(this),
filters = [], filters = [],
col = $(this).data('column'), col = $(this).data('column'),

View File

@ -22,12 +22,12 @@
<script src="../js/widgets/widget-filter.js"></script> <script src="../js/widgets/widget-filter.js"></script>
<script> <script>
$(function(){ $(function() {
// External search // External search
// buttons set up like this: // buttons set up like this:
// <button type="button" class="search" data-filter-column="4" data-filter-text="2?%">Saved Search</button> // <button type="button" class="search" data-filter-column="4" data-filter-text="2?%">Saved Search</button>
$('button.match').click(function(){ $('button.match').click(function() {
// toggle "filter-match" class on first column // toggle "filter-match" class on first column
var first = $('table').find('th:first').toggleClass('filter-match'); var first = $('table').find('th:first').toggleClass('filter-match');
@ -44,7 +44,7 @@
return false; return false;
}); });
$('.accordion button[data-filter-column]').click(function(){ $('.accordion button[data-filter-column]').click(function() {
var filters = [], var filters = [],
$t = $(this), $t = $(this),
col = $t.data('filter-column'), // zero-based index col = $t.data('filter-column'), // zero-based index
@ -54,7 +54,7 @@
return false; return false;
}); });
$('button.search-type').click(function(){ $('button.search-type').click(function() {
var c = $('#demo table')[0].config, var c = $('#demo table')[0].config,
wo = c.widgetOptions, wo = c.widgetOptions,
search = wo.filter_searchFiltered = !wo.filter_searchFiltered; search = wo.filter_searchFiltered = !wo.filter_searchFiltered;

View File

@ -52,7 +52,7 @@
*/ */
// Allow changing an input from one column (any column) to another // Allow changing an input from one column (any column) to another
$('select').change(function(){ $('select').change(function() {
// modify the search input data-column value (swap "0" or "all in this demo) // modify the search input data-column value (swap "0" or "all in this demo)
$('.selectable').attr( 'data-column', $(this).val() ); $('.selectable').attr( 'data-column', $(this).val() );
// update external search inputs // update external search inputs

View File

@ -39,19 +39,19 @@
<script src="../js/widgets/widget-uitheme.js"></script> <script src="../js/widgets/widget-uitheme.js"></script>
<script src="../js/widgets/widget-filter-formatter-jui.js"></script> <script src="../js/widgets/widget-filter-formatter-jui.js"></script>
<script> <script>
$(function(){ $(function() {
$('#switcher').jui_theme_switch({ $('#switcher').jui_theme_switch({
stylesheet_link_id : 'ui-theme', stylesheet_link_id : 'ui-theme',
datasource_url : 'assets/theme_switcher.json' datasource_url : 'assets/theme_switcher.json'
}); });
$('.accordion button').on('click', function(){ $('.accordion button').on('click', function() {
var $this = $(this), var $this = $(this),
column = $this.data('column'), column = $this.data('column'),
filters = []; filters = [];
filters[ column ] = $this.data('value'); filters[ column ] = $this.data('value');
$('table').trigger('sorton', [ [[column, 0]], function(){ $('table').trigger('sorton', [ [[column, 0]], function() {
$.tablesorter.setFilters( $('table'), filters, true ); $.tablesorter.setFilters( $('table'), filters, true );
} ]); } ]);
}); });
@ -77,7 +77,7 @@
filter_formatter : { filter_formatter : {
// Rank (jQuery selector added v2.17.0) // Rank (jQuery selector added v2.17.0)
'th:contains("Rank")' : function($cell, indx){ 'th:contains("Rank")' : function($cell, indx) {
return $.tablesorter.filterFormatter.uiSlider( $cell, indx, { return $.tablesorter.filterFormatter.uiSlider( $cell, indx, {
delayed : true, delayed : true,
valueToHeader : false, valueToHeader : false,
@ -92,7 +92,7 @@
}, },
// Age // Age
1 : function($cell, indx){ 1 : function($cell, indx) {
return $.tablesorter.filterFormatter.uiSlider( $cell, indx, { return $.tablesorter.filterFormatter.uiSlider( $cell, indx, {
delayed : false, delayed : false,
valueToHeader : false, valueToHeader : false,
@ -108,7 +108,7 @@
}, },
// Total (jQuery selector added v2.17.0) // Total (jQuery selector added v2.17.0)
'.total' : function($cell, indx){ '.total' : function($cell, indx) {
return $.tablesorter.filterFormatter.uiRange( $cell, indx, { return $.tablesorter.filterFormatter.uiRange( $cell, indx, {
delayed : false, delayed : false,
valueToHeader : false, valueToHeader : false,
@ -120,7 +120,7 @@
}, },
// Discount // Discount
3 : function($cell, indx){ 3 : function($cell, indx) {
return $.tablesorter.filterFormatter.uiSpinner( $cell, indx, { return $.tablesorter.filterFormatter.uiSpinner( $cell, indx, {
delayed : true, delayed : true,
addToggle : false, addToggle : false,
@ -136,7 +136,7 @@
}, },
// Date (one input) // Date (one input)
4 : function($cell, indx){ 4 : function($cell, indx) {
return $.tablesorter.filterFormatter.uiDateCompare( $cell, indx, { return $.tablesorter.filterFormatter.uiDateCompare( $cell, indx, {
cellText : 'Dates', // text added before the input cellText : 'Dates', // text added before the input
compare : [ '', '=', '>=', '<=' ], compare : [ '', '=', '>=', '<=' ],
@ -150,7 +150,7 @@
}, },
// Date (two inputs) // Date (two inputs)
5 : function($cell, indx){ 5 : function($cell, indx) {
return $.tablesorter.filterFormatter.uiDatepicker( $cell, indx, { return $.tablesorter.filterFormatter.uiDatepicker( $cell, indx, {
// from : '08/01/2013', // default from date // from : '08/01/2013', // default from date
// to : '1/18/2014', // default to date // to : '1/18/2014', // default to date
@ -266,7 +266,7 @@
filter_formatter : { filter_formatter : {
// Rank (jQuery selector added v2.17.0) // Rank (jQuery selector added v2.17.0)
'th:contains("Rank")' : function($cell, indx){ 'th:contains("Rank")' : function($cell, indx) {
return $.tablesorter.filterFormatter.uiSlider( $cell, indx, { return $.tablesorter.filterFormatter.uiSlider( $cell, indx, {
// filterFormatter options // filterFormatter options
cellText : 'Rank:', cellText : 'Rank:',
@ -285,7 +285,7 @@
}, },
// Age // Age
1 : function($cell, indx){ 1 : function($cell, indx) {
return $.tablesorter.filterFormatter.uiSlider( $cell, indx, { return $.tablesorter.filterFormatter.uiSlider( $cell, indx, {
delayed: false, // delay search (set by filter_searchDelay) delayed: false, // delay search (set by filter_searchDelay)
valueToHeader: false, // add current slider value to the header cell valueToHeader: false, // add current slider value to the header cell
@ -334,7 +334,7 @@
filter_formatter : { filter_formatter : {
// Total column (jQuery selector added v2.17.0) // Total column (jQuery selector added v2.17.0)
'.total' : function($cell, indx){ '.total' : function($cell, indx) {
return $.tablesorter.filterFormatter.uiRange( $cell, indx, { return $.tablesorter.filterFormatter.uiRange( $cell, indx, {
delayed: true, // delay search (set by filter_searchDelay) delayed: true, // delay search (set by filter_searchDelay)
valueToHeader: false, // add current slider value to the header cell valueToHeader: false, // add current slider value to the header cell
@ -378,7 +378,7 @@
filter_formatter : { filter_formatter : {
// Discount column // Discount column
3 : function($cell, indx){ 3 : function($cell, indx) {
return $.tablesorter.filterFormatter.uiSpinner( $cell, indx, { return $.tablesorter.filterFormatter.uiSpinner( $cell, indx, {
delayed: true, // delay search (set by filter_searchDelay) delayed: true, // delay search (set by filter_searchDelay)
addToggle: false, // add a toggle switch to activate/deactive the search addToggle: false, // add a toggle switch to activate/deactive the search
@ -433,7 +433,7 @@
filter_formatter : { filter_formatter : {
// Date (one input) // Date (one input)
4 : function($cell, indx){ 4 : function($cell, indx) {
return $.tablesorter.filterFormatter.uiDateCompare( $cell, indx, { return $.tablesorter.filterFormatter.uiDateCompare( $cell, indx, {
cellText : 'Dates', // text added before the input cellText : 'Dates', // text added before the input
compare : [ '', '=', '&gt;=', '&lt;=' ], // search values greater/less than selected value; overrides exactMatch compare : [ '', '=', '&gt;=', '&lt;=' ], // search values greater/less than selected value; overrides exactMatch
@ -496,7 +496,7 @@
filter_formatter : { filter_formatter : {
// Date (two inputs) // Date (two inputs)
5 : function($cell, indx){ 5 : function($cell, indx) {
return $.tablesorter.filterFormatter.uiDatepicker( $cell, indx, { return $.tablesorter.filterFormatter.uiDatepicker( $cell, indx, {
// add any of the jQuery UI Datepicker options here (http://api.jqueryui.com/datepicker/) // add any of the jQuery UI Datepicker options here (http://api.jqueryui.com/datepicker/)
// from : '8/1/2013', // starting date // from : '8/1/2013', // starting date
@ -543,10 +543,10 @@
</li> </li>
<li>Some method should be added to show the user the current value of the selector - update a data attribute for css3 tooltips, or update the header cell.</li> <li>Some method should be added to show the user the current value of the selector - update a data attribute for css3 tooltips, or update the header cell.</li>
<li>A reset function needs to also be included; bind to the <code>filterReset</code> event and clear out or disable your custom selector when triggered. <li>A reset function needs to also be included; bind to the <code>filterReset</code> event and clear out or disable your custom selector when triggered.
<pre class="prettyprint lang-javascript">$cell.closest('table').bind('filterReset', function(){ /* update the input here */ });</pre> <pre class="prettyprint lang-javascript">$cell.closest('table').bind('filterReset', function() { /* update the input here */ });</pre>
</li> </li>
<li>In <span class="version">v2.15.0</span>, in order to update your custom input with any saved filter searches, you will need to bind to the <code>filterFomatterUpdate</code> event to get the saved filter value from the hidden input and apply it to your custom input. <li>In <span class="version">v2.15.0</span>, in order to update your custom input with any saved filter searches, you will need to bind to the <code>filterFomatterUpdate</code> event to get the saved filter value from the hidden input and apply it to your custom input.
<pre class="prettyprint lang-javascript">$cell.closest('table').bind('filterFomatterUpdate', function(){ <pre class="prettyprint lang-javascript">$cell.closest('table').bind('filterFomatterUpdate', function() {
var savedSearch = $cell.find('input[type=hidden]').val(); var savedSearch = $cell.find('input[type=hidden]').val();
// apply this saved search to your custom input // apply this saved search to your custom input
$.tablesorter.filter.formatterUpdated($cell, indx); // new v2.17.5 $.tablesorter.filter.formatterUpdated($cell, indx); // new v2.17.5

View File

@ -42,7 +42,7 @@
filter_formatter : { filter_formatter : {
// Rank // Rank
0 : function($cell, indx){ 0 : function($cell, indx) {
return $.tablesorter.filterFormatter.html5Range( $cell, indx, { return $.tablesorter.filterFormatter.html5Range( $cell, indx, {
value: 0, value: 0,
min: 0, min: 0,
@ -55,7 +55,7 @@
}, },
// Color // Color
1 : function($cell, indx){ 1 : function($cell, indx) {
return $.tablesorter.filterFormatter.html5Color( $cell, indx, { return $.tablesorter.filterFormatter.html5Color( $cell, indx, {
value: '#000000', value: '#000000',
addToggle: true, addToggle: true,
@ -65,7 +65,7 @@
}, },
// Age // Age
3: function($cell, indx){ 3: function($cell, indx) {
return $.tablesorter.filterFormatter.html5Number( $cell, indx, { return $.tablesorter.filterFormatter.html5Number( $cell, indx, {
value: 1, value: 1,
min: 1, min: 1,
@ -78,7 +78,7 @@
}, },
// Total // Total
4 : function($cell, indx){ 4 : function($cell, indx) {
return $.tablesorter.filterFormatter.html5Range( $cell, indx, { return $.tablesorter.filterFormatter.html5Range( $cell, indx, {
value: 0, value: 0,
min: 0, min: 0,
@ -90,7 +90,7 @@
}, },
// Discount // Discount
5: function($cell, indx){ 5: function($cell, indx) {
return $.tablesorter.filterFormatter.html5Number( $cell, indx, { return $.tablesorter.filterFormatter.html5Number( $cell, indx, {
value: 1, value: 1,
min: 1, min: 1,
@ -155,7 +155,7 @@
filter_formatter : { filter_formatter : {
// Rank // Rank
0 : function($cell, indx){ 0 : function($cell, indx) {
return $.tablesorter.filterFormatter.html5Range( $cell, indx, { return $.tablesorter.filterFormatter.html5Range( $cell, indx, {
value: 0, value: 0,
min: 0, min: 0,
@ -168,7 +168,7 @@
}, },
// Total // Total
4 : function($cell, indx){ 4 : function($cell, indx) {
return $.tablesorter.filterFormatter.html5Range( $cell, indx, { return $.tablesorter.filterFormatter.html5Range( $cell, indx, {
value: 0, value: 0,
min: 0, min: 0,
@ -212,7 +212,7 @@
filter_formatter : { filter_formatter : {
// Color // Color
1 : function($cell, indx){ 1 : function($cell, indx) {
return $.tablesorter.filterFormatter.html5Color( $cell, indx, { return $.tablesorter.filterFormatter.html5Color( $cell, indx, {
value: '#000000', value: '#000000',
addToggle: true, addToggle: true,
@ -254,7 +254,7 @@
filter_formatter : { filter_formatter : {
// Age // Age
3: function($cell, indx){ 3: function($cell, indx) {
return $.tablesorter.filterFormatter.html5Number( $cell, indx, { return $.tablesorter.filterFormatter.html5Number( $cell, indx, {
value: 1, value: 1,
min: 1, min: 1,
@ -267,7 +267,7 @@
}, },
// Discount // Discount
5: function($cell, indx){ 5: function($cell, indx) {
return $.tablesorter.filterFormatter.html5Number( $cell, indx, { return $.tablesorter.filterFormatter.html5Number( $cell, indx, {
value: 1, value: 1,
min: 1, min: 1,

View File

@ -25,7 +25,7 @@
<script src="js/select2-3.4.6.min.js"></script> <script src="js/select2-3.4.6.min.js"></script>
<script src="../js/widgets/widget-filter-formatter-select2.js"></script> <script src="../js/widgets/widget-filter-formatter-select2.js"></script>
<script id="js">$(function(){ <script id="js">$(function() {
$('.tablesorter').tablesorter({ $('.tablesorter').tablesorter({
theme: 'blue', theme: 'blue',
@ -40,7 +40,7 @@
filter_formatter : { filter_formatter : {
// Alphanumeric (match) // Alphanumeric (match)
0 : function($cell, indx){ 0 : function($cell, indx) {
return $.tablesorter.filterFormatter.select2( $cell, indx, { return $.tablesorter.filterFormatter.select2( $cell, indx, {
match : true, // adds "filter-match" to header match : true, // adds "filter-match" to header
cellText : 'Match: ', // Cell text cellText : 'Match: ', // Cell text
@ -50,7 +50,7 @@
}, },
// Alphanumeric (exact) // Alphanumeric (exact)
1 : function($cell, indx){ 1 : function($cell, indx) {
return $.tablesorter.filterFormatter.select2( $cell, indx, { return $.tablesorter.filterFormatter.select2( $cell, indx, {
match : false // exact match only match : false // exact match only
}); });
@ -153,7 +153,7 @@
This is an example of how to set these options: This is an example of how to set these options:
<pre class="prettyprint lang-js">filter_formatter : { <pre class="prettyprint lang-js">filter_formatter : {
// default settings on first column // default settings on first column
0 : function($cell, indx){ 0 : function($cell, indx) {
return $.tablesorter.filterFormatter.select2( $cell, indx, { return $.tablesorter.filterFormatter.select2( $cell, indx, {
// *** select2 filter formatter options *** // *** select2 filter formatter options ***
cellText : '', // Text (wrapped in a label element) cellText : '', // Text (wrapped in a label element)

View File

@ -55,7 +55,7 @@
$table $table
.find( '.' + selectmenuClass ) .find( '.' + selectmenuClass )
.iconselectmenu({ .iconselectmenu({
change: function(){ change: function() {
// start a new search // start a new search
$table.trigger( 'search' ); $table.trigger( 'search' );
} }

View File

@ -163,12 +163,12 @@
}); });
// Clear stored filters - added v2.25.6 // Clear stored filters - added v2.25.6
$('.resetsaved').click(function(){ $('.resetsaved').click(function() {
$('#table').trigger('filterResetSaved'); $('#table').trigger('filterResetSaved');
// show quick popup to indicate something happened // show quick popup to indicate something happened
var $message = $('<span class="results"> Reset</span>').insertAfter(this); var $message = $('<span class="results"> Reset</span>').insertAfter(this);
setTimeout(function(){ setTimeout(function() {
$message.remove(); $message.remove();
}, 500); }, 500);
return false; return false;
@ -177,7 +177,7 @@
// External search // External search
// buttons set up like this: // buttons set up like this:
// <button type="button" data-filter-column="4" data-filter-text="2?%">Saved Search</button> // <button type="button" data-filter-column="4" data-filter-text="2?%">Saved Search</button>
$('button[data-filter-column]').click(function(){ $('button[data-filter-column]').click(function() {
/*** first method *** data-filter-column="1" data-filter-text="!son" /*** first method *** data-filter-column="1" data-filter-text="!son"
add search value to Discount column (zero based index) input */ add search value to Discount column (zero based index) input */
var filters = [], var filters = [],
@ -211,10 +211,10 @@
});</script> });</script>
<script> <script>
$(function(){ $(function() {
// *** widgetfilter_startsWith toggle button *** // *** widgetfilter_startsWith toggle button ***
$('button.toggle').click(function(){ $('button.toggle').click(function() {
var c = $('#table')[0].config, var c = $('#table')[0].config,
$t = $(this), $t = $(this),
// toggle the boolean // toggle the boolean

View File

@ -9,12 +9,12 @@
<script> <script>
// tweak "Added" column to keep recent dates // tweak "Added" column to keep recent dates
$(function(){ $(function() {
var d, t, var d, t,
tweaks = [ 9e5, 8e8, 2e7, 0, 6e10, 1e11 ], tweaks = [ 9e5, 8e8, 2e7, 0, 6e10, 1e11 ],
$t = $('#demo tbody'), $t = $('#demo tbody'),
date = new Date().getTime(); date = new Date().getTime();
$t.find('tr td:nth-child(4)').each(function(i){ $t.find('tr td:nth-child(4)').each(function(i) {
d = new Date( date - tweaks[i] ); d = new Date( date - tweaks[i] );
t = (d.getMonth() + 1) + '/' + d.getDate() + '/' + d.getFullYear() + ' ' + t = (d.getMonth() + 1) + '/' + d.getDate() + '/' + d.getFullYear() + ' ' +
d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds(); d.getHours() + ':' + d.getMinutes() + ':' + d.getSeconds();
@ -88,7 +88,7 @@
* Copyright (c) 2011 John Resig (ejohn.org) * Copyright (c) 2011 John Resig (ejohn.org)
* Licensed under the MIT and GPL licenses. * Licensed under the MIT and GPL licenses.
*/ */
function prettyDate(date){ function prettyDate(date) {
var diff = (((new Date()).getTime() - date.getTime()) / 1000), var diff = (((new Date()).getTime() - date.getTime()) / 1000),
day_diff = Math.floor(diff / 86400); day_diff = Math.floor(diff / 86400);
if ( isNaN(day_diff) || day_diff < 0 ) { return ''; } if ( isNaN(day_diff) || day_diff < 0 ) { return ''; }

View File

@ -81,7 +81,7 @@ tr.group-header.collapsed td i {
<!-- grouping widget --> <!-- grouping widget -->
<script src="../js/widgets/widget-grouping.js"></script> <script src="../js/widgets/widget-grouping.js"></script>
<script id="js">$(function(){ <script id="js">$(function() {
$("table").tablesorter({ $("table").tablesorter({
theme : 'blue', theme : 'blue',
@ -97,7 +97,7 @@ tr.group-header.collapsed td i {
$('.tablesorter-childRow td').hide(); $('.tablesorter-childRow td').hide();
$('.tablesorter').on('click', '.toggle', function(){ $('.tablesorter').on('click', '.toggle', function() {
$(this).closest('tr').nextUntil('tr:not(.tablesorter-childRow)').find('td').toggle(); $(this).closest('tr').nextUntil('tr:not(.tablesorter-childRow)').find('td').toggle();
return false; return false;
}); });

Some files were not shown because too many files have changed in this diff Show More