jquery-tablesorter 1.14.0 → 1.14.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6dfe913d87203537e4c01799330730a0a5d07c76
4
- data.tar.gz: 4372b67de0d2b979cdd67be82de133141e02bb70
3
+ metadata.gz: 1d8960dc57d66b1ac1b240f8ec2a50bcd85a130d
4
+ data.tar.gz: 2ff7b825a32d597efe45f28ae8f52bc32a73f222
5
5
  SHA512:
6
- metadata.gz: 6ac07021042d37ed4bceca7f05ebd40b086ee7f5437fbc8de5dfd97bf81bb546c52818a6be7d8a674beaa35d7629a3e61970621db28db57bf8c758676249831d
7
- data.tar.gz: 7cbe44694d1091fc8a2a1c9666280ee4ea2580a414fb9bbb3b08adccfd660da3f07cbc0b88b0c9cd54f2a7d14e20c1d4afd1db790bcc047cc5012fd37f1a7b86
6
+ metadata.gz: 38e32b180cae97a545ddc52cf7f2f93fd5a5cf1a20d7a280b5a2e0cf2d7fcee64d0b9532ec17b9b63ff0a07ccfcdab5dc847171fe345bb883d818cd30c43938b
7
+ data.tar.gz: 0054a4c0676789cccb11959b59aa81c2dceb4e33b46a58cf496915f9ea954e768f27b7956446bde7c25596d86938a2316a2a3b90a34492da4dfb7d3e359ac142
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.19.0 (2/7/2015), [documentation]
7
+ Current tablesorter version: 2.19.1 (2/9/2015), [documentation]
8
8
 
