Merge branch 'master' into gh-pages

This commit is contained in:
Rob Garrison 2017-05-03 17:25:42 -05:00
commit 8cc99d5873
18 changed files with 91 additions and 74 deletions

View File

@ -104,6 +104,17 @@ If you would like to contribute, please...
View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/Changes). View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/Changes).
#### <a name="v2.28.9">Version 2.28.9</a> (5/3/2017)
* Core:
* Fix widget option changes across multiple tables; seen in the second table of the math page demo with the `math_ignore` option.
* Docs:
* Add page header section to Math docs. See #1392.
* Fix misspelling.
* update jQuery.
* Math:
* Include noop `math_complete` in defaults; prevents option not recognized warning
#### <a name="v2.28.8">Version 2.28.8</a> (4/18/2017) #### <a name="v2.28.8">Version 2.28.8</a> (4/18/2017)
* Docs: * Docs:
@ -135,44 +146,3 @@ View the [complete change log here](https://github.com/Mottie/tablesorter/wiki/C
* Prevent JS error added from last update. Fixes [issue #1377](https://github.com/Mottie/tablesorter/issues/1377). * Prevent JS error added from last update. Fixes [issue #1377](https://github.com/Mottie/tablesorter/issues/1377).
* Meta: * Meta:
* Fix composer.json license. * Fix composer.json license.
#### <a name="v2.28.6">Version 2.28.6</a> (4/2/2017)
* Core:
* Prevent overwritting default `widgetOptions`. Fixes [issue #1356](https://github.com/Mottie/tablesorter/issues/1356).
* Fix method of saving default widgetOptions. See [issue #1356](https://github.com/Mottie/tablesorter/issues/1356).
* Update column count after reset.
* Add fix it (in Abelt) note for [issue #1362](https://github.com/Mottie/tablesorter/issues/1362).
* Update widgets after `sortReset`. Fixes [issue #1361](https://github.com/Mottie/tablesorter/issues/1361).
* The `applyWidget` callback now occurs after "tablesorter-ready" event
* Docs:
* Update jQuery to v3.2.0.
* Fix "update" labels from previous version.
* Add note about Excel & `output_encoding`. See [issue #1353](https://github.com/Mottie/tablesorter/issues/1353).
* Clarify parser & sorter class name differences.
* Add note about event binding after build widget completes. See [issue #1370](https://github.com/Mottie/tablesorter/issues/1370).
* Fixed linting issues.
* Add some internal links.
* Build:
* Stop build widget option warnings.
* Filter:
* Compare last search array (instead of a combined string). Fixes [issue #1363](https://github.com/Mottie/tablesorter/issues/1363).
* Output:
* Fixed CSV output when colspan &gt;3. See [PR #1373](https://github.com/Mottie/tablesorter/pull/1373); thanks [@ruchir19](https://github.com/ruchir19)!
* Pager:
* Fix "all" option to not set when the option doesn't exist. See [PR #1364](https://github.com/Mottie/tablesorter/pull/1364); thanks [@simenflatby](https://github.com/simenflatby)!
* Stop using combined filter values. See [issue #1363](https://github.com/Mottie/tablesorter/issues/1363).
* Use "all" only when the option exists. Fixes [#1364](https://github.com/Mottie/tablesorter/pull/1364) & [#1366](https://github.com/Mottie/tablesorter/issues/1366).
* Sort2Hash:
* Stop option warnings. Fixes [issue #1369](https://github.com/Mottie/tablesorter/issues/1369).
* Parsers:
* Add leading zero parser & [demo](https://mottie.github.io/tablesorter/docs/example-parsers-leading-zeros.html).
* Theme:
* Add CSS highlight file; copied from [the demo](https://mottie.github.io/tablesorter/docs/example-css-highlighting.html).
* Meta:
* Add `composer.json` file. Fixes [issue #1355](https://github.com/Mottie/tablesorter/issues/1355).
* Readme: Move questions section closer to the top.
* Update dependencies.
* Fix indentation & remove extra spaces.
* Remove cdnjs auto-update config - see [CDNJS #9080](https://github.com/cdnjs/cdnjs/pull/9080).
* Update SPDX license.

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 04-18-2017 (v2.28.8)*/ /*! tablesorter (FORK) - updated 05-03-2017 (v2.28.9)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) { (function(factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
@ -10,7 +10,7 @@
} }
}(function(jQuery) { }(function(jQuery) {
/*! TableSorter (FORK) v2.28.8 *//* /*! TableSorter (FORK) v2.28.9 *//*
* Client-side table sorting with ease! * Client-side table sorting with ease!
* @requires jQuery v1.2.6+ * @requires jQuery v1.2.6+
* *
@ -34,7 +34,7 @@
'use strict'; 'use strict';
var ts = $.tablesorter = { var ts = $.tablesorter = {
version : '2.28.8', version : '2.28.9',
parsers : [], parsers : [],
widgets : [], widgets : [],
@ -1943,7 +1943,7 @@
for ( indx = 0; indx < len; indx++ ) { for ( indx = 0; indx < len; indx++ ) {
widget = ts.getWidgetById( c.widgets[ indx ] ); widget = ts.getWidgetById( c.widgets[ indx ] );
if ( widget && widget.options ) { if ( widget && widget.options ) {
wo = $.extend( {}, widget.options ); wo = $.extend( true, {}, widget.options );
c.widgetOptions = $.extend( true, wo, c.widgetOptions ); c.widgetOptions = $.extend( true, wo, c.widgetOptions );
// add widgetOptions to defaults for option validator // add widgetOptions to defaults for option validator
$.extend( true, ts.defaults.widgetOptions, widget.options ); $.extend( true, ts.defaults.widgetOptions, widget.options );

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@
} }
}(function(jQuery) { }(function(jQuery) {
/*! TableSorter (FORK) v2.28.8 *//* /*! TableSorter (FORK) v2.28.9 *//*
* Client-side table sorting with ease! * Client-side table sorting with ease!
* @requires jQuery v1.2.6+ * @requires jQuery v1.2.6+
* *
@ -32,7 +32,7 @@
'use strict'; 'use strict';
var ts = $.tablesorter = { var ts = $.tablesorter = {
version : '2.28.8', version : '2.28.9',
parsers : [], parsers : [],
widgets : [], widgets : [],
@ -1941,7 +1941,7 @@
for ( indx = 0; indx < len; indx++ ) { for ( indx = 0; indx < len; indx++ ) {
widget = ts.getWidgetById( c.widgets[ indx ] ); widget = ts.getWidgetById( c.widgets[ indx ] );
if ( widget && widget.options ) { if ( widget && widget.options ) {
wo = $.extend( {}, widget.options ); wo = $.extend( true, {}, widget.options );
c.widgetOptions = $.extend( true, wo, c.widgetOptions ); c.widgetOptions = $.extend( true, wo, c.widgetOptions );
// add widgetOptions to defaults for option validator // add widgetOptions to defaults for option validator
$.extend( true, ts.defaults.widgetOptions, widget.options ); $.extend( true, ts.defaults.widgetOptions, widget.options );

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
/*! tablesorter (FORK) - updated 04-18-2017 (v2.28.8)*/ /*! tablesorter (FORK) - updated 05-03-2017 (v2.28.9)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) { (function(factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -806,6 +806,23 @@ BAD =&gt; No minus (-) here! $#,###.00 or [-] here either &lt;= BAD</textarea>
</tbody> </tbody>
</table></div> </table></div>
<h1>Page Header</h1>
<div>
<pre class="prettyprint lang-html">&lt;!-- load your chosen theme --&gt;
&lt;link rel=&quot;stylesheet&quot; href=&quot;css/theme.blue.css&quot;&gt;
&lt;!-- jQuery --&gt;
&lt;script src=&quot;js/jquery.min.js&quot;&gt;&lt;/script&gt;
&lt;!-- Tablesorter: required --&gt;
&lt;script src=&quot;js/jquery.tablesorter.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;js/widget-math.js&quot;&gt;&lt;/script&gt;
&lt;!-- load filter widget if needed --&gt;
&lt;script src=&quot;js/widget-filter.js&quot;&gt;&lt;/script&gt;</pre>
</div>
<h1>Javascript</h1> <h1>Javascript</h1>
<div id="javascript"> <div id="javascript">
<pre class="prettyprint lang-javascript"></pre> <pre class="prettyprint lang-javascript"></pre>

View File

@ -261,7 +261,7 @@
<pre class="prettyprint lang-css">content: attr(data-title);</pre> <pre class="prettyprint lang-css">content: attr(data-title);</pre>
The second method ignores the backslash and shows <code>"row1 \A row2"</code> The second method ignores the backslash and shows <code>"row1 \A row2"</code>
</li> </li>
<li><span class="label label-info">Update</span>: After some discussion in <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=988694">bugzilla</a>, I discovered that it is possible to add multiple lines of content usigin a data-attribute by setting a <code>white-space: pre;</code> css definition and using <code>&amp;#10</code> instead of <code>\A</code> (<a href="https://jsfiddle.net/96pwE/5/">demo</a>), but I think I'll keep the second reflow version because it actually allows styling.</li> <li><span class="label label-info">Update</span>: After some discussion in <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=988694">bugzilla</a>, I discovered that it is possible to add multiple lines of content using a data-attribute by setting a <code>white-space: pre;</code> css definition and using <code>&amp;#10</code> instead of <code>\A</code> (<a href="https://jsfiddle.net/96pwE/5/">demo</a>), but I think I'll keep the second reflow version because it actually allows styling.</li>
<li>Adding bold elements to every table tbody cell is the method used by jQuery Mobile; so, a second reflow widget "reflow2" was created to do the same, and work properly with a thead containing multiple rows.</li> <li>Adding bold elements to every table tbody cell is the method used by jQuery Mobile; so, a second reflow widget "reflow2" was created to do the same, and work properly with a thead containing multiple rows.</li>
</ul> </ul>
</li> </li>

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*/ */
/*! tablesorter (FORK) - updated 04-18-2017 (v2.28.8)*/ /*! tablesorter (FORK) - updated 05-03-2017 (v2.28.9)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) { (function(factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {
@ -16,7 +16,7 @@
} }
}(function(jQuery) { }(function(jQuery) {
/*! TableSorter (FORK) v2.28.8 *//* /*! TableSorter (FORK) v2.28.9 *//*
* Client-side table sorting with ease! * Client-side table sorting with ease!
* @requires jQuery v1.2.6+ * @requires jQuery v1.2.6+
* *
@ -40,7 +40,7 @@
'use strict'; 'use strict';
var ts = $.tablesorter = { var ts = $.tablesorter = {
version : '2.28.8', version : '2.28.9',
parsers : [], parsers : [],
widgets : [], widgets : [],
@ -1949,7 +1949,7 @@
for ( indx = 0; indx < len; indx++ ) { for ( indx = 0; indx < len; indx++ ) {
widget = ts.getWidgetById( c.widgets[ indx ] ); widget = ts.getWidgetById( c.widgets[ indx ] );
if ( widget && widget.options ) { if ( widget && widget.options ) {
wo = $.extend( {}, widget.options ); wo = $.extend( true, {}, widget.options );
c.widgetOptions = $.extend( true, wo, c.widgetOptions ); c.widgetOptions = $.extend( true, wo, c.widgetOptions );
// add widgetOptions to defaults for option validator // add widgetOptions to defaults for option validator
$.extend( true, ts.defaults.widgetOptions, widget.options ); $.extend( true, ts.defaults.widgetOptions, widget.options );

View File

@ -1,4 +1,4 @@
/*! TableSorter (FORK) v2.28.8 *//* /*! TableSorter (FORK) v2.28.9 *//*
* Client-side table sorting with ease! * Client-side table sorting with ease!
* @requires jQuery v1.2.6+ * @requires jQuery v1.2.6+
* *
@ -22,7 +22,7 @@
'use strict'; 'use strict';
var ts = $.tablesorter = { var ts = $.tablesorter = {
version : '2.28.8', version : '2.28.9',
parsers : [], parsers : [],
widgets : [], widgets : [],
@ -1931,7 +1931,7 @@
for ( indx = 0; indx < len; indx++ ) { for ( indx = 0; indx < len; indx++ ) {
widget = ts.getWidgetById( c.widgets[ indx ] ); widget = ts.getWidgetById( c.widgets[ indx ] );
if ( widget && widget.options ) { if ( widget && widget.options ) {
wo = $.extend( {}, widget.options ); wo = $.extend( true, {}, widget.options );
c.widgetOptions = $.extend( true, wo, c.widgetOptions ); c.widgetOptions = $.extend( true, wo, c.widgetOptions );
// add widgetOptions to defaults for option validator // add widgetOptions to defaults for option validator
$.extend( true, ts.defaults.widgetOptions, widget.options ); $.extend( true, ts.defaults.widgetOptions, widget.options );

View File

@ -4,7 +4,7 @@
*/ */
/*! tablesorter (FORK) - updated 04-18-2017 (v2.28.8)*/ /*! tablesorter (FORK) - updated 05-03-2017 (v2.28.9)*/
/* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */ /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
(function(factory) { (function(factory) {
if (typeof define === 'function' && define.amd) { if (typeof define === 'function' && define.amd) {

View File

@ -1,4 +1,4 @@
/*! Widget: math - updated 11/26/2016 (v2.28.0) *//* /*! Widget: math - updated 5/3/2017 (v2.28.9) *//*
* Requires tablesorter v2.16+ and jQuery 1.7+ * Requires tablesorter v2.16+ and jQuery 1.7+
* by Rob Garrison * by Rob Garrison
*/ */
@ -606,7 +606,7 @@
// complete executed after each fucntion // complete executed after each fucntion
math_complete : null, // function($cell, wo, result, value, arry){ return result; }, math_complete : null, // function($cell, wo, result, value, arry){ return result; },
// math_completed called after all math calculations have completed // math_completed called after all math calculations have completed
// math_completed : function( config ) {}, math_completed: function( config ) {},
// order of calculation; 'all' is last // order of calculation; 'all' is last
math_priority : [ 'row', 'above', 'below', 'col' ], math_priority : [ 'row', 'above', 'below', 'col' ],
// template for or just prepend the mask prefix & suffix with this HTML // template for or just prepend the mask prefix & suffix with this HTML

View File

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

View File

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

View File

@ -161,17 +161,37 @@ jQuery(function($){
}, },
undef, c1, c2, c3, c4, e, i, t; undef, c1, c2, c3, c4, e, i, t;
/* test widget */
ts.addWidget({
id : 'test',
options: {
'test': []
},
format: function() {}
});
$table1 $table1
.on('tablesorter-initialized', function(){ .on('tablesorter-initialized', function(){
init = true; init = true;
}) })
.tablesorter(); .tablesorter({
widgets: ['test'],
widgetOptions: {
// check widget option defaults across tables
test: [0,1]
}
});
$table2.tablesorter({ $table2.tablesorter({
headers: { headers: {
0: { sorter: 'text' }, 0: { sorter: 'text' },
1: { sorter: 'text' }, 1: { sorter: 'text' },
2: { sorter: false } 2: { sorter: false }
},
widgets: ['test'],
widgetOptions: {
// check widget option defaults across tables
test: [0]
} }
}); });
@ -182,7 +202,9 @@ jQuery(function($){
0: { empty : 'top' }, // sort empty cells to the top 0: { empty : 'top' }, // sort empty cells to the top
2: { string: 'min' }, // non-numeric content is treated as a MIN value 2: { string: 'min' }, // non-numeric content is treated as a MIN value
3: { sorter: 'digit', empty : 'zero', string : 'top' } 3: { sorter: 'digit', empty : 'zero', string : 'top' }
} },
// check widget option defaults across tables
widgets: ['test']
}); });
$table4.tablesorter({ $table4.tablesorter({
@ -907,6 +929,14 @@ jQuery(function($){
return t; return t;
}; };
QUnit.test( 'check widgetOption defaults across tables', function(assert) {
assert.expect(4);
assert.deepEqual(c1.widgetOptions.test, [0,1], 'widget option properly set');
assert.deepEqual(c2.widgetOptions.test, [0], 'widget option properly set');
assert.deepEqual(c3.widgetOptions.test, [], 'default widget option set on table');
assert.deepEqual(ts.defaults.widgetOptions.test, [], 'default widget option set in core');
});
QUnit.test( 'apply zebra widget', function(assert) { QUnit.test( 'apply zebra widget', function(assert) {
assert.expect(3); assert.expect(3);
assert.equal( zebra(), false, 'zebra not applied' ); assert.equal( zebra(), false, 'zebra not applied' );