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
@@ -1,4 +1,4 @@
1
- /*! TableSorter (FORK) v2.29.6 *//*
1
+ /*! TableSorter (FORK) v2.30.1 *//*
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.29.6',
25
+ version : '2.30.1',
26
26
 
27
27
  parsers : [],
28
28
  widgets : [],
@@ -34,8 +34,8 @@
34
34
  showProcessing : false, // show an indeterminate timer icon in the header when the table is sorted or filtered.
35
35
 
36
36
  headerTemplate : '{content}',// header layout template (HTML ok); {content} = innerHTML, {icon} = <i/> // class from cssIcon
37
- onRenderTemplate : null, // function( index, template ){ return template; }, // template is a string
38
- onRenderHeader : null, // function( index ){}, // nothing to return
37
+ onRenderTemplate : null, // function( index, template ) { return template; }, // template is a string
38
+ onRenderHeader : null, // function( index ) {}, // nothing to return
39
39
 
40
40
  // *** functionality
41
41
  cancelSelection : true, // prevent text selection in the header
@@ -64,7 +64,7 @@
64
64
  emptyTo : 'bottom', // sort empty cell to bottom, top, none, zero, emptyMax, emptyMin
65
65
  stringTo : 'max', // sort strings in numerical column as max, min, top, bottom, zero
66
66
  duplicateSpan : true, // colspan cells in the tbody will have duplicated content in the cache for each spanned column
67
- textExtraction : 'basic', // text extraction method/function - function( node, table, cellIndex ){}
67
+ textExtraction : 'basic', // text extraction method/function - function( node, table, cellIndex ) {}
68
68
  textAttribute : 'data-text',// data-attribute that contains alternate cell text (used in default textExtraction function)
69
69
  textSorter : null, // choose overall or specific column sorter function( a, b, direction, table, columnIndex ) [alt: ts.sortText]
70
70
  numberSorter : null, // choose overall numeric sorter function( a, b, direction, maxColumnValue )
@@ -78,7 +78,7 @@
78
78
  },
79
79
 
80
80
  // *** callbacks
81
- initialized : null, // function( table ){},
81
+ initialized : null, // function( table ) {},
82
82
 
83
83
  // *** extra css class names
84
84
  tableClass : '',
@@ -216,7 +216,7 @@
216
216
  setup : function( table, c ) {
217
217
  // if no thead or tbody, or tablesorter is already present, quit
218
218
  if ( !table || !table.tHead || table.tBodies.length === 0 || table.hasInitialized === true ) {
219
- if ( c.debug ) {
219
+ if ( ts.debug(c, 'core') ) {
220
220
  if ( table.hasInitialized ) {
221
221
  console.warn( 'Stopping initialization. Tablesorter has already been initialized' );
222
222
  } else {
@@ -237,7 +237,7 @@
237
237
  table.config = c;
238
238
  // save the settings where they read
239
239
  $.data( table, 'tablesorter', c );
240
- if ( c.debug ) {
240
+ if ( ts.debug(c, 'core') ) {
241
241
  console[ console.group ? 'group' : 'log' ]( 'Initializing tablesorter v' + ts.version );
242
242
  $.data( table, 'startoveralltimer', new Date() );
243
243
  }
@@ -298,7 +298,10 @@
298
298
  ts.setupParsers( c );
299
299
  // start total row count at zero
300
300
  c.totalRows = 0;
301
- ts.validateOptions( c );
301
+ // only validate options while debugging. See #1528
302
+ if (c.debug) {
303
+ ts.validateOptions( c );
304
+ }
302
305
  // build the cache for the tbody cells
303
306
  // delayInit will delay building the cache until the user starts a sort
304
307
  if ( !c.delayInit ) { ts.buildCache( c ); }
@@ -343,9 +346,9 @@
343
346
  // initialized
344
347
  table.hasInitialized = true;
345
348
  table.isProcessing = false;
346
- if ( c.debug ) {
349
+ if ( ts.debug(c, 'core') ) {
347
350
  console.log( 'Overall initialization time:' + ts.benchmark( $.data( table, 'startoveralltimer' ) ) );
348
- if ( c.debug && console.groupEnd ) { console.groupEnd(); }
351
+ if ( ts.debug(c, 'core') && console.groupEnd ) { console.groupEnd(); }
349
352
  }
350
353
  $table.triggerHandler( 'tablesorter-initialized', table );
351
354
  if ( typeof c.initialized === 'function' ) {
@@ -542,7 +545,7 @@
542
545
  c.headerList = [];
543
546
  c.headerContent = [];
544
547
  c.sortVars = [];
545
- if ( c.debug ) {
548
+ if ( ts.debug(c, 'core') ) {
546
549
  timer = new Date();
547
550
  }
548
551
  // children tr in tfoot - see issue #196 & #547
@@ -637,7 +640,7 @@
637
640
  });
638
641
  // enable/disable sorting
639
642
  ts.updateHeader( c );
640
- if ( c.debug ) {
643
+ if ( ts.debug(c, 'core') ) {
641
644
  console.log( 'Built headers:' + ts.benchmark( timer ) );
642
645
  console.log( c.$headers );
643
646
  }
@@ -660,14 +663,15 @@
660
663
  noParser, parser, extractor, time, tbody, len,
661
664
  table = c.table,
662
665
  tbodyIndex = 0,
663
- debug = {};
666
+ debug = ts.debug(c, 'core'),
667
+ debugOutput = {};
664
668
  // update table bodies in case we start with an empty table
665
669
  c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' );
666
670
  tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies;
667
671
  len = tbody.length;
668
672
  if ( len === 0 ) {
669
- return c.debug ? console.warn( 'Warning: *Empty table!* Not building a parser cache' ) : '';
670
- } else if ( c.debug ) {
673
+ return debug ? console.warn( 'Warning: *Empty table!* Not building a parser cache' ) : '';
674
+ } else if ( debug ) {
671
675
  time = new Date();
672
676
  console[ console.group ? 'group' : 'log' ]( 'Detecting parsers for each column' );
673
677
  }
@@ -709,8 +713,8 @@
709
713
  if ( !parser ) {
710
714
  parser = ts.detectParserForColumn( c, rows, -1, colIndex );
711
715
  }
712
- if ( c.debug ) {
713
- debug[ '(' + colIndex + ') ' + header.text() ] = {
716
+ if ( debug ) {
717
+ debugOutput[ '(' + colIndex + ') ' + header.text() ] = {
714
718
  parser : parser.id,
715
719
  extractor : extractor ? extractor.id : 'none',
716
720
  string : c.strings[ colIndex ],
@@ -736,9 +740,9 @@
736
740
  }
737
741
  tbodyIndex += ( list.parsers.length ) ? len : 1;
738
742
  }
739
- if ( c.debug ) {
740
- if ( !ts.isEmptyObject( debug ) ) {
741
- console[ console.table ? 'table' : 'log' ]( debug );
743
+ if ( debug ) {
744
+ if ( !ts.isEmptyObject( debugOutput ) ) {
745
+ console[ console.table ? 'table' : 'log' ]( debugOutput );
742
746
  } else {
743
747
  console.warn( ' No parsers detected!' );
744
748
  }
@@ -764,7 +768,7 @@
764
768
  },
765
769
 
766
770
  getParserById : function( name ) {
767
- /*jshint eqeqeq:false */
771
+ /*jshint eqeqeq:false */ // eslint-disable-next-line eqeqeq
768
772
  if ( name == 'false' ) { return false; }