9
9
  Any issue associated with the js/css files, please report to [Mottie's fork].
10
10
 
@@ -1,3 +1,3 @@
1
1
  module JqueryTablesorter
2
- VERSION = '1.14.0'
2
+ VERSION = '1.14.1'
3
3
  end
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * tablesorter (FORK) pager plugin
3
- * updated 2/7/2015 (v2.19.0)
3
+ * updated 2/9/2015 (v2.19.1)
4
4
  */
5
5
  /*jshint browser:true, jquery:true, unused:false */
6
6
  ;(function($) {
@@ -204,7 +204,7 @@
204
204
  if ($out.length) {
205
205
  $out[ ($out[0].tagName === 'INPUT') ? 'val' : 'html' ](s);
206
206
  // rebind startRow/page inputs
207
- $out.find('.ts-startRow, .ts-page').unbind('change').bind('change', function(){
207
+ $out.find('.ts-startRow, .ts-page').unbind('change.pager').bind('change.pager', function(){
208
208
  var v = $(this).val(),
209
209
  pg = $(this).hasClass('ts-startRow') ? Math.floor( v/p.size ) + 1 : v;
210
210
  c.$table.trigger('pageSet.pager', [ pg ]);
@@ -768,7 +768,7 @@
768
768
  table.config.appender = null; // remove pager appender function
769
769
  p.initialized = false;
770
770
  delete table.config.rowsCopy;
771
- $(table).unbind(pagerEvents.split(' ').join('.pager '));
771
+ $(table).unbind( $.trim(pagerEvents.split(' ').join('.pager ')) );
772
772
  if (ts.storage) {
773
773
  ts.storage(table, p.storageKey, '');
774
774
  }
@@ -848,7 +848,7 @@
848
848
  p.regexRows = new RegExp('(' + (wo.filter_filteredRow || 'filtered') + '|' + c.selectorRemove.slice(1) + '|' + c.cssChildRow + ')');
849
849
 
850
850
  $t
851
- .unbind(pagerEvents.split(' ').join('.pager '))
851
+ .unbind( $.trim(pagerEvents.split(' ').join('.pager ')) )
852
852
  .bind('filterInit.pager filterStart.pager', function(e, filters) {
853
853
  p.currentFilters = $.isArray(filters) ? filters : c.$table.data('lastSearch');
854
854
  // don't change page if filters are the same (pager updating, etc)
@@ -945,8 +945,8 @@
945
945
  p.$goto = pager.find(p.cssGoto);
946
946
  if ( p.$goto.length ) {
947
947
  p.$goto
948
- .unbind('change')
949
- .bind('change', function(){
948
+ .unbind('change.pager')
949
+ .bind('change.pager', function(){
950
950
  p.page = $(this).val() - 1;
951
951
  moveToPage(table, p, true);
952
952
  updatePageDisplay(table, p, false);
@@ -1,5 +1,5 @@
1
1
  /**!
2
- * TableSorter (FORK) 2.19.0 - Client-side table sorting with ease!
2
+ * TableSorter (FORK) 2.19.1 - Client-side table sorting with ease!
3
3
  * @requires jQuery v1.2.6+
4
4
  *
5
5
  * Copyright (c) 2007 Christian Bach
@@ -25,14 +25,14 @@
25
25
  factory(jQuery);
26
26
  }
27
27
  }(function($) {
28
- "use strict";
28
+ 'use strict';
29
29
  $.extend({
30
30
  /*jshint supernew:true */
31
31
  tablesorter: new function() {
32
32
 
33
33
  var ts = this;
34
34
 
35
- ts.version = "2.19.0";
35
+ ts.version = '2.19.1';
36
36
 
37
37
  ts.parsers = [];
38
38
  ts.widgets = [];
@@ -50,13 +50,13 @@
50
50
  // *** functionality
51
51
  cancelSelection : true, // prevent text selection in the header
52
52
  tabIndex : true, // add tabindex to header for keyboard accessibility
53
- dateFormat : 'mmddyyyy', // other options: "ddmmyyy" or "yyyymmdd"
53
+ dateFormat : 'mmddyyyy', // other options: 'ddmmyyy' or 'yyyymmdd'
54
54
  sortMultiSortKey : 'shiftKey', // key used to select additional columns
55
55
  sortResetKey : 'ctrlKey', // key used to remove sorting on a column
56
- usNumberFormat : true, // false for German "1.234.567,89" or French "1 234 567,89"
56
+ usNumberFormat : true, // false for German '1.234.567,89' or French '1 234 567,89'
57
57
  delayInit : false, // if false, the parsed table contents will not update until the first sort
58
58
  serverSideSorting: false, // if true, server-side sorting should be performed because client-side sorting will be disabled, but the ui and events will still be used.
59
- resort : true, // default setting to trigger a resort after an "update", "addRows", "updateCell", etc has completed
59
+ resort : true, // default setting to trigger a resort after an 'update', 'addRows', 'updateCell', etc has completed
60
60
 
61
61
  // *** sort options
62
62
  headers : {}, // set sorter, string, empty, locked order, sortInitialOrder, filter, etc.
@@ -69,7 +69,7 @@
69
69
  sortInitialOrder : 'asc', // sort direction on first click
70
70
  sortLocaleCompare: false, // replace equivalent character (accented characters)
71
71
  sortReset : false, // third click on the header will reset column to default - unsorted
72
- sortRestart : false, // restart sort to "sortInitialOrder" when clicking on previously unsorted columns
72
+ sortRestart : false, // restart sort to 'sortInitialOrder' when clicking on previously unsorted columns
73
73
 
74
74
  emptyTo : 'bottom', // sort empty cell to bottom, top, none, zero, emptyMax, emptyMin
75
75
  stringTo : 'max', // sort strings in numerical column as max, min, top, bottom, zero
@@ -121,7 +121,7 @@
121
121
  strings: {},
122
122
  parsers: []
123
123
 
124
- // removed: widgetZebra: { css: ["even", "odd"] }
124
+ // removed: widgetZebra: { css: ['even', 'odd'] }
125
125
 
126
126
  };
127
127
 
@@ -157,7 +157,7 @@
157
157
  function log() {
158
158
  var a = arguments[0],
159
159
  s = arguments.length > 1 ? Array.prototype.slice.call(arguments) : a;
160
- if (typeof console !== "undefined" && typeof console.log !== "undefined") {
160
+ if (typeof console !== 'undefined' && typeof console.log !== 'undefined') {
161
161
  console[ /error/i.test(a) ? 'error' : /warn/i.test(a) ? 'warn' : 'log' ](s);
162
162
  } else {
163
163
  alert(s);
@@ -165,7 +165,7 @@
165
165
  }
166
166
 
167
167
  function benchmark(s, d) {
168
- log(s + " (" + (new Date().getTime() - d.getTime()) + "ms)");
168
+ log(s + ' (' + (new Date().getTime() - d.getTime()) + 'ms)');
169
169
  }
170
170
 
171
171
  ts.log = log;
@@ -187,7 +187,7 @@
187
187
  c = table.config,
188
188
  t = c.textExtraction || '';
189
189
  if (typeof(t) === 'string') {
190
- // check data-attribute first when set to "basic"; don't use node.innerText - it's really slow!
190
+ // check data-attribute first when set to 'basic'; don't use node.innerText - it's really slow!
191
191
  return $.trim( (t === 'basic' ? $node.attr(c.textAttribute) || node.textContent : node.textContent ) || $node.text() || '' );
192
192
  } else {
193
193
  if (typeof(t) === 'function') {
@@ -236,7 +236,7 @@
236
236
  tb = c.$tbodies = c.$table.children('tbody:not(.' + c.cssInfoBlock + ')'),
237
237
  rows, list, l, i, h, ch, np, p, e, time,
238
238
  j = 0,
239
- parsersDebug = "",
239
+ parsersDebug = '',
240
240
  len = tb.length;
241
241
  if ( len === 0) {
242
242
  return c.debug ? log('Warning: *Empty table!* Not building a parser cache') : '';
@@ -275,7 +275,7 @@
275
275
  p = detectParserForColumn(table, rows, -1, i);
276
276
  }
277
277
  if (c.debug) {
278
- parsersDebug += "column:" + i + "; extractor:" + e.id + "; parser:" + p.id + "; string:" + c.strings[i] + '; empty: ' + c.empties[i] + "\n";
278
+ parsersDebug += 'column:' + i + '; extractor:' + e.id + '; parser:' + p.id + '; string:' + c.strings[i] + '; empty: ' + c.empties[i] + '\n';
279
279
  }
280
280
  list.parsers[i] = p;
281
281
  list.extractors[i] = e;
@@ -284,8 +284,8 @@
284
284
  j += (list.parsers.length) ? len : 1;
285
285
  }
286
286
  if (c.debug) {
287
- log(parsersDebug ? parsersDebug : "No parsers detected");
288
- benchmark("Completed detecting parsers", time);
287
+ log(parsersDebug ? parsersDebug : 'No parsers detected');
288
+ benchmark('Completed detecting parsers', time);
289
289
  }
290
290
  c.parsers = list.parsers;
291
291
  c.extractors = list.extractors;
@@ -315,7 +315,7 @@
315
315
  for (k = 0; k < $tb.length; k++) {
316
316
  colMax = []; // column max value per tbody
317
317
  cc = c.cache[k] = {
318
- normalized: [] // array of normalized row data; last entry contains "rowData" above
318
+ normalized: [] // array of normalized row data; last entry contains 'rowData' above
319
319
  // colMax: # // added at the end
320
320
  };
321
321
 
@@ -326,7 +326,8 @@
326
326
  rowData = {
327
327
  // order: original row order #
328
328
  // $row : jQuery Object[]
329
- child: [] // child row text (filter widget)
329
+ child: [], // child row text (filter widget)
330
+ raw: [] // original row text
330
331
  };
331
332
  /** Add the table data to main data array */
332
333
  $row = $($tb[k].rows[i]);
@@ -337,12 +338,12 @@
337
338
  if ($row.hasClass(c.cssChildRow) && i !== 0) {
338
339
  t = cc.normalized.length - 1;
339
340
  cc.normalized[t][c.columns].$row = cc.normalized[t][c.columns].$row.add($row);
340
- // add "hasChild" class name to parent row
341
+ // add 'hasChild' class name to parent row
341
342
  if (!$row.prev().hasClass(c.cssChildRow)) {
342
343
  $row.prev().addClass(ts.css.cssHasChild);
343
344
  }
344
345
  // save child row content (un-parsed!)
345
- rowData.child[t] = $.trim( $row[0].textContent || $row[0].innerText || $row.text() || "" );
346
+ rowData.child[t] = $.trim( $row[0].textContent || $row.text() || '' );
346
347
  // go to the next for loop
347
348
  continue;
348
349
  }
@@ -356,6 +357,7 @@
356
357
  continue;
357
358
  }
358
359
  t = getElementText(table, $row[0].cells[j], j);
360
+ rowData.raw.push(t); // save original row text
359
361
  // do extract before parsing if there is one
360
362
  if (typeof extractors[j].id === 'undefined') {
361
363
  tx = t;
@@ -366,7 +368,7 @@
366
368
  // in case the parser needs to extract data from the table cell attributes
367
369
  v = parsers[j].id === 'no-parser' ? '' : parsers[j].format(tx, table, $row[0].cells[j], j);
368
370
  cols.push( c.ignoreCase && typeof v === 'string' ? v.toLowerCase() : v );
369
- if ((parsers[j].type || '').toLowerCase() === "numeric") {
371
+ if ((parsers[j].type || '').toLowerCase() === 'numeric') {
370
372
  // determine column max value (ignore sign)
371
373
  colMax[j] = Math.max(Math.abs(v) || 0, colMax[j] || 0);
372
374
  }
@@ -384,7 +386,7 @@
384
386
  ts.isProcessing(table); // remove processing icon
385
387
  }
386
388
  if (c.debug) {
387
- benchmark("Building cache for " + totalRows + " rows", cacheTime);
389
+ benchmark('Building cache for ' + totalRows + ' rows', cacheTime);
388
390
  }
389
391
  }
390
392
 
@@ -401,7 +403,7 @@
401
403
  if (isEmptyObject(cc)) {
402
404
  // run pager appender in case the table was just emptied
403
405
  return c.appender ? c.appender(table, rows) :
404
- table.isUpdating ? c.$table.trigger("updateComplete", table) : ''; // Fixes #532
406
+ table.isUpdating ? c.$table.trigger('updateComplete', table) : ''; // Fixes #532
405
407
  }
406
408
  if (c.debug) {
407
409
  appendTime = new Date();
@@ -428,17 +430,17 @@
428
430
  c.appender(table, rows);
429
431
  }
430
432
  if (c.debug) {
431
- benchmark("Rebuilt table", appendTime);
433
+ benchmark('Rebuilt table', appendTime);
432
434
  }
433
435
  // apply table widgets; but not before ajax completes
434
436
  if (!init && !c.appender) { ts.applyWidget(table); }
435
437
  if (table.isUpdating) {
436
- c.$table.trigger("updateComplete", table);
438
+ c.$table.trigger('updateComplete', table);
437
439
  }
438
440
  }
439
441
 
440
442
  function formatSortingOrder(v) {
441
- // look for "d" in "desc" order; return true
443
+ // look for 'd' in 'desc' order; return true
442
444
  return (/^d/i.test(v) || v === 1);
443
445
  }
444
446
 
@@ -490,7 +492,7 @@
490
492
  // add to parent in case there are multiple rows
491
493
  $t.parent().addClass(ts.css.headerRow + ' ' + c.cssHeaderRow).attr('role', 'row');
492
494
  // allow keyboard cursor to focus on element
493
- if (c.tabIndex) { $t.attr("tabindex", 0); }
495
+ if (c.tabIndex) { $t.attr('tabindex', 0); }
494
496
  return elem;
495
497
  }));
496
498
  $(table).find(c.selectorHeaders).attr({
@@ -500,7 +502,7 @@
500
502
  // enable/disable sorting
501
503
  updateHeader(table);
502
504
  if (c.debug) {
503
- benchmark("Built headers:", time);
505
+ benchmark('Built headers:', time);
504
506
  log(c.$headers);
505
507
  }
506
508
  }
@@ -522,7 +524,7 @@
522
524
  c.$headers.each(function(index, th){
523
525
  $th = $(th);
524
526
  col = ts.getColumnData( table, c.headers, index, true );
525
- // add "sorter-false" class if "parser-false" is set
527
+ // add 'sorter-false' class if 'parser-false' is set
526
528
  s = ts.getData( th, col, 'sorter' ) === 'false' || ts.getData( th, col, 'parser' ) === 'false';
527
529
  th.sortDisabled = s;
528
530
  $th[ s ? 'addClass' : 'removeClass' ]('sorter-false').attr('aria-disabled', '' + s);
@@ -610,7 +612,7 @@
610
612
  t = 1;
611
613
  break;
612
614
  case 's': // same direction (as primary column)
613
- // if primary sort is set to "s", make it ascending
615
+ // if primary sort is set to 's', make it ascending
614
616
  t = primary || 0;
615
617
  break;
616
618
  case 'o':
@@ -649,7 +651,7 @@
649
651
  key = !event[c.sortMultiSortKey],
650
652
  $table = c.$table;
651
653
  // Only call sortStart if sorting is enabled
652
- $table.trigger("sortStart", table);
654
+ $table.trigger('sortStart', table);
653
655
  // get current column sort order
654
656
  cell.count = event[c.sortResetKey] ? 2 : (cell.count + 1) % (c.sortReset ? 3 : 2);
655
657
  // reset all sorts on non-current column - issue #30
@@ -736,14 +738,14 @@
736
738
  }
737
739
  }
738
740
  // sortBegin event triggered immediately before the sort
739
- $table.trigger("sortBegin", table);
741
+ $table.trigger('sortBegin', table);
740
742
  // setTimeout needed so the processing icon shows up
741
743
  setTimeout(function(){
742
744
  // set css for headers
743
745
  setHeadersCss(table);
744
746
  multisort(table);
745
747
  appendToTable(table);
746
- $table.trigger("sortEnd", table);
748
+ $table.trigger('sortEnd', table);
747
749
  }, 1);
748
750
  }
749
751
 
@@ -787,7 +789,7 @@
787
789
  num = (c.strings[col]) ? c.string[c.strings[col]] || 0 : 0;
788
790
  }
789
791
  // fall back to built-in numeric sort
790
- // var sort = $.tablesorter["sort" + s](table, a[c], b[c], c, colMax[c], dir);
792
+ // var sort = $.tablesorter['sort' + s](table, a[c], b[c], c, colMax[c], dir);
791
793
  sort = c.numberSorter ? c.numberSorter(a[col], b[col], dir, colMax[col], table) :
792
794
  ts[ 'sortNumeric' + (dir ? 'Asc' : 'Desc') ](a[col], b[col], num, colMax[col], col, table);
793
795
  } else {
@@ -811,7 +813,7 @@
811
813
  return a[c.columns].order - b[c.columns].order;
812
814
  });
813
815
  }
814
- if (c.debug) { benchmark("Sorting on " + sortList.toString() + " and dir " + order + " time", sortTime); }
816
+ if (c.debug) { benchmark('Sorting on ' + sortList.toString() + ' and dir ' + order + ' time', sortTime); }
815
817
  }
816
818
 
817
819
  function resortComplete(c, callback){
@@ -848,11 +850,14 @@
848
850
 
849
851
  function bindMethods(table){
850
852
  var c = table.config,
851
- $table = c.$table;
853
+ $table = c.$table,
854
+ events = 'sortReset update updateRows updateCell updateAll addRows updateComplete sorton appendCache ' +
855
+ 'updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave '.split(' ')
856
+ .join(c.namespace + ' ');
852
857
  // apply easy methods that trigger bound events
853
858
  $table
854
- .unbind('sortReset update updateRows updateCell updateAll addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave '.split(' ').join(c.namespace + ' '))
855
- .bind("sortReset" + c.namespace, function(e, callback){
859
+ .unbind( $.trim(events) )
860
+ .bind('sortReset' + c.namespace, function(e, callback){
856
861
  e.stopPropagation();
857
862
  c.sortList = [];
858
863
  setHeadersCss(table);
@@ -862,7 +867,7 @@
862
867
  callback(table);
863
868
  }
864
869
  })
865
- .bind("updateAll" + c.namespace, function(e, resort, callback){
870
+ .bind('updateAll' + c.namespace, function(e, resort, callback){
866
871
  e.stopPropagation();
867
872
  table.isUpdating = true;
868
873
  ts.refreshWidgets(table, true, true);
@@ -871,14 +876,14 @@
871
876
  bindMethods(table);
872
877
  commonUpdate(table, resort, callback);
873
878
  })
874
- .bind("update" + c.namespace + " updateRows" + c.namespace, function(e, resort, callback) {
879
+ .bind('update' + c.namespace + ' updateRows' + c.namespace, function(e, resort, callback) {
875
880
  e.stopPropagation();
876
881
  table.isUpdating = true;
877
882
  // update sorting (if enabled/disabled)
878
883
  updateHeader(table);
879
884
  commonUpdate(table, resort, callback);
880
885
  })
881
- .bind("updateCell" + c.namespace, function(e, cell, resort, callback) {
886
+ .bind('updateCell' + c.namespace, function(e, cell, resort, callback) {
882
887
  e.stopPropagation();
883
888
  table.isUpdating = true;
884
889
  $table.find(c.selectorRemove).remove();
@@ -904,7 +909,7 @@
904
909
  v = c.parsers[icell].id === 'no-parser' ? '' :
905
910
  c.parsers[icell].format( t, table, cell, icell );
906
911
  c.cache[tbdy].normalized[row][icell] = c.ignoreCase && typeof v === 'string' ? v.toLowerCase() : v;
907
- if ((c.parsers[icell].type || '').toLowerCase() === "numeric") {
912
+ if ((c.parsers[icell].type || '').toLowerCase() === 'numeric') {
908
913
  // update column max value (ignore sign)
909
914
  c.cache[tbdy].colMax[icell] = Math.max(Math.abs(v) || 0, c.cache[tbdy].colMax[icell] || 0);
910
915
  }
@@ -922,7 +927,7 @@
922
927
  }
923
928
  }
924
929
  })
925
- .bind("addRows" + c.namespace, function(e, $row, resort, callback) {
930
+ .bind('addRows' + c.namespace, function(e, $row, resort, callback) {
926
931
  e.stopPropagation();
927
932
  table.isUpdating = true;
928
933
  if (isEmptyObject(c.cache)) {
@@ -957,7 +962,7 @@
957
962
  v = c.parsers[j].id === 'no-parser' ? '' :
958
963
  c.parsers[j].format( t, table, $row[i].cells[j], j );
959
964
  cells[j] = c.ignoreCase && typeof v === 'string' ? v.toLowerCase() : v;
960
- if ((c.parsers[j].type || '').toLowerCase() === "numeric") {
965
+ if ((c.parsers[j].type || '').toLowerCase() === 'numeric') {
961
966
  // update column max value (ignore sign)
962
967
  c.cache[tbdy].colMax[j] = Math.max(Math.abs(cells[j]) || 0, c.cache[tbdy].colMax[j] || 0);
963
968
  }
@@ -971,37 +976,37 @@
971
976
  checkResort(c, resort, callback);
972
977
  }
973
978
  })
974
- .bind("updateComplete" + c.namespace, function(){
979
+ .bind('updateComplete' + c.namespace, function(){
975
980
  table.isUpdating = false;
976
981
  })
977
- .bind("sorton" + c.namespace, function(e, list, callback, init) {
982
+ .bind('sorton' + c.namespace, function(e, list, callback, init) {
978
983
  var c = table.config;
979
984
  e.stopPropagation();
980
- $table.trigger("sortStart", this);
985
+ $table.trigger('sortStart', this);
981
986
  // update header count index
982
987
  updateHeaderSortCount(table, list);
983
988
  // set css for headers
984
989
  setHeadersCss(table);
985
990
  // fixes #346
986
991
  if (c.delayInit && isEmptyObject(c.cache)) { buildCache(table); }
987
- $table.trigger("sortBegin", this);
992
+ $table.trigger('sortBegin', this);
988
993
  // sort the table and append it to the dom
989
994
  multisort(table);
990
995
  appendToTable(table, init);
991
- $table.trigger("sortEnd", this);
996
+ $table.trigger('sortEnd', this);
992
997
  ts.applyWidget(table);
993
998
  if ($.isFunction(callback)) {
994
999
  callback(table);
995
1000
  }
996
1001
  })
997
- .bind("appendCache" + c.namespace, function(e, callback, init) {
1002
+ .bind('appendCache' + c.namespace, function(e, callback, init) {
998
1003
  e.stopPropagation();
999
1004
  appendToTable(table, init);
1000
1005
  if ($.isFunction(callback)) {
1001
1006
  callback(table);
1002
1007
  }
1003
1008
  })
1004
- .bind("updateCache" + c.namespace, function(e, callback){
1009
+ .bind('updateCache' + c.namespace, function(e, callback){
1005
1010
  // rebuild parsers
1006
1011
  if (!(c.parsers && c.parsers.length)) {
1007
1012
  buildParserCache(table);
@@ -1012,24 +1017,24 @@
1012
1017
  callback(table);
1013
1018
  }
1014
1019
  })
1015
- .bind("applyWidgetId" + c.namespace, function(e, id) {
1020
+ .bind('applyWidgetId' + c.namespace, function(e, id) {
1016
1021
  e.stopPropagation();
1017
1022
  ts.getWidgetById(id).format(table, c, c.widgetOptions);
1018
1023
  })
1019
- .bind("applyWidgets" + c.namespace, function(e, init) {
1024
+ .bind('applyWidgets' + c.namespace, function(e, init) {
1020
1025
  e.stopPropagation();
1021
1026
  // apply widgets
1022
1027
  ts.applyWidget(table, init);
1023
1028
  })
1024
- .bind("refreshWidgets" + c.namespace, function(e, all, dontapply){
1029
+ .bind('refreshWidgets' + c.namespace, function(e, all, dontapply){
1025
1030
  e.stopPropagation();
1026
1031
  ts.refreshWidgets(table, all, dontapply);
1027
1032
  })
1028
- .bind("destroy" + c.namespace, function(e, c, cb){
1033
+ .bind('destroy' + c.namespace, function(e, c, cb){
1029
1034
  e.stopPropagation();
1030
1035
  ts.destroy(table, c, cb);
1031
1036
  })
1032
- .bind("resetToLoadState" + c.namespace, function(){
1037
+ .bind('resetToLoadState' + c.namespace, function(){
1033
1038
  // remove all widgets
1034
1039
  ts.removeWidget(table, true, false);
1035
1040
  // restore original settings; this clears out current settings, but does not clear
@@ -1075,14 +1080,14 @@
1075
1080
  // make sure to store the config object
1076
1081
  table.config = c;
1077
1082
  // save the settings where they read
1078
- $.data(table, "tablesorter", c);
1083
+ $.data(table, 'tablesorter', c);
1079
1084
  if (c.debug) { $.data( table, 'startoveralltimer', new Date()); }
1080
1085
 
1081
1086
  // removing this in version 3 (only supports jQuery 1.7+)
1082
1087
  c.supportsDataObject = (function(version) {
1083
1088
  version[0] = parseInt(version[0], 10);
1084
1089
  return (version[0] > 1) || (version[0] === 1 && parseInt(version[1], 10) >= 4);
1085
- })($.fn.jquery.split("."));
1090
+ })($.fn.jquery.split('.'));
1086
1091
  // digit sort text location; keeping max+/- for backwards compatibility
1087
1092
  c.string = { 'max': 1, 'min': -1, 'emptymin': 1, 'emptymax': -1, 'zero': 0, 'none': 0, 'null': 0, 'top': true, 'bottom': false };
1088
1093
  // ensure case insensitivity
@@ -1145,7 +1150,7 @@
1145
1150
  ts.applyWidget(table, true);
1146
1151
  // if user has supplied a sort list to constructor
1147
1152
  if (c.sortList.length > 0) {
1148
- $table.trigger("sorton", [c.sortList, {}, !c.initWidgets, true]);
1153
+ $table.trigger('sorton', [c.sortList, {}, !c.initWidgets, true]);
1149
1154
  } else {
1150
1155
  setHeadersCss(table);
1151
1156
  if (c.initWidgets) {
@@ -1173,7 +1178,7 @@
1173
1178
  table.hasInitialized = true;
1174
1179
  table.isProcessing = false;
1175
1180
  if (c.debug) {
1176
- ts.benchmark("Overall initialization time", $.data( table, 'startoveralltimer'));
1181
+ ts.benchmark('Overall initialization time', $.data( table, 'startoveralltimer'));
1177
1182
  }
1178
1183
  $table.trigger('tablesorter-initialized', table);
1179
1184
  if (typeof c.initialized === 'function') { c.initialized(table); }
@@ -1239,15 +1244,15 @@
1239
1244
  cell = cells[j];
1240
1245
  $cell = $(cell);
1241
1246
  rowIndex = cell.parentNode.rowIndex;
1242
- cellId = rowIndex + "-" + $cell.index();
1247
+ cellId = rowIndex + '-' + $cell.index();
1243
1248
  rowSpan = cell.rowSpan || 1;
1244
1249
  colSpan = cell.colSpan || 1;
1245
- if (typeof(matrix[rowIndex]) === "undefined") {
1250
+ if (typeof(matrix[rowIndex]) === 'undefined') {
1246
1251
  matrix[rowIndex] = [];
1247
1252
  }
1248
1253
  // Find first available column in the first row
1249
1254
  for (k = 0; k < matrix[rowIndex].length + 1; k++) {
1250
- if (typeof(matrix[rowIndex][k]) === "undefined") {
1255
+ if (typeof(matrix[rowIndex][k]) === 'undefined') {
1251
1256
  firstAvailCol = k;
1252
1257
  break;
1253
1258
  }
@@ -1257,12 +1262,12 @@
1257
1262
  // add data-column
1258
1263
  $cell.attr({ 'data-column' : firstAvailCol }); // 'data-row' : rowIndex
1259
1264
  for (k = rowIndex; k < rowIndex + rowSpan; k++) {
1260
- if (typeof(matrix[k]) === "undefined") {
1265
+ if (typeof(matrix[k]) === 'undefined') {
1261
1266
  matrix[k] = [];
1262
1267
  }
1263
1268
  matrixrow = matrix[k];
1264
1269
  for (l = firstAvailCol; l < firstAvailCol + colSpan; l++) {
1265
- matrixrow[l] = "x";
1270
+ matrixrow[l] = 'x';
1266
1271
  }
1267
1272
  }
1268
1273
  }
@@ -1325,8 +1330,8 @@
1325
1330
  $headers
1326
1331
  // http://stackoverflow.com/questions/5312849/jquery-find-self;
1327
1332
  .find(c.selectorSort).add( $headers.filter(c.selectorSort) )
1328
- .unbind('mousedown mouseup sort keyup '.split(' ').join(c.namespace + ' '))
1329
- .bind('mousedown mouseup sort keyup '.split(' ').join(c.namespace + ' '), function(e, external) {
1333
+ .unbind( $.trim('mousedown mouseup sort keyup '.split(' ').join(c.namespace + ' ')) )
1334
+ .bind( $.trim('mousedown mouseup sort keyup '.split(' ').join(c.namespace + ' ')), function(e, external) {
1330
1335
  var cell, type = e.type;
1331
1336
  // only recognize left clicks or enter
1332
1337
  if ( ((e.which || e.button) !== 1 && !/sort|keyup/.test(type)) || (type === 'keyup' && e.which !== 13) ) {
@@ -1382,10 +1387,12 @@
1382
1387
  if (!table.hasInitialized) { return; }
1383
1388
  // remove all widgets
1384
1389
  ts.removeWidget(table, true, false);
1385
- var $t = $(table), c = table.config,
1386
- $h = $t.find('thead:first'),
1387
- $r = $h.find('tr.' + ts.css.headerRow).removeClass(ts.css.headerRow + ' ' + c.cssHeaderRow),
1388
- $f = $t.find('tfoot:first > tr').children('th, td');
1390
+ var events,
1391
+ $t = $(table),
1392
+ c = table.config,
1393
+ $h = $t.find('thead:first'),
1394
+ $r = $h.find('tr.' + ts.css.headerRow).removeClass(ts.css.headerRow + ' ' + c.cssHeaderRow),
1395
+ $f = $t.find('tfoot:first > tr').children('th, td');
1389
1396
  if (removeClasses === false && $.inArray('uitheme', c.widgets) >= 0) {
1390
1397
  // reapply uitheme classes, in case we want to maintain appearance
1391
1398
  $t.trigger('applyWidgetId', ['uitheme']);
@@ -1394,15 +1401,18 @@
1394
1401
  // remove widget added rows, just in case
1395
1402
  $h.find('tr').not($r).remove();
1396
1403
  // disable tablesorter
1404
+ events = 'sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache ' +
1405
+ 'applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd resetToLoadState '.split(' ')
1406
+ .join(c.namespace + ' ');
1397
1407
  $t
1398
1408
  .removeData('tablesorter')
1399
- .unbind('sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd resetToLoadState '.split(' ').join(c.namespace + ' '));
1409
+ .unbind( $.trim(events) );
1400
1410
  c.$headers.add($f)
1401
1411
  .removeClass( [ts.css.header, c.cssHeader, c.cssAsc, c.cssDesc, ts.css.sortAsc, ts.css.sortDesc, ts.css.sortNone].join(' ') )
1402
1412
  .removeAttr('data-column')
1403
1413
  .removeAttr('aria-label')
1404
1414
  .attr('aria-disabled', 'true');
1405
- $r.find(c.selectorSort).unbind('mousedown mouseup keypress '.split(' ').join(c.namespace + ' '));
1415
+ $r.find(c.selectorSort).unbind( $.trim('mousedown mouseup keypress '.split(' ').join(c.namespace + ' ')) );
1406
1416
  ts.restoreHeaders(table);
1407
1417
  $t.toggleClass(ts.css.table + ' ' + c.tableClass + ' tablesorter-' + c.theme, removeClasses === false);
1408
1418
  // clear flag in case the plugin is initialized again
@@ -1422,7 +1432,7 @@
1422
1432
  };
1423
1433
 
1424
1434
  // Natural sort - https://github.com/overset/javascript-natural-sort (date sorting removed)
1425
- // this function will only accept strings, or you'll see "TypeError: undefined is not a function"
1435
+ // this function will only accept strings, or you'll see 'TypeError: undefined is not a function'
1426
1436
  // I could add a = a.toString(); b = b.toString(); but it'll slow down the sort overall
1427
1437
  ts.sortNatural = function(a, b) {
1428
1438
  if (a === b) { return 0; }
@@ -1521,20 +1531,20 @@
1521
1531
 
1522
1532
  // used when replacing accented characters during sorting
1523
1533
  ts.characterEquivalents = {
1524
- "a" : "\u00e1\u00e0\u00e2\u00e3\u00e4\u0105\u00e5", // áàâãäąå
1525
- "A" : "\u00c1\u00c0\u00c2\u00c3\u00c4\u0104\u00c5", // ÁÀÂÃÄĄÅ
1526
- "c" : "\u00e7\u0107\u010d", // çćč
1527
- "C" : "\u00c7\u0106\u010c", // ÇĆČ
1528
- "e" : "\u00e9\u00e8\u00ea\u00eb\u011b\u0119", // éèêëěę
1529
- "E" : "\u00c9\u00c8\u00ca\u00cb\u011a\u0118", // ÉÈÊËĚĘ
1530
- "i" : "\u00ed\u00ec\u0130\u00ee\u00ef\u0131", // íìİîïı
1531
- "I" : "\u00cd\u00cc\u0130\u00ce\u00cf", // ÍÌİÎÏ
1532
- "o" : "\u00f3\u00f2\u00f4\u00f5\u00f6", // óòôõö
1533
- "O" : "\u00d3\u00d2\u00d4\u00d5\u00d6", // ÓÒÔÕÖ
1534
- "ss": "\u00df", // ß (s sharp)
1535
- "SS": "\u1e9e", // ẞ (Capital sharp s)
1536
- "u" : "\u00fa\u00f9\u00fb\u00fc\u016f", // úùûüů
1537
- "U" : "\u00da\u00d9\u00db\u00dc\u016e" // ÚÙÛÜŮ
1534
+ 'a' : '\u00e1\u00e0\u00e2\u00e3\u00e4\u0105\u00e5', // áàâãäąå
1535
+ 'A' : '\u00c1\u00c0\u00c2\u00c3\u00c4\u0104\u00c5', // ÁÀÂÃÄĄÅ
1536
+ 'c' : '\u00e7\u0107\u010d', // çćč
1537
+ 'C' : '\u00c7\u0106\u010c', // ÇĆČ
1538
+ 'e' : '\u00e9\u00e8\u00ea\u00eb\u011b\u0119', // éèêëěę
1539
+ 'E' : '\u00c9\u00c8\u00ca\u00cb\u011a\u0118', // ÉÈÊËĚĘ
1540
+ 'i' : '\u00ed\u00ec\u0130\u00ee\u00ef\u0131', // íìİîïı
1541
+ 'I' : '\u00cd\u00cc\u0130\u00ce\u00cf', // ÍÌİÎÏ
1542
+ 'o' : '\u00f3\u00f2\u00f4\u00f5\u00f6', // óòôõö
1543
+ 'O' : '\u00d3\u00d2\u00d4\u00d5\u00d6', // ÓÒÔÕÖ
1544
+ 'ss': '\u00df', // ß (s sharp)
1545
+ 'SS': '\u1e9e', // ẞ (Capital sharp s)
1546
+ 'u' : '\u00fa\u00f9\u00fb\u00fc\u016f', // úùûüů
1547
+ 'U' : '\u00da\u00d9\u00db\u00dc\u016e' // ÚÙÛÜŮ
1538
1548
  };
1539
1549
  ts.replaceAccents = function(s) {
1540
1550
  var a, acc = '[', eq = ts.characterEquivalents;
@@ -1623,7 +1633,7 @@
1623
1633
  if (init !== false && table.hasInitialized && (table.isApplyingWidgets || table.isUpdating)) { return; }
1624
1634
  if (c.debug) { time = new Date(); }
1625
1635
  // look for widgets to apply from in table class
1626
- // stop using \b otherwise this matches "ui-widget-content" & adds "content" widget
1636
+ // stop using \b otherwise this matches 'ui-widget-content' & adds 'content' widget
1627
1637
  wd = new RegExp( '\\s' + c.widgetClass.replace( /\{name\}/i, '([\\w-]+)' )+ '\\s', 'g' );
1628
1638
  if ( tableClass.match( wd ) ) {
1629
1639
  // extract out the widget id from the table class (widget id's can include dashes)
@@ -1686,7 +1696,7 @@
1686
1696
  }, 0);
1687
1697
  if (c.debug) {
1688
1698
  w = c.widgets.length;
1689
- benchmark("Completed " + (init === true ? "initializing " : "applying ") + w + " widget" + (w !== 1 ? "s" : ""), time);
1699
+ benchmark('Completed ' + (init === true ? 'initializing ' : 'applying ') + w + ' widget' + (w !== 1 ? 's' : ''), time);
1690
1700
  }
1691
1701
  };
1692
1702
 
@@ -1751,7 +1761,7 @@
1751
1761
  };
1752
1762
 
1753
1763
  // get sorter, string, empty, etc options for each column from
1754
- // jQuery data, metadata, header option or header class name ("sorter-false")
1764
+ // jQuery data, metadata, header option or header class name ('sorter-false')
1755
1765
  // priority = jQuery data > meta > headers option > header class name
1756
1766
  ts.getData = function(h, ch, key) {
1757
1767
  var val = '', $h = $(h), m, cl;
@@ -1759,15 +1769,15 @@
1759
1769
  m = $.metadata ? $h.metadata() : false;
1760
1770
  cl = ' ' + ($h.attr('class') || '');
1761
1771
  if (typeof $h.data(key) !== 'undefined' || typeof $h.data(key.toLowerCase()) !== 'undefined'){
1762
- // "data-lockedOrder" is assigned to "lockedorder"; but "data-locked-order" is assigned to "lockedOrder"
1763
- // "data-sort-initial-order" is assigned to "sortInitialOrder"
1772
+ // 'data-lockedOrder' is assigned to 'lockedorder'; but 'data-locked-order' is assigned to 'lockedOrder'
1773
+ // 'data-sort-initial-order' is assigned to 'sortInitialOrder'
1764
1774
  val += $h.data(key) || $h.data(key.toLowerCase());
1765
1775
  } else if (m && typeof m[key] !== 'undefined') {
1766
1776
  val += m[key];
1767
1777
  } else if (ch && typeof ch[key] !== 'undefined') {
1768
1778
  val += ch[key];
1769
1779
  } else if (cl !== ' ' && cl.match(' ' + key + '-')) {
1770
- // include sorter class name "sorter-text", etc; now works with "sorter-my-custom-parser"
1780
+ // include sorter class name 'sorter-text', etc; now works with 'sorter-my-custom-parser'
1771
1781
  val = cl.match( new RegExp('\\s' + key + '-([\\w-]+)') )[1] || '';
1772
1782
  }
1773
1783
  return $.trim(val);
@@ -1778,7 +1788,7 @@
1778
1788
  // allow using formatFloat without a table; defaults to US number format
1779
1789
  var i,
1780
1790
  t = table && table.config ? table.config.usNumberFormat !== false :
1781
- typeof table !== "undefined" ? table : true;
1791
+ typeof table !== 'undefined' ? table : true;
1782
1792
  if (t) {
1783
1793
  // US Format - 1,234,567.89 -> 1234567.89
1784
1794
  s = s.replace(/,/g,'');
@@ -1825,7 +1835,7 @@
1825
1835
  });
1826
1836
 
1827
1837
  ts.addParser({
1828
- id: "text",
1838
+ id: 'text',
1829
1839
  is: function() {
1830
1840
  return true;
1831
1841
  },
@@ -1837,35 +1847,35 @@
1837
1847
  }
1838
1848
  return s;
1839
1849
  },
1840
- type: "text"
1850
+ type: 'text'
1841
1851
  });
1842
1852
 
1843
1853
  ts.addParser({
1844
- id: "digit",
1854
+ id: 'digit',
1845
1855
  is: function(s) {
1846
1856
  return ts.isDigit(s);
1847
1857
  },
1848
1858
  format: function(s, table) {
1849
- var n = ts.formatFloat((s || '').replace(/[^\w,. \-()]/g, ""), table);
1859
+ var n = ts.formatFloat((s || '').replace(/[^\w,. \-()]/g, ''), table);
1850
1860
  return s && typeof n === 'number' ? n : s ? $.trim( s && table.config.ignoreCase ? s.toLocaleLowerCase() : s ) : s;
1851
1861
  },
1852
- type: "numeric"
1862
+ type: 'numeric'
1853
1863
  });
1854
1864
 
1855
1865
  ts.addParser({
1856
- id: "currency",
1866
+ id: 'currency',
1857
1867
  is: function(s) {
1858
1868
  return (/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/).test((s || '').replace(/[+\-,. ]/g,'')); // £$€¤¥¢
1859
1869
  },
1860
1870
  format: function(s, table) {
1861
- var n = ts.formatFloat((s || '').replace(/[^\w,. \-()]/g, ""), table);
1871
+ var n = ts.formatFloat((s || '').replace(/[^\w,. \-()]/g, ''), table);
1862
1872
  return s && typeof n === 'number' ? n : s ? $.trim( s && table.config.ignoreCase ? s.toLocaleLowerCase() : s ) : s;
1863
1873
  },
1864
- type: "numeric"
1874
+ type: 'numeric'
1865
1875
  });
1866
1876
 
1867
1877
  ts.addParser({
1868
- id: "url",
1878
+ id: 'url',
1869
1879
  is: function(s) {
1870
1880
  return (/^(https?|ftp|file):\/\//).test(s);
1871
1881
  },
@@ -1873,35 +1883,35 @@
1873
1883
  return s ? $.trim(s.replace(/(https?|ftp|file):\/\//, '')) : s;
1874
1884
  },
1875
1885
  parsed : true, // filter widget flag
1876
- type: "text"
1886
+ type: 'text'
1877
1887
  });
1878
1888
 
1879
1889
  ts.addParser({
1880
- id: "isoDate",
1890
+ id: 'isoDate',
1881
1891
  is: function(s) {
1882
1892
  return (/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/).test(s);
1883
1893
  },
1884
1894
  format: function(s, table) {
1885
- var date = s ? new Date( s.replace(/-/g, "/") ) : s;
1895
+ var date = s ? new Date( s.replace(/-/g, '/') ) : s;
1886
1896
  return date instanceof Date && isFinite(date) ? date.getTime() : s;
1887
1897
  },
1888
- type: "numeric"
1898
+ type: 'numeric'
1889
1899
  });
1890
1900
 
1891
1901
  ts.addParser({
1892
- id: "percent",
1902
+ id: 'percent',
1893
1903
  is: function(s) {
1894
1904
  return (/(\d\s*?%|%\s*?\d)/).test(s) && s.length < 15;
1895
1905
  },
1896
1906
  format: function(s, table) {
1897
- return s ? ts.formatFloat(s.replace(/%/g, ""), table) : s;
1907
+ return s ? ts.formatFloat(s.replace(/%/g, ''), table) : s;
1898
1908
  },
1899
- type: "numeric"
1909
+ type: 'numeric'
1900
1910
  });
1901
1911
 
1902
1912
  // added image parser to core v2.17.9
1903
1913
  ts.addParser({
1904
- id: "image",
1914
+ id: 'image',
1905
1915
  is: function(s, table, node, $node){
1906
1916
  return $node.find('img').length > 0;
1907
1917
  },
@@ -1909,65 +1919,65 @@
1909
1919
  return $(cell).find('img').attr(table.config.imgAttr || 'alt') || s;
1910
1920
  },
1911
1921
  parsed : true, // filter widget flag
1912
- type: "text"
1922
+ type: 'text'
1913
1923
  });
1914
1924
 
1915
1925
  ts.addParser({
1916
- id: "usLongDate",
1926
+ id: 'usLongDate',
1917
1927
  is: function(s) {
1918
1928
  // two digit years are not allowed cross-browser
1919
1929
  // Jan 01, 2013 12:34:56 PM or 01 Jan 2013
1920
1930
  return (/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i).test(s) || (/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i).test(s);
1921
1931
  },
1922
1932
  format: function(s, table) {
1923
- var date = s ? new Date( s.replace(/(\S)([AP]M)$/i, "$1 $2") ) : s;
1933
+ var date = s ? new Date( s.replace(/(\S)([AP]M)$/i, '$1 $2') ) : s;
1924
1934
  return date instanceof Date && isFinite(date) ? date.getTime() : s;
1925
1935
  },
1926
- type: "numeric"
1936
+ type: 'numeric'
1927
1937
  });
1928
1938
 
1929
1939
  ts.addParser({
1930
- id: "shortDate", // "mmddyyyy", "ddmmyyyy" or "yyyymmdd"
1940
+ id: 'shortDate', // 'mmddyyyy', 'ddmmyyyy' or 'yyyymmdd'
1931
1941
  is: function(s) {
1932
1942
  // testing for ##-##-#### or ####-##-##, so it's not perfect; time can be included
1933
- return (/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/).test((s || '').replace(/\s+/g," ").replace(/[\-.,]/g, "/"));
1943
+ return (/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/).test((s || '').replace(/\s+/g,' ').replace(/[\-.,]/g, '/'));
1934
1944
  },
1935
1945
  format: function(s, table, cell, cellIndex) {
1936
1946
  if (s) {
1937
1947
  var date, d,
1938
1948
  c = table.config,
1939
- ci = c.$headers.filter('[data-column=' + cellIndex + ']:last'),
1949
+ ci = c.$headers.filter('[data-column="' + cellIndex + '"]:last'),
1940
1950
  format = ci.length && ci[0].dateFormat || ts.getData( ci, ts.getColumnData( table, c.headers, cellIndex ), 'dateFormat') || c.dateFormat;
1941
- d = s.replace(/\s+/g," ").replace(/[\-.,]/g, "/"); // escaped - because JSHint in Firefox was showing it as an error
1942
- if (format === "mmddyyyy") {
1943
- d = d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/, "$3/$1/$2");
1944
- } else if (format === "ddmmyyyy") {
1945
- d = d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/, "$3/$2/$1");
1946
- } else if (format === "yyyymmdd") {
1947
- d = d.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/, "$1/$2/$3");
1951
+ d = s.replace(/\s+/g, ' ').replace(/[\-.,]/g, '/'); // escaped - because JSHint in Firefox was showing it as an error
1952
+ if (format === 'mmddyyyy') {
1953
+ d = d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/, '$3/$1/$2');
1954
+ } else if (format === 'ddmmyyyy') {
1955
+ d = d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/, '$3/$2/$1');
1956
+ } else if (format === 'yyyymmdd') {
1957
+ d = d.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/, '$1/$2/$3');
1948
1958
  }
1949
1959
  date = new Date(d);
1950
1960
  return date instanceof Date && isFinite(date) ? date.getTime() : s;
1951
1961
  }
1952
1962
  return s;
1953
1963
  },
1954
- type: "numeric"
1964
+ type: 'numeric'
1955
1965
  });
1956
1966
 
1957
1967
  ts.addParser({
1958
- id: "time",
1968
+ id: 'time',
1959
1969
  is: function(s) {
1960
1970
  return (/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i).test(s);
1961
1971
  },
1962
1972
  format: function(s, table) {
1963
- var date = s ? new Date( "2000/01/01 " + s.replace(/(\S)([AP]M)$/i, "$1 $2") ) : s;
1973
+ var date = s ? new Date( '2000/01/01 ' + s.replace(/(\S)([AP]M)$/i, '$1 $2') ) : s;
1964
1974
  return date instanceof Date && isFinite(date) ? date.getTime() : s;
1965
1975
  },
1966
- type: "numeric"
1976
+ type: 'numeric'
1967
1977
  });
1968
1978
 
1969
1979
  ts.addParser({
1970
- id: "metadata",
1980
+ id: 'metadata',
1971
1981
  is: function() {
1972
1982
  return false;
1973
1983
  },
@@ -1976,12 +1986,12 @@
1976
1986
  p = (!c.parserMetadataName) ? 'sortValue' : c.parserMetadataName;
1977
1987
  return $(cell).metadata()[p];
1978
1988
  },
1979
- type: "numeric"
1989
+ type: 'numeric'
1980
1990
  });
1981
1991
 
1982
1992
  // add default widgets
1983
1993
  ts.addWidget({
1984
- id: "zebra",
1994
+ id: 'zebra',
1985
1995
  priority: 90,
1986
1996
  format: function(table, c, wo) {
1987
1997
  var $tb, $tv, $tr, row, even, time, k,
@@ -2010,7 +2020,7 @@
2010
2020
  if (refreshing) { return; }
2011
2021
  var k, $tb,
2012
2022
  b = c.$tbodies,
2013
- rmv = (wo.zebra || [ "even", "odd" ]).join(' ');
2023
+ rmv = (wo.zebra || [ 'even', 'odd' ]).join(' ');
2014
2024
  for (k = 0; k < b.length; k++ ){
2015
2025
  $tb = ts.processTbody(table, b.eq(k), true); // remove tbody
2016
2026
  $tb.children().removeClass(rmv);