jquery-tablesorter 1.23.7 → 1.23.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5226e025d2a88ae7018955827c4e95e4125beb3e
4
- data.tar.gz: 827cca9a9f4cce7526d6e6f13d4bc68f4ab37815
3
+ metadata.gz: 63a032c41e735674612068809224ec4c0f4c96da
4
+ data.tar.gz: 75d23fe18e33d749088e2a8e5b272eb1a4bc76ee
5
5
  SHA512:
6
- metadata.gz: e3070f5226707bfd568e4f927786228ecdcc8a5699f82cf769b91b142c2615fc7664ff666e94cb4984adfda57c08e65657a6ae897582c6ee7642f26df73aa8ac
7
- data.tar.gz: 6e986ca5e3f9c3bda9969b274fec6c010df2c59f27b309b07094bf610e0d48c590f688270b0d0d74322b62ff6a5bb94c58c70b51e925dc9a7af015a2a4e29620
6
+ metadata.gz: 782f08009bdadcd9f2e4793e58c21059d21fd6a6dc5a1c43c5f3d925e5c658d002845ba09a4302a07e8e80b8998c21962c7a2818e007cfa7d6348ef66642ad08
7
+ data.tar.gz: 3530f579dbc761cb359587678766b3accd21137ff929c10172bb5394787c9feaba2d06223f1faf301b21eb11792e9e9eb660dbbf712019e4b1ad1fc5ce56c189
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Simple integration of jQuery tablesorter ([Mottie's fork]) into the asset pipeline.
6
6
 
7
- Current tablesorter version: 2.28.7 (4/4/2017), [documentation]
7
+ Current tablesorter version: 2.28.8 (4/18/2017), [documentation]
8
8
 
9
9
  Any issue associated with the js/css files, please report to [Mottie's fork].
10
10
 
@@ -24,7 +24,7 @@ Or install it yourself as:
24
24
 
25
25
  ## Requirements
26
26
 
27
- It should work with Rails 3.2 and higher (tested up to 5) as well as with ruby 1.9.3 - 2.3.x.
27
+ It should work with Rails 3.2 and higher (tested up to 5) as well as with ruby 1.9.3 - 2.4.x.
28
28
  Each release is always tested with the latest version of both.
29
29
 
30
30
  ## Usage
@@ -1,7 +1,7 @@
1
1
  module JqueryTablesorter
2
2
  MAJOR = 1
3
3
  MINOR = 23
4
- TINY = 7
4
+ TINY = 8
5
5
 
6
6
  VERSION = [MAJOR, MINOR, TINY].compact.join('.')
7
7
  end
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * tablesorter (FORK) pager plugin
3
- * updated 4/2/2017 (v2.28.6)
3
+ * updated 4/18/2017 (v2.28.8)
4
4
  */
5
5
  /*jshint browser:true, jquery:true, unused:false */
6
6
  ;(function($) {
@@ -968,11 +968,15 @@
968
968
  .unbind( pagerEvents.split(' ').join(namespace + ' ').replace(/\s+/g, ' ') )
969
969
  .bind('filterInit filterStart '.split(' ').join(namespace + ' '), function(e, filters) {
970
970
  p.currentFilters = $.isArray(filters) ? filters : c.$table.data('lastSearch');
971
+ var filtersEqual;
972
+ if (ts.filter.equalFilters) {
973
+ filtersEqual = ts.filter.equalFilters(c, c.lastSearch, p.currentFilters);
974
+ } else {
975
+ // will miss filter changes of the same value in a different column, see #1363
976
+ filtersEqual = (c.lastSearch || []).join('') !== (p.currentFilters || []).join('');
977
+ }
971
978
  // don't change page if filters are the same (pager updating, etc)
972
- if (
973
- e.type === 'filterStart' &&
974
- p.pageReset !== false &&
975
- (c.lastSearch || []).join(',') !== (p.currentFilters || []).join(',')) {
979
+ if (e.type === 'filterStart' && p.pageReset !== false && !filtersEqual) {
976
980
  p.page = p.pageReset; // fixes #456 & #565
977
981
  }
978
982
  })
@@ -4,7 +4,7 @@
4
4
  ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
5
5
  █████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
6
6
  */
7
- /*! tablesorter (FORK) - updated 04-04-2017 (v2.28.7)*/
7
+ /*! tablesorter (FORK) - updated 04-18-2017 (v2.28.8)*/
8
8
  /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
9
9
  (function(factory) {
10
10
  if (typeof define === 'function' && define.amd) {
@@ -16,7 +16,7 @@
16
16
  }
17
17
  }(function(jQuery) {
18
18
 
19
- /*! TableSorter (FORK) v2.28.7 *//*
19
+ /*! TableSorter (FORK) v2.28.8 *//*
20
20
  * Client-side table sorting with ease!
21
21
  * @requires jQuery v1.2.6+
22
22
  *
@@ -40,7 +40,7 @@
40
40
  'use strict';
41
41
  var ts = $.tablesorter = {
42
42
 
43
- version : '2.28.7',
43
+ version : '2.28.8',
44
44
 
45
45
  parsers : [],
46
46
  widgets : [],
@@ -1325,7 +1325,7 @@
1325
1325
  cell = $cell[ 0 ]; // in case cell is a jQuery object
1326
1326
  // tbody may not exist if update is initialized while tbody is removed for processing
1327
1327
  if ( $tbodies.length && tbodyIndex >= 0 ) {
1328
- row = $tbodies.eq( tbodyIndex ).find( 'tr' ).index( $row );
1328
+ row = $tbodies.eq( tbodyIndex ).find( 'tr' ).not( '.' + c.cssChildRow ).index( $row );
1329
1329
  cache = tbcache.normalized[ row ];
1330
1330
  len = $row[ 0 ].cells.length;
1331
1331
  if ( len !== c.columns ) {
@@ -1346,7 +1346,6 @@
1346
1346
  cache[ c.columns ].raw[ icell ] = tmp;
1347
1347
  tmp = ts.getParsedText( c, cell, icell, tmp );
1348
1348
  cache[ icell ] = tmp; // parsed
1349
- cache[ c.columns ].$row = $row;
1350
1349
  if ( ( c.parsers[ icell ].type || '' ).toLowerCase() === 'numeric' ) {
1351
1350
  // update column max value (ignore sign)
1352
1351
  tbcache.colMax[ icell ] = Math.max( Math.abs( tmp ) || 0, tbcache.colMax[ icell ] || 0 );
@@ -2827,12 +2826,26 @@
2827
2826
 
2828
2827
  })( jQuery );
2829
2828
 
2830
- /*! Widget: storage - updated 11/26/2016 (v2.28.0) */
2829
+ /*! Widget: storage - updated 4/18/2017 (v2.28.8) */
2831
2830
  /*global JSON:false */
2832
2831
  ;(function ($, window, document) {
2833
2832
  'use strict';
2834
2833
 
2835
2834
  var ts = $.tablesorter || {};
2835
+
2836
+ // update defaults for validator; these values must be falsy!
2837
+ $.extend(true, ts.defaults, {
2838
+ fixedUrl: '',
2839
+ widgetOptions: {
2840
+ storage_fixedUrl: '',
2841
+ storage_group: '',
2842
+ storage_page: '',
2843
+ storage_storageType: '',
2844
+ storage_tableId: '',
2845
+ storage_useSessionStorage: ''
2846
+ }
2847
+ });
2848
+
2836
2849
  // *** Store data in local storage, with a cookie fallback ***
2837
2850
  /* IE7 needs JSON library for JSON.stringify - (http://caniuse.com/#search=json)
2838
2851
  if you need it, then include https://github.com/douglascrockford/JSON-js
@@ -2859,8 +2872,12 @@
2859
2872
  values = {},
2860
2873
  c = table.config,
2861
2874
  wo = c && c.widgetOptions,
2862
- storageType = ( options && options.useSessionStorage ) || ( wo && wo.storage_useSessionStorage ) ?
2863
- 'sessionStorage' : 'localStorage',
2875
+ storageType = (
2876
+ ( options && options.storageType ) || ( wo && wo.storage_storageType )
2877
+ ).toString().charAt(0).toLowerCase(),
2878
+ // deprecating "useSessionStorage"; any storageType setting overrides it
2879
+ session = storageType ? '' :
2880
+ ( options && options.useSessionStorage ) || ( wo && wo.storage_useSessionStorage ),
2864
2881
  $table = $(table),
2865
2882
  // id from (1) options ID, (2) table 'data-table-group' attribute, (3) widgetOptions.storage_tableId,
2866
2883
  // (4) table ID, then (5) table index
@@ -2872,29 +2889,26 @@
2872
2889
  url = options && options.url ||
2873
2890
  $table.attr(options && options.page || wo && wo.storage_page || 'data-table-page') ||
2874
2891
  wo && wo.storage_fixedUrl || c && c.fixedUrl || window.location.pathname;
2875
- // update defaults for validator; these values must be falsy!
2876
- $.extend(true, ts.defaults, {
2877
- fixedUrl: '',
2878
- widgetOptions: {
2879
- storage_fixedUrl: '',
2880
- storage_group: '',
2881
- storage_page: '',
2882
- storage_tableId: '',
2883
- storage_useSessionStorage: ''
2884
- }
2885
- });
2886
- // https://gist.github.com/paulirish/5558557
2887
- if (storageType in window) {
2888
- try {
2889
- window[storageType].setItem('_tmptest', 'temp');
2890
- hasStorage = true;
2891
- window[storageType].removeItem('_tmptest');
2892
- } catch (error) {
2893
- if (c && c.debug) {
2894
- console.warn( storageType + ' is not supported in this browser' );
2892
+
2893
+ // skip if using cookies
2894
+ if (storageType !== 'c') {
2895
+ storageType = (storageType === 's' || session) ? 'sessionStorage' : 'localStorage';
2896
+ // https://gist.github.com/paulirish/5558557
2897
+ if (storageType in window) {
2898
+ try {
2899
+ window[storageType].setItem('_tmptest', 'temp');
2900
+ hasStorage = true;
2901
+ window[storageType].removeItem('_tmptest');
2902
+ } catch (error) {
2903
+ if (c && c.debug) {
2904
+ console.warn( storageType + ' is not supported in this browser' );
2905
+ }
2895
2906
  }
2896
2907
  }
2897
2908
  }
2909
+ if (c.debug) {
2910
+ console.log('Storage widget using', hasStorage ? storageType : 'cookies');
2911
+ }
2898
2912
  // *** get value ***
2899
2913
  if ($.parseJSON) {
2900
2914
  if (hasStorage) {
@@ -3204,7 +3218,7 @@
3204
3218
 
3205
3219
  })(jQuery);
3206
3220
 
3207
- /*! Widget: filter - updated 4/4/2017 (v2.28.7) *//*
3221
+ /*! Widget: filter - updated 4/18/2017 (v2.28.8) *//*
3208
3222
  * Requires tablesorter v2.8+ and jQuery 1.7+
3209
3223
  * by Rob Garrison
3210
3224
  */
@@ -4091,6 +4105,19 @@
4091
4105
  tsf.checkFilters( table, filter, skipFirst );
4092
4106
  }
4093
4107
  },
4108
+ equalFilters: function (c, filter1, filter2) {
4109
+ var indx,
4110
+ f1 = [],
4111
+ f2 = [],
4112
+ len = c.columns + 1; // add one to include anyMatch filter
4113
+ filter1 = $.isArray(filter1) ? filter1 : [];
4114
+ filter2 = $.isArray(filter2) ? filter2 : [];
4115
+ for (indx = 0; indx < len; indx++) {
4116
+ f1[indx] = filter1[indx] || '';
4117
+ f2[indx] = filter2[indx] || '';
4118
+ }
4119
+ return f1.join(',') === f2.join(',');
4120
+ },
4094
4121
  checkFilters: function( table, filter, skipFirst ) {
4095
4122
  var c = table.config,
4096
4123
  wo = c.widgetOptions,
@@ -4123,7 +4150,7 @@
4123
4150
  }
4124
4151
  // return if the last search is the same; but filter === false when updating the search
4125
4152
  // see example-widget-filter.html filter toggle buttons
4126
- if ( c.lastSearch.join(',') === currentFilters.join(',') && filter !== false ) {
4153
+ if ( tsf.equalFilters(c, c.lastSearch, currentFilters) && filter !== false ) {
4127
4154
  return;
4128
4155
  } else if ( filter === false ) {
4129
4156
  // force filter refresh
@@ -4472,7 +4499,7 @@
4472
4499
  },
4473
4500
  findRows: function( table, filters, currentFilters ) {
4474
4501
  if (
4475
- table.config.lastSearch.join(',') === ( currentFilters || [] ).join(',') ||
4502
+ tsf.equalFilters(table.config, table.config.lastSearch, currentFilters) ||
4476
4503
  !table.config.widgetOptions.filter_initialized
4477
4504
  ) {
4478
4505
  return;
@@ -5017,7 +5044,8 @@
5017
5044
  if ( ( getRaw !== true && wo && !wo.filter_columnFilters ) ||
5018
5045
  // setFilters called, but last search is exactly the same as the current
5019
5046
  // fixes issue #733 & #903 where calling update causes the input values to reset
5020
- ( $.isArray(setFilters) && setFilters.join(',') === c.lastSearch.join(',') ) ) {
5047
+ ( $.isArray(setFilters) && tsf.equalFilters(c, setFilters, c.lastSearch) )
5048
+ ) {
5021
5049
  return $( table ).data( 'lastSearch' ) || [];
5022
5050
  }
5023
5051
  if ( c ) {
@@ -5402,7 +5430,7 @@
5402
5430
 
5403
5431
  })(jQuery, window);
5404
5432
 
5405
- /*! Widget: resizable - updated 1/28/2017 (v2.28.5) */
5433
+ /*! Widget: resizable - updated 4/18/2017 (v2.28.8) */
5406
5434
  /*jshint browser:true, jquery:true, unused:false */
5407
5435
  ;(function ($, window) {
5408
5436
  'use strict';
@@ -5567,6 +5595,10 @@
5567
5595
  tableHeight += $this.filter('[style*="height"]').length ? $this.height() : $this.children('table').height();
5568
5596
  });
5569
5597
  }
5598
+
5599
+ if ( !wo.resizable_includeFooter && c.$table.children('tfoot').length ) {
5600
+ tableHeight -= c.$table.children('tfoot').height();
5601
+ }
5570
5602
  // subtract out table left position from resizable handles. Fixes #864
5571
5603
  startPosition = c.$table.position().left;
5572
5604
  $handles.each( function() {
@@ -5737,10 +5769,10 @@
5737
5769
  options: {
5738
5770
  resizable : true, // save column widths to storage
5739
5771
  resizable_addLastColumn : false,
5772
+ resizable_includeFooter: true,
5740
5773
  resizable_widths : [],
5741
5774
  resizable_throttle : false, // set to true (5ms) or any number 0-10 range
5742
- resizable_targetLast : false,
5743
- resizable_fullWidth : null
5775
+ resizable_targetLast : false
5744
5776
  },
5745
5777
  init: function(table, thisWidget, c, wo) {
5746
5778
  ts.resizable.init( c, wo );
@@ -1,4 +1,4 @@
1
- /*! TableSorter (FORK) v2.28.7 *//*
1
+ /*! TableSorter (FORK) v2.28.8 *//*
2
2
  * Client-side table sorting with ease!
3
3
  * @requires jQuery v1.2.6+
4
4
  *
@@ -22,7 +22,7 @@
22
22
  'use strict';
23
23
  var ts = $.tablesorter = {
24
24
 
25
- version : '2.28.7',
25
+ version : '2.28.8',
26
26
 
27
27
  parsers : [],
28
28
  widgets : [],
@@ -1307,7 +1307,7 @@
1307
1307
  cell = $cell[ 0 ]; // in case cell is a jQuery object
1308
1308
  // tbody may not exist if update is initialized while tbody is removed for processing
1309
1309
  if ( $tbodies.length && tbodyIndex >= 0 ) {
1310
- row = $tbodies.eq( tbodyIndex ).find( 'tr' ).index( $row );
1310
+ row = $tbodies.eq( tbodyIndex ).find( 'tr' ).not( '.' + c.cssChildRow ).index( $row );
1311
1311
  cache = tbcache.normalized[ row ];
1312
1312
  len = $row[ 0 ].cells.length;
1313
1313
  if ( len !== c.columns ) {
@@ -1328,7 +1328,6 @@
1328
1328
  cache[ c.columns ].raw[ icell ] = tmp;
1329
1329
  tmp = ts.getParsedText( c, cell, icell, tmp );
1330
1330
  cache[ icell ] = tmp; // parsed
1331
- cache[ c.columns ].$row = $row;
1332
1331
  if ( ( c.parsers[ icell ].type || '' ).toLowerCase() === 'numeric' ) {
1333
1332
  // update column max value (ignore sign)
1334
1333
  tbcache.colMax[ icell ] = Math.max( Math.abs( tmp ) || 0, tbcache.colMax[ icell ] || 0 );
@@ -4,7 +4,7 @@
4
4
  ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
5
5
  █████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
6
6
  */
7
- /*! tablesorter (FORK) - updated 04-04-2017 (v2.28.7)*/
7
+ /*! tablesorter (FORK) - updated 04-18-2017 (v2.28.8)*/
8
8
  /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
9
9
  (function(factory) {
10
10
  if (typeof define === 'function' && define.amd) {
@@ -16,12 +16,26 @@
16
16
  }
17
17
  }(function(jQuery) {
18
18
 
19
- /*! Widget: storage - updated 11/26/2016 (v2.28.0) */
19
+ /*! Widget: storage - updated 4/18/2017 (v2.28.8) */
20
20
  /*global JSON:false */
21
21
  ;(function ($, window, document) {
22
22
  'use strict';
23
23
 
24
24
  var ts = $.tablesorter || {};
25
+
26
+ // update defaults for validator; these values must be falsy!
27
+ $.extend(true, ts.defaults, {
28
+ fixedUrl: '',
29
+ widgetOptions: {
30
+ storage_fixedUrl: '',
31
+ storage_group: '',
32
+ storage_page: '',
33
+ storage_storageType: '',
34
+ storage_tableId: '',
35
+ storage_useSessionStorage: ''
36
+ }
37
+ });
38
+
25
39
  // *** Store data in local storage, with a cookie fallback ***
26
40
  /* IE7 needs JSON library for JSON.stringify - (http://caniuse.com/#search=json)
27
41
  if you need it, then include https://github.com/douglascrockford/JSON-js
@@ -48,8 +62,12 @@
48
62
  values = {},
49
63
  c = table.config,
50
64
  wo = c && c.widgetOptions,
51
- storageType = ( options && options.useSessionStorage ) || ( wo && wo.storage_useSessionStorage ) ?
52
- 'sessionStorage' : 'localStorage',
65
+ storageType = (
66
+ ( options && options.storageType ) || ( wo && wo.storage_storageType )
67
+ ).toString().charAt(0).toLowerCase(),
68
+ // deprecating "useSessionStorage"; any storageType setting overrides it
69
+ session = storageType ? '' :
70
+ ( options && options.useSessionStorage ) || ( wo && wo.storage_useSessionStorage ),
53
71
  $table = $(table),
54
72
  // id from (1) options ID, (2) table 'data-table-group' attribute, (3) widgetOptions.storage_tableId,
55
73
  // (4) table ID, then (5) table index
@@ -61,29 +79,26 @@
61
79
  url = options && options.url ||
62
80
  $table.attr(options && options.page || wo && wo.storage_page || 'data-table-page') ||
63
81
  wo && wo.storage_fixedUrl || c && c.fixedUrl || window.location.pathname;
64
- // update defaults for validator; these values must be falsy!
65
- $.extend(true, ts.defaults, {
66
- fixedUrl: '',
67
- widgetOptions: {
68
- storage_fixedUrl: '',
69
- storage_group: '',
70
- storage_page: '',
71
- storage_tableId: '',
72
- storage_useSessionStorage: ''
73
- }
74
- });
75
- // https://gist.github.com/paulirish/5558557
76
- if (storageType in window) {
77
- try {
78
- window[storageType].setItem('_tmptest', 'temp');
79
- hasStorage = true;
80
- window[storageType].removeItem('_tmptest');
81
- } catch (error) {
82
- if (c && c.debug) {
83
- console.warn( storageType + ' is not supported in this browser' );
82
+
83
+ // skip if using cookies
84
+ if (storageType !== 'c') {
85
+ storageType = (storageType === 's' || session) ? 'sessionStorage' : 'localStorage';
86
+ // https://gist.github.com/paulirish/5558557
87
+ if (storageType in window) {
88
+ try {
89
+ window[storageType].setItem('_tmptest', 'temp');
90
+ hasStorage = true;
91
+ window[storageType].removeItem('_tmptest');
92
+ } catch (error) {
93
+ if (c && c.debug) {
94
+ console.warn( storageType + ' is not supported in this browser' );
95
+ }
84
96
  }
85
97
  }
86
98
  }
99
+ if (c.debug) {
100
+ console.log('Storage widget using', hasStorage ? storageType : 'cookies');
101
+ }
87
102
  // *** get value ***
88
103
  if ($.parseJSON) {
89
104
  if (hasStorage) {
@@ -393,7 +408,7 @@
393
408
 
394
409
  })(jQuery);
395
410
 
396
- /*! Widget: filter - updated 4/4/2017 (v2.28.7) *//*
411
+ /*! Widget: filter - updated 4/18/2017 (v2.28.8) *//*
397
412
  * Requires tablesorter v2.8+ and jQuery 1.7+
398
413
  * by Rob Garrison
399
414
  */
@@ -1280,6 +1295,19 @@
1280
1295
  tsf.checkFilters( table, filter, skipFirst );
1281
1296
  }
1282
1297
  },
1298
+ equalFilters: function (c, filter1, filter2) {
1299
+ var indx,
1300
+ f1 = [],
1301
+ f2 = [],
1302
+ len = c.columns + 1; // add one to include anyMatch filter
1303
+ filter1 = $.isArray(filter1) ? filter1 : [];
1304
+ filter2 = $.isArray(filter2) ? filter2 : [];
1305
+ for (indx = 0; indx < len; indx++) {
1306
+ f1[indx] = filter1[indx] || '';
1307
+ f2[indx] = filter2[indx] || '';
1308
+ }
1309
+ return f1.join(',') === f2.join(',');
1310
+ },
1283
1311
  checkFilters: function( table, filter, skipFirst ) {
1284
1312
  var c = table.config,
1285
1313
  wo = c.widgetOptions,
@@ -1312,7 +1340,7 @@
1312
1340
  }
1313
1341
  // return if the last search is the same; but filter === false when updating the search
1314
1342
  // see example-widget-filter.html filter toggle buttons
1315
- if ( c.lastSearch.join(',') === currentFilters.join(',') && filter !== false ) {
1343
+ if ( tsf.equalFilters(c, c.lastSearch, currentFilters) && filter !== false ) {
1316
1344
  return;
1317
1345
  } else if ( filter === false ) {
1318
1346
  // force filter refresh
@@ -1661,7 +1689,7 @@
1661
1689
  },
1662
1690
  findRows: function( table, filters, currentFilters ) {
1663
1691
  if (
1664
- table.config.lastSearch.join(',') === ( currentFilters || [] ).join(',') ||
1692
+ tsf.equalFilters(table.config, table.config.lastSearch, currentFilters) ||
1665
1693
  !table.config.widgetOptions.filter_initialized
1666
1694
  ) {
1667
1695
  return;
@@ -2206,7 +2234,8 @@
2206
2234
  if ( ( getRaw !== true && wo && !wo.filter_columnFilters ) ||
2207
2235
  // setFilters called, but last search is exactly the same as the current
2208
2236
  // fixes issue #733 & #903 where calling update causes the input values to reset
2209
- ( $.isArray(setFilters) && setFilters.join(',') === c.lastSearch.join(',') ) ) {
2237
+ ( $.isArray(setFilters) && tsf.equalFilters(c, setFilters, c.lastSearch) )
2238
+ ) {
2210
2239
  return $( table ).data( 'lastSearch' ) || [];
2211
2240
  }
2212
2241
  if ( c ) {
@@ -2591,7 +2620,7 @@
2591
2620
 
2592
2621
  })(jQuery, window);
2593
2622
 
2594
- /*! Widget: resizable - updated 1/28/2017 (v2.28.5) */
2623
+ /*! Widget: resizable - updated 4/18/2017 (v2.28.8) */
2595
2624
  /*jshint browser:true, jquery:true, unused:false */
2596
2625
  ;(function ($, window) {
2597
2626
  'use strict';
@@ -2756,6 +2785,10 @@
2756
2785
  tableHeight += $this.filter('[style*="height"]').length ? $this.height() : $this.children('table').height();
2757
2786
  });
2758
2787
  }
2788
+
2789
+ if ( !wo.resizable_includeFooter && c.$table.children('tfoot').length ) {
2790
+ tableHeight -= c.$table.children('tfoot').height();
2791
+ }
2759
2792
  // subtract out table left position from resizable handles. Fixes #864
2760
2793
  startPosition = c.$table.position().left;
2761
2794
  $handles.each( function() {
@@ -2926,10 +2959,10 @@
2926
2959
  options: {
2927
2960
  resizable : true, // save column widths to storage
2928
2961
  resizable_addLastColumn : false,
2962
+ resizable_includeFooter: true,
2929
2963
  resizable_widths : [],
2930
2964
  resizable_throttle : false, // set to true (5ms) or any number 0-10 range
2931
- resizable_targetLast : false,
2932
- resizable_fullWidth : null
2965
+ resizable_targetLast : false
2933
2966
  },
2934
2967
  init: function(table, thisWidget, c, wo) {
2935
2968
  ts.resizable.init( c, wo );
@@ -1,4 +1,4 @@
1
- /*! Widget: filter - updated 4/4/2017 (v2.28.7) *//*
1
+ /*! Widget: filter - updated 4/18/2017 (v2.28.8) *//*
2
2
  * Requires tablesorter v2.8+ and jQuery 1.7+
3
3
  * by Rob Garrison
4
4
  */
@@ -885,6 +885,19 @@
885
885
  tsf.checkFilters( table, filter, skipFirst );
886
886
  }
887
887
  },
888
+ equalFilters: function (c, filter1, filter2) {
889
+ var indx,
890
+ f1 = [],
891
+ f2 = [],
892
+ len = c.columns + 1; // add one to include anyMatch filter
893
+ filter1 = $.isArray(filter1) ? filter1 : [];
894
+ filter2 = $.isArray(filter2) ? filter2 : [];
895
+ for (indx = 0; indx < len; indx++) {
896
+ f1[indx] = filter1[indx] || '';
897
+ f2[indx] = filter2[indx] || '';
898
+ }
899
+ return f1.join(',') === f2.join(',');
900
+ },
888
901
  checkFilters: function( table, filter, skipFirst ) {
889
902
  var c = table.config,
890
903
  wo = c.widgetOptions,
@@ -917,7 +930,7 @@
917
930
  }
918
931
  // return if the last search is the same; but filter === false when updating the search
919
932
  // see example-widget-filter.html filter toggle buttons
920
- if ( c.lastSearch.join(',') === currentFilters.join(',') && filter !== false ) {
933
+ if ( tsf.equalFilters(c, c.lastSearch, currentFilters) && filter !== false ) {
921
934
  return;
922
935
  } else if ( filter === false ) {
923
936
  // force filter refresh
@@ -1266,7 +1279,7 @@
1266
1279
  },
1267
1280
  findRows: function( table, filters, currentFilters ) {
1268
1281
  if (
1269
- table.config.lastSearch.join(',') === ( currentFilters || [] ).join(',') ||
1282
+ tsf.equalFilters(table.config, table.config.lastSearch, currentFilters) ||
1270
1283
  !table.config.widgetOptions.filter_initialized
1271
1284
  ) {
1272
1285
  return;
@@ -1811,7 +1824,8 @@
1811
1824
  if ( ( getRaw !== true && wo && !wo.filter_columnFilters ) ||
1812
1825
  // setFilters called, but last search is exactly the same as the current
1813
1826
  // fixes issue #733 & #903 where calling update causes the input values to reset
1814
- ( $.isArray(setFilters) && setFilters.join(',') === c.lastSearch.join(',') ) ) {
1827
+ ( $.isArray(setFilters) && tsf.equalFilters(c, setFilters, c.lastSearch) )
1828
+ ) {
1815
1829
  return $( table ).data( 'lastSearch' ) || [];
1816
1830
  }
1817
1831
  if ( c ) {
@@ -1,4 +1,4 @@
1
- /*! Widget: Pager - updated 4/2/2017 (v2.28.6) */
1
+ /*! Widget: Pager - updated 4/18/2017 (v2.28.8) */
2
2
  /* Requires tablesorter v2.8+ and jQuery 1.7+
3
3
  * by Rob Garrison
4
4
  */
@@ -249,10 +249,15 @@
249
249
  .off( namespace )
250
250
  .on( 'filterInit filterStart '.split( ' ' ).join( namespace + ' ' ), function( e, filters ) {
251
251
  p.currentFilters = $.isArray( filters ) ? filters : c.$table.data( 'lastSearch' );
252
+ var filtersEqual;
253
+ if (ts.filter.equalFilters) {
254
+ filtersEqual = ts.filter.equalFilters(c, c.lastSearch, p.currentFilters);
255
+ } else {
256
+ // will miss filter changes of the same value in a different column, see #1363
257
+ filtersEqual = ( c.lastSearch || [] ).join( '' ) !== ( p.currentFilters || [] ).join( '' );
258
+ }
252
259
  // don't change page if filters are the same (pager updating, etc)
253
- if ( e.type === 'filterStart' && wo.pager_pageReset !== false &&
254
- ( c.lastSearch || [] ).join( ',' ) !== ( p.currentFilters || [] ).join( ',' )
255
- ) {
260
+ if ( e.type === 'filterStart' && wo.pager_pageReset !== false && !filtersEqual ) {
256
261
  p.page = wo.pager_pageReset; // fixes #456 & #565
257
262
  }
258
263
  })
@@ -1,4 +1,4 @@
1
- /*! Widget: resizable - updated 1/28/2017 (v2.28.5) */
1
+ /*! Widget: resizable - updated 4/18/2017 (v2.28.8) */
2
2
  /*jshint browser:true, jquery:true, unused:false */
3
3
  ;(function ($, window) {
4
4
  'use strict';
@@ -163,6 +163,10 @@
163
163
  tableHeight += $this.filter('[style*="height"]').length ? $this.height() : $this.children('table').height();
164
164
  });
165
165
  }
166
+
167
+ if ( !wo.resizable_includeFooter && c.$table.children('tfoot').length ) {
168
+ tableHeight -= c.$table.children('tfoot').height();
169
+ }
166
170
  // subtract out table left position from resizable handles. Fixes #864
167
171
  startPosition = c.$table.position().left;
168
172
  $handles.each( function() {
@@ -333,10 +337,10 @@
333
337
  options: {
334
338
  resizable : true, // save column widths to storage
335
339
  resizable_addLastColumn : false,
340
+ resizable_includeFooter: true,
336
341
  resizable_widths : [],
337
342
  resizable_throttle : false, // set to true (5ms) or any number 0-10 range
338
- resizable_targetLast : false,
339
- resizable_fullWidth : null
343
+ resizable_targetLast : false
340
344
  },
341
345
  init: function(table, thisWidget, c, wo) {
342
346
  ts.resizable.init( c, wo );
@@ -1,4 +1,4 @@
1
- /*! Widget: scroller - updated 1/28/2017 (v2.28.5) *//*
1
+ /*! Widget: scroller - updated 4/18/2017 (v2.28.8) *//*
2
2
  Copyright (C) 2011 T. Connell & Associates, Inc.
3
3
 
4
4
  Dual-licensed under the MIT and GPL licenses
@@ -113,7 +113,7 @@
113
113
  when height < max height (filtering) */
114
114
  '.' + tscss.scrollerTable + ' { position: relative; overflow: auto; }' +
115
115
  '.' + tscss.scrollerTable + ' table.' + tscss.table +
116
- ' { border-top: 0; margin-top: 0; margin-bottom: 0; overflow: hidden; }' +
116
+ ' { border-top: 0; margin-top: 0; margin-bottom: 0; overflow: hidden; max-width: initial; }' +
117
117
  /* hide footer in original table */
118
118
  '.' + tscss.scrollerTable + ' tfoot, .' + tscss.scrollerHideElement + ', .' + tscss.scrollerHideColumn +
119
119
  ' { display: none; }' +
@@ -365,7 +365,7 @@
365
365
 
366
366
  resize : function( c, wo ) {
367
367
  if ( wo.scroller_isBusy ) { return; }
368
- var index, borderWidth, setWidth, $headers, $this, temp,
368
+ var index, borderWidth, setWidth, $headers, $this,
369
369
  tsScroller = ts.scroller,
370
370
  $container = wo.scroller_$container,
371
371
  $table = c.$table,
@@ -378,7 +378,9 @@
378
378
  // Hide other scrollers so we can resize
379
379
  $div = $( 'div.' + tscss.scrollerWrap + '[id!="' + id + '"]' )
380
380
  .addClass( tscss.scrollerHideElement ),
381
- row = '<tr class="' + tscss.scrollerSpacerRow + ' ' + c.selectorRemove.slice(1) + '">';
381
+ temp = 'padding:0;margin:0;border:0;height:0;max-height:0;min-height:0;',
382
+ row = '<tr class="' + tscss.scrollerSpacerRow + ' ' + c.selectorRemove.slice(1) +
383
+ '" style="' + temp + '">';
382
384
 
383
385
  wo.scroller_calcWidths = [];
384
386
 
@@ -417,22 +419,22 @@
417
419
  setWidth = $this.width();
418
420
  }
419
421
  }
420
- row += '<td data-column="' + index + '" style="padding:0;margin:0;border:0;height:0;max-height:0;' +
421
- 'min-height:0;width:' + setWidth + 'px;min-width:' + setWidth + 'px;max-width:' + setWidth + 'px"></td>';
422
+ row += '<td data-column="' + index + '" style="' + temp + 'width:' + setWidth +
423
+ 'px;min-width:' + setWidth + 'px;max-width:' + setWidth + 'px"></td>';
422
424
 
423
425
  // save current widths
424
426
  wo.scroller_calcWidths[ index ] = setWidth;
425
427
  }
426
428
  row += '</tr>';
427
- c.$tbodies.eq(0).prepend( row ); // tbody
429
+ c.$tbodies.eq(0).append( row ); // tbody
428
430
  $hdr.children( 'thead' ).append( row );
429
431
  $foot.children( 'tfoot' ).append( row );
430
432
 
431
433
  // include colgroup or alignment is off
432
434
  ts.fixColumnWidth( c.table );
433
435
  row = c.$table.children( 'colgroup' )[0].outerHTML;
434
- $hdr.prepend( row );
435
- $foot.prepend( row );
436
+ $hdr.append( row );
437
+ $foot.append( row );
436
438
 
437
439
  temp = $tableWrap.parent().innerWidth() -
438
440
  ( tsScroller.hasScrollBar( $tableWrap ) ? wo.scroller_barSetWidth : 0 );
@@ -1,9 +1,23 @@
1
- /*! Widget: storage - updated 11/26/2016 (v2.28.0) */
1
+ /*! Widget: storage - updated 4/18/2017 (v2.28.8) */
2
2
  /*global JSON:false */
3
3
  ;(function ($, window, document) {
4
4
  'use strict';
5
5
 
6
6
  var ts = $.tablesorter || {};
7
+
8
+ // update defaults for validator; these values must be falsy!
9
+ $.extend(true, ts.defaults, {
10
+ fixedUrl: '',
11
+ widgetOptions: {
12
+ storage_fixedUrl: '',
13
+ storage_group: '',
14
+ storage_page: '',
15
+ storage_storageType: '',
16
+ storage_tableId: '',
17
+ storage_useSessionStorage: ''
18
+ }
19
+ });
20
+
7
21
  // *** Store data in local storage, with a cookie fallback ***
8
22
  /* IE7 needs JSON library for JSON.stringify - (http://caniuse.com/#search=json)
9
23
  if you need it, then include https://github.com/douglascrockford/JSON-js
@@ -30,8 +44,12 @@
30
44
  values = {},
31
45
  c = table.config,
32
46
  wo = c && c.widgetOptions,
33
- storageType = ( options && options.useSessionStorage ) || ( wo && wo.storage_useSessionStorage ) ?
34
- 'sessionStorage' : 'localStorage',
47
+ storageType = (
48
+ ( options && options.storageType ) || ( wo && wo.storage_storageType )
49
+ ).toString().charAt(0).toLowerCase(),
50
+ // deprecating "useSessionStorage"; any storageType setting overrides it
51
+ session = storageType ? '' :
52
+ ( options && options.useSessionStorage ) || ( wo && wo.storage_useSessionStorage ),
35
53
  $table = $(table),
36
54
  // id from (1) options ID, (2) table 'data-table-group' attribute, (3) widgetOptions.storage_tableId,
37
55
  // (4) table ID, then (5) table index
@@ -43,29 +61,26 @@
43
61
  url = options && options.url ||
44
62
  $table.attr(options && options.page || wo && wo.storage_page || 'data-table-page') ||
45
63
  wo && wo.storage_fixedUrl || c && c.fixedUrl || window.location.pathname;
46
- // update defaults for validator; these values must be falsy!
47
- $.extend(true, ts.defaults, {
48
- fixedUrl: '',
49
- widgetOptions: {
50
- storage_fixedUrl: '',
51
- storage_group: '',
52
- storage_page: '',
53
- storage_tableId: '',
54
- storage_useSessionStorage: ''
55
- }
56
- });
57
- // https://gist.github.com/paulirish/5558557
58
- if (storageType in window) {
59
- try {
60
- window[storageType].setItem('_tmptest', 'temp');
61
- hasStorage = true;
62
- window[storageType].removeItem('_tmptest');
63
- } catch (error) {
64
- if (c && c.debug) {
65
- console.warn( storageType + ' is not supported in this browser' );
64
+
65
+ // skip if using cookies
66
+ if (storageType !== 'c') {
67
+ storageType = (storageType === 's' || session) ? 'sessionStorage' : 'localStorage';
68
+ // https://gist.github.com/paulirish/5558557
69
+ if (storageType in window) {
70
+ try {
71
+ window[storageType].setItem('_tmptest', 'temp');
72
+ hasStorage = true;
73
+ window[storageType].removeItem('_tmptest');
74
+ } catch (error) {
75
+ if (c && c.debug) {
76
+ console.warn( storageType + ' is not supported in this browser' );
77
+ }
66
78
  }
67
79
  }
68
80
  }
81
+ if (c.debug) {
82
+ console.log('Storage widget using', hasStorage ? storageType : 'cookies');
83
+ }
69
84
  // *** get value ***
70
85
  if ($.parseJSON) {
71
86
  if (hasStorage) {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-tablesorter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.23.7
4
+ version: 1.23.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jun Lin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-04-09 00:00:00.000000000 Z
12
+ date: 2017-04-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties