jquery-tablesorter 1.1.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. data/README.markdown +3 -1
  2. data/lib/jquery-tablesorter/version.rb +1 -1
  3. data/vendor/assets/images/jquery-tablesorter/black-asc.gif +0 -0
  4. data/vendor/assets/images/jquery-tablesorter/black-desc.gif +0 -0
  5. data/vendor/assets/images/jquery-tablesorter/dropbox-asc-hovered.png +0 -0
  6. data/vendor/assets/images/jquery-tablesorter/dropbox-asc.png +0 -0
  7. data/vendor/assets/images/jquery-tablesorter/dropbox-desc-hovered.png +0 -0
  8. data/vendor/assets/images/jquery-tablesorter/dropbox-desc.png +0 -0
  9. data/vendor/assets/images/jquery-tablesorter/green-asc.gif +0 -0
  10. data/vendor/assets/images/jquery-tablesorter/green-desc.gif +0 -0
  11. data/vendor/assets/images/jquery-tablesorter/green-header.gif +0 -0
  12. data/vendor/assets/images/jquery-tablesorter/green-unsorted.gif +0 -0
  13. data/vendor/assets/images/jquery-tablesorter/ice-asc.gif +0 -0
  14. data/vendor/assets/images/jquery-tablesorter/ice-desc.gif +0 -0
  15. data/vendor/assets/images/jquery-tablesorter/ice-unsorted.gif +0 -0
  16. data/vendor/assets/images/jquery-tablesorter/white-asc.gif +0 -0
  17. data/vendor/assets/images/jquery-tablesorter/white-desc.gif +0 -0
  18. data/vendor/assets/javascripts/jquery-tablesorter/addons/pager/jquery.tablesorter.pager.js +507 -507
  19. data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.js +72 -63
  20. data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.min.js +2 -3
  21. data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets.js +17 -12
  22. data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets.min.js +8 -8
  23. data/vendor/assets/stylesheets/jquery-tablesorter/theme.black-ice.css +12 -8
  24. data/vendor/assets/stylesheets/jquery-tablesorter/theme.blue.css +14 -10
  25. data/vendor/assets/stylesheets/jquery-tablesorter/theme.bootstrap.css +10 -4
  26. data/vendor/assets/stylesheets/jquery-tablesorter/theme.dark.css +12 -8
  27. data/vendor/assets/stylesheets/jquery-tablesorter/theme.default.css +9 -6
  28. data/vendor/assets/stylesheets/jquery-tablesorter/theme.dropbox.css +29 -18
  29. data/vendor/assets/stylesheets/jquery-tablesorter/theme.green.css +15 -6
  30. data/vendor/assets/stylesheets/jquery-tablesorter/theme.grey.css +12 -10
  31. data/vendor/assets/stylesheets/jquery-tablesorter/theme.ice.css +20 -10
  32. data/vendor/assets/stylesheets/jquery-tablesorter/theme.jui.css +7 -1
  33. metadata +17 -15
@@ -1,5 +1,5 @@
1
- /*!
2
- * TableSorter 2.4.6 - Client-side table sorting with ease!
1
+ /*!
2
+ * TableSorter 2.5.2 - Client-side table sorting with ease!
3
3
  * @requires jQuery v1.2.6+
4
4
  *
5
5
  * Copyright (c) 2007 Christian Bach
@@ -14,7 +14,7 @@
14
14
  * @author Christian Bach/christian.bach@polyester.se
15
15
  * @contributor Rob Garrison/https://github.com/Mottie/tablesorter
16
16
  */
17
- /*jshint evil:true, browser:true, jquery:true, unused:false */
17
+ /*jshint browser:true, jquery:true, unused:false */
18
18
  /*global console:false, alert:false */
