jquery-tablesorter 1.21.4 → 1.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (25) 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/images/jquery-tablesorter/bootstrap-black-unsorted.png +0 -0
  5. data/vendor/assets/images/jquery-tablesorter/metro-black-asc.png +0 -0
  6. data/vendor/assets/images/jquery-tablesorter/metro-black-desc.png +0 -0
  7. data/vendor/assets/images/jquery-tablesorter/metro-white-asc.png +0 -0
  8. data/vendor/assets/images/jquery-tablesorter/metro-white-desc.png +0 -0
  9. data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.combined.js +63 -43
  10. data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.js +33 -21
  11. data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets.js +30 -22
  12. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-columnSelector.js +62 -24
  13. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-currentSort.js +60 -0
  14. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter.js +13 -10
  15. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-grouping.js +3 -3
  16. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-mark.js +135 -0
  17. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-math.js +24 -15
  18. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-output.js +4 -4
  19. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-scroller.js +4 -2
  20. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-stickyHeaders.js +10 -5
  21. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-uitheme.js +4 -4
  22. data/vendor/assets/stylesheets/jquery-tablesorter/theme.bootstrap.css +2 -2
  23. data/vendor/assets/stylesheets/jquery-tablesorter/theme.bootstrap_2.css +2 -2
  24. data/vendor/assets/stylesheets/jquery-tablesorter/theme.materialize.css +176 -0
  25. metadata +5 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00d5cfb816cce8b645193c850e6ae99698cb2516
4
- data.tar.gz: 5af380402f10f667792a92c6fff45c6675ad963b
3
+ metadata.gz: 99189ff9a2249c96239ce0a4d41da038186e1cde
4
+ data.tar.gz: 679942012457965ded688309186e319f21ef60a9
5
5
  SHA512:
6
- metadata.gz: 910fb98292ba03abcbe9936aa464912c2c320665aed95906e681ce9ea07ee60c398be04b65094cc743518c99e3dbc83cb3deaa2f987affc5d65176601028d5f3
7
- data.tar.gz: c40b9a23019d3ef3d0ec431f50c6ef2bef63f5fb375257f36d50d6baeb425b15b5cc1b69453fb9015e405d0fcb962cbe20c71a27340090865c2a19efe6ca6670
6
+ metadata.gz: 770c688cdc640feea77d202e70ed0052c83e6fdf8941e3bac493037c6a01f5ef17beede2a6cca63314d183ea6a7e73c9b4d80e417ab050bc0f5621717dc32a1f
7
+ data.tar.gz: 1396e2d506b053424f68fef6700fb7e6f9169c629635e89b71043c54dd7360bb739f2b1a3ddb7b2a47e9a6ff82708ad650f4bd327ea245c335e600ec4e904e9b
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Simple integration of jquery-tablesorter into the asset pipeline.
6
6
 
7
- Current tablesorter version: 2.26.6 (7/11/2016), [documentation]
7
+ Current tablesorter version: 2.27.1 (7/31/2016), [documentation]
8
8
 
