diff --git a/README.md b/README.md index 9a2b652a..b7cd8421 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,81 @@ tablesorter can successfully parse and sort many types of data including linked View the [complete listing here](//github.com/Mottie/tablesorter/wiki/Changes). +#### Version 2.18.0 (10/26/2014) + +* Core + * Move "ipAddress" parser into `parser-network.js` parser file. + * Add "image" parser to core. + * Add `widgetClass` option + * Allows adding widgets to the table by adding a table class name. + * Fix debug logs for applying widgets. + * Fixes [issue #743](https://github.com/Mottie/tablesorter/issues/743). + * Add `$cell` parameter to parser detection `is` function (`is: function(s, table, cell, $cell) { /* ... */ }`). + * Add `$table` parameter to `onRenderHeader` function (`onRenderHeader: function (index, config, $table){ /* ... */ }`). + * Fix ARIA caption label reference. + * Get column index from data-attribute when sorting. + * The `aria-labelledby` attribute is no longer to all nested captions. + * Update `widgetClass` option matching. See [issue #743](https://github.com/Mottie/tablesorter/issues/743). +* Themes + * Include caption element in metro theme; update various demo theme selectors to include the metro theme. + * Fix zebra striping in nested tables. +* Parsers + * Created `parser-network.js` parser + * Removed "ipAddress" parser from core. + * Move "ipAddress" parser into this file; a duplicate of the parser named "ipv4Address" is included. + * Moved "ipv6Address" parser into this file. + * Added new MAC parser. + * Update all date parsers to ensure a valid date is being parsed. + * Add named number parser & demo. +* Column Selector widget + * Prevent adding a media query when no priorities are set. + * `col` element will now be hidden along with the column. Fixes [issues #740](https://github.com/Mottie/tablesorter/issues/740). +* Editable widget + * Make updatable so this widget works with the pager. Fixes [issue #732](https://github.com/Mottie/tablesorter/issues/732). +* Filter widget + * Fix wildcard match logic to behave logically. Fixes [issue #727](https://github.com/Mottie/tablesorter/issues/727). + * Add `filter_cellFilter` option. Fixes [issue #731](https://github.com/Mottie/tablesorter/issues/731). + * External inputs can now target multiple columns (e.g. `data-column="0-2,4,6-7"`); see [this Stackoverflow question](http://stackoverflow.com/q/26470602/145346). + * Any match filters now properly uses `filter_ignoreCase`. Fixes [issue #748](https://github.com/Mottie/tablesorter/issues/748). + * Fix saved filter updates to multiple or "any" column inputs. +* Grouping widget + * Add "monthyear" grouping to dates. Fixes [issue #744](https://github.com/Mottie/tablesorter/issues/744). +* Pager addon & widget + * Use a sample of page number links for large collections. + * Add `maxOptionSize` option + * Tweak code & fix problems introduces in [pull #711](https://github.com/Mottie/tablesorter/pull/711). + * Thanks [camallen](https://github.com/camallen)! + * Fix ouput display not updating on initialization. + * Add url check to allow ajax updating of table. Fixes [issue #730](https://github.com/Mottie/tablesorter/issues/730). + * Check for dynamically changing `ajaxUrl` option. + * Add `ajaxObject` to the `table.config.pager` variable. + * IE requires a value attribute for every option. Fixes [issue #734](https://github.com/Mottie/tablesorter/issues/734). + * Revert some code modified for large collections to use jQuery instead of native javascript (more IE issues). + * Ensure `pager.filteredRows` is current on page move. See [issue #745](https://github.com/Mottie/tablesorter/issues/745). + * Fix empty table select showing 0 & 1 pages. + * The `fixedHeight` option is now working properly. Fixes [issue #742](https://github.com/Mottie/tablesorter/issues/742) & [issue #729](https://github.com/Mottie/tablesorter/issues/729). + * Widget cleanup & only use the last search data. + * Add note about including an ajax `success` function within the `ajaxObject` definition. See [issue #749](https://github.com/Mottie/tablesorter/issues/749). +* RepeatHeaders widget + * Now works with filtered & nested tables. +* Resizable widget + * Make it work inside of an overflow container. Fixes [issue #737](https://github.com/Mottie/tablesorter/issues/737). +* Scroller widget + * Remove `scroller_idPrefix` in lieu of a unique namespace id. +* StickyHeaders widget + * Now stacks when within a nested table. + * Wrapped sticky header components (`thead` & `caption`) in a sticky div. + * Added `stickyHeaders_xScroll` and `stickyHeaders_yScroll` options. + * Removed jQuery UI selection from the demo to allow the accordion to be properly themed. +* CssStickyHeaders widget + * Now stacks when within a nested table. + * Removed `cssStickyHeaders_zIndex` option as the widget no longer uses relative positioning (it wasn't necessary) + * Please note that **using this widget on nested tables does not work properly in ALL versions of IE** (including IE11). +* UITheme + * Ignore nested tables. + * Add method to remove previous theme. + * Fix multiple header row sort icons. + #### Version 2.17.8 (9/15/2014) * Core @@ -115,44 +190,3 @@ View the [complete listing here](//github.com/Mottie/tablesorter/wiki/Changes). * Core: Do not detach rows before appending to prevent ajax rows from disappearing. Fixes [issue #701](//github.com/Mottie/tablesorter/issues/701). * Docs: Fix change log links. * Filter: attached external select causing javascript errors. Fixes [issue #702](//github.com/Mottie/tablesorter/issues/702) - -#### Version 2.17.6 (8/1/2014) - -* Core - * Adding a class name of `parser-false` to a column will now automatically set `sorter-false` and `filter-false` behavior. - * Add extractor type which allows giving a column two parsers, one to extract content from an input/select and the second to parse the extracted text. Thanks to [TheSin-](//github.com/TheSin-)! - * Ensure custom parsed data adheres to the `ignoreCase` option. - * Add a delay to any sort if there is an update in progress. This prevents issues with a sort being applied causing duplicate rows to be added to the table, hopefully. - * The `widthFixed` option now finds both visible `th` and `td` cells within the first row of the tbody to set column width percentages. - * Ensure all rows have a set role for screen readers (`role="row"`). Fixes [issue #690](//github.com/Mottie/tablesorter/issues/690). - * Redefine `c.$headers` when building headers for new/replaced header cells (not just content). Fixes [issue #683](//github.com/Mottie/tablesorter/issues/683). -* Docs - * Fixed lots of minor HTML issues (e.g. missing closing `` & `
` tags)
-* Parsers
- * Add parser for textareas within the `parser-input-select.js` file.
- * Modify input & textarea parser to only update the table cache when:
- * The user presses enter (input) or alt + enter (textarea) within the element.
- * When the element is blurred.
- * Or, when the mouse leaves the tbody.
-* Editable
- * Add two new options:
- * `editable_autoAccept`: accepts any changes made to the table cell automatically (`true` by default)
- * `editable_validate`: a function used to validate the changes; return a valid string (`null` by default)
- * Modify `editable_columns` type check to prevent javascript errors. See [pull #688](//github.com/Mottie/tablesorter/issues/688). Thanks [scratcher28](//github.com/scratcher28)!
- * Limit the `editable_columns` array value to columns within the table.
-* Filter
- * Make all options show within the current select when the `filter-onlyAvail` class is set on a column.
- * Updated & added docs for `$.tablesorter.filter.buildSelect` function to allow external calls to modify filter select options.
- * Update `filter_selectSource` to accept arrays instead of a function. This was documented as working, but it wasn't coded until now. Sorry!
- * Add `filter_selectSourceSeparator` option:
- * Include a separator within the `filter_selectSource` array (e.g. "a-z|A through Z").
- * The text that is left of the separator is added to the option value, the the text on the right is added to the option text.
- * So `"a-z|A through Z"` becomes ``.
- * Fixes [issue #692](//github.com/Mottie/tablesorter/issues/692).
- * Add `role="row"` to the filter row. Fixes [issue #697](//github.com/Mottie/tablesorter/issues/697).
- * Any match inputs now follow the `filter_startsWith` setting. See [this Stackoverflow](//stackoverflow.com/q/25070448/145346) question.
-* Pager
- * The `ouput` option can now include user modifiable `startRow` (`{startRow:input}`) or `page` (`{page:input}`) inputs within the output.
- * Remove selected attribute from page selector options. Fixes [issue #700](//github.com/Mottie/tablesorter/issues/700).
-* Resizable
- * Update `$.tablesorter.addHeaderResizeEvent` function's first parameter `table` to accept table DOM elements as well as jQuery objects. Fixes [issue #687](//github.com/Mottie/tablesorter/issues/687).
diff --git a/addons/pager/jquery.tablesorter.pager.js b/addons/pager/jquery.tablesorter.pager.js
index ec7535b7..ad9f79d7 100644
--- a/addons/pager/jquery.tablesorter.pager.js
+++ b/addons/pager/jquery.tablesorter.pager.js
@@ -1,6 +1,6 @@
/*!
* tablesorter pager plugin
- * updated 9/15/2014 (v2.17.8)
+ * updated 10/26/2014 (v2.18.0)
*/
/*jshint browser:true, jquery:true, unused:false */
;(function($) {
diff --git a/addons/pager/jquery.tablesorter.pager.min.js b/addons/pager/jquery.tablesorter.pager.min.js
index ef9a49b9..9a1b5af9 100644
--- a/addons/pager/jquery.tablesorter.pager.min.js
+++ b/addons/pager/jquery.tablesorter.pager.min.js
@@ -1,2 +1,2 @@
-/* tablesorter pager plugin updated 9/15/2014 (v2.17.8) */
-;(function(h){var k=h.tablesorter;h.extend({tablesorterPager:new function(){this.defaults={container:null,ajaxUrl:null,customAjaxUrl:function(b,a){return a},ajaxObject:{dataType:"json"},processAjaxOnInit:!0,ajaxProcessing:function(b){return[0,[],null]},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:!0,page:0,pageReset:0,size:10,savePages:!0,storageKey:"tablesorter-pager",fixedHeight:!1,countChildRows:!1,removeRows:!1,cssFirst:".first",cssPrev:".prev",cssNext:".next",cssLast:".last", cssGoto:".gotoPage",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize",cssErrorRow:"tablesorter-errorRow",cssDisabled:"disabled",totalRows:0,totalPages:0,filteredRows:0,filteredPages:0,ajaxCounter:0,currentFilters:[],startRow:0,endRow:0,$size:null,last:{}};var w=this,p=function(b,a){var d=b.cssDisabled,f=!!a,g=f||0===b.page,e=Math.min(b.totalPages,b.filteredPages),f=f||b.page===e-1||0===e;b.updateArrows&&(b.$container.find(b.cssFirst+","+b.cssPrev)[g?"addClass":"removeClass"](d).attr("aria-disabled", g),b.$container.find(b.cssNext+","+b.cssLast)[f?"addClass":"removeClass"](d).attr("aria-disabled",f))},t=function(b,a,d){var f,g,e,l,c=b.config;l=c.$table.hasClass("hasFilters");e=[];f=a.size||10;e=[c.widgetOptions&&c.widgetOptions.filter_filteredRow||"filtered",c.selectorRemove.replace(/^(\w+\.)/g,"")];a.countChildRows&&e.push(c.cssChildRow);e.join("|");l&&!a.ajaxUrl?h.isEmptyObject(c.cache)?a.filteredRows=a.totalRows=c.$tbodies.eq(0).children("tr").not(a.countChildRows?"":"."+c.cssChildRow).length: (a.filteredRows=0,h.each(c.cache[0].normalized,function(b,d){a.filteredRows+=a.regexRows.test(d[c.columns].$row[0].className)?0:1})):l||(a.filteredRows=a.totalRows);a.totalPages=Math.ceil(a.totalRows/f);c.totalRows=a.totalRows;c.filteredRows=a.filteredRows;a.filteredPages=Math.ceil(a.filteredRows/f)||0;if(0<=Math.min(a.totalPages,a.filteredPages)&&(e=a.size*a.page>a.filteredRows,a.startRow=e?1:0===a.filteredRows?0:a.size*a.page+1,a.page=e?0:a.page,a.endRow=Math.min(a.filteredRows,a.totalRows,a.size* (a.page+1)),l=a.$container.find(a.cssPageDisplay),e=(a.ajaxData&&a.ajaxData.output?a.ajaxData.output||a.output:a.output).replace(/\{page([\-+]\d+)?\}/gi,function(c,b){return a.totalPages?a.page+(b?parseInt(b,10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(c){var b,d;b=c.replace(/[{}\s]/g,"");c=b.split(":");d=a.ajaxData;var e=/(rows?|pages?)$/i.test(b)?0:"";return/(startRow|page)/.test(c[0])&&"input"===c[1]?(b=(""+("page"===c[0]?a.totalPages:a.totalRows)).length,d="page"===c[0]?a.page+1:a.startRow, ''):1 k.inArray(a,G)&&(x=b(q,m),null!==x))return B=x,!1}),null!==B?w=B:(m.exact=(m.iExact+m.childRowText).indexOf(c.filter.parseFilter(q,m.iFilter,p,m.parsed[p])),w=!u.filter_startsWith&&0<=m.exact||u.filter_startsWith&&0===m.exact)),v=w?v:!1);f.eq(h).toggle(v).toggleClass(u.filter_filteredRow,!v); s.length&&s.toggleClass(u.filter_filteredRow,!v)}}q.filteredRows+=f.not("."+u.filter_filteredRow).length;q.totalRows+=f.length;c.processTbody(d,n,!1)}q.lastCombinedFilter=b;q.lastSearch=a;q.$table.data("lastSearch",a);u.filter_saveFilters&&c.storage&&c.storage(d,"tablesorter-filters",a);q.debug&&c.benchmark("Completed filter widget search",A);u.filter_initialized&&q.$table.trigger("filterEnd",q);setTimeout(function(){q.$table.trigger("applyWidgets")},0)}},getOptionSource:function(d,a,b){var e,f=d.config, h=[],g=!1,n=f.widgetOptions.filter_selectSource,l=f.$table.data("lastSearch")||[],r=k.isFunction(n)?!0:c.getColumnData(d,n,a);b&&""!==l[a]&&(b=!1);if(!0===r)g=n(d,a,b);else{if(r instanceof k||"string"===k.type(r)&&0<=r.indexOf(""))return r;k.isArray(r)?g=r:"object"===k.type(n)&&r&&(g=r(d,a,b))}!1===g&&(g=c.filter.getOptions(d,a,b));g=k.grep(g,function(a,b){return k.inArray(a,g)===b});f.$headers.filter('[data-column="'+a+'"]:last').hasClass("filter-select-nosort")||(k.each(g,function(b,c){h.push({t:c, p:f.parsers&&f.parsers[a].format(c,d,[],a)})}),e=f.textSorter||"",h.sort(function(b,f){var g=b.p.toString(),h=f.p.toString();return k.isFunction(e)?e(g,h,!0,a,d):"object"===typeof e&&e.hasOwnProperty(a)?e[a](g,h,!0,a,d):c.sortNatural?c.sortNatural(g,h):!0}),g=[],k.each(h,function(a,b){g.push(b.t)}));return g},getOptions:function(c,a,b){var e,f,h,g,n=c.config,l=n.widgetOptions,r=n.$table.children("tbody"),p=[];for(e=0;en&&l<=s&&(l++,f.append(a[g]))),g++;k.processTbody(b,f,!1)}else v(b,d);t(b, d);d.isDisabled||u(b,d);b.isUpdating&&c.trigger("updateComplete",[b,!0])}},E=function(b,a){a.ajax?p(a,!0):(a.isDisabled=!0,h.data(b,"pagerLastPage",a.page),h.data(b,"pagerLastSize",a.size),a.page=0,a.size=a.totalRows,a.totalPages=1,h(b).addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),x(b,b.config.rowsCopy,a),h(b).trigger("applyWidgets"),b.config.debug&&k.log("pager disabled"));a.$size.add(a.$goto).add(a.$container.find(".ts-startRow, .ts-page")).each(function(){h(this).attr("aria-disabled", "true").addClass(a.cssDisabled)[0].disabled=!0})},y=function(b){var a=b.config,d=a.pager;a.$table.trigger("updateCache",[function(){var f,g=[],e=b.config.cache[0].normalized;d.totalRows=e.length;for(f=0;f ")).click(function(){h(this).remove()}).appendTo(k.$table.find("thead:first")).addClass(u+" "+k.selectorRemove.replace(/^(\w+\.)/g,"")).attr({role:"alert","aria-live":"assertive"}))})};h.fn.extend({tablesorterPager:h.tablesorterPager.construct})})(jQuery);
+/* tablesorter pager plugin updated 10/26/2014 (v2.18.0) */
+;(function(h){var k=h.tablesorter;h.extend({tablesorterPager:new function(){this.defaults={container:null,ajaxUrl:null,customAjaxUrl:function(c,a){return a},ajaxObject:{dataType:"json"},processAjaxOnInit:!0,ajaxProcessing:function(c){return[0,[],null]},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:!0,page:0,pageReset:0,size:10,maxOptionSize:20,savePages:!0,storageKey:"tablesorter-pager",fixedHeight:!1,countChildRows:!1,removeRows:!1,cssFirst:".first",cssPrev:".prev",cssNext:".next", cssLast:".last",cssGoto:".gotoPage",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize",cssErrorRow:"tablesorter-errorRow",cssDisabled:"disabled",totalRows:0,totalPages:0,filteredRows:0,filteredPages:0,ajaxCounter:0,currentFilters:[],startRow:0,endRow:0,$size:null,last:{}};var w=this,u=function(c,a){var b=c.cssDisabled,e=!!a,f=e||0===c.page,g=Math.min(c.totalPages,c.filteredPages),e=e||c.page===g-1||0===g;c.updateArrows&&(c.$container.find(c.cssFirst+","+c.cssPrev)[f?"addClass":"removeClass"](b).attr("aria-disabled", f),c.$container.find(c.cssNext+","+c.cssLast)[e?"addClass":"removeClass"](b).attr("aria-disabled",e))},p=function(c,a){var b=c.config,e=b.$table.hasClass("hasFilters");e&&!a.ajaxUrl?h.isEmptyObject(b.cache)?a.filteredRows=a.totalRows=b.$tbodies.eq(0).children("tr").not(a.countChildRows?"":"."+b.cssChildRow).length:(a.filteredRows=0,h.each(b.cache[0].normalized,function(c,e){a.filteredRows+=a.regexRows.test(e[b.columns].$row[0].className)?0:1})):e||(a.filteredRows=a.totalRows)},t=function(c,a,b){if(a.initialized){var e, f,g,l=c.config;e=a.size||10;a.countChildRows&&f.push(l.cssChildRow);a.totalPages=Math.ceil(a.totalRows/e);l.totalRows=a.totalRows;p(c,a);l.filteredRows=a.filteredRows;a.filteredPages=Math.ceil(a.filteredRows/e)||0;0<=Math.min(a.totalPages,a.filteredPages)&&(f=a.size*a.page>a.filteredRows,a.startRow=f?1:0===a.filteredRows?0:a.size*a.page+1,a.page=f?0:a.page,a.endRow=Math.min(a.filteredRows,a.totalRows,a.size*(a.page+1)),g=a.$container.find(a.cssPageDisplay),e=(a.ajaxData&&a.ajaxData.output?a.ajaxData.output|| a.output:a.output).replace(/\{page([\-+]\d+)?\}/gi,function(d,b){return a.totalPages?a.page+(b?parseInt(b,10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(d){var b,c;b=d.replace(/[{}\s]/g,"");d=b.split(":");c=a.ajaxData;var e=/(rows?|pages?)$/i.test(b)?0:"";return/(startRow|page)/.test(d[0])&&"input"===d[1]?(b=(""+("page"===d[0]?a.totalPages:a.totalRows)).length,c="page"===d[0]?a.page+1:a.startRow,''):1'+p+" ');b=e.children("tr").eq(0).height()*a.size;h.data(c,"pagerSavedHeight",b);C(c,a);h.data(c,"pagerLastSize",a.size)},v=function(c,a){if(!a.ajaxUrl){var b,e=0,f=c.config,g=f.$tbodies.eq(0).children("tr"),h=g.length,d=a.page*a.size,m=d+a.size,s=f.widgetOptions&& f.widgetOptions.filter_filteredRow||"filtered",r=0;for(b=0;b  ")).click(function(){h(this).remove()}).appendTo(k.$table.find("thead:first")).addClass(t+ " "+k.selectorRemove.replace(/^(\w+\.)/g,"")).attr({role:"alert","aria-live":"assertive"}))})};h.fn.extend({tablesorterPager:h.tablesorterPager.construct})})(jQuery);
diff --git a/js/jquery.tablesorter.js b/js/jquery.tablesorter.js
index 11e44ed5..1fdc8ee2 100644
--- a/js/jquery.tablesorter.js
+++ b/js/jquery.tablesorter.js
@@ -1,5 +1,5 @@
/**!
-* TableSorter 2.17.8 - Client-side table sorting with ease!
+* TableSorter 2.18.0 - Client-side table sorting with ease!
* @requires jQuery v1.2.6+
*
* Copyright (c) 2007 Christian Bach
@@ -24,7 +24,7 @@
var ts = this;
- ts.version = "2.17.8";
+ ts.version = "2.18.0";
ts.parsers = [];
ts.widgets = [];
diff --git a/js/jquery.tablesorter.min.js b/js/jquery.tablesorter.min.js
index e20f0114..0449400b 100644
--- a/js/jquery.tablesorter.min.js
+++ b/js/jquery.tablesorter.min.js
@@ -1,5 +1,5 @@
/*!
-* TableSorter 2.17.8 min - Client-side table sorting with ease!
+* TableSorter 2.18.0 min - Client-side table sorting with ease!
* Copyright (c) 2007 Christian Bach
*/
-!function(h){h.extend({tablesorter:new function(){function d(){var b=arguments[0],a=1'+u+" ");a.$filters=k(g+"").appendTo(a.$table.children("thead").eq(0)).find("td");for(f=0;f