19
19
  !(function($) {
20
20
  "use strict";
@@ -23,7 +23,7 @@
23
23
 
24
24
  var ts = this;
25
25
 
26
- ts.version = "2.4.5";
26
+ ts.version = "2.5.2";
27
27
 
28
28
  ts.parsers = [];
29
29
  ts.widgets = [];
@@ -71,9 +71,9 @@
71
71
 
72
72
  // css class names
73
73
  tableClass : 'tablesorter',
74
- cssAsc : 'tablesorter-headerSortUp',
74
+ cssAsc : 'tablesorter-headerAsc',
75
75
  cssChildRow : 'tablesorter-childRow', // previously "expand-child"
76
- cssDesc : 'tablesorter-headerSortDown',
76
+ cssDesc : 'tablesorter-headerDesc',
77
77
  cssHeader : 'tablesorter-header',
78
78
  cssHeaderRow : 'tablesorter-headerRow',
79
79
  cssIcon : 'tablesorter-icon', // if this class exists, a <i> will be added to the header automatically
@@ -162,7 +162,7 @@
162
162
  return ts.parsers[0];
163
163
  }
164
164
 
165
- function buildParserCache(table, $headers) {
165
+ function buildParserCache(table) {
166
166
  var c = table.config,
167
167
  tb = $(table.tBodies).filter(':not(.' + c.cssInfoBlock + ')'),
168
168
  rows, list, l, i, h, ch, p, parsersDebug = "";
@@ -173,7 +173,10 @@
173
173
  l = rows[0].cells.length;
174
174
  for (i = 0; i < l; i++) {
175
175
  // tons of thanks to AnthonyM1229 for working out the following selector (issue #74) to make this work in IE8!
176
- h = $headers.filter(':not([colspan])[data-column="' + i + '"]:last,[colspan="1"][data-column="' + i + '"]:last');
176
+ // More fixes to this selector to work properly in iOS and jQuery 1.8+ (issue #132 & #174)
177
+ h = c.$headers.filter(':not([colspan])');
178
+ h = h.add( c.$headers.filter('[colspan="1"]') ) // ie8 fix
179
+ .filter('[data-column="' + i + '"]:last');
177
180
  ch = c.headers[i];
178
181
  // get column parser
179
182
  p = ts.getParserById( ts.getData(h, ch, 'sorter') );
@@ -203,7 +206,7 @@
203
206
  totalRows,
204
207
  totalCells,
205
208
  parsers = tc.parsers,
206
- t, i, j, k, c, cols, cacheTime;
209
+ t, v, i, j, k, c, cols, cacheTime, colMax = [];
207
210
  tc.cache = {};
208
211
  if (tc.debug) {
209
212
  cacheTime = new Date();
@@ -233,11 +236,16 @@
233
236
  t = getElementText(table, c[0].cells[j], j);
234
237
  // allow parsing if the string is empty, previously parsing would change it to zero,
235
238
  // in case the parser needs to extract data from the table cell attributes
236
- cols.push( parsers[j].format(t, table, c[0].cells[j], j) );
239
+ v = parsers[j].format(t, table, c[0].cells[j], j);
240
+ cols.push(v);
241
+ if ((parsers[j].type || '').toLowerCase() === "numeric") {
242
+ colMax[j] = Math.max(Math.abs(v), colMax[j] || 0); // determine column max value (ignore sign)
243
+ }
237
244
  }
238
245
  cols.push(tc.cache[k].normalized.length); // add position for rowCache
239
246
  tc.cache[k].normalized.push(cols);
240
247
  }
248
+ tc.cache[k].colMax = colMax;
241
249
  }
242
250
  }
243
251
  if (tc.showProcessing) {
@@ -370,7 +378,7 @@
370
378
  if (typeof(lock) !== 'undefined' && lock !== false) {
371
379
  this.order = this.lockedOrder = formatSortingOrder(lock) ? [1,1,1] : [0,0,0];
372
380
  }
373
- $t.addClass( this.sortDisabled ? 'sorter-false' : c.cssHeader );
381
+ $t.addClass( (this.sortDisabled ? 'sorter-false ' : ' ') + c.cssHeader );
374
382
  // add cell to headerList
375
383
  c.headerList[index] = this;
376
384
  // add to parent in case there are multiple rows
@@ -383,28 +391,28 @@
383
391
  return $tableHeaders;
384
392
  }
385
393
 
386
- function setHeadersCss(table, $headers) {
394
+ function setHeadersCss(table) {
387
395
  var f, i, j, l,
388
396
  c = table.config,
389
397
  list = c.sortList,
390
- css = [c.cssDesc, c.cssAsc],
398
+ css = [c.cssAsc, c.cssDesc],
391
399
  // find the footer
392
400
  $t = $(table).find('tfoot tr').children().removeClass(css.join(' '));
393
401
  // remove all header information
394
- $headers.removeClass(css.join(' '));
402
+ c.$headers.removeClass(css.join(' '));
395
403
  l = list.length;
396
404
  for (i = 0; i < l; i++) {
397
405
  // direction = 2 means reset!
398
406
  if (list[i][1] !== 2) {
399
407
  // multicolumn sorting updating - choose the :last in case there are nested columns
400
- f = $headers.not('.sorter-false').filter('[data-column="' + list[i][0] + '"]' + (l === 1 ? ':last' : '') );
408
+ f = c.$headers.not('.sorter-false').filter('[data-column="' + list[i][0] + '"]' + (l === 1 ? ':last' : '') );
401
409
  if (f.length) {
402
410
  for (j = 0; j < f.length; j++) {
403
411
  if (!f[j].sortDisabled) {
404
412
  f.eq(j).addClass(css[list[i][1]]);
405
413
  // add sorted class to footer, if it exists
406
414
  if ($t.length) {
407
- $t.filter('[data-column="' + list[i][0] + '"]').eq(j).addClass(css[list[i][1]]);
415
+ $t.filter('[data-column="' + list[i][0] + '"]').eq(j).addClass(css[list[i][1]]);
408
416
  }
409
417
  }
410
418
  }
@@ -446,48 +454,38 @@
446
454
  }
447
455
 
448
456
  // sort multiple columns
449
- function multisort(table) {
457
+ /* */
458
+ function multisort(table) { /*jshint loopfunc:true */
450
459
  var dynamicExp, sortWrapper, col, mx = 0, dir = 0, tc = table.config,
451
460
  sortList = tc.sortList, l = sortList.length, bl = table.tBodies.length,
452
- sortTime, i, j, k, c, cache, lc, s, e, order, orgOrderCol;
461
+ sortTime, i, j, k, c, colMax, cache, lc, s, e, order, orgOrderCol;
453
462
  if (tc.debug) { sortTime = new Date(); }
454
463
  for (k = 0; k < bl; k++) {
455
- dynamicExp = "sortWrapper = function(a,b) {";
456
- cache = tc.cache[k];
457
- lc = cache.normalized.length;
458
- for (i = 0; i < l; i++) {
459
- c = sortList[i][0];
460
- order = sortList[i][1];
461
- // fallback to natural sort since it is more robust
462
- s = /n/i.test(getCachedSortType(tc.parsers, c)) ? "Numeric" : "Text";
463
- s += order === 0 ? "" : "Desc";
464
- e = "e" + i;
465
- // get max column value (ignore sign)
466
- if (/Numeric/.test(s) && tc.strings[c]) {
467
- for (j = 0; j < lc; j++) {
468
- col = Math.abs(parseFloat(cache.normalized[j][c]));
469
- mx = Math.max( mx, isNaN(col) ? 0 : col );
470
- }
471
- // sort strings in numerical columns
472
- if (typeof(tc.string[tc.strings[c]]) === 'boolean') {
473
- dir = (order === 0 ? 1 : -1) * (tc.string[tc.strings[c]] ? -1 : 1);
474
- } else {
475
- dir = (tc.strings[c]) ? tc.string[tc.strings[c]] || 0 : 0;
464
+ colMax = tc.cache[k].colMax;
465
+ cache = tc.cache[k].normalized;
466
+ lc = cache.length;
467
+ orgOrderCol = (cache && cache[0]) ? cache[0].length - 1 : 0;
468
+ cache.sort(function(a, b) {
469
+ // cache is undefined here in IE, so don't use it!
470
+ for (i = 0; i < l; i++) {
471
+ c = sortList[i][0];
472
+ order = sortList[i][1];
473
+ // fallback to natural sort since it is more robust
474
+ s = /n/i.test(getCachedSortType(tc.parsers, c)) ? "Numeric" : "Text";
475
+ s += order === 0 ? "" : "Desc";
476
+ if (/Numeric/.test(s) && tc.strings[c]) {
477
+ // sort strings in numerical columns
478
+ if (typeof (tc.string[tc.strings[c]]) === 'boolean') {
479
+ dir = (order === 0 ? 1 : -1) * (tc.string[tc.strings[c]] ? -1 : 1);
480
+ } else {
481
+ dir = (tc.strings[c]) ? tc.string[tc.strings[c]] || 0 : 0;
482
+ }
476
483
  }
484
+ var sort = $.tablesorter["sort" + s](table, a[c], b[c], c, colMax[c], dir);
485
+ if (sort) { return sort; }
477
486
  }
478
- dynamicExp += "var " + e + " = $.tablesorter.sort" + s + "(table,a[" + c + "],b[" + c + "]," + c + "," + mx + "," + dir + "); ";
479
- dynamicExp += "if (" + e + ") { return " + e + "; } ";
480
- dynamicExp += "else { ";
481
- }
482
- // if value is the same keep orignal order
483
- orgOrderCol = (cache.normalized && cache.normalized[0]) ? cache.normalized[0].length - 1 : 0;
484
- dynamicExp += "return a[" + orgOrderCol + "]-b[" + orgOrderCol + "];";
485
- for (i=0; i < l; i++) {
486
- dynamicExp += "}; ";
487
- }
488
- dynamicExp += "return 0; ";
489
- dynamicExp += "}; ";
490
- cache.normalized.sort(eval(dynamicExp)); // sort using eval expression
487
+ return a[orgOrderCol] - b[orgOrderCol];
488
+ });
491
489
  }
492
490
  if (tc.debug) { benchmark("Sorting on " + sortList.toString() + " and dir " + order + " time", sortTime); }
493
491
  }
@@ -515,7 +513,7 @@
515
513
  // if no thead or tbody, or tablesorter is already present, quit
516
514
  if (!this.tHead || this.tBodies.length === 0 || this.hasInitialized === true) { return; }
517
515
  // declare
518
- var $headers, $cell, $this = $(this),
516
+ var $cell, $this = $(this),
519
517
  c, i, j, k = '', a, s, o, downTime,
520
518
  m = $.metadata;
521
519
  // initialization flag
@@ -538,15 +536,15 @@
538
536
  }
539
537
  $this.addClass(c.tableClass + k);
540
538
  // build headers
541
- $headers = buildHeaders(this);
539
+ c.$headers = buildHeaders(this);
542
540
  // try to auto detect column type, and store in tables config
543
- c.parsers = buildParserCache(this, $headers);
541
+ c.parsers = buildParserCache(this);
544
542
  // build the cache for the tbody cells
545
543
  // delayInit will delay building the cache until the user starts a sort
546
544
  if (!c.delayInit) { buildCache(this); }
547
545
  // apply event handling to headers
548
546
  // this is to big, perhaps break it out?
549
- $headers
547
+ c.$headers
550
548
  // http://stackoverflow.com/questions/5312849/jquery-find-self
551
549
  .find('*').andSelf().filter(c.selectorSort)
552
550
  .unbind('mousedown.tablesorter mouseup.tablesorter')
@@ -574,7 +572,7 @@
574
572
  // reset all sorts on non-current column - issue #30
575
573
  if (c.sortRestart) {
576
574
  i = cell;
577
- $headers.each(function() {
575
+ c.$headers.each(function() {
578
576
  // only reset counts on columns that weren't just clicked on and if not included in a multisort
579
577
  if (this !== i && (k || !$(this).is('.' + c.cssDesc + ',.' + c.cssAsc))) {
580
578
  this.count = -1;
@@ -655,7 +653,7 @@
655
653
  // setTimeout needed so the processing icon shows up
656
654
  setTimeout(function(){
657
655
  // set css for headers
658
- setHeadersCss($this[0], $headers);
656
+ setHeadersCss($this[0]);
659
657
  multisort($this[0]);
660
658
  appendToTable($this[0]);
661
659
  }, 1);
@@ -663,7 +661,7 @@
663
661
  });
664
662
  if (c.cancelSelection) {
665
663
  // cancel selection
666
- $headers.each(function() {
664
+ c.$headers.each(function() {
667
665
  this.onselectstart = function() {
668
666
  return false;
669
667
  };
@@ -671,12 +669,18 @@
671
669
  }
672
670
  // apply easy methods that trigger binded events
673
671
  $this
674
- .unbind('update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave')
672
+ .unbind('sortReset update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave')
673
+ .bind("sortReset", function(){
674
+ c.sortList = [];
675
+ setHeadersCss(this);
676
+ multisort(this);
677
+ appendToTable(this);
678
+ })
675
679
  .bind("update", function(e, resort, callback) {
676
680
  // remove rows/elements before update
677
681
  $(c.selectorRemove, this).remove();
678
682
  // rebuild parsers
679
- c.parsers = buildParserCache(this, $headers);
683
+ c.parsers = buildParserCache(this);
680
684
  // rebuild the cache map
681
685
  buildCache(this);
682
686
  checkResort($this, resort, callback);
@@ -703,6 +707,10 @@
703
707
  var i, rows = $row.filter('tr').length,
704
708
  dat = [], l = $row[0].cells.length, t = this,
705
709
  tbdy = $(this).find('tbody').index( $row.closest('tbody') );
710
+ // fixes adding rows to an empty table - see issue #179
711
+ if (!c.parsers) {
712
+ c.parsers = buildParserCache(t);
713
+ }
706
714
  // add each row
707
715
  for (i = 0; i < rows; i++) {
708
716
  // add each cell
@@ -724,7 +732,7 @@
724
732
  // update header count index
725
733
  updateHeaderSortCount(this, list);
726
734
  // set css for headers
727
- setHeadersCss(this, $headers);
735
+ setHeadersCss(this);
728
736
  // sort the table and append it to the dom
729
737
  multisort(this);
730
738
  appendToTable(this, init);
@@ -844,7 +852,7 @@
844
852
  // disable tablesorter
845
853
  $t
846
854
  .removeData('tablesorter')
847
- .unbind('update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave')
855
+ .unbind('sortReset update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave')
848
856
  .find('.' + c.cssHeader)
849
857
  .unbind('click mousedown mousemove mouseup')
850
858
  .removeClass(c.cssHeader + ' ' + c.cssAsc + ' ' + c.cssDesc)
@@ -1304,6 +1312,7 @@
1304
1312
  row = 0;
1305
1313
  $tv = $tb.children('tr:visible');
1306
1314
  // revered back to using jQuery each - strangely it's the fastest method
1315
+ /*jshint loopfunc:true */
1307
1316
  $tv.each(function(){
1308
1317
  $tr = $(this);
1309
1318
  // style children rows the same way the parent row was styled
@@ -1,6 +1,5 @@
1
1
  /*!
2
- * TableSorter 2.4.6 - Client-side table sorting with ease!
3
- * Minified using UglifyJS (http://jscompress.com/)
2
+ * TableSorter 2.5.2 min - Client-side table sorting with ease!
4
3
  * Copyright (c) 2007 Christian Bach
5
4
  */
6
- !function($){"use strict";$.extend({tablesorter:new function(){function log(a){if(typeof console!=="undefined"&&typeof console.log!=="undefined"){console.log(a)}else{alert(a)}}function benchmark(a,b){log(a+" ("+((new Date).getTime()-b.getTime())+"ms)")}function getElementText(a,b,c){if(!b){return""}var d=a.config,e=d.textExtraction,f="";if(e==="simple"){if(d.supportsTextContent){f=b.textContent}else{f=$(b).text()}}else{if(typeof e==="function"){f=e(b,a,c)}else if(typeof e==="object"&&e.hasOwnProperty(c)){f=e[c](b,a,c)}else{f=d.supportsTextContent?b.textContent:$(b).text()}}return $.trim(f)}function detectParserForColumn(a,b,c,d){var e,f=ts.parsers.length,g=false,h="",i=true;while(h===""&&i){c++;if(b[c]){g=b[c].cells[d];h=getElementText(a,g,d);if(a.config.debug){log("Checking if value was empty on row "+c+", column: "+d+": "+h)}}else{i=false}}for(e=1;e<f;e++){if(ts.parsers[e].is(h,a,g)){return ts.parsers[e]}}return ts.parsers[0]}function buildParserCache(a,b){var c=a.config,d=$(a.tBodies).filter(":not(."+c.cssInfoBlock+")"),e,f,g,h,i,j,k,l="";if(d.length===0){return}e=d[0].rows;if(e[0]){f=[];g=e[0].cells.length;for(h=0;h<g;h++){i=b.filter(':not([colspan])[data-column="'+h+'"]:last,[colspan="1"][data-column="'+h+'"]:last');j=c.headers[h];k=ts.getParserById(ts.getData(i,j,"sorter"));c.empties[h]=ts.getData(i,j,"empty")||c.emptyTo||(c.emptyToBottom?"bottom":"top");c.strings[h]=ts.getData(i,j,"string")||c.stringTo||"max";if(!k){k=detectParserForColumn(a,e,-1,h)}if(c.debug){l+="column:"+h+"; parser:"+k.id+"; string:"+c.strings[h]+"; empty: "+c.empties[h]+"\n"}f.push(k)}}if(c.debug){log(l)}return f}function buildCache(a){var b=a.tBodies,c=a.config,d,e,f=c.parsers,g,h,i,j,k,l,m;c.cache={};if(c.debug){m=new Date}if(c.showProcessing){ts.isProcessing(a,true)}for(j=0;j<b.length;j++){c.cache[j]={row:[],normalized:[]};if(!$(b[j]).hasClass(c.cssInfoBlock)){d=b[j]&&b[j].rows.length||0;e=b[j].rows[0]&&b[j].rows[0].cells.length||0;for(h=0;h<d;++h){k=$(b[j].rows[h]);l=[];if(k.hasClass(c.cssChildRow)){c.cache[j].row[c.cache[j].row.length-1]=c.cache[j].row[c.cache[j].row.length-1].add(k);continue}c.cache[j].row.push(k);for(i=0;i<e;++i){g=getElementText(a,k[0].cells[i],i);l.push(f[i].format(g,a,k[0].cells[i],i))}l.push(c.cache[j].normalized.length);c.cache[j].normalized.push(l)}}}if(c.showProcessing){ts.isProcessing(a)}if(c.debug){benchmark("Building cache for "+d+" rows",m)}}function appendToTable(a,b){var c=a.config,d=a.tBodies,e=[],f=c.cache,g,h,i,j,k,l,m,n,o,p,q,r;if(c.debug){r=new Date}for(o=0;o<d.length;o++){k=$(d[o]);if(!k.hasClass(c.cssInfoBlock)){l=ts.processTbody(a,k,true);g=f[o].row;h=f[o].normalized;i=h.length;j=i?h[0].length-1:0;for(m=0;m<i;m++){q=h[m][j];e.push(g[q]);if(!c.appender||!c.removeRows){p=g[q].length;for(n=0;n<p;n++){l.append(g[q][n])}}}ts.processTbody(a,l,false)}}if(c.appender){c.appender(a,e)}if(c.debug){benchmark("Rebuilt table",r)}if(!b){ts.applyWidget(a)}$(a).trigger("sortEnd",a)}function computeThIndexes(a){var b=[],c={},d=$(a).find("thead:eq(0) tr, tfoot tr"),e,f,g,h,i,j,k,l,m,n,o,p;for(e=0;e<d.length;e++){j=d[e].cells;for(f=0;f<j.length;f++){i=j[f];k=i.parentNode.rowIndex;l=k+"-"+i.cellIndex;m=i.rowSpan||1;n=i.colSpan||1;if(typeof b[k]==="undefined"){b[k]=[]}for(g=0;g<b[k].length+1;g++){if(typeof b[k][g]==="undefined"){o=g;break}}c[l]=o;$(i).attr({"data-column":o});for(g=k;g<k+m;g++){if(typeof b[g]==="undefined"){b[g]=[]}p=b[g];for(h=o;h<o+n;h++){p[h]="x"}}}}return c}function formatSortingOrder(a){return/^d/i.test(a)||a===1}function buildHeaders(a){var b=computeThIndexes(a),c,d,e,f,g,h,i=a.config;i.headerList=[];if(i.debug){g=new Date}h=$(a).find(i.selectorHeaders).each(function(a){d=$(this);c=i.headers[a];e=i.cssIcon?'<i class="'+i.cssIcon+'"></i>':"";this.innerHTML='<div class="tablesorter-header-inner">'+this.innerHTML+e+"</div>";if(i.onRenderHeader){i.onRenderHeader.apply(d,[a])}this.column=b[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(ts.getData(d,c,"sortInitialOrder")||i.sortInitialOrder)?[1,0,2]:[0,1,2];this.count=-1;if(ts.getData(d,c,"sorter")==="false"){this.sortDisabled=true;d.addClass("sorter-false")}else{d.removeClass("sorter-false")}this.lockedOrder=false;f=ts.getData(d,c,"lockedOrder")||false;if(typeof f!=="undefined"&&f!==false){this.order=this.lockedOrder=formatSortingOrder(f)?[1,1,1]:[0,0,0]}d.addClass(this.sortDisabled?"sorter-false":i.cssHeader);i.headerList[a]=this;d.parent().addClass(i.cssHeaderRow)});if(a.config.debug){benchmark("Built headers:",g);log(h)}return h}function setHeadersCss(a,b){var c,d,e,f,g=a.config,h=g.sortList,i=[g.cssDesc,g.cssAsc],j=$(a).find("tfoot tr").children().removeClass(i.join(" "));b.removeClass(i.join(" "));f=h.length;for(d=0;d<f;d++){if(h[d][1]!==2){c=b.not(".sorter-false").filter('[data-column="'+h[d][0]+'"]'+(f===1?":last":""));if(c.length){for(e=0;e<c.length;e++){if(!c[e].sortDisabled){c.eq(e).addClass(i[h[d][1]]);if(j.length){j.filter('[data-column="'+h[d][0]+'"]').eq(e).addClass(i[h[d][1]])}}}}}}}function fixColumnWidth(a){if(a.config.widthFixed&&$(a).find("colgroup").length===0){var b=$("<colgroup>"),c=$(a).width();$("tr:first td",a.tBodies[0]).each(function(){b.append($("<col>").css("width",parseInt($(this).width()/c*1e3,10)/10+"%"))});$(a).prepend(b)}}function updateHeaderSortCount(a,b){var c,d,e=a.config,f=e.headerList.length,g=b||e.sortList;e.sortList=[];$.each(g,function(a,b){c=[parseInt(b[0],10),parseInt(b[1],10)];d=e.headerList[c[0]];if(d){e.sortList.push(c);d.count=c[1]%(e.sortReset?3:2)}})}function getCachedSortType(a,b){return a&&a[b]?a[b].type||"":""}function multisort(table){var dynamicExp,sortWrapper,col,mx=0,dir=0,tc=table.config,sortList=tc.sortList,l=sortList.length,bl=table.tBodies.length,sortTime,i,j,k,c,cache,lc,s,e,order,orgOrderCol;if(tc.debug){sortTime=new Date}for(k=0;k<bl;k++){dynamicExp="sortWrapper = function(a,b) {";cache=tc.cache[k];lc=cache.normalized.length;for(i=0;i<l;i++){c=sortList[i][0];order=sortList[i][1];s=/n/i.test(getCachedSortType(tc.parsers,c))?"Numeric":"Text";s+=order===0?"":"Desc";e="e"+i;if(/Numeric/.test(s)&&tc.strings[c]){for(j=0;j<lc;j++){col=Math.abs(parseFloat(cache.normalized[j][c]));mx=Math.max(mx,isNaN(col)?0:col)}if(typeof tc.string[tc.strings[c]]==="boolean"){dir=(order===0?1:-1)*(tc.string[tc.strings[c]]?-1:1)}else{dir=tc.strings[c]?tc.string[tc.strings[c]]||0:0}}dynamicExp+="var "+e+" = $.tablesorter.sort"+s+"(table,a["+c+"],b["+c+"],"+c+","+mx+","+dir+"); ";dynamicExp+="if ("+e+") { return "+e+"; } ";dynamicExp+="else { "}orgOrderCol=cache.normalized&&cache.normalized[0]?cache.normalized[0].length-1:0;dynamicExp+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(i=0;i<l;i++){dynamicExp+="}; "}dynamicExp+="return 0; ";dynamicExp+="}; ";cache.normalized.sort(eval(dynamicExp))}if(tc.debug){benchmark("Sorting on "+sortList.toString()+" and dir "+order+" time",sortTime)}}function resortComplete(a,b){a.trigger("updateComplete");if(typeof b==="function"){b(a[0])}}function checkResort(a,b,c){if(b!==false){a.trigger("sorton",[a[0].config.sortList,function(){resortComplete(a,c)}])}else{resortComplete(a,c)}}var ts=this;ts.version="2.4.5";ts.parsers=[];ts.widgets=[];ts.defaults={theme:"default",widthFixed:false,showProcessing:false,cancelSelection:true,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",usNumberFormat:true,delayInit:false,headers:{},ignoreCase:true,sortForce:null,sortList:[],sortAppend:null,sortInitialOrder:"asc",sortLocaleCompare:false,sortReset:false,sortRestart:false,emptyTo:"bottom",stringTo:"max",textExtraction:"simple",textSorter:null,widgets:[],widgetOptions:{zebra:["even","odd"]},initWidgets:true,initialized:null,onRenderHeader:null,tableClass:"tablesorter",cssAsc:"tablesorter-headerSortUp",cssChildRow:"tablesorter-childRow",cssDesc:"tablesorter-headerSortDown",cssHeader:"tablesorter-header",cssHeaderRow:"tablesorter-headerRow",cssIcon:"tablesorter-icon",cssInfoBlock:"tablesorter-infoOnly",cssProcessing:"tablesorter-processing",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:false,headerList:[],empties:{},strings:{},parsers:[]};ts.benchmark=benchmark;ts.construct=function(a){return this.each(function(){if(!this.tHead||this.tBodies.length===0||this.hasInitialized===true){return}var b,c,d=$(this),e,f,g,h="",i,j,k,l,m=$.metadata;this.hasInitialized=false;this.config={};e=$.extend(true,this.config,ts.defaults,a);$.data(this,"tablesorter",e);if(e.debug){$.data(this,"startoveralltimer",new Date)}e.supportsTextContent=$("<span>x</span>")[0].textContent==="x";e.supportsDataObject=parseFloat($.fn.jquery)>=1.4;e.string={max:1,min:-1,"max+":1,"max-":-1,zero:0,none:0,"null":0,top:true,bottom:false};if(!/tablesorter\-/.test(d.attr("class"))){h=e.theme!==""?" tablesorter-"+e.theme:""}d.addClass(e.tableClass+h);b=buildHeaders(this);e.parsers=buildParserCache(this,b);if(!e.delayInit){buildCache(this)}b.find("*").andSelf().filter(e.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter").bind("mousedown.tablesorter mouseup.tablesorter",function(a,c){var m=this.tagName.match("TH|TD")?$(this):$(this).parents("th, td").filter(":last"),n=m[0];if((a.which||a.button)!==1){return false}if(a.type==="mousedown"){l=(new Date).getTime();return a.target.tagName==="INPUT"?"":!e.cancelSelection}if(c!==true&&(new Date).getTime()-l>250){return false}if(e.delayInit&&!e.cache){buildCache(d[0])}if(!n.sortDisabled){d.trigger("sortStart",d[0]);h=!a[e.sortMultiSortKey];n.count=(n.count+1)%(e.sortReset?3:2);if(e.sortRestart){f=n;b.each(function(){if(this!==f&&(h||!$(this).is("."+e.cssDesc+",."+e.cssAsc))){this.count=-1}})}f=n.column;if(h){e.sortList=[];if(e.sortForce!==null){i=e.sortForce;for(g=0;g<i.length;g++){if(i[g][0]!==f){e.sortList.push(i[g])}}}k=n.order[n.count];if(k<2){e.sortList.push([f,k]);if(n.colSpan>1){for(g=1;g<n.colSpan;g++){e.sortList.push([f+g,k])}}}}else{if(e.sortAppend&&e.sortList.length>1){if(ts.isValueInArray(e.sortAppend[0][0],e.sortList)){e.sortList.pop()}}if(ts.isValueInArray(f,e.sortList)){for(g=0;g<e.sortList.length;g++){j=e.sortList[g];k=e.headerList[j[0]];if(j[0]===f){j[1]=k.order[k.count];if(j[1]===2){e.sortList.splice(g,1);k.count=-1}}}}else{k=n.order[n.count];if(k<2){e.sortList.push([f,k]);if(n.colSpan>1){for(g=1;g<n.colSpan;g++){e.sortList.push([f+g,k])}}}}}if(e.sortAppend!==null){i=e.sortAppend;for(g=0;g<i.length;g++){if(i[g][0]!==f){e.sortList.push(i[g])}}}d.trigger("sortBegin",d[0]);setTimeout(function(){setHeadersCss(d[0],b);multisort(d[0]);appendToTable(d[0])},1)}});if(e.cancelSelection){b.each(function(){this.onselectstart=function(){return false}})}d.unbind("update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave").bind("update",function(a,c,f){$(e.selectorRemove,this).remove();e.parsers=buildParserCache(this,b);buildCache(this);checkResort(d,c,f)}).bind("updateCell",function(a,b,c,f){var g,h,i,j=this,k=$(this).find("tbody"),l=k.index($(b).parents("tbody").filter(":last")),m=$(b).parents("tr").filter(":last");if(k.length&&l>=0){h=k.eq(l).find("tr").index(m);i=b.cellIndex;g=j.config.cache[l].normalized[h].length-1;j.config.cache[l].row[j.config.cache[l].normalized[h][g]]=m;j.config.cache[l].normalized[h][i]=e.parsers[i].format(getElementText(j,b,i),j,b,i);checkResort(d,c,f)}}).bind("addRows",function(a,b,c,f){var h,i=b.filter("tr").length,j=[],k=b[0].cells.length,l=this,m=$(this).find("tbody").index(b.closest("tbody"));for(h=0;h<i;h++){for(g=0;g<k;g++){j[g]=e.parsers[g].format(getElementText(l,b[h].cells[g],g),l,b[h].cells[g],g)}j.push(e.cache[m].row.length);e.cache[m].row.push([b[h]]);e.cache[m].normalized.push(j);j=[]}checkResort(d,c,f)}).bind("sorton",function(a,c,d,e){$(this).trigger("sortStart",this);updateHeaderSortCount(this,c);setHeadersCss(this,b);multisort(this);appendToTable(this,e);if(typeof d==="function"){d(this)}}).bind("appendCache",function(a,b,c){appendToTable(this,c);if(typeof b==="function"){b(this)}}).bind("applyWidgetId",function(a,b){ts.getWidgetById(b).format(this,e,e.widgetOptions)}).bind("applyWidgets",function(a,b){ts.applyWidget(this,b)}).bind("refreshWidgets",function(a,b,c){ts.refreshWidgets(this,b,c)}).bind("destroy",function(a,b,c){ts.destroy(this,b,c)});if(e.supportsDataObject&&typeof d.data().sortlist!=="undefined"){e.sortList=d.data().sortlist}else if(m&&d.metadata()&&d.metadata().sortlist){e.sortList=d.metadata().sortlist}ts.applyWidget(this,true);if(e.sortList.length>0){d.trigger("sorton",[e.sortList,{},!e.initWidgets])}else if(e.initWidgets){ts.applyWidget(this)}fixColumnWidth(this);if(e.showProcessing){d.unbind("sortBegin sortEnd").bind("sortBegin sortEnd",function(a){ts.isProcessing(d[0],a.type==="sortBegin")})}this.hasInitialized=true;if(e.debug){ts.benchmark("Overall initialization time",$.data(this,"startoveralltimer"))}d.trigger("tablesorter-initialized",this);if(typeof e.initialized==="function"){e.initialized(this)}})};ts.isProcessing=function(a,b,c){var d=a.config,e=c||$(a).find("."+d.cssHeader);if(b){if(d.sortList.length>0){e=e.filter(function(){return this.sortDisabled?false:ts.isValueInArray(parseFloat($(this).attr("data-column")),d.sortList)})}e.addClass(d.cssProcessing)}else{e.removeClass(d.cssProcessing)}};ts.processTbody=function(a,b,c){var d,e;if(c){b.before('<span class="tablesorter-savemyplace"/>');e=$.fn.detach?b.detach():b.remove();return e}e=$(a).find("span.tablesorter-savemyplace");b.insertAfter(e);e.remove()};ts.clearTableBody=function(a){$(a.tBodies).filter(":not(."+a.config.cssInfoBlock+")").empty()};ts.destroy=function(a,b,c){var d=$(a),e=a.config,f=d.find("thead:first");a.hasInitialized=false;f.find("tr:not(."+e.cssHeaderRow+")").remove();f.find(".tablesorter-resizer").remove();ts.refreshWidgets(a,true,true);d.removeData("tablesorter").unbind("update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave").find("."+e.cssHeader).unbind("click mousedown mousemove mouseup").removeClass(e.cssHeader+" "+e.cssAsc+" "+e.cssDesc).find(".tablesorter-header-inner").each(function(){if(e.cssIcon!==""){$(this).find("."+e.cssIcon).remove()}$(this).replaceWith($(this).contents())});if(b!==false){d.removeClass(e.tableClass)}if(typeof c==="function"){c(a)}};ts.regex=[/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi,/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,/^0x[0-9a-f]+$/i];ts.sortText=function(a,b,c,d){if(b===c){return 0}var e=a.config,f=e.string[e.empties[d]||e.emptyTo],g=ts.regex,h,i,j,k,l,m,n,o;if(b===""&&f!==0){return typeof f==="boolean"?f?-1:1:-f||-1}if(c===""&&f!==0){return typeof f==="boolean"?f?1:-1:f||1}if(typeof e.textSorter==="function"){return e.textSorter(b,c,a,d)}h=b.replace(g[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");j=c.replace(g[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");i=parseInt(b.match(g[2]),16)||h.length!==1&&b.match(g[1])&&Date.parse(b);k=parseInt(c.match(g[2]),16)||i&&c.match(g[1])&&Date.parse(c)||null;if(k){if(i<k){return-1}if(i>k){return 1}}o=Math.max(h.length,j.length);for(n=0;n<o;n++){l=isNaN(h[n])?h[n]||0:parseFloat(h[n])||0;m=isNaN(j[n])?j[n]||0:parseFloat(j[n])||0;if(isNaN(l)!==isNaN(m)){return isNaN(l)?1:-1}if(typeof l!==typeof m){l+="";m+=""}if(l<m){return-1}if(l>m){return 1}}return 0};ts.sortTextDesc=function(a,b,c,d){if(b===c){return 0}var e=a.config,f=e.string[e.empties[d]||e.emptyTo];if(b===""&&f!==0){return typeof f==="boolean"?f?-1:1:f||1}if(c===""&&f!==0){return typeof f==="boolean"?f?1:-1:-f||-1}if(typeof e.textSorter==="function"){return e.textSorter(c,b,a,d)}return ts.sortText(a,c,b)};ts.getTextValue=function(a,b,c){if(b){var d,e=a.length,f=b+c;for(d=0;d<e;d++){f+=a.charCodeAt(d)}return c*f}return 0};ts.sortNumeric=function(a,b,c,d,e,f){if(b===c){return 0}var g=a.config,h=g.string[g.empties[d]||g.emptyTo];if(b===""&&h!==0){return typeof h==="boolean"?h?-1:1:-h||-1}if(c===""&&h!==0){return typeof h==="boolean"?h?1:-1:h||1}if(isNaN(b)){b=ts.getTextValue(b,e,f)}if(isNaN(c)){c=ts.getTextValue(c,e,f)}return b-c};ts.sortNumericDesc=function(a,b,c,d,e,f){if(b===c){return 0}var g=a.config,h=g.string[g.empties[d]||g.emptyTo];if(b===""&&h!==0){return typeof h==="boolean"?h?-1:1:h||1}if(c===""&&h!==0){return typeof h==="boolean"?h?1:-1:-h||-1}if(isNaN(b)){b=ts.getTextValue(b,e,f)}if(isNaN(c)){c=ts.getTextValue(c,e,f)}return c-b};ts.characterEquivalents={a:"\u00e1\u00e0\u00e2\u00e3\u00e4",A:"\u00c1\u00c0\u00c2\u00c3\u00c4",c:"\u00e7",C:"\u00c7",e:"\u00e9\u00e8\u00ea\u00eb",E:"\u00c9\u00c8\u00ca\u00cb",i:"\u00ed\u00ec\u0130\u00ee\u00ef",I:"\u00cd\u00cc\u0130\u00ce\u00cf",o:"\u00f3\u00f2\u00f4\u00f5\u00f6",O:"\u00d3\u00d2\u00d4\u00d5\u00d6",S:"\u00df",u:"\u00fa\u00f9\u00fb\u00fc",U:"\u00da\u00d9\u00db\u00dc"};;ts.replaceAccents=function(a){var b,c="[",d=ts.characterEquivalents;if(!ts.characterRegex){ts.characterRegexArray={};for(b in d){if(typeof b==="string"){c+=d[b];ts.characterRegexArray[b]=new RegExp("["+d[b]+"]","g")}}ts.characterRegex=new RegExp(c+"]")}if(ts.characterRegex.test(a)){for(b in d){if(typeof b==="string"){a=a.replace(ts.characterRegexArray[b],b)}}}return a};ts.isValueInArray=function(a,b){var c,d=b.length;for(c=0;c<d;c++){if(b[c][0]===a){return true}}return false};ts.addParser=function(a){var b,c=ts.parsers.length,d=true;for(b=0;b<c;b++){if(ts.parsers[b].id.toLowerCase()===a.id.toLowerCase()){d=false}}if(d){ts.parsers.push(a)}};ts.getParserById=function(a){var b,c=ts.parsers.length;for(b=0;b<c;b++){if(ts.parsers[b].id.toLowerCase()===a.toString().toLowerCase()){return ts.parsers[b]}}return false};ts.addWidget=function(a){ts.widgets.push(a)};ts.getWidgetById=function(a){var b,c,d=ts.widgets.length;for(b=0;b<d;b++){c=ts.widgets[b];if(c&&c.hasOwnProperty("id")&&c.id.toLowerCase()===a.toLowerCase()){return c}}};ts.applyWidget=function(a,b){var c=a.config,d=c.widgetOptions,e=c.widgets.sort().reverse(),f,g,h,i=e.length;g=$.inArray("zebra",c.widgets);if(g>=0){c.widgets.splice(g,1);c.widgets.push("zebra")}if(c.debug){f=new Date}for(g=0;g<i;g++){h=ts.getWidgetById(e[g]);if(h){if(b===true&&h.hasOwnProperty("init")){h.init(a,h,c,d)}else if(!b&&h.hasOwnProperty("format")){h.format(a,c,d)}}}if(c.debug){benchmark("Completed "+(b===true?"initializing":"applying")+" widgets",f)}};ts.refreshWidgets=function(a,b,c){var d,e=a.config,f=e.widgets,g=ts.widgets,h=g.length;for(d=0;d<h;d++){if(g[d]&&g[d].id&&(b||$.inArray(g[d].id,f)<0)){if(e.debug){log("removing "+g[d].id)}if(g[d].hasOwnProperty("remove")){g[d].remove(a,e,e.widgetOptions)}}}if(c!==true){ts.applyWidget(a,b)}};ts.getData=function(a,b,c){var d="",e=$(a),f,g;if(!e.length){return""}f=$.metadata?e.metadata():false;g=" "+(e.attr("class")||"");if(typeof e.data(c)!=="undefined"||typeof e.data(c.toLowerCase())!=="undefined"){d+=e.data(c)||e.data(c.toLowerCase())}else if(f&&typeof f[c]!=="undefined"){d+=f[c]}else if(b&&typeof b[c]!=="undefined"){d+=b[c]}else if(g!==" "&&g.match(" "+c+"-")){d=g.match(new RegExp(" "+c+"-(\\w+)"))[1]||""}return $.trim(d)};ts.formatFloat=function(a,b){if(typeof a!=="string"||a===""){return a}if(b.config.usNumberFormat!==false){a=a.replace(/,/g,"")}else{a=a.replace(/[\s|\.]/g,"").replace(/,/g,".")}if(/^\s*\([.\d]+\)/.test(a)){a=a.replace(/^\s*\(/,"-").replace(/\)/,"")}var c=parseFloat(a);return isNaN(c)?$.trim(a):c};ts.isDigit=function(a){return isNaN(a)?/^[\-+(]?\d+[)]?$/.test(a.toString().replace(/[,.'\s]/g,"")):true}}});var ts=$.tablesorter;$.fn.extend({tablesorter:ts.construct});ts.addParser({id:"text",is:function(a,b,c){return true},format:function(a,b,c,d){var e=b.config;a=$.trim(e.ignoreCase?a.toLocaleLowerCase():a);return e.sortLocaleCompare?ts.replaceAccents(a):a},type:"text"});ts.addParser({id:"currency",is:function(a){return/^\(?[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+/.test(a)},format:function(a,b){return ts.formatFloat(a.replace(/[^\w,. \-()]/g,""),b)},type:"numeric"});ts.addParser({id:"ipAddress",is:function(a){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(a)},format:function(a,b){var c,d=a.split("."),e="",f=d.length;for(c=0;c<f;c++){e+=("00"+d[c]).slice(-3)}return ts.formatFloat(e,b)},type:"numeric"});ts.addParser({id:"url",is:function(a){return/^(https?|ftp|file):\/\//.test(a)},format:function(a){return $.trim(a.replace(/(https?|ftp|file):\/\//,""))},type:"text"});ts.addParser({id:"isoDate",is:function(a){return/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(a)},format:function(a,b){return ts.formatFloat(a!==""?(new Date(a.replace(/-/g,"/"))).getTime()||"":"",b)},type:"numeric"});ts.addParser({id:"percent",is:function(a){return/\d%\)?$/.test(a)},format:function(a,b){return ts.formatFloat(a.replace(/%/g,""),b)},type:"numeric"});ts.addParser({id:"usLongDate",is:function(a){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4}|'?\d{2})\s+(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(a)},format:function(a,b){return ts.formatFloat((new Date(a.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||"",b)},type:"numeric"});ts.addParser({id:"shortDate",is:function(a){return/^(\d{2}|\d{4})[\/\-\,\.\s+]\d{2}[\/\-\.\,\s+](\d{2}|\d{4})$/.test(a)},format:function(a,b,c,d){var e=b.config,f=e.headerList[d],g=f.shortDateFormat;if(typeof g==="undefined"){g=f.shortDateFormat=ts.getData(f,e.headers[d],"dateFormat")||e.dateFormat}a=a.replace(/\s+/g," ").replace(/[\-|\.|\,]/g,"/");if(g==="mmddyyyy"){a=a.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2")}else if(g==="ddmmyyyy"){a=a.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1")}else if(g==="yyyymmdd"){a=a.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3")}return ts.formatFloat((new Date(a)).getTime()||"",b)},type:"numeric"});ts.addParser({id:"time",is:function(a){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(a)},format:function(a,b){return ts.formatFloat((new Date("2000/01/01 "+a.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||"",b)},type:"numeric"});ts.addParser({id:"digit",is:function(a){return ts.isDigit(a)},format:function(a,b){return ts.formatFloat(a.replace(/[^\w,. \-()]/g,""),b)},type:"numeric"});ts.addParser({id:"metadata",is:function(a){return false},format:function(a,b,c){var d=b.config,e=!d.parserMetadataName?"sortValue":d.parserMetadataName;return $(c).metadata()[e]},type:"numeric"});ts.addWidget({id:"zebra",format:function(a,b,c){var d,e,f,g,h,i,j,k,l=new RegExp(b.cssChildRow,"i"),m=$(a).children("tbody:not(."+b.cssInfoBlock+")");if(b.debug){i=new Date}for(j=0;j<m.length;j++){d=$(m[j]);k=d.children("tr").length;if(k>1){g=0;e=d.children("tr:visible");e.each(function(){f=$(this);if(!l.test(this.className)){g++}h=g%2===0;f.removeClass(c.zebra[h?1:0]).addClass(c.zebra[h?0:1])})}}if(b.debug){ts.benchmark("Applying Zebra widget",i)}},remove:function(a,b,c){var d,e,f=$(a).children("tbody:not(."+b.cssInfoBlock+")"),g=(b.widgetOptions.zebra||["even","odd"]).join(" ");for(d=0;d<f.length;d++){e=$.tablesorter.processTbody(a,$(f[d]),true);e.children().removeClass(g);$.tablesorter.processTbody(a,e,false)}}})}(jQuery)
5
+ !function(f){f.extend({tablesorter:new function(){function d(c){"undefined"!==typeof console&&"undefined"!==typeof console.log?console.log(c):alert(c)}function u(c,b){d(c+" ("+((new Date).getTime()-b.getTime())+"ms)")}function n(c,b,a){if(!b)return"";var g=c.config,h=g.textExtraction,e="",e="simple"===h?g.supportsTextContent?b.textContent:f(b).text():"function"===typeof h?h(b,c,a):"object"===typeof h&&h.hasOwnProperty(a)?h[a](b,c,a):g.supportsTextContent?b.textContent:f(b).text();return f.trim(e)} function i(c){var b=c.config,a=f(c.tBodies).filter(":not(."+b.cssInfoBlock+")"),g,h,s,j,l,k,m="";if(0!==a.length){a=a[0].rows;if(a[0]){g=[];h=a[0].cells.length;for(s=0;s<h;s++){j=b.$headers.filter(":not([colspan])");j=j.add(b.$headers.filter('[colspan="1"]')).filter('[data-column="'+s+'"]:last');l=b.headers[s];k=e.getParserById(e.getData(j,l,"sorter"));b.empties[s]=e.getData(j,l,"empty")||b.emptyTo||(b.emptyToBottom?"bottom":"top");b.strings[s]=e.getData(j,l,"string")||b.stringTo||"max";if(!k)a:{j= c;l=a;k=-1;for(var u=s,q=void 0,r=e.parsers.length,x=!1,p="",q=!0;""===p&&q;)k++,l[k]?(x=l[k].cells[u],p=n(j,x,u),j.config.debug&&d("Checking if value was empty on row "+k+", column: "+u+": "+p)):q=!1;for(q=1;q<r;q++)if(e.parsers[q].is(p,j,x)){k=e.parsers[q];break a}k=e.parsers[0]}b.debug&&(m+="column:"+s+"; parser:"+k.id+"; string:"+b.strings[s]+"; empty: "+b.empties[s]+"\n");g.push(k)}}b.debug&&d(m);return g}}function p(c){var b=c.tBodies,a=c.config,g,h,d=a.parsers,j,l,k,m,i,q,p,x=[];a.cache={}; a.debug&&(p=new Date);a.showProcessing&&e.isProcessing(c,!0);for(m=0;m<b.length;m++)if(a.cache[m]={row:[],normalized:[]},!f(b[m]).hasClass(a.cssInfoBlock)){g=b[m]&&b[m].rows.length||0;h=b[m].rows[0]&&b[m].rows[0].cells.length||0;for(l=0;l<g;++l)if(i=f(b[m].rows[l]),q=[],i.hasClass(a.cssChildRow))a.cache[m].row[a.cache[m].row.length-1]=a.cache[m].row[a.cache[m].row.length-1].add(i);else{a.cache[m].row.push(i);for(k=0;k<h;++k)if(j=n(c,i[0].cells[k],k),j=d[k].format(j,c,i[0].cells[k],k),q.push(j),"numeric"=== (d[k].type||"").toLowerCase())x[k]=Math.max(Math.abs(j),x[k]||0);q.push(a.cache[m].normalized.length);a.cache[m].normalized.push(q)}a.cache[m].colMax=x}a.showProcessing&&e.isProcessing(c);a.debug&&u("Building cache for "+g+" rows",p)}function r(c,b){var a=c.config,g=c.tBodies,h=[],d=a.cache,j,l,k,m,i,q,n,p,r,t,v;a.debug&&(v=new Date);for(p=0;p<g.length;p++)if(j=f(g[p]),!j.hasClass(a.cssInfoBlock)){i=e.processTbody(c,j,!0);j=d[p].row;l=d[p].normalized;m=(k=l.length)?l[0].length-1:0;for(q=0;q<k;q++)if(t= l[q][m],h.push(j[t]),!a.appender||!a.removeRows){r=j[t].length;for(n=0;n<r;n++)i.append(j[t][n])}e.processTbody(c,i,!1)}a.appender&&a.appender(c,h);a.debug&&u("Rebuilt table",v);b||e.applyWidget(c);f(c).trigger("sortEnd",c)}function B(c){var b,a,g,h=c.config,e=h.sortList,d=[h.cssAsc,h.cssDesc],l=f(c).find("tfoot tr").children().removeClass(d.join(" "));h.$headers.removeClass(d.join(" "));g=e.length;for(b=0;b<g;b++)if(2!==e[b][1]&&(c=h.$headers.not(".sorter-false").filter('[data-column="'+e[b][0]+ '"]'+(1===g?":last":"")),c.length))for(a=0;a<c.length;a++)c[a].sortDisabled||(c.eq(a).addClass(d[e[b][1]]),l.length&&l.filter('[data-column="'+e[b][0]+'"]').eq(a).addClass(d[e[b][1]]))}function D(c){var b=0,a=c.config,g=a.sortList,h=g.length,e=c.tBodies.length,d,l,k,m,i,q,n,p,r;a.debug&&(d=new Date);for(k=0;k<e;k++)i=a.cache[k].colMax,r=(q=a.cache[k].normalized)&&q[0]?q[0].length-1:0,q.sort(function(e,d){for(l=0;l<h;l++){m=g[l][0];p=g[l][1];n=/n/i.test(a.parsers&&a.parsers[m]?a.parsers[m].type||"": "")?"Numeric":"Text";n+=0===p?"":"Desc";/Numeric/.test(n)&&a.strings[m]&&(b="boolean"===typeof a.string[a.strings[m]]?(0===p?1:-1)*(a.string[a.strings[m]]?-1:1):a.strings[m]?a.string[a.strings[m]]||0:0);var j=f.tablesorter["sort"+n](c,e[m],d[m],m,i[m],b);if(j)return j}return e[r]-d[r]});a.debug&&u("Sorting on "+g.toString()+" and dir "+p+" time",d)}function C(c,b){c.trigger("updateComplete");"function"===typeof b&&b(c[0])}function E(c,b,a){!1!==b?c.trigger("sorton",[c[0].config.sortList,function(){C(c, a)}]):C(c,a)}var e=this;e.version="2.5.2";e.parsers=[];e.widgets=[];e.defaults={theme:"default",widthFixed:!1,showProcessing:!1,cancelSelection:!0,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",usNumberFormat:!0,delayInit:!1,headers:{},ignoreCase:!0,sortForce:null,sortList:[],sortAppend:null,sortInitialOrder:"asc",sortLocaleCompare:!1,sortReset:!1,sortRestart:!1,emptyTo:"bottom",stringTo:"max",textExtraction:"simple",textSorter:null,widgets:[],widgetOptions:{zebra:["even","odd"]},initWidgets:!0, initialized:null,onRenderHeader:null,tableClass:"tablesorter",cssAsc:"tablesorter-headerAsc",cssChildRow:"tablesorter-childRow",cssDesc:"tablesorter-headerDesc",cssHeader:"tablesorter-header",cssHeaderRow:"tablesorter-headerRow",cssIcon:"tablesorter-icon",cssInfoBlock:"tablesorter-infoOnly",cssProcessing:"tablesorter-processing",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]};e.benchmark=u;e.construct= function(c){return this.each(function(){if(this.tHead&&!(0===this.tBodies.length||!0===this.hasInitialized)){var b=f(this),a,g,h,s="",j,l,k,m,C=f.metadata;this.hasInitialized=!1;this.config={};a=f.extend(!0,this.config,e.defaults,c);f.data(this,"tablesorter",a);a.debug&&f.data(this,"startoveralltimer",new Date);a.supportsTextContent="x"===f("<span>x</span>")[0].textContent;a.supportsDataObject=1.4<=parseFloat(f.fn.jquery);a.string={max:1,min:-1,"max+":1,"max-":-1,zero:0,none:0,"null":0,top:!0,bottom:!1}; /tablesorter\-/.test(b.attr("class"))||(s=""!==a.theme?" tablesorter-"+a.theme:"");b.addClass(a.tableClass+s);var q=[],M={},x=f(this).find("thead:eq(0) tr, tfoot tr"),H,I,v,y,L,A,J,N,O,F;for(H=0;H<x.length;H++){L=x[H].cells;for(I=0;I<L.length;I++){y=L[I];A=y.parentNode.rowIndex;J=A+"-"+y.cellIndex;N=y.rowSpan||1;O=y.colSpan||1;"undefined"===typeof q[A]&&(q[A]=[]);for(v=0;v<q[A].length+1;v++)if("undefined"===typeof q[A][v]){F=v;break}M[J]=F;f(y).attr({"data-column":F});for(v=A;v<A+N;v++){"undefined"=== typeof q[v]&&(q[v]=[]);J=q[v];for(y=F;y<F+O;y++)J[y]="x"}}}var K,z,P,G,Q,w=this.config;w.headerList=[];w.debug&&(Q=new Date);q=f(this).find(w.selectorHeaders).each(function(a){z=f(this);K=w.headers[a];P=w.cssIcon?'<i class="'+w.cssIcon+'"></i>':"";this.innerHTML='<div class="tablesorter-header-inner">'+this.innerHTML+P+"</div>";w.onRenderHeader&&w.onRenderHeader.apply(z,[a]);this.column=M[this.parentNode.rowIndex+"-"+this.cellIndex];var b=e.getData(z,K,"sortInitialOrder")||w.sortInitialOrder;this.order= /^d/i.test(b)||1===b?[1,0,2]:[0,1,2];this.count=-1;"false"===e.getData(z,K,"sorter")?(this.sortDisabled=!0,z.addClass("sorter-false")):z.removeClass("sorter-false");this.lockedOrder=!1;G=e.getData(z,K,"lockedOrder")||!1;"undefined"!==typeof G&&!1!==G&&(this.order=this.lockedOrder=/^d/i.test(G)||1===G?[1,1,1]:[0,0,0]);z.addClass((this.sortDisabled?"sorter-false ":" ")+w.cssHeader);w.headerList[a]=this;z.parent().addClass(w.cssHeaderRow)});this.config.debug&&(u("Built headers:",Q),d(q));a.$headers= q;a.parsers=i(this);a.delayInit||p(this);a.$headers.find("*").andSelf().filter(a.selectorSort).unbind("mousedown.tablesorter mouseup.tablesorter").bind("mousedown.tablesorter mouseup.tablesorter",function(c,d){var i=(this.tagName.match("TH|TD")?f(this):f(this).parents("th, td").filter(":last"))[0];if(1!==(c.which||c.button))return!1;if("mousedown"===c.type)return m=(new Date).getTime(),"INPUT"===c.target.tagName?"":!a.cancelSelection;if(!0!==d&&250<(new Date).getTime()-m)return!1;a.delayInit&&!a.cache&& p(b[0]);if(!i.sortDisabled){b.trigger("sortStart",b[0]);s=!c[a.sortMultiSortKey];i.count=(i.count+1)%(a.sortReset?3:2);a.sortRestart&&(g=i,a.$headers.each(function(){if(this!==g&&(s||!f(this).is("."+a.cssDesc+",."+a.cssAsc)))this.count=-1}));g=i.column;if(s){a.sortList=[];if(null!==a.sortForce){j=a.sortForce;for(h=0;h<j.length;h++)j[h][0]!==g&&a.sortList.push(j[h])}k=i.order[i.count];if(2>k&&(a.sortList.push([g,k]),1<i.colSpan))for(h=1;h<i.colSpan;h++)a.sortList.push([g+h,k])}else if(a.sortAppend&& 1<a.sortList.length&&e.isValueInArray(a.sortAppend[0][0],a.sortList)&&a.sortList.pop(),e.isValueInArray(g,a.sortList))for(h=0;h<a.sortList.length;h++)l=a.sortList[h],k=a.headerList[l[0]],l[0]===g&&(l[1]=k.order[k.count],2===l[1]&&(a.sortList.splice(h,1),k.count=-1));else if(k=i.order[i.count],2>k&&(a.sortList.push([g,k]),1<i.colSpan))for(h=1;h<i.colSpan;h++)a.sortList.push([g+h,k]);if(null!==a.sortAppend){j=a.sortAppend;for(h=0;h<j.length;h++)j[h][0]!==g&&a.sortList.push(j[h])}b.trigger("sortBegin", b[0]);setTimeout(function(){B(b[0]);D(b[0]);r(b[0])},1)}});a.cancelSelection&&a.$headers.each(function(){this.onselectstart=function(){return!1}});b.unbind("sortReset update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave").bind("sortReset",function(){a.sortList=[];B(this);D(this);r(this)}).bind("update",function(c,g,h){f(a.selectorRemove,this).remove();a.parsers=i(this);p(this);E(b,g,h)}).bind("updateCell",function(c,g,h,e){var d,j,i;d=f(this).find("tbody"); var c=d.index(f(g).parents("tbody").filter(":last")),s=f(g).parents("tr").filter(":last");d.length&&0<=c&&(j=d.eq(c).find("tr").index(s),i=g.cellIndex,d=this.config.cache[c].normalized[j].length-1,this.config.cache[c].row[this.config.cache[c].normalized[j][d]]=s,this.config.cache[c].normalized[j][i]=a.parsers[i].format(n(this,g,i),this,g,i),E(b,h,e))}).bind("addRows",function(c,g,e,d){var j=g.filter("tr").length,s=[],k=g[0].cells.length,l=f(this).find("tbody").index(g.closest("tbody"));a.parsers|| (a.parsers=i(this));for(c=0;c<j;c++){for(h=0;h<k;h++)s[h]=a.parsers[h].format(n(this,g[c].cells[h],h),this,g[c].cells[h],h);s.push(a.cache[l].row.length);a.cache[l].row.push([g[c]]);a.cache[l].normalized.push(s);s=[]}E(b,e,d)}).bind("sorton",function(a,b,c,g){f(this).trigger("sortStart",this);var h,e,d=this.config,a=b||d.sortList;d.sortList=[];f.each(a,function(a,b){h=[parseInt(b[0],10),parseInt(b[1],10)];if(e=d.headerList[h[0]])d.sortList.push(h),e.count=h[1]%(d.sortReset?3:2)});B(this);D(this); r(this,g);"function"===typeof c&&c(this)}).bind("appendCache",function(a,b,c){r(this,c);"function"===typeof b&&b(this)}).bind("applyWidgetId",function(b,c){e.getWidgetById(c).format(this,a,a.widgetOptions)}).bind("applyWidgets",function(a,b){e.applyWidget(this,b)}).bind("refreshWidgets",function(a,b,c){e.refreshWidgets(this,b,c)}).bind("destroy",function(a,b,c){e.destroy(this,b,c)});a.supportsDataObject&&"undefined"!==typeof b.data().sortlist?a.sortList=b.data().sortlist:C&&(b.metadata()&&b.metadata().sortlist)&& (a.sortList=b.metadata().sortlist);e.applyWidget(this,!0);0<a.sortList.length?b.trigger("sorton",[a.sortList,{},!a.initWidgets]):a.initWidgets&&e.applyWidget(this);if(this.config.widthFixed&&0===f(this).find("colgroup").length){var R=f("<colgroup>"),S=f(this).width();f("tr:first td",this.tBodies[0]).each(function(){R.append(f("<col>").css("width",parseInt(1E3*(f(this).width()/S),10)/10+"%"))});f(this).prepend(R)}a.showProcessing&&b.unbind("sortBegin sortEnd").bind("sortBegin sortEnd",function(a){e.isProcessing(b[0], "sortBegin"===a.type)});this.hasInitialized=!0;a.debug&&e.benchmark("Overall initialization time",f.data(this,"startoveralltimer"));b.trigger("tablesorter-initialized",this);"function"===typeof a.initialized&&a.initialized(this)}})};e.isProcessing=function(c,b,a){var g=c.config,c=a||f(c).find("."+g.cssHeader);b?(0<g.sortList.length&&(c=c.filter(function(){return this.sortDisabled?!1:e.isValueInArray(parseFloat(f(this).attr("data-column")),g.sortList)})),c.addClass(g.cssProcessing)):c.removeClass(g.cssProcessing)}; e.processTbody=function(c,b,a){if(a)return b.before('<span class="tablesorter-savemyplace"/>'),c=f.fn.detach?b.detach():b.remove();c=f(c).find("span.tablesorter-savemyplace");b.insertAfter(c);c.remove()};e.clearTableBody=function(c){f(c.tBodies).filter(":not(."+c.config.cssInfoBlock+")").empty()};e.destroy=function(c,b,a){var g=f(c),h=c.config,d=g.find("thead:first");c.hasInitialized=!1;d.find("tr:not(."+h.cssHeaderRow+")").remove();d.find(".tablesorter-resizer").remove();e.refreshWidgets(c,!0,!0); g.removeData("tablesorter").unbind("sortReset update updateCell addRows sorton appendCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave").find("."+h.cssHeader).unbind("click mousedown mousemove mouseup").removeClass(h.cssHeader+" "+h.cssAsc+" "+h.cssDesc).find(".tablesorter-header-inner").each(function(){""!==h.cssIcon&&f(this).find("."+h.cssIcon).remove();f(this).replaceWith(f(this).contents())});!1!==b&&g.removeClass(h.tableClass);"function"===typeof a&&a(c)};e.regex=[/(^-?[0-9]+(\.?[0-9]*)[df]?e?[0-9]?$|^0x[0-9a-f]+$|[0-9]+)/gi, /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,/^0x[0-9a-f]+$/i];e.sortText=function(c,b,a,g){if(b===a)return 0;var h=c.config,d=h.string[h.empties[g]||h.emptyTo],j=e.regex;if(""===b&&0!==d)return"boolean"===typeof d?d?-1:1:-d||-1;if(""===a&&0!==d)return"boolean"===typeof d?d?1:-1:d||1;if("function"===typeof h.textSorter)return h.textSorter(b,a,c,g);c=b.replace(j[0],"\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");g=a.replace(j[0], "\\0$1\\0").replace(/\\0$/,"").replace(/^\\0/,"").split("\\0");b=parseInt(b.match(j[2]),16)||1!==c.length&&b.match(j[1])&&Date.parse(b);if(a=parseInt(a.match(j[2]),16)||b&&a.match(j[1])&&Date.parse(a)||null){if(b<a)return-1;if(b>a)return 1}h=Math.max(c.length,g.length);for(b=0;b<h;b++){a=isNaN(c[b])?c[b]||0:parseFloat(c[b])||0;j=isNaN(g[b])?g[b]||0:parseFloat(g[b])||0;if(isNaN(a)!==isNaN(j))return isNaN(a)?1:-1;typeof a!==typeof j&&(a+="",j+="");if(a<j)return-1;if(a>j)return 1}return 0};e.sortTextDesc= function(c,b,a,g){if(b===a)return 0;var d=c.config,f=d.string[d.empties[g]||d.emptyTo];return""===b&&0!==f?"boolean"===typeof f?f?-1:1:f||1:""===a&&0!==f?"boolean"===typeof f?f?1:-1:-f||-1:"function"===typeof d.textSorter?d.textSorter(a,b,c,g):e.sortText(c,a,b)};e.getTextValue=function(c,b,a){if(b){for(var g=c.length,d=b+a,b=0;b<g;b++)d+=c.charCodeAt(b);return a*d}return 0};e.sortNumeric=function(c,b,a,g,d,f){if(b===a)return 0;c=c.config;g=c.string[c.empties[g]||c.emptyTo];if(""===b&&0!==g)return"boolean"=== typeof g?g?-1:1:-g||-1;if(""===a&&0!==g)return"boolean"===typeof g?g?1:-1:g||1;isNaN(b)&&(b=e.getTextValue(b,d,f));isNaN(a)&&(a=e.getTextValue(a,d,f));return b-a};e.sortNumericDesc=function(c,b,a,d,h,f){if(b===a)return 0;c=c.config;d=c.string[c.empties[d]||c.emptyTo];if(""===b&&0!==d)return"boolean"===typeof d?d?-1:1:d||1;if(""===a&&0!==d)return"boolean"===typeof d?d?1:-1:-d||-1;isNaN(b)&&(b=e.getTextValue(b,h,f));isNaN(a)&&(a=e.getTextValue(a,h,f));return a-b};e.characterEquivalents={a:"\u00e1\u00e0\u00e2\u00e3\u00e4", A:"\u00c1\u00c0\u00c2\u00c3\u00c4",c:"\u00e7",C:"\u00c7",e:"\u00e9\u00e8\u00ea\u00eb",E:"\u00c9\u00c8\u00ca\u00cb",i:"\u00ed\u00ec\u0130\u00ee\u00ef",I:"\u00cd\u00cc\u0130\u00ce\u00cf",o:"\u00f3\u00f2\u00f4\u00f5\u00f6",O:"\u00d3\u00d2\u00d4\u00d5\u00d6",S:"\u00df",u:"\u00fa\u00f9\u00fb\u00fc",U:"\u00da\u00d9\u00db\u00dc"};e.replaceAccents=function(c){var b,a="[",d=e.characterEquivalents;if(!e.characterRegex){e.characterRegexArray={};for(b in d)"string"===typeof b&&(a+=d[b],e.characterRegexArray[b]= RegExp("["+d[b]+"]","g"));e.characterRegex=RegExp(a+"]")}if(e.characterRegex.test(c))for(b in d)"string"===typeof b&&(c=c.replace(e.characterRegexArray[b],b));return c};e.isValueInArray=function(c,b){var a,d=b.length;for(a=0;a<d;a++)if(b[a][0]===c)return!0;return!1};e.addParser=function(c){var b,a=e.parsers.length,d=!0;for(b=0;b<a;b++)e.parsers[b].id.toLowerCase()===c.id.toLowerCase()&&(d=!1);d&&e.parsers.push(c)};e.getParserById=function(c){var b,a=e.parsers.length;for(b=0;b<a;b++)if(e.parsers[b].id.toLowerCase()=== c.toString().toLowerCase())return e.parsers[b];return!1};e.addWidget=function(c){e.widgets.push(c)};e.getWidgetById=function(c){var b,a,d=e.widgets.length;for(b=0;b<d;b++)if((a=e.widgets[b])&&a.hasOwnProperty("id")&&a.id.toLowerCase()===c.toLowerCase())return a};e.applyWidget=function(c,b){var a=c.config,d=a.widgetOptions,h=a.widgets.sort().reverse(),i,j,l,k=h.length;j=f.inArray("zebra",a.widgets);0<=j&&(a.widgets.splice(j,1),a.widgets.push("zebra"));a.debug&&(i=new Date);for(j=0;j<k;j++)(l=e.getWidgetById(h[j]))&& (!0===b&&l.hasOwnProperty("init")?l.init(c,l,a,d):!b&&l.hasOwnProperty("format")&&l.format(c,a,d));a.debug&&u("Completed "+(!0===b?"initializing":"applying")+" widgets",i)};e.refreshWidgets=function(c,b,a){var g,h=c.config,i=h.widgets,j=e.widgets,l=j.length;for(g=0;g<l;g++)if(j[g]&&j[g].id&&(b||0>f.inArray(j[g].id,i)))h.debug&&d("removing "+j[g].id),j[g].hasOwnProperty("remove")&&j[g].remove(c,h,h.widgetOptions);!0!==a&&e.applyWidget(c,b)};e.getData=function(c,b,a){var d="",c=f(c),e,i;if(!c.length)return""; e=f.metadata?c.metadata():!1;i=" "+(c.attr("class")||"");"undefined"!==typeof c.data(a)||"undefined"!==typeof c.data(a.toLowerCase())?d+=c.data(a)||c.data(a.toLowerCase()):e&&"undefined"!==typeof e[a]?d+=e[a]:b&&"undefined"!==typeof b[a]?d+=b[a]:" "!==i&&i.match(" "+a+"-")&&(d=i.match(RegExp(" "+a+"-(\\w+)"))[1]||"");return f.trim(d)};e.formatFloat=function(c,b){if("string"!==typeof c||""===c)return c;c=!1!==b.config.usNumberFormat?c.replace(/,/g,""):c.replace(/[\s|\.]/g,"").replace(/,/g,".");/^\s*\([.\d]+\)/.test(c)&& (c=c.replace(/^\s*\(/,"-").replace(/\)/,""));var a=parseFloat(c);return isNaN(a)?f.trim(c):a};e.isDigit=function(c){return isNaN(c)?/^[\-+(]?\d+[)]?$/.test(c.toString().replace(/[,.'\s]/g,"")):!0}}});var i=f.tablesorter;f.fn.extend({tablesorter:i.construct});i.addParser({id:"text",is:function(){return!0},format:function(d,u){var n=u.config,d=f.trim(n.ignoreCase?d.toLocaleLowerCase():d);return n.sortLocaleCompare?i.replaceAccents(d):d},type:"text"});i.addParser({id:"currency",is:function(d){return/^\(?[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+/.test(d)}, format:function(d,f){return i.formatFloat(d.replace(/[^\w,. \-()]/g,""),f)},type:"numeric"});i.addParser({id:"ipAddress",is:function(d){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(d)},format:function(d,f){var n,t=d.split("."),p="",r=t.length;for(n=0;n<r;n++)p+=("00"+t[n]).slice(-3);return i.formatFloat(p,f)},type:"numeric"});i.addParser({id:"url",is:function(d){return/^(https?|ftp|file):\/\//.test(d)},format:function(d){return f.trim(d.replace(/(https?|ftp|file):\/\//,""))},type:"text"}); i.addParser({id:"isoDate",is:function(d){return/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(d)},format:function(d,f){return i.formatFloat(""!==d?(new Date(d.replace(/-/g,"/"))).getTime()||"":"",f)},type:"numeric"});i.addParser({id:"percent",is:function(d){return/\d%\)?$/.test(d)},format:function(d,f){return i.formatFloat(d.replace(/%/g,""),f)},type:"numeric"});i.addParser({id:"usLongDate",is:function(d){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4}|'?\d{2})\s+(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(d)}, format:function(d,f){return i.formatFloat((new Date(d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||"",f)},type:"numeric"});i.addParser({id:"shortDate",is:function(d){return/^(\d{2}|\d{4})[\/\-\,\.\s+]\d{2}[\/\-\.\,\s+](\d{2}|\d{4})$/.test(d)},format:function(d,f,n,t){var n=f.config,p=n.headerList[t],r=p.shortDateFormat;"undefined"===typeof r&&(r=p.shortDateFormat=i.getData(p,n.headers[t],"dateFormat")||n.dateFormat);d=d.replace(/\s+/g," ").replace(/[\-|\.|\,]/g,"/");"mmddyyyy"===r?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/, "$3/$1/$2"):"ddmmyyyy"===r?d=d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===r&&(d=d.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3"));return i.formatFloat((new Date(d)).getTime()||"",f)},type:"numeric"});i.addParser({id:"time",is:function(d){return/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i.test(d)},format:function(d,f){return i.formatFloat((new Date("2000/01/01 "+d.replace(/(\S)([AP]M)$/i,"$1 $2"))).getTime()||"",f)},type:"numeric"});i.addParser({id:"digit", is:function(d){return i.isDigit(d)},format:function(d,f){return i.formatFloat(d.replace(/[^\w,. \-()]/g,""),f)},type:"numeric"});i.addParser({id:"metadata",is:function(){return!1},format:function(d,i,n){d=i.config;d=!d.parserMetadataName?"sortValue":d.parserMetadataName;return f(n).metadata()[d]},type:"numeric"});i.addWidget({id:"zebra",format:function(d,u,n){var t,p,r,B,D,C,E=RegExp(u.cssChildRow,"i"),e=f(d).children("tbody:not(."+u.cssInfoBlock+")");u.debug&&(D=new Date);for(d=0;d<e.length;d++)t= f(e[d]),C=t.children("tr").length,1<C&&(r=0,t=t.children("tr:visible"),t.each(function(){p=f(this);E.test(this.className)||r++;B=0===r%2;p.removeClass(n.zebra[B?1:0]).addClass(n.zebra[B?0:1])}));u.debug&&i.benchmark("Applying Zebra widget",D)},remove:function(d,i){var n,t,p=f(d).children("tbody:not(."+i.cssInfoBlock+")"),r=(i.widgetOptions.zebra||["even","odd"]).join(" ");for(n=0;n<p.length;n++)t=f.tablesorter.processTbody(d,f(p[n]),!0),t.children().removeClass(r),f.tablesorter.processTbody(d,t,!1)}})}(jQuery);
@@ -1,4 +1,4 @@
1
- /*! tableSorter 2.4+ widgets - updated 10/17/2012
1
+ /*! tableSorter 2.4+ widgets - updated 11/22/2012
2
2
  *
3
3
  * Column Styles
4
4
  * Column Filters
@@ -159,7 +159,7 @@ $.tablesorter.addWidget({
159
159
  $tar.removeClass(rmv + ' tablesorter-icon ' + o.icons);
160
160
  } else {
161
161
  t = ($t.hasClass('hasStickyHeaders')) ? $t.find(sh).find('th').eq(i).add($el) : $el;
162
- klass = ($el.hasClass(c.cssAsc)) ? o.sortDesc : ($el.hasClass(c.cssDesc)) ? o.sortAsc : $el.hasClass(c.cssHeader) ? o.sortNone : '';
162
+ klass = ($el.hasClass(c.cssAsc)) ? o.sortAsc : ($el.hasClass(c.cssDesc)) ? o.sortDesc : $el.hasClass(c.cssHeader) ? o.sortNone : '';
163
163
  $el[klass === o.sortNone ? 'removeClass' : 'addClass'](o.active);
164
164
  $tar.removeClass(rmv).addClass(klass);
165
165
  }
@@ -673,10 +673,11 @@ $.tablesorter.addWidget({
673
673
  hdrCells = header.children('tr:not(.sticky-false)').children(),
674
674
  css = wo.stickyHeaders || 'tablesorter-stickyHeader',
675
675
  innr = '.tablesorter-header-inner',
676
- firstCell = hdrCells.eq(0),
676
+ firstRow = hdrCells.eq(0).parent(),
677
677
  tfoot = $table.find('tfoot'),
678
+ t2 = $table.clone(), // clone table, but don't remove id... the table might be styled by css
678
679
  // clone the entire thead - seems to work in IE8+
679
- stkyHdr = header.clone()
680
+ stkyHdr = t2.children('thead:first')
680
681
  .addClass(css)
681
682
  .css({
682
683
  width : header.outerWidth(true),
@@ -686,7 +687,7 @@ $.tablesorter.addWidget({
686
687
  visibility : 'hidden',
687
688
  zIndex : 1
688
689
  }),
689
- stkyCells = stkyHdr.find('tr').children(),
690
+ stkyCells = stkyHdr.children('tr:not(.sticky-false)').children(), // issue #172
690
691
  laststate = '',
691
692
  spacing = 0,
692
693
  resizeHdr = function(){
@@ -694,10 +695,10 @@ $.tablesorter.addWidget({
694
695
  spacing = 0;
695
696
  // yes, I dislike browser sniffing, but it really is needed here :(
696
697
  // webkit automatically compensates for border spacing
697
- if ($table.css('border-collapse') !== 'collapse' && !/webkit/i.test(bwsr)) {
698
- // IE needs to be adjusted by the padding; Firefox & Opera use the border-spacing
698
+ if ($table.css('border-collapse') !== 'collapse' && !/(webkit|msie)/i.test(bwsr)) {
699
+ // Firefox & Opera use the border-spacing
699
700
  // update border-spacing here because of demos that switch themes
700
- spacing = /msie/i.test(bwsr) ? parseInt(header.css('padding-left'), 10) : parseInt($table.css('border-spacing'), 10);
701
+ spacing = parseInt(hdrCells.eq(0).css('border-left-width'), 10) * 2;
701
702
  }
702
703
  stkyHdr.css({
703
704
  left : header.offset().left - win.scrollLeft() - spacing,
@@ -707,7 +708,7 @@ $.tablesorter.addWidget({
707
708
  .each(function(i){
708
709
  var $h = hdrCells.eq(i);
709
710
  $(this).css({
710
- width: $h.width(),
711
+ width: $h.width() - spacing,
711
712
  height: $h.height()
712
713
  });
713
714
  })
@@ -717,6 +718,9 @@ $.tablesorter.addWidget({
717
718
  $(this).width(w);
718
719
  });
719
720
  };
721
+ // clear out cloned table, except for sticky header
722
+ t2.find('thead:gt(0),tr.sticky-false,tbody,tfoot,caption').remove();
723
+ t2.css({ height:0, width:0, padding:0, margin:0, border:0 });
720
724
  // remove rows you don't want to be sticky
721
725
  stkyHdr.find('tr.sticky-false').remove();
722
726
  // remove resizable block
@@ -751,13 +755,14 @@ $.tablesorter.addWidget({
751
755
  return false;
752
756
  });
753
757
  });
754
- header.after( stkyHdr );
758
+ // add stickyheaders AFTER the table. If the table is selected by ID, the original one (first) will be returned.
759
+ $table.after( t2 );
755
760
  // make it sticky!
756
761
  win
757
762
  .bind('scroll.tsSticky', function(){
758
- var offset = firstCell.offset(),
763
+ var offset = firstRow.offset(),
759
764
  sTop = win.scrollTop(),
760
- tableHt = $table.height() - (firstCell.height() + (tfoot.height() || 0)),
765
+ tableHt = $table.height() - (stkyHdr.height() + (tfoot.height() || 0)),
761
766
  vis = (sTop > offset.top) && (sTop < offset.top + tableHt) ? 'visible' : 'hidden';
762
767
  stkyHdr
763
768
  .css({
@@ -1,12 +1,12 @@
1
- /*! tableSorter 2.4+ widgets - updated 10/17/2012 */
1
+ /*! tableSorter 2.4+ widgets - updated 11/22/2012 */
2
2
  ;(function(a){
3
3
  a.tablesorter=a.tablesorter||{};
4
4
  a.tablesorter.themes={bootstrap:{table:"table table-bordered table-striped",header:"bootstrap-header",icons:"",sortNone:"bootstrap-icon-unsorted",sortAsc:"icon-chevron-up",sortDesc:"icon-chevron-down",active:"",hover:"",filterRow:"",even:"",odd:""},jui:{table:"ui-widget ui-widget-content ui-corner-all",header:"ui-widget-header ui-corner-all ui-state-default",icons:"ui-icon",sortNone:"ui-icon-carat-2-n-s",sortAsc:"ui-icon-carat-1-n",sortDesc:"ui-icon-carat-1-s", active:"ui-state-active",hover:"ui-state-hover",filterRow:"",even:"ui-widget-content",odd:"ui-state-default"}};
5
- a.tablesorter.storage=function(e,b,c){var d,i=!1;d={};var f=e.id||a(".tablesorter").index(a(e)),g=window.location.pathname;try{i=!!localStorage.getItem}catch(m){}a.parseJSON&&(i?d=a.parseJSON(localStorage[b])||{}:(d=document.cookie.split(/[;\s|=]/),e=a.inArray(b,d)+1,d=0!==e?a.parseJSON(d[e])||{}:{}));if(c&&JSON&&JSON.hasOwnProperty("stringify")){if(!d[g]||!d[g][f])d[g]||(d[g]={});d[g][f]= c;i?localStorage[b]=JSON.stringify(d):(e=new Date,e.setTime(e.getTime()+31536E6),document.cookie=b+"="+JSON.stringify(d).replace(/\"/g,'"')+"; expires="+e.toGMTString()+"; path=/")}else return d&&d.hasOwnProperty(g)&&d[g].hasOwnProperty(f)?d[g][f]:{}};
6
- a.tablesorter.addWidget({id:"uitheme",format:function(e){var b,c,d,i,f=a(e),g=e.config,m=g.widgetOptions,n="object"===typeof m.uitheme?"jui":m.uitheme||"jui",h="object"===typeof m.uitheme&&!Object.prototype.toString.call(m.uitheme).test("Array")?m.uitheme: a.tablesorter.themes[a.tablesorter.themes.hasOwnProperty(n)?n:"jui"],l=a(g.headerList),p="tr."+(m.stickyHeaders||"tablesorter-stickyHeader"),q=h.sortNone+" "+h.sortDesc+" "+h.sortAsc;g.debug&&(b=new Date);if(!f.hasClass("tablesorter-"+n)||g.theme===n||!e.hasInitialized)""!==h.even&&(m.zebra[0]+=" "+h.even),""!==h.odd&&(m.zebra[1]+=" "+h.odd),f.removeClass(""===g.theme?"":"tablesorter-"+g.theme).addClass("tablesorter-"+n+" "+h.table),g.theme="",l.addClass(h.header).filter(":not(.sorter-false)").hover(function(){a(this).addClass(h.hover)}, function(){a(this).removeClass(h.hover)}),l.find(".tablesorter-wrapper").length||l.wrapInner('<div class="tablesorter-wrapper" style="position:relative;height:100%;width:100%"></div>'),g.cssIcon&&l.find("."+g.cssIcon).addClass(h.icons),f.hasClass("hasFilters")&&l.find(".tablesorter-filter-row").addClass(h.filterRow);a.each(l,function(b){d=a(this);i=g.cssIcon?d.find("."+g.cssIcon):d;this.sortDisabled?(d.removeClass(q),i.removeClass(q+" tablesorter-icon "+h.icons)):(f.hasClass("hasStickyHeaders")&& f.find(p).find("th").eq(b).add(d),c=d.hasClass(g.cssAsc)?h.sortDesc:d.hasClass(g.cssDesc)?h.sortAsc:d.hasClass(g.cssHeader)?h.sortNone:"",d[c===h.sortNone?"removeClass":"addClass"](h.active),i.removeClass(q).addClass(c))});g.debug&&a.tablesorter.benchmark("Applying "+n+" theme",b)},remove:function(e,b,c){var e=a(e),d="object"===typeof c.uitheme?"jui":c.uitheme||"jui",c="object"===typeof c.uitheme?c.uitheme:a.tablesorter.themes[a.tablesorter.themes.hasOwnProperty(d)?d:"jui"],i=e.children("thead").children(), f=c.sortNone+" "+c.sortDesc+" "+c.sortAsc;e.removeClass("tablesorter-"+d+" "+c.table).find(b.cssHeader).removeClass(c.header);i.unbind("mouseenter mouseleave").removeClass(c.hover+" "+f+" "+c.active).find(".tablesorter-filter-row").removeClass(c.filterRow);i.find(".tablesorter-icon").removeClass(c.icons)}});
7
- a.tablesorter.addWidget({id:"columns",format:function(e){var b,c,d,i,f,g,m,n,h,l=a(e),p=e.config,q=p.widgetOptions,s=l.children("tbody:not(."+p.cssInfoBlock+")"),u=p.sortList,v=u.length,k=["primary", "secondary","tertiary"],k=p.widgetColumns&&p.widgetColumns.hasOwnProperty("css")?p.widgetColumns.css||k:q&&q.hasOwnProperty("columns")?q.columns||k:k;g=k.length-1;m=k.join(" ");p.debug&&(f=new Date);for(h=0;h<s.length;h++)b=a.tablesorter.processTbody(e,a(s[h]),!0),c=b.children("tr"),c.each(function(){i=a(this);if("none"!==this.style.display&&(d=i.children().removeClass(m),u&&u[0]&&(d.eq(u[0][0]).addClass(k[0]),1<v)))for(n=1;n<v;n++)d.eq(u[n][0]).addClass(k[n]||k[g])}),a.tablesorter.processTbody(e, b,!1);c=!1!==q.columns_thead?"thead tr":"";!1!==q.columns_tfoot&&(c+=(""===c?"":",")+"tfoot tr");if(c.length&&(i=l.find(c).children().removeClass(m),u&&u[0]&&(i.filter('[data-column="'+u[0][0]+'"]').addClass(k[0]),1<v)))for(n=1;n<v;n++)i.filter('[data-column="'+u[n][0]+'"]').addClass(k[n]||k[g]);p.debug&&a.tablesorter.benchmark("Applying Columns widget",f)},remove:function(e,b){var c,d,i=a(e).children("tbody:not(."+b.cssInfoBlock+")"),f=(b.widgetOptions.columns||["primary","secondary","tertiary"]).join(" "); for(c=0;c<i.length;c++)d=a.tablesorter.processTbody(e,a(i[c]),!0),d.children("tr").each(function(){a(this).children().removeClass(f)}),a.tablesorter.processTbody(e,d,!1)}});
8
- a.tablesorter.addWidget({id:"filter",format:function(e){if(e.config.parsers&&!a(e).hasClass("hasFilters")){var b,c,d,i,f,g,m,n,h,l,p,q,s,u,v,k,x,F="",z=a.tablesorter,r=e.config,A=a(r.headerList),j=r.widgetOptions,y=j.filter_cssFilter||"tablesorter-filter",t=a(e).addClass("hasFilters"),D=t.children("tbody:not(."+r.cssInfoBlock+ ")"),E=r.parsers.length,B=[/^\/((?:\\\/|[^\/])+)\/([mig]{0,3})?$/,RegExp(r.cssChildRow),/undefined|number/,/(^[\"|\'|=])|([\"|\'|=]$)/,/[\"\'=]/g,/[^\w,. \-()]/g,/[<>=]/g],L=A.map(function(b){return z.getData?"parsed"===z.getData(A.filter('[data-column="'+b+'"]:last'),r.headers[b],"filter"):a(this).hasClass("filter-parsed")}).get(),G,H,C=function(b){var d=a.isArray(b),e=t.find("thead").eq(0).children("tr").find("select."+y+", input."+y),c=d?b:e.map(function(){return a(this).val()||""}).get(),f=(c|| []).join("");d&&e.each(function(c,d){a(d).val(b[c]||"")});!0===j.filter_hideFilters&&t.find(".tablesorter-filter-row").trigger(""===f?"mouseleave":"mouseenter");if(!(F===f&&!1!==b))if(t.trigger("filterStart",[c]),r.showProcessing)setTimeout(function(){I(b,c,f);return!1},30);else return I(b,c,f),!1},I=function(g,i,h){var l,p,s,q,x,w,y;r.debug&&(y=new Date);for(d=0;d<D.length;d++){g=a.tablesorter.processTbody(e,a(D[d]),!0);l=g.children("tr");x=l.length;if(""===h)l.show().removeClass("filtered");else for(c= 0;c<x;c++)if(!B[1].test(l[c].className)){q=!0;s=l.eq(c).nextUntil("tr:not(."+r.cssChildRow+")");k=s.length&&(j&&j.hasOwnProperty("filter_childRows")&&"undefined"!==typeof j.filter_childRows?j.filter_childRows:1)?s.text():"";k=j.filter_ignoreCase?k.toLocaleLowerCase():k;p=l.eq(c).children("td");for(b=0;b<E;b++)if(i[b]){m=j.filter_useParsedData||L[b]?r.cache[d].normalized[c][b]:a.trim(p.eq(b).text());n=!B[2].test(typeof m)&&j.filter_ignoreCase?m.toLocaleLowerCase():m;w=q;f=j.filter_ignoreCase?i[b].toLocaleLowerCase(): i[b];if(j.filter_functions&&j.filter_functions[b])!0===j.filter_functions[b]?w=A.filter('[data-column="'+b+'"]:last').hasClass("filter-match")?0<=n.search(f):i[b]===m:"function"===typeof j.filter_functions[b]?w=j.filter_functions[b](m,r.cache[d].normalized[c][b],i[b],b):"function"===typeof j.filter_functions[b][i[b]]&&(w=j.filter_functions[b][i[b]](m,r.cache[d].normalized[c][b],i[b],b));else if(B[0].test(f)){u=B[0].exec(f);try{w=RegExp(u[1],u[2]).test(n)}catch(C){w=!1}}else B[3].test(f)&&n===f.replace(B[4], "")?w=!0:/^\!/.test(f)?(f=f.replace("!",""),v=n.search(a.trim(f)),w=""===f?!0:!(j.filter_startsWith?0===v:0<=v)):/^[<>]=?/.test(f)?(u=isNaN(n)?a.tablesorter.formatFloat(n.replace(B[5],""),e):a.tablesorter.formatFloat(n,e),v=a.tablesorter.formatFloat(f.replace(B[5],"").replace(B[6],""),e),/>/.test(f)&&(w=/>=/.test(f)?u>=v:u>v),/</.test(f)&&(w=/<=/.test(f)?u<=v:u<v)):/[\?|\*]/.test(f)?w=RegExp(f.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(n):(m=(n+k).indexOf(f),w=!j.filter_startsWith&&0<=m|| j.filter_startsWith&&0===m);q=w?q?!0:!1:!1}l[c].style.display=q?"":"none";l.eq(c)[q?"removeClass":"addClass"]("filtered");if(s.length)s[q?"show":"hide"]()}a.tablesorter.processTbody(e,g,!1)}F=h;r.debug&&z.benchmark("Completed filter widget search",y);t.trigger("applyWidgets");t.trigger("filterEnd")},J=function(b,f){var g,h=[],b=parseInt(b,10);g='<option value="">'+(A.filter('[data-column="'+b+'"]:last').attr("data-placeholder")||"")+"</option>";for(d=0;d<D.length;d++){i=r.cache[d].row.length;for(c= 0;c<i;c++)j.filter_useParsedData?h.push(""+r.cache[d].normalized[c][b]):(k=r.cache[d].row[c][0].cells[b])&&h.push(r.supportsTextContent?k.textContent:a(k).text())}h=a.grep(h,function(b,c){return a.inArray(b,h)===c});h=z.sortText?h.sort(function(a,c){return z.sortText(e,a,c,b)}):h.sort(!0);for(d=0;d<h.length;d++)g+='<option value="'+h[d]+'">'+h[d]+"</option>";t.find("thead").find("select."+y+'[data-column="'+b+'"]')[f?"html":"append"](g)},K=function(a){for(b=0;b<E;b++)k=A.filter('[data-column="'+b+ '"]:last'),k.hasClass("filter-select")&&(!k.hasClass("filter-false")&&!(j.filter_functions&&!0===j.filter_functions[b]))&&(j.filter_functions||(j.filter_functions={}),j.filter_functions[b]=!0,J(b,a))};r.debug&&(G=new Date);j.filter_ignoreCase=!1!==j.filter_ignoreCase;j.filter_useParsedData=!0===j.filter_useParsedData;if(!1!==j.filter_columnFilters&&A.filter(".filter-false").length!==A.length){k='<tr class="tablesorter-filter-row">';for(b=0;b<E;b++)s=!1,s=A.filter('[data-column="'+b+'"]:last'),g=j.filter_functions&& j.filter_functions[b]&&"function"!==typeof j.filter_functions[b]||s.hasClass("filter-select"),k+="<td>",k=g?k+('<select data-column="'+b+'" class="'+y):k+('<input type="search" placeholder="'+(s.attr("data-placeholder")||"")+'" data-column="'+b+'" class="'+y),s=z.getData?"false"===z.getData(s[0],r.headers[b],"filter"):r.headers[b]&&r.headers[b].hasOwnProperty("filter")&&!1===r.headers[b].filter||s.hasClass("filter-false"),k+=s?' disabled" disabled':'"',k+=(g?"></select>":">")+"</td>";t.find("thead").eq(0).append(k+= "</tr>")}t.bind(["addRows","updateCell","update","appendCache","search"].join(".tsfilter "),function(a,b){"search"!==a.type&&K(!0);C("search"===a.type?b:"");return!1}).find("input."+y).bind("keyup search",function(a,b){if(!(32>a.which&&8!==a.which||37<=a.which&&40>=a.which)){if("undefined"!==typeof b)return C(b),!1;clearTimeout(H);H=setTimeout(function(){C()},j.filter_searchDelay||300)}});j.filter_reset&&a(j.filter_reset).length&&a(j.filter_reset).bind("click",function(){t.find("."+y).val("");C(); return!1});if(j.filter_functions)for(x in j.filter_functions)if(j.filter_functions.hasOwnProperty(x)&&"string"===typeof x)if(k=A.filter('[data-column="'+x+'"]:last'),g="",!0===j.filter_functions[x]&&!k.hasClass("filter-false"))J(x);else if("string"===typeof x&&!k.hasClass("filter-false")){for(l in j.filter_functions[x])"string"===typeof l&&(g+=""===g?'<option value="">'+(k.attr("data-placeholder")||"")+"</option>":"",g+='<option value="'+l+'">'+l+"</option>");t.find("thead").find("select."+y+'[data-column="'+ x+'"]').append(g)}K();t.find("select."+y).bind("change search",function(){C()});!0===j.filter_hideFilters&&t.find(".tablesorter-filter-row").addClass("hideme").bind("mouseenter mouseleave",function(b){var c;p=a(this);clearTimeout(h);h=setTimeout(function(){/enter|over/.test(b.type)?p.removeClass("hideme"):a(document.activeElement).closest("tr")[0]!==p[0]&&(c=t.find("."+(j.filter_cssFilter||"tablesorter-filter")).map(function(){return a(this).val()||""}).get().join(""),""===c&&p.addClass("hideme"))}, 200)}).find("input, select").bind("focus blur",function(b){q=a(this).closest("tr");clearTimeout(h);h=setTimeout(function(){if(""===t.find("."+(j.filter_cssFilter||"tablesorter-filter")).map(function(){return a(this).val()||""}).get().join(""))q["focus"===b.type?"removeClass":"addClass"]("hideme")},200)});r.showProcessing&&t.bind("filterStart filterEnd",function(b,c){var d=c?t.find("."+r.cssHeader).filter("[data-column]").filter(function(){return""!==c[a(this).data("column")]}):"";z.isProcessing(t[0], "filterStart"===b.type,c?d:"")});r.debug&&z.benchmark("Applying Filter widget",G);t.trigger("filterInit")}},remove:function(e,b,c){var d,i;d=a(e);b=d.children("tbody:not(."+b.cssInfoBlock+")");d.removeClass("hasFilters").unbind(["addRows","updateCell","update","appendCache","search"].join(".tsfilter")).find(".tablesorter-filter-row").remove();for(d=0;d<b.length;d++)i=a.tablesorter.processTbody(e,a(b[d]),!0),i.children().removeClass("filtered").show(),a.tablesorter.processTbody(e,i,!1);c.filterreset&& a(c.filter_reset).unbind("click")}});
9
- a.tablesorter.addWidget({id:"stickyHeaders",format:function(e){if(!a(e).hasClass("hasStickyHeaders")){var b=a(e).addClass("hasStickyHeaders"),c=e.config,d=c.widgetOptions,i=a(window),f=a(e).children("thead:first"),g=f.children("tr:not(.sticky-false)").children(),e=d.stickyHeaders||"tablesorter-stickyHeader",m=g.eq(0),n=b.find("tfoot"),h=f.clone().addClass(e).css({width:f.outerWidth(!0),position:"fixed",margin:0,top:0,visibility:"hidden",zIndex:1}),l=h.find("tr").children(), p="",q=0,s=function(){var c=navigator.userAgent;q=0;"collapse"!==b.css("border-collapse")&&!/webkit/i.test(c)&&(q=/msie/i.test(c)?parseInt(f.css("padding-left"),10):parseInt(b.css("border-spacing"),10));h.css({left:f.offset().left-i.scrollLeft()-q,width:f.outerWidth()});l.each(function(b){b=g.eq(b);a(this).css({width:b.width(),height:b.height()})}).find(".tablesorter-header-inner").each(function(b){b=g.eq(b).find(".tablesorter-header-inner").width();a(this).width(b)})};h.find("tr.sticky-false").remove(); l.find(".tablesorter-resizer").remove();b.bind("sortEnd.tsSticky",function(){g.each(function(b){b=l.eq(b);b.attr("class",a(this).attr("class"));c.cssIcon&&b.find("."+c.cssIcon).attr("class",a(this).find("."+c.cssIcon).attr("class"))})}).bind("pagerComplete.tsSticky",function(){s()});g.find("*").andSelf().filter(c.selectorSort).each(function(b){var c=a(this);l.eq(b).bind("mouseup",function(b){c.trigger(b,!0)}).bind("mousedown",function(){this.onselectstart=function(){return!1};return!1})});f.after(h); i.bind("scroll.tsSticky",function(){var a=m.offset(),c=i.scrollTop(),d=b.height()-(m.height()+(n.height()||0)),a=c>a.top&&c<a.top+d?"visible":"hidden";h.css({left:f.offset().left-i.scrollLeft()-q,visibility:a});a!==p&&(s(),p=a)}).bind("resize.tsSticky",function(){s()})}},remove:function(e,b,c){e=a(e);c=c.stickyHeaders||"tablesorter-stickyHeader";e.removeClass("hasStickyHeaders").unbind("sortEnd.tsSticky pagerComplete.tsSticky").find("."+c).remove();a(window).unbind("scroll.tsSticky resize.tsSticky")}});
10
- a.tablesorter.addWidget({id:"resizable",format:function(e){if(!a(e).hasClass("hasResizable")){a(e).addClass("hasResizable");var b,c,d,i,f,g=a(e),m=e.config,n=m.widgetOptions,h=0,l=null,p=null,q=function(){h=0;l=p=null;a(window).trigger("resize")};if(d=a.tablesorter.storage&&!1!==n.resizable?a.tablesorter.storage(e,"tablesorter-resizable"):{})for(c in d)!isNaN(c)&&c<m.headerList.length&&a(m.headerList[c]).width(d[c]);g.children("thead:first").find("tr").each(function(){i=a(this).children();a(this).find(".tablesorter-wrapper").length|| i.wrapInner('<div class="tablesorter-wrapper" style="position:relative;height:100%;width:100%"></div>');i=i.slice(0,-1);f=f?f.add(i):i});f.each(function(){b=a(this);c=parseInt(b.css("padding-right"),10)+8;b.find(".tablesorter-wrapper").append('<div class="tablesorter-resizer" style="cursor:w-resize;position:absolute;height:100%;width:16px;right:-'+c+'px;top:0;z-index:1;"></div>')}).bind("mousemove.tsresize",function(a){if(0!==h&&l){var b=a.pageX-h;l.width(l.width()+b);p.width(p.width()-b);h=a.pageX}}).bind("mouseup.tsresize", function(){a.tablesorter.storage&&l&&(d[l.index()]=l.width(),d[p.index()]=p.width(),!1!==n.resizable&&a.tablesorter.storage(e,"tablesorter-resizable",d));q()}).find(".tablesorter-resizer").bind("mousedown",function(b){l=a(b.target).parents("th:last");p=l.next();h=b.pageX});g.find("thead:first").bind("mouseup.tsresize mouseleave.tsresize",function(){q()}).bind("contextmenu.tsresize",function(){a.tablesorter.resizableReset(e);var b=a.isEmptyObject?a.isEmptyObject(d):d==={};d={};return b})}},remove:function(e){a(e).removeClass("hasResizable").find("thead").unbind("mouseup.tsresize mouseleave.tsresize contextmenu.tsresize").find("tr").children().unbind("mousemove.tsresize mouseup.tsresize").find(".tablesorter-wrapper").each(function(){a(this).find(".tablesorter-resizer").remove(); a(this).replaceWith(a(this).contents())});a.tablesorter.resizableReset(e)}});a.tablesorter.resizableReset=function(e){a(e.config.headerList).width("auto");a.tablesorter.storage(e,"tablesorter-resizable",{})};
11
- a.tablesorter.addWidget({id:"saveSort",init:function(a,b){b.format(a,!0)},format:function(e,b){var c,d,i=e.config;c=!1!==i.widgetOptions.saveSort;var f={sortList:i.sortList};i.debug&&(d=new Date);a(e).hasClass("hasSaveSort")?c&&(e.hasInitialized&&a.tablesorter.storage)&&(a.tablesorter.storage(e, "tablesorter-savesort",f),i.debug&&a.tablesorter.benchmark("saveSort widget: Saving last sort: "+i.sortList,d)):(a(e).addClass("hasSaveSort"),f="",a.tablesorter.storage&&(f=(c=a.tablesorter.storage(e,"tablesorter-savesort"))&&c.hasOwnProperty("sortList")&&a.isArray(c.sortList)?c.sortList:"",i.debug&&a.tablesorter.benchmark('saveSort: Last sort loaded: "'+f+'"',d)),b&&f&&0<f.length?i.sortList=f:e.hasInitialized&&(f&&0<f.length)&&a(e).trigger("sorton",[f]))},remove:function(e){a.tablesorter.storage(e, "tablesorter-savesort","")}})
5
+ a.tablesorter.storage=function(e,c,d){var b,i=!1;b={};var f=e.id||a(".tablesorter").index(a(e)),g=window.location.pathname;try{i=!!localStorage.getItem}catch(n){}a.parseJSON&&(i?b=a.parseJSON(localStorage[c])||{}:(b=document.cookie.split(/[;\s|=]/),e=a.inArray(c,b)+1,b=0!==e?a.parseJSON(b[e])||{}:{}));if(d&&JSON&&JSON.hasOwnProperty("stringify")){if(!b[g]||!b[g][f])b[g]||(b[g]={});b[g][f]= d;i?localStorage[c]=JSON.stringify(b):(e=new Date,e.setTime(e.getTime()+31536E6),document.cookie=c+"="+JSON.stringify(b).replace(/\"/g,'"')+"; expires="+e.toGMTString()+"; path=/")}else return b&&b.hasOwnProperty(g)&&b[g].hasOwnProperty(f)?b[g][f]:{}};
6
+ a.tablesorter.addWidget({id:"uitheme",format:function(e){var c,d,b,i,f=a(e),g=e.config,n=g.widgetOptions,m="object"===typeof n.uitheme?"jui":n.uitheme||"jui",h="object"===typeof n.uitheme&&!Object.prototype.toString.call(n.uitheme).test("Array")?n.uitheme: a.tablesorter.themes[a.tablesorter.themes.hasOwnProperty(m)?m:"jui"],l=a(g.headerList),q="tr."+(n.stickyHeaders||"tablesorter-stickyHeader"),p=h.sortNone+" "+h.sortDesc+" "+h.sortAsc;g.debug&&(c=new Date);if(!f.hasClass("tablesorter-"+m)||g.theme===m||!e.hasInitialized)""!==h.even&&(n.zebra[0]+=" "+h.even),""!==h.odd&&(n.zebra[1]+=" "+h.odd),f.removeClass(""===g.theme?"":"tablesorter-"+g.theme).addClass("tablesorter-"+m+" "+h.table),g.theme="",l.addClass(h.header).filter(":not(.sorter-false)").hover(function(){a(this).addClass(h.hover)}, function(){a(this).removeClass(h.hover)}),l.find(".tablesorter-wrapper").length||l.wrapInner('<div class="tablesorter-wrapper" style="position:relative;height:100%;width:100%"></div>'),g.cssIcon&&l.find("."+g.cssIcon).addClass(h.icons),f.hasClass("hasFilters")&&l.find(".tablesorter-filter-row").addClass(h.filterRow);a.each(l,function(c){b=a(this);i=g.cssIcon?b.find("."+g.cssIcon):b;this.sortDisabled?(b.removeClass(p),i.removeClass(p+" tablesorter-icon "+h.icons)):(f.hasClass("hasStickyHeaders")&& f.find(q).find("th").eq(c).add(b),d=b.hasClass(g.cssAsc)?h.sortAsc:b.hasClass(g.cssDesc)?h.sortDesc:b.hasClass(g.cssHeader)?h.sortNone:"",b[d===h.sortNone?"removeClass":"addClass"](h.active),i.removeClass(p).addClass(d))});g.debug&&a.tablesorter.benchmark("Applying "+m+" theme",c)},remove:function(e,c,d){var e=a(e),b="object"===typeof d.uitheme?"jui":d.uitheme||"jui",d="object"===typeof d.uitheme?d.uitheme:a.tablesorter.themes[a.tablesorter.themes.hasOwnProperty(b)?b:"jui"],i=e.children("thead").children(), f=d.sortNone+" "+d.sortDesc+" "+d.sortAsc;e.removeClass("tablesorter-"+b+" "+d.table).find(c.cssHeader).removeClass(d.header);i.unbind("mouseenter mouseleave").removeClass(d.hover+" "+f+" "+d.active).find(".tablesorter-filter-row").removeClass(d.filterRow);i.find(".tablesorter-icon").removeClass(d.icons)}});
7
+ a.tablesorter.addWidget({id:"columns",format:function(e){var c,d,b,i,f,g,n,m,h,l=a(e),q=e.config,p=q.widgetOptions,s=l.children("tbody:not(."+q.cssInfoBlock+")"),u=q.sortList,v=u.length,k=["primary", "secondary","tertiary"],k=q.widgetColumns&&q.widgetColumns.hasOwnProperty("css")?q.widgetColumns.css||k:p&&p.hasOwnProperty("columns")?p.columns||k:k;g=k.length-1;n=k.join(" ");q.debug&&(f=new Date);for(h=0;h<s.length;h++)c=a.tablesorter.processTbody(e,a(s[h]),!0),d=c.children("tr"),d.each(function(){i=a(this);if("none"!==this.style.display&&(b=i.children().removeClass(n),u&&u[0]&&(b.eq(u[0][0]).addClass(k[0]),1<v)))for(m=1;m<v;m++)b.eq(u[m][0]).addClass(k[m]||k[g])}),a.tablesorter.processTbody(e, c,!1);d=!1!==p.columns_thead?"thead tr":"";!1!==p.columns_tfoot&&(d+=(""===d?"":",")+"tfoot tr");if(d.length&&(i=l.find(d).children().removeClass(n),u&&u[0]&&(i.filter('[data-column="'+u[0][0]+'"]').addClass(k[0]),1<v)))for(m=1;m<v;m++)i.filter('[data-column="'+u[m][0]+'"]').addClass(k[m]||k[g]);q.debug&&a.tablesorter.benchmark("Applying Columns widget",f)},remove:function(e,c){var d,b,i=a(e).children("tbody:not(."+c.cssInfoBlock+")"),f=(c.widgetOptions.columns||["primary","secondary","tertiary"]).join(" "); for(d=0;d<i.length;d++)b=a.tablesorter.processTbody(e,a(i[d]),!0),b.children("tr").each(function(){a(this).children().removeClass(f)}),a.tablesorter.processTbody(e,b,!1)}});
8
+ a.tablesorter.addWidget({id:"filter",format:function(e){if(e.config.parsers&&!a(e).hasClass("hasFilters")){var c,d,b,i,f,g,n,m,h,l,q,p,s,u,v,k,x,F="",z=a.tablesorter,r=e.config,A=a(r.headerList),j=r.widgetOptions,y=j.filter_cssFilter||"tablesorter-filter",t=a(e).addClass("hasFilters"),D=t.children("tbody:not(."+r.cssInfoBlock+ ")"),E=r.parsers.length,B=[/^\/((?:\\\/|[^\/])+)\/([mig]{0,3})?$/,RegExp(r.cssChildRow),/undefined|number/,/(^[\"|\'|=])|([\"|\'|=]$)/,/[\"\'=]/g,/[^\w,. \-()]/g,/[<>=]/g],L=A.map(function(b){return z.getData?"parsed"===z.getData(A.filter('[data-column="'+b+'"]:last'),r.headers[b],"filter"):a(this).hasClass("filter-parsed")}).get(),G,H,C=function(b){var c=a.isArray(b),e=t.find("thead").eq(0).children("tr").find("select."+y+", input."+y),d=c?b:e.map(function(){return a(this).val()||""}).get(),f=(d|| []).join("");c&&e.each(function(c,d){a(d).val(b[c]||"")});!0===j.filter_hideFilters&&t.find(".tablesorter-filter-row").trigger(""===f?"mouseleave":"mouseenter");if(!(F===f&&!1!==b))if(t.trigger("filterStart",[d]),r.showProcessing)setTimeout(function(){I(b,d,f);return!1},30);else return I(b,d,f),!1},I=function(g,i,h){var l,q,s,p,x,w,y;r.debug&&(y=new Date);for(b=0;b<D.length;b++){g=a.tablesorter.processTbody(e,a(D[b]),!0);l=g.children("tr");x=l.length;if(""===h)l.show().removeClass("filtered");else for(d= 0;d<x;d++)if(!B[1].test(l[d].className)){p=!0;s=l.eq(d).nextUntil("tr:not(."+r.cssChildRow+")");k=s.length&&(j&&j.hasOwnProperty("filter_childRows")&&"undefined"!==typeof j.filter_childRows?j.filter_childRows:1)?s.text():"";k=j.filter_ignoreCase?k.toLocaleLowerCase():k;q=l.eq(d).children("td");for(c=0;c<E;c++)if(i[c]){n=j.filter_useParsedData||L[c]?r.cache[b].normalized[d][c]:a.trim(q.eq(c).text());m=!B[2].test(typeof n)&&j.filter_ignoreCase?n.toLocaleLowerCase():n;w=p;f=j.filter_ignoreCase?i[c].toLocaleLowerCase(): i[c];if(j.filter_functions&&j.filter_functions[c])!0===j.filter_functions[c]?w=A.filter('[data-column="'+c+'"]:last').hasClass("filter-match")?0<=m.search(f):i[c]===n:"function"===typeof j.filter_functions[c]?w=j.filter_functions[c](n,r.cache[b].normalized[d][c],i[c],c):"function"===typeof j.filter_functions[c][i[c]]&&(w=j.filter_functions[c][i[c]](n,r.cache[b].normalized[d][c],i[c],c));else if(B[0].test(f)){u=B[0].exec(f);try{w=RegExp(u[1],u[2]).test(m)}catch(C){w=!1}}else B[3].test(f)&&m===f.replace(B[4], "")?w=!0:/^\!/.test(f)?(f=f.replace("!",""),v=m.search(a.trim(f)),w=""===f?!0:!(j.filter_startsWith?0===v:0<=v)):/^[<>]=?/.test(f)?(u=isNaN(m)?a.tablesorter.formatFloat(m.replace(B[5],""),e):a.tablesorter.formatFloat(m,e),v=a.tablesorter.formatFloat(f.replace(B[5],"").replace(B[6],""),e),/>/.test(f)&&(w=/>=/.test(f)?u>=v:u>v),/</.test(f)&&(w=/<=/.test(f)?u<=v:u<v)):/[\?|\*]/.test(f)?w=RegExp(f.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(m):(n=(m+k).indexOf(f),w=!j.filter_startsWith&&0<=n|| j.filter_startsWith&&0===n);p=w?p?!0:!1:!1}l[d].style.display=p?"":"none";l.eq(d)[p?"removeClass":"addClass"]("filtered");if(s.length)s[p?"show":"hide"]()}a.tablesorter.processTbody(e,g,!1)}F=h;r.debug&&z.benchmark("Completed filter widget search",y);t.trigger("applyWidgets");t.trigger("filterEnd")},J=function(c,f){var g,h=[],c=parseInt(c,10);g='<option value="">'+(A.filter('[data-column="'+c+'"]:last').attr("data-placeholder")||"")+"</option>";for(b=0;b<D.length;b++){i=r.cache[b].row.length;for(d= 0;d<i;d++)j.filter_useParsedData?h.push(""+r.cache[b].normalized[d][c]):(k=r.cache[b].row[d][0].cells[c])&&h.push(a.trim(r.supportsTextContent?k.textContent:a(k).text()))}h=a.grep(h,function(c,b){return a.inArray(c,h)===b});h=z.sortText?h.sort(function(a,b){return z.sortText(e,a,b,c)}):h.sort(!0);for(b=0;b<h.length;b++)g+='<option value="'+h[b]+'">'+h[b]+"</option>";t.find("thead").find("select."+y+'[data-column="'+c+'"]')[f?"html":"append"](g)},K=function(a){for(c=0;c<E;c++)k=A.filter('[data-column="'+ c+'"]:last'),k.hasClass("filter-select")&&(!k.hasClass("filter-false")&&!(j.filter_functions&&!0===j.filter_functions[c]))&&(j.filter_functions||(j.filter_functions={}),j.filter_functions[c]=!0,J(c,a))};r.debug&&(G=new Date);j.filter_ignoreCase=!1!==j.filter_ignoreCase;j.filter_useParsedData=!0===j.filter_useParsedData;if(!1!==j.filter_columnFilters&&A.filter(".filter-false").length!==A.length){k='<tr class="tablesorter-filter-row">';for(c=0;c<E;c++)s=!1,s=A.filter('[data-column="'+c+'"]:last'),g= j.filter_functions&&j.filter_functions[c]&&"function"!==typeof j.filter_functions[c]||s.hasClass("filter-select"),k+="<td>",k=g?k+('<select data-column="'+c+'" class="'+y):k+('<input type="search" placeholder="'+(s.attr("data-placeholder")||"")+'" data-column="'+c+'" class="'+y),s=z.getData?"false"===z.getData(s[0],r.headers[c],"filter"):r.headers[c]&&r.headers[c].hasOwnProperty("filter")&&!1===r.headers[c].filter||s.hasClass("filter-false"),k+=s?' disabled" disabled':'"',k+=(g?"></select>":">")+ "</td>";t.find("thead").eq(0).append(k+="</tr>")}t.bind(["addRows","updateCell","update","appendCache","search"].join(".tsfilter "),function(a,b){"search"!==a.type&&K(!0);C("search"===a.type?b:"");return!1}).find("input."+y).bind("keyup search",function(a,b){if(!(32>a.which&&8!==a.which||37<=a.which&&40>=a.which)){if("undefined"!==typeof b)return C(b),!1;clearTimeout(H);H=setTimeout(function(){C()},j.filter_searchDelay||300)}});j.filter_reset&&a(j.filter_reset).length&&a(j.filter_reset).bind("click", function(){t.find("."+y).val("");C();return!1});if(j.filter_functions)for(x in j.filter_functions)if(j.filter_functions.hasOwnProperty(x)&&"string"===typeof x)if(k=A.filter('[data-column="'+x+'"]:last'),g="",!0===j.filter_functions[x]&&!k.hasClass("filter-false"))J(x);else if("string"===typeof x&&!k.hasClass("filter-false")){for(l in j.filter_functions[x])"string"===typeof l&&(g+=""===g?'<option value="">'+(k.attr("data-placeholder")||"")+"</option>":"",g+='<option value="'+l+'">'+l+"</option>"); t.find("thead").find("select."+y+'[data-column="'+x+'"]').append(g)}K();t.find("select."+y).bind("change search",function(){C()});!0===j.filter_hideFilters&&t.find(".tablesorter-filter-row").addClass("hideme").bind("mouseenter mouseleave",function(b){var c;q=a(this);clearTimeout(h);h=setTimeout(function(){/enter|over/.test(b.type)?q.removeClass("hideme"):a(document.activeElement).closest("tr")[0]!==q[0]&&(c=t.find("."+(j.filter_cssFilter||"tablesorter-filter")).map(function(){return a(this).val()|| ""}).get().join(""),""===c&&q.addClass("hideme"))},200)}).find("input, select").bind("focus blur",function(b){p=a(this).closest("tr");clearTimeout(h);h=setTimeout(function(){if(""===t.find("."+(j.filter_cssFilter||"tablesorter-filter")).map(function(){return a(this).val()||""}).get().join(""))p["focus"===b.type?"removeClass":"addClass"]("hideme")},200)});r.showProcessing&&t.bind("filterStart filterEnd",function(b,c){var d=c?t.find("."+r.cssHeader).filter("[data-column]").filter(function(){return""!== c[a(this).data("column")]}):"";z.isProcessing(t[0],"filterStart"===b.type,c?d:"")});r.debug&&z.benchmark("Applying Filter widget",G);t.trigger("filterInit")}},remove:function(e,c,d){var b,i;b=a(e);c=b.children("tbody:not(."+c.cssInfoBlock+")");b.removeClass("hasFilters").unbind(["addRows","updateCell","update","appendCache","search"].join(".tsfilter")).find(".tablesorter-filter-row").remove();for(b=0;b<c.length;b++)i=a.tablesorter.processTbody(e,a(c[b]),!0),i.children().removeClass("filtered").show(), a.tablesorter.processTbody(e,i,!1);d.filterreset&&a(d.filter_reset).unbind("click")}});
9
+ a.tablesorter.addWidget({id:"stickyHeaders",format:function(e){if(!a(e).hasClass("hasStickyHeaders")){var c=a(e).addClass("hasStickyHeaders"),d=e.config,b=d.widgetOptions,i=a(window),f=a(e).children("thead:first"),g=f.children("tr:not(.sticky-false)").children(),e=b.stickyHeaders||"tablesorter-stickyHeader",n=g.eq(0).parent(),m=c.find("tfoot"),b=c.clone(),h=b.children("thead:first").addClass(e).css({width:f.outerWidth(!0), position:"fixed",margin:0,top:0,visibility:"hidden",zIndex:1}),l=h.children("tr:not(.sticky-false)").children(),q="",p=0,s=function(){var b=navigator.userAgent;p=0;"collapse"!==c.css("border-collapse")&&!/(webkit|msie)/i.test(b)&&(p=2*parseInt(g.eq(0).css("border-left-width"),10));h.css({left:f.offset().left-i.scrollLeft()-p,width:f.outerWidth()});l.each(function(b){b=g.eq(b);a(this).css({width:b.width()-p,height:b.height()})}).find(".tablesorter-header-inner").each(function(b){b=g.eq(b).find(".tablesorter-header-inner").width(); a(this).width(b)})};b.find("thead:gt(0),tr.sticky-false,tbody,tfoot,caption").remove();b.css({height:0,width:0,padding:0,margin:0,border:0});h.find("tr.sticky-false").remove();l.find(".tablesorter-resizer").remove();c.bind("sortEnd.tsSticky",function(){g.each(function(b){b=l.eq(b);b.attr("class",a(this).attr("class"));d.cssIcon&&b.find("."+d.cssIcon).attr("class",a(this).find("."+d.cssIcon).attr("class"))})}).bind("pagerComplete.tsSticky",function(){s()});g.find("*").andSelf().filter(d.selectorSort).each(function(b){var c= a(this);l.eq(b).bind("mouseup",function(a){c.trigger(a,!0)}).bind("mousedown",function(){this.onselectstart=function(){return!1};return!1})});c.after(b);i.bind("scroll.tsSticky",function(){var a=n.offset(),b=i.scrollTop(),d=c.height()-(h.height()+(m.height()||0)),a=b>a.top&&b<a.top+d?"visible":"hidden";h.css({left:f.offset().left-i.scrollLeft()-p,visibility:a});a!==q&&(s(),q=a)}).bind("resize.tsSticky",function(){s()})}},remove:function(e,c,d){e=a(e);d=d.stickyHeaders||"tablesorter-stickyHeader"; e.removeClass("hasStickyHeaders").unbind("sortEnd.tsSticky pagerComplete.tsSticky").find("."+d).remove();a(window).unbind("scroll.tsSticky resize.tsSticky")}});
10
+ a.tablesorter.addWidget({id:"resizable",format:function(e){if(!a(e).hasClass("hasResizable")){a(e).addClass("hasResizable");var c,d,b,i,f,g=a(e),n=e.config,m=n.widgetOptions,h=0,l=null,q=null,p=function(){h=0;l=q=null;a(window).trigger("resize")};if(b=a.tablesorter.storage&&!1!==m.resizable?a.tablesorter.storage(e,"tablesorter-resizable"): {})for(d in b)!isNaN(d)&&d<n.headerList.length&&a(n.headerList[d]).width(b[d]);g.children("thead:first").find("tr").each(function(){i=a(this).children();a(this).find(".tablesorter-wrapper").length||i.wrapInner('<div class="tablesorter-wrapper" style="position:relative;height:100%;width:100%"></div>');i=i.slice(0,-1);f=f?f.add(i):i});f.each(function(){c=a(this);d=parseInt(c.css("padding-right"),10)+8;c.find(".tablesorter-wrapper").append('<div class="tablesorter-resizer" style="cursor:w-resize;position:absolute;height:100%;width:16px;right:-'+ d+'px;top:0;z-index:1;"></div>')}).bind("mousemove.tsresize",function(a){if(0!==h&&l){var b=a.pageX-h;l.width(l.width()+b);q.width(q.width()-b);h=a.pageX}}).bind("mouseup.tsresize",function(){a.tablesorter.storage&&l&&(b[l.index()]=l.width(),b[q.index()]=q.width(),!1!==m.resizable&&a.tablesorter.storage(e,"tablesorter-resizable",b));p()}).find(".tablesorter-resizer").bind("mousedown",function(b){l=a(b.target).parents("th:last");q=l.next();h=b.pageX});g.find("thead:first").bind("mouseup.tsresize mouseleave.tsresize", function(){p()}).bind("contextmenu.tsresize",function(){a.tablesorter.resizableReset(e);var c=a.isEmptyObject?a.isEmptyObject(b):b==={};b={};return c})}},remove:function(e){a(e).removeClass("hasResizable").find("thead").unbind("mouseup.tsresize mouseleave.tsresize contextmenu.tsresize").find("tr").children().unbind("mousemove.tsresize mouseup.tsresize").find(".tablesorter-wrapper").each(function(){a(this).find(".tablesorter-resizer").remove();a(this).replaceWith(a(this).contents())});a.tablesorter.resizableReset(e)}}); a.tablesorter.resizableReset=function(e){a(e.config.headerList).width("auto");a.tablesorter.storage(e,"tablesorter-resizable",{})};
11
+ a.tablesorter.addWidget({id:"saveSort",init:function(a,c){c.format(a,!0)},format:function(e,c){var d,b,i=e.config;d=!1!==i.widgetOptions.saveSort;var f={sortList:i.sortList};i.debug&&(b=new Date);a(e).hasClass("hasSaveSort")?d&&(e.hasInitialized&&a.tablesorter.storage)&&(a.tablesorter.storage(e,"tablesorter-savesort",f),i.debug&&a.tablesorter.benchmark("saveSort widget: Saving last sort: "+ i.sortList,b)):(a(e).addClass("hasSaveSort"),f="",a.tablesorter.storage&&(f=(d=a.tablesorter.storage(e,"tablesorter-savesort"))&&d.hasOwnProperty("sortList")&&a.isArray(d.sortList)?d.sortList:"",i.debug&&a.tablesorter.benchmark('saveSort: Last sort loaded: "'+f+'"',b)),c&&f&&0<f.length?i.sortList=f:e.hasInitialized&&(f&&0<f.length)&&a(e).trigger("sorton",[f]))},remove:function(e){a.tablesorter.storage(e,"tablesorter-savesort","")}})
12
12
  })(jQuery);
@@ -1,4 +1,4 @@
1
- /*************
1
+ /*************
2
2
  Black Ice Theme (by thezoggy)
3
3
  *************/
4
4
  /* overall */
@@ -32,20 +32,24 @@
32
32
  background-position: center right;
33
33
  background-repeat: no-repeat;
34
34
  }
35
- .tablesorter-blackice th.headerSortUp,
36
- .tablesorter-blackice th.tablesorter-headerSortUp {
35
+ .tablesorter-blackice .headerSortUp,
36
+ .tablesorter-blackice .tablesorter-headerSortUp,
37
+ .tablesorter-blackice .tablesorter-headerAsc {
38
+ background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7);
37
39
  color: #fff;
38
- background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7);
39
40
  }
40
- .tablesorter-blackice th.headerSortDown,
41
- .tablesorter-blackice th.tablesorter-headerSortDown {
41
+ .tablesorter-blackice .headerSortDown,
42
+ .tablesorter-blackice .tablesorter-headerSortDown,
43
+ .tablesorter-blackice .tablesorter-headerDesc {
42
44
  color: #fff;
43
- background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7);
45
+ background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7);
44
46
  }
45
47
 
46
48
  /* tfoot */
47
49
  .tablesorter-blackice tfoot .tablesorter-headerSortUp,
48
- .tablesorter-blackice tfoot .tablesorter-headerSortDown {
50
+ .tablesorter-blackice tfoot .tablesorter-headerSortDown,
51
+ .tablesorter-blackice tfoot .tablesorter-headerAsc,
52
+ .tablesorter-blackice tfoot .tablesorter-headerDesc {
49
53
  /* remove sort arrows from footer */
50
54
  background-image: url();
51
55
  }