Skip to content
This repository
Browse code

default css names & widget fixes

  • Loading branch information...
commit ac26e9415d4a463419c93aeea7a65e2e2c1dd762 1 parent 0642f8e
Rob G authored
17 README.markdown
Source Rendered
@@ -34,6 +34,23 @@ Included all original [document pages](http://mottie.github.com/tablesorter/docs
34 34
35 35 View the [complete listing here](http://mottie.github.com/tablesorter/changelog.txt).
36 36
  37 +#### Version 2.1.7 (3/26/2012)
  38 +
  39 +* Changed default css options to use more unique names:
  40 + * `cssHeader` is now `"tablesorter-header"`
  41 + * `cssAsc` is now `"tablesorter-headerSortUp"`
  42 + * `cssDesc` is now `"tablesorter-headerSortDown"`
  43 + * Updated blue & green styles to use the appropriate names.
  44 + * Left the original css definitions to keep the styles backward compatible.
  45 +* Table header cell content wrapper modification:
  46 + * Previously the content was wrapped with a `span`, now wrapped with a `div`
  47 + * Content wrapping div now as the class name of `tablesorter-header-inner` applied to it.
  48 +* Various widget fixes:
  49 + * The `$.tablesorter.storage` code now loads saved variables before updating. Fix for [issue #41](https://github.com/Mottie/tablesorter/issues/41).
  50 + * Reverted the "filter" widget code to work like it is supposed to. Fix for [issue #40](https://github.com/Mottie/tablesorter/issues/40).
  51 + * Modified the "stickHeaders" widget to now set the width of the content instead of the table cell. It seems to work better. Fix for [issue #37](https://github.com/Mottie/tablesorter/issues/37)
  52 + * Fixed the "uitheme" widget code to update the sorting icon correctly.
  53 +
37 54 #### Version 2.1.6 (3/22/2012)
38 55
39 56 * Pager updates
18 changelog.txt
... ... @@ -1,5 +1,23 @@
1 1 TableSorter Change Log
2 2
  3 +Version 2.1.7 (3/26/2012)
  4 +============================
  5 +
  6 +* Changed default css options to use more unique names:
  7 + * `cssHeader` is now `"tablesorter-header"`
  8 + * `cssAsc` is now `"tablesorter-headerSortUp"`
  9 + * `cssDesc` is now `"tablesorter-headerSortDown"`
  10 + * Updated blue & green styles to use the appropriate names.
  11 + * Left the original css definitions to keep the styles backward compatible.
  12 +* Table header cell content wrapper modification:
  13 + * Previously the content was wrapped with a `span`, now wrapped with a `div`
  14 + * Content wrapping div now as the class name of `tablesorter-header-inner` applied to it.
  15 +* Various widget fixes:
  16 + * The `$.tablesorter.storage` code now loads saved variables before updating. Fix for [issue #41](https://github.com/Mottie/tablesorter/issues/41).
  17 + * Reverted the "filter" widget code to work like it is supposed to. Fix for [issue #40](https://github.com/Mottie/tablesorter/issues/40).
  18 + * Modified the "stickHeaders" widget to now set the width of the content instead of the table cell. It seems to work better. Fix for [issue #37](https://github.com/Mottie/tablesorter/issues/37)
  19 + * Fixed the "uitheme" widget code to update the sorting icon correctly.
  20 +
3 21 Version 2.1.6 (3/22/2012)
4 22 ============================
5 23
BIN  css/blue/blue.zip
Binary file not shown
18 css/blue/style.css
@@ -8,17 +8,23 @@ table.tablesorter {
8 8 text-align: left;
9 9 border-spacing: 0;
10 10 }
11   -table.tablesorter, table.tablesorter th, table.tablesorter tr.tablesorter-stickyHeader th, table.tablesorter td {
  11 +table.tablesorter,
  12 +table.tablesorter th,
  13 +table.tablesorter tr.tablesorter-stickyHeader th,
  14 +table.tablesorter td {
12 15 border: #cdcdcd 1px solid;
13 16 }
14 17
15   -table.tablesorter thead tr th, tr.tablesorter-stickyHeader th, table.tablesorter tfoot tr th {
  18 +table.tablesorter thead tr th,
  19 +tr.tablesorter-stickyHeader th,
  20 +table.tablesorter tfoot tr th {
16 21 background-color: #e6eeee;
17 22 border-collapse: collapse;
18 23 font-size: 12px;
19 24 padding: 4px 20px 4px 4px;
20 25 }
21   -table.tablesorter thead tr .header, tr.tablesorter-stickyHeader .header {
  26 +table.tablesorter thead tr .tablesorter-header,
  27 +tr.tablesorter-stickyHeader .tablesorter-header {
22 28 background-image: url(black-bg.gif);
23 29 background-repeat: no-repeat;
24 30 background-position: center right;
@@ -30,11 +36,13 @@ table.tablesorter tbody td {
30 36 background-color: #fff;
31 37 vertical-align: top;
32 38 }
33   -table.tablesorter thead tr .headerSortUp {
  39 +table.tablesorter thead tr .headerSortUp,
  40 +table.tablesorter thead tr .tablesorter-headerSortUp {
34 41 background-color: #8dbdd8;
35 42 background-image: url(black-asc.gif);
36 43 }
37   -table.tablesorter thead tr .headerSortDown {
  44 +table.tablesorter thead tr .headerSortDown,
  45 +table.tablesorter thead tr .tablesorter-headerSortDown {
38 46 background-color: #8dbdd8;
39 47 background-image: url(black-desc.gif);
40 48 }
BIN  css/green/green.zip
Binary file not shown
39 css/green/style.css
@@ -8,11 +8,16 @@ table.tablesorter {
8 8 text-align: left;
9 9 border-spacing: 0;
10 10 }
11   -table.tablesorter, table.tablesorter th, table.tablesorter tr.tablesorter-stickyHeader th, table.tablesorter td {
  11 +table.tablesorter,
  12 +table.tablesorter th,
  13 +table.tablesorter tr.tablesorter-stickyHeader th,
  14 +table.tablesorter td {
12 15 border: #cdcdcd 1px solid;
13 16 }
14 17
15   -table.tablesorter thead tr th, tr.tablesorter-stickyHeader th, table.tablesorter tfoot tr th {
  18 +table.tablesorter thead tr th,
  19 +tr.tablesorter-stickyHeader th,
  20 +table.tablesorter tfoot tr th {
16 21 border-collapse: collapse;
17 22 font-size: 12px;
18 23 padding: 5px;
@@ -21,24 +26,32 @@ table.tablesorter td {
21 26 color: #3d3d3d;
22 27 padding: 5px;
23 28 }
24   -table.tablesorter thead tr, table.tablesorter tfoot tr {
  29 +table.tablesorter thead tr.tablesorter-header,
  30 +table.tablesorter thead tr.tablesorter-stickyHeader,
  31 +table.tablesorter tfoot tr {
25 32 background: url(bkgd.png) center center repeat-x;
26 33 }
27   -table.tablesorter .header {
  34 +table.tablesorter .header,
  35 +table.tablesorter .tablesorter-header {
28 36 background: transparent;
29 37 border-right: #cdcdcd 1px solid;
30 38 padding: 9px;
31 39 height: auto;
32 40 cursor: pointer;
33 41 }
34   -table.tablesorter .header span:first-child, .tablesorter-stickyHeader .header span:first-child {
  42 +table.tablesorter .header span:first-child,
  43 +.tablesorter-stickyHeader .header span:first-child,
  44 +table.tablesorter th.tablesorter-header .tablesorter-header-inner,
  45 +.tablesorter-stickyHeader th.tablesorter-header .tablesorter-header-inner {
35 46 background: url(none.png) no-repeat;
36 47 padding: 2px 0 2px 25px;
37 48 }
38   -table.tablesorter .headerSortUp span:first-child {
  49 +table.tablesorter .headerSortUp span:first-child,
  50 +table.tablesorter .tablesorter-headerSortUp .tablesorter-header-inner {
39 51 background: url(asc.png) no-repeat;
40 52 }
41   -table.tablesorter .headerSortDown span:first-child {
  53 +table.tablesorter .headerSortDown span:first-child,
  54 +table.tablesorter .tablesorter-headerSortDown .tablesorter-header-inner {
42 55 background: url(desc.png) no-repeat;
43 56 }
44 57
@@ -51,21 +64,24 @@ table.tablesorter tr.even td {
51 64 }
52 65
53 66 /* Column Widget - column sort colors */
54   -table.tablesorter tbody td.primary, table.tablesorter tbody tr.odd td.primary {
  67 +table.tablesorter tbody td.primary,
  68 +table.tablesorter tbody tr.odd td.primary {
55 69 background-color: #c0ffc0;
56 70 }
57 71 table.tablesorter tbody tr.even td.primary {
58 72 background-color: #e8ffe8;
59 73 }
60 74
61   -table.tablesorter tbody td.secondary, table.tablesorter tbody tr.odd td.secondary {
  75 +table.tablesorter tbody td.secondary,
  76 +table.tablesorter tbody tr.odd td.secondary {
62 77 background-color: #d6ffd6;
63 78 }
64 79 table.tablesorter tbody tr.even td.secondary {
65 80 background-color: #e8ffe8;
66 81 }
67 82
68   -table.tablesorter tbody td.tertiary, table.tablesorter tbody tr.odd td.tertiary {
  83 +table.tablesorter tbody td.tertiary,
  84 +table.tablesorter tbody tr.odd td.tertiary {
69 85 background-color: #eaffea;
70 86 }
71 87 table.tablesorter tbody tr.even td.tertiary {
@@ -79,7 +95,8 @@ table.tablesorter thead tr.tablesorter-filter input.tablesorter-filter {
79 95 -moz-box-sizing: border-box;
80 96 box-sizing: border-box;
81 97 }
82   -table.tablesorter thead tr.tablesorter-filter, table.tablesorter thead tr.tablesorter-filter td {
  98 +table.tablesorter thead tr.tablesorter-filter,
  99 +table.tablesorter thead tr.tablesorter-filter td {
83 100 text-align: center;
84 101 background: #fff;
85 102 }
6 css/ui/style.css
@@ -7,7 +7,8 @@ table.tablesorter {
7 7 text-align: left;
8 8 padding: 5px;
9 9 }
10   -table.tablesorter thead tr th, table.tablesorter tfoot tr th {
  10 +table.tablesorter thead tr th,
  11 +table.tablesorter tfoot tr th {
11 12 border-collapse: collapse;
12 13 font-size: 8pt;
13 14 padding: 4px;
@@ -47,7 +48,8 @@ table.tablesorter thead tr.tablesorter-filter input.tablesorter-filter {
47 48 -moz-box-sizing: border-box;
48 49 box-sizing: border-box;
49 50 }
50   -table.tablesorter thead tr.tablesorter-filter, table.tablesorter thead tr.tablesorter-filter td {
  51 +table.tablesorter thead tr.tablesorter-filter,
  52 +table.tablesorter thead tr.tablesorter-filter td {
51 53 text-align: center;
52 54 }
53 55 /* optional disabled input styling */
2  docs/example-option-render-header.html
@@ -27,7 +27,7 @@
27 27 -moz-border-radius: 1em;
28 28 -webkit-border-radius: 1em;
29 29 }
30   -.headerSortDown .roundedCorners {
  30 +.tablesorter-headerSortDown .roundedCorners {
31 31 border-color: #fff;
32 32 }
33 33 </style>
44 docs/index.html
@@ -403,12 +403,12 @@
403 403 <tr id="cssasc">
404 404 <td><a href="#" class="toggle2">cssAsc</a></td>
405 405 <td>String</td>
406   - <td>"headerSortUp"</td>
  406 + <td>"tablesorter-headerSortUp"</td>
407 407 <td>The CSS style used to style the header when sorting ascending. Example from the blue skin:
408 408 <div class="collapsible">
409   - <pre class="css">th.headerSortUp {
410   - background-image: url(../img/small_asc.gif);
411   - background-color: #3399FF;
  409 + <pre class="css">th.tablesorter-headerSortUp {
  410 + background-color: #8dbdd8;
  411 + background-image: url(black-asc.gif);
412 412 }</pre></div>
413 413 </td>
414 414 <td></td>
@@ -472,12 +472,12 @@
472 472 <tr id="cssdesc">
473 473 <td><a href="#" class="toggle2">cssDesc</a></td>
474 474 <td>String</td>
475   - <td>"headerSortDown"</td>
  475 + <td>"tablesorter-headerSortDown"</td>
476 476 <td>The CSS style used to style the header when sorting descending. Example from the blue skin:
477 477 <div class="collapsible">
478   - <pre class="css">th.headerSortDown {
479   - background-image: url(../img/small_desc.gif);
480   - background-color: #3399FF;
  478 + <pre class="css">th.tablesorter-headerSortDown {
  479 + background-color: #8dbdd8;
  480 + background-image: url(black-desc.gif);
481 481 }</pre></div>
482 482 </td>
483 483 <td></td>
@@ -486,18 +486,18 @@
486 486 <tr id="cssheader">
487 487 <td><a href="#" class="toggle2">cssHeader</a></td>
488 488 <td>String</td>
489   - <td>"header"</td>
  489 + <td>"tablesorter-header"</td>
490 490 <td>The CSS style used to style the header in its unsorted state. Example from the blue skin:
491 491 <div class="collapsible">
492   - <pre class="css">th.header {
493   - background-image: url(../img/small.gif);
494   - cursor: pointer;
495   - font-weight: bold;
  492 + <pre class="css">th.tablesorter-header {
  493 + background-color: #e6eeee;
  494 + background-image: url(black-bg.gif);
496 495 background-repeat: no-repeat;
497   - background-position: center left;
498   - padding-left: 20px;
499   - border-right: 1px solid #dad9c7;
500   - margin-left: -1px;
  496 + background-position: center right;
  497 + border-collapse: collapse;
  498 + cursor: pointer;
  499 + font-size: 12px;
  500 + padding: 4px 20px 4px 4px;
501 501 }</pre></div>
502 502 </td>
503 503 <td></td>
@@ -564,7 +564,7 @@
564 564 <tr id="headerlist">
565 565 <td>headerList</td>
566 566 <td>Array</td>
567   - <td>[] (empty array)</td>
  567 + <td>[ ] (empty array)</td>
568 568 <td>Internal list of each header element as selected using jQuery selectors in the <a href="#selectorheaders"><code class="hilight">selectorHeaders</code></a> option. Not really useful for normal usage.</td>
569 569 <td></td>
570 570 </tr>
@@ -647,7 +647,7 @@
647 647 <tr id="parsers">
648 648 <td><a href="#" class="toggle2">parsers</a></td>
649 649 <td>Object</td>
650   - <td>{}</td>
  650 + <td>{ }</td>
651 651 <td>Internal list of all of the parsers. Here is a complete list of default parsers:
652 652 <div class="collapsible">
653 653 <br>
@@ -865,7 +865,7 @@
865 865 <tr id="widgets">
866 866 <td>widgets</td>
867 867 <td>Array</td>
868   - <td>[] (empty array)</td>
  868 + <td>[ ] (empty array)</td>
869 869 <td>
870 870 Initialize widgets using this option ( e.g. <code class="hilight">widgets : ['zebra']</code>, or custom widgets <code class="hilight">widgets: ['zebra', 'myCustomWidget'];</code>, see <a href="example-widgets.html">this demo</a> on how to write your own custom widget ).
871 871 </td>
@@ -886,7 +886,7 @@
886 886 <tr id="widgetoptions">
887 887 <td><a href="#" class="toggle2">widgetOptions</a></td>
888 888 <td>Object</td>
889   - <td>{}</td>
  889 + <td>{ }</td>
890 890 <td>
891 891 As of version 2.1, all widget options have been moved into this option. This is a move to store all widget specific options in one place so as not to polute the main table options. All current widgets have been modified to use this new option. <span class="tip"><em>New!</em></span> in v2.1.
892 892 <div class="collapsible">
@@ -1485,7 +1485,7 @@
1485 1485
1486 1486 <strong id="Download-Addons">Optional / Add-Ons:</strong>
1487 1487 <ul>
1488   - <li><a class="external" href="http://plugins.jquery.com/files/jquery.metadata.2.1.zip">jQuery Metadata 2.1</a> (3,7kb, required for setting <a href="#Examples">inline options</a>)</li>
  1488 + <li><a class="external" href="http://plugins.jquery.com/files/jquery.metadata.2.1.zip">jQuery Metadata 2.1</a> (6kb, required for setting <a href="#Examples">inline options</a>)</li>
1489 1489 <li><a href="../js/jquery.tablesorter.js">jquery.tablesorter.js</a> (30kb/<a href="../js/jquery.tablesorter.min.js">17kb min</a>)</li>
1490 1490 <li><a href="../addons/pager/jquery.tablesorter.pager.js">jquery.tablesorter.pager.js</a> (14kb/<a href="../addons/pager/jquery.tablesorter.pager.min.js">7kb min</a>, <a href="example-pager.html">demo</a>)</li>
1491 1491 <li><a href="../js/jquery.tablesorter.widgets.js">jquery.tablesorter.widgets.js</a> (15kb/<a href="../js/jquery.tablesorter.widgets.min.js">7kb min</a>, includes the jQuery UI theme, columns styling, resizable columns, filter, sticky header and save sort widgets. <span class="tip"><em>Updated!</em></span> in v2.1.)</li>
16 js/jquery.tablesorter.js
... ... @@ -1,5 +1,5 @@
1 1 /*!
2   -* TableSorter 2.1.6 - Client-side table sorting with ease!
  2 +* TableSorter 2.1.7 - Client-side table sorting with ease!
3 3 * @requires jQuery v1.2.6+
4 4 *
5 5 * Copyright (c) 2007 Christian Bach
@@ -18,13 +18,13 @@
18 18 $.extend({
19 19 tablesorter: new function(){
20 20
21   - this.version = "2.1.6";
  21 + this.version = "2.1.7";
22 22
23 23 var parsers = [], widgets = [], tbl;
24 24 this.defaults = {
25   - cssHeader: "header",
26   - cssAsc: "headerSortUp",
27   - cssDesc: "headerSortDown",
  25 + cssHeader: "tablesorter-header",
  26 + cssAsc: "tablesorter-headerSortUp",
  27 + cssDesc: "tablesorter-headerSortDown",
28 28 cssChildRow: "expand-child",
29 29 sortInitialOrder: "asc",
30 30 sortMultiSortKey: "shiftKey",
@@ -347,12 +347,12 @@
347 347 time = new Date();
348 348 }
349 349 $tableHeaders = $(c.selectorHeaders, table)
350   - .wrapInner("<span/>")
  350 + .wrapInner("<div class='tablesorter-header-inner' />")
351 351 .each(function (index) {
352 352 this.column = header_index[this.parentNode.rowIndex + "-" + this.cellIndex];
353 353 this.order = formatSortingOrder( checkHeaderOrder(table, index) ) ? [1,0,2] : [0,1,2];
354 354 this.count = -1; // set to -1 because clicking on the header automatically adds one
355   - if (checkHeaderMetadata(this) || checkHeaderOptions(table, index) || $(this).is('.sorter-false')) { this.sortDisabled = true; }
  355 + if (checkHeaderMetadata(this) || checkHeaderOptions(table, index) || $(this).hasClass('sorter-false')) { this.sortDisabled = true; }
356 356 this.lockedOrder = false;
357 357 lock = checkHeaderLocked(table, index);
358 358 if (typeof(lock) !== 'undefined' && lock !== false) {
@@ -364,7 +364,7 @@
364 364 }
365 365 // add cell to headerList
366 366 c.headerList[index] = this;
367   - $(this).parent().addClass('tablesorter-header');
  367 + $(this).parent().addClass(c.cssHeader);
368 368 });
369 369 if (c.debug) {
370 370 benchmark("Built headers", time);
4 js/jquery.tablesorter.min.js
... ... @@ -1,6 +1,6 @@
1 1 /*!
2   -* TableSorter 2.1.6 - Client-side table sorting with ease!
  2 +* TableSorter 2.1.7 - Client-side table sorting with ease!
3 3 * Minified using http://dean.edwards.name/packer/
4 4 * Copyright (c) 2007 Christian Bach
5 5 */
6   -!(function($){$.extend({tablesorter:new function(){this.version="2.1.6";var g=[],widgets=[],tbl;this.defaults={cssHeader:"header",cssAsc:"headerSortUp",cssDesc:"headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:false,sortReset:false,sortRestart:false,textExtraction:"simple",parsers:{},widgets:[],headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"mmddyyyy",usNumberFormat:true,onRenderHeader:null,selectorHeaders:'thead th',selectorRemove:"tr.remove-me",tableClass:'tablesorter',debug:false,widgetOptions:{zebra:["even","odd"]}};function log(s){if(typeof console!=="undefined"&&typeof console.log!=="undefined"){console.log(s)}else{alert(s)}}function benchmark(s,d){log(s+" ("+(new Date().getTime()-d.getTime())+"ms)")}this.benchmark=benchmark;this.hasInitialized=false;function getElementText(a,b,c){var d="",te=a.textExtraction;if(!b){return""}if(!a.supportsTextContent){a.supportsTextContent=b.textContent||false}if(te==="simple"){if(a.supportsTextContent){d=b.textContent}else{if(b.childNodes[0]&&b.childNodes[0].hasChildNodes()){d=b.childNodes[0].innerHTML}else{d=b.innerHTML}}}else{if(typeof(te)==="function"){d=te(b,tbl,c)}else if(typeof(te)==="object"&&te.hasOwnProperty(c)){d=te[c](b,tbl,c)}else{d=$(b).text()}}return d}function getParserById(a){var i,l=g.length;for(i=0;i<l;i++){if(g[i].id.toLowerCase()===(a.toString()).toLowerCase()){return g[i]}}return false}function trimAndGetNodeText(a,b,c){return $.trim(getElementText(a,b,c))}function detectParserForColumn(a,b,c,d){var i,l=g.length,node=false,nodeValue='',keepLooking=true;while(nodeValue===''&&keepLooking){c++;if(b[c]){node=b[c].cells[d];nodeValue=trimAndGetNodeText(a.config,node,d);if(a.config.debug){log('Checking if value was empty on row '+c+', column:'+d+": "+nodeValue)}}else{keepLooking=false}}for(i=1;i<l;i++){if(g[i].is(nodeValue,a,node)){return g[i]}}return g[0]}function buildParserCache(a,b){if(a.tBodies.length===0){return}var c=a.tBodies[0].rows,list,cells,l,h,i,p,parsersDebug="";if(c[0]){list=[];cells=c[0].cells;l=cells.length;for(i=0;i<l;i++){p=false;h=$(b[i]);if($.metadata&&(h.metadata()&&h.metadata().sorter)){p=getParserById(h.metadata().sorter)}else if((a.config.headers[i]&&a.config.headers[i].sorter)){p=getParserById(a.config.headers[i].sorter)}else if(h.attr('class')&&h.attr('class').match('sorter-')){p=getParserById(h.attr('class').match(/sorter-(\w+)/)[1]||'')}if(!p){p=detectParserForColumn(a,c,-1,i)}if(a.config.debug){parsersDebug+="column:"+i+"; parser:"+p.id+"\n"}list.push(p)}}if(a.config.debug){log(parsersDebug)}return list}function buildCache(a){var b=a.tBodies[0],totalRows=(b&&b.rows.length)||0,totalCells=(b.rows[0]&&b.rows[0].cells.length)||0,g=a.config.parsers,cache={row:[],normalized:[]},t,i,j,c,cols,cacheTime;if(a.config.debug){cacheTime=new Date()}for(i=0;i<totalRows;++i){c=$(b.rows[i]);cols=[];if(c.hasClass(a.config.cssChildRow)){cache.row[cache.row.length-1]=cache.row[cache.row.length-1].add(c);continue}cache.row.push(c);for(j=0;j<totalCells;++j){t=trimAndGetNodeText(a.config,c[0].cells[j],j);cols.push(g[j].format(t,a,c[0].cells[j],j))}cols.push(cache.normalized.length);cache.normalized.push(cols)}if(a.config.debug){benchmark("Building cache for "+totalRows+" rows",cacheTime)}a.config.cache=cache;return cache}function getWidgetById(a){var i,w,l=widgets.length;for(i=0;i<l;i++){w=widgets[i];if(w&&w.hasOwnProperty('id')&&w.id.toLowerCase()===a.toLowerCase()){return w}}}function applyWidget(a,b){var c=a.config.widgets,i,w,l=c.length;for(i=0;i<l;i++){w=getWidgetById(c[i]);if(w){if(b&&w.hasOwnProperty('init')){w.init(a,widgets,w)}else if(!b&&w.hasOwnProperty('format')){w.format(a)}}}}function appendToTable(a,b){var c=a.config,r=b.row,n=b.normalized,totalRows=n.length,checkCell=totalRows?(n[0].length-1):0,rows=[],i,j,l,pos,appendTime;if(c.debug){appendTime=new Date()}for(i=0;i<totalRows;i++){pos=n[i][checkCell];rows.push(r[pos]);if(!c.appender||!c.removeRows){l=r[pos].length;for(j=0;j<l;j++){a.tBodies[0].appendChild(r[pos][j])}}}if(c.appender){c.appender(a,rows)}if(c.debug){benchmark("Rebuilt table",appendTime)}applyWidget(a);$(a).trigger("sortEnd",a)}function computeTableHeaderCellIndexes(t){var a=[],lookup={},thead=t.getElementsByTagName('THEAD')[0],trs=thead.getElementsByTagName('TR'),i,j,k,l,c,cells,rowIndex,cellId,rowSpan,colSpan,firstAvailCol,matrixrow;for(i=0;i<trs.length;i++){cells=trs[i].cells;for(j=0;j<cells.length;j++){c=cells[j];rowIndex=c.parentNode.rowIndex;cellId=rowIndex+"-"+c.cellIndex;rowSpan=c.rowSpan||1;colSpan=c.colSpan||1;if(typeof(a[rowIndex])==="undefined"){a[rowIndex]=[]}for(k=0;k<a[rowIndex].length+1;k++){if(typeof(a[rowIndex][k])==="undefined"){firstAvailCol=k;break}}lookup[cellId]=firstAvailCol;for(k=rowIndex;k<rowIndex+rowSpan;k++){if(typeof(a[k])==="undefined"){a[k]=[]}matrixrow=a[k];for(l=firstAvailCol;l<firstAvailCol+colSpan;l++){matrixrow[l]="x"}}}}return lookup}function formatSortingOrder(v){return(/^d/i.test(v)||v===1)}function checkHeaderMetadata(a){return(($.metadata)&&($(a).metadata().sorter===false))}function checkHeaderOptions(a,i){return((a.config.headers[i])&&(a.config.headers[i].sorter===false))}function checkHeaderLocked(a,i){if((a.config.headers[i])&&(a.config.headers[i].lockedOrder!==null)){return a.config.headers[i].lockedOrder}return false}function checkHeaderOrder(a,i){if((a.config.headers[i])&&(a.config.headers[i].sortInitialOrder)){return a.config.headers[i].sortInitialOrder}return a.config.sortInitialOrder}function buildHeaders(b){var d=($.metadata)?true:false,header_index=computeTableHeaderCellIndexes(b),$th,lock,time,$tableHeaders,c=b.config;c.headerList=[];if(c.debug){time=new Date()}$tableHeaders=$(c.selectorHeaders,b).wrapInner("<span/>").each(function(a){this.column=header_index[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(checkHeaderOrder(b,a))?[1,0,2]:[0,1,2];this.count=-1;if(checkHeaderMetadata(this)||checkHeaderOptions(b,a)||$(this).is('.sorter-false')){this.sortDisabled=true}this.lockedOrder=false;lock=checkHeaderLocked(b,a);if(typeof(lock)!=='undefined'&&lock!==false){this.order=this.lockedOrder=formatSortingOrder(lock)?[1,1,1]:[0,0,0]}if(!this.sortDisabled){$th=$(this).addClass(c.cssHeader);if(c.onRenderHeader){c.onRenderHeader.apply($th,[a])}}c.headerList[a]=this;$(this).parent().addClass('tablesorter-header')});if(c.debug){benchmark("Built headers",time);log($tableHeaders)}return $tableHeaders}function checkCellColSpan(a,b,d){var i,cell,arr=[],r=a.tHead.rows,c=r[d].cells;for(i=0;i<c.length;i++){cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(a,b,d++))}else{if(a.tHead.length===1||(cell.rowSpan>1||!r[d+1])){arr.push(cell)}}}return arr}function isValueInArray(v,a){var i,l=a.length;for(i=0;i<l;i++){if(a[i][0]===v){return true}}return false}function setHeadersCss(b,c,d){var h=[],i,l,css=[b.config.cssDesc,b.config.cssAsc];c.removeClass(css[0]).removeClass(css[1]);c.each(function(a){if(!this.sortDisabled){h[this.column]=$(this)}});l=d.length;for(i=0;i<l;i++){if(d[i][1]===2){continue}h[d[i][0]].addClass(css[d[i][1]])}}function fixColumnWidth(a,b){if(a.config.widthFixed){var c=$('<colgroup>');$("tr:first td",a.tBodies[0]).each(function(){c.append($('<col>').css('width',$(this).width()))});$(a).prepend(c)}}function updateHeaderSortCount(a,b){var i,s,o,c=a.config,l=b.length;for(i=0;i<l;i++){s=b[i];o=c.headerList[s[0]];o.count=(s[1]+1)%(c.sortReset?3:2)}}function getCachedSortType(a,i){return(a)?a[i].type:''}function multisort(a,b,d){var f="var sortWrapper = function(a,b) {",col,mx=0,dir=0,tc=a.config,lc=d.normalized.length,l=b.length,sortTime,i,j,c,s,e,order,orgOrderCol;if(tc.debug){sortTime=new Date()}for(i=0;i<l;i++){c=b[i][0];order=b[i][1];s=(getCachedSortType(tc.parsers,c)==="text")?((order===0)?"sortText":"sortTextDesc"):((order===0)?"sortNumeric":"sortNumericDesc");e="e"+i;if(/Numeric/.test(s)&&tc.headers[c]&&tc.headers[c].string){for(j=0;j<lc;j++){col=Math.abs(parseFloat(d.normalized[j][c]));mx=Math.max(mx,isNaN(col)?0:col)}dir=(tc.headers[c])?tc.string[tc.headers[c].string]||0:0}f+="var "+e+" = "+s+"(a["+c+"],b["+c+"],"+mx+","+dir+"); ";f+="if ("+e+") { return "+e+"; } ";f+="else { "}orgOrderCol=(d.normalized&&d.normalized[0])?d.normalized[0].length-1:0;f+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(i=0;i<l;i++){f+="}; "}f+="return 0; ";f+="}; ";eval(f);d.normalized.sort(sortWrapper);if(tc.debug){benchmark("Sorting on "+b.toString()+" and dir "+order+" time",sortTime)}return d}function sortText(a,b){if(a===''){return 1}if(b===''){return-1}if(a===b){return 0}if($.data(tbl[0],"tablesorter").sortLocaleCompare){return a.localeCompare(b)}try{var c=0,ax,t,x=/^(\.)?\d/,L=Math.min(a.length,b.length)+1;while(c<L&&a.charAt(c)===b.charAt(c)&&x.test(b.substring(c))===false&&x.test(a.substring(c))===false){c++}a=a.substring(c);b=b.substring(c);if(x.test(a)||x.test(b)){if(x.test(a)===false){return(a)?1:-1}else if(x.test(b)===false){return(b)?-1:1}else{t=parseFloat(a)-parseFloat(b);if(t!==0){return t}else{t=a.search(/[^\.\d]/)}if(t===-1){t=b.search(/[^\.\d]/)}a=a.substring(t);b=b.substring(t)}}return(a>b)?1:-1}catch(er){return 0}}function sortTextDesc(a,b){if(a===''){return 1}if(b===''){return-1}if(a===b){return 0}if($.data(tbl[0],"tablesorter").sortLocaleCompare){return b.localeCompare(a)}return-sortText(a,b)}function getTextValue(a,b,d){if(b){var i,l=a.length,n=b+d;for(i=0;i<l;i++){n+=a.charCodeAt(i)}return d*n}return 0}function sortNumeric(a,b,c,d){if(a===''){return 1}if(b===''){return-1}if(isNaN(a)){a=getTextValue(a,c,d)}if(isNaN(b)){b=getTextValue(b,c,d)}return a-b}function sortNumericDesc(a,b,c,d){if(a===''){return 1}if(b===''){return-1}if(isNaN(a)){a=getTextValue(a,c,d)}if(isNaN(b)){b=getTextValue(b,c,d)}return b-a}this.construct=function(f){return this.each(function(){if(!this.tHead||this.tBodies.length===0){return}var d,$document,$headers,cache,config,shiftDown=0,sortOrder,totalRows,$cell,c,i,j,k,a,s,o;this.config={};c=config=$.extend(true,this.config,$.tablesorter.defaults,f);tbl=d=$(this).addClass(this.config.tableClass);$.data(this,"tablesorter",c);$headers=buildHeaders(this);c.parsers=buildParserCache(this,$headers);c.string={max:1,'max+':1,'max-':-1,none:0};cache=buildCache(this);fixColumnWidth(this);$headers.click(function(e){totalRows=(d[0].tBodies[0]&&d[0].tBodies[0].rows.length)||0;if(!this.sortDisabled){d.trigger("sortStart",tbl[0]);$cell=$(this);k=!e[c.sortMultiSortKey];this.count=(this.count+1)%(c.sortReset?3:2);if(c.sortRestart){i=this;$headers.each(function(){if(this!==i&&(k||!$(this).is('.'+c.cssDesc+',.'+c.cssAsc))){this.count=-1}})}i=this.column;if(k){c.sortList=[];if(c.sortForce!==null){a=c.sortForce;for(j=0;j<a.length;j++){if(a[j][0]!==i){c.sortList.push(a[j])}}}if(this.order[this.count]<2){c.sortList.push([i,this.order[this.count]])}}else{if(isValueInArray(i,c.sortList)){for(j=0;j<c.sortList.length;j++){s=c.sortList[j];o=c.headerList[s[0]];if(s[0]===i){s[1]=o.order[o.count];if(s[1]===2){c.sortList.splice(j,1);o.count=-1}}}}else{if(this.order[this.count]<2){c.sortList.push([i,this.order[this.count]])}}}if(c.sortAppend!==null){a=c.sortAppend;for(j=0;j<a.length;j++){if(a[j][0]!==i){c.sortList.push(a[j])}}}d.trigger("sortBegin",tbl[0]);setHeadersCss(d[0],$headers,c.sortList);appendToTable(d[0],multisort(d[0],c.sortList,cache));return false}}).mousedown(function(){if(c.cancelSelection){this.onselectstart=function(){return false};return false}});d.bind("update",function(){var t=this,c=t.config;$(c.selectorRemove,t.tBodies[0]).remove();t.config.parsers=buildParserCache(t,$headers);cache=buildCache(t);d.trigger("sorton",[t.config.sortList])}).bind("updateCell",function(e,a){var b=[(a.parentNode.rowIndex-1),a.cellIndex];cache.normalized[b[0]][b[1]]=c.parsers[b[1]].format(getElementText(c,a,b[1]),d,a,b[1]);c.cache=cache;d.trigger("sorton",[c.sortList])}).bind("addRows",function(e,a){var i,rows=a.filter('tr').length,dat=[],l=a[0].cells.length;for(i=0;i<rows;i++){for(j=0;j<l;j++){dat[j]=c.parsers[j].format(getElementText(c,a[i].cells[j],j),d,a[i].cells[j],j)}dat.push(cache.row.length);cache.row.push([a[i]]);cache.normalized.push(dat);dat=[]}c.cache=cache;d.trigger("sorton",[c.sortList])}).bind("sorton",function(e,a){$(this).trigger("sortStart",tbl[0]);c.sortList=a;var b=c.sortList;updateHeaderSortCount(this,b);setHeadersCss(this,$headers,b);appendToTable(this,multisort(this,b,cache))}).bind("appendCache",function(){appendToTable(this,cache)}).bind("applyWidgetId",function(e,a){getWidgetById(a).format(this)}).bind("applyWidgets",function(){applyWidget(this)});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){c.sortList=$(this).metadata().sortlist}applyWidget(this,true);if(c.sortList.length>0){d.trigger("sorton",[c.sortList])}else{applyWidget(this)}this.hasInitialized=true})};this.addParser=function(b){var i,l=g.length,a=true;for(i=0;i<l;i++){if(g[i].id.toLowerCase()===b.id.toLowerCase()){a=false}}if(a){g.push(b)}};this.addWidget=function(a){widgets.push(a)};this.formatFloat=function(s){if(typeof(s)!=='string'){return s}if(tbl[0].config.usNumberFormat){s=s.replace(/,/g,'')}else{s=s.replace(/[\s|\.]/g,'').replace(/,/g,'.')}var i=parseFloat(s);return isNaN(i)?$.trim(s):i};this.isDigit=function(s){return(/^[\-+]?\d*$/).test($.trim(s.replace(/[,.'\s]/g,'')))};this.clearTableBody=function(a){$(a.tBodies[0]).empty()}}})();$.fn.extend({tablesorter:$.tablesorter.construct});var m=$.tablesorter;m.addParser({id:"text",is:function(s){return true},format:function(s){return $.trim(s.toLocaleLowerCase())},type:"text"});m.addParser({id:"digit",is:function(s){return $.tablesorter.isDigit(s)},format:function(s){return $.tablesorter.formatFloat(s)},type:"numeric"});m.addParser({id:"currency",is:function(s){return(/^[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]/).test(s)},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9,. \-]/g),""))},type:"numeric"});m.addParser({id:"ipAddress",is:function(s){return(/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/).test(s)},format:function(s){var i,item,a=s.split("."),r="",l=a.length;for(i=0;i<l;i++){item=a[i];if(item.length===2){r+="0"+item}else{r+=item}}return $.tablesorter.formatFloat(r)},type:"numeric"});m.addParser({id:"url",is:function(s){return(/^(https?|ftp|file):\/\/$/).test(s)},format:function(s){return $.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''))},type:"text"});m.addParser({id:"isoDate",is:function(s){return(/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/).test(s)},format:function(s){return $.tablesorter.formatFloat((s!=="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"")},type:"numeric"});m.addParser({id:"percent",is:function(s){return(/\%$/).test($.trim(s))},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""))},type:"numeric"});m.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/))},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime())},type:"numeric"});m.addParser({id:"shortDate",is:function(s){return(/\d{1,4}[\/\-\,\.\s+]\d{1,4}[\/\-\.\,\s+]\d{1,4}/).test(s)},format:function(s,a,b,d){var c=a.config,format=(c.headers&&c.headers[d])?c.headers[d].dateFormat||c.dateFormat:c.dateFormat;s=s.replace(/\s+/g," ").replace(/[\-|\.|\,|\s]/g,"/");if(format==="mmddyyyy"){s=s.replace(/(\d{1,2})\/(\d{1,2})\/(\d{4})/,"$3/$1/$2")}else if(format==="ddmmyyyy"){s=s.replace(/(\d{1,2})\/(\d{1,2})\/(\d{4})/,"$3/$2/$1")}else if(format==="yyyymmdd"){s=s.replace(/(\d{4})\/(\d{1,2})\/(\d{1,2})/,"$1/$2/$3")}return $.tablesorter.formatFloat(new Date(s).getTime())},type:"numeric"});m.addParser({id:"time",is:function(s){return(/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/).test(s)},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime())},type:"numeric"});m.addParser({id:"metadata",is:function(s){return false},format:function(s,a,b){var c=a.config,p=(!c.parserMetadataName)?'sortValue':c.parserMetadataName;return $(b).metadata()[p]},type:"numeric"});m.addWidget({id:"zebra",format:function(a){var b,row=0,even,time,c=a.config,child=c.cssChildRow,css=["even","odd"];css=c.widgetZebra&&c.hasOwnProperty('css')?c.widgetZebra.css:(c.widgetOptions&&c.widgetOptions.hasOwnProperty('zebra'))?c.widgetOptions.zebra:css;if(a.config.debug){time=new Date()}$("tr:visible",a.tBodies[0]).each(function(i){b=$(this);if(!b.hasClass(child)){row++}even=(row%2===0);b.removeClass(css[even?1:0]).addClass(css[even?0:1])});if(a.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time)}}})})(jQuery);
  6 +!(function($){$.extend({tablesorter:new function(){this.version="2.1.7";var g=[],widgets=[],tbl;this.defaults={cssHeader:"tablesorter-header",cssAsc:"tablesorter-headerSortUp",cssDesc:"tablesorter-headerSortDown",cssChildRow:"expand-child",sortInitialOrder:"asc",sortMultiSortKey:"shiftKey",sortForce:null,sortAppend:null,sortLocaleCompare:false,sortReset:false,sortRestart:false,textExtraction:"simple",parsers:{},widgets:[],headers:{},widthFixed:false,cancelSelection:true,sortList:[],headerList:[],dateFormat:"mmddyyyy",usNumberFormat:true,onRenderHeader:null,selectorHeaders:'thead th',selectorRemove:"tr.remove-me",tableClass:'tablesorter',debug:false,widgetOptions:{zebra:["even","odd"]}};function log(s){if(typeof console!=="undefined"&&typeof console.log!=="undefined"){console.log(s)}else{alert(s)}}function benchmark(s,d){log(s+" ("+(new Date().getTime()-d.getTime())+"ms)")}this.benchmark=benchmark;this.hasInitialized=false;function getElementText(a,b,c){var d="",te=a.textExtraction;if(!b){return""}if(!a.supportsTextContent){a.supportsTextContent=b.textContent||false}if(te==="simple"){if(a.supportsTextContent){d=b.textContent}else{if(b.childNodes[0]&&b.childNodes[0].hasChildNodes()){d=b.childNodes[0].innerHTML}else{d=b.innerHTML}}}else{if(typeof(te)==="function"){d=te(b,tbl,c)}else if(typeof(te)==="object"&&te.hasOwnProperty(c)){d=te[c](b,tbl,c)}else{d=$(b).text()}}return d}function getParserById(a){var i,l=g.length;for(i=0;i<l;i++){if(g[i].id.toLowerCase()===(a.toString()).toLowerCase()){return g[i]}}return false}function trimAndGetNodeText(a,b,c){return $.trim(getElementText(a,b,c))}function detectParserForColumn(a,b,c,d){var i,l=g.length,node=false,nodeValue='',keepLooking=true;while(nodeValue===''&&keepLooking){c++;if(b[c]){node=b[c].cells[d];nodeValue=trimAndGetNodeText(a.config,node,d);if(a.config.debug){log('Checking if value was empty on row '+c+', column:'+d+": "+nodeValue)}}else{keepLooking=false}}for(i=1;i<l;i++){if(g[i].is(nodeValue,a,node)){return g[i]}}return g[0]}function buildParserCache(a,b){if(a.tBodies.length===0){return}var c=a.tBodies[0].rows,list,cells,l,h,i,p,parsersDebug="";if(c[0]){list=[];cells=c[0].cells;l=cells.length;for(i=0;i<l;i++){p=false;h=$(b[i]);if($.metadata&&(h.metadata()&&h.metadata().sorter)){p=getParserById(h.metadata().sorter)}else if((a.config.headers[i]&&a.config.headers[i].sorter)){p=getParserById(a.config.headers[i].sorter)}else if(h.attr('class')&&h.attr('class').match('sorter-')){p=getParserById(h.attr('class').match(/sorter-(\w+)/)[1]||'')}if(!p){p=detectParserForColumn(a,c,-1,i)}if(a.config.debug){parsersDebug+="column:"+i+"; parser:"+p.id+"\n"}list.push(p)}}if(a.config.debug){log(parsersDebug)}return list}function buildCache(a){var b=a.tBodies[0],totalRows=(b&&b.rows.length)||0,totalCells=(b.rows[0]&&b.rows[0].cells.length)||0,g=a.config.parsers,cache={row:[],normalized:[]},t,i,j,c,cols,cacheTime;if(a.config.debug){cacheTime=new Date()}for(i=0;i<totalRows;++i){c=$(b.rows[i]);cols=[];if(c.hasClass(a.config.cssChildRow)){cache.row[cache.row.length-1]=cache.row[cache.row.length-1].add(c);continue}cache.row.push(c);for(j=0;j<totalCells;++j){t=trimAndGetNodeText(a.config,c[0].cells[j],j);cols.push(g[j].format(t,a,c[0].cells[j],j))}cols.push(cache.normalized.length);cache.normalized.push(cols)}if(a.config.debug){benchmark("Building cache for "+totalRows+" rows",cacheTime)}a.config.cache=cache;return cache}function getWidgetById(a){var i,w,l=widgets.length;for(i=0;i<l;i++){w=widgets[i];if(w&&w.hasOwnProperty('id')&&w.id.toLowerCase()===a.toLowerCase()){return w}}}function applyWidget(a,b){var c=a.config.widgets,i,w,l=c.length;for(i=0;i<l;i++){w=getWidgetById(c[i]);if(w){if(b&&w.hasOwnProperty('init')){w.init(a,widgets,w)}else if(!b&&w.hasOwnProperty('format')){w.format(a)}}}}function appendToTable(a,b){var c=a.config,r=b.row,n=b.normalized,totalRows=n.length,checkCell=totalRows?(n[0].length-1):0,rows=[],i,j,l,pos,appendTime;if(c.debug){appendTime=new Date()}for(i=0;i<totalRows;i++){pos=n[i][checkCell];rows.push(r[pos]);if(!c.appender||!c.removeRows){l=r[pos].length;for(j=0;j<l;j++){a.tBodies[0].appendChild(r[pos][j])}}}if(c.appender){c.appender(a,rows)}if(c.debug){benchmark("Rebuilt table",appendTime)}applyWidget(a);$(a).trigger("sortEnd",a)}function computeTableHeaderCellIndexes(t){var a=[],lookup={},thead=t.getElementsByTagName('THEAD')[0],trs=thead.getElementsByTagName('TR'),i,j,k,l,c,cells,rowIndex,cellId,rowSpan,colSpan,firstAvailCol,matrixrow;for(i=0;i<trs.length;i++){cells=trs[i].cells;for(j=0;j<cells.length;j++){c=cells[j];rowIndex=c.parentNode.rowIndex;cellId=rowIndex+"-"+c.cellIndex;rowSpan=c.rowSpan||1;colSpan=c.colSpan||1;if(typeof(a[rowIndex])==="undefined"){a[rowIndex]=[]}for(k=0;k<a[rowIndex].length+1;k++){if(typeof(a[rowIndex][k])==="undefined"){firstAvailCol=k;break}}lookup[cellId]=firstAvailCol;for(k=rowIndex;k<rowIndex+rowSpan;k++){if(typeof(a[k])==="undefined"){a[k]=[]}matrixrow=a[k];for(l=firstAvailCol;l<firstAvailCol+colSpan;l++){matrixrow[l]="x"}}}}return lookup}function formatSortingOrder(v){return(/^d/i.test(v)||v===1)}function checkHeaderMetadata(a){return(($.metadata)&&($(a).metadata().sorter===false))}function checkHeaderOptions(a,i){return((a.config.headers[i])&&(a.config.headers[i].sorter===false))}function checkHeaderLocked(a,i){if((a.config.headers[i])&&(a.config.headers[i].lockedOrder!==null)){return a.config.headers[i].lockedOrder}return false}function checkHeaderOrder(a,i){if((a.config.headers[i])&&(a.config.headers[i].sortInitialOrder)){return a.config.headers[i].sortInitialOrder}return a.config.sortInitialOrder}function buildHeaders(b){var d=($.metadata)?true:false,header_index=computeTableHeaderCellIndexes(b),$th,lock,time,$tableHeaders,c=b.config;c.headerList=[];if(c.debug){time=new Date()}$tableHeaders=$(c.selectorHeaders,b).wrapInner("<div class='tablesorter-header-inner' />").each(function(a){this.column=header_index[this.parentNode.rowIndex+"-"+this.cellIndex];this.order=formatSortingOrder(checkHeaderOrder(b,a))?[1,0,2]:[0,1,2];this.count=-1;if(checkHeaderMetadata(this)||checkHeaderOptions(b,a)||$(this).hasClass('sorter-false')){this.sortDisabled=true}this.lockedOrder=false;lock=checkHeaderLocked(b,a);if(typeof(lock)!=='undefined'&&lock!==false){this.order=this.lockedOrder=formatSortingOrder(lock)?[1,1,1]:[0,0,0]}if(!this.sortDisabled){$th=$(this).addClass(c.cssHeader);if(c.onRenderHeader){c.onRenderHeader.apply($th,[a])}}c.headerList[a]=this;$(this).parent().addClass(c.cssHeader)});if(c.debug){benchmark("Built headers",time);log($tableHeaders)}return $tableHeaders}function checkCellColSpan(a,b,d){var i,cell,arr=[],r=a.tHead.rows,c=r[d].cells;for(i=0;i<c.length;i++){cell=c[i];if(cell.colSpan>1){arr=arr.concat(checkCellColSpan(a,b,d++))}else{if(a.tHead.length===1||(cell.rowSpan>1||!r[d+1])){arr.push(cell)}}}return arr}function isValueInArray(v,a){var i,l=a.length;for(i=0;i<l;i++){if(a[i][0]===v){return true}}return false}function setHeadersCss(b,c,d){var h=[],i,l,css=[b.config.cssDesc,b.config.cssAsc];c.removeClass(css[0]).removeClass(css[1]);c.each(function(a){if(!this.sortDisabled){h[this.column]=$(this)}});l=d.length;for(i=0;i<l;i++){if(d[i][1]===2){continue}h[d[i][0]].addClass(css[d[i][1]])}}function fixColumnWidth(a,b){if(a.config.widthFixed){var c=$('<colgroup>');$("tr:first td",a.tBodies[0]).each(function(){c.append($('<col>').css('width',$(this).width()))});$(a).prepend(c)}}function updateHeaderSortCount(a,b){var i,s,o,c=a.config,l=b.length;for(i=0;i<l;i++){s=b[i];o=c.headerList[s[0]];o.count=(s[1]+1)%(c.sortReset?3:2)}}function getCachedSortType(a,i){return(a)?a[i].type:''}function multisort(a,b,d){var f="var sortWrapper = function(a,b) {",col,mx=0,dir=0,tc=a.config,lc=d.normalized.length,l=b.length,sortTime,i,j,c,s,e,order,orgOrderCol;if(tc.debug){sortTime=new Date()}for(i=0;i<l;i++){c=b[i][0];order=b[i][1];s=(getCachedSortType(tc.parsers,c)==="text")?((order===0)?"sortText":"sortTextDesc"):((order===0)?"sortNumeric":"sortNumericDesc");e="e"+i;if(/Numeric/.test(s)&&tc.headers[c]&&tc.headers[c].string){for(j=0;j<lc;j++){col=Math.abs(parseFloat(d.normalized[j][c]));mx=Math.max(mx,isNaN(col)?0:col)}dir=(tc.headers[c])?tc.string[tc.headers[c].string]||0:0}f+="var "+e+" = "+s+"(a["+c+"],b["+c+"],"+mx+","+dir+"); ";f+="if ("+e+") { return "+e+"; } ";f+="else { "}orgOrderCol=(d.normalized&&d.normalized[0])?d.normalized[0].length-1:0;f+="return a["+orgOrderCol+"]-b["+orgOrderCol+"];";for(i=0;i<l;i++){f+="}; "}f+="return 0; ";f+="}; ";eval(f);d.normalized.sort(sortWrapper);if(tc.debug){benchmark("Sorting on "+b.toString()+" and dir "+order+" time",sortTime)}return d}function sortText(a,b){if(a===''){return 1}if(b===''){return-1}if(a===b){return 0}if($.data(tbl[0],"tablesorter").sortLocaleCompare){return a.localeCompare(b)}try{var c=0,ax,t,x=/^(\.)?\d/,L=Math.min(a.length,b.length)+1;while(c<L&&a.charAt(c)===b.charAt(c)&&x.test(b.substring(c))===false&&x.test(a.substring(c))===false){c++}a=a.substring(c);b=b.substring(c);if(x.test(a)||x.test(b)){if(x.test(a)===false){return(a)?1:-1}else if(x.test(b)===false){return(b)?-1:1}else{t=parseFloat(a)-parseFloat(b);if(t!==0){return t}else{t=a.search(/[^\.\d]/)}if(t===-1){t=b.search(/[^\.\d]/)}a=a.substring(t);b=b.substring(t)}}return(a>b)?1:-1}catch(er){return 0}}function sortTextDesc(a,b){if(a===''){return 1}if(b===''){return-1}if(a===b){return 0}if($.data(tbl[0],"tablesorter").sortLocaleCompare){return b.localeCompare(a)}return-sortText(a,b)}function getTextValue(a,b,d){if(b){var i,l=a.length,n=b+d;for(i=0;i<l;i++){n+=a.charCodeAt(i)}return d*n}return 0}function sortNumeric(a,b,c,d){if(a===''){return 1}if(b===''){return-1}if(isNaN(a)){a=getTextValue(a,c,d)}if(isNaN(b)){b=getTextValue(b,c,d)}return a-b}function sortNumericDesc(a,b,c,d){if(a===''){return 1}if(b===''){return-1}if(isNaN(a)){a=getTextValue(a,c,d)}if(isNaN(b)){b=getTextValue(b,c,d)}return b-a}this.construct=function(f){return this.each(function(){if(!this.tHead||this.tBodies.length===0){return}var d,$document,$headers,cache,config,shiftDown=0,sortOrder,totalRows,$cell,c,i,j,k,a,s,o;this.config={};c=config=$.extend(true,this.config,$.tablesorter.defaults,f);tbl=d=$(this).addClass(this.config.tableClass);$.data(this,"tablesorter",c);$headers=buildHeaders(this);c.parsers=buildParserCache(this,$headers);c.string={max:1,'max+':1,'max-':-1,none:0};cache=buildCache(this);fixColumnWidth(this);$headers.click(function(e){totalRows=(d[0].tBodies[0]&&d[0].tBodies[0].rows.length)||0;if(!this.sortDisabled){d.trigger("sortStart",tbl[0]);$cell=$(this);k=!e[c.sortMultiSortKey];this.count=(this.count+1)%(c.sortReset?3:2);if(c.sortRestart){i=this;$headers.each(function(){if(this!==i&&(k||!$(this).is('.'+c.cssDesc+',.'+c.cssAsc))){this.count=-1}})}i=this.column;if(k){c.sortList=[];if(c.sortForce!==null){a=c.sortForce;for(j=0;j<a.length;j++){if(a[j][0]!==i){c.sortList.push(a[j])}}}if(this.order[this.count]<2){c.sortList.push([i,this.order[this.count]])}}else{if(isValueInArray(i,c.sortList)){for(j=0;j<c.sortList.length;j++){s=c.sortList[j];o=c.headerList[s[0]];if(s[0]===i){s[1]=o.order[o.count];if(s[1]===2){c.sortList.splice(j,1);o.count=-1}}}}else{if(this.order[this.count]<2){c.sortList.push([i,this.order[this.count]])}}}if(c.sortAppend!==null){a=c.sortAppend;for(j=0;j<a.length;j++){if(a[j][0]!==i){c.sortList.push(a[j])}}}d.trigger("sortBegin",tbl[0]);setHeadersCss(d[0],$headers,c.sortList);appendToTable(d[0],multisort(d[0],c.sortList,cache));return false}}).mousedown(function(){if(c.cancelSelection){this.onselectstart=function(){return false};return false}});d.bind("update",function(){var t=this,c=t.config;$(c.selectorRemove,t.tBodies[0]).remove();t.config.parsers=buildParserCache(t,$headers);cache=buildCache(t);d.trigger("sorton",[t.config.sortList])}).bind("updateCell",function(e,a){var b=[(a.parentNode.rowIndex-1),a.cellIndex];cache.normalized[b[0]][b[1]]=c.parsers[b[1]].format(getElementText(c,a,b[1]),d,a,b[1]);c.cache=cache;d.trigger("sorton",[c.sortList])}).bind("addRows",function(e,a){var i,rows=a.filter('tr').length,dat=[],l=a[0].cells.length;for(i=0;i<rows;i++){for(j=0;j<l;j++){dat[j]=c.parsers[j].format(getElementText(c,a[i].cells[j],j),d,a[i].cells[j],j)}dat.push(cache.row.length);cache.row.push([a[i]]);cache.normalized.push(dat);dat=[]}c.cache=cache;d.trigger("sorton",[c.sortList])}).bind("sorton",function(e,a){$(this).trigger("sortStart",tbl[0]);c.sortList=a;var b=c.sortList;updateHeaderSortCount(this,b);setHeadersCss(this,$headers,b);appendToTable(this,multisort(this,b,cache))}).bind("appendCache",function(){appendToTable(this,cache)}).bind("applyWidgetId",function(e,a){getWidgetById(a).format(this)}).bind("applyWidgets",function(){applyWidget(this)});if($.metadata&&($(this).metadata()&&$(this).metadata().sortlist)){c.sortList=$(this).metadata().sortlist}applyWidget(this,true);if(c.sortList.length>0){d.trigger("sorton",[c.sortList])}else{applyWidget(this)}this.hasInitialized=true})};this.addParser=function(b){var i,l=g.length,a=true;for(i=0;i<l;i++){if(g[i].id.toLowerCase()===b.id.toLowerCase()){a=false}}if(a){g.push(b)}};this.addWidget=function(a){widgets.push(a)};this.formatFloat=function(s){if(typeof(s)!=='string'){return s}if(tbl[0].config.usNumberFormat){s=s.replace(/,/g,'')}else{s=s.replace(/[\s|\.]/g,'').replace(/,/g,'.')}var i=parseFloat(s);return isNaN(i)?$.trim(s):i};this.isDigit=function(s){return(/^[\-+]?\d*$/).test($.trim(s.replace(/[,.'\s]/g,'')))};this.clearTableBody=function(a){$(a.tBodies[0]).empty()}}})();$.fn.extend({tablesorter:$.tablesorter.construct});var m=$.tablesorter;m.addParser({id:"text",is:function(s){return true},format:function(s){return $.trim(s.toLocaleLowerCase())},type:"text"});m.addParser({id:"digit",is:function(s){return $.tablesorter.isDigit(s)},format:function(s){return $.tablesorter.formatFloat(s)},type:"numeric"});m.addParser({id:"currency",is:function(s){return(/^[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]/).test(s)},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/[^0-9,. \-]/g),""))},type:"numeric"});m.addParser({id:"ipAddress",is:function(s){return(/^\d{2,3}[\.]\d{2,3}[\.]\d{2,3}[\.]\d{2,3}$/).test(s)},format:function(s){var i,item,a=s.split("."),r="",l=a.length;for(i=0;i<l;i++){item=a[i];if(item.length===2){r+="0"+item}else{r+=item}}return $.tablesorter.formatFloat(r)},type:"numeric"});m.addParser({id:"url",is:function(s){return(/^(https?|ftp|file):\/\/$/).test(s)},format:function(s){return $.trim(s.replace(new RegExp(/(https?|ftp|file):\/\//),''))},type:"text"});m.addParser({id:"isoDate",is:function(s){return(/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/).test(s)},format:function(s){return $.tablesorter.formatFloat((s!=="")?new Date(s.replace(new RegExp(/-/g),"/")).getTime():"")},type:"numeric"});m.addParser({id:"percent",is:function(s){return(/\%$/).test($.trim(s))},format:function(s){return $.tablesorter.formatFloat(s.replace(new RegExp(/%/g),""))},type:"numeric"});m.addParser({id:"usLongDate",is:function(s){return s.match(new RegExp(/^[A-Za-z]{3,10}\.? [0-9]{1,2}, ([0-9]{4}|'?[0-9]{2}) (([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(AM|PM)))$/))},format:function(s){return $.tablesorter.formatFloat(new Date(s).getTime())},type:"numeric"});m.addParser({id:"shortDate",is:function(s){return(/\d{1,4}[\/\-\,\.\s+]\d{1,4}[\/\-\.\,\s+]\d{1,4}/).test(s)},format:function(s,a,b,d){var c=a.config,format=(c.headers&&c.headers[d])?c.headers[d].dateFormat||c.dateFormat:c.dateFormat;s=s.replace(/\s+/g," ").replace(/[\-|\.|\,|\s]/g,"/");if(format==="mmddyyyy"){s=s.replace(/(\d{1,2})\/(\d{1,2})\/(\d{4})/,"$3/$1/$2")}else if(format==="ddmmyyyy"){s=s.replace(/(\d{1,2})\/(\d{1,2})\/(\d{4})/,"$3/$2/$1")}else if(format==="yyyymmdd"){s=s.replace(/(\d{4})\/(\d{1,2})\/(\d{1,2})/,"$1/$2/$3")}return $.tablesorter.formatFloat(new Date(s).getTime())},type:"numeric"});m.addParser({id:"time",is:function(s){return(/^(([0-2]?[0-9]:[0-5][0-9])|([0-1]?[0-9]:[0-5][0-9]\s(am|pm)))$/).test(s)},format:function(s){return $.tablesorter.formatFloat(new Date("2000/01/01 "+s).getTime())},type:"numeric"});m.addParser({id:"metadata",is:function(s){return false},format:function(s,a,b){var c=a.config,p=(!c.parserMetadataName)?'sortValue':c.parserMetadataName;return $(b).metadata()[p]},type:"numeric"});m.addWidget({id:"zebra",format:function(a){var b,row=0,even,time,c=a.config,child=c.cssChildRow,css=["even","odd"];css=c.widgetZebra&&c.hasOwnProperty('css')?c.widgetZebra.css:(c.widgetOptions&&c.widgetOptions.hasOwnProperty('zebra'))?c.widgetOptions.zebra:css;if(a.config.debug){time=new Date()}$("tr:visible",a.tBodies[0]).each(function(i){b=$(this);if(!b.hasClass(child)){row++}even=(row%2===0);b.removeClass(css[even?1:0]).addClass(css[even?0:1])});if(a.config.debug){$.tablesorter.benchmark("Applying Zebra widget",time)}}})})(jQuery);
53 js/jquery.tablesorter.widgets.js
... ... @@ -1,4 +1,4 @@
1   -/*! tableSorter 2.1 widgets - updated 3/22/2012
  1 +/*! tableSorter 2.1 widgets - updated 3/26/2012
2 2 *
3 3 * jQuery UI Theme
4 4 * Column Styles
@@ -14,6 +14,9 @@
14 14 /* IE7 needs JSON library for JSON.stringify - (http://caniuse.com/#search=json)
15 15 if you need it, then include https://github.com/douglascrockford/JSON-js
16 16
  17 + $.parseJSON is not available is jQuery versions older than 1.4.1, using older
  18 + versions will only allow storing information for one page at a time
  19 +
17 20 // *** Save data (JSON format only) ***
18 21 // val must be valid JSON... use http://jsonlint.com/ to ensure it is valid
19 22 var val = { "mywidget" : "data1" }; // valid JSON uses double quotes
@@ -27,15 +30,26 @@
27 30 alert(val); // "data1" if saved, or "" if not
28 31 */
29 32 $.tablesorter.storage = function(table, key, val){
30   - var d, k, ls = false, v = {},
  33 + var d, k, o = {}, ls = false, v = {},
31 34 id = table.id || $('.tablesorter').index( $(table) ),
32 35 url = window.location.pathname;
33 36 try { ls = !!(localStorage.getItem); } catch(e) {}
  37 + // *** get val ***
  38 + if ($.parseJSON) {
  39 + if (ls) {
  40 + o = $.parseJSON(localStorage[key]) || {};
  41 + } else {
  42 + k = document.cookie.split(/[;\s|=]/); // cookie
  43 + d = $.inArray(key, k) + 1; // add one to get from the key to the value
  44 + o = (d !== 0) ? $.parseJSON(k[d]) || {} : {};
  45 + }
  46 + }
34 47 if (val && JSON && JSON.hasOwnProperty('stringify')) {
35 48 // add unique identifiers = url pathname > table ID/index on page > data
36 49 v[url] = {};
37 50 v[url][id] = {};
38 51 v[url][id] = val;
  52 + v = $.extend( o, v );
39 53 // *** set val ***
40 54 if (ls) {
41 55 localStorage[key] = JSON.stringify(v);
@@ -44,17 +58,9 @@ $.tablesorter.storage = function(table, key, val){
44 58 d.setTime(d.getTime()+(31536e+6)); // 365 days
45 59 document.cookie = key + '=' + (JSON.stringify(v)).replace(/\"/g,'\"') + '; expires=' + d.toGMTString() + '; path=/';
46 60 }
47   - } else if ($.parseJSON) {
48   - // *** get val ***
49   - if (ls) {
50   - v = $.parseJSON(localStorage[key]) || {};
51   - } else {
52   - k = document.cookie.split(/[;\s|=]/); // cookie
53   - d = $.inArray(key, k) + 1; // add one to get from the key to the value
54   - v = (d !== 0) ? $.parseJSON(k[d]) || {} : {};
55   - }
  61 + } else {
  62 + return ( o && o.hasOwnProperty(url) && o[url].hasOwnProperty(id) ) ? o[url][id] : {};
56 63 }
57   - return ( v && v.hasOwnProperty(url) && v[url].hasOwnProperty(id)) ? v[url][id] : {};
58 64 };
59 65
60 66 // Widget: jQuery UI theme
@@ -96,7 +102,7 @@ $.tablesorter.addWidget({
96 102 $t.find('span.ui-icon').removeClass(rmv + ' ui-icon');
97 103 } else {
98 104 klass = ($t.hasClass(c.cssAsc)) ? icons[1] : ($t.hasClass(c.cssDesc)) ? icons[2] : $t.hasClass(c.cssHeader) ? icons[0] : '';
99   - t = ($table.hasClass('hasStickyHeaders')) ? $table.find('tr.' + wo.stickyHeaders || 'tablesorter-stickyheader').find('th').eq(i).add($t) : $t;
  105 + t = ($table.hasClass('hasStickyHeaders')) ? $table.find('tr.' + (wo.stickyHeaders || 'tablesorter-stickyHeader')).find('th').eq(i).add($t) : $t;
100 106 t[klass === icons[0] ? 'removeClass' : 'addClass']('ui-state-active')
101 107 .find('span.ui-icon').removeClass(rmv).addClass(klass);
102 108 }
@@ -190,7 +196,7 @@ $.tablesorter.addWidget({
190 196 typeof wo.filter_childRows !== 'undefined' ? wo.filter_childRows : true)) ? cr.text() : '';
191 197 $td = $(this).find('td');
192 198 for (i=0; i < cols; i++){
193   - x = $.inArray( v[i], ($td.eq(i).text() + t).toLowerCase() );
  199 + x = ($td.eq(i).text() + t).toLowerCase().indexOf(v[i]);
194 200 if (v[i] !== '' && ( (!wo.filter_startsWith && x >= 0) || (wo.filter_startsWith && x === 0) ) ) {
195 201 r = (r) ? true : false;
196 202 } else if (v[i] !== '') {
@@ -223,14 +229,13 @@ $.tablesorter.addWidget({
223 229 win = $(window),
224 230 header = $(table).find('thead'),
225 231 hdrCells = header.find('tr').children(),
226   - css = wo.stickyHeaders || 'tablesorter-stickyheader',
  232 + css = wo.stickyHeaders || 'tablesorter-stickyHeader',
227 233 firstCell = hdrCells.eq(0),
228   - brdr = parseInt(firstCell.css('border-left-width'),10),
229 234 sticky = header.find('tr.tablesorter-header').clone()
230 235 .removeClass('tablesorter-header')
231 236 .addClass(css)
232 237 .css({
233   - width : header.outerWidth() + brdr,
  238 + width : header.outerWidth(true),
234 239 position : 'fixed',
235 240 left : firstCell.offset().left,
236 241 margin : 0,
@@ -239,7 +244,7 @@ $.tablesorter.addWidget({
239 244 zIndex : 10
240 245 }),
241 246 stkyCells = sticky.children(),
242   - laststate;
  247 + laststate = '';
243 248 // update sticky header class names to match real header after sorting
244 249 $table.bind('sortEnd', function(e,t){
245 250 var th = $(t).find('thead tr'),
@@ -254,8 +259,6 @@ $.tablesorter.addWidget({
254 259 hdrCells.each(function(i){
255 260 var t = $(this),
256 261 s = stkyCells.eq(i)
257   - // set cell widths
258   - .width( t.width() + brdr )
259 262 // clicking on sticky will trigger sort
260 263 .bind('click', function(e){
261 264 t.trigger(e);
@@ -264,7 +267,9 @@ $.tablesorter.addWidget({
264 267 .bind('mousedown', function(){
265 268 this.onselectstart = function(){ return false; };
266 269 return false;
267   - });
  270 + })
  271 + // set cell widths
  272 + .find('.tablesorter-header-inner').width( t.find('.tablesorter-header-inner').width() );
268 273 });
269 274 header.prepend( sticky );
270 275 // make it sticky!
@@ -286,10 +291,10 @@ $.tablesorter.addWidget({
286 291 .resize(function(){
287 292 sticky.css({
288 293 left : firstCell.offset().left - win.scrollLeft(),
289   - width: header.outerWidth() + brdr
  294 + width: header.outerWidth()
290 295 });
291   - stkyCells.each(function(i){
292   - $(this).width( hdrCells.eq(i).width() + brdr );
  296 + stkyCells.find('.tablesorter-header-inner').each(function(i){
  297 + $(this).width( hdrCells.eq(i).find('.tablesorter-header-inner').width() );
293 298 });
294 299 });
295 300 }
16 js/jquery.tablesorter.widgets.min.js
... ... @@ -1,10 +1,10 @@
1   -/*! tableSorter 2.1 widgets - updated 3/22/2012 */
  1 +/*! tableSorter 2.1 widgets - updated 3/26/2012 */
2 2 (function(b){
3   -b.tablesorter.storage=function(a,e,c){var d,f=!1;d={};var a=a.id||b(".tablesorter").index(b(a)),g=window.location.pathname;try{f=!!localStorage.getItem}catch(j){}c&&JSON&&JSON.hasOwnProperty("stringify")?(d[g]={},d[g][a]={},d[g][a]=c,f?localStorage[e]=JSON.stringify(d):(c=new Date,c.setTime(c.getTime()+31536E6),document.cookie=e+"="+JSON.stringify(d).replace(/\"/g,'"')+"; expires="+c.toGMTString()+"; path=/")):b.parseJSON&&(f?d=b.parseJSON(localStorage[e])||{}:(d=document.cookie.split(/[;\s|=]/), c=b.inArray(e,d)+1,d=0!==c?b.parseJSON(d[c])||{}:{}));return d&&d.hasOwnProperty(g)&&d[g].hasOwnProperty(a)?d[g][a]:{}};
4   -b.tablesorter.addWidget({id:"uitheme",format:function(a){var e,c,d,f,g,j=b(a),i=a.config,h=i.widgetOptions,k=["ui-icon-arrowthick-2-n-s","ui-icon-arrowthick-1-s","ui-icon-arrowthick-1-n"],k=i.widgetUitheme&&i.widgetUitheme.hasOwnProperty("css")?i.widgetUitheme.css||k:h&&h.hasOwnProperty("uitheme")?h.uitheme:k;d=k.join(" ");i.debug&&(e=new Date);j.hasClass("ui-theme")||(j.addClass("ui-widget ui-widget-content ui-corner-all ui-theme"), b.each(i.headerList,function(){b(this).addClass("ui-widget-header ui-corner-all ui-state-default").append('<span class="ui-icon"/>').wrapInner('<div class="tablesorter-inner"/>').hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")})}));b.each(i.headerList,function(a){f=b(this);if(this.sortDisabled)f.find("span.ui-icon").removeClass(d+" ui-icon");else{c=f.hasClass(i.cssAsc)?k[1]:f.hasClass(i.cssDesc)?k[2]:f.hasClass(i.cssHeader)?k[0]:"";g=j.hasClass("hasStickyHeaders")? j.find("tr."+h.stickyHeaders||"tablesorter-stickyheader").find("th").eq(a).add(f):f;g[c===k[0]?"removeClass":"addClass"]("ui-state-active").find("span.ui-icon").removeClass(d).addClass(c)}});i.debug&&b.tablesorter.benchmark("Applying uitheme widget",e)}});
5   -b.tablesorter.addWidget({id:"columns",format:function(a){var e,c,d,f,g=a.config,j=g.sortList,i=j.length,h=["primary","secondary","tertiary"],h=g.widgetColumns&&g.widgetColumns.hasOwnProperty("css")?g.widgetColumns.css||h:g.widgetOptions&&g.widgetOptions.hasOwnProperty("columns")? g.widgetOptions.columns||h:h;d=h.length-1;f=h.join(" ");g.debug&&(c=new Date);j&&j[0]?b("tr:visible",a.tBodies[0]).each(function(a){e=b(this).children().removeClass(f);e.eq(j[0][0]).addClass(h[0]);if(1<i)for(a=1;a<i;a++)e.eq(j[a][0]).addClass(h[a]||h[d])}):b("td",a.tBodies[0]).removeClass(f);g.debug&&b.tablesorter.benchmark("Applying Columns widget",c)}});
6   -b.tablesorter.addWidget({id:"filter",format:function(a){if(!b(a).hasClass("hasFilters")){var e,c,d,f,g,j,i,h=a.config,k=h.widgetOptions,l=k.filter_cssFilter|| "tablesorter-filter",m=h.headerList.length,n=b(a).addClass("hasFilters"),a='<tr class="'+l+'">',o;h.debug&&(o=new Date);for(e=0;e<m;e++)a+='<td><input type="search" data-col="'+e+'" class="'+l,a+=h.headers[e]&&h.headers[e].hasOwnProperty("filter")&&!1===h.headers[e].filter||b(h.headerList[e]).is(".filter-false")?' disabled" disabled':'"',a+="></td>";n.find("thead").append(a+="</tr>").find("input."+l).bind("keyup search",function(){c=n.find("thead").find("input."+l).map(function(){return(b(this).val()|| "").toLowerCase()}).get();""===c.join("")?n.find("tr").show():n.find("tbody").find("tr:not(."+h.cssChildRow+")").each(function(){d=!0;j=b(this).nextUntil("tr:not(."+h.cssChildRow+")");f=j.length&&(k&&k.hasOwnProperty("filter_childRows")&&"undefined"!==typeof k.filter_childRows?k.filter_childRows:1)?j.text():"";i=b(this).find("td");for(e=0;e<m;e++)g=b.inArray(c[e],(i.eq(e).text()+f).toLowerCase()),""!==c[e]&&(!k.filter_startsWith&&0<=g||k.filter_startsWith&&0===g)?d=d?!0:!1:""!==c[e]&&(d=!1);b(this)[d? "show":"hide"]();if(j.length)j[d?"show":"hide"]()});n.trigger("applyWidgets")});h.debug&&b.tablesorter.benchmark("Applying Filter widget",o)}}});
7   -b.tablesorter.addWidget({id:"stickyHeaders",format:function(a){if(!b(a).hasClass("hasStickyHeaders")){var e=b(a).addClass("hasStickyHeaders"),c=a.config.widgetOptions,d=b(window),f=b(a).find("thead"),g=f.find("tr").children(),j=c.stickyHeaders||"tablesorter-stickyheader",i=g.eq(0),h=parseInt(i.css("border-left-width"),10),k=f.find("tr.tablesorter-header").clone().removeClass("tablesorter-header").addClass(j).css({width:f.outerWidth(!0)+ h,position:"fixed",left:i.offset().left,margin:0,top:0,visibility:"hidden",zIndex:10}),l=k.children(),m;e.bind("sortEnd",function(a,c){var d=b(c).find("thead tr"),e=d.filter("."+j).children();d.filter(":not(."+j+")").children().each(function(a){e.eq(a).attr("class",b(this).attr("class"))})}).bind("pagerComplete",function(){d.resize()});g.each(function(a){var c=b(this);l.eq(a).width(c.width()+h).bind("click",function(b){c.trigger(b)}).bind("mousedown",function(){this.onselectstart=function(){return!1}; return!1})});f.prepend(k);d.scroll(function(){var b=i.offset(),a=d.scrollTop(),a=a>b.top&&a<b.top+e.find("tbody").height()?"visible":"hidden";k.css({left:b.left-d.scrollLeft(),visibility:a});a!==m&&(d.resize(),m=a)}).resize(function(){k.css({left:i.offset().left-d.scrollLeft(),width:f.outerWidth()+h});l.each(function(a){b(this).width(g.eq(a).width()+h)})})}}});
8   -b.tablesorter.addWidget({id:"resizable",format:function(a){if(!b(a).hasClass("hasResizable")){b(a).addClass("hasResizable");var e,c,d=a.config, f=b(d.headerList).filter(":gt(0)"),g=0,j=null,i=null,h=function(){g=0;j=i=null;b(window).trigger("resize")};if(c=b.tablesorter.storage?b.tablesorter.storage(a,"tablesorter-resizable"):"")for(e in c)!isNaN(e)&&e<d.headerList.length&&b(d.headerList[e]).width(c[e]);f.each(function(){b(this).append('<div class="tablesorter-resizer" style="cursor:w-resize;position:absolute;height:100%;width:20px;left:-20px;top:0;z-index:1;"></div>').wrapInner('<div style="position:relative;height:100%;width:100%"></div>')}).bind("mousemove", function(a){if(0!==g&&j){var b=a.pageX-g;j.width()<-b||i&&i.width()<=b||(i.width(i.width()+b),g=a.pageX)}}).bind("mouseup",function(){c&&b.tablesorter.storage&&j&&(c[i.index()]=i.width(),b.tablesorter.storage(a,"tablesorter-resizable",c));h();return!1}).find(".tablesorter-resizer").bind("mousedown",function(a){j=b(a.target).closest("th");i=j.prev();g=a.pageX});b(a).find("thead").bind("mouseup mouseleave",function(){h()})}}});
9   -b.tablesorter.addWidget({id:"saveSort",init:function(a,b,c){c.format(a,!0)}, format:function(a,e){var c,d,f=a.config;c={sortList:f.sortList};f.debug&&(d=new Date);b(a).hasClass("hasSaveSort")?a.hasInitialized&&b.tablesorter.storage&&(b.tablesorter.storage(a,"tablesorter-savesort",c),f.debug&&b.tablesorter.benchmark("saveSort widget: Saving last sort: "+f.sortList,d)):(b(a).addClass("hasSaveSort"),c="",b.tablesorter.storage&&(c=(c=b.tablesorter.storage(a,"tablesorter-savesort"))&&c.hasOwnProperty("sortList")&&b.isArray(c.sortList)?c.sortList:"",f.debug&&b.tablesorter.benchmark("saveSort: Last sort loaded: "+ c,d)),e&&c&&0<c.length?f.sortList=c:a.hasInitialized&&c&&0<c.length&&b(a).trigger("sorton",[c]))}})
  3 +b.tablesorter.storage=function(a,e,d){var c,i;c={};var j=!1,g={},a=a.id||b(".tablesorter").index(b(a)),f=window.location.pathname;try{j=!!localStorage.getItem}catch(h){}b.parseJSON&&(j?c=b.parseJSON(localStorage[e])||{}:(i=document.cookie.split(/[;\s|=]/),c=b.inArray(e,i)+1,c=0!==c?b.parseJSON(i[c])||{}:{}));if(d&&JSON&&JSON.hasOwnProperty("stringify"))g[f]={},g[f][a]={},g[f][a]=d,g=b.extend(c,g),j?localStorage[e]=JSON.stringify(g):(c=new Date,c.setTime(c.getTime()+31536E6),document.cookie= e+"="+JSON.stringify(g).replace(/\"/g,'"')+"; expires="+c.toGMTString()+"; path=/");else return c&&c.hasOwnProperty(f)&&c[f].hasOwnProperty(a)?c[f][a]:{}};
  4 +b.tablesorter.addWidget({id:"uitheme",format:function(a){var e,d,c,i,j,g=b(a),f=a.config,h=f.widgetOptions,k=["ui-icon-arrowthick-2-n-s","ui-icon-arrowthick-1-s","ui-icon-arrowthick-1-n"],k=f.widgetUitheme&&f.widgetUitheme.hasOwnProperty("css")?f.widgetUitheme.css||k:h&&h.hasOwnProperty("uitheme")?h.uitheme:k;c=k.join(" ");f.debug&&(e=new Date); g.hasClass("ui-theme")||(g.addClass("ui-widget ui-widget-content ui-corner-all ui-theme"),b.each(f.headerList,function(){b(this).addClass("ui-widget-header ui-corner-all ui-state-default").append('<span class="ui-icon"/>').wrapInner('<div class="tablesorter-inner"/>').hover(function(){b(this).addClass("ui-state-hover")},function(){b(this).removeClass("ui-state-hover")})}));b.each(f.headerList,function(a){i=b(this);if(this.sortDisabled)i.find("span.ui-icon").removeClass(c+" ui-icon");else{d=i.hasClass(f.cssAsc)? k[1]:i.hasClass(f.cssDesc)?k[2]:i.hasClass(f.cssHeader)?k[0]:"";j=g.hasClass("hasStickyHeaders")?g.find("tr."+(h.stickyHeaders||"tablesorter-stickyHeader")).find("th").eq(a).add(i):i;j[d===k[0]?"removeClass":"addClass"]("ui-state-active").find("span.ui-icon").removeClass(c).addClass(d)}});f.debug&&b.tablesorter.benchmark("Applying uitheme widget",e)}});
  5 +b.tablesorter.addWidget({id:"columns",format:function(a){var e,d,c,i,j=a.config,g=j.sortList,f=g.length,h=["primary","secondary","tertiary"],h=j.widgetColumns&& j.widgetColumns.hasOwnProperty("css")?j.widgetColumns.css||h:j.widgetOptions&&j.widgetOptions.hasOwnProperty("columns")?j.widgetOptions.columns||h:h;c=h.length-1;i=h.join(" ");j.debug&&(d=new Date);g&&g[0]?b("tr:visible",a.tBodies[0]).each(function(a){e=b(this).children().removeClass(i);e.eq(g[0][0]).addClass(h[0]);if(1<f)for(a=1;a<f;a++)e.eq(g[a][0]).addClass(h[a]||h[c])}):b("td",a.tBodies[0]).removeClass(i);j.debug&&b.tablesorter.benchmark("Applying Columns widget",d)}});
  6 +b.tablesorter.addWidget({id:"filter", format:function(a){if(!b(a).hasClass("hasFilters")){var e,d,c,i,j,g,f,h=a.config,k=h.widgetOptions,l=k.filter_cssFilter||"tablesorter-filter",n=h.headerList.length,m=b(a).addClass("hasFilters"),a='<tr class="'+l+'">',o;h.debug&&(o=new Date);for(e=0;e<n;e++)a+='<td><input type="search" data-col="'+e+'" class="'+l,a+=h.headers[e]&&h.headers[e].hasOwnProperty("filter")&&!1===h.headers[e].filter||b(h.headerList[e]).is(".filter-false")?' disabled" disabled':'"',a+="></td>";m.find("thead").append(a+="</tr>").find("input."+ l).bind("keyup search",function(){d=m.find("thead").find("input."+l).map(function(){return(b(this).val()||"").toLowerCase()}).get();""===d.join("")?m.find("tr").show():m.find("tbody").find("tr:not(."+h.cssChildRow+")").each(function(){c=!0;g=b(this).nextUntil("tr:not(."+h.cssChildRow+")");i=g.length&&(k&&k.hasOwnProperty("filter_childRows")&&"undefined"!==typeof k.filter_childRows?k.filter_childRows:1)?g.text():"";f=b(this).find("td");for(e=0;e<n;e++)j=(f.eq(e).text()+i).toLowerCase().indexOf(d[e]), ""!==d[e]&&(!k.filter_startsWith&&0<=j||k.filter_startsWith&&0===j)?c=c?!0:!1:""!==d[e]&&(c=!1);b(this)[c?"show":"hide"]();if(g.length)g[c?"show":"hide"]()});m.trigger("applyWidgets")});h.debug&&b.tablesorter.benchmark("Applying Filter widget",o)}}});
  7 +b.tablesorter.addWidget({id:"stickyHeaders",format:function(a){if(!b(a).hasClass("hasStickyHeaders")){var e=b(a).addClass("hasStickyHeaders"),d=a.config.widgetOptions,c=b(window),i=b(a).find("thead"),j=i.find("tr").children(),g=d.stickyHeaders||"tablesorter-stickyHeader", f=j.eq(0),h=i.find("tr.tablesorter-header").clone().removeClass("tablesorter-header").addClass(g).css({width:i.outerWidth(!0),position:"fixed",left:f.offset().left,margin:0,top:0,visibility:"hidden",zIndex:10}),k=h.children(),l="";e.bind("sortEnd",function(a,c){var d=b(c).find("thead tr"),e=d.filter("."+g).children();d.filter(":not(."+g+")").children().each(function(a){e.eq(a).attr("class",b(this).attr("class"))})}).bind("pagerComplete",function(){c.resize()});j.each(function(a){var c=b(this);k.eq(a).bind("click", function(b){c.trigger(b)}).bind("mousedown",function(){this.onselectstart=function(){return!1};return!1}).find(".tablesorter-header-inner").width(c.find(".tablesorter-header-inner").width())});i.prepend(h);c.scroll(function(){var b=f.offset(),a=c.scrollTop(),a=a>b.top&&a<b.top+e.find("tbody").height()?"visible":"hidden";h.css({left:b.left-c.scrollLeft(),visibility:a});a!==l&&(c.resize(),l=a)}).resize(function(){h.css({left:f.offset().left-c.scrollLeft(),width:i.outerWidth()});k.find(".tablesorter-header-inner").each(function(a){b(this).width(j.eq(a).find(".tablesorter-header-inner").width())})})}}});
  8 +b.tablesorter.addWidget({id:"resizable",format:function(a){if(!b(a).hasClass("hasResizable")){b(a).addClass("hasResizable");var e,d,c=a.config,i=b(c.headerList).filter(":gt(0)"),j=0,g=null,f=null,h=function(){j=0;g=f=null;b(window).trigger("resize")};if(d=b.tablesorter.storage?b.tablesorter.storage(a,"tablesorter-resizable"):"")for(e in d)!isNaN(e)&&e<c.headerList.length&&b(c.headerList[e]).width(d[e]);i.each(function(){b(this).append('<div class="tablesorter-resizer" style="cursor:w-resize;position:absolute;height:100%;width:20px;left:-20px;top:0;z-index:1;"></div>').wrapInner('<div style="position:relative;height:100%;width:100%"></div>')}).bind("mousemove", function(a){if(0!==j&&g){var b=a.pageX-j;g.width()<-b||f&&f.width()<=b||(f.width(f.width()+b),j=a.pageX)}}).bind("mouseup",function(){d&&b.tablesorter.storage&&g&&(d[f.index()]=f.width(),b.tablesorter.storage(a,"tablesorter-resizable",d));h();return!1}).find(".tablesorter-resizer").bind("mousedown",function(a){g=b(a.target).closest("th");f=g.prev();j=a.pageX});b(a).find("thead").bind("mouseup mouseleave",function(){h()})}}});
  9 +b.tablesorter.addWidget({id:"saveSort",init:function(a,b,d){d.format(a,!0)}, format:function(a,e){var d,c,i=a.config;d={sortList:i.sortList};i.debug&&(c=new Date);b(a).hasClass("hasSaveSort")?a.hasInitialized&&b.tablesorter.storage&&(b.tablesorter.storage(a,"tablesorter-savesort",d),i.debug&&b.tablesorter.benchmark("saveSort widget: Saving last sort: "+i.sortList,c)):(b(a).addClass("hasSaveSort"),d="",b.tablesorter.storage&&(d=(d=b.tablesorter.storage(a,"tablesorter-savesort"))&&d.hasOwnProperty("sortList")&&b.isArray(d.sortList)?d.sortList:"",i.debug&&b.tablesorter.benchmark("saveSort: Last sort loaded: "+ d,c)),e&&d&&0<d.length?i.sortList=d:a.hasInitialized&&d&&0<d.length&&b(a).trigger("sorton",[d]))}})
10 10 })(jQuery);
2  package.json
... ... @@ -1,6 +1,6 @@
1 1 {
2 2 "name": "tablesorter",
3   - "version": "2.1.6",
  3 + "version": "2.1.7",
4 4 "title": "tablesorter",
5 5 "author": {
6 6 "name": "Christian Bach",

0 comments on commit ac26e94

Please sign in to comment.
Something went wrong with that request. Please try again.