Merge branch 'master' into gh-pages

This commit is contained in:
Rob Garrison 2017-07-04 12:57:40 -05:00
commit ac8786c9d3
28 changed files with 288 additions and 231 deletions

View File

@ -104,6 +104,28 @@ If you would like to contribute, please...
View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/Changes).
#### <a name="v2.28.15">Version 2.28.15</a> (7/4/2017)
* Core:
* Use calculated index instead of DOM index. See [pull #1424](https://github.com/Mottie/tablesorter/pull/1424); thanks [@ced-b](https://github.com/ced-b)!
* Fix check count cell indexing.
* ColumnSelector:
* Remove colspan adjustments when widget removed.
* Include tbody colspan updates on removal.
* Filter:
* Add namespacing to filter-formatter listeners. Needed to prevent JS error when a "resetToLoadState" is triggered and the "filterFomatterUpdate" bindings are still firing.
* Fix namespacing of events.
* Sort2Hash:
* Prevent filter update if unchanged & compare (with) hash filter.
* Fix p's (reference to pager object).
* Docs
* CSS fixed to comply with editable_wrapContent : `<div>`. See [pull #1420](https://github.com/Mottie/tablesorter/pull/1420); thanks [@LaurentBarbareau](https://github.com/LaurentBarbareau)!
* Remove note on contenteditable wrapping. See [pull #1420](https://github.com/Mottie/tablesorter/pull/1420).
* Update pager widget options in demo code.
* Use src files in filter formatter demo for testing.
* Meta:
* Include `js` & `css` folders with bower installs.
#### <a name="v2.28.14">Version 2.28.14</a> (6/8/2017)
* Core:
@ -127,15 +149,3 @@ View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/C
* Meta:
* Set jQuery dependency back to >=1.2.6. Fixes [issue #1411](https://github.com/Mottie/tablesorter/issues/1411).
* Add `package-lock.json` file.
#### <a name="v2.28.12">Version 2.28.12</a> (5/26/2017)
* ColumnSelector:
* Don't clear container on updateAll. Fixes [issue #1406](https://github.com/Mottie/tablesorter/issues/1406).
* Filter:
* Return `null` from `filter_selectSource` to prevent select updates; From discussion in IRC with [@alexweissman](https://github.com/alexweissman).
* Select searches now process filter types, then exactly match. Previously only exact matches were performed by default, filter types were ignored. This broke the filter + jQuery UI selectmenu demo.
* Docs/Meta:
* Fix linting issues.
* Update jQuery UI to v1.12.1.
* Update [filter selectmenu demo](https://mottie.github.io/tablesorter/docs/example-widget-filter-selectmenu.html).

View File

@ -34,11 +34,8 @@
"/node_modules",
"/bower_components",
"/.git",
"/addons",
"/beta-testing",
"/css",
"/docs",
"/js",
"/testing",
"/Gruntfile.js",
"/package.json",

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 06-08-2017 (v2.28.14)*/
/*! tablesorter (FORK) - updated 07-04-2017 (v2.28.15)*/
/* 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.28.14 *//*
/*! TableSorter (FORK) v2.28.15 *//*
* Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
@ -34,7 +34,7 @@
'use strict';
var ts = $.tablesorter = {
version : '2.28.14',
version : '2.28.15',
parsers : [],
widgets : [],
@ -2252,7 +2252,7 @@
cells = $rows[ i ].cells;
for ( j = 0; j < cells.length; j++ ) {
cell = cells[ j ];
rowIndex = cell.parentNode.rowIndex;
rowIndex = i;
rowSpan = cell.rowSpan || 1;
colSpan = cell.colSpan || 1;
if ( typeof matrix[ rowIndex ] === 'undefined' ) {
@ -2311,7 +2311,7 @@
if ( !valid ) {
$rows.each( function( indx, el ) {
var cell = el.parentElement.nodeName;
if ( cells.indexOf( cell ) ) {
if ( cells.indexOf( cell ) < 0 ) {
cells.push( cell );
}
});
@ -3268,7 +3268,7 @@
})(jQuery);
/*! Widget: filter - updated 5/24/2017 (v2.28.11) *//*
/*! Widget: filter - updated 7/4/2017 (v2.28.15) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison
*/
@ -3339,8 +3339,10 @@
var tbodyIndex, $tbody,
$table = c.$table,
$tbodies = c.$tbodies,
events = 'addRows updateCell update updateRows updateComplete appendCache filterReset filterAndSortReset filterEnd search '
.split( ' ' ).join( c.namespace + 'filter ' );
events = (
'addRows updateCell update updateRows updateComplete appendCache filterReset ' +
'filterAndSortReset filterFomatterUpdate filterEnd search stickyHeadersInit '
).split( ' ' ).join( c.namespace + 'filter ' );
$table
.removeClass( 'hasFilters' )
// add filter namespace to all BUT search
@ -3869,7 +3871,9 @@
// so we have to work with it instead
formatterUpdated: function( $cell, column ) {
// prevent error if $cell is undefined - see #1056
var wo = $cell && $cell.closest( 'table' )[0].config.widgetOptions;
var $table = $cell && $cell.closest( 'table' );
var config = $table.length && $table[0].config,
wo = config && config.widgetOptions;
if ( wo && !wo.filter_initialized ) {
// add updates by column since this function
// may be called numerous times before initialization

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@
}
}(function(jQuery) {
/*! TableSorter (FORK) v2.28.14 *//*
/*! TableSorter (FORK) v2.28.15 *//*
* Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
@ -32,7 +32,7 @@
'use strict';
var ts = $.tablesorter = {
version : '2.28.14',
version : '2.28.15',
parsers : [],
widgets : [],
@ -2250,7 +2250,7 @@
cells = $rows[ i ].cells;
for ( j = 0; j < cells.length; j++ ) {
cell = cells[ j ];
rowIndex = cell.parentNode.rowIndex;
rowIndex = i;
rowSpan = cell.rowSpan || 1;
colSpan = cell.colSpan || 1;
if ( typeof matrix[ rowIndex ] === 'undefined' ) {
@ -2309,7 +2309,7 @@
if ( !valid ) {
$rows.each( function( indx, el ) {
var cell = el.parentElement.nodeName;
if ( cells.indexOf( cell ) ) {
if ( cells.indexOf( cell ) < 0 ) {
cells.push( cell );
}
});

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 06-08-2017 (v2.28.14)*/
/*! tablesorter (FORK) - updated 07-04-2017 (v2.28.15)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -402,7 +402,7 @@
})(jQuery);
/*! Widget: filter - updated 5/24/2017 (v2.28.11) *//*
/*! Widget: filter - updated 7/4/2017 (v2.28.15) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison
*/
@ -473,8 +473,10 @@
var tbodyIndex, $tbody,
$table = c.$table,
$tbodies = c.$tbodies,
events = 'addRows updateCell update updateRows updateComplete appendCache filterReset filterAndSortReset filterEnd search '
.split( ' ' ).join( c.namespace + 'filter ' );
events = (
'addRows updateCell update updateRows updateComplete appendCache filterReset ' +
'filterAndSortReset filterFomatterUpdate filterEnd search stickyHeadersInit '
).split( ' ' ).join( c.namespace + 'filter ' );
$table
.removeClass( 'hasFilters' )
// add filter namespace to all BUT search
@ -1003,7 +1005,9 @@
// so we have to work with it instead
formatterUpdated: function( $cell, column ) {
// prevent error if $cell is undefined - see #1056
var wo = $cell && $cell.closest( 'table' )[0].config.widgetOptions;
var $table = $cell && $cell.closest( 'table' );
var config = $table.length && $table[0].config,
wo = config && config.widgetOptions;
if ( wo && !wo.filter_initialized ) {
// add updates by column since this function
// may be called numerous times before initialization

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: filter, select2 formatter function - updated 7/11/2016 (v2.26.6) */
!function(e){"use strict";var t=e.tablesorter||{};t.filterFormatter=t.filterFormatter||{},t.filterFormatter.select2=function(l,c,i){var a,n,s=e.extend({cellText:"",match:!0,value:"",multiple:!0,width:"100%"},i),d=l.addClass("select2col"+c).closest("table")[0].config,r=d.widgetOptions,o=e('<input class="filter" type="hidden">').appendTo(l).bind("change"+d.namespace+"filter",function(){var e=v(this.value);d.$table.find(".select2col"+c+" .select2").select2("val",e),g()}),f=d.$headerIndexed[c],p=f.hasClass(r.filter_onlyAvail),u=s.match?"":"^",b=s.match?"":"$",$=r.filter_ignoreCase?"i":"",v=function(e){return e.replace(/^\/\(\^?/,"").replace(/\$\|\^/g,"|").replace(/\$?\)\/i?$/g,"").replace(/\\/g,"").split("|")},g=function(){var t=!1,l=d.$table.find(".select2col"+c+" .select2").select2("val")||s.value||"";e.isArray(l)&&(t=!0,l=l.join("\0")),l=l.replace(/[-[\]{}()*+?.,/\\^$|#\s]/g,"\\$&"),t&&(l=l.split("\0")),o.val(e.isArray(l)&&l.length&&""!==l.join("")?"/("+u+(l||[]).join(b+"|"+u)+b+")/"+$:"").trigger("search").end().find(".select2").select2("val",l),d.widgetOptions.$sticky&&d.widgetOptions.$sticky.find(".select2col"+c+" .select2").select2("val",l)},h=function(){n=[],a=t.filter.getOptionSource(d.$table[0],c,p)||[],e.each(a,function(e,t){n.push({id:""+t.parsed,text:t.text})}),s.data=n};return f.toggleClass("filter-match",s.match),s.cellText&&l.prepend("<label>"+s.cellText+"</label>"),s.ajax&&!e.isEmptyObject(s.ajax)||s.data||(h(),d.$table.bind("filterEnd",function(){h(),d.$table.find(".select2col"+c).add(d.widgetOptions.$sticky&&d.widgetOptions.$sticky.find(".select2col"+c)).find(".select2").select2(s)})),e('<input class="select2 select2-'+c+'" type="hidden" />').val(s.value).appendTo(l).select2(s).bind("change",function(){g()}),d.$table.bind("filterFomatterUpdate",function(){var e=v(d.$table.data("lastSearch")[c]||"");(l=d.$table.find(".select2col"+c)).find(".select2").select2("val",e),g(),t.filter.formatterUpdated(l,c)}),d.$table.bind("stickyHeadersInit",function(){var t=d.widgetOptions.$sticky.find(".select2col"+c).empty();e('<input class="select2 select2-'+c+'" type="hidden">').val(s.value).appendTo(t).select2(s).bind("change",function(){d.$table.find(".select2col"+c).find(".select2").select2("val",d.widgetOptions.$sticky.find(".select2col"+c+" .select2").select2("val")),g()}),s.cellText&&t.prepend("<label>"+s.cellText+"</label>")}),d.$table.bind("filterReset",function(){d.$table.find(".select2col"+c).find(".select2").select2("val",s.value||""),setTimeout(function(){g()},0)}),g(),o}}(jQuery);
!function(e){"use strict";var t=e.tablesorter||{};t.filterFormatter=t.filterFormatter||{},t.filterFormatter.select2=function(l,c,i){var a,n,s=e.extend({cellText:"",match:!0,value:"",multiple:!0,width:"100%"},i),d=l.addClass("select2col"+c).closest("table")[0].config,r=d.widgetOptions,o=e('<input class="filter" type="hidden">').appendTo(l).bind("change"+d.namespace+"filter",function(){var e=v(this.value);d.$table.find(".select2col"+c+" .select2").select2("val",e),g()}),f=d.$headerIndexed[c],p=f.hasClass(r.filter_onlyAvail),u=s.match?"":"^",b=s.match?"":"$",$=r.filter_ignoreCase?"i":"",v=function(e){return e.replace(/^\/\(\^?/,"").replace(/\$\|\^/g,"|").replace(/\$?\)\/i?$/g,"").replace(/\\/g,"").split("|")},g=function(){var l=!1,i=d.$table.find(".select2col"+c+" .select2").select2("val")||s.value||"";e.isArray(i)&&(l=!0,i=i.join("\0")),i=i.replace(/[-[\]{}()*+?.,/\\^$|#\s]/g,"\\$&"),l&&(i=i.split("\0")),t.isEmptyObject(o.find(".select2").data())||(o.val(e.isArray(i)&&i.length&&""!==i.join("")?"/("+u+(i||[]).join(b+"|"+u)+b+")/"+$:"").trigger("search").end().find(".select2").select2("val",i),d.widgetOptions.$sticky&&d.widgetOptions.$sticky.find(".select2col"+c+" .select2").select2("val",i))},h=function(){n=[],a=t.filter.getOptionSource(d.$table[0],c,p)||[],e.each(a,function(e,t){n.push({id:""+t.parsed,text:t.text})}),s.data=n};return f.toggleClass("filter-match",s.match),s.cellText&&l.prepend("<label>"+s.cellText+"</label>"),s.ajax&&!e.isEmptyObject(s.ajax)||s.data||(h(),d.$table.bind("filterEnd",function(){h(),d.$table.find(".select2col"+c).add(d.widgetOptions.$sticky&&d.widgetOptions.$sticky.find(".select2col"+c)).find(".select2").select2(s)})),e('<input class="select2 select2-'+c+'" type="hidden" />').val(s.value).appendTo(l).select2(s).bind("change",function(){g()}),d.$table.bind("filterFomatterUpdate",function(){var e=v(d.$table.data("lastSearch")[c]||"");(l=d.$table.find(".select2col"+c)).find(".select2").select2("val",e),g(),t.filter.formatterUpdated(l,c)}),d.$table.bind("stickyHeadersInit",function(){var t=d.widgetOptions.$sticky.find(".select2col"+c).empty();e('<input class="select2 select2-'+c+'" type="hidden">').val(s.value).appendTo(t).select2(s).bind("change",function(){d.$table.find(".select2col"+c).find(".select2").select2("val",d.widgetOptions.$sticky.find(".select2col"+c+" .select2").select2("val")),g()}),s.cellText&&t.prepend("<label>"+s.cellText+"</label>")}),d.$table.bind("filterReset",function(){d.$table.find(".select2col"+c).find(".select2").select2("val",s.value||""),setTimeout(function(){g()},0)}),g(),o}}(jQuery);

File diff suppressed because one or more lines are too long

View File

@ -1,2 +1,2 @@
/*! Widget: sort2Hash (BETA) - updated 4/2/2017 (v2.28.6) */
!function(e){"use strict";var t=e.tablesorter||{},a=t.sort2Hash={init:function(r,o){var s,n,i,h,d=r.table,c=r.pager,l=t.hasWidget(d,"saveSort"),H=a.decodeHash(r,o,"sort");(H&&!l||H&&l&&o.sort2Hash_overrideSaveSort)&&a.convertString2Sort(r,o,H),t.hasWidget(r.table,"pager")&&(n=parseInt(a.decodeHash(r,o,"page"),10),i=c.page=n<0?0:n>c.totalPages?c.totalPages-1:n,h=c.size=parseInt(a.decodeHash(r,o,"size"),10)),t.hasWidget(d,"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])}),e.tablesorter.setFilters(d,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,d,c=r.split(t.sort2Hash_separator),l=0,H=c.length,g=[];l<H;){if(s=c[l++],i=parseInt(s,10),isNaN(i)||i>e.columns)for(o=new RegExp("("+a.regexEscape(s)+")","i"),h=0;h<e.columns;h++)d=e.$headerIndexed[h],o.test(d.attr(t.sort2Hash_headerTextAttr))&&(s=h,h=e.columns);n=c[l++],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||[],d=h.length;for(r=0;r<d;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||[],d=h.length;for(r=0;r<d;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"),d=a.convertSort2String(r,o),c=h&&""!==r.lastSearch.join("")?r.lastSearch:[],l=encodeURIComponent(c.join(r.widgetOptions.sort2Hash_separator)),H={sort:d?a.encodeHash(r,o,"sort",d,r.sortList):"",page:i?a.encodeHash(r,o,"page",r.pager.page+1):"",size:i?a.encodeHash(r,o,"size",r.pager.size):"",filter:l?a.encodeHash(r,o,"filter",l,c):""};e.each(H,function(e,t){n=a.cleanHash(r,o,e,n),s+=t}),window.location.hash=((window.location.hash||"").replace("#","").length?n:o.sort2Hash_hash)+s}};t.addWidget({id:"sort2Hash",priority:60,options:{sort2Hash_hash:"#",sort2Hash_separator:"-",sort2Hash_headerTextAttr:"data-header",sort2Hash_directionText:[0,1],sort2Hash_overrideSaveSort:!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);
/*! Widget: sort2Hash (BETA) - updated 7/4/2017 (v2.28.15) */
!function(e){"use strict";var t=e.tablesorter||{},a=t.sort2Hash={init:function(r,o){var s,n,i,h,d=r.table,l=r.pager,c=t.hasWidget(d,"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=l.page=n<0?0:n>l.totalPages?l.totalPages-1:n,h=l.size=parseInt(a.decodeHash(r,o,"size"),10)),t.hasWidget(d,"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(d,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,d,l=r.split(t.sort2Hash_separator),c=0,H=l.length,g=[];c<H;){if(s=l[c++],i=parseInt(s,10),isNaN(i)||i>e.columns)for(o=new RegExp("("+a.regexEscape(s)+")","i"),h=0;h<e.columns;h++)d=e.$headerIndexed[h],o.test(d.attr(t.sort2Hash_headerTextAttr))&&(s=h,h=e.columns);n=l[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||[],d=h.length;for(r=0;r<d;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||[],d=h.length;for(r=0;r<d;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"),d=a.convertSort2String(r,o),l=h&&""!==r.lastSearch.join("")?r.lastSearch:[],c=encodeURIComponent(l.join(r.widgetOptions.sort2Hash_separator)),H={sort:d?a.encodeHash(r,o,"sort",d,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,l):""};e.each(H,function(e,t){n=a.cleanHash(r,o,e,n),s+=t}),window.location.hash=((window.location.hash||"").replace("#","").length?n:o.sort2Hash_hash)+s}};t.addWidget({id:"sort2Hash",priority:60,options:{sort2Hash_hash:"#",sort2Hash_separator:"-",sort2Hash_headerTextAttr:"data-header",sort2Hash_directionText:[0,1],sort2Hash_overrideSaveSort:!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

@ -31,7 +31,7 @@
.color2 { color: blue; }
.color3 { color: green; }
</style>
<style id="css">.tablesorter tbody > tr > td[contenteditable=true]:focus {
<style id="css">.tablesorter tbody > tr > td > div[contenteditable=true]:focus {
outline: #08f 1px solid;
background: #eee;
resize: none;
@ -122,8 +122,7 @@ td.editable_updated {
<h3><a href="#">Notes</a></h3>
<div>
<ul>
<li>This widget can not be applied to the original plugin and requires jQuery 1.7+ and a browser that supports <a href="http://caniuse.com/#feat=contenteditable"><code>contenteditable</code> attributes</a> (almost all modern browsers).</li>
<li><span class="label warning">Important</span>: In Internet Explorer, please wrap the cell content with a DIV or SPAN as <a href="http://msdn.microsoft.com/en-us/library/ie/ms533690(v=vs.85).aspx">it is not possible to make table cells directly contenteditable</a>. Wrapping the content in the markup is much more efficient than using javascript to do it for you (especially in IE).<br><br></li>
<li>This widget can not be applied to the original plugin and requires jQuery 1.7+ and a browser that supports <a href="http://caniuse.com/#feat=contenteditable"><code>contenteditable</code> attributes</a> (almost all modern browsers)<br><br></li>
<li>In <span class="version">v2.23.0</span>, the <code>editable_columns</code> option will now accept a string with both ranges and single columns, e.g. <code>'1,3-5,7'</code>.</li>
<li>In <span class="version">v2.22.2</span>,
<ul>

View File

@ -33,7 +33,10 @@
<link href="../css/theme.jui.css" rel="stylesheet">
<link href="../css/filter.formatter.css" rel="stylesheet">
<script src="../js/jquery.tablesorter.js"></script>
<script src="../js/jquery.tablesorter.widgets.js"></script>
<script src="../js/widgets/widget-filter.js"></script>
<script src="../js/widgets/widget-stickyHeaders.js"></script>
<script src="../js/widgets/widget-storage.js"></script>
<script src="../js/widgets/widget-uitheme.js"></script>
<script src="../js/widgets/widget-filter-formatter-jui.js"></script>
<script>
$(function(){

View File

@ -38,6 +38,26 @@
widgets: ['zebra', 'filter', 'pager'],
widgetOptions: {
// css class names of pager arrows
pager_css: {
container : 'tablesorter-pager',
errorRow : 'tablesorter-errorRow', // error information row (don't include period at beginning)
disabled : 'disabled' // class added to arrows @ extremes (i.e. prev/first arrows "disabled" on first page)
},
// jQuery selectors
pager_selectors: {
container : '.pager', // target the pager markup (wrapper)
first : '.first', // go to first page arrow
prev : '.prev', // previous page arrow
next : '.next', // next page arrow
last : '.last', // go to last page arrow
gotoPage : '.gotoPage', // go to page selector - select dropdown that sets the current page
pageDisplay : '.pagedisplay', // location of where the "output" is displayed
pageSize : '.pagesize' // page size selector - select dropdown that sets the "size" option
},
// output default: '{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
@ -49,12 +69,24 @@
// starting page of the pager (zero based index)
pager_startPage: 0,
// Reset pager to this page after filtering; set to desired page number
// (zero-based index), or false to not change page at filter start
pager_pageReset: 0,
// Number of visible rows
pager_size: 25,
// f true, child rows will be counted towards the pager set size
pager_countChildRows: false,
// Save pager page & size if the storage script is loaded (requires $.tablesorter.storage in jquery.tablesorter.widgets.js)
pager_savePages: true,
// Saves tablesorter paging to custom key if defined. Key parameter name
// used by the $.tablesorter.storage function. Useful if you have
// multiple tables defined
pager_storageKey: "tablesorter-pager",
// if true, the table will remain the same height no matter how many records are displayed. The space is made up by an empty
// table row set to a height to compensate; default is false
pager_fixedHeight: false,
@ -94,6 +126,18 @@
dataType: 'json'
},
// Set this option to false if your table data is preloaded into the
// table, but you are still using ajax
pager_processAjaxOnInit: true,
// When processAjaxOnInit is set to false, set this option to contain
// the total number of rows and filtered rows to prevent an initial ajax
// call
initialRows: {
total: 100,
filtered: 100
},
// process ajax so that the following information is returned:
// [ total_rows (number), rows (array of arrays), headers (array; optional) ]
// example:
@ -140,26 +184,6 @@
// in version 2.10, you can optionally return $(rows) a set of table rows within a jQuery object
return [ total, rows, headers ];
}
},
// css class names of pager arrows
pager_css: {
container : 'tablesorter-pager',
errorRow : 'tablesorter-errorRow', // error information row (don't include period at beginning)
disabled : 'disabled' // class added to arrows @ extremes (i.e. prev/first arrows "disabled" on first page)
},
// jQuery selectors
pager_selectors: {
container : '.pager', // target the pager markup (wrapper)
first : '.first', // go to first page arrow
prev : '.prev', // previous page arrow
next : '.next', // next page arrow
last : '.last', // go to last page arrow
gotoPage : '.gotoPage', // go to page selector - select dropdown that sets the current page
pageDisplay : '.pagedisplay', // location of where the "output" is displayed
pageSize : '.pagesize' // page size selector - select dropdown that sets the "size" option
}
}

View File

@ -37,66 +37,9 @@
widgetOptions: {
// output default: '{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
pager_output: '{startRow:input} &ndash; {endRow} / {totalRows} rows', // '{page}/{totalPages}'
// apply disabled classname to the pager arrows when the rows at either extreme is visible
pager_updateArrows: true,
// starting page of the pager (zero based index)
pager_startPage: 0,
// Number of visible rows
pager_size: 10,
// Save pager page & size if the storage script is loaded (requires $.tablesorter.storage in jquery.tablesorter.widgets.js)
pager_savePages: true,
// if true, the table will remain the same height no matter how many records are displayed. The space is made up by an empty
// table row set to a height to compensate; default is false
pager_fixedHeight: true,
// remove rows from the table to speed up the sort of large tables.
// setting this to false, only hides the non-visible rows; needed if you plan to add/remove rows with the pager enabled.
pager_removeRows: false, // removing rows in larger tables speeds up the sort
// use this format: "http://mydatabase.com?page={page}&size={size}&{sortList:col}&{filterList:fcol}"
// where {page} is replaced by the page number, {size} is replaced by the number of records to show,
// {sortList:col} adds the sortList to the url into a "col" array, and {filterList:fcol} adds
// the filterList to the url into an "fcol" array.
// So a sortList = [[2,0],[3,0]] becomes "&col[2]=0&col[3]=0" in the url
// and a filterList = [[2,Blue],[3,13]] becomes "&fcol[2]=Blue&fcol[3]=13" in the url
pager_ajaxUrl: null,
// modify the url after all processing has been applied
pager_customAjaxUrl: function(table, url) { return url; },
// ajax error callback from $.tablesorter.showError function
// pager_ajaxError: function( config, xhr, settings, exception ){ return exception; };
// returning false will abort the error message
pager_ajaxError: null,
// modify the $.ajax object to allow complete control over your ajax requests
pager_ajaxObject: {
dataType: 'json'
},
// process ajax so that the following information is returned:
// [ total_rows (number), rows (array of arrays), headers (array; optional) ]
// example:
// [
// 100, // total rows
// [
// [ "row1cell1", "row1cell2", ... "row1cellN" ],
// [ "row2cell1", "row2cell2", ... "row2cellN" ],
// ...
// [ "rowNcell1", "rowNcell2", ... "rowNcellN" ]
// ],
// [ "header1", "header2", ... "headerN" ] // optional
// ]
pager_ajaxProcessing: function(ajax){ return [ 0, [], null ]; },
// ** NOTE: All default ajax options have been removed from this demo,
// see the example-widget-pager-ajax demo for a full list of pager
// options
// css class names that are added
pager_css: {
@ -115,7 +58,44 @@
gotoPage : '.gotoPage', // go to page selector - select dropdown that sets the current page
pageDisplay : '.pagedisplay', // location of where the "output" is displayed
pageSize : '.pagesize' // page size selector - select dropdown that sets the "size" option
}
},
// output default: '{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
pager_output: '{startRow:input} &ndash; {endRow} / {totalRows} rows', // '{page}/{totalPages}'
// apply disabled classname to the pager arrows when the rows at either extreme is visible
pager_updateArrows: true,
// starting page of the pager (zero based index)
pager_startPage: 0,
// Reset pager to this page after filtering; set to desired page number
// (zero-based index), or false to not change page at filter start
pager_pageReset: 0,
// Number of visible rows
pager_size: 10,
// f true, child rows will be counted towards the pager set size
pager_countChildRows: false,
// Save pager page & size if the storage script is loaded (requires $.tablesorter.storage in jquery.tablesorter.widgets.js)
pager_savePages: true,
// Saves tablesorter paging to custom key if defined. Key parameter name
// used by the $.tablesorter.storage function. Useful if you have
// multiple tables defined
pager_storageKey: "tablesorter-pager",
// if true, the table will remain the same height no matter how many records are displayed. The space is made up by an empty
// table row set to a height to compensate; default is false
pager_fixedHeight: true,
// remove rows from the table to speed up the sort of large tables.
// setting this to false, only hides the non-visible rows; needed if you plan to add/remove rows with the pager enabled.
pager_removeRows: false // removing rows in larger tables speeds up the sort
}

View File

@ -461,11 +461,11 @@
<li><span class="label label-info">Beta</span> <a href="example-widget-chart.html">Chart Widget</a> (<span class="version">v2.19.0</span>; <span class="version updated">v2.24.0</span>).</li>
<li><span class="results">&dagger;</span> <a href="example-widget-columns.html">Columns highlight widget</a> (v2.0.17; <span class="version updated">v2.28.11</span>).</li>
<li><a href="example-widget-column-selector.html">Column selector widget</a> (<span class="version">v2.15</span>; <span class="version updated">v2.28.2</span>).</li>
<li><a href="example-widget-column-selector.html">Column selector widget</a> (<span class="version">v2.15</span>; <span class="version updated">v2.28.15</span>).</li>
<li><a href="example-widget-editable.html">Content editable widget</a> (v2.9; <span class="version updated">v2.28.7</span>).</li>
<li><a href="example-widget-current-sort.html">Current Sort Widget</a> (<span class="version">v2.27.0</span>).</li>
<li><span class="label label-info">Beta</span> <a href="example-dragtable.html">Dragtable mod</a> - (jQuery UI widget for column reordering [<a class="external" href="http://stackoverflow.com/a/27770224/145346">ref</a>]; <span class="version">v2.24.0</span>).</li>
<li><span class="results">&dagger;</span> Filter widget (<span class="version updated">v2.28.11</span>):
<li><span class="results">&dagger;</span> Filter widget (<span class="version updated">v2.28.15</span>):
<ul>
<li><a href="example-widget-filter.html">basic</a> (v2.0.18; <span class="version updated">v2.26.6</span>).</li>
<li><a href="example-widget-filter-any-match.html">external option (match any column)</a> (<span class="version">v2.13.3</span>; <span class="version updated">v2.27.5</span>).</li>
@ -508,7 +508,7 @@
<li><span class="results">&dagger;</span> <a href="example-widget-resizable.html">Resizable columns widget</a> (v2.0.23.1; <span class="version updated">v2.28.8</span>).</li>
<li><span class="results">&dagger;</span> <a href="example-widget-savesort.html">Save sort widget</a> (v2.0.27; <span class="version updated">v2.24.0</span>).</li>
<li><a href="example-widget-scroller.html">Scroller widget</a> (<span class="version">v2.9</span>; <span class="version updated">v2.28.8</span>).</li>
<li><span class="label label-info">Beta</span> <a href="example-widget-sort-to-hash.html">Sort-to-hash widget</a> (<span class="version">v2.22.4</span>; <span class="version updated">v2.28.6</span>).</li>
<li><span class="label label-info">Beta</span> <a href="example-widget-sort-to-hash.html">Sort-to-hash widget</a> (<span class="version">v2.22.4</span>; <span class="version updated">v2.28.15</span>).</li>
<li><span class="label label-info">Beta</span> <a href="example-widget-sort-tbodies.html">Sort tbodies widget</a> (<span class="version">v2.22.2</span>; <span class="version updated">v2.28.0</span>).</li>
<li><a href="example-widget-static-row.html">Static row widget</a> (<span class="version">v2.16</span>; <span class="version updated">v2.24.0</span>).</li>

View File

@ -4,7 +4,7 @@
*/
/*! tablesorter (FORK) - updated 06-08-2017 (v2.28.14)*/
/*! tablesorter (FORK) - updated 07-04-2017 (v2.28.15)*/
/* 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.28.14 *//*
/*! TableSorter (FORK) v2.28.15 *//*
* Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
@ -40,7 +40,7 @@
'use strict';
var ts = $.tablesorter = {
version : '2.28.14',
version : '2.28.15',
parsers : [],
widgets : [],
@ -2258,7 +2258,7 @@
cells = $rows[ i ].cells;
for ( j = 0; j < cells.length; j++ ) {
cell = cells[ j ];
rowIndex = cell.parentNode.rowIndex;
rowIndex = i;
rowSpan = cell.rowSpan || 1;
colSpan = cell.colSpan || 1;
if ( typeof matrix[ rowIndex ] === 'undefined' ) {
@ -2317,7 +2317,7 @@
if ( !valid ) {
$rows.each( function( indx, el ) {
var cell = el.parentElement.nodeName;
if ( cells.indexOf( cell ) ) {
if ( cells.indexOf( cell ) < 0 ) {
cells.push( cell );
}
});
@ -3274,7 +3274,7 @@
})(jQuery);
/*! Widget: filter - updated 5/24/2017 (v2.28.11) *//*
/*! Widget: filter - updated 7/4/2017 (v2.28.15) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison
*/
@ -3345,8 +3345,10 @@
var tbodyIndex, $tbody,
$table = c.$table,
$tbodies = c.$tbodies,
events = 'addRows updateCell update updateRows updateComplete appendCache filterReset filterAndSortReset filterEnd search '
.split( ' ' ).join( c.namespace + 'filter ' );
events = (
'addRows updateCell update updateRows updateComplete appendCache filterReset ' +
'filterAndSortReset filterFomatterUpdate filterEnd search stickyHeadersInit '
).split( ' ' ).join( c.namespace + 'filter ' );
$table
.removeClass( 'hasFilters' )
// add filter namespace to all BUT search
@ -3875,7 +3877,9 @@
// so we have to work with it instead
formatterUpdated: function( $cell, column ) {
// prevent error if $cell is undefined - see #1056
var wo = $cell && $cell.closest( 'table' )[0].config.widgetOptions;
var $table = $cell && $cell.closest( 'table' );
var config = $table.length && $table[0].config,
wo = config && config.widgetOptions;
if ( wo && !wo.filter_initialized ) {
// add updates by column since this function
// may be called numerous times before initialization

View File

@ -1,4 +1,4 @@
/*! TableSorter (FORK) v2.28.14 *//*
/*! TableSorter (FORK) v2.28.15 *//*
* Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
@ -22,7 +22,7 @@
'use strict';
var ts = $.tablesorter = {
version : '2.28.14',
version : '2.28.15',
parsers : [],
widgets : [],
@ -2240,7 +2240,7 @@
cells = $rows[ i ].cells;
for ( j = 0; j < cells.length; j++ ) {
cell = cells[ j ];
rowIndex = cell.parentNode.rowIndex;
rowIndex = i;
rowSpan = cell.rowSpan || 1;
colSpan = cell.colSpan || 1;
if ( typeof matrix[ rowIndex ] === 'undefined' ) {
@ -2299,7 +2299,7 @@
if ( !valid ) {
$rows.each( function( indx, el ) {
var cell = el.parentElement.nodeName;
if ( cells.indexOf( cell ) ) {
if ( cells.indexOf( cell ) < 0 ) {
cells.push( cell );
}
});

View File

@ -4,7 +4,7 @@
*/
/*! tablesorter (FORK) - updated 06-08-2017 (v2.28.14)*/
/*! tablesorter (FORK) - updated 07-04-2017 (v2.28.15)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) {
if (typeof define === 'function' && define.amd) {
@ -408,7 +408,7 @@
})(jQuery);
/*! Widget: filter - updated 5/24/2017 (v2.28.11) *//*
/*! Widget: filter - updated 7/4/2017 (v2.28.15) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison
*/
@ -479,8 +479,10 @@
var tbodyIndex, $tbody,
$table = c.$table,
$tbodies = c.$tbodies,
events = 'addRows updateCell update updateRows updateComplete appendCache filterReset filterAndSortReset filterEnd search '
.split( ' ' ).join( c.namespace + 'filter ' );
events = (
'addRows updateCell update updateRows updateComplete appendCache filterReset ' +
'filterAndSortReset filterFomatterUpdate filterEnd search stickyHeadersInit '
).split( ' ' ).join( c.namespace + 'filter ' );
$table
.removeClass( 'hasFilters' )
// add filter namespace to all BUT search
@ -1009,7 +1011,9 @@
// so we have to work with it instead
formatterUpdated: function( $cell, column ) {
// prevent error if $cell is undefined - see #1056
var wo = $cell && $cell.closest( 'table' )[0].config.widgetOptions;
var $table = $cell && $cell.closest( 'table' );
var config = $table.length && $table[0].config,
wo = config && config.widgetOptions;
if ( wo && !wo.filter_initialized ) {
// add updates by column since this function
// may be called numerous times before initialization

View File

@ -1,4 +1,4 @@
/* Widget: columnSelector (responsive table widget) - updated 5/25/2017 (v2.28.12) *//*
/* Widget: columnSelector (responsive table widget) - updated 7/4/2017 (v2.28.15) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+
* by Justin Hallett & Rob Garrison
*/
@ -547,6 +547,11 @@
csel.$style.remove();
csel.$breakpoints.remove();
$( c.namespace + 'columnselectorHasSpan' ).removeClass( wo.filter_filteredRow || 'filtered' );
c.$table.find('[data-col-span]').each(function(indx, el) {
var $el = $(el);
console.log($el, $el.attr('data-col-span'));
$el.attr('colspan', $el.attr('data-col-span'));
});
c.$table.off('updateAll' + namespace + ' update' + namespace);
}

View File

@ -89,6 +89,7 @@
chkd = $cell.find('.toggle').is(':checked');
}
state = o.disabled || !chkd ? 'disable' : 'enable';
if (!ts.isEmptyObject($cell.find('.spinner').data())) {
$cell.find('.filter')
// add equal to the beginning, so we filter exact numbers
.val( chkd ? (compare ? compare : o.exactMatch ? '=' : '') + v : '' )
@ -103,6 +104,7 @@
$shcell.find('.toggle')[0].checked = chkd;
}
}
}
};
// add callbacks; preserve added callbacks
@ -137,7 +139,7 @@
});
// update spinner from hidden input, in case of saved filters
c.$table.bind('filterFomatterUpdate', function(){
c.$table.bind('filterFomatterUpdate' + c.namespace + 'filter', function(){
var val = tsff.updateCompare($cell, $input, o)[0];
$cell.find('.spinner').val( val );
updateSpinner({ value: val }, true);
@ -153,7 +155,7 @@
}
// has sticky headers?
c.$table.bind('stickyHeadersInit', function(){
c.$table.bind('stickyHeadersInit' + c.namespace + 'filter', function(){
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
if (o.addToggle) {
$('<div class="button"><input id="stickyuispinnerbutton' + indx + '" type="checkbox" class="toggle" />' +
@ -187,7 +189,7 @@
});
// on reset
c.$table.bind('filterReset', function(){
c.$table.bind('filterReset' + c.namespace + 'filter', function(){
if ($.isArray(o.compare)) {
$cell.add($shcell).find(compareSelect).val( o.compare[ o.selected || 0 ] );
}
@ -250,11 +252,12 @@
// add values to the handle data-value attribute so the css tooltip will work properly
$cell.find('.ui-slider-handle').addClass('value-popup').attr('data-value', result);
}
// prevent JS error if "resetToLoadState" or filter widget was removed for another reason
if (!ts.isEmptyObject($cell.find('.slider').data())) {
// update the hidden input;
$cell.find('.filter')
// ****** ADD AN EQUAL SIGN TO THE BEGINNING! <- this makes the slide exactly match the number ******
// when the value is at the minimum, clear the hidden input so all rows will be seen
$cell.find('.filter')
.val( ( compare ? compare + v : v === o.min ? '' : (o.exactMatch ? '=' : '') + v ) )
.trigger( notrigger ? '' : 'search', searchType ).end()
.find('.slider').slider('value', v);
@ -270,6 +273,7 @@
$shcell.find('.ui-slider-handle').addClass('value-popup').attr('data-value', result);
}
}
}
};
$cell.closest('thead').find('th[data-column=' + indx + ']').addClass('filter-parsed');
@ -296,7 +300,7 @@
.slider(o);
// update slider from hidden input, in case of saved filters
c.$table.bind('filterFomatterUpdate', function(){
c.$table.bind('filterFomatterUpdate' + c.namespace + 'filter', function(){
var val = tsff.updateCompare($cell, $input, o)[0];
$cell.find('.slider').slider('value', val );
updateSlider({ value: val }, false);
@ -312,7 +316,7 @@
}
// on reset
c.$table.bind('filterReset', function(){
c.$table.bind('filterReset' + c.namespace + 'filter', function(){
if ($.isArray(o.compare)) {
$cell.add($shcell).find(compareSelect).val( o.compare[ o.selected || 0 ] );
}
@ -322,7 +326,7 @@
});
// has sticky headers?
c.$table.bind('stickyHeadersInit', function(){
c.$table.bind('stickyHeadersInit' + c.namespace + 'filter', function(){
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
// add a jQuery UI slider!
@ -401,6 +405,7 @@
.eq(0).attr('data-value', val[0]).end() // adding value to data attribute
.eq(1).attr('data-value', val[1]); // value popup shown via css
}
if (!ts.isEmptyObject($cell.find('.range').data())) {
// update the hidden input
$cell.find('.filter').val(range)
.trigger(notrigger ? '' : 'search', searchType).end()
@ -417,6 +422,7 @@
.eq(1).attr('data-value', val[1]); // value popup shown via css
}
}
}
};
$cell.closest('thead').find('th[data-column=' + indx + ']').addClass('filter-parsed');
@ -443,13 +449,13 @@
.slider(o);
// update slider from hidden input, in case of saved filters
c.$table.bind('filterFomatterUpdate', function(){
c.$table.bind('filterFomatterUpdate' + c.namespace + 'filter', function(){
getRange();
ts.filter.formatterUpdated($cell, indx);
});
// on reset
c.$table.bind('filterReset', function(){
c.$table.bind('filterReset' + c.namespace + 'filter', function(){
$cell.find('.range').slider('values', o.values);
setTimeout(function(){
updateUiRange();
@ -457,7 +463,7 @@
});
// has sticky headers?
c.$table.bind('stickyHeadersInit', function(){
c.$table.bind('stickyHeadersInit' + c.namespace + 'filter', function(){
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
// add a jQuery UI slider!
@ -552,7 +558,7 @@
$date.datepicker(o);
// on reset
c.$table.bind('filterReset', function(){
c.$table.bind('filterReset' + c.namespace + 'filter', function(){
if ($.isArray(o.compare)) {
$cell.add($shcell).find(compareSelect).val( o.compare[ o.selected || 0 ] );
}
@ -563,7 +569,7 @@
});
// update date compare from hidden input, in case of saved filters
c.$table.bind('filterFomatterUpdate', function(){
c.$table.bind('filterFomatterUpdate' + c.namespace + 'filter', function(){
var num, v = $input.val();
if (/\s+-\s+/.test(v)) {
// date range found; assume an exact match on one day
@ -591,7 +597,7 @@
}
// has sticky headers?
c.$table.bind('stickyHeadersInit', function(){
c.$table.bind('stickyHeadersInit' + c.namespace + 'filter', function(){
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
// add a jQuery datepicker!
@ -702,7 +708,7 @@
$cell.find('.dateTo').datepicker(o);
// update date compare from hidden input, in case of saved filters
c.$table.bind('filterFomatterUpdate', function(){
c.$table.bind('filterFomatterUpdate' + c.namespace + 'filter', function(){
var val = $input.val() || '',
from = '',
to = '';
@ -733,7 +739,7 @@
});
// has sticky headers?
c.$table.bind('stickyHeadersInit', function(){
c.$table.bind('stickyHeadersInit' + c.namespace + 'filter', function(){
$shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
$shcell.append(t);
@ -747,7 +753,7 @@
});
// on reset
$cell.closest('table').bind('filterReset', function(){
$cell.closest('table').bind('filterReset' + c.namespace + 'filter', function(){
$cell.add($shcell).find('.dateFrom').val('').datepicker('setDate', o.from || null );
$cell.add($shcell).find('.dateTo').val('').datepicker('setDate', o.to || null );
setTimeout(function(){

View File

@ -70,6 +70,7 @@
if (arry) {
v = v.split('\u0000');
}
if (!ts.isEmptyObject($input.find('.select2').data())) {
$input
// add regex, so we filter exact numbers
.val(
@ -83,6 +84,7 @@
if (c.widgetOptions.$sticky) {
c.widgetOptions.$sticky.find('.select2col' + indx + ' .select2').select2('val', v);
}
}
},
// get options from table cell content or filter_selectSource (v2.16)

View File

@ -1,4 +1,4 @@
/*! Widget: filter - updated 5/24/2017 (v2.28.11) *//*
/*! Widget: filter - updated 7/4/2017 (v2.28.15) *//*
* Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison
*/
@ -69,8 +69,10 @@
var tbodyIndex, $tbody,
$table = c.$table,
$tbodies = c.$tbodies,
events = 'addRows updateCell update updateRows updateComplete appendCache filterReset filterAndSortReset filterEnd search '
.split( ' ' ).join( c.namespace + 'filter ' );
events = (
'addRows updateCell update updateRows updateComplete appendCache filterReset ' +
'filterAndSortReset filterFomatterUpdate filterEnd search stickyHeadersInit '
).split( ' ' ).join( c.namespace + 'filter ' );
$table
.removeClass( 'hasFilters' )
// add filter namespace to all BUT search
@ -599,7 +601,9 @@
// so we have to work with it instead
formatterUpdated: function( $cell, column ) {
// prevent error if $cell is undefined - see #1056
var wo = $cell && $cell.closest( 'table' )[0].config.widgetOptions;
var $table = $cell && $cell.closest( 'table' );
var config = $table.length && $table[0].config,
wo = config && config.widgetOptions;
if ( wo && !wo.filter_initialized ) {
// add updates by column since this function
// may be called numerous times before initialization

View File

@ -1,4 +1,4 @@
/*! Widget: sort2Hash (BETA) - updated 4/2/2017 (v2.28.6) */
/*! Widget: sort2Hash (BETA) - updated 7/4/2017 (v2.28.15) */
/* Requires tablesorter v2.8+ and jQuery 1.7+
* by Rob Garrison
*/
@ -29,7 +29,18 @@
c.$table.one( 'filterEnd', function() {
$(this).triggerHandler( 'pageAndSize', [ page, size ] );
});
// use the newest filter comparison code
if ( ts.filter.equalFilters ) {
temp = ts.filter.equalFilters( c, c.lastSearch, filter );
} else {
// quick n' dirty comparison... it will miss filter changes of
// the same value in a different column, see #1363
temp = ( c.lastSearch || [] ).join( '' ) !== ( filter || [] ).join( '' );
}
// don't set filters if they haven't changed
if ( !temp ) {
$.tablesorter.setFilters( table, filter, true );
}
}, 100 );
});
}

View File

@ -1,7 +1,7 @@
{
"name": "tablesorter",
"title": "tablesorter",
"version": "2.28.14",
"version": "2.28.15",
"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.28.14",
"version": "2.28.15",
"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",