Merge branch 'master' into gh-pages

This commit is contained in:
Rob Garrison 2016-09-23 11:48:58 -05:00
commit 225fafc5d8
34 changed files with 241 additions and 169 deletions

12
.gitattributes vendored
View File

@ -10,14 +10,14 @@
*.dbproj merge=union
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.md diss=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.md diss=astextplain

View File

@ -101,6 +101,24 @@ If you would like to contribute, please...
View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/Changes).
#### <a name="v2.27.7">Version 2.27.7</a> (9/23/2016)
* Core:
* Include version in log.
* Remove space from debug message.
* Docs: update jQuery.
* Filter:
* Include "input" event for searches. See [issue #1280](https://github.com/Mottie/tablesorter/issues/1280).
* Add support for descending sort on selectSources values.
* Mark: Remove internal case matching.
* Pager:
* Allow for optional output callback in favour of parsable string. See [pull #1283](https://github.com/Mottie/tablesorter/pull/1283); thanks [@joelperry93](https://github.com/joelperry93)!
* Add output function support to pager widget. See [pull #1283](https://github.com/Mottie/tablesorter/pull/1283).
* Maintain `pageDisplay` ID, if one exists. Fixes [issue #1288](https://github.com/Mottie/tablesorter/issues/1288).
* RepeatHeaders:
* Repeat HTML content instead of only text. See [pull #1282](https://github.com/Mottie/tablesorter/pull/1282); thanks [@Milania1](https://github.com/Milania1)!
* Testing: update jQuery usage.
#### <a name="v2.27.6">Version 2.27.6</a> (9/1/2016)
* Core: `textSorter` option now accepts class names. See [Stackoverflow](http://stackoverflow.com/q/39259954/145346).
@ -128,8 +146,3 @@ View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/C
* Docs: Correct usage of Sugar v2.0+ `sortCollage`.
* Filter: Add any match search by column text - see [updated demo](https://mottie.github.io/tablesorter/docs/example-widget-filter-any-match.html#anymatch_searches).
* Parser: Fix JSHint issue.
#### <a name="v2.27.4">Version 2.27.4</a> (8/18/2016)
* Docs & parser: Update Sugar library v2.0+. Fixes [issue #1275](https://github.com/Mottie/tablesorter/issues/1275).
* Docs: Add `sortStable` example.

View File

@ -1,6 +1,6 @@
/*!
* tablesorter (FORK) pager plugin
* updated 8/17/2016 (v2.27.3)
* updated 9/23/2016 (v2.27.7)
*/
/*jshint browser:true, jquery:true, unused:false */
;(function($) {
@ -182,27 +182,33 @@
p.startRow = (t) ? sz * p.page + 1 : (p.filteredRows === 0 ? 0 : sz * p.page + 1);
p.endRow = Math.min( p.filteredRows, p.totalRows, sz * ( p.page + 1 ) );
$out = p.$container.find(p.cssPageDisplay);
// form the output string (can now get a new output string from the server)
s = ( p.ajaxData && p.ajaxData.output ? p.ajaxData.output || p.output : p.output )
// {page} = one-based index; {page+#} = zero based index +/- value
.replace(/\{page([\-+]\d+)?\}/gi, function(m, n){
return p.totalPages ? p.page + (n ? parseInt(n, 10) : 1) : 0;
})
// {totalPages}, {extra}, {extra:0} (array) or {extra : key} (object)
.replace(/\{\w+(\s*:\s*\w+)?\}/gi, function(m){
var len, indx,
str = m.replace(/[{}\s]/g, ''),
extra = str.split(':'),
data = p.ajaxData,
// return zero for default page/row numbers
deflt = /(rows?|pages?)$/i.test(str) ? 0 : '';
if (/(startRow|page)/.test(extra[0]) && extra[1] === 'input') {
len = ('' + (extra[0] === 'page' ? p.totalPages : p.totalRows)).length;
indx = extra[0] === 'page' ? p.page + 1 : p.startRow;
return '<input type="text" class="ts-' + extra[0] + '" style="max-width:' + len + 'em" value="' + indx + '"/>';
}
return extra.length > 1 && data && data[extra[0]] ? data[extra[0]][extra[1]] : p[str] || (data ? data[str] : deflt) || deflt;
});
// Output param can be callback for custom rendering or string
if (typeof p.output === 'function') {
s = p.output(table, p);
} else {
// form the output string (can now get a new output string from the server)
s = ( p.ajaxData && p.ajaxData.output ? p.ajaxData.output || p.output : p.output )
// {page} = one-based index; {page+#} = zero based index +/- value
.replace(/\{page([\-+]\d+)?\}/gi, function(m, n){
return p.totalPages ? p.page + (n ? parseInt(n, 10) : 1) : 0;
})
// {totalPages}, {extra}, {extra:0} (array) or {extra : key} (object)
.replace(/\{\w+(\s*:\s*\w+)?\}/gi, function(m){
var len, indx,
str = m.replace(/[{}\s]/g, ''),
extra = str.split(':'),
data = p.ajaxData,
// return zero for default page/row numbers
deflt = /(rows?|pages?)$/i.test(str) ? 0 : '';
if (/(startRow|page)/.test(extra[0]) && extra[1] === 'input') {
len = ('' + (extra[0] === 'page' ? p.totalPages : p.totalRows)).length;
indx = extra[0] === 'page' ? p.page + 1 : p.startRow;
return '<input type="text" class="ts-' + extra[0] + '" style="max-width:' + len + 'em" value="' + indx + '"/>';
}
return extra.length > 1 && data && data[extra[0]] ? data[extra[0]][extra[1]] : p[str] || (data ? data[str] : deflt) || deflt;
});
}
if ( p.$goto.length ) {
t = '';
options = buildPageSelect( table, p );
@ -865,7 +871,7 @@
},
enablePager = function(table, p, triggered) {
var info, size,
var info, size, $el,
c = table.config;
p.$size.add(p.$goto).add(p.$container.find('.ts-startRow, .ts-page'))
.removeClass(p.cssDisabled)
@ -878,10 +884,15 @@
p.$size.val( p.size ); // set page size
p.totalPages = p.size === 'all' ? 1 : Math.ceil( getTotalPages( table, p ) / p.size );
// if table id exists, include page display with aria info
if ( table.id ) {
info = table.id + '_pager_info';
p.$container.find(p.cssPageDisplay).attr('id', info);
c.$table.attr('aria-describedby', info);
if ( table.id && !c.$table.attr( 'aria-describedby' ) ) {
$el = p.$container.find( p.cssPageDisplay );
info = $el.attr( 'id' );
if ( !info ) {
// only add pageDisplay id if it doesn't exist - see #1288
info = table.id + '_pager_info';
$el.attr( 'id', info );
}
c.$table.attr( 'aria-describedby', info );
}
changeHeight(table, p);
if ( triggered ) {

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 09-01-2016 (v2.27.6)*/
/*! tablesorter (FORK) - updated 09-23-2016 (v2.27.7)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -10,7 +10,7 @@
}
}(function(jQuery) {
/*! TableSorter (FORK) v2.27.6 *//*
/*! TableSorter (FORK) v2.27.7 *//*
* Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
@ -34,7 +34,7 @@
'use strict';
var ts = $.tablesorter = {
version : '2.27.6',
version : '2.27.7',
parsers : [],
widgets : [],
@ -245,7 +245,7 @@
// save the settings where they read
$.data( table, 'tablesorter', c );
if ( c.debug ) {
console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter' );
console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter v' + ts.version );
$.data( table, 'startoveralltimer', new Date() );
}
@ -347,7 +347,7 @@
table.hasInitialized = true;
table.isProcessing = false;
if ( c.debug ) {
console.log( 'Overall initialization time: ' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
console.log( 'Overall initialization time:' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
if ( c.debug && console.groupEnd ) { console.groupEnd(); }
}
$table.triggerHandler( 'tablesorter-initialized', table );
@ -3131,7 +3131,7 @@
})(jQuery);
/*! Widget: filter - updated 8/22/2016 (v2.27.5) *//*
/*! Widget: filter - updated 9/23/2016 (v2.27.7) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison
*/
@ -3964,9 +3964,9 @@
// don't allow 'change' event to process if the input value is the same - fixes #685
if ( table.config.widgetOptions.filter_initialized &&
( event.which === tskeyCodes.enter || event.type === 'search' ||
( event.type === 'change' ) && this.value !== c.lastSearch[column] ) ||
// only "input" event fires in MS Edge when clicking the "x" to clear the search
( event.type === 'input' && this.value === '' ) ) {
( event.type === 'change' || event.type === 'input' ) &&
this.value !== c.lastSearch[column] )
) {
event.preventDefault();
// init search with no delay
$( this ).attr( 'data-lastSearchTime', new Date().getTime() );
@ -4681,6 +4681,7 @@
var cts, txt, indx, len, parsedTxt, str,
c = table.config,
validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns,
direction = validColumn ? c.$headerIndexed[ column ].hasClass( 'filter-select-sort-desc' ) : false,
parsed = [];
// get unique elements and sort the list
// if $.tablesorter.sortText exists ( not in the original tablesorter ),
@ -4721,8 +4722,8 @@
// sort parsed select options
cts = c.textSorter || '';
parsed.sort( function( a, b ) {
var x = a.parsed,
y = b.parsed;
var x = direction ? b.parsed : a.parsed,
y = direction ? a.parsed : b.parsed;
if ( validColumn && typeof cts === 'function' ) {
// custom OVERALL text sorter
return cts( x, y, true, column, table );

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@
}
}(function(jQuery) {
/*! TableSorter (FORK) v2.27.6 *//*
/*! TableSorter (FORK) v2.27.7 *//*
* Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
@ -32,7 +32,7 @@
'use strict';
var ts = $.tablesorter = {
version : '2.27.6',
version : '2.27.7',
parsers : [],
widgets : [],
@ -243,7 +243,7 @@
// save the settings where they read
$.data( table, 'tablesorter', c );
if ( c.debug ) {
console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter' );
console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter v' + ts.version );
$.data( table, 'startoveralltimer', new Date() );
}
@ -345,7 +345,7 @@
table.hasInitialized = true;
table.isProcessing = false;
if ( c.debug ) {
console.log( 'Overall initialization time: ' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
console.log( 'Overall initialization time:' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
if ( c.debug && console.groupEnd ) { console.groupEnd(); }
}
$table.triggerHandler( 'tablesorter-initialized', table );

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 09-01-2016 (v2.27.6)*/
/*! tablesorter (FORK) - updated 09-23-2016 (v2.27.7)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -376,7 +376,7 @@
})(jQuery);
/*! Widget: filter - updated 8/22/2016 (v2.27.5) *//*
/*! Widget: filter - updated 9/23/2016 (v2.27.7) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison
*/
@ -1209,9 +1209,9 @@
// don't allow 'change' event to process if the input value is the same - fixes #685
if ( table.config.widgetOptions.filter_initialized &&
( event.which === tskeyCodes.enter || event.type === 'search' ||
( event.type === 'change' ) && this.value !== c.lastSearch[column] ) ||
// only "input" event fires in MS Edge when clicking the "x" to clear the search
( event.type === 'input' && this.value === '' ) ) {
( event.type === 'change' || event.type === 'input' ) &&
this.value !== c.lastSearch[column] )
) {
event.preventDefault();
// init search with no delay
$( this ).attr( 'data-lastSearchTime', new Date().getTime() );
@ -1926,6 +1926,7 @@
var cts, txt, indx, len, parsedTxt, str,
c = table.config,
validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns,
direction = validColumn ? c.$headerIndexed[ column ].hasClass( 'filter-select-sort-desc' ) : false,
parsed = [];
// get unique elements and sort the list
// if $.tablesorter.sortText exists ( not in the original tablesorter ),
@ -1966,8 +1967,8 @@
// sort parsed select options
cts = c.textSorter || '';
parsed.sort( function( a, b ) {
var x = a.parsed,
y = b.parsed;
var x = direction ? b.parsed : a.parsed,
y = direction ? a.parsed : b.parsed;
if ( validColumn && typeof cts === 'function' ) {
// custom OVERALL text sorter
return cts( x, y, true, column, table );

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: mark.js - updated 9/1/2016 (v2.27.6) */
!function(a){"use strict";var b=a.tablesorter;b.mark={init:function(c){if("function"==typeof a.fn.mark){var d,e=c.widgetOptions.mark_tsUpdate;c.$table.on("filterEnd.tsmark pagerComplete.tsmark"+(e?" "+e:""),function(a,d){b.mark.update(c,a.type===e?d:"")}),d="(?:<|=|>|\\||\"|\\'|\\s+(?:&&|-|"+(b.language.and||"and")+"|"+(b.language.or||"or")+"|"+(b.language.to||"to")+")\\s+)",b.mark.regex.filter=new RegExp(d,"gim")}else console.warn('Widget-mark not initialized: missing "jquery.mark.js"')},regex:{mark:/^mark_(.+)$/,pure:/^\/((?:\\\/|[^\/])+)\/([mig]{0,3})?$/},checkRegex:function(a){if(a instanceof RegExp){var b="".match(a);return null===b||b.length<5}return!1},cleanMatches:function(a){for(var b=[],c=a&&a.length||0;c--;)""!==a[c]&&(b[b.length]=a[c]);return b},ignoreColumns:function(b){for(var c=b.widgetOptions,d=b.columns,e=[];d--;)(c.mark_tsIgnore[d]||a(b.$headerIndexed[d]).hasClass("mark-ignore"))&&(e[e.length]=":nth-child("+(d+1)+")");return e.length?":not("+e.join(",")+")":""},update:function(c,d){var e={},f=c.widgetOptions,g="undefined"==typeof f.filter_ignoreCase||f.filter_ignoreCase,h=b.mark.regex,i=c.$table.find("tbody tr").unmark().not("."+(c.widgetOptions.filter_filteredRow||"filtered"));d=d||a.tablesorter.getFilters(c.$table),a.each(c.widgetOptions,function(a,b){var c=a.match(h.mark);c&&"undefined"!=typeof c[1]&&(e[c[1]]=b)}),a.each(d,function(d,j){if(j&&!a(c.$headerIndexed[d]).hasClass("mark-ignore")&&!f.mark_tsIgnore[d]){var k=null,l=j,m=!1,n=d===c.columns?b.mark.ignoreColumns(c):":nth-child("+(d+1)+")";if(h.pure.test(j)){l=h.pure.exec(j),".*"===l[1]&&(l[1]="");try{k=new RegExp(l[1],"gim"),l=new RegExp(l[1],l[2])}catch(a){l=null}return void(b.mark.checkRegex(k)&&i.children(n).markRegExp(l,e))}0===j.indexOf("~")?(m=!0,l=j.replace(/~/g,"").split("")):(j.indexOf("?")>-1&&(m=!0,j=j.replace(/\?/g,"\\S{1}")),j.indexOf("*")>-1&&(m=!0,j=j.replace(/\*/g,"\\S*")),l=j.split(h.filter)),m&&l&&l.length?(l=new RegExp(b.mark.cleanMatches(l).join(".*"),"gm"+(g?"i":"")),b.mark.checkRegex(l)&&i.children(n).markRegExp(l,e)):i.children(n).mark(b.mark.cleanMatches(l),e)}})}},b.addWidget({id:"mark",options:{mark_tsUpdate:"markUpdate",mark_tsIgnore:{}},init:function(a,c,d,e){b.mark.init(d,e)},remove:function(a,b){var c=b.widgetOptions.mark_tsUpdate;b.$table.off("filterEnd.tsmark pagerComplete.tsmark"+(c?" "+c:""))}})}(jQuery);
/*! Widget: mark.js - updated 9/23/2016 (v2.27.7) */
!function(a){"use strict";var b=a.tablesorter;b.mark={init:function(c){if("function"==typeof a.fn.mark){var d,e=c.widgetOptions.mark_tsUpdate;c.$table.on("filterEnd.tsmark pagerComplete.tsmark"+(e?" "+e:""),function(a,d){b.mark.update(c,a.type===e?d:"")}),d="(?:<|=|>|\\||\"|\\'|\\s+(?:&&|-|"+(b.language.and||"and")+"|"+(b.language.or||"or")+"|"+(b.language.to||"to")+")\\s+)",b.mark.regex.filter=new RegExp(d,"gim")}else console.warn('Widget-mark not initialized: missing "jquery.mark.js"')},regex:{mark:/^mark_(.+)$/,pure:/^\/((?:\\\/|[^\/])+)\/([mig]{0,3})?$/},checkRegex:function(a){if(a instanceof RegExp){var b="".match(a);return null===b||b.length<5}return!1},cleanMatches:function(a){for(var b=[],c=a&&a.length||0;c--;)""!==a[c]&&(b[b.length]=a[c]);return b},ignoreColumns:function(b){for(var c=b.widgetOptions,d=b.columns,e=[];d--;)(c.mark_tsIgnore[d]||a(b.$headerIndexed[d]).hasClass("mark-ignore"))&&(e[e.length]=":nth-child("+(d+1)+")");return e.length?":not("+e.join(",")+")":""},update:function(c,d){var e={},f=c.widgetOptions,g=b.mark.regex,h=c.$table.find("tbody tr").unmark().not("."+(c.widgetOptions.filter_filteredRow||"filtered"));d=d||a.tablesorter.getFilters(c.$table),a.each(c.widgetOptions,function(a,b){var c=a.match(g.mark);c&&"undefined"!=typeof c[1]&&(e[c[1]]=b)}),a.each(d,function(d,i){if(i&&!a(c.$headerIndexed[d]).hasClass("mark-ignore")&&!f.mark_tsIgnore[d]){var j=null,k=i,l=!1,m=d===c.columns?b.mark.ignoreColumns(c):":nth-child("+(d+1)+")";if(g.pure.test(i)){k=g.pure.exec(i),".*"===k[1]&&(k[1]="");try{j=new RegExp(k[1],"gim"),k=new RegExp(k[1],k[2])}catch(a){k=null}return void(b.mark.checkRegex(j)&&h.children(m).markRegExp(k,e))}0===i.indexOf("~")?(l=!0,k=i.replace(/~/g,"").split("")):(i.indexOf("?")>-1&&(l=!0,i=i.replace(/\?/g,"\\S{1}")),i.indexOf("*")>-1&&(l=!0,i=i.replace(/\*/g,"\\S*")),k=i.split(g.filter)),l&&k&&k.length?(k=new RegExp(b.mark.cleanMatches(k).join(".*"),"gm"),b.mark.checkRegex(k)&&h.children(m).markRegExp(k,e)):h.children(m).mark(b.mark.cleanMatches(k),e)}})}},b.addWidget({id:"mark",options:{mark_tsUpdate:"markUpdate",mark_tsIgnore:{}},init:function(a,c,d,e){b.mark.init(d,e)},remove:function(a,b){var c=b.widgetOptions.mark_tsUpdate;b.$table.off("filterEnd.tsmark pagerComplete.tsmark"+(c?" "+c:""))}})}(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
/*! Widget: repeatHeaders - updated 2/7/2015 (v2.19.0) */
!function(a){"use strict";a.tablesorter.addWidget({id:"repeatHeaders",priority:10,options:{rowsToSkip:4},format:function(b,c,d){var e,f,g,h,i="";if(!d.repeatHeaders){for(i='<tr class="repeated-header '+c.selectorRemove.slice(1)+'">',e=0;e<c.columns;e++)i+="<th>"+a.trim(c.$headers.eq(e).text())+"</th>";d.repeatHeaders=i+"</tr>"}for(h=d&&d.rowsToSkip||4,c.$table.find("tr.repeated-header").remove(),f=c.$tbodies.find("tr"),g=f.length,e=h;e<g;e+=h)f.eq(e).before(d.repeatHeaders)},remove:function(a,b,c){c.repeatHeaders="",b.$table.find("tr.repeated-header").remove()}})}(jQuery);
/*! Widget: repeatHeaders - updated 9/23/2016 (v2.27.7) */
!function(a){"use strict";a.tablesorter.addWidget({id:"repeatHeaders",priority:10,options:{rowsToSkip:4},format:function(b,c,d){var e,f,g,h,i="";if(!d.repeatHeaders){for(i='<tr class="repeated-header '+c.selectorRemove.slice(1)+'">',e=0;e<c.columns;e++)i+="<th>"+a.trim(c.$headers.eq(e).html())+"</th>";d.repeatHeaders=i+"</tr>"}for(h=d&&d.rowsToSkip||4,c.$table.find("tr.repeated-header").remove(),f=c.$tbodies.find("tr"),g=f.length,e=h;e<g;e+=h)f.eq(e).before(d.repeatHeaders)},remove:function(a,b,c){c.repeatHeaders="",b.$table.find("tr.repeated-header").remove()}})}(jQuery);

View File

@ -56,6 +56,8 @@
// output string - default is '{page}/{totalPages}'
// possible variables: {size}, {page}, {totalPages}, {filteredPages}, {startRow}, {endRow}, {filteredRows} and {totalRows}
// also {page:input} & {startRow:input} will add a modifiable input in place of the value
// In v2.27.7, this can be set as a function
// output: function(table, pager) { return 'page ' + pager.startRow + ' - ' + pager.endRow; }
output: '{startRow:input} to {endRow} ({totalRows})',
// apply disabled classname (cssDisabled option) to the pager arrows when the rows

View File

@ -639,6 +639,7 @@ $(function(){
<li><code>filter-false</code> - disable the filter for a specific header column.</li>
<li><code>filter-select</code> - build a default select box for a column (shows unique column content). See the <a href="example-widget-filter-custom.html">custom filter widget</a> demo for an example.</li>
<li><code>filter-select-nosort</code> - when a default select box is built, this option prevents the sorting of select options leaving them in their original table order (<span class="version">v2.16.3</span>).</li>
<li><code>filter-select-sort-desc</code> - when a default select box is built, it is automatically set to an ascending sort. Adding this class name will perform a descending sort on the values (<span class="version">v2.27.7</span>).</li>
<li><code>filter-match</code> - applies to &quot;filter-select&quot; columns and columns where the user can use the logical "or" search. Makes the filter/select match the column contents instead of exactly matching.</li>
<li><code>filter-parsed</code> - set a column to filter through parsed data instead of the actual table cell content.</li>
<li><code>filter-onlyAvail</code>

View File

@ -11,9 +11,11 @@
<link class="ui-theme" rel="stylesheet" href="css/jquery-ui.min.css">
<script src="js/jquery-ui.min.js"></script>
<link rel="stylesheet" href="css/jq.css">
<link href="css/tipsy.css" rel="stylesheet">
<link href="css/prettify.css" rel="stylesheet">
<script src="js/prettify.js"></script>
<script src="js/docs.js"></script>
<script src="js/jquery.tipsy.min.js"></script>
<!-- Tablesorter: required -->
<link rel="stylesheet" href="../css/theme.blue.css">
@ -32,7 +34,7 @@ th.tablesorter-header.ignore, .ignore { background-color: #e6bf99; }
<script src="../js/jquery.tablesorter.js"></script>
<script src="../js/widgets/widget-filter.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.0.0/jquery.mark.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.1.1/jquery.mark.js"></script>
<script src="../js/widgets/widget-mark.js"></script>
<script id="js">$(function() {
@ -58,6 +60,7 @@ th.tablesorter-header.ignore, .ignore { background-color: #e6bf99; }
},
// *** default settings for non-regular expression searches only
mark_accuracy: 'partially',
mark_caseSensitive: false,
mark_diacritics: true,
mark_separateWordSearch: true,
mark_synonyms: {},
@ -83,10 +86,12 @@ th.tablesorter-header.ignore, .ignore { background-color: #e6bf99; }
// preset searches for the first table
$('button[data-filter-column]').click(function(){
var filters = [],
config = $table[0].config,
$t = $(this),
col = $t.data('filter-column'), // zero-based index, or "all" column
txt = $t.data('filter-text') || $t.text(); // text to add to filter
filters[col === "all" ? $table[0].config.columns : col] = txt;
filters[col === "all" ? config.columns : col] = txt;
config.widgetOptions.mark_caseSensitive = $t.data('mark-case') || false;
$.tablesorter.setFilters( $table, filters );
return false;
});
@ -113,22 +118,31 @@ th.tablesorter-header.ignore, .ignore { background-color: #e6bf99; }
$('button.table2').click(function(){
// check for reset
var query = $(this).hasClass('reset2') ? '' : this.textContent;
config = $table2[0].config;
config.widgetOptions.mark_caseSensitive = $(this).data('mark-case') || false;
$('#table2-search')
.val(query)
.trigger('input');
});
$('#table2-search').on('input', function() {
$('#table2-search').on('input', function(event) {
var config = $table2[0].config,
filters = [];
// still target the "any" match column
filters[config.columns] = this.value;
// if input was not triggered by a button click, reset caseSensitive
if (!event.isTrigger) {
config.widgetOptions.mark_caseSensitive = false;
}
// trigger a mark update
$table2.trigger('markUpdate', [filters]);
// or call the function directly
// $.tablesorter.mark.update(config, filters);
});
// add tooltip
$('.tooltip').tipsy({ gravity: 's' });
});</script>
</head>
@ -148,6 +162,7 @@ th.tablesorter-header.ignore, .ignore { background-color: #e6bf99; }
<h3 id="notes"><a href="#">Notes</a></h3>
<div>
<ul>
<li>Updated <span class="verison">v2.27.7</span>, removed internal case matching as mark.js v8.1.1 now has a <code>caseSensitive</code> option (set using <code>mark_caseSensitive</code> widget option).</li>
<li>Updated <span class="verison">v2.27.6</span>
<ul>
<li>The mark widget properly applies after a pager change has occured.</li>
@ -285,6 +300,11 @@ $('button.update').click(function(){
<td>"partially"</td>
<td>Use "partially", "complementary", "exactly" or object - see markjs docs for details.</td>
</tr>
<tr id="mark-casesensitive">
<td><span class="permalink">mark_caseSensitive</span></td>
<td>false</td>
<td>If <code>true</code>, only case sensitive marks are applied.</td>
</tr>
<tr id="mark-diacritics">
<td><span class="permalink">mark_diacritics</span></td>
<td>true</td>
@ -362,8 +382,9 @@ $('button.update').click(function(){
<button class="bad" type="button" data-filter-column="all" title="See &quot;Notes&quot; on why the second row isn't highlighted">~ee</button>
<button type="button" data-filter-column="all">br?n</button>
<button type="button" data-filter-column="all">br*n</button>
<button type="button" data-filter-column="all">aaron|bruce</button>
<button type="button" data-filter-column="all">aaron &amp;&amp; 2</button>
<button type="button" data-filter-column="all">aaron|bruce</button>
<button type="button" class="sens tooltip" title="Case Sensitive Mark" data-filter-column="all" data-mark-case="true">aaron|Bruce</button>
<table id="table" class="tablesorter">
<thead>
<tr>
@ -401,8 +422,9 @@ $('button.update').click(function(){
<button class="table2 bad" type="button" title="See &quot;Notes&quot; on why the &quot;005 Bruce Almighty&quot; row isn't highlighted">~ee</button>
<button class="table2" type="button">br?n</button>
<button class="table2" type="button">br*n</button>
<button class="table2" type="button">aaron|bruce</button>
<button class="table2" type="button">aaron &amp;&amp; 2</button>
<button class="table2" type="button">aaron|bruce</button>
<button class="table2 sens tooltip" type="button" title="Case Sensitive Mark" data-filter-column="all" data-mark-case="true">aaron|Bruce</button>
<table id="table2" class="tablesorter">
<thead>

View File

@ -491,9 +491,9 @@
<br><br>
</li>
<li>Pager plugin (<a href="example-pager.html">basic</a> &amp; <a href="example-pager-ajax.html">ajax</a> demos; <span class="version updated">v2.27.3</span>).</li>
<li>Pager plugin (<a href="example-pager.html">basic</a> &amp; <a href="example-pager-ajax.html">ajax</a> demos; <span class="version updated">v2.27.7</span>).</li>
<li>
Pager widget (<a href="example-widget-pager.html">basic</a> &amp; <a href="example-widget-pager-ajax.html">ajax</a> demos) (<span class="version">v2.12</span>; <span class="version updated">v2.27.3</span>).<br>
Pager widget (<a href="example-widget-pager.html">basic</a> &amp; <a href="example-widget-pager-ajax.html">ajax</a> demos) (<span class="version">v2.12</span>; <span class="version updated">v2.27.7</span>).<br>
<br>
</li>
@ -3314,8 +3314,12 @@ $('table').trigger('search', false);</pre></div>
<li><span class="label warning">*NOTE*</span> because this example is providing a fixed select option source, it can not support "filter-onlyAvail" (only show available options after filtering).</li>
</ul>
In <span class="version updated">v2.21.5</span>, this option will now override the <code>filter_function</code> options (<em>so you need to add them back!</em>), allowing the addition of custom select options and still maintain basic filtering action - see <a href="http://jsfiddle.net/Mottie/856bzzeL/117/">this demo</a> (<a class="external" href="http://stackoverflow.com/a/29506523/145346">ref</a>).<br>
<br>
<p>
In <span class="version updated">v2.27.7</span>, an option to have a descending sort applied to this data can be done by adding a <code>"filter-select-sort-desc"</code> to the header cell. Adding a <code>"filter-select-nosort"</code> class name to a header to prevent sorting has been available since v2.16.3.
</p>
<p>
In <span class="version updated">v2.21.5</span>, this option will now override the <code>filter_function</code> options (<em>so you need to add them back!</em>), allowing the addition of custom select options and still maintain basic filtering action - see <a href="http://jsfiddle.net/Mottie/856bzzeL/117/">this demo</a> (<a class="external" href="http://stackoverflow.com/a/29506523/145346">ref</a>).
</p>
In <span class="version updated">v2.17.0</span>, the <code>filter_selectSource</code> column can also be referenced by using a jQuery selector (e.g. class name or ID) that points to a table <em>header</em> cell.<br>
<pre class="prettyprint lang-js">filter_selectSource : {
".model-number" : [ "abc", "def", "ghi", "xyz" ]
@ -4507,11 +4511,15 @@ $('table').trigger('search', false);</pre></div>
<td><a href="#" class="permalink">output</a></td>
<td>String</td>
<td>&quot;{page}/<wbr>{totalPages}&quot;</td>
<td>This option allows you to format the output display which can show the current page, total pages, filtered pages, current start and end rows, total rows and filtered rows (v2.0.9; <span class="version">v2.17.6</span>).
<td>This option allows you to format the output display which can show the current page, total pages, filtered pages, current start and end rows, total rows and filtered rows (v2.0.9; <span class="version">v2.27.7</span>).
<div class="collapsible">
<br>
<span class="label label-info">Note</span> The pager widget equivalent option is within the <code>widgetOptions</code> and accessed via <code>widgetOptions.pager_output</code><br>
<br>
In <span class="version updated">v2.27.7</span>, this option can also be set as a function
<pre class="prettyprint lang-js">output: function(table, pager) {
return 'page ' + pager.startRow + ' - ' + pager.endRow;
}</pre>
This option replaced the original <code>separator</code> option, which only separated the page number from the total number of pages. The formatted output from this option is placed inside the information block targeted by the <code>cssPageDisplay</code> option.<br>
<br>
Use it as follows:
@ -7711,6 +7719,7 @@ $('select.external').html( opts );</pre>
The <code>column</code> parameter is optional, but if included it is used:
<ul>
<li>To check the column header for a <code>filter-select-nosort</code> class name to prevent the sorting of options.</li>
<li>To check the column header for a <code>filter-select-sort-desc</code> class name to preform a descending sort of options.</li>
<li>To check tablesorter's <code>textSorter</code> option in case there are column specific sorting algorhithms set.</li>
</ul>
See the <a href="#function-getoptions"><code>getOptions</code></a> function description or the <a href="#widget-filter-selectsource"><code>filter_selectSource</code></a> option (under "An object containing column keys"; getJSON) for examples which use this function.

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*/
/*! tablesorter (FORK) - updated 09-01-2016 (v2.27.6)*/
/*! tablesorter (FORK) - updated 09-23-2016 (v2.27.7)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -16,7 +16,7 @@
}
}(function(jQuery) {
/*! TableSorter (FORK) v2.27.6 *//*
/*! TableSorter (FORK) v2.27.7 *//*
* Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
@ -40,7 +40,7 @@
'use strict';
var ts = $.tablesorter = {
version : '2.27.6',
version : '2.27.7',
parsers : [],
widgets : [],
@ -251,7 +251,7 @@
// save the settings where they read
$.data( table, 'tablesorter', c );
if ( c.debug ) {
console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter' );
console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter v' + ts.version );
$.data( table, 'startoveralltimer', new Date() );
}
@ -353,7 +353,7 @@
table.hasInitialized = true;
table.isProcessing = false;
if ( c.debug ) {
console.log( 'Overall initialization time: ' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
console.log( 'Overall initialization time:' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
if ( c.debug && console.groupEnd ) { console.groupEnd(); }
}
$table.triggerHandler( 'tablesorter-initialized', table );
@ -3137,7 +3137,7 @@
})(jQuery);
/*! Widget: filter - updated 8/22/2016 (v2.27.5) *//*
/*! Widget: filter - updated 9/23/2016 (v2.27.7) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison
*/
@ -3970,9 +3970,9 @@
// don't allow 'change' event to process if the input value is the same - fixes #685
if ( table.config.widgetOptions.filter_initialized &&
( event.which === tskeyCodes.enter || event.type === 'search' ||
( event.type === 'change' ) && this.value !== c.lastSearch[column] ) ||
// only "input" event fires in MS Edge when clicking the "x" to clear the search
( event.type === 'input' && this.value === '' ) ) {
( event.type === 'change' || event.type === 'input' ) &&
this.value !== c.lastSearch[column] )
) {
event.preventDefault();
// init search with no delay
$( this ).attr( 'data-lastSearchTime', new Date().getTime() );
@ -4687,6 +4687,7 @@
var cts, txt, indx, len, parsedTxt, str,
c = table.config,
validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns,
direction = validColumn ? c.$headerIndexed[ column ].hasClass( 'filter-select-sort-desc' ) : false,
parsed = [];
// get unique elements and sort the list
// if $.tablesorter.sortText exists ( not in the original tablesorter ),
@ -4727,8 +4728,8 @@
// sort parsed select options
cts = c.textSorter || '';
parsed.sort( function( a, b ) {
var x = a.parsed,
y = b.parsed;
var x = direction ? b.parsed : a.parsed,
y = direction ? a.parsed : b.parsed;
if ( validColumn && typeof cts === 'function' ) {
// custom OVERALL text sorter
return cts( x, y, true, column, table );

View File

@ -1,4 +1,4 @@
/*! TableSorter (FORK) v2.27.6 *//*
/*! TableSorter (FORK) v2.27.7 *//*
* Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
@ -22,7 +22,7 @@
'use strict';
var ts = $.tablesorter = {
version : '2.27.6',
version : '2.27.7',
parsers : [],
widgets : [],
@ -233,7 +233,7 @@
// save the settings where they read
$.data( table, 'tablesorter', c );
if ( c.debug ) {
console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter' );
console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter v' + ts.version );
$.data( table, 'startoveralltimer', new Date() );
}
@ -335,7 +335,7 @@
table.hasInitialized = true;
table.isProcessing = false;
if ( c.debug ) {
console.log( 'Overall initialization time: ' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
console.log( 'Overall initialization time:' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
if ( c.debug && console.groupEnd ) { console.groupEnd(); }
}
$table.triggerHandler( 'tablesorter-initialized', table );

View File

@ -4,7 +4,7 @@
*/
/*! tablesorter (FORK) - updated 09-01-2016 (v2.27.6)*/
/*! tablesorter (FORK) - updated 09-23-2016 (v2.27.7)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -382,7 +382,7 @@
})(jQuery);
/*! Widget: filter - updated 8/22/2016 (v2.27.5) *//*
/*! Widget: filter - updated 9/23/2016 (v2.27.7) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison
*/
@ -1215,9 +1215,9 @@
// don't allow 'change' event to process if the input value is the same - fixes #685
if ( table.config.widgetOptions.filter_initialized &&
( event.which === tskeyCodes.enter || event.type === 'search' ||
( event.type === 'change' ) && this.value !== c.lastSearch[column] ) ||
// only "input" event fires in MS Edge when clicking the "x" to clear the search
( event.type === 'input' && this.value === '' ) ) {
( event.type === 'change' || event.type === 'input' ) &&
this.value !== c.lastSearch[column] )
) {
event.preventDefault();
// init search with no delay
$( this ).attr( 'data-lastSearchTime', new Date().getTime() );
@ -1932,6 +1932,7 @@
var cts, txt, indx, len, parsedTxt, str,
c = table.config,
validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns,
direction = validColumn ? c.$headerIndexed[ column ].hasClass( 'filter-select-sort-desc' ) : false,
parsed = [];
// get unique elements and sort the list
// if $.tablesorter.sortText exists ( not in the original tablesorter ),
@ -1972,8 +1973,8 @@
// sort parsed select options
cts = c.textSorter || '';
parsed.sort( function( a, b ) {
var x = a.parsed,
y = b.parsed;
var x = direction ? b.parsed : a.parsed,
y = direction ? a.parsed : b.parsed;
if ( validColumn && typeof cts === 'function' ) {
// custom OVERALL text sorter
return cts( x, y, true, column, table );

View File

@ -1,4 +1,4 @@
/*! Widget: filter - updated 8/22/2016 (v2.27.5) *//*
/*! Widget: filter - updated 9/23/2016 (v2.27.7) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison
*/
@ -831,9 +831,9 @@
// don't allow 'change' event to process if the input value is the same - fixes #685
if ( table.config.widgetOptions.filter_initialized &&
( event.which === tskeyCodes.enter || event.type === 'search' ||
( event.type === 'change' ) && this.value !== c.lastSearch[column] ) ||
// only "input" event fires in MS Edge when clicking the "x" to clear the search
( event.type === 'input' && this.value === '' ) ) {
( event.type === 'change' || event.type === 'input' ) &&
this.value !== c.lastSearch[column] )
) {
event.preventDefault();
// init search with no delay
$( this ).attr( 'data-lastSearchTime', new Date().getTime() );
@ -1548,6 +1548,7 @@
var cts, txt, indx, len, parsedTxt, str,
c = table.config,
validColumn = typeof column !== 'undefined' && column !== null && column >= 0 && column < c.columns,
direction = validColumn ? c.$headerIndexed[ column ].hasClass( 'filter-select-sort-desc' ) : false,
parsed = [];
// get unique elements and sort the list
// if $.tablesorter.sortText exists ( not in the original tablesorter ),
@ -1588,8 +1589,8 @@
// sort parsed select options
cts = c.textSorter || '';
parsed.sort( function( a, b ) {
var x = a.parsed,
y = b.parsed;
var x = direction ? b.parsed : a.parsed,
y = direction ? a.parsed : b.parsed;
if ( validColumn && typeof cts === 'function' ) {
// custom OVERALL text sorter
return cts( x, y, true, column, table );

View File

@ -1,4 +1,4 @@
/*! Widget: mark.js - updated 9/1/2016 (v2.27.6) *//*
/*! Widget: mark.js - updated 9/23/2016 (v2.27.7) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison
*/
@ -70,8 +70,6 @@
update : function( c, filters ) {
var options = {},
wo = c.widgetOptions,
setIgnoreCase = typeof wo.filter_ignoreCase === 'undefined' ? true :
wo.filter_ignoreCase,
regex = ts.mark.regex,
$rows = c.$table
.find( 'tbody tr' )
@ -139,7 +137,7 @@
if ( useRegex && matches && matches.length ) {
matches = new RegExp(
ts.mark.cleanMatches( matches ).join( '.*' ),
'gm' + ( setIgnoreCase ? 'i' : '' )
'gm'
);
if ( ts.mark.checkRegex( matches ) ) {
$rows.children( col ).markRegExp( matches, options );

View File

@ -1,4 +1,4 @@
/*! Widget: Pager - updated 8/17/2016 (v2.27.3) */
/*! Widget: Pager - updated 9/23/2016 (v2.27.7) */
/* Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison
*/
@ -464,30 +464,36 @@
p.startRow = t ? sz * p.page + 1 : ( p.filteredRows === 0 ? 0 : sz * p.page + 1 );
p.endRow = Math.min( p.filteredRows, p.totalRows, sz * ( p.page + 1 ) );
$out = p.$container.find( wo.pager_selectors.pageDisplay );
// form the output string (can now get a new output string from the server)
s = ( p.ajaxData && p.ajaxData.output ? p.ajaxData.output || wo.pager_output : wo.pager_output )
// {page} = one-based index; {page+#} = zero based index +/- value
.replace( /\{page([\-+]\d+)?\}/gi, function( m, n ) {
return p.totalPages ? p.page + ( n ? parseInt( n, 10 ) : 1 ) : 0;
})
// {totalPages}, {extra}, {extra:0} (array) or {extra : key} (object)
.replace( /\{\w+(\s*:\s*\w+)?\}/gi, function( m ) {
var len, indx,
str = m.replace( /[{}\s]/g, '' ),
extra = str.split( ':' ),
data = p.ajaxData,
// return zero for default page/row numbers
deflt = /(rows?|pages?)$/i.test( str ) ? 0 : '';
if ( /(startRow|page)/.test( extra[ 0 ] ) && extra[ 1 ] === 'input' ) {
len = ( '' + ( extra[ 0 ] === 'page' ? p.totalPages : p.totalRows ) ).length;
indx = extra[ 0 ] === 'page' ? p.page + 1 : p.startRow;
return '<input type="text" class="ts-' + extra[ 0 ] +
'" style="max-width:' + len + 'em" value="' + indx + '"/>';
}
return extra.length > 1 && data && data[ extra[ 0 ] ] ?
data[ extra[ 0 ] ][ extra[ 1 ] ] :
p[ str ] || ( data ? data[ str ] : deflt ) || deflt;
});
// Output param can be callback for custom rendering or string
if ( typeof wo.pager_output === 'function' ) {
s = wo.pager_output( table, p );
} else {
// form the output string (can now get a new output string from the server)
s = ( p.ajaxData && p.ajaxData.output ? p.ajaxData.output || wo.pager_output : wo.pager_output )
// {page} = one-based index; {page+#} = zero based index +/- value
.replace( /\{page([\-+]\d+)?\}/gi, function( m, n ) {
return p.totalPages ? p.page + ( n ? parseInt( n, 10 ) : 1 ) : 0;
})
// {totalPages}, {extra}, {extra:0} (array) or {extra : key} (object)
.replace( /\{\w+(\s*:\s*\w+)?\}/gi, function( m ) {
var len, indx,
str = m.replace( /[{}\s]/g, '' ),
extra = str.split( ':' ),
data = p.ajaxData,
// return zero for default page/row numbers
deflt = /(rows?|pages?)$/i.test( str ) ? 0 : '';
if ( /(startRow|page)/.test( extra[ 0 ] ) && extra[ 1 ] === 'input' ) {
len = ( '' + ( extra[ 0 ] === 'page' ? p.totalPages : p.totalRows ) ).length;
indx = extra[ 0 ] === 'page' ? p.page + 1 : p.startRow;
return '<input type="text" class="ts-' + extra[ 0 ] +
'" style="max-width:' + len + 'em" value="' + indx + '"/>';
}
return extra.length > 1 && data && data[ extra[ 0 ] ] ?
data[ extra[ 0 ] ][ extra[ 1 ] ] :
p[ str ] || ( data ? data[ str ] : deflt ) || deflt;
});
}
if ( p.$goto.length ) {
t = '';
options = tsp.buildPageSelect( c, p );
@ -1199,7 +1205,7 @@
},
enablePager: function( c, triggered ) {
var info, size,
var info, size, $el,
table = c.table,
p = c.pager;
p.isDisabled = false;
@ -1210,9 +1216,14 @@
p.totalPages = p.size === 'all' ? 1 : Math.ceil( tsp.getTotalPages( c, p ) / p.size );
c.$table.removeClass( 'pagerDisabled' );
// if table id exists, include page display with aria info
if ( table.id ) {
info = table.id + '_pager_info';
p.$container.find( c.widgetOptions.pager_selectors.pageDisplay ).attr( 'id', info );
if ( table.id && !c.$table.attr( 'aria-describedby' ) ) {
$el = p.$container.find( c.widgetOptions.pager_selectors.pageDisplay );
info = $el.attr( 'id' );
if ( !info ) {
// only add pageDisplay id if it doesn't exist - see #1288
info = table.id + '_pager_info';
$el.attr( 'id', info );
}
c.$table.attr( 'aria-describedby', info );
}
tsp.changeHeight( c );

View File

@ -1,4 +1,4 @@
/*! Widget: repeatHeaders - updated 2/7/2015 (v2.19.0) *//*
/*! Widget: repeatHeaders - updated 9/23/2016 (v2.27.7) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+
* Original by Christian Bach from the example-widgets.html demo
*/
@ -19,8 +19,8 @@
if (!wo.repeatHeaders) {
h = '<tr class="repeated-header ' + c.selectorRemove.slice(1) + '">';
for (i = 0; i < c.columns; i++) {
// only get the headerContent text
h += '<th>' + $.trim( c.$headers.eq(i).text() ) + '</th>';
// repeat the content of the current header (including child elements)
h += '<th>' + $.trim( c.$headers.eq(i).html() ) + '</th>';
}
// 'remove-me' class was added in case the table needs to be updated, the 'remove-me' rows will be
// removed prior to the update to prevent including the rows in the update - see 'selectorRemove' option

View File

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

View File

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

View File

@ -162,7 +162,7 @@ jQuery(function($){
undef, c1, c2, c3, c4, e, i, t;
$table1
.bind('tablesorter-initialized', function(){
.on('tablesorter-initialized', function(){
init = true;
})
.tablesorter();
@ -727,7 +727,7 @@ jQuery(function($){
QUnit.test( 'sort Events', function(assert) {
assert.expect(1);
$table1.add($table5).bind( events.join('.testing '), function(e){
$table1.add($table5).on( events.join('.testing '), function(e){
if (e.type === events[sortIndx%3]) {
sortIndx++;
}
@ -739,7 +739,7 @@ jQuery(function($){
// ensure all sort events fire on an empty table
$table5.trigger('sorton', [ [[0,0]] ]);
$table1.add($table5).unbind( events.join('.testing ') );
$table1.add($table5).off( events.join('.testing ') );
// table1 sorted twice in the above test; sortIndx = 9 then empty table5 x1 (total = 3 events x 3)
assert.equal( sortIndx, 9, 'sortStart, sortBegin & sortEnd fired in order x2; including empty table' );
@ -755,7 +755,7 @@ jQuery(function($){
// updateAll
$table1
.trigger('sorton', [ [[0,1]] ])
.bind('updateComplete.testing', function(){ updateIndx++; })
.on('updateComplete.testing', function(){ updateIndx++; })
.find('th:eq(1)').removeAttr('class').html('num').end()
.find('td:nth-child(2)').html(function(i,h){
return h.substring(1);
@ -832,13 +832,13 @@ jQuery(function($){
}]);
$table5
.bind('updateComplete.testing', function(){ updateIndx++; })
.on('updateComplete.testing', function(){ updateIndx++; })
.trigger('update', [true, function(){
updateCallback++;
assert.cacheCompare( table5, 'all', [], 'update method on empty table' );
}]);
$table1.add($table5).unbind('updateComplete.testing');
$table1.add($table5).off('updateComplete.testing');
// table1 updated 4x in the above test
// table5 updated 1x