jquery-tablesorter 1.24.5 → 1.25.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/jquery-tablesorter/version.rb +2 -2
  4. data/vendor/assets/javascripts/jquery-tablesorter/addons/pager/jquery.tablesorter.pager.js +85 -85
  5. data/vendor/assets/javascripts/jquery-tablesorter/beta-testing/widget-reorder.js +17 -18
  6. data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.combined.js +128 -101
  7. data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.js +70 -58
  8. data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets.js +58 -43
  9. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-extract.js +1 -1
  10. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-iso8601.js +1 -1
  11. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-month.js +1 -1
  12. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-range.js +1 -1
  13. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-two-digit-year.js +2 -2
  14. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js +1 -1
  15. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date.js +1 -1
  16. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-duration.js +1 -1
  17. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-feet-inch-fraction.js +2 -2
  18. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-file-type.js +2 -2
  19. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-ignore-articles.js +1 -1
  20. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-image.js +2 -2
  21. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-input-select.js +1 -1
  22. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-leading-zeros.js +1 -0
  23. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-named-numbers.js +1 -1
  24. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-network.js +4 -4
  25. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-roman.js +5 -5
  26. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-alignChar.js +15 -15
  27. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-build-table.js +28 -18
  28. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-chart.js +1 -1
  29. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-columnSelector.js +22 -18
  30. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-cssStickyHeaders.js +1 -1
  31. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter-formatter-html5.js +34 -31
  32. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter-formatter-jui.js +46 -46
  33. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter-formatter-select2.js +10 -10
  34. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter-type-insideRange.js +1 -1
  35. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter.js +17 -13
  36. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-formatter.js +2 -2
  37. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-grouping.js +14 -15
  38. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-headerTitles.js +8 -9
  39. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-lazyload.js +35 -35
  40. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-math.js +8 -9
  41. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-output.js +7 -6
  42. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-pager.js +60 -56
  43. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-print.js +1 -1
  44. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-reflow.js +11 -11
  45. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-repeatheaders.js +2 -2
  46. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-resizable.js +3 -3
  47. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-saveSort.js +23 -12
  48. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-scroller.js +3 -4
  49. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-sort2Hash.js +2 -2
  50. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-sortTbodies.js +1 -1
  51. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-staticRow.js +7 -7
  52. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-stickyHeaders.js +2 -2
  53. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-storage.js +5 -6
  54. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-uitheme.js +7 -6
  55. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-vertical-group.js +10 -12
  56. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-view.js +3 -3
  57. metadata +2 -2
@@ -4,8 +4,8 @@
4
4
  */
5
5
  /*jshint browser:true, jquery:true, unused:false */
6
6
  /*global jQuery: false */