9
9
  Any issue associated with the js/css files, please report to [Mottie's fork].
10
10
 
@@ -1,7 +1,7 @@
1
1
  module JqueryTablesorter
2
2
  MAJOR = 1
3
- MINOR = 21
4
- TINY = 4
3
+ MINOR = 22
4
+ TINY = 0
5
5
 
6
6
  VERSION = [MAJOR, MINOR, TINY].compact.join('.')
7
7
  end
@@ -4,7 +4,7 @@
4
4
  ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀██
5
5
  █████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
6
6
  */
7
- /*! tablesorter (FORK) - updated 07-11-2016 (v2.26.6)*/
7
+ /*! tablesorter (FORK) - updated 07-31-2016 (v2.27.1)*/
8
8
  /* Includes widgets ( storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort ) */
9
9
  (function(factory) {
10
10
  if (typeof define === 'function' && define.amd) {
@@ -14,16 +14,16 @@
14
14
  } else {
15
15
  factory(jQuery);
16
16
  }
17
- }(function($) {
17
+ }(function(jQuery) {
18
18
 
19
- /*! TableSorter (FORK) v2.26.6 *//*
19
+ /*! TableSorter (FORK) v2.27.1 *//*
20
20
  * Client-side table sorting with ease!
21
21
  * @requires jQuery v1.2.6+
22
22
  *
23
23
  * Copyright (c) 2007 Christian Bach
24
24
  * fork maintained by Rob Garrison
25
25
  *
26
- * Examples and docs at: http://tablesorter.com
26
+ * Examples and original docs at: http://tablesorter.com
27
27
  * Dual licensed under the MIT and GPL licenses:
28
28
  * http://www.opensource.org/licenses/mit-license.php
29
29
  * http://www.gnu.org/licenses/gpl.html
@@ -33,13 +33,14 @@
33
33
  * @cat Plugins/Tablesorter
34
34
  * @author Christian Bach - christian.bach@polyester.se
35
35
  * @contributor Rob Garrison - https://github.com/Mottie/tablesorter
36
+ * @docs (fork) - https://mottie.github.io/tablesorter/docs/
36
37
  */
37
38
  /*jshint browser:true, jquery:true, unused:false, expr: true */
38
39
  ;( function( $ ) {
39
40
  'use strict';
40
41
  var ts = $.tablesorter = {
41
42
 
42
- version : '2.26.6',
43
+ version : '2.27.1',
43
44
 
44
45
  parsers : [],
45
46
  widgets : [],
@@ -580,19 +581,19 @@
580
581
  }
581
582
  column = parseInt( $elem.attr( 'data-column' ), 10 );
582
583
  elem.column = column;
583
- tmp = ts.getData( $elem, configHeaders, 'sortInitialOrder' ) || c.sortInitialOrder;
584
+ tmp = ts.getOrder( ts.getData( $elem, configHeaders, 'sortInitialOrder' ) || c.sortInitialOrder );
584
585
  // this may get updated numerous times if there are multiple rows
585
586
  c.sortVars[ column ] = {
586
587
  count : -1, // set to -1 because clicking on the header automatically adds one
587
- order: ts.getOrder( tmp ) ?
588
- [ 1, 0, 2 ] : // desc, asc, unsorted
589
- [ 0, 1, 2 ], // asc, desc, unsorted
588
+ order: tmp ?
589
+ ( c.sortReset ? [ 1, 0, 2 ] : [ 1, 0 ] ) : // desc, asc, unsorted
590
+ ( c.sortReset ? [ 0, 1, 2 ] : [ 0, 1 ] ), // asc, desc, unsorted
590
591
  lockedOrder : false
591
592
  };
592
593
  tmp = ts.getData( $elem, configHeaders, 'lockedOrder' ) || false;
593
594
  if ( typeof tmp !== 'undefined' && tmp !== false ) {
594
595
  c.sortVars[ column ].lockedOrder = true;
595
- c.sortVars[ column ].order = ts.getOrder( tmp ) ? [ 1, 1, 1 ] : [ 0, 0, 0 ];
596
+ c.sortVars[ column ].order = ts.getOrder( tmp ) ? [ 1, 1 ] : [ 0, 0 ];
596
597
  }
597
598
  // add cell to headerList
598
599
  c.headerList[ index ] = elem;
@@ -900,6 +901,10 @@
900
901
  /** Add the table data to main data array */
901
902
  $row = $( $tbody[ tbodyIndex ].rows[ rowIndex ] );
902
903
  cols = [];
904
+ // ignore "remove-me" rows
905
+ if ( $row.hasClass( c.selectorRemove.slice(1) ) ) {
906
+ continue;
907
+ }
903
908
  // if this is a child row, add it to the last row's children and continue to the next row
904
909
  // ignore child row class, if it is the first row
905
910
  if ( $row.hasClass( c.cssChildRow ) && rowIndex !== 0 ) {
@@ -991,7 +996,8 @@
991
996
  if ( c.debug ) {
992
997
  len = Math.min( 5, c.cache[ 0 ].normalized.length );
993
998
  console[ console.group ? 'group' : 'log' ]( 'Building cache for ' + c.totalRows +
994
- ' rows (showing ' + len + ' rows in log)' + ts.benchmark( cacheTime ) );
999
+ ' rows (showing ' + len + ' rows in log) and ' + c.columns + ' columns' +
1000
+ ts.benchmark( cacheTime ) );
995
1001
  val = {};
996
1002
  for ( colIndex = 0; colIndex < c.columns; colIndex++ ) {
997
1003
  for ( cacheIndex = 0; cacheIndex < len; cacheIndex++ ) {
@@ -1142,6 +1148,7 @@
1142
1148
  setColumnAriaLabel : function( c, $header, nextSort ) {
1143
1149
  if ( $header.length ) {
1144
1150
  var column = parseInt( $header.attr( 'data-column' ), 10 ),
1151
+ vars = c.sortVars[ column ],
1145
1152
  tmp = $header.hasClass( ts.css.sortAsc ) ?
1146
1153
  'sortAsc' :
1147
1154
  $header.hasClass( ts.css.sortDesc ) ? 'sortDesc' : 'sortNone',
@@ -1149,7 +1156,8 @@
1149
1156
  if ( $header.hasClass( 'sorter-false' ) || nextSort === false ) {
1150
1157
  txt += ts.language.sortDisabled;
1151
1158
  } else {
1152
- nextSort = c.sortVars[ column ].order[ ( c.sortVars[ column ].count + 1 ) % ( c.sortReset ? 3 : 2 ) ];
1159
+ tmp = ( vars.count + 1 ) % vars.order.length;
1160
+ nextSort = vars.order[ tmp ];
1153
1161
  // if nextSort
1154
1162
  txt += ts.language[ nextSort === 0 ? 'nextAsc' : nextSort === 1 ? 'nextDesc' : 'nextNone' ];
1155
1163
  }
@@ -1208,7 +1216,12 @@
1208
1216
  // set order if not already defined - due to colspan header without associated header cell
1209
1217
  // adding this check prevents a javascript error
1210
1218
  if ( !c.sortVars[ col ].order ) {
1211
- order = c.sortVars[ col ].order = ts.getOrder( c.sortInitialOrder ) ? [ 1, 0, 2 ] : [ 0, 1, 2 ];
1219
+ if ( ts.getOrder( c.sortInitialOrder ) ) {
1220
+ order = c.sortReset ? [ 1, 0, 2 ] : [ 1, 0 ];
1221
+ } else {
1222
+ order = c.sortReset ? [ 0, 1, 2 ] : [ 0, 1 ];
1223
+ }
1224
+ c.sortVars[ col ].order = order;
1212
1225
  c.sortVars[ col ].count = 0;
1213
1226
  }
1214
1227
 
@@ -1225,12 +1238,12 @@
1225
1238
  dir = primary || 0;
1226
1239
  break;
1227
1240
  case 'o' :
1228
- temp = order[ ( primary || 0 ) % ( c.sortReset ? 3 : 2 ) ];
1241
+ temp = order[ ( primary || 0 ) % order.length ];
1229
1242
  // opposite of primary column; but resets if primary resets
1230
1243
  dir = temp === 0 ? 1 : temp === 1 ? 0 : 2;
1231
1244
  break;
1232
1245
  case 'n' :
1233
- dir = order[ ( ++c.sortVars[ col ].count ) % ( c.sortReset ? 3 : 2 ) ];
1246
+ dir = order[ ( ++c.sortVars[ col ].count ) % order.length ];
1234
1247
  break;
1235
1248
  default : // ascending
1236
1249
  dir = 0;
@@ -1240,7 +1253,7 @@
1240
1253
  group = [ col, parseInt( dir, 10 ) || 0 ];
1241
1254
  c.sortList[ c.sortList.length ] = group;
1242
1255
  dir = $.inArray( group[ 1 ], order ); // fixes issue #167
1243
- c.sortVars[ col ].count = dir >= 0 ? dir : group[ 1 ] % ( c.sortReset ? 3 : 2 );
1256
+ c.sortVars[ col ].count = dir >= 0 ? dir : group[ 1 ] % order.length;
1244
1257
  }
1245
1258
  }
1246
1259
  },
@@ -1503,8 +1516,8 @@
1503
1516
  // Only call sortStart if sorting is enabled
1504
1517
  c.$table.triggerHandler( 'sortStart', table );
1505
1518
  // get current column sort order
1506
- c.sortVars[ col ].count =
1507
- event[ c.sortResetKey ] ? 2 : ( c.sortVars[ col ].count + 1 ) % ( c.sortReset ? 3 : 2 );
1519
+ tmp = ( c.sortVars[ col ].count + 1 ) % order.length;
1520
+ c.sortVars[ col ].count = event[ c.sortResetKey ] ? 2 : tmp;
1508
1521
  // reset all sorts on non-current column - issue #30
1509
1522
  if ( c.sortRestart ) {
1510
1523
  for ( headerIndx = 0; headerIndx < len; headerIndx++ ) {
@@ -1599,7 +1612,7 @@
1599
1612
  dir = tmp === 0 ? 1 : 0;
1600
1613
  break;
1601
1614
  case 'n' :
1602
- dir = ( tmp + 1 ) % ( c.sortReset ? 3 : 2 );
1615
+ dir = ( tmp + 1 ) % order.length;
1603
1616
  break;
1604
1617
  default:
1605
1618
  dir = 0;
@@ -2117,7 +2130,7 @@
2117
2130
  ▀████▀ ██ ██ ██████ ██ ██ ██ ██████ █████▀
2118
2131
  */
2119
2132
  benchmark : function( diff ) {
2120
- return ( ' ( ' + ( new Date().getTime() - diff.getTime() ) + 'ms )' );
2133
+ return ( ' (' + ( new Date().getTime() - diff.getTime() ) + ' ms)' );
2121
2134
  },
2122
2135
  // deprecated ts.log
2123
2136
  log : function() {
@@ -2546,8 +2559,8 @@
2546
2559
 
2547
2560
  // too many protocols to add them all https://en.wikipedia.org/wiki/URI_scheme
2548
2561
  // now, this regex can be updated before initialization
2549
- ts.regex.urlProtocolTest = /^(https?|ftp|file):\/\//;
2550
- ts.regex.urlProtocolReplace = /(https?|ftp|file):\/\//;
2562
+ ts.regex.urlProtocolTest = /^(https?|ftp|file):\/\//;
2563
+ ts.regex.urlProtocolReplace = /(https?|ftp|file):\/\/(www\.)?/;
2551
2564
  ts.addParser({
2552
2565
  id : 'url',
2553
2566
  is : function( str ) {
@@ -2556,7 +2569,6 @@
2556
2569
  format : function( str ) {
2557
2570
  return str ? $.trim( str.replace( ts.regex.urlProtocolReplace, '' ) ) : str;
2558
2571
  },
2559
- parsed : true, // filter widget flag
2560
2572
  type : 'text'
2561
2573
  });
2562
2574
 
@@ -2839,7 +2851,7 @@
2839
2851
 
2840
2852
  })(jQuery, window, document);
2841
2853
 
2842
- /*! Widget: uitheme - updated 7/11/2016 (v2.26.6) */
2854
+ /*! Widget: uitheme - updated 7/31/2016 (v2.27.0) */
2843
2855
  ;(function ($) {
2844
2856
  'use strict';
2845
2857
  var ts = $.tablesorter || {};
@@ -2878,9 +2890,9 @@
2878
2890
  hover : 'ui-state-hover', // hover class
2879
2891
  // icon class names
2880
2892
  icons : 'ui-icon', // icon class added to the <i> in the header
2881
- iconSortNone : 'ui-icon-carat-2-n-s', // class name added to icon when column is not sorted
2882
- iconSortAsc : 'ui-icon-carat-1-n', // class name added to icon when column has ascending sort
2883
- iconSortDesc : 'ui-icon-carat-1-s', // class name added to icon when column has descending sort
2893
+ iconSortNone : 'ui-icon-carat-2-n-s ui-icon-caret-2-n-s', // class name added to icon when column is not sorted
2894
+ iconSortAsc : 'ui-icon-carat-1-n ui-icon-caret-1-n', // class name added to icon when column has ascending sort
2895
+ iconSortDesc : 'ui-icon-carat-1-s ui-icon-caret-1-s', // class name added to icon when column has descending sort
2884
2896
  filterRow : '',
2885
2897
  footerRow : '',
2886
2898
  footerCells : '',
@@ -3114,7 +3126,7 @@
3114
3126
 
3115
3127
  })(jQuery);
3116
3128
 
3117
- /*! Widget: filter - updated 7/11/2016 (v2.26.6) *//*
3129
+ /*! Widget: filter - updated 7/31/2016 (v2.27.0) *//*
3118
3130
  * Requires tablesorter v2.8+ and jQuery 1.7+
3119
3131
  * by Rob Garrison
3120
3132
  */
@@ -3210,7 +3222,7 @@
3210
3222
 
3211
3223
  // regex used in filter 'check' functions - not for general use and not documented
3212
3224
  regex: {
3213
- regex : /^\/((?:\\\/|[^\/])+)\/([mig]{0,3})?$/, // regex to test for regex
3225
+ regex : /^\/((?:\\\/|[^\/])+)\/([migyu]{0,5})?$/, // regex to test for regex
3214
3226
  child : /tablesorter-childRow/, // child row class name; this gets updated in the script
3215
3227
  filtered : /filtered/, // filtered (hidden) row class name; updated in the script
3216
3228
  type : /undefined|number/, // check type
@@ -3553,6 +3565,8 @@
3553
3565
  // force a new search since content has changed
3554
3566
  c.lastCombinedFilter = null;
3555
3567
  c.lastSearch = [];
3568
+ // update filterFormatters after update - Fixes #1237
3569
+ c.$table.triggerHandler( 'filterFomatterUpdate' );
3556
3570
  }
3557
3571
  // pass true ( skipFirst ) to prevent the tablesorter.setFilters function from skipping the first
3558
3572
  // input ensures all inputs are updated when a search is triggered on the table
@@ -3717,8 +3731,10 @@
3717
3731
  count = 0,
3718
3732
  completed = function() {
3719
3733
  wo.filter_initialized = true;
3734
+ // update lastSearch - it gets cleared often
3735
+ c.lastSearch = c.$table.data( 'lastSearch' );
3720
3736
  c.$table.triggerHandler( 'filterInit', c );
3721
- tsf.findRows( c.table, c.$table.data( 'lastSearch' ) || [] );
3737
+ tsf.findRows( c.table, c.lastSearch || [] );
3722
3738
  };
3723
3739
  if ( $.isEmptyObject( wo.filter_formatter ) ) {
3724
3740
  completed();
@@ -4203,6 +4219,7 @@
4203
4219
  fxn, ffxn, txt,
4204
4220
  wo = c.widgetOptions,
4205
4221
  showRow = true,
4222
+ hasAnyMatchInput = wo.filter_$anyMatch && wo.filter_$anyMatch.length,
4206
4223
 
4207
4224
  // if wo.filter_$anyMatch data-column attribute is changed dynamically
4208
4225
  // we don't want to do an "anyMatch" search on one column using data
@@ -4212,11 +4229,11 @@
4212
4229
  tsf.multipleColumns( c, wo.filter_$anyMatch ) :
4213
4230
  [];
4214
4231
  data.$cells = data.$row.children();
4215
- if ( data.anyMatchFlag && columnIndex.length > 1 || data.anyMatchFilter ) {
4232
+ if ( data.anyMatchFlag && columnIndex.length > 1 || ( data.anyMatchFilter && !hasAnyMatchInput ) ) {
4216
4233
  data.anyMatch = true;
4217
4234
  data.isMatch = true;
4218
4235
  data.rowArray = data.$cells.map( function( i ) {
4219
- if ( $.inArray( i, columnIndex ) > -1 || data.anyMatchFilter ) {
4236
+ if ( $.inArray( i, columnIndex ) > -1 || ( data.anyMatchFilter && !hasAnyMatchInput ) ) {
4220
4237
  if ( data.parsed[ i ] ) {
4221
4238
  txt = data.cacheArray[ i ];
4222
4239
  } else {
@@ -4506,6 +4523,7 @@
4506
4523
  }
4507
4524
 
4508
4525
  data.$row = $rows.eq( rowIndex );
4526
+ data.rowIndex = rowIndex;
4509
4527
  data.cacheArray = norm_rows[ rowIndex ];
4510
4528
  rowData = data.cacheArray[ c.columns ];
4511
4529
  data.rawArray = rowData.raw;
@@ -4861,7 +4879,7 @@
4861
4879
 
4862
4880
  ts.getFilters = function( table, getRaw, setFilters, skipFirst ) {
4863
4881
  var i, $filters, $column, cols,
4864
- filters = false,
4882
+ filters = [],
4865
4883
  c = table ? $( table )[0].config : '',
4866
4884
  wo = c ? c.widgetOptions : '';
4867
4885
  if ( ( getRaw !== true && wo && !wo.filter_columnFilters ) ||
@@ -4927,9 +4945,6 @@
4927
4945
  }
4928
4946
  }
4929
4947
  }
4930
- if ( filters.length === 0 ) {
4931
- filters = false;
4932
- }
4933
4948
  return filters;
4934
4949
  };
4935
4950
 
@@ -4947,12 +4962,12 @@
4947
4962
  tsf.searching( c.table, filter, skipFirst );
4948
4963
  c.$table.triggerHandler( 'filterFomatterUpdate' );
4949
4964
  }
4950
- return !!valid;
4965
+ return valid.length !== 0;
4951
4966
  };
4952
4967
 
4953
4968
  })( jQuery );
4954
4969
 
4955
- /*! Widget: stickyHeaders - updated 5/1/2016 (v2.26.0) *//*
4970
+ /*! Widget: stickyHeaders - updated 7/31/2016 (v2.27.0) *//*
4956
4971
  * Requires tablesorter v2.8+ and jQuery 1.4.3+
4957
4972
  * by Rob Garrison
4958
4973
  */
@@ -5015,10 +5030,11 @@
5015
5030
  // **************************
5016
5031
  ts.addWidget({
5017
5032
  id: 'stickyHeaders',
5018
- priority: 60, // sticky widget must be initialized after the filter widget!
5033
+ priority: 55, // sticky widget must be initialized after the filter widget!
5019
5034
  options: {
5020
5035
  stickyHeaders : '', // extra class name added to the sticky header row
5021
- stickyHeaders_attachTo : null, // jQuery selector or object to attach sticky header to
5036
+ stickyHeaders_appendTo : null, // jQuery selector or object to phycially attach the sticky headers
5037
+ stickyHeaders_attachTo : null, // jQuery selector or object to attach scroll listener to (overridden by xScroll & yScroll settings)
5022
5038
  stickyHeaders_xScroll : null, // jQuery selector or object to monitor horizontal scroll position (defaults: xScroll > attachTo > window)
5023
5039
  stickyHeaders_yScroll : null, // jQuery selector or object to monitor vertical scroll position (defaults: yScroll > attachTo > window)
5024
5040
  stickyHeaders_offset : 0, // number or jquery selector targeting the position:fixed element
@@ -5169,8 +5185,12 @@
5169
5185
 
5170
5186
  ts.bindEvents(table, $stickyThead.children().children('.' + ts.css.header));
5171
5187
 
5172
- // add stickyheaders AFTER the table. If the table is selected by ID, the original one (first) will be returned.
5173
- $table.after( $stickyWrap );
5188
+ if (wo.stickyHeaders_appendTo) {
5189
+ $(wo.stickyHeaders_appendTo).append( $stickyWrap );
5190
+ } else {
5191
+ // add stickyheaders AFTER the table. If the table is selected by ID, the original one (first) will be returned.
5192
+ $table.after( $stickyWrap );
5193
+ }
5174
5194
 
5175
5195
  // onRenderHeader is defined, we need to do something about it (fixes #641)
5176
5196
  if (c.onRenderHeader) {
@@ -5716,5 +5736,5 @@
5716
5736
 
5717
5737
  })(jQuery);
5718
5738
 
5719
- return $.tablesorter;
5739
+ return jQuery.tablesorter;
5720
5740
  }));
@@ -1,11 +1,11 @@
1
- /*! TableSorter (FORK) v2.26.6 *//*
1
+ /*! TableSorter (FORK) v2.27.1 *//*
2
2
  * Client-side table sorting with ease!
3
3
  * @requires jQuery v1.2.6+
4
4
  *
5
5
  * Copyright (c) 2007 Christian Bach
6
6
  * fork maintained by Rob Garrison
7
7
  *
8
- * Examples and docs at: http://tablesorter.com
8
+ * Examples and original docs at: http://tablesorter.com
9
9
  * Dual licensed under the MIT and GPL licenses:
10
10
  * http://www.opensource.org/licenses/mit-license.php
11
11
  * http://www.gnu.org/licenses/gpl.html
@@ -15,13 +15,14 @@
15
15
  * @cat Plugins/Tablesorter
16
16
  * @author Christian Bach - christian.bach@polyester.se
17
17
  * @contributor Rob Garrison - https://github.com/Mottie/tablesorter
18
+ * @docs (fork) - https://mottie.github.io/tablesorter/docs/
18
19
  */
19
20
  /*jshint browser:true, jquery:true, unused:false, expr: true */
20
21
  ;( function( $ ) {
21
22
  'use strict';
22
23
  var ts = $.tablesorter = {
23
24
 
24
- version : '2.26.6',
25
+ version : '2.27.1',
25
26
 
26
27
  parsers : [],
27
28
  widgets : [],
@@ -562,19 +563,19 @@
562
563
  }
563
564
  column = parseInt( $elem.attr( 'data-column' ), 10 );
564
565
  elem.column = column;
565
- tmp = ts.getData( $elem, configHeaders, 'sortInitialOrder' ) || c.sortInitialOrder;
566
+ tmp = ts.getOrder( ts.getData( $elem, configHeaders, 'sortInitialOrder' ) || c.sortInitialOrder );
566
567
  // this may get updated numerous times if there are multiple rows
567
568
  c.sortVars[ column ] = {
568
569
  count : -1, // set to -1 because clicking on the header automatically adds one
569
- order: ts.getOrder( tmp ) ?
570
- [ 1, 0, 2 ] : // desc, asc, unsorted
571
- [ 0, 1, 2 ], // asc, desc, unsorted
570
+ order: tmp ?
571
+ ( c.sortReset ? [ 1, 0, 2 ] : [ 1, 0 ] ) : // desc, asc, unsorted
572
+ ( c.sortReset ? [ 0, 1, 2 ] : [ 0, 1 ] ), // asc, desc, unsorted
572
573
  lockedOrder : false
573
574
  };
574
575
  tmp = ts.getData( $elem, configHeaders, 'lockedOrder' ) || false;
575
576
  if ( typeof tmp !== 'undefined' && tmp !== false ) {
576
577
  c.sortVars[ column ].lockedOrder = true;
577
- c.sortVars[ column ].order = ts.getOrder( tmp ) ? [ 1, 1, 1 ] : [ 0, 0, 0 ];
578
+ c.sortVars[ column ].order = ts.getOrder( tmp ) ? [ 1, 1 ] : [ 0, 0 ];
578
579
  }
579
580
  // add cell to headerList
580
581
  c.headerList[ index ] = elem;
@@ -882,6 +883,10 @@
882
883
  /** Add the table data to main data array */
883
884
  $row = $( $tbody[ tbodyIndex ].rows[ rowIndex ] );
884
885
  cols = [];
886
+ // ignore "remove-me" rows
887
+ if ( $row.hasClass( c.selectorRemove.slice(1) ) ) {
888
+ continue;
889
+ }
885
890
  // if this is a child row, add it to the last row's children and continue to the next row
886
891
  // ignore child row class, if it is the first row
887
892
  if ( $row.hasClass( c.cssChildRow ) && rowIndex !== 0 ) {
@@ -973,7 +978,8 @@
973
978
  if ( c.debug ) {
974
979
  len = Math.min( 5, c.cache[ 0 ].normalized.length );
975
980
  console[ console.group ? 'group' : 'log' ]( 'Building cache for ' + c.totalRows +
976
- ' rows (showing ' + len + ' rows in log)' + ts.benchmark( cacheTime ) );
981
+ ' rows (showing ' + len + ' rows in log) and ' + c.columns + ' columns' +
982
+ ts.benchmark( cacheTime ) );
977
983
  val = {};
978
984
  for ( colIndex = 0; colIndex < c.columns; colIndex++ ) {
979
985
  for ( cacheIndex = 0; cacheIndex < len; cacheIndex++ ) {
@@ -1124,6 +1130,7 @@
1124
1130
  setColumnAriaLabel : function( c, $header, nextSort ) {
1125
1131
  if ( $header.length ) {
1126
1132
  var column = parseInt( $header.attr( 'data-column' ), 10 ),
1133
+ vars = c.sortVars[ column ],
1127
1134
  tmp = $header.hasClass( ts.css.sortAsc ) ?
1128
1135
  'sortAsc' :
1129
1136
  $header.hasClass( ts.css.sortDesc ) ? 'sortDesc' : 'sortNone',
@@ -1131,7 +1138,8 @@
1131
1138
  if ( $header.hasClass( 'sorter-false' ) || nextSort === false ) {
1132
1139
  txt += ts.language.sortDisabled;
1133
1140
  } else {
1134
- nextSort = c.sortVars[ column ].order[ ( c.sortVars[ column ].count + 1 ) % ( c.sortReset ? 3 : 2 ) ];
1141
+ tmp = ( vars.count + 1 ) % vars.order.length;
1142
+ nextSort = vars.order[ tmp ];
1135
1143
  // if nextSort
1136
1144
  txt += ts.language[ nextSort === 0 ? 'nextAsc' : nextSort === 1 ? 'nextDesc' : 'nextNone' ];
1137
1145
  }
@@ -1190,7 +1198,12 @@
1190
1198
  // set order if not already defined - due to colspan header without associated header cell
1191
1199
  // adding this check prevents a javascript error
1192
1200
  if ( !c.sortVars[ col ].order ) {
1193
- order = c.sortVars[ col ].order = ts.getOrder( c.sortInitialOrder ) ? [ 1, 0, 2 ] : [ 0, 1, 2 ];
1201
+ if ( ts.getOrder( c.sortInitialOrder ) ) {
1202
+ order = c.sortReset ? [ 1, 0, 2 ] : [ 1, 0 ];
1203
+ } else {
1204
+ order = c.sortReset ? [ 0, 1, 2 ] : [ 0, 1 ];
1205
+ }
1206
+ c.sortVars[ col ].order = order;
1194
1207
  c.sortVars[ col ].count = 0;
1195
1208
  }
1196
1209
 
@@ -1207,12 +1220,12 @@
1207
1220
  dir = primary || 0;
1208
1221
  break;
1209
1222
  case 'o' :
1210
- temp = order[ ( primary || 0 ) % ( c.sortReset ? 3 : 2 ) ];
1223
+ temp = order[ ( primary || 0 ) % order.length ];
1211
1224
  // opposite of primary column; but resets if primary resets
1212
1225
  dir = temp === 0 ? 1 : temp === 1 ? 0 : 2;
1213
1226
  break;
1214
1227
  case 'n' :
1215
- dir = order[ ( ++c.sortVars[ col ].count ) % ( c.sortReset ? 3 : 2 ) ];
1228
+ dir = order[ ( ++c.sortVars[ col ].count ) % order.length ];
1216
1229
  break;
1217
1230
  default : // ascending
1218
1231
  dir = 0;
@@ -1222,7 +1235,7 @@
1222
1235
  group = [ col, parseInt( dir, 10 ) || 0 ];
1223
1236
  c.sortList[ c.sortList.length ] = group;
1224
1237
  dir = $.inArray( group[ 1 ], order ); // fixes issue #167
1225
- c.sortVars[ col ].count = dir >= 0 ? dir : group[ 1 ] % ( c.sortReset ? 3 : 2 );
1238
+ c.sortVars[ col ].count = dir >= 0 ? dir : group[ 1 ] % order.length;
1226
1239
  }
1227
1240
  }
1228
1241
  },
@@ -1485,8 +1498,8 @@
1485
1498
  // Only call sortStart if sorting is enabled
1486
1499
  c.$table.triggerHandler( 'sortStart', table );
1487
1500
  // get current column sort order
1488
- c.sortVars[ col ].count =
1489
- event[ c.sortResetKey ] ? 2 : ( c.sortVars[ col ].count + 1 ) % ( c.sortReset ? 3 : 2 );
1501
+ tmp = ( c.sortVars[ col ].count + 1 ) % order.length;
1502
+ c.sortVars[ col ].count = event[ c.sortResetKey ] ? 2 : tmp;
1490
1503
  // reset all sorts on non-current column - issue #30
1491
1504
  if ( c.sortRestart ) {
1492
1505
  for ( headerIndx = 0; headerIndx < len; headerIndx++ ) {
@@ -1581,7 +1594,7 @@
1581
1594
  dir = tmp === 0 ? 1 : 0;
1582
1595
  break;
1583
1596
  case 'n' :
1584
- dir = ( tmp + 1 ) % ( c.sortReset ? 3 : 2 );
1597
+ dir = ( tmp + 1 ) % order.length;
1585
1598
  break;
1586
1599
  default:
1587
1600
  dir = 0;
@@ -2099,7 +2112,7 @@
2099
2112
  ▀████▀ ██ ██ ██████ ██ ██ ██ ██████ █████▀
2100
2113
  */
2101
2114
  benchmark : function( diff ) {
2102
- return ( ' ( ' + ( new Date().getTime() - diff.getTime() ) + 'ms )' );
2115
+ return ( ' (' + ( new Date().getTime() - diff.getTime() ) + ' ms)' );
2103
2116
  },
2104
2117
  // deprecated ts.log
2105
2118
  log : function() {
@@ -2528,8 +2541,8 @@
2528
2541
 
2529
2542
  // too many protocols to add them all https://en.wikipedia.org/wiki/URI_scheme
2530
2543
  // now, this regex can be updated before initialization
2531
- ts.regex.urlProtocolTest = /^(https?|ftp|file):\/\//;
2532
- ts.regex.urlProtocolReplace = /(https?|ftp|file):\/\//;
2544
+ ts.regex.urlProtocolTest = /^(https?|ftp|file):\/\//;
2545
+ ts.regex.urlProtocolReplace = /(https?|ftp|file):\/\/(www\.)?/;
2533
2546
  ts.addParser({
2534
2547
  id : 'url',
2535
2548
  is : function( str ) {
@@ -2538,7 +2551,6 @@
2538
2551
  format : function( str ) {
2539
2552
  return str ? $.trim( str.replace( ts.regex.urlProtocolReplace, '' ) ) : str;
2540
2553
  },
2541
- parsed : true, // filter widget flag
2542
2554
  type : 'text'
2543
2555
  });
2544
2556