769
773
  var indx,
770
774
  len = ts.parsers.length;
@@ -781,6 +785,7 @@
781
785
  indx = ts.parsers.length,
782
786
  node = false,
783
787
  nodeValue = '',
788
+ debug = ts.debug(c, 'core'),
784
789
  keepLooking = true;
785
790
  while ( nodeValue === '' && keepLooking ) {
786
791
  rowIndex++;
@@ -791,7 +796,7 @@
791
796
  node = rows[ rowIndex ].cells[ cellIndex ];
792
797
  nodeValue = ts.getElementText( c, node, cellIndex );
793
798
  $node = $( node );
794
- if ( c.debug ) {
799
+ if ( debug ) {
795
800
  console.log( 'Checking if value was empty on row ' + rowIndex + ', column: ' +
796
801
  cellIndex + ': "' + nodeValue + '"' );
797
802
  }
@@ -873,7 +878,8 @@
873
878
  cols, $cells, cell, cacheTime, totalRows, rowData, prevRowData,
874
879
  colMax, span, cacheIndex, hasParser, max, len, index,
875
880
  table = c.table,
876
- parsers = c.parsers;
881
+ parsers = c.parsers,
882
+ debug = ts.debug(c, 'core');
877
883
  // update tbody variable
878
884
  c.$tbodies = c.$table.children( 'tbody:not(.' + c.cssInfoBlock + ')' );
879
885
  $tbody = typeof $tbodies === 'undefined' ? c.$tbodies : $tbodies,
@@ -881,9 +887,9 @@
881
887
  c.totalRows = 0;
882
888
  // if no parsers found, return - it's an empty table.
883
889
  if ( !parsers ) {
884
- return c.debug ? console.warn( 'Warning: *Empty table!* Not building a cache' ) : '';
890
+ return debug ? console.warn( 'Warning: *Empty table!* Not building a cache' ) : '';
885
891
  }
886
- if ( c.debug ) {
892
+ if ( debug ) {
887
893
  cacheTime = new Date();
888
894
  }
889
895
  // processing icon
@@ -952,7 +958,7 @@
952
958
  cell = $row[ 0 ].cells[ colIndex ];
953
959
  if ( cell && cacheIndex < c.columns ) {
954
960
  hasParser = typeof parsers[ cacheIndex ] !== 'undefined';
955
- if ( !hasParser && c.debug ) {
961
+ if ( !hasParser && debug ) {
956
962
  console.warn( 'No parser found for row: ' + rowIndex + ', column: ' + colIndex +
957
963
  '; cell containing: "' + $(cell).text() + '"; does it have a header?' );
958
964
  }
@@ -1000,7 +1006,7 @@
1000
1006
  if ( c.showProcessing ) {
1001
1007
  ts.isProcessing( table ); // remove processing icon
1002
1008
  }
1003
- if ( c.debug ) {
1009
+ if ( debug ) {
1004
1010
  len = Math.min( 5, c.cache[ 0 ].normalized.length );
1005
1011
  console[ console.group ? 'group' : 'log' ]( 'Building cache for ' + c.totalRows +
1006
1012
  ' rows (showing ' + len + ' rows in log) and ' + c.columns + ' columns' +
@@ -1031,7 +1037,7 @@
1031
1037
  data = { raw : [], parsed: [], $cell: [] },
1032
1038
  c = table.config;
1033
1039
  if ( ts.isEmptyObject( c ) ) {
1034
- if ( c.debug ) {
1040
+ if ( ts.debug(c, 'core') ) {
1035
1041
  console.warn( 'No cache found - aborting getColumnText function!' );
1036
1042
  }
1037
1043
  } else {
@@ -1125,8 +1131,8 @@
1125
1131
  // direction = 2 means reset!
1126
1132
  if ( list[ indx ][ 1 ] !== 2 ) {
1127
1133
  // multicolumn sorting updating - see #1005
1128
- // .not(function(){}) needs jQuery 1.4
1129
- // filter(function(i, el){}) <- el is undefined in jQuery v1.2.6
1134
+ // .not(function() {}) needs jQuery 1.4
1135
+ // filter(function(i, el) {}) <- el is undefined in jQuery v1.2.6
1130
1136
  $sorted = c.$headers.filter( function( i ) {
1131
1137
  // only include headers that are in the sortList (this includes colspans)
1132
1138
  var include = true,
@@ -1375,7 +1381,7 @@
1375
1381
  ts.resortComplete( c, callback );
1376
1382
  }
1377
1383
  } else {
1378
- if ( c.debug ) {
1384
+ if ( ts.debug(c, 'core') ) {
1379
1385
  console.error( 'updateCell aborted, tbody missing or not within the indicated table' );
1380
1386
  }
1381
1387
  c.table.isUpdating = false;
@@ -1398,7 +1404,7 @@
1398
1404
  // row contained in the table?
1399
1405
  ( ts.getClosest( $row, 'table' )[ 0 ] !== c.table )
1400
1406
  ) {
1401
- if ( c.debug ) {
1407
+ if ( ts.debug(c, 'core') ) {
1402
1408
  console.error( 'addRows method requires (1) a jQuery selector reference to rows that have already ' +
1403
1409
  'been added to the table, or (2) row HTML string to be added to a table with only one tbody' );
1404
1410
  }
@@ -1470,7 +1476,6 @@
1470
1476
  appendCache : function( c, init ) {
1471
1477
  var parsed, totalRows, $tbody, $curTbody, rowIndex, tbodyIndex, appendTime,
1472
1478
  table = c.table,
1473
- wo = c.widgetOptions,
1474
1479
  $tbodies = c.$tbodies,
1475
1480
  rows = [],
1476
1481
  cache = c.cache;
@@ -1480,7 +1485,7 @@
1480
1485
  return c.appender ? c.appender( table, rows ) :
1481
1486
  table.isUpdating ? c.$table.triggerHandler( 'updateComplete', table ) : ''; // Fixes #532
1482
1487
  }
1483
- if ( c.debug ) {
1488
+ if ( ts.debug(c, 'core') ) {
1484
1489
  appendTime = new Date();
1485
1490
  }
1486
1491
  for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
@@ -1493,7 +1498,7 @@
1493
1498
  for ( rowIndex = 0; rowIndex < totalRows; rowIndex++ ) {
1494
1499
  rows[rows.length] = parsed[ rowIndex ][ c.columns ].$row;
1495
1500
  // removeRows used by the pager plugin; don't render if using ajax - fixes #411
1496
- if ( !c.appender || ( c.pager && ( !c.pager.removeRows || !wo.pager_removeRows ) && !c.pager.ajax ) ) {
1501
+ if ( !c.appender || ( c.pager && !c.pager.removeRows && !c.pager.ajax ) ) {
1497
1502
  $curTbody.append( parsed[ rowIndex ][ c.columns ].$row );
1498
1503
  }
1499
1504
  }
@@ -1504,7 +1509,7 @@
1504
1509
  if ( c.appender ) {
1505
1510
  c.appender( table, rows );
1506
1511
  }
1507
- if ( c.debug ) {
1512
+ if ( ts.debug(c, 'core') ) {
1508
1513
  console.log( 'Rebuilt table' + ts.benchmark( appendTime ) );
1509
1514
  }
1510
1515
  // apply table widgets; but not before ajax completes
@@ -1535,7 +1540,7 @@
1535
1540
  initSort : function( c, cell, event ) {
1536
1541
  if ( c.table.isUpdating ) {
1537
1542
  // let any updates complete before initializing a sort
1538
- return setTimeout( function(){
1543
+ return setTimeout( function() {
1539
1544
  ts.initSort( c, cell, event );
1540
1545
  }, 50 );
1541
1546
  }
@@ -1686,7 +1691,7 @@
1686
1691
  // empty table - fixes #206/#346
1687
1692
  return;
1688
1693
  }
1689
- if ( c.debug ) { sortTime = new Date(); }
1694
+ if ( ts.debug(c, 'core') ) { sortTime = new Date(); }
1690
1695
  // cache textSorter to optimize speed
1691
1696
  if ( typeof textSorter === 'object' ) {
1692
1697
  colMax = c.columns;
@@ -1748,7 +1753,7 @@
1748
1753
  return a[ c.columns ].order - b[ c.columns ].order;
1749
1754
  });
1750
1755
  }
1751
- if ( c.debug ) {
1756
+ if ( ts.debug(c, 'core') ) {
1752
1757
  console.log( 'Applying sort ' + sortList.toString() + ts.benchmark( sortTime ) );
1753
1758
  }
1754
1759
  },
@@ -2001,6 +2006,7 @@
2001
2006
  var applied, time, name,
2002
2007
  c = table.config,
2003
2008
  wo = c.widgetOptions,
2009
+ debug = ts.debug(c, 'core'),
2004
2010
  widget = ts.getWidgetById( id );
2005
2011
  if ( widget ) {
2006
2012
  name = widget.id;
@@ -2009,7 +2015,7 @@
2009
2015
  if ( $.inArray( name, c.widgets ) < 0 ) {
2010
2016
  c.widgets[ c.widgets.length ] = name;
2011
2017
  }
2012
- if ( c.debug ) { time = new Date(); }
2018
+ if ( debug ) { time = new Date(); }
2013
2019
 
2014
2020
  if ( init || !( c.widgetInit[ name ] ) ) {
2015
2021
  // set init flag first to prevent calling init more than once (e.g. pager)
@@ -2020,7 +2026,7 @@
2020
2026
  }
2021
2027
  if ( typeof widget.init === 'function' ) {
2022
2028
  applied = true;
2023
- if ( c.debug ) {
2029
+ if ( debug ) {
2024
2030
  console[ console.group ? 'group' : 'log' ]( 'Initializing ' + name + ' widget' );
2025
2031
  }
2026
2032
  widget.init( table, widget, c, wo );
@@ -2028,12 +2034,12 @@
2028
2034
  }
2029
2035
  if ( !init && typeof widget.format === 'function' ) {
2030
2036
  applied = true;
2031
- if ( c.debug ) {
2037
+ if ( debug ) {
2032
2038
  console[ console.group ? 'group' : 'log' ]( 'Updating ' + name + ' widget' );
2033
2039
  }
2034
2040
  widget.format( table, c, wo, false );
2035
2041
  }
2036
- if ( c.debug ) {
2042
+ if ( debug ) {
2037
2043
  if ( applied ) {
2038
2044
  console.log( 'Completed ' + ( init ? 'initializing ' : 'applying ' ) + name + ' widget' + ts.benchmark( time ) );
2039
2045
  if ( console.groupEnd ) { console.groupEnd(); }
@@ -2046,12 +2052,13 @@
2046
2052
  table = $( table )[ 0 ]; // in case this is called externally
2047
2053
  var indx, len, names, widget, time,
2048
2054
  c = table.config,
2055
+ debug = ts.debug(c, 'core'),
2049
2056
  widgets = [];
2050
2057
  // prevent numerous consecutive widget applications
2051
2058
  if ( init !== false && table.hasInitialized && ( table.isApplyingWidgets || table.isUpdating ) ) {
2052
2059
  return;
2053
2060
  }
2054
- if ( c.debug ) { time = new Date(); }
2061
+ if ( debug ) { time = new Date(); }
2055
2062
  ts.addWidgetFromClass( table );
2056
2063
  // prevent "tablesorter-ready" from firing multiple times in a row
2057
2064
  clearTimeout( c.timerReady );
@@ -2070,7 +2077,7 @@
2070
2077
  // set priority to 10 if not defined
2071
2078
  if ( !widget.priority ) { widget.priority = 10; }
2072
2079
  widgets[ indx ] = widget;
2073
- } else if ( c.debug ) {
2080
+ } else if ( debug ) {
2074
2081
  console.warn( '"' + names[ indx ] + '" was enabled, but the widget code has not been loaded!' );
2075
2082
  }
2076
2083
  }
@@ -2080,7 +2087,7 @@
2080
2087
  });
2081
2088
  // add/update selected widgets
2082
2089
  len = widgets.length;
2083
- if ( c.debug ) {
2090
+ if ( debug ) {
2084
2091
  console[ console.group ? 'group' : 'log' ]( 'Start ' + ( init ? 'initializing' : 'applying' ) + ' widgets' );
2085
2092
  }
2086
2093
  for ( indx = 0; indx < len; indx++ ) {
@@ -2089,7 +2096,7 @@
2089
2096
  ts.applyWidgetId( table, widget.id, init );
2090
2097
  }
2091
2098
  }
2092
- if ( c.debug && console.groupEnd ) { console.groupEnd(); }
2099
+ if ( debug && console.groupEnd ) { console.groupEnd(); }
2093
2100
  }
2094
2101
  c.timerReady = setTimeout( function() {
2095
2102
  table.isApplyingWidgets = false;
@@ -2099,7 +2106,7 @@
2099
2106
  if ( !init && typeof callback === 'function' ) {
2100
2107
  callback( table );
2101
2108
  }
2102
- if ( c.debug ) {
2109
+ if ( debug ) {
2103
2110
  widget = c.widgets.length;
2104
2111
  console.log( 'Completed ' +
2105
2112
  ( init === true ? 'initializing ' : 'applying ' ) + widget +
@@ -2136,7 +2143,7 @@
2136
2143
  c.widgets.splice( indx, 1 );
2137
2144
  }
2138
2145
  if ( widget && widget.remove ) {
2139
- if ( c.debug ) {
2146
+ if ( ts.debug(c, 'core') ) {
2140
2147
  console.log( ( refreshing ? 'Refreshing' : 'Removing' ) + ' "' + name[ index ] + '" widget' );
2141
2148
  }
2142
2149
  widget.remove( table, c, c.widgetOptions, refreshing );
@@ -2190,6 +2197,12 @@
2190
2197
  log : function() {
2191
2198
  console.log( arguments );
2192
2199
  },
2200
+ debug : function(c, name) {
2201
+ return c && (
2202
+ c.debug === true ||
2203
+ typeof c.debug === 'string' && c.debug.indexOf(name) > -1
2204
+ );
2205
+ },
2193
2206
 
2194
2207
  // $.isEmptyObject from jQuery v1.4
2195
2208
  isEmptyObject : function( obj ) {
@@ -2495,7 +2508,7 @@
2495
2508
  ignore = 'headers sortForce sortList sortAppend widgets'.split( ' ' ),
2496
2509
  orig = c.originalSettings;
2497
2510
  if ( orig ) {
2498
- if ( c.debug ) {
2511
+ if ( ts.debug(c, 'core') ) {
2499
2512
  timer = new Date();
2500
2513
  }
2501
2514
  for ( setting in orig ) {
@@ -2511,7 +2524,7 @@
2511
2524
  }
2512
2525
  }
2513
2526
  }
2514
- if ( c.debug ) {
2527
+ if ( ts.debug(c, 'core') ) {
2515
2528
  console.log( 'validate options time:' + ts.benchmark( timer ) );
2516
2529
  }
2517
2530
  }
@@ -2542,7 +2555,6 @@
2542
2555
  var events,
2543
2556
  $t = $( table ),
2544
2557
  c = table.config,
2545
- debug = c.debug,
2546
2558
  $h = $t.find( 'thead:first' ),
2547
2559
  $r = $h.find( 'tr.' + ts.css.headerRow ).removeClass( ts.css.headerRow + ' ' + c.cssHeaderRow ),
2548
2560
  $f = $t.find( 'tfoot:first > tr' ).children( 'th, td' );
@@ -2580,7 +2592,7 @@
2580
2592
  if ( typeof callback === 'function' ) {
2581
2593
  callback( table );
2582
2594
  }
2583
- if ( debug ) {
2595
+ if ( ts.debug(c, 'core') ) {
2584
2596
  console.log( 'tablesorter has been removed' );
2585
2597
  }
2586
2598
  }
@@ -2697,7 +2709,7 @@
2697
2709
  is : function( str ) {
2698
2710
  return ts.regex.isoDate.test( str );
2699
2711
  },
2700
- format : function( str, table ) {
2712
+ format : function( str ) {
2701
2713
  var date = str ? new Date( str.replace( ts.regex.dash, '/' ) ) : str;
2702
2714
  return date instanceof Date && isFinite( date ) ? date.getTime() : str;
2703
2715
  },
@@ -2740,7 +2752,7 @@
2740
2752
  // Jan 01, 2013 12:34:56 PM or 01 Jan 2013
2741
2753
  return ts.regex.usLongDateTest1.test( str ) || ts.regex.usLongDateTest2.test( str );
2742
2754
  },
2743
- format : function( str, table ) {
2755
+ format : function( str ) {
2744
2756
  var date = str ? new Date( str.replace( ts.regex.dateReplace, '$1 $2' ) ) : str;
2745
2757
  return date instanceof Date && isFinite( date ) ? date.getTime() : str;
2746
2758
  },
@@ -2801,7 +2813,7 @@
2801
2813
  is : function( str ) {
2802
2814
  return ts.regex.timeTest.test( str );
2803
2815
  },
2804
- format : function( str, table ) {
2816
+ format : function( str ) {
2805
2817
  // isolate time... ignore month, day and year
2806
2818
  var temp,
2807
2819
  timePart = ( str || '' ).match( ts.regex.timeMatch ),
@@ -2868,7 +2880,7 @@
2868
2880
  var tbodyIndex, $tbody,
2869
2881
  $tbodies = c.$tbodies,
2870
2882
  toRemove = ( wo.zebra || [ 'even', 'odd' ] ).join( ' ' );
2871
- for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ){
2883
+ for ( tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) {
2872
2884
  $tbody = ts.processTbody( table, $tbodies.eq( tbodyIndex ), true ); // remove tbody
2873
2885
  $tbody.children().removeClass( toRemove );
2874
2886
  ts.processTbody( table, $tbody, false ); // restore tbody