7
- ;(function($){
8
- "use strict";
7
+ ;(function($) {
8
+ 'use strict';
9
9
 
10
10
  $.tablesorter.addWidget({
11
11
  id: 'reorder',
@@ -22,14 +22,13 @@ $.tablesorter.addWidget({
22
22
  init: function(table, thisWidget, c, wo) {
23
23
  var i, timer, $helper, $bar, clickOffset,
24
24
  lastIndx = -1,
25
- ts = $.tablesorter,
26
25
  endIndex = -1,
27
26
  startIndex = -1,
28
27
  t = wo.reorder_blocked.split(' '),
29
28
  noReorderLeft = t[0] || 'reorder-block-left',
30
29
  noReorderLast = t[1] || 'reorder-block-end',
31
30
  lastOffset = c.$headers.not('.' + noReorderLeft).first(),
32
- offsets = c.$headers.map(function(i){
31
+ offsets = c.$headers.map(function() {
33
32
  var s, $t = $(this);
34
33
  if ($t.hasClass(noReorderLeft)) {
35
34
  s = lastOffset;
@@ -40,7 +39,7 @@ $.tablesorter.addWidget({
40
39
  return $t.offset().left;
41
40
  }).get(),
42
41
  len = offsets.length,
43
- startReorder = function(e, $th){
42
+ startReorder = function(e, $th) {
44
43
  var p = $th.position(),
45
44
  r = $th.parent().position(),
46
45
  i = startIndex = $th.index();
@@ -68,7 +67,7 @@ $.tablesorter.addWidget({
68
67
  positionBar(e);
69
68
  lastIndx = endIndex;
70
69
  },
71
- positionBar = function(e){
70
+ positionBar = function(e) {
72
71
  for (i = 0; i <= len; i++) {
73
72
  if ( i > 0 && e.pageX < offsets[i-1] + (offsets[i] - offsets[i-1])/2 && !c.$headers.eq(i).hasClass(noReorderLeft) ) {
74
73
  endIndex = i - 1;
@@ -87,7 +86,7 @@ $.tablesorter.addWidget({
87
86
  $bar.css('left', offsets[len]);
88
87
  }
89
88
  },
90
- finishReorder = function(){
89
+ finishReorder = function() {
91
90
  $helper.remove();
92
91
  $bar.remove();
93
92
  // finish reorder
@@ -95,7 +94,7 @@ $.tablesorter.addWidget({
95
94
  rows = c.$table.find('tr'),
96
95
  cols;
97
96
  startIndex = -1; // stop mousemove updates
98
- if ( s > -1 && endIndex > -1 && s != endIndex && s + 1 !== endIndex ) {
97
+ if ( s > -1 && endIndex > -1 && s !== endIndex && s + 1 !== endIndex ) {
99
98
  adj = endIndex !== 0;
100
99
  if (c.debug) {
101
100
  console.log( 'Inserting column ' + s + (adj ? ' after' : ' before') + ' column ' + (endIndex - adj ? 1 : 0) );
@@ -123,10 +122,10 @@ $.tablesorter.addWidget({
123
122
  }
124
123
  endIndex = -1;
125
124
  },
126
- mdown = function(e, el){
125
+ mdown = function(e, el) {
127
126
  var $t = $(el), evt = e;
128
127
  if ($t.hasClass(wo.reorder_noReorder)) { return; }
129
- timer = setTimeout(function(){
128
+ timer = setTimeout(function() {
130
129
  $t.addClass('tablesorter-reorder');
131
130
  startReorder(evt, $t);
132
131
  }, wo.reorder_delay);
@@ -140,13 +139,13 @@ $.tablesorter.addWidget({
140
139
  offsets.push( c.$table.offset().left + c.$table.outerWidth() );
141
140
  }
142
141
 
143
- c.$headers.not('.' + wo.reorder_noReorder).bind('mousedown.reorder', function(e){
142
+ c.$headers.not('.' + wo.reorder_noReorder).bind('mousedown.reorder', function(e) {
144
143
  mdown(e, this);
145
144
  });
146
145
 
147
146
  $(document)
148
- .bind('mousemove.reorder', function(e){
149
- if (startIndex !== -1){
147
+ .bind('mousemove.reorder', function(e) {
148
+ if (startIndex !== -1) {
150
149
  var c = { left : e.pageX - clickOffset[0] };
151
150
  endIndex = -1;
152
151
  if (/y/.test(wo.reorder_axis)) {
@@ -157,9 +156,9 @@ $.tablesorter.addWidget({
157
156
  }
158
157
  })
159
158
  .add( c.$headers )
160
- .bind('mouseup.reorder', function(){
159
+ .bind('mouseup.reorder', function() {
161
160
  clearTimeout(timer);
162
- if (startIndex !== -1 && endIndex !== -1){
161
+ if (startIndex !== -1 && endIndex !== -1) {
163
162
  finishReorder();
164
163
  } else {
165
164
  startIndex = -1;
@@ -167,8 +166,8 @@ $.tablesorter.addWidget({
167
166
  });
168
167
 
169
168
  // has sticky headers?
170
- c.$table.bind('stickyHeadersInit', function(){
171
- wo.$sticky.find('thead').children().not('.' + wo.reorder_noReorder).bind('mousedown.reorder', function(e){
169
+ c.$table.bind('stickyHeadersInit', function() {
170
+ wo.$sticky.find('thead').children().not('.' + wo.reorder_noReorder).bind('mousedown.reorder', function(e) {
172
171
  mdown(e, this);
173
172
  });
174
173
  });
@@ -177,6 +176,6 @@ $.tablesorter.addWidget({
177
176
  });
178
177
 
179
178
  // add mouse coordinates
180
- $x = $('#main h1:last'); $(document).mousemove(function(e){ $x.html( e.pageX ); });
179
+ $x = $('#main h1:last'); $(document).mousemove(function(e) { $x.html( e.pageX ); });
181
180
 
182
181
  })(jQuery);
@@ -4,7 +4,7 @@
4
4
  ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
5
5
  █████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
6
6
  */
7
- /*! tablesorter (FORK) - updated 2018-02-25 (v2.29.6)*/
7
+ /*! tablesorter (FORK) - updated 2018-03-19 (v2.30.1)*/
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.29.6 *//*
19
+ /*! TableSorter (FORK) v2.30.1 *//*
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.29.6',
43
+ version : '2.30.1',
44
44
 
45
45
  parsers : [],
46
46
  widgets : [],
@@ -52,8 +52,8 @@
52
52
  showProcessing : false, // show an indeterminate timer icon in the header when the table is sorted or filtered.
53
53
 
54
54
  headerTemplate : '{content}',// header layout template (HTML ok); {content} = innerHTML, {icon} = <i/> // class from cssIcon
55
- onRenderTemplate : null, // function( index, template ){ return template; }, // template is a string
56
- onRenderHeader : null, // function( index ){}, // nothing to return
55
+ onRenderTemplate : null, // function( index, template ) { return template; }, // template is a string
56
+ onRenderHeader : null, // function( index ) {}, // nothing to return
57
57
 
58
58
  // *** functionality
59
59
  cancelSelection : true, // prevent text selection in the header
@@ -82,7 +82,7 @@
82
82
  emptyTo : 'bottom', // sort empty cell to bottom, top, none, zero, emptyMax, emptyMin
83
83
  stringTo : 'max', // sort strings in numerical column as max, min, top, bottom, zero
84
84
  duplicateSpan : true, // colspan cells in the tbody will have duplicated content in the cache for each spanned column
85
- textExtraction : 'basic', // text extraction method/function - function( node, table, cellIndex ){}
85
+ textExtraction : 'basic', // text extraction method/function - function( node, table, cellIndex ) {}
86
86
  textAttribute : 'data-text',// data-attribute that contains alternate cell text (used in default textExtraction function)
87
87
  textSorter : null, // choose overall or specific column sorter function( a, b, direction, table, columnIndex ) [alt: ts.sortText]
88
88
  numberSorter : null, // choose overall numeric sorter function( a, b, direction, maxColumnValue )
@@ -96,7 +96,7 @@
96
96
  },
97
97
 
98
98
  // *** callbacks
99
- initialized : null, // function( table ){},
99
+ initialized : null, // function( table ) {},
100
100
 
101
101
  // *** extra css class names
102
102
  tableClass : '',
@@ -234,7 +234,7 @@
234
234
  setup : function( table, c ) {
235
235
  // if no thead or tbody, or tablesorter is already present, quit
236
236
  if ( !table || !table.tHead || table.tBodies.length === 0 || table.hasInitialized === true ) {
237
- if ( c.debug ) {
237
+ if ( ts.debug(c, 'core') ) {
238
238
  if ( table.hasInitialized ) {
239
239
  console.warn( 'Stopping initialization. Tablesorter has already been initialized' );
240
240
  } else {
@@ -255,7 +255,7 @@
255
255
  table.config = c;
256
256
  // save the settings where they read
257
257
  $.data( table, 'tablesorter', c );
258
- if ( c.debug ) {
258
+ if ( ts.debug(c, 'core') ) {
259
259
  console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter v' + ts.version );
260
260
  $.data( table, 'startoveralltimer', new Date() );
261
261
  }
@@ -316,7 +316,10 @@
316
316
  ts.setupParsers( c );
317
317
  // start total row count at zero
318
318
  c.totalRows = 0;
319
- ts.validateOptions( c );
319
+ // only validate options while debugging. See #1528
320
+ if (c.debug) {
321
+ ts.validateOptions( c );
322
+ }
320
323
  // build the cache for the tbody cells
321
324
  // delayInit will delay building the cache until the user starts a sort
322
325
  if ( !c.delayInit ) { ts.buildCache( c ); }
@@ -361,9 +364,9 @@
361
364
  // initialized
362
365
  table.hasInitialized = true;
363
366
  table.isProcessing = false;
364
- if ( c.debug ) {
367
+ if ( ts.debug(c, 'core') ) {
365
368
  console.log( 'Overall initialization time:' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
366
- if ( c.debug && console.groupEnd ) { console.groupEnd(); }
369
+ if ( ts.debug(c, 'core') && console.groupEnd ) { console.groupEnd(); }
367
370
  }
368
371
  $table.triggerHandler( 'tablesorter-initialized', table );
369
372
  if ( typeof c.initialized === 'function' ) {
@@ -560,7 +563,7 @@
560
563
  c.headerList = [];
561
564
  c.headerContent = [];
562
565
  c.sortVars = [];
563
- if ( c.debug ) {
566
+ if ( ts.debug(c, 'core') ) {
564
567
  timer = new Date();
565
568
  }
566
569
  // children tr in tfoot - see issue #196 & #547
@@ -655,7 +658,7 @@
655
658
  });
656
659
  // enable/disable sorting
657
660
  ts.updateHeader( c );
658
- if ( c.debug ) {
661
+ if ( ts.debug(c, 'core') ) {
659
662
  console.log( 'Built headers:' + ts.benchmark( timer ) );
660
663
  console.log( c.$headers );
661
664
  }
@@ -678,14 +681,15 @@
678
681
  noParser, parser, extractor, time, tbody, len,
679
682
  table = c.table,
680
683
  tbodyIndex = 0,
681
- debug = {};
684
+ debug = ts.debug(c, 'core'),
685
+ debugOutput = {};
682
686
  // update table bodies in case we start with an empty table
683
687
  c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' );
684
688
  tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies;
685
689
  len = tbody.length;
686
690
  if ( len === 0 ) {
687
- return c.debug ? console.warn( 'Warning: *Empty table!* Not building a parser cache' ) : '';
688
- } else if ( c.debug ) {
691
+ return debug ? console.warn( 'Warning: *Empty table!* Not building a parser cache' ) : '';
692
+ } else if ( debug ) {
689
693
  time = new Date();
690
694
  console[ console.group ? 'group' : 'log' ]( 'Detecting parsers for each column' );
691
695
  }
@@ -727,8 +731,8 @@
727
731
  if ( !parser ) {
728
732
  parser = ts.detectParserForColumn( c, rows, -1, colIndex );
729
733
  }
730
- if ( c.debug ) {
731
- debug[ '(' + colIndex + ') ' + header.text() ] = {
734
+ if ( debug ) {
735
+ debugOutput[ '(' + colIndex + ') ' + header.text() ] = {
732
736
  parser : parser.id,
733
737
  extractor : extractor ? extractor.id : 'none',
734
738
  string : c.strings[ colIndex ],
@@ -754,9 +758,9 @@
754
758
  }
755
759
  tbodyIndex += ( list.parsers.length ) ? len : 1;
756
760
  }
757
- if ( c.debug ) {
758
- if ( !ts.isEmptyObject( debug ) ) {
759
- console[ console.table ? 'table' : 'log' ]( debug );
761
+ if ( debug ) {
762
+ if ( !ts.isEmptyObject( debugOutput ) ) {
763
+ console[ console.table ? 'table' : 'log' ]( debugOutput );
760
764
  } else {
761
765
  console.warn( ' No parsers detected!' );
762
766
  }
@@ -782,7 +786,7 @@
782
786
  },
783
787
 
784
788
  getParserById : function( name ) {
785
- /*jshint eqeqeq:false */
789
+ /*jshint eqeqeq:false */ // eslint-disable-next-line eqeqeq
786
790
  if ( name == 'false' ) { return false; }
787
791
  var indx,
788
792
  len = ts.parsers.length;
@@ -799,6 +803,7 @@
799
803
  indx = ts.parsers.length,
800
804
  node = false,
801
805
  nodeValue = '',
806
+ debug = ts.debug(c, 'core'),
802
807
  keepLooking = true;
803
808
  while ( nodeValue === '' && keepLooking ) {
804
809
  rowIndex++;
@@ -809,7 +814,7 @@
809
814
  node = rows[ rowIndex ].cells[ cellIndex ];
810
815
  nodeValue = ts.getElementText( c, node, cellIndex );
811
816
  $node = $( node );
812
- if ( c.debug ) {
817
+ if ( debug ) {
813
818
  console.log( 'Checking if value was empty on row ' + rowIndex + ', column: ' +
814
819
  cellIndex + ': "' + nodeValue + '"' );
815
820
  }
@@ -891,7 +896,8 @@
891
896
  cols, $cells, cell, cacheTime, totalRows, rowData, prevRowData,
892
897
  colMax, span, cacheIndex, hasParser, max, len, index,
893
898
  table = c.table,
894
- parsers = c.parsers;
899
+ parsers = c.parsers,
900
+ debug = ts.debug(c, 'core');
895
901
  // update tbody variable
896
902
  c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' );
897
903
  $tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies,
@@ -899,9 +905,9 @@
899
905
  c.totalRows = 0;
900
906
  // if no parsers found, return - it's an empty table.
901
907
  if ( !parsers ) {
902
- return c.debug ? console.warn( 'Warning: *Empty table!* Not building a cache' ) : '';
908
+ return debug ? console.warn( 'Warning: *Empty table!* Not building a cache' ) : '';
903
909
  }
904
- if ( c.debug ) {
910
+ if ( debug ) {
905
911
  cacheTime = new Date();
906
912
  }
907
913
  // processing icon
@@ -970,7 +976,7 @@
970
976
  cell = $row[ 0 ].cells[ colIndex ];
971
977
  if ( cell && cacheIndex < c.columns ) {
972
978
  hasParser = typeof parsers[ cacheIndex ] !== 'undefined';
973
- if ( !hasParser && c.debug ) {
979
+ if ( !hasParser && debug ) {
974
980
  console.warn( 'No parser found for row: ' + rowIndex + ', column: ' + colIndex +
975
981
  '; cell containing: "' + $(cell).text() + '"; does it have a header?' );
976
982
  }
@@ -1018,7 +1024,7 @@
1018
1024
  if ( c.showProcessing ) {
1019
1025
  ts.isProcessing( table ); // remove processing icon
1020
1026
  }
1021
- if ( c.debug ) {
1027
+ if ( debug ) {
1022
1028
  len = Math.min( 5, c.cache[ 0 ].normalized.length );
1023
1029
  console[ console.group ? 'group' : 'log' ]( 'Building cache for ' + c.totalRows +
1024
1030
  ' rows (showing ' + len + ' rows in log) and ' + c.columns + ' columns' +
@@ -1049,7 +1055,7 @@
1049
1055
  data = { raw : [], parsed: [], $cell: [] },
1050
1056
  c = table.config;
1051
1057
  if ( ts.isEmptyObject( c ) ) {
1052
- if ( c.debug ) {
1058
+ if ( ts.debug(c, 'core') ) {
1053
1059
  console.warn( 'No cache found - aborting getColumnText function!' );
1054
1060
  }
1055
1061
  } else {
@@ -1143,8 +1149,8 @@
1143
1149
  // direction = 2 means reset!
1144
1150
  if ( list[ indx ][ 1 ] !== 2 ) {
1145
1151
  // multicolumn sorting updating - see #1005
1146
- // .not(function(){}) needs jQuery 1.4
1147
- // filter(function(i, el){}) <- el is undefined in jQuery v1.2.6
1152
+ // .not(function() {}) needs jQuery 1.4
1153
+ // filter(function(i, el) {}) <- el is undefined in jQuery v1.2.6
1148
1154
  $sorted = c.$headers.filter( function( i ) {
1149
1155
  // only include headers that are in the sortList (this includes colspans)
1150
1156
  var include = true,
@@ -1393,7 +1399,7 @@
1393
1399
  ts.resortComplete( c, callback );
1394
1400
  }
1395
1401
  } else {
1396
- if ( c.debug ) {
1402
+ if ( ts.debug(c, 'core') ) {
1397
1403
  console.error( 'updateCell aborted, tbody missing or not within the indicated table' );
1398
1404
  }
1399
1405
  c.table.isUpdating = false;
@@ -1416,7 +1422,7 @@
1416
1422
  // row contained in the table?
1417
1423
  ( ts.getClosest( $row, 'table' )[ 0 ] !== c.table )
1418
1424
  ) {
1419
- if ( c.debug ) {
1425
+ if ( ts.debug(c, 'core') ) {
1420
1426
  console.error( 'addRows method requires (1) a jQuery selector reference to rows that have already ' +
1421
1427
  'been added to the table, or (2) row HTML string to be added to a table with only one tbody' );
1422
1428
  }
@@ -1488,7 +1494,6 @@
1488
1494
  appendCache : function( c, init ) {
1489
1495
  var parsed, totalRows, $tbody, $curTbody, rowIndex, tbodyIndex, appendTime,
1490
1496
  table = c.table,
1491
- wo = c.widgetOptions,
1492
1497
  $tbodies = c.$tbodies,
1493
1498
  rows = [],
1494
1499
  cache = c.cache;
@@ -1498,7 +1503,7 @@
1498
1503
  return c.appender ? c.appender( table, rows ) :
1499
1504
  table.isUpdating ? c.$table.triggerHandler( 'updateComplete', table ) : ''; // Fixes #532
1500
1505
  }
1501
- if ( c.debug ) {
1506
+ if ( ts.debug(c, 'core') ) {
1502
1507
  appendTime = new Date();
1503
1508
  }
1504
1509
  for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
@@ -1511,7 +1516,7 @@
1511
1516
  for ( rowIndex = 0; rowIndex < totalRows; rowIndex++ ) {
1512
1517
  rows[rows.length] = parsed[ rowIndex ][ c.columns ].$row;
1513
1518
  // removeRows used by the pager plugin; don't render if using ajax - fixes #411
1514
- if ( !c.appender || ( c.pager && ( !c.pager.removeRows || !wo.pager_removeRows ) && !c.pager.ajax ) ) {
1519
+ if ( !c.appender || ( c.pager && !c.pager.removeRows && !c.pager.ajax ) ) {
1515
1520
  $curTbody.append( parsed[ rowIndex ][ c.columns ].$row );
1516
1521
  }
1517
1522
  }
@@ -1522,7 +1527,7 @@
1522
1527
  if ( c.appender ) {
1523
1528
  c.appender( table, rows );
1524
1529
  }
1525
- if ( c.debug ) {
1530
+ if ( ts.debug(c, 'core') ) {
1526
1531
  console.log( 'Rebuilt table' + ts.benchmark( appendTime ) );
1527
1532
  }
1528
1533
  // apply table widgets; but not before ajax completes
@@ -1553,7 +1558,7 @@
1553
1558
  initSort : function( c, cell, event ) {
1554
1559
  if ( c.table.isUpdating ) {
1555
1560
  // let any updates complete before initializing a sort
1556
- return setTimeout( function(){
1561
+ return setTimeout( function() {
1557
1562
  ts.initSort( c, cell, event );
1558
1563
  }, 50 );
1559
1564
  }
@@ -1704,7 +1709,7 @@
1704
1709
  // empty table - fixes #206/#346
1705
1710
  return;
1706
1711
  }
1707
- if ( c.debug ) { sortTime = new Date(); }
1712
+ if ( ts.debug(c, 'core') ) { sortTime = new Date(); }
1708
1713
  // cache textSorter to optimize speed
1709
1714
  if ( typeof textSorter === 'object' ) {
1710
1715
  colMax = c.columns;
@@ -1766,7 +1771,7 @@
1766
1771
  return a[ c.columns ].order - b[ c.columns ].order;
1767
1772
  });
1768
1773
  }
1769
- if ( c.debug ) {
1774
+ if ( ts.debug(c, 'core') ) {
1770
1775
  console.log( 'Applying sort ' + sortList.toString() + ts.benchmark( sortTime ) );
1771
1776
  }
1772
1777
  },
@@ -2019,6 +2024,7 @@
2019
2024
  var applied, time, name,
2020
2025
  c = table.config,
2021
2026
  wo = c.widgetOptions,
2027
+ debug = ts.debug(c, 'core'),
2022
2028
  widget = ts.getWidgetById( id );
2023
2029
  if ( widget ) {
2024
2030
  name = widget.id;
@@ -2027,7 +2033,7 @@
2027
2033
  if ( $.inArray( name, c.widgets ) < 0 ) {
2028
2034
  c.widgets[ c.widgets.length ] = name;
2029
2035
  }
2030
- if ( c.debug ) { time = new Date(); }
2036
+ if ( debug ) { time = new Date(); }
2031
2037
 
2032
2038
  if ( init || !( c.widgetInit[ name ] ) ) {
2033
2039
  // set init flag first to prevent calling init more than once (e.g. pager)
@@ -2038,7 +2044,7 @@
2038
2044
  }
2039
2045
  if ( typeof widget.init === 'function' ) {
2040
2046
  applied = true;
2041
- if ( c.debug ) {
2047
+ if ( debug ) {
2042
2048
  console[ console.group ? 'group' : 'log' ]( 'Initializing ' + name + ' widget' );
2043
2049
  }
2044
2050
  widget.init( table, widget, c, wo );
@@ -2046,12 +2052,12 @@
2046
2052
  }
2047
2053
  if ( !init && typeof widget.format === 'function' ) {
2048
2054
  applied = true;
2049
- if ( c.debug ) {
2055
+ if ( debug ) {
2050
2056
  console[ console.group ? 'group' : 'log' ]( 'Updating ' + name + ' widget' );
2051
2057
  }
2052
2058
  widget.format( table, c, wo, false );
2053
2059
  }
2054
- if ( c.debug ) {
2060
+ if ( debug ) {
2055
2061
  if ( applied ) {
2056
2062
  console.log( 'Completed ' + ( init ? 'initializing ' : 'applying ' ) + name + ' widget' + ts.benchmark( time ) );
2057
2063
  if ( console.groupEnd ) { console.groupEnd(); }
@@ -2064,12 +2070,13 @@
2064
2070
  table = $( table )[ 0 ]; // in case this is called externally
2065
2071
  var indx, len, names, widget, time,
2066
2072
  c = table.config,
2073
+ debug = ts.debug(c, 'core'),
2067
2074
  widgets = [];
2068
2075
  // prevent numerous consecutive widget applications
2069
2076
  if ( init !== false && table.hasInitialized && ( table.isApplyingWidgets || table.isUpdating ) ) {
2070
2077
  return;
2071
2078
  }
2072
- if ( c.debug ) { time = new Date(); }
2079
+ if ( debug ) { time = new Date(); }
2073
2080
  ts.addWidgetFromClass( table );
2074
2081
  // prevent "tablesorter-ready" from firing multiple times in a row
2075
2082
  clearTimeout( c.timerReady );
@@ -2088,7 +2095,7 @@
2088
2095
  // set priority to 10 if not defined
2089
2096
  if ( !widget.priority ) { widget.priority = 10; }
2090
2097
  widgets[ indx ] = widget;
2091
- } else if ( c.debug ) {
2098
+ } else if ( debug ) {
2092
2099
  console.warn( '"' + names[ indx ] + '" was enabled, but the widget code has not been loaded!' );
2093
2100
  }
2094
2101
  }
@@ -2098,7 +2105,7 @@
2098
2105
  });
2099
2106
  // add/update selected widgets
2100
2107
  len = widgets.length;
2101
- if ( c.debug ) {
2108
+ if ( debug ) {
2102
2109
  console[ console.group ? 'group' : 'log' ]( 'Start ' + ( init ? 'initializing' : 'applying' ) + ' widgets' );
2103
2110
  }
2104
2111
  for ( indx = 0; indx < len; indx++ ) {
@@ -2107,7 +2114,7 @@
2107
2114
  ts.applyWidgetId( table, widget.id, init );
2108
2115
  }
2109
2116
  }
2110
- if ( c.debug && console.groupEnd ) { console.groupEnd(); }
2117
+ if ( debug && console.groupEnd ) { console.groupEnd(); }
2111
2118
  }
2112
2119
  c.timerReady = setTimeout( function() {
2113
2120
  table.isApplyingWidgets = false;
@@ -2117,7 +2124,7 @@
2117
2124
  if ( !init && typeof callback === 'function' ) {
2118
2125
  callback( table );
2119
2126
  }
2120
- if ( c.debug ) {
2127
+ if ( debug ) {
2121
2128
  widget = c.widgets.length;
2122
2129
  console.log( 'Completed ' +
2123
2130
  ( init === true ? 'initializing ' : 'applying ' ) + widget +
@@ -2154,7 +2161,7 @@
2154
2161
  c.widgets.splice( indx, 1 );
2155
2162
  }
2156
2163
  if ( widget && widget.remove ) {
2157
- if ( c.debug ) {
2164
+ if ( ts.debug(c, 'core') ) {
2158
2165
  console.log( ( refreshing ? 'Refreshing' : 'Removing' ) + ' "' + name[ index ] + '" widget' );
2159
2166
  }
2160
2167
  widget.remove( table, c, c.widgetOptions, refreshing );
@@ -2208,6 +2215,12 @@
2208
2215
  log : function() {
2209
2216
  console.log( arguments );
2210
2217
  },
2218
+ debug : function(c, name) {
2219
+ return c && (
2220
+ c.debug === true ||
2221
+ typeof c.debug === 'string' && c.debug.indexOf(name) > -1
2222
+ );
2223
+ },
2211
2224
 
2212
2225
  // $.isEmptyObject from jQuery v1.4
2213
2226
  isEmptyObject : function( obj ) {
@@ -2513,7 +2526,7 @@
2513
2526
  ignore = 'headers sortForce sortList sortAppend widgets'.split( ' ' ),
2514
2527
  orig = c.originalSettings;
2515
2528
  if ( orig ) {
2516
- if ( c.debug ) {
2529
+ if ( ts.debug(c, 'core') ) {
2517
2530
  timer = new Date();
2518
2531
  }
2519
2532
  for ( setting in orig ) {
@@ -2529,7 +2542,7 @@
2529
2542
  }
2530
2543
  }
2531
2544
  }
2532
- if ( c.debug ) {
2545
+ if ( ts.debug(c, 'core') ) {
2533
2546
  console.log( 'validate options time:' + ts.benchmark( timer ) );
2534
2547
  }
2535
2548
  }
@@ -2560,7 +2573,6 @@
2560
2573
  var events,
2561
2574
  $t = $( table ),
2562
2575
  c = table.config,
2563
- debug = c.debug,
2564
2576
  $h = $t.find( 'thead:first' ),
2565
2577
  $r = $h.find( 'tr.' + ts.css.headerRow ).removeClass( ts.css.headerRow + ' ' + c.cssHeaderRow ),
2566
2578
  $f = $t.find( 'tfoot:first > tr' ).children( 'th, td' );
@@ -2598,7 +2610,7 @@
2598
2610
  if ( typeof callback === 'function' ) {
2599
2611
  callback( table );
2600
2612
  }
2601
- if ( debug ) {
2613
+ if ( ts.debug(c, 'core') ) {
2602
2614
  console.log( 'tablesorter has been removed' );
2603
2615
  }
2604
2616
  }
@@ -2715,7 +2727,7 @@
2715
2727
  is : function( str ) {
2716
2728
  return ts.regex.isoDate.test( str );
2717
2729
  },
2718
- format : function( str, table ) {
2730
+ format : function( str ) {
2719
2731
  var date = str ? new Date( str.replace( ts.regex.dash, '/' ) ) : str;
2720
2732
  return date instanceof Date && isFinite( date ) ? date.getTime() : str;
2721
2733
  },
@@ -2758,7 +2770,7 @@
2758
2770
  // Jan 01, 2013 12:34:56 PM or 01 Jan 2013
2759
2771
  return ts.regex.usLongDateTest1.test( str ) || ts.regex.usLongDateTest2.test( str );
2760
2772
  },
2761
- format : function( str, table ) {
2773
+ format : function( str ) {
2762
2774
  var date = str ? new Date( str.replace( ts.regex.dateReplace, '$1 $2' ) ) : str;
2763
2775
  return date instanceof Date && isFinite( date ) ? date.getTime() : str;
2764
2776
  },
@@ -2819,7 +2831,7 @@
2819
2831
  is : function( str ) {
2820
2832
  return ts.regex.timeTest.test( str );
2821
2833
  },
2822
- format : function( str, table ) {
2834
+ format : function( str ) {
2823
2835
  // isolate time... ignore month, day and year
2824
2836
  var temp,
2825
2837
  timePart = ( str || '' ).match( ts.regex.timeMatch ),
@@ -2886,7 +2898,7 @@
2886
2898
  var tbodyIndex, $tbody,
2887
2899
  $tbodies = c.$tbodies,
2888
2900
  toRemove = ( wo.zebra || [ 'even', 'odd' ] ).join( ' ' );
2889
- for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ){
2901
+ for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
2890
2902
  $tbody = ts.processTbody( table, $tbodies.eq( tbodyIndex ), true ); // remove tbody
2891
2903
  $tbody.children().removeClass( toRemove );
2892
2904
  ts.processTbody( table, $tbody, false ); // restore tbody
@@ -2896,7 +2908,7 @@
2896
2908
 
2897
2909
  })( jQuery );
2898
2910
 
2899
- /*! Widget: storage - updated 4/18/2017 (v2.28.8) */
2911
+ /*! Widget: storage - updated 2018-03-18 (v2.30.0) */
2900
2912
  /*global JSON:false */
2901
2913
  ;(function ($, window, document) {
2902
2914
  'use strict';
@@ -2942,6 +2954,7 @@
2942
2954
  values = {},
2943
2955
  c = table.config,
2944
2956
  wo = c && c.widgetOptions,
2957
+ debug = ts.debug(c, 'storage'),
2945
2958
  storageType = (
2946
2959
  ( options && options.storageType ) || ( wo && wo.storage_storageType )
2947
2960
  ).toString().charAt(0).toLowerCase(),
@@ -2970,14 +2983,12 @@
2970
2983
  hasStorage = true;
2971
2984
  window[storageType].removeItem('_tmptest');
2972
2985
  } catch (error) {
2973
- if (c && c.debug) {
2974
- console.warn( storageType + ' is not supported in this browser' );
2975
- }
2986
+ console.warn( storageType + ' is not supported in this browser' );
2976
2987
  }
2977
2988
  }
2978
2989
  }
2979
- if (c.debug) {
2980
- console.log('Storage widget using', hasStorage ? storageType : 'cookies');
2990
+ if (debug) {
2991
+ console.log('Storage >> Using', hasStorage ? storageType : 'cookies');
2981
2992
  }
2982
2993
  // *** get value ***
2983
2994
  if ($.parseJSON) {
@@ -3013,7 +3024,7 @@
3013
3024
 
3014
3025
  })(jQuery, window, document);
3015
3026
 
3016
- /*! Widget: uitheme - updated 9/27/2017 (v2.29.0) */
3027
+ /*! Widget: uitheme - updated 2018-03-18 (v2.30.0) */
3017
3028
  ;(function ($) {
3018
3029
  'use strict';
3019
3030
  var ts = $.tablesorter || {};
@@ -3078,8 +3089,9 @@
3078
3089
  theme = c.theme || 'jui',
3079
3090
  themes = themesAll[theme] || {},
3080
3091
  remove = $.trim( [ themes.sortNone, themes.sortDesc, themes.sortAsc, themes.active ].join( ' ' ) ),
3081
- iconRmv = $.trim( [ themes.iconSortNone, themes.iconSortDesc, themes.iconSortAsc ].join( ' ' ) );
3082
- if (c.debug) { time = new Date(); }
3092
+ iconRmv = $.trim( [ themes.iconSortNone, themes.iconSortDesc, themes.iconSortAsc ].join( ' ' ) ),
3093
+ debug = ts.debug(c, 'uitheme');
3094
+ if (debug) { time = new Date(); }
3083
3095
  // initialization code - run once
3084
3096
  if (!$table.hasClass('tablesorter-' + theme) || c.theme !== c.appliedTheme || !wo.uitheme_applied) {
3085
3097
  wo.uitheme_applied = true;
@@ -3124,7 +3136,7 @@
3124
3136
  $(this)[ event.type === 'mouseenter' ? 'addClass' : 'removeClass' ](themes.hover || '');
3125
3137
  });
3126
3138
 
3127
- $headers.each(function(){
3139
+ $headers.each(function() {
3128
3140
  var $this = $(this);
3129
3141
  if (!$this.find('.' + ts.css.wrapper).length) {
3130
3142
  // Firefox needs this inner div to position the icon & resizer correctly
@@ -3182,8 +3194,8 @@
3182
3194
  }
3183
3195
  }
3184
3196
  }
3185
- if (c.debug) {
3186
- console.log('Applying ' + theme + ' theme' + ts.benchmark(time));
3197
+ if (debug) {
3198
+ console.log('uitheme >> Applied ' + theme + ' theme' + ts.benchmark(time));
3187
3199
  }
3188
3200
  },
3189
3201
  remove: function(table, c, wo, refreshing) {
@@ -3288,7 +3300,7 @@
3288
3300
 
3289
3301
  })(jQuery);
3290
3302
 
3291
- /*! Widget: filter - updated 2018-01-30 (v2.29.5) *//*
3303
+ /*! Widget: filter - updated 2018-03-18 (v2.30.0) *//*
3292
3304
  * Requires tablesorter v2.8+ and jQuery 1.7+
3293
3305
  * by Rob Garrison
3294
3306
  */
@@ -3570,6 +3582,7 @@
3570
3582
  if ( tsfRegex.exact.test( data.iFilter ) ) {
3571
3583
  var txt = data.iFilter.replace( tsfRegex.exact, '' ),
3572
3584
  filter = tsf.parseFilter( c, txt, data ) || '';
3585
+ // eslint-disable-next-line eqeqeq
3573
3586
  return data.anyMatch ? $.inArray( filter, data.rowArray ) >= 0 : filter == data.iExact;
3574
3587
  }
3575
3588
  return null;
@@ -3743,7 +3756,7 @@
3743
3756
  c.lastCombinedFilter = null;
3744
3757
  c.lastSearch = [];
3745
3758
  // update filterFormatters after update (& small delay) - Fixes #1237
3746
- setTimeout(function(){
3759
+ setTimeout(function() {
3747
3760
  c.$table.triggerHandler( 'filterFomatterUpdate' );
3748
3761
  }, 100);
3749
3762
  }
@@ -3837,7 +3850,7 @@
3837
3850
 
3838
3851
  // show processing icon
3839
3852
  if ( c.showProcessing ) {
3840
- txt = 'filterStart filterEnd '.split( ' ' ).join( c.namespace + 'filter ' );
3853
+ txt = 'filterStart filterEnd '.split( ' ' ).join( c.namespace + 'filter-sp ' );
3841
3854
  c.$table
3842
3855
  .unbind( txt.replace( ts.regex.spaces, ' ' ) )
3843
3856
  .bind( txt, function( event, columns ) {
@@ -3916,6 +3929,9 @@
3916
3929
  c.lastSearch = c.$table.data( 'lastSearch' );
3917
3930
  c.$table.triggerHandler( 'filterInit', c );
3918
3931
  tsf.findRows( c.table, c.lastSearch || [] );
3932
+ if (ts.debug(c, 'filter')) {
3933
+ console.log('Filter >> Widget initialized');
3934
+ }
3919
3935
  };
3920
3936
  if ( $.isEmptyObject( wo.filter_formatter ) ) {
3921
3937
  completed();
@@ -4616,6 +4632,7 @@
4616
4632
  storedFilters = $.extend( [], filters ),
4617
4633
  c = table.config,
4618
4634
  wo = c.widgetOptions,
4635
+ debug = ts.debug(c, 'filter'),
4619
4636
  // data object passed to filters; anyMatch is a flag for the filters
4620
4637
  data = {
4621
4638
  anyMatch: false,
@@ -4632,7 +4649,6 @@
4632
4649
  defaultColFilter : [],
4633
4650
  defaultAnyFilter : ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) || ''
4634
4651
  };
4635
-
4636
4652
  // parse columns after formatter, in case the class is added at that point
4637
4653
  data.parsed = [];
4638
4654
  for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) {
@@ -4654,8 +4670,8 @@
4654
4670
  ( ts.getColumnData( table, wo.filter_excludeFilter, columnIndex, true ) || '' ).split( /\s+/ );
4655
4671
  }
4656
4672
 
4657
- if ( c.debug ) {
4658
- console.log( 'Filter: Starting filter widget search', filters );
4673
+ if ( debug ) {
4674
+ console.log( 'Filter >> Starting filter widget search', filters );
4659
4675
  time = new Date();
4660
4676
  }
4661
4677
  // filtered rows count
@@ -4753,8 +4769,8 @@
4753
4769
  notFiltered = $rows.not( '.' + wo.filter_filteredRow ).length;
4754
4770
  // can't search when all rows are hidden - this happens when looking for exact matches
4755
4771
  if ( searchFiltered && notFiltered === 0 ) { searchFiltered = false; }
4756
- if ( c.debug ) {
4757
- console.log( 'Filter: Searching through ' +
4772
+ if ( debug ) {
4773
+ console.log( 'Filter >> Searching through ' +
4758
4774
  ( searchFiltered && notFiltered < len ? notFiltered : 'all' ) + ' rows' );
4759
4775
  }
4760
4776
  if ( data.anyMatchFlag ) {
@@ -4857,8 +4873,8 @@
4857
4873
  if ( wo.filter_saveFilters && ts.storage ) {
4858
4874
  ts.storage( table, 'tablesorter-filters', tsf.processFilters( storedFilters, true ) );
4859
4875
  }
4860
- if ( c.debug ) {
4861
- console.log( 'Completed filter widget search' + ts.benchmark(time) );
4876
+ if ( debug ) {
4877
+ console.log( 'Filter >> Completed search' + ts.benchmark(time) );
4862
4878
  }
4863
4879
  if ( wo.filter_initialized ) {
4864
4880
  c.$table.triggerHandler( 'filterBeforeEnd', c );
@@ -5073,13 +5089,13 @@
5073
5089
  options += '<option';
5074
5090
  for ( val in option ) {
5075
5091
  if ( option.hasOwnProperty( val ) && val !== 'text' ) {
5076
- options += ' ' + val + '="' + option[ val ] + '"';
5092
+ options += ' ' + val + '="' + option[ val ].replace( tsfRegex.quote, '&quot;' ) + '"';
5077
5093
  }
5078
5094
  }
5079
5095
  if ( !option.value ) {
5080
- options += ' value="' + option.text + '"';
5096
+ options += ' value="' + option.text.replace( tsfRegex.quote, '&quot;' ) + '"';
5081
5097
  }
5082
- options += '>' + option.text + '</option>';
5098
+ options += '>' + option.text.replace( tsfRegex.quote, '&quot;' ) + '</option>';
5083
5099
  // above code is needed in jQuery < v1.8
5084
5100
 
5085
5101
  // make sure we don't turn an object into a string (objects without a "text" property)
@@ -5363,7 +5379,7 @@
5363
5379
  $stickyThead = $stickyTable.children('thead:first'),
5364
5380
  $stickyCells,
5365
5381
  laststate = '',
5366
- setWidth = function($orig, $clone){
5382
+ setWidth = function($orig, $clone) {
5367
5383
  var index, width, border, $cell, $this,
5368
5384
  $cells = $orig.filter(':visible'),
5369
5385
  len = $cells.length;
@@ -5504,7 +5520,7 @@
5504
5520
  });
5505
5521
  c.$table
5506
5522
  .unbind('stickyHeadersUpdate' + namespace)
5507
- .bind('stickyHeadersUpdate' + namespace, function(){
5523
+ .bind('stickyHeadersUpdate' + namespace, function() {
5508
5524
  scrollSticky( true );
5509
5525
  });
5510
5526
 
@@ -5580,7 +5596,7 @@
5580
5596
  });
5581
5597
 
5582
5598
  // Add extra scroller css
5583
- $(function(){
5599
+ $(function() {
5584
5600
  var s = '<style>' +
5585
5601
  'body.' + ts.css.resizableNoSelect + ' { -ms-user-select: none; -moz-user-select: -moz-none;' +
5586
5602
  '-khtml-user-select: none; -webkit-user-select: none; user-select: none; }' +
@@ -5725,7 +5741,7 @@
5725
5741
 
5726
5742
  if ( ts.hasWidget( c.table, 'scroller' ) ) {
5727
5743
  tableHeight = 0;
5728
- c.$table.closest( '.' + ts.css.scrollerWrap ).children().each(function(){
5744
+ c.$table.closest( '.' + ts.css.scrollerWrap ).children().each(function() {
5729
5745
  var $this = $(this);
5730
5746
  // center table has a max-height set
5731
5747
  tableHeight += $this.filter('[style*="height"]').length ? $this.height() : $this.children('table').height();
@@ -5947,7 +5963,7 @@
5947
5963
  });
5948
5964
 
5949
5965
  ts.resizableReset = function( table, refreshing ) {
5950
- $( table ).each(function(){
5966
+ $( table ).each(function() {
5951
5967
  var index, $t,
5952
5968
  c = this.config,
5953
5969
  wo = c && c.widgetOptions,
@@ -5981,7 +5997,7 @@
5981
5997
 
5982
5998
  })( jQuery, window );
5983
5999
 
5984
- /*! Widget: saveSort - updated 10/31/2015 (v2.24.0) *//*
6000
+ /*! Widget: saveSort - updated 2018-03-19 (v2.30.1) *//*
5985
6001
  * Requires tablesorter v2.16+
5986
6002
  * by Rob Garrison
5987
6003
  */
@@ -5989,6 +6005,15 @@
5989
6005
  'use strict';
5990
6006
  var ts = $.tablesorter || {};
5991
6007
 
6008
+ function getStoredSortList(c) {
6009
+ var stored = ts.storage( c.table, 'tablesorter-savesort' );
6010
+ return (stored && stored.hasOwnProperty('sortList') && $.isArray(stored.sortList)) ? stored.sortList : [];
6011
+ }
6012
+
6013
+ function sortListChanged(c, sortList) {
6014
+ return (sortList || getStoredSortList(c)).join(',') !== c.sortList.join(',');
6015
+ }
6016
+
5992
6017
  // this widget saves the last sort only if the
5993
6018
  // saveSort widget option is true AND the
5994
6019
  // $.tablesorter.storage function is included
@@ -6004,18 +6029,19 @@
6004
6029
  thisWidget.format(table, c, wo, true);
6005
6030
  },
6006
6031
  format: function(table, c, wo, init) {
6007
- var stored, time,
6032
+ var time,
6008
6033
  $table = c.$table,
6009
6034
  saveSort = wo.saveSort !== false, // make saveSort active/inactive; default to true
6010
- sortList = { 'sortList' : c.sortList };
6011
- if (c.debug) {
6035
+ sortList = { 'sortList' : c.sortList },
6036
+ debug = ts.debug(c, 'saveSort');
6037
+ if (debug) {
6012
6038
  time = new Date();
6013
6039
  }
6014
6040
  if ($table.hasClass('hasSaveSort')) {
6015
- if (saveSort && table.hasInitialized && ts.storage) {
6041
+ if (saveSort && table.hasInitialized && ts.storage && sortListChanged(c)) {
6016
6042
  ts.storage( table, 'tablesorter-savesort', sortList );
6017
- if (c.debug) {
6018
- console.log('saveSort widget: Saving last sort: ' + c.sortList + ts.benchmark(time));
6043
+ if (debug) {
6044
+ console.log('saveSort >> Saving last sort: ' + c.sortList + ts.benchmark(time));
6019
6045
  }
6020
6046
  }
6021
6047
  } else {
@@ -6024,10 +6050,9 @@
6024
6050
  sortList = '';
6025
6051
  // get data
6026
6052
  if (ts.storage) {
6027
- stored = ts.storage( table, 'tablesorter-savesort' );
6028
- sortList = (stored && stored.hasOwnProperty('sortList') && $.isArray(stored.sortList)) ? stored.sortList : '';
6029
- if (c.debug) {
6030
- console.log('saveSort: Last sort loaded: "' + sortList + '"' + ts.benchmark(time));
6053
+ sortList = getStoredSortList(c);
6054
+ if (debug) {
6055
+ console.log('saveSort >> Last sort loaded: "' + sortList + '"' + ts.benchmark(time));
6031
6056
  }
6032
6057
  $table.bind('saveSortReset', function(event) {
6033
6058
  event.stopPropagation();
@@ -6040,7 +6065,9 @@
6040
6065
  c.sortList = sortList;
6041
6066
  } else if (table.hasInitialized && sortList && sortList.length > 0) {
6042
6067
  // update sort change
6043
- ts.sortOn( c, sortList );
6068
+ if (sortListChanged(c, sortList)) {
6069
+ ts.sortOn(c, sortList);
6070
+ }
6044
6071
  }
6045
6072
  }
6046
6073
  },