diff --git a/.gitignore b/.gitignore index 37d00333..4fa9ca09 100644 --- a/.gitignore +++ b/.gitignore @@ -139,7 +139,6 @@ Desktop.ini # Packages *.egg *.egg-info -dist build eggs parts diff --git a/Gruntfile.js b/Gruntfile.js index 32423c57..42de3085 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -74,8 +74,8 @@ module.exports = function( grunt ) { build: { src: [ 'dist/**/**/**/*', 'dist/**/**/*', 'dist/**/*', 'dist' ] }, - cleancss: { - src: [ 'dist/temp/*', 'dist/temp', 'dist/css/*.css', '!dist/css/*.min.css' ] + css: { + src: [ 'dist/css/*.css', '!dist/css/*.min.css' ] } }, @@ -96,10 +96,7 @@ module.exports = function( grunt ) { dot: true, flatten: true, src: ['css/*.css', 'addons/pager/*.css'], - dest: 'dist/temp/', - rename: function(dest, src) { - return dest + src.replace( /\./g, '+' ).replace( /\+css/g, '.css' ); - } + dest: 'dist/css/' }] }, less: { @@ -113,18 +110,6 @@ module.exports = function( grunt ) { flatten: true, src: [ 'addons/pager/icons/*', 'css/images/*' ], dest: 'dist/css/images/' - }, - fixnames: { - files : [{ - expand: true, - dot: true, - flatten: true, - src: ['dist/temp/*.css'], - dest: 'dist/css/', - rename: function(dest, src) { - return dest + src.replace( /\+/g, '.' ); - } - }] } }, @@ -186,23 +171,21 @@ module.exports = function( grunt ) { report: 'gzip' }, allFiles: { - files: [ - { - expand: true, - cwd: './js/', // Src matches are relative to this path. - src: [ - '*.js', - '**/*.js', - '!_test-*.js', - '!**/_test-*.js', - '!*.min.js', - '!**/semver.js' - ], - dest: 'dist/js/', - ext: '.min.js', // Dist files will have this extension. - extDot: 'last' // Extensions in filenames begin after the first dot - } - ] + files: [{ + expand: true, + cwd: './js/', // Src matches are relative to this path. + src: [ + '*.js', + '**/*.js', + '!_test-*.js', + '!**/_test-*.js', + '!*.min.js', + '!**/semver.js' + ], + dest: 'dist/js/', + ext: '.min.js', // Dist files will have this extension. + extDot: 'last' // Extensions in filenames begin after the first dot + }] }, pageraddon: { files: { @@ -216,10 +199,11 @@ module.exports = function( grunt ) { files: [{ expand: true, flatten: true, - cwd: 'dist/temp', + cwd: 'dist/css', src: ['*.css'], - dest: 'dist/temp', - ext: '.min.css' + dest: 'dist/css', + ext: '.min.css', + extDot: 'last' }] } }, @@ -253,24 +237,14 @@ module.exports = function( grunt ) { grunt.registerTask( 'test', [ 'jshint', 'qunit' ] ); - /* grunt-contrib-cssmin does not work with multiple periods in the file name. - * see https://github.com/gruntjs/grunt-contrib-cssmin/issues/175 - * Css files are copied to 'dist/temp' folder & '.' are replaced with '+'. - * Css files are minified & copied to 'dist/css'. - * 'dist/temp' is deleted. - */ tasks = [ 'clean:build', - 'copy:main', - 'copy:css', - 'copy:less', - 'copy:images', + 'copy', 'concat', 'jshint', 'uglify', 'cssmin', - 'copy:fixnames', - 'clean:cleancss', + 'clean:css', 'updateManifest' ]; @@ -296,7 +270,7 @@ module.exports = function( grunt ) { temp = temp.widgets.split(/\s+/); } } catch (err) { - grunt.log.error('Custom build json not found - Use "grunt custom:{filename}" (no .json ending)'); + grunt.log.error('Custom build json not found - Use "grunt custom:{filename}"'); temp = defaults.standardWidgets; } diff --git a/dist/css/dragtable.mod.min.css b/dist/css/dragtable.mod.min.css new file mode 100644 index 00000000..56d2f42e --- /dev/null +++ b/dist/css/dragtable.mod.min.css @@ -0,0 +1 @@ +.dragtable-sortable{list-style-type:none;margin:0;padding:0;-moz-user-select:none;z-index:10}.dragtable-sortable li{margin:0;padding:0;float:left;font-size:1em}.dragtable-sortable table{margin-top:0}.dragtable-sortable td,.dragtable-sortable th{border-left:0}.dragtable-sortable li:first-child td,.dragtable-sortable li:first-child th{border-left:1px solid #CCC}.ui-sortable-helper{opacity:.7;filter:alpha(opacity=70)}.ui-sortable-placeholder{-moz-box-shadow:4px 5px 4px rgba(0,0,0,.2) inset;-webkit-box-shadow:4px 5px 4px rgba(0,0,0,.2) inset;box-shadow:4px 5px 4px rgba(0,0,0,.2) inset;border-bottom:1px solid rgba(0,0,0,.2);border-top:1px solid rgba(0,0,0,.2);visibility:visible!important;background:#EFEFEF}.ui-sortable-placeholder *{opacity:0;visibility:hidden}.table-handle,.table-handle-disabled{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyIiBoZWlnaHQ9IjEzIj48cmVjdCBzdHlsZT0iZmlsbDojMzMzO2ZpbGwtb3BhY2l0eTouODsiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHg9IjEiIHk9IjIiLz4JPHJlY3Qgc3R5bGU9ImZpbGw6IzMzMztmaWxsLW9wYWNpdHk6Ljg7IiB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4PSIxIiB5PSI0Ii8+CTxyZWN0IHN0eWxlPSJmaWxsOiMzMzM7ZmlsbC1vcGFjaXR5Oi44OyIgd2lkdGg9IjEiIGhlaWdodD0iMSIgeD0iMSIgeT0iNiIvPjxyZWN0IHN0eWxlPSJmaWxsOiMzMzM7ZmlsbC1vcGFjaXR5Oi44OyIgd2lkdGg9IjEiIGhlaWdodD0iMSIgeD0iMSIgeT0iOCIvPjxyZWN0IHN0eWxlPSJmaWxsOiMzMzM7ZmlsbC1vcGFjaXR5Oi44OyIgd2lkdGg9IjEiIGhlaWdodD0iMSIgeD0iMSIgeT0iMTAiLz48L3N2Zz4=);background-repeat:repeat-x;height:13px;margin:0 1px;cursor:move}.table-handle-disabled{opacity:0;cursor:not-allowed}.dragtable-sortable table{margin-bottom:0} \ No newline at end of file diff --git a/dist/css/filter.formatter.min.css b/dist/css/filter.formatter.min.css new file mode 100644 index 00000000..6f6b5cbd --- /dev/null +++ b/dist/css/filter.formatter.min.css @@ -0,0 +1 @@ +.tablesorter .tablesorter-filter-row td{text-align:center;font-size:.9em;font-weight:400}.tablesorter .ui-slider,.tablesorter input.range{width:90%;margin:2px auto;font-size:.8em}.tablesorter .ui-slider{top:12px}.tablesorter .ui-slider .ui-slider-handle{width:.9em;height:.9em}.tablesorter .ui-datepicker{font-size:.8em}.tablesorter .ui-slider-horizontal{height:.5em}.tablesorter .value-popup:after{content:attr(data-value);position:absolute;bottom:14px;left:-7px;min-width:18px;height:12px;background-color:#444;background-image:-webkit-gradient(linear,left top,left bottom,from(#444),to(#999));background-image:-webkit-linear-gradient(top,#444,#999);background-image:-moz-linear-gradient(top,#444,#999);background-image:-o-linear-gradient(top,#444,#999);background-image:linear-gradient(to bottom,#444,#999);-webkit-border-radius:3px;border-radius:3px;-webkit-background-clip:padding-box;background-clip:padding-box;-webkit-box-shadow:0 0 4px 0 #777;box-shadow:0 0 4px 0 #777;border:1px solid #444;color:#fff;font:1em/1.1em Arial,Sans-Serif;padding:1px;text-align:center}.tablesorter .value-popup:before{content:"";position:absolute;width:0;height:0;border-top:8px solid #777;border-left:8px solid transparent;border-right:8px solid transparent;top:-8px;left:50%;margin-left:-8px;margin-top:-1px}.tablesorter .dateFrom,.tablesorter .dateTo{width:80px;margin:2px 5px}.tablesorter .button{width:14px;height:14px;background:#fcfff4;background:-webkit-linear-gradient(top,#fcfff4 0,#dfe5d7 40%,#b3bead 100%);background:-moz-linear-gradient(top,#fcfff4 0,#dfe5d7 40%,#b3bead 100%);background:-o-linear-gradient(top,#fcfff4 0,#dfe5d7 40%,#b3bead 100%);background:-ms-linear-gradient(top,#fcfff4 0,#dfe5d7 40%,#b3bead 100%);background:linear-gradient(top,#fcfff4 0,#dfe5d7 40%,#b3bead 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fcfff4', endColorstr='#b3bead', GradientType=0);margin:1px 5px 1px 1px;-webkit-border-radius:25px;-moz-border-radius:25px;border-radius:25px;-webkit-box-shadow:inset 0 1px 1px #fff,0 1px 3px rgba(0,0,0,.5);-moz-box-shadow:inset 0 1px 1px #fff,0 1px 3px rgba(0,0,0,.5);box-shadow:inset 0 1px 1px #fff,0 1px 3px rgba(0,0,0,.5);position:relative;top:3px;display:inline-block}.tablesorter .button label{cursor:pointer;position:absolute;width:10px;height:10px;-webkit-border-radius:25px;-moz-border-radius:25px;border-radius:25px;left:2px;top:2px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.5),0 1px 0 rgba(255,255,255,1);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,.5),0 1px 0 rgba(255,255,255,1);box-shadow:inset 0 1px 1px rgba(0,0,0,.5),0 1px 0 rgba(255,255,255,1);background:#45484d;background:-webkit-linear-gradient(top,#222 0,#45484d 100%);background:-moz-linear-gradient(top,#222 0,#45484d 100%);background:-o-linear-gradient(top,#222 0,#45484d 100%);background:-ms-linear-gradient(top,#222 0,#45484d 100%);background:linear-gradient(top,#222 0,#45484d 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#222', endColorstr='#45484d', GradientType=0)}.tablesorter .button label:after{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";filter:alpha(opacity=0);opacity:0;content:'';position:absolute;width:8px;height:8px;background:#55f;background:-webkit-linear-gradient(top,#aaf 0,#55f 100%);background:-moz-linear-gradient(top,#aaf 0,#55f 100%);background:-o-linear-gradient(top,#aaf 0,#55f 100%);background:-ms-linear-gradient(top,#aaf 0,#55f 100%);background:linear-gradient(top,#aaf 0,#55f 100%);-webkit-border-radius:25px;-moz-border-radius:25px;border-radius:25px;top:1px;left:1px;-webkit-box-shadow:inset 0 1px 1px #fff,0 1px 3px rgba(0,0,0,.5);-moz-box-shadow:inset 0 1px 1px #fff,0 1px 3px rgba(0,0,0,.5);box-shadow:inset 0 1px 1px #fff,0 1px 3px rgba(0,0,0,.5)}.tablesorter .button label:hover::after{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=30)";filter:alpha(opacity=30);opacity:.3}.tablesorter .button input[type=checkbox]{visibility:hidden}.tablesorter .button input[type=checkbox]:checked+label:after{-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";filter:alpha(opacity=100);opacity:1}.tablesorter .colorpicker{width:30px;height:18px}.tablesorter .ui-spinner-input{width:100px;height:18px}.tablesorter .currentColor,.tablesorter .ui-spinner,.tablesorter input.number{position:relative}.tablesorter .tablesorter-filter-row.hideme td *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0;filter:alpha(opacity=0)} \ No newline at end of file diff --git a/dist/css/images/black-asc.gif b/dist/css/images/black-asc.gif new file mode 100644 index 00000000..730533fa Binary files /dev/null and b/dist/css/images/black-asc.gif differ diff --git a/dist/css/images/black-desc.gif b/dist/css/images/black-desc.gif new file mode 100644 index 00000000..4c3b6102 Binary files /dev/null and b/dist/css/images/black-desc.gif differ diff --git a/dist/css/images/black-unsorted.gif b/dist/css/images/black-unsorted.gif new file mode 100644 index 00000000..5647f658 Binary files /dev/null and b/dist/css/images/black-unsorted.gif differ diff --git a/dist/css/images/bootstrap-black-unsorted.png b/dist/css/images/bootstrap-black-unsorted.png new file mode 100644 index 00000000..4e161a65 Binary files /dev/null and b/dist/css/images/bootstrap-black-unsorted.png differ diff --git a/dist/css/images/bootstrap-white-unsorted.png b/dist/css/images/bootstrap-white-unsorted.png new file mode 100644 index 00000000..fb227a15 Binary files /dev/null and b/dist/css/images/bootstrap-white-unsorted.png differ diff --git a/dist/css/images/dragtable-handle.png b/dist/css/images/dragtable-handle.png new file mode 100644 index 00000000..ff64a7d5 Binary files /dev/null and b/dist/css/images/dragtable-handle.png differ diff --git a/dist/css/images/dragtable-handle.svg b/dist/css/images/dragtable-handle.svg new file mode 100644 index 00000000..041ec1de --- /dev/null +++ b/dist/css/images/dragtable-handle.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/dist/css/images/dropbox-asc-hovered.png b/dist/css/images/dropbox-asc-hovered.png new file mode 100644 index 00000000..bc45223f Binary files /dev/null and b/dist/css/images/dropbox-asc-hovered.png differ diff --git a/dist/css/images/dropbox-asc.png b/dist/css/images/dropbox-asc.png new file mode 100644 index 00000000..0d6ee150 Binary files /dev/null and b/dist/css/images/dropbox-asc.png differ diff --git a/dist/css/images/dropbox-desc-hovered.png b/dist/css/images/dropbox-desc-hovered.png new file mode 100644 index 00000000..49309420 Binary files /dev/null and b/dist/css/images/dropbox-desc-hovered.png differ diff --git a/dist/css/images/dropbox-desc.png b/dist/css/images/dropbox-desc.png new file mode 100644 index 00000000..0bce65a0 Binary files /dev/null and b/dist/css/images/dropbox-desc.png differ diff --git a/dist/css/images/first.png b/dist/css/images/first.png new file mode 100644 index 00000000..6f11fcb0 Binary files /dev/null and b/dist/css/images/first.png differ diff --git a/dist/css/images/green-asc.gif b/dist/css/images/green-asc.gif new file mode 100644 index 00000000..4cfba095 Binary files /dev/null and b/dist/css/images/green-asc.gif differ diff --git a/dist/css/images/green-desc.gif b/dist/css/images/green-desc.gif new file mode 100644 index 00000000..4f881765 Binary files /dev/null and b/dist/css/images/green-desc.gif differ diff --git a/dist/css/images/green-header.gif b/dist/css/images/green-header.gif new file mode 100644 index 00000000..cc746b70 Binary files /dev/null and b/dist/css/images/green-header.gif differ diff --git a/dist/css/images/green-unsorted.gif b/dist/css/images/green-unsorted.gif new file mode 100644 index 00000000..0afe2c02 Binary files /dev/null and b/dist/css/images/green-unsorted.gif differ diff --git a/dist/css/images/ice-asc.gif b/dist/css/images/ice-asc.gif new file mode 100644 index 00000000..0961d9aa Binary files /dev/null and b/dist/css/images/ice-asc.gif differ diff --git a/dist/css/images/ice-desc.gif b/dist/css/images/ice-desc.gif new file mode 100644 index 00000000..0330fcca Binary files /dev/null and b/dist/css/images/ice-desc.gif differ diff --git a/dist/css/images/ice-unsorted.gif b/dist/css/images/ice-unsorted.gif new file mode 100644 index 00000000..c1afde55 Binary files /dev/null and b/dist/css/images/ice-unsorted.gif differ diff --git a/dist/css/images/last.png b/dist/css/images/last.png new file mode 100644 index 00000000..72079357 Binary files /dev/null and b/dist/css/images/last.png differ diff --git a/dist/css/images/loading.gif b/dist/css/images/loading.gif new file mode 100644 index 00000000..72054717 Binary files /dev/null and b/dist/css/images/loading.gif differ diff --git a/dist/css/images/metro-black-asc.png b/dist/css/images/metro-black-asc.png new file mode 100644 index 00000000..f7a781be Binary files /dev/null and b/dist/css/images/metro-black-asc.png differ diff --git a/dist/css/images/metro-black-desc.png b/dist/css/images/metro-black-desc.png new file mode 100644 index 00000000..ef5f48e0 Binary files /dev/null and b/dist/css/images/metro-black-desc.png differ diff --git a/dist/css/images/metro-loading.gif b/dist/css/images/metro-loading.gif new file mode 100644 index 00000000..ae274c6c Binary files /dev/null and b/dist/css/images/metro-loading.gif differ diff --git a/dist/css/images/metro-unsorted.png b/dist/css/images/metro-unsorted.png new file mode 100644 index 00000000..653b0834 Binary files /dev/null and b/dist/css/images/metro-unsorted.png differ diff --git a/dist/css/images/metro-white-asc.png b/dist/css/images/metro-white-asc.png new file mode 100644 index 00000000..63327188 Binary files /dev/null and b/dist/css/images/metro-white-asc.png differ diff --git a/dist/css/images/metro-white-desc.png b/dist/css/images/metro-white-desc.png new file mode 100644 index 00000000..ca7c363e Binary files /dev/null and b/dist/css/images/metro-white-desc.png differ diff --git a/dist/css/images/next.png b/dist/css/images/next.png new file mode 100644 index 00000000..4a2f9d4e Binary files /dev/null and b/dist/css/images/next.png differ diff --git a/dist/css/images/prev.png b/dist/css/images/prev.png new file mode 100644 index 00000000..15d1584b Binary files /dev/null and b/dist/css/images/prev.png differ diff --git a/dist/css/images/white-asc.gif b/dist/css/images/white-asc.gif new file mode 100644 index 00000000..2173b0a0 Binary files /dev/null and b/dist/css/images/white-asc.gif differ diff --git a/dist/css/images/white-desc.gif b/dist/css/images/white-desc.gif new file mode 100644 index 00000000..7109c3ea Binary files /dev/null and b/dist/css/images/white-desc.gif differ diff --git a/dist/css/images/white-unsorted.gif b/dist/css/images/white-unsorted.gif new file mode 100644 index 00000000..9bfc3459 Binary files /dev/null and b/dist/css/images/white-unsorted.gif differ diff --git a/dist/css/jquery.tablesorter.pager.min.css b/dist/css/jquery.tablesorter.pager.min.css new file mode 100644 index 00000000..9d87fe3f --- /dev/null +++ b/dist/css/jquery.tablesorter.pager.min.css @@ -0,0 +1 @@ +.tablesorter-pager{padding:5px}td.tablesorter-pager{background-color:#e6eeee;margin:0}.tablesorter-pager img{vertical-align:middle;margin-right:2px;cursor:pointer}.tablesorter-pager .pagedisplay{padding:0 5px;width:auto;white-space:nowrap;text-align:center}.tablesorter-pager select{margin:0;padding:0}.tablesorter-pager.disabled{display:none}.tablesorter-pager .disabled{opacity:.5;filter:alpha(opacity=50);cursor:default} \ No newline at end of file diff --git a/dist/css/less/bootstrap.less b/dist/css/less/bootstrap.less new file mode 100644 index 00000000..01a5eb85 --- /dev/null +++ b/dist/css/less/bootstrap.less @@ -0,0 +1,319 @@ +/* Tablesorter Custom Bootstrap LESS Theme by Rob Garrison + +To create your own theme, modify the code below and run it through +a LESS compiler, like this one: http://leafo.net/lessphp/editor.html +or download less.js from http://lesscss.org/ + +Test out these custom less files live + Basic Theme : http://codepen.io/Mottie/pen/eqBbn + Bootstrap : http://codepen.io/Mottie/pen/Ltzpi + Metro Style : http://codepen.io/Mottie/pen/gCslk + +*/ + +/*** theme ***/ +@theme : tablesorter-bootstrap; + +/*** fonts ***/ +@tableHeaderFont : 14px bold Arial, Sans-serif; +@tableBodyFont : 14px "Helvetica Neue", Helvetica, Arial, sans-serif; + +/*** color definitions ***/ +/* for best results, only change the hue (240), + leave the saturation (60%) and luminosity (80%) alone + pick the color from here: http://hslpicker.com/#99E699 */ +@headerBackground : hsl(240, 60%, 80%); +@borderAndBackground : #cdcdcd; +@overallBorder : @borderAndBackground 1px solid; +@headerTextColor : #000; + +@bodyBackground : #fff; +@bodyTextColor : #000; + +@headerAsc : darken(spin(@headerBackground, 5), 10%); /* darken(@headerBackground, 10%); */ +@headerDesc : lighten(spin(@headerBackground, -5), 10%); /* desaturate(@headerAsc, 5%); */ + +@captionBackground : #fff; /* it might be best to match the document body background color here */ +@errorBackground : #e6bf99; /* ajax error message (added to thead) */ + +@filterCellBackground : #eee; +@filterElementTextColor: #333; +@filterElementBkgd : #fff; +@filterElementBorder : 1px solid #bbb; +@filterTransitionTime : 0.1s; +@filterRowHiddenHeight : 4px; /* becomes height using padding (so it's divided by 2) */ + +@overallPadding : 4px; +/* 20px should be slightly wider than the icon width to avoid overlap */ +@headerPadding : 4px 20px 4px 4px; +@headerMargin : 0 0 18px; + +/* url(icons/loading.gif); */ +@processingIcon : url('data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs='); + +/* zebra striping */ +.allRows { + background: @bodyBackground; + color: @bodyTextColor; +} +.evenRows { + background: lighten(@headerBackground, 35%); +} +.oddRows { + background: lighten(@headerBackground, 18%); +} + +/* hovered rows */ +.oddHovered { + background: desaturate(@headerBackground, 60%); +} +.evenHovered { + background: lighten( desaturate(@headerBackground, 60%), 10% ); +} + +/* Columns widget */ +@primaryOdd : spin(@headerBackground, 10); /* saturate( darken( desaturate(@headerBackground, 10%), 10% ), 30%); */ +@primaryEven : lighten( @primaryOdd, 10% ); +@secondaryOdd : @primaryEven; +@secondaryEven : lighten( @primaryEven, 5% ); +@tertiaryOdd : @secondaryEven; +@tertiaryEven : lighten( @secondaryEven, 5% ); + +/* Filter widget transition */ +.filterWidgetTransition { + -webkit-transition: line-height @filterTransitionTime ease; + -moz-transition: line-height @filterTransitionTime ease; + -o-transition: line-height @filterTransitionTime ease; + transition: line-height @filterTransitionTime ease; +} + +/*** icon block ***/ +.iconPosition { + font-size: 11px; + position: absolute; + right: 2px; + top: 50%; + margin-top: -7px; /* half the icon height; older IE doesn't like this */ + width: 14px; + height: 14px; + background-repeat: no-repeat; + line-height: 14px; +} + +/* black */ +@unsortedBlack : url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOCAMAAADOvxanAAAAVFBMVEUAAABCQkJZWVkZGRnJyckgICAZGRkZGRn8/PweHh4dHR0aGhoaGhpUVFQbGxvQ0NDc3NxMTExSUlIbGxvr6+s4ODhKSkogICAtLS00NDQzMzMnJydSEPrQAAAAGHRSTlMA1ssZRLgdAQbDyisqsZo8QdXUq0r9xPepSRwiAAAAX0lEQVQI13XHSQKAIAwEwQAKxn13Ev7/T2Pu9qmarJKPXIicI4PH4hxaKNrhm2S8bJK5h4YzKHrzJNtK6yYT/TdXzpS5zuYg4MSQYF6i4IHExdw1UVRi05HPrrvT53a+qyMFC9t04gcAAAAASUVORK5CYII=); + +/* white */ +@unsortedWhite : url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOBAMAAAALT/umAAAAKlBMVEUAAAD///////////////////////////////////////////////////+Gu8ovAAAADXRSTlMA4EXKBtQqvR0+sxmalc142gAAAFdJREFUCNdjYGDoamAAAjZbMxCVfvd6AgMDd+3du9UMDKx3hWSvMjBwXZww8RYDGuC53NB8h4GB8a617UUGBs7Yu3cjGRhYVO9eVQFKOskKOQApFmUgBwBZ+xXRTttNdAAAAABJRU5ErkJggg==); + +/* automatically choose the correct arrow/text color */ +.headerText (@a) when (lightness(@a) >= 50%) { + color: @headerTextColor; +} +.headerText (@a) when (lightness(@a) < 50%) { + color: lighten(@headerTextColor, 90%); +} +.unsorted (@a) when (lightness(@a) >= 50%) { + background-image: @unsortedBlack; + color: @headerTextColor; +} +.unsorted (@a) when (lightness(@a) < 50%) { + background-image: @unsortedWhite; + color: lighten(@headerTextColor, 90%); +} + +/* variable theme name - requires less.js 1.3+; + or just replace (!".@{theme}") with the contents of @theme +*/ +.@{theme} { + font: @tableBodyFont; + background-color: @borderAndBackground; + width: 100%; + + /* style th's outside of the thead */ + th, thead td { + font: @tableHeaderFont; + font-weight: bold; + background-color: @headerBackground; + .headerText(@headerBackground); + border-collapse: collapse; + margin: @headerMargin; + padding: @overallPadding; + } + + tbody td, tfoot th, tfoot td { + padding: @overallPadding; + vertical-align: top; + } + + /* style header */ + .tablesorter-header { + cursor: pointer; + } + + .tablesorter-header-inner { + position: relative; + padding: @headerPadding; + } + + /* bootstrap uses for icons */ + .tablesorter-header-inner i.tablesorter-icon { + .iconPosition + } + + .tablesorter-header.sorter-false { + background-image: none; + cursor: default; + + } + + .tablesorter-headerAsc { + background-color: @headerAsc; + } + + .tablesorter-headerDesc { + background-color: @headerDesc; + } + + .bootstrap-icon-unsorted { + .unsorted(@headerBackground); + } + + + /* tfoot */ + tfoot .tablesorter-headerAsc, + tfoot .tablesorter-headerDesc { + /* remove sort arrows from footer */ + background-image: none; + } + + /* optional disabled input styling */ + .disabled { + opacity: 0.5; + filter: alpha(opacity=50); + cursor: not-allowed; + } + + /* body */ + tbody { + + td { + .allRows; + padding: @overallPadding; + vertical-align: top; + } + + /* Zebra Widget - row alternating colors */ + tr.odd > td { + .oddRows; + } + tr.even > td { + .evenRows; + } + + } + + /* hovered row colors + you'll need to add additional lines for + rows with more than 2 child rows + */ + tbody > tr:hover td, + tbody > tr:hover + tr.tablesorter-childRow > td, + tbody > tr:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td, + tbody > tr.even:hover > td, + tbody > tr.even:hover + tr.tablesorter-childRow > td, + tbody > tr.even:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td { + .evenHovered; + } + tbody > tr.odd:hover > td, + tbody > tr.odd:hover + tr.tablesorter-childRow > td, + tbody > tr.odd:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td { + .oddHovered; + } + + /* table processing indicator - indeterminate spinner */ + .tablesorter-processing { + background-image: @processingIcon; + background-position: center center; + background-repeat: no-repeat; + } + + /* Column Widget - column sort colors */ + tr.odd td.primary { + background-color: @primaryOdd; + } + td.primary, tr.even td.primary { + background-color: @primaryEven; + } + tr.odd td.secondary { + background-color: @secondaryOdd; + } + td.secondary, tr.even td.secondary { + background-color: @secondaryEven; + } + tr.odd td.tertiary { + background-color: @tertiaryOdd; + } + td.tertiary, tr.even td.tertiary { + background-color: @tertiaryEven; + } + + /* caption (non-theme matching) */ + caption { + background: @captionBackground ; + } + + /* filter widget */ + .tablesorter-filter-row input, + .tablesorter-filter-row select{ + width: 98%; + margin: 0; + padding: @overallPadding; + color: @filterElementTextColor; + background: @filterElementBkgd; + border: @filterElementBorder; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + .filterWidgetTransition; + } + .tablesorter-filter-row { + background: @filterCellBackground; + } + .tablesorter-filter-row td { + text-align: center; + background: @filterCellBackground; + line-height: normal; + text-align: center; /* center the input */ + .filterWidgetTransition; + } + /* hidden filter row */ + .tablesorter-filter-row.hideme td { + padding: @filterRowHiddenHeight / 2; + margin: 0; + line-height: 0; + cursor: pointer; + } + .tablesorter-filter-row.hideme * { + height: 1px; + min-height: 0; + border: 0; + padding: 0; + margin: 0; + /* don't use visibility: hidden because it disables tabbing */ + opacity: 0; + filter: alpha(opacity=0); + } + /* rows hidden by filtering (needed for child rows) */ + .filtered { + display: none; + } + + /* ajax error row */ + .tablesorter-errorRow td { + text-align: center; + cursor: pointer; + background-color: @errorBackground; + } + +} diff --git a/dist/css/less/metro.less b/dist/css/less/metro.less new file mode 100644 index 00000000..63543b34 --- /dev/null +++ b/dist/css/less/metro.less @@ -0,0 +1,354 @@ +/* Tablesorter Custom Metro LESS Theme by Rob Garrison + +To create your own theme, modify the code below and run it through +a LESS compiler, like this one: http://leafo.net/lessphp/editor.html +or download less.js from http://lesscss.org/ + +Test out these custom less files live + Basic Theme : http://codepen.io/Mottie/pen/eqBbn + Bootstrap : http://codepen.io/Mottie/pen/Ltzpi + Metro Style : http://codepen.io/Mottie/pen/gCslk + +*/ + +/*** theme ***/ +@theme : tablesorter-metro; + +/*** fonts ***/ +@tableHeaderFont : 14px 'Segoe UI Semilight', 'Open Sans', Verdana, Arial, Helvetica, sans-serif; +@tableBodyFont : 14px 'Segoe UI Semilight', 'Open Sans', Verdana, Arial, Helvetica, sans-serif; + +/*** color definitions ***/ +/* for best results, only change the hue (120), + leave the saturation (60%) and luminosity (75%) alone + pick the color from here: http://hslpicker.com/#825a2b + + Inspired by http://www.jtable.org/ metro themes: + Blue: hsl(212, 86%, 35%) + Brown hsl(32, 50%, 30%) + Crimson hsl(0, 100%, 38%) + Dark Grey hsl(0, 0%, 27%) + Dark Orange hsl(13, 70%, 51%) + Green hsl(120, 100%, 32%) + Light Gray hsl(0, 0%, 44%) + Pink hsl(297, 100%, 33%) + Purple hsl(257, 51%, 48%) + Red hsl(5, 100%, 40%) + + */ +@headerBackground : hsl(32, 50%, 30%); +@borderAndBackground : #cdcdcd; +@headerTextColor : #eee; + +@bodyBackground : #fff; +@bodyTextColor : #000; + +@captionBackground : #fff; /* it might be best to match the document body background color here */ +@errorBackground : #e6bf99; /* ajax error message (added to thead) */ + +@filterCellBackground : #eee; +@filterElementTextColor: #333; +@filterElementBkgd : #fff; +@filterElementBorder : 1px solid #bbb; +@filterTransitionTime : 0.1s; +@filterRowHiddenHeight : 4px; /* becomes height using padding (so it's divided by 2) */ + +@overallPadding : 4px; +/* 20px should be slightly wider than the icon width to avoid overlap */ +@headerPadding : 4px 20px 4px 4px; + +/* url(icons/loading.gif); */ +@processingIcon : url('data:image/gif;base64,R0lGODlhEAAQAPIAAP///1VVVdbW1oCAgFVVVZaWlqurq7a2tiH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAADMwi63P4wyklrE2MIOggZnAdOmGYJRbExwroUmcG2LmDEwnHQLVsYOd2mBzkYDAdKa+dIAAAh+QQJCgAAACwAAAAAEAAQAAADNAi63P5OjCEgG4QMu7DmikRxQlFUYDEZIGBMRVsaqHwctXXf7WEYB4Ag1xjihkMZsiUkKhIAIfkECQoAAAAsAAAAABAAEAAAAzYIujIjK8pByJDMlFYvBoVjHA70GU7xSUJhmKtwHPAKzLO9HMaoKwJZ7Rf8AYPDDzKpZBqfvwQAIfkECQoAAAAsAAAAABAAEAAAAzMIumIlK8oyhpHsnFZfhYumCYUhDAQxRIdhHBGqRoKw0R8DYlJd8z0fMDgsGo/IpHI5TAAAIfkECQoAAAAsAAAAABAAEAAAAzIIunInK0rnZBTwGPNMgQwmdsNgXGJUlIWEuR5oWUIpz8pAEAMe6TwfwyYsGo/IpFKSAAAh+QQJCgAAACwAAAAAEAAQAAADMwi6IMKQORfjdOe82p4wGccc4CEuQradylesojEMBgsUc2G7sDX3lQGBMLAJibufbSlKAAAh+QQJCgAAACwAAAAAEAAQAAADMgi63P7wCRHZnFVdmgHu2nFwlWCI3WGc3TSWhUFGxTAUkGCbtgENBMJAEJsxgMLWzpEAACH5BAkKAAAALAAAAAAQABAAAAMyCLrc/jDKSatlQtScKdceCAjDII7HcQ4EMTCpyrCuUBjCYRgHVtqlAiB1YhiCnlsRkAAAOwAAAAAAAAAAAA=='); + +/* zebra striping */ +.allRows { + background: @bodyBackground; + color: @bodyTextColor; +} +.evenRows { + background: lighten( desaturate(@headerBackground, 80%), 70%); + color: @bodyTextColor; +} +.oddRows { + background: lighten( desaturate(@headerBackground, 80%), 50%); +} + +/* hovered rows */ +.oddHovered { + background: lighten( desaturate(@headerBackground, 50%), 40%); + color: @bodyTextColor; +} +.evenHovered { + background: lighten( desaturate(@headerBackground, 50%), 30%); + color: @bodyTextColor; +} + +/* Columns widget */ +@primaryOdd : lighten( spin(@headerBackground, 10), 40%); +@primaryEven : lighten( @primaryOdd, 8% ); +@secondaryOdd : @primaryEven; +@secondaryEven : lighten( @primaryEven, 8% ); +@tertiaryOdd : @secondaryEven; +@tertiaryEven : lighten( @secondaryEven, 8% ); + +/* Filter widget transition */ +.filterWidgetTransition { + -webkit-transition: line-height @filterTransitionTime ease; + -moz-transition: line-height @filterTransitionTime ease; + -o-transition: line-height @filterTransitionTime ease; + transition: line-height @filterTransitionTime ease; +} + +/*** Arrows ***/ +@arrowPosition : right 5px center; + +/* black */ +@unsortedBlack : url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABt0UjBAAAACnRSTlMAMwsqXt+gIBUGxGoDMAAAAFlJREFUCNctzC0SQAAUReEzGNQ3AlHRiSRZFCVZYgeswRL8hLdK7834wj3tAlGP6y7fYHpKS6w6WwbVG0I1NZVnZPG8/DYxOYlnhUYkA06R1s9ESsxR4NIdPhkPFDFYuEnMAAAAAElFTkSuQmCC); +@sortAscBlack : url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABt0UjBAAAACnRSTlMAMwsqXt+gIBUGxGoDMAAAAFlJREFUCNctzC0SQAAUReEzGNQ3AlHRiSRZFCVZYgeswRL8hLdK7834wj3tAlGP6y7fYHpKS6w6WwbVG0I1NZVnZPG8/DYxOYlnhUYkA06R1s9ESsxR4NIdPhkPFDFYuEnMAAAAAElFTkSuQmCC); +@sortDescBlack : url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAALVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADBoCg+AAAADnRSTlMAMiweCQITTvDctZZqaTlM310AAABcSURBVAjXY2BgYEtgAAFHERDJqigUAKSYBQUNgFSioKAYAwOLIBA4MASBKFUGQxAlzAAF+94BwWuGKBC1lIFl3rt3Lx0YGCzevWsGSjK9e6cAUlT3HKyW9wADAwDRrBiDy6bKzwAAAABJRU5ErkJggg==); + +/* white */ +@unsortedWhite : url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAElBMVEUAAADu7u7u7u7u7u7u7u7u7u7yb344AAAABnRSTlMAMhIHKyAHBrhHAAAATElEQVQI12NgYGBSYAABQ2Ew5SgCIlkFBQOAlKKgoBADA7MgEBgwsIAoB4ZAECXKAAFQHkg9WIejoCBIv4mgoDOQYgZpAxkDNARqEQBTkAYuMZEHPgAAAABJRU5ErkJggg==); +@sortAscWhite : url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAHlBMVEUAAADu7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u4+jEeEAAAACXRSTlMAMwkqFV7roCD4hW+/AAAAWUlEQVQI1y3MrQ5AABSG4Xd+Rj0jiDabjKZxB6qqaarGNRh27tY5myd8b/uAeML1l2+wPqUlUd0ss+oNoZqG2rOwe15+p5iC1HNAK5IBlUjnZyIlZsxx0QAfzokSZgp96u4AAAAASUVORK5CYII=); +@sortDescWhite : url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAJ1BMVEUAAADu7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u4RJgHSAAAADHRSTlMAMiweCQITaU7olrlu2HdvAAAAXElEQVQI12NgYGBLYAABRxEQyaooFACkmAUFDYBUoqCgGAMDiyAQODAEgShVBkMQJcwABWvOAMEphmgQtZWBZc6ZMycdGBhszpw5DJRkOnNGAaSo5wRYLXsBAwMAi4YWQHRX4F0AAAAASUVORK5CYII=); + +/* automatically choose the correct arrow/text color */ +.headerText (@a) when (lightness(@a) >= 50%) { + color: @headerTextColor; +} +.headerText (@a) when (lightness(@a) < 50%) { + color: lighten(@headerTextColor, 90%); +} +.unsorted (@a) when (lightness(@a) >= 50%) { + background-image: @unsortedBlack; +} +.unsorted (@a) when (lightness(@a) < 50%) { + background-image: @unsortedWhite; +} +.sortAsc (@a) when (lightness(@a) >= 50%) { + background-image: @sortAscBlack; +} +.sortAsc (@a) when (lightness(@a) < 50%) { + background-image: @sortAscWhite; +} +.sortDesc (@a) when (lightness(@a) >= 50%) { + background-image: @sortDescBlack; +} +.sortDesc (@a) when (lightness(@a) < 50%) { + background-image: @sortDescWhite; +} + +/* variable theme name - requires less.js 1.3+; + or just replace (!".@{theme}") with the contents of @theme +*/ +.@{theme} { + font: @tableBodyFont; + background-color: @borderAndBackground; + margin: 10px 0 15px; + width: 100%; + text-align: left; + border-spacing: 0; + border: 0; + + th, td { + border: 0; + } + + /* style th's outside of the thead */ + th, thead td { + font: @tableHeaderFont; + font-weight: bold; + background-color: @headerBackground; + color: @headerTextColor; + .headerText(@headerBackground); + border-collapse: collapse; + padding: @overallPadding; + } + + .dark-row th, .dark-row td, caption.dark-row { + background-color: darken( @headerBackground, 10% ); + } + + tbody td, tfoot th, tfoot td { + padding: @overallPadding; + vertical-align: top; + } + + /* style header */ + .tablesorter-header { + .unsorted(@headerBackground); + background-repeat: no-repeat; + background-position: @arrowPosition; + cursor: pointer; + white-space: normal; + } + + .tablesorter-header-inner { + padding: @headerPadding; + } + + .tablesorter-header.sorter-false { + background-image: none; + cursor: default; + padding: @overallPadding; + } + + .tablesorter-headerAsc { + .sortAsc(@headerBackground); + } + + .tablesorter-headerDesc { + .sortDesc(@headerBackground); + } + + /* tfoot */ + tfoot .tablesorter-headerAsc, + tfoot .tablesorter-headerDesc { + /* remove sort arrows from footer */ + background-image: none; + } + + /* optional disabled input styling */ + .disabled { + opacity: 0.5; + filter: alpha(opacity=50); + cursor: not-allowed; + } + + /* body */ + tbody { + + td { + .allRows; + padding: @overallPadding; + vertical-align: top; + } + + /* Zebra Widget - row alternating colors */ + tr.odd > td { + .oddRows; + } + tr.even > td { + .evenRows; + } + + } + + /* hovered row colors + you'll need to add additional lines for + rows with more than 2 child rows + */ + tbody > tr:hover td, + tbody > tr:hover + tr.tablesorter-childRow > td, + tbody > tr:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td, + tbody > tr.even:hover > td, + tbody > tr.even:hover + tr.tablesorter-childRow > td, + tbody > tr.even:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td { + .evenHovered; + } + tbody > tr.odd:hover > td, + tbody > tr.odd:hover + tr.tablesorter-childRow > td, + tbody > tr.odd:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td { + .oddHovered; + } + + /* table processing indicator - indeterminate spinner */ + .tablesorter-processing { + background-image: @processingIcon; + background-position: center center; + background-repeat: no-repeat; + } + + /* pager */ + div.tablesorter-pager { + button { + background-color: lighten( @headerBackground, 7% ); + color: @headerTextColor; + border: lighten( @headerBackground, 15% ) 1px solid; + cursor: pointer; + } + button:hover { + background-color: lighten( @headerBackground, 15% ); + } + } + + /* Column Widget - column sort colors */ + tr.odd td.primary { + background-color: @primaryOdd; + } + td.primary, tr.even td.primary { + background-color: @primaryEven; + } + tr.odd td.secondary { + background-color: @secondaryOdd; + } + td.secondary, tr.even td.secondary { + background-color: @secondaryEven; + } + tr.odd td.tertiary { + background-color: @tertiaryOdd; + } + td.tertiary, tr.even td.tertiary { + background-color: @tertiaryEven; + } + + /* caption (non-theme matching) */ + caption { + background: @captionBackground ; + } + + /* filter widget */ + .tablesorter-filter-row input, + .tablesorter-filter-row select{ + width: 98%; + height: auto; + margin: 0; + padding: @overallPadding; + color: @filterElementTextColor; + background: @filterElementBkgd; + border: @filterElementBorder; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + .filterWidgetTransition; + } + .tablesorter-filter-row { + background: @filterCellBackground; + } + .tablesorter-filter-row td { + text-align: center; + background: @filterCellBackground; + line-height: normal; + text-align: center; /* center the input */ + .filterWidgetTransition; + } + /* hidden filter row */ + .tablesorter-filter-row.hideme td { + padding: @filterRowHiddenHeight / 2; + margin: 0; + line-height: 0; + cursor: pointer; + } + .tablesorter-filter-row.hideme * { + height: 1px; + min-height: 0; + border: 0; + padding: 0; + margin: 0; + /* don't use visibility: hidden because it disables tabbing */ + opacity: 0; + filter: alpha(opacity=0); + } + /* rows hidden by filtering (needed for child rows) */ + .filtered { + display: none; + } + + /* ajax error row */ + .tablesorter-errorRow td { + text-align: center; + cursor: pointer; + background-color: @errorBackground; + } + +} diff --git a/dist/css/less/theme.less b/dist/css/less/theme.less new file mode 100644 index 00000000..021c66d9 --- /dev/null +++ b/dist/css/less/theme.less @@ -0,0 +1,326 @@ +/* Tablesorter Custom LESS Theme by Rob Garrison + + To create your own theme, modify the code below and run it through + a LESS compiler, like this one: http://leafo.net/lessphp/editor.html + or download less.js from http://lesscss.org/ + +Test out these custom less files live + Basic Theme : http://codepen.io/Mottie/pen/eqBbn + Bootstrap : http://codepen.io/Mottie/pen/Ltzpi + Metro Style : http://codepen.io/Mottie/pen/gCslk + + */ + +/*** theme ***/ +@theme : tablesorter-custom; + +/*** fonts ***/ +@tableHeaderFont : 11px 'trebuchet ms', verdana, arial; +@tableBodyFont : 11px 'trebuchet ms', verdana, arial; + +/*** color definitions ***/ +/* for best results, only change the hue (120), + leave the saturation (60%) and luminosity (75%) alone + pick the color from here: http://hslpicker.com/#99E699 */ +@headerBackground : hsl(120, 60%, 75%); +@borderAndBackground : #cdcdcd; +@overallBorder : @borderAndBackground 1px solid; +@headerTextColor : #000; + +@bodyBackground : #fff; +@bodyTextColor : #000; + +@headerAsc : darken(spin(@headerBackground, 5), 10%); /* darken(@headerBackground, 10%); */ +@headerDesc : lighten(spin(@headerBackground, -5), 10%); /* desaturate(@headerAsc, 5%); */ + +@captionBackground : #fff; /* it might be best to match the document body background color here */ +@errorBackground : #e6bf99; /* ajax error message (added to thead) */ + +@filterCellBackground : #eee; +@filterElementTextColor: #333; +@filterElementBkgd : #fff; +@filterElementBorder : 1px solid #bbb; +@filterTransitionTime : 0.1s; +@filterRowHiddenHeight : 4px; /* becomes height using padding (so it's divided by 2) */ + +@overallPadding : 4px; +/* 20px should be slightly wider than the icon width to avoid overlap */ +@headerPadding : 4px 20px 4px 4px; + +/* url(icons/loading.gif); */ +@processingIcon : url('data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs='); + +/* zebra striping */ +.allRows { + background: @bodyBackground; + color: @bodyTextColor; +} +.evenRows { + background: lighten(@headerBackground, 40%); + color: @bodyTextColor; +} +.oddRows { + background: lighten(@headerBackground, 20%); +} + +/* hovered rows */ +.oddHovered { + background: desaturate(@headerBackground, 60%); + color: @bodyTextColor; +} +.evenHovered { + background: lighten( desaturate(@headerBackground, 60%), 10% ); + color: @bodyTextColor; +} + +/* Columns widget */ +@primaryOdd : spin(@headerBackground, 10); /* saturate( darken( desaturate(@headerBackground, 10%), 10% ), 30%); */ +@primaryEven : lighten( @primaryOdd, 10% ); +@secondaryOdd : @primaryEven; +@secondaryEven : lighten( @primaryEven, 5% ); +@tertiaryOdd : @secondaryEven; +@tertiaryEven : lighten( @secondaryEven, 5% ); + +/* Filter widget transition */ +.filterWidgetTransition { + -webkit-transition: line-height @filterTransitionTime ease; + -moz-transition: line-height @filterTransitionTime ease; + -o-transition: line-height @filterTransitionTime ease; + transition: line-height @filterTransitionTime ease; +} + +/*** Arrows ***/ +@arrowPosition : right 5px center; + +/* black */ +@unsortedBlack : url(data:image/gif;base64,R0lGODlhFQAJAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==); +@sortAscBlack : url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7); +@sortDescBlack : url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7); + +/* white */ +@unsortedWhite : url(data:image/gif;base64,R0lGODlhFQAJAIAAAP///////yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==); +@sortAscWhite : url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7); +@sortDescWhite : url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7); + +/* automatically choose the correct arrow/text color */ +.headerText (@a) when (lightness(@a) >= 50%) { + color: @headerTextColor; +} +.headerText (@a) when (lightness(@a) < 50%) { + color: lighten(@headerTextColor, 90%); +} +.unsorted (@a) when (lightness(@a) >= 50%) { + background-image: @unsortedBlack; +} +.unsorted (@a) when (lightness(@a) < 50%) { + background-image: @unsortedWhite; +} +.sortAsc (@a) when (lightness(@a) >= 50%) { + background-image: @sortAscBlack; +} +.sortAsc (@a) when (lightness(@a) < 50%) { + background-image: @sortAscWhite; +} +.sortDesc (@a) when (lightness(@a) >= 50%) { + background-image: @sortDescBlack; +} +.sortDesc (@a) when (lightness(@a) < 50%) { + background-image: @sortDescWhite; +} + +/* variable theme name - requires less.js 1.3+; + or just replace (!".@{theme}") with the contents of @theme + */ +.@{theme} { + font: @tableBodyFont; + background-color: @borderAndBackground; + margin: 10px 0 15px; + width: 100%; + text-align: left; + border-spacing: 0; + border: @overallBorder; + border-width: 1px 0 0 1px; + + th, td { + border: @overallBorder; + border-width: 0 1px 1px 0; + } + + /* style th's outside of the thead */ + th, thead td { + font: @tableHeaderFont; + font-weight: bold; + background-color: @headerBackground; + .headerText(@headerBackground); + border-collapse: collapse; + padding: @overallPadding; + } + + tbody td, tfoot th, tfoot td { + padding: @overallPadding; + vertical-align: top; + } + + /* style header */ + .tablesorter-header { + .unsorted(@headerBackground); + background-repeat: no-repeat; + background-position: @arrowPosition; + padding: @headerPadding; + cursor: pointer; + } + + .tablesorter-header.sorter-false { + background-image: none; + cursor: default; + padding: @overallPadding; + } + + .tablesorter-headerAsc { + background-color: @headerAsc; + .sortAsc(@headerBackground); + } + + .tablesorter-headerDesc { + background-color: @headerDesc; + .sortDesc(@headerBackground); + } + + /* tfoot */ + tfoot .tablesorter-headerAsc, + tfoot .tablesorter-headerDesc { + /* remove sort arrows from footer */ + background-image: none; + } + + /* optional disabled input styling */ + .disabled { + opacity: 0.5; + filter: alpha(opacity=50); + cursor: not-allowed; + } + + /* body */ + tbody { + + td { + .allRows; + padding: @overallPadding; + vertical-align: top; + } + + /* Zebra Widget - row alternating colors */ + tr.odd > td { + .oddRows; + } + tr.even > td { + .evenRows; + } + + } + + /* hovered row colors + you'll need to add additional lines for + rows with more than 2 child rows + */ + tbody > tr:hover td, + tbody > tr:hover + tr.tablesorter-childRow > td, + tbody > tr:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td, + tbody > tr.even:hover > td, + tbody > tr.even:hover + tr.tablesorter-childRow > td, + tbody > tr.even:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td { + .evenHovered; + } + tbody > tr.odd:hover > td, + tbody > tr.odd:hover + tr.tablesorter-childRow > td, + tbody > tr.odd:hover + tr.tablesorter-childRow + tr.tablesorter-childRow > td { + .oddHovered; + } + + /* table processing indicator - indeterminate spinner */ + .tablesorter-processing { + background-image: @processingIcon; + background-position: center center; + background-repeat: no-repeat; + } + + /* Column Widget - column sort colors */ + tr.odd td.primary { + background-color: @primaryOdd; + } + td.primary, tr.even td.primary { + background-color: @primaryEven; + } + tr.odd td.secondary { + background-color: @secondaryOdd; + } + td.secondary, tr.even td.secondary { + background-color: @secondaryEven; + } + tr.odd td.tertiary { + background-color: @tertiaryOdd; + } + td.tertiary, tr.even td.tertiary { + background-color: @tertiaryEven; + } + + /* caption (non-theme matching) */ + caption { + background: @captionBackground ; + } + + /* filter widget */ + .tablesorter-filter-row input, + .tablesorter-filter-row select { + width: 98%; + height: auto; + margin: 0; + padding: @overallPadding; + color: @filterElementTextColor; + background: @filterElementBkgd; + border: @filterElementBorder; + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + .filterWidgetTransition; + } + .tablesorter-filter-row { + background: @filterCellBackground; + } + .tablesorter-filter-row td { + text-align: center; + background: @filterCellBackground; + line-height: normal; + text-align: center; /* center the input */ + .filterWidgetTransition; + } + /* hidden filter row */ + .tablesorter-filter-row.hideme td { + padding: @filterRowHiddenHeight / 2; + margin: 0; + line-height: 0; + cursor: pointer; + } + .tablesorter-filter-row.hideme * { + height: 1px; + min-height: 0; + border: 0; + padding: 0; + margin: 0; + /* don't use visibility: hidden because it disables tabbing */ + opacity: 0; + filter: alpha(opacity=0); + } + /* rows hidden by filtering (needed for child rows) */ + .filtered { + display: none; + } + + /* ajax error row */ + .tablesorter-errorRow td { + text-align: center; + cursor: pointer; + background-color: @errorBackground; + } + +} diff --git a/dist/css/theme.black-ice.min.css b/dist/css/theme.black-ice.min.css new file mode 100644 index 00000000..075ab522 --- /dev/null +++ b/dist/css/theme.black-ice.min.css @@ -0,0 +1 @@ +.tablesorter-blackice{width:100%;margin-right:auto;margin-left:auto;font:11px/18px Arial,Sans-serif;text-align:left;background-color:#000;border-collapse:collapse;border-spacing:0}.tablesorter-blackice th,.tablesorter-blackice thead td{padding:4px;font:700 13px/20px Arial,Sans-serif;color:#e5e5e5;text-align:left;text-shadow:0 1px 0 rgba(0,0,0,.7);background-color:#111;border:1px solid #232323}.tablesorter-blackice .header,.tablesorter-blackice .tablesorter-header{padding:4px 20px 4px 4px;cursor:pointer;background-image:url(data:image/gif;base64,R0lGODlhFQAJAIAAAP///////yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==);background-position:center right;background-repeat:no-repeat}.tablesorter-blackice .headerSortUp,.tablesorter-blackice .tablesorter-headerAsc,.tablesorter-blackice .tablesorter-headerSortUp{background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7);color:#fff}.tablesorter-blackice .headerSortDown,.tablesorter-blackice .tablesorter-headerDesc,.tablesorter-blackice .tablesorter-headerSortDown{color:#fff;background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7)}.tablesorter-blackice thead .sorter-false{background-image:none;cursor:default;padding:4px}.tablesorter-blackice tfoot .tablesorter-headerAsc,.tablesorter-blackice tfoot .tablesorter-headerDesc,.tablesorter-blackice tfoot .tablesorter-headerSortDown,.tablesorter-blackice tfoot .tablesorter-headerSortUp{background-image:none}.tablesorter-blackice td{padding:4px;color:#ccc;vertical-align:top;background-color:#333;border:1px solid #232323}.tablesorter-blackice tbody>tr.even:hover>td,.tablesorter-blackice tbody>tr.odd:hover>td,.tablesorter-blackice tbody>tr:hover>td{background:#000}.tablesorter-blackice .tablesorter-processing{background-position:center center!important;background-repeat:no-repeat!important;background-image:url(data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=)!important}.tablesorter-blackice tr.odd>td{background-color:#333}.tablesorter-blackice tr.even>td{background-color:#393939}.tablesorter-blackice td.primary,.tablesorter-blackice tr.odd td.primary{background-color:#2f3a40}.tablesorter-blackice td.secondary,.tablesorter-blackice tr.even td.primary,.tablesorter-blackice tr.odd td.secondary{background-color:#3f4a50}.tablesorter-blackice td.tertiary,.tablesorter-blackice tr.even td.secondary,.tablesorter-blackice tr.odd td.tertiary{background-color:#4f5a60}.tablesorter-blackice tr.even td.tertiary{background-color:#5a646b}caption{background:#fff}.tablesorter-blackice .tablesorter-filter-row{background:#222}.tablesorter-blackice .tablesorter-filter-row td{background:#222;line-height:normal;text-align:center;-webkit-transition:line-height .1s ease;-moz-transition:line-height .1s ease;-o-transition:line-height .1s ease;transition:line-height .1s ease}.tablesorter-blackice .tablesorter-filter-row .disabled{opacity:.5;filter:alpha(opacity=50);cursor:not-allowed}.tablesorter-blackice .tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0;cursor:pointer}.tablesorter-blackice .tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0;filter:alpha(opacity=0)}.tablesorter-blackice input.tablesorter-filter,.tablesorter-blackice select.tablesorter-filter{width:98%;height:auto;margin:0;padding:4px;background-color:#fff;border:1px solid #bbb;color:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .1s ease;-moz-transition:height .1s ease;-o-transition:height .1s ease;transition:height .1s ease}.tablesorter .filtered{display:none}.tablesorter .tablesorter-errorRow td{text-align:center;cursor:pointer;background-color:#e6bf99} \ No newline at end of file diff --git a/dist/css/theme.blue.min.css b/dist/css/theme.blue.min.css new file mode 100644 index 00000000..c7fb1716 --- /dev/null +++ b/dist/css/theme.blue.min.css @@ -0,0 +1 @@ +.tablesorter-blue{width:100%;background-color:#fff;margin:10px 0 15px;text-align:left;border-spacing:0;border:1px solid #cdcdcd;border-width:1px 0 0 1px}.tablesorter-blue td,.tablesorter-blue th{border:1px solid #cdcdcd;border-width:0 1px 1px 0}.tablesorter-blue th,.tablesorter-blue thead td{font:700 12px/18px Arial,Sans-serif;color:#000;background-color:#99bfe6;border-collapse:collapse;padding:4px;text-shadow:0 1px 0 rgba(204,204,204,.7)}.tablesorter-blue tbody td,.tablesorter-blue tfoot td,.tablesorter-blue tfoot th{padding:4px;vertical-align:top}.tablesorter-blue .header,.tablesorter-blue .tablesorter-header{background-image:url(data:image/gif;base64,R0lGODlhFQAJAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==);background-repeat:no-repeat;background-position:center right;padding:4px 18px 4px 4px;white-space:normal;cursor:pointer}.tablesorter-blue .headerSortUp,.tablesorter-blue .tablesorter-headerAsc,.tablesorter-blue .tablesorter-headerSortUp{background-color:#9fbfdf;background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7)}.tablesorter-blue .headerSortDown,.tablesorter-blue .tablesorter-headerDesc,.tablesorter-blue .tablesorter-headerSortDown{background-color:#8cb3d9;background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7)}.tablesorter-blue thead .sorter-false{background-image:none;cursor:default;padding:4px}.tablesorter-blue tfoot .tablesorter-headerAsc,.tablesorter-blue tfoot .tablesorter-headerDesc,.tablesorter-blue tfoot .tablesorter-headerSortDown,.tablesorter-blue tfoot .tablesorter-headerSortUp{background-image:none}.tablesorter-blue td{color:#3d3d3d;background-color:#fff;padding:4px;vertical-align:top}.tablesorter-blue tbody>tr.even:hover+tr.tablesorter-childRow+tr.tablesorter-childRow>td,.tablesorter-blue tbody>tr.even:hover+tr.tablesorter-childRow>td,.tablesorter-blue tbody>tr.even:hover>td,.tablesorter-blue tbody>tr:hover+tr.tablesorter-childRow+tr.tablesorter-childRow>td,.tablesorter-blue tbody>tr:hover+tr.tablesorter-childRow>td,.tablesorter-blue tbody>tr:hover>td{background:#d9d9d9}.tablesorter-blue tbody>tr.odd:hover+tr.tablesorter-childRow+tr.tablesorter-childRow>td,.tablesorter-blue tbody>tr.odd:hover+tr.tablesorter-childRow>td,.tablesorter-blue tbody>tr.odd:hover>td{background:#bfbfbf}.tablesorter-blue .tablesorter-processing{background-position:center center!important;background-repeat:no-repeat!important;background-image:url(data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=)!important}.tablesorter-blue tbody tr.odd>td{background-color:#ebf2fa}.tablesorter-blue tbody tr.even>td{background-color:#fff}.tablesorter-blue td.primary,.tablesorter-blue tr.odd td.primary{background-color:#99b3e6}.tablesorter-blue td.secondary,.tablesorter-blue tr.even td.primary,.tablesorter-blue tr.odd td.secondary{background-color:#c2d1f0}.tablesorter-blue td.tertiary,.tablesorter-blue tr.even td.secondary,.tablesorter-blue tr.odd td.tertiary{background-color:#d6e0f5}.tablesorter-blue tr.even td.tertiary{background-color:#ebf0fa}caption{background:#fff}.tablesorter-blue .tablesorter-filter-row{background:#eee}.tablesorter-blue .tablesorter-filter-row td{background:#eee;line-height:normal;text-align:center;-webkit-transition:line-height .1s ease;-moz-transition:line-height .1s ease;-o-transition:line-height .1s ease;transition:line-height .1s ease}.tablesorter-blue .tablesorter-filter-row .disabled{opacity:.5;filter:alpha(opacity=50);cursor:not-allowed}.tablesorter-blue .tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0;cursor:pointer}.tablesorter-blue .tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0;filter:alpha(opacity=0)}.tablesorter-blue input.tablesorter-filter,.tablesorter-blue select.tablesorter-filter{width:98%;height:auto;margin:0;padding:4px;background-color:#fff;border:1px solid #bbb;color:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .1s ease;-moz-transition:height .1s ease;-o-transition:height .1s ease;transition:height .1s ease}.tablesorter .filtered{display:none}.tablesorter .tablesorter-errorRow td{text-align:center;cursor:pointer;background-color:#e6bf99} \ No newline at end of file diff --git a/dist/css/theme.bootstrap.min.css b/dist/css/theme.bootstrap.min.css new file mode 100644 index 00000000..b4916ba4 --- /dev/null +++ b/dist/css/theme.bootstrap.min.css @@ -0,0 +1 @@ +.tablesorter-bootstrap{width:100%}.tablesorter-bootstrap tfoot td,.tablesorter-bootstrap tfoot th,.tablesorter-bootstrap thead td,.tablesorter-bootstrap thead th{font:700 14px/20px Arial,Sans-serif;padding:4px;margin:0 0 18px;background-color:#eee}.tablesorter-bootstrap .tablesorter-header{cursor:pointer}.tablesorter-bootstrap .tablesorter-header-inner{position:relative;padding:4px 18px 4px 4px}.tablesorter-bootstrap .tablesorter-header i.tablesorter-icon{font-size:11px;position:absolute;right:2px;top:50%;margin-top:-7px;width:14px;height:14px;background-repeat:no-repeat;line-height:14px;display:inline-block}.tablesorter-bootstrap .bootstrap-icon-unsorted{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOCAMAAADOvxanAAAAVFBMVEUAAABCQkJZWVkZGRnJyckgICAZGRkZGRn8/PweHh4dHR0aGhoaGhpUVFQbGxvQ0NDc3NxMTExSUlIbGxvr6+s4ODhKSkogICAtLS00NDQzMzMnJydSEPrQAAAAGHRSTlMA1ssZRLgdAQbDyisqsZo8QdXUq0r9xPepSRwiAAAAX0lEQVQI13XHSQKAIAwEwQAKxn13Ev7/T2Pu9qmarJKPXIicI4PH4hxaKNrhm2S8bJK5h4YzKHrzJNtK6yYT/TdXzpS5zuYg4MSQYF6i4IHExdw1UVRi05HPrrvT53a+qyMFC9t04gcAAAAASUVORK5CYII=)}.tablesorter-bootstrap .icon-white.bootstrap-icon-unsorted{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOBAMAAAALT/umAAAAKlBMVEUAAAD///////////////////////////////////////////////////+Gu8ovAAAADXRSTlMA4EXKBtQqvR0+sxmalc142gAAAFdJREFUCNdjYGDoamAAAjZbMxCVfvd6AgMDd+3du9UMDKx3hWSvMjBwXZww8RYDGuC53NB8h4GB8a617UUGBs7Yu3cjGRhYVO9eVQFKOskKOQApFmUgBwBZ+xXRTttNdAAAAABJRU5ErkJggg==)}.tablesorter-bootstrap>tbody>tr.odd>td,.tablesorter-bootstrap>tbody>tr.tablesorter-hasChildRow.odd:hover~tr.tablesorter-hasChildRow.odd~.tablesorter-childRow.odd>td{background-color:#f9f9f9}.tablesorter-bootstrap>tbody>tr.even:hover>td,.tablesorter-bootstrap>tbody>tr.odd:hover>td,.tablesorter-bootstrap>tbody>tr.tablesorter-hasChildRow.even:hover~.tablesorter-childRow.even>td,.tablesorter-bootstrap>tbody>tr.tablesorter-hasChildRow.odd:hover~.tablesorter-childRow.odd>td{background-color:#f5f5f5}.tablesorter-bootstrap>tbody>tr.even>td,.tablesorter-bootstrap>tbody>tr.tablesorter-hasChildRow.even:hover~tr.tablesorter-hasChildRow.even~.tablesorter-childRow.even>td{background-color:#fff}.tablesorter-bootstrap .tablesorter-processing{background-image:url(data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=);background-position:center center!important;background-repeat:no-repeat!important}.caption{background:#fff}.tablesorter-bootstrap .tablesorter-filter-row input.tablesorter-filter,.tablesorter-bootstrap .tablesorter-filter-row select.tablesorter-filter{width:98%;margin:0 auto;padding:4px 6px;color:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .1s ease;-moz-transition:height .1s ease;-o-transition:height .1s ease;transition:height .1s ease}.tablesorter-bootstrap .tablesorter-filter-row .tablesorter-filter.disabled{background-color:#eee;color:#555;cursor:not-allowed;border:1px solid #ccc;border-radius:4px;box-shadow:0 1px 1px rgba(0,0,0,.075) inset;box-sizing:border-box;transition:height .1s ease}.tablesorter-bootstrap .tablesorter-filter-row{background:#efefef}.tablesorter-bootstrap .tablesorter-filter-row td{background:#efefef;line-height:normal;text-align:center;padding:4px 6px;vertical-align:middle;-webkit-transition:line-height .1s ease;-moz-transition:line-height .1s ease;-o-transition:line-height .1s ease;transition:line-height .1s ease}.tablesorter-bootstrap .tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0}.tablesorter-bootstrap .tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0;filter:alpha(opacity=0)}.tablesorter .filtered{display:none}.tablesorter-bootstrap .tablesorter-pager select{padding:4px 6px}.tablesorter-bootstrap .tablesorter-pager .pagedisplay{border:0}.tablesorter-bootstrap tfoot i{font-size:11px}.tablesorter .tablesorter-errorRow td{text-align:center;cursor:pointer;background-color:#e6bf99} \ No newline at end of file diff --git a/dist/css/theme.bootstrap_2.min.css b/dist/css/theme.bootstrap_2.min.css new file mode 100644 index 00000000..d0b1911d --- /dev/null +++ b/dist/css/theme.bootstrap_2.min.css @@ -0,0 +1 @@ +.tablesorter-bootstrap{width:100%}.tablesorter-bootstrap .tablesorter-header,.tablesorter-bootstrap tfoot td,.tablesorter-bootstrap tfoot th{font:700 14px/20px Arial,Sans-serif;position:relative;padding:8px;margin:0 0 18px;list-style:none;background-color:#FBFBFB;background-image:-moz-linear-gradient(top,#fff,#efefef);background-image:-ms-linear-gradient(top,#fff,#efefef);background-image:-webkit-gradient(linear,0 0,0 100%,from(white),to(#efefef));background-image:-webkit-linear-gradient(top,#fff,#efefef);background-image:-o-linear-gradient(top,#fff,#efefef);background-image:linear-gradient(to bottom,#fff,#efefef);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#efefef', GradientType=0);background-repeat:repeat-x;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.tablesorter-bootstrap .tablesorter-header{cursor:pointer}.tablesorter-bootstrap .tablesorter-header-inner{position:relative;padding:4px 18px 4px 4px}.tablesorter-bootstrap .tablesorter-header i.tablesorter-icon{position:absolute;right:2px;top:50%;margin-top:-7px;width:14px;height:14px;background-repeat:no-repeat;line-height:14px;display:inline-block}.tablesorter-bootstrap .bootstrap-icon-unsorted{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOCAYAAAD5YeaVAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAWVJREFUeNqUUL9Lw2AUTGP8mqGlpBQkNeCSRcckEBcHq1jImMElToKuDvpHFMGhU0BQcHBwLji6CE1B4uB/INQsDi4d2jQ/fPeZxo764OV6915f7lLJ81xot9tCURXqdVEUr7IsO6ffH9Q5BlEUCaLwWxWqTcbYnaIoh0Dw4gAvcWlxq1qt9hqNxg6hUGAP+uIPUrGs0qXLer2+v/pTX6QpxLtkc2U2m53ACb8sSdIDXerSEms2m6+DweAICA4d89KGbduf9MpEVdXQ9/2LVqv1CASHjjn3iq/x1xKFfxQPqGnada1W86bT6SiO42OS3qk3KPStLMvbk8nkfjwen/LLuq6blFymMB0KdUPSGhAcOualjX6/f0bCiC7NaWGPQr0BwaFjzn0gYJqmLAiCA8/zni3LmhuGkQPBoWPOPwQeaPIqD4fDruu6L6Zp5kBw6IudchmdJAkLw3DXcZwnIPjy/FuAAQCiqqWWCAFKcwAAAABJRU5ErkJggg==)}.tablesorter-bootstrap .icon-white.bootstrap-icon-unsorted{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAOBAMAAAALT/umAAAAKlBMVEUAAAD///////////////////////////////////////////////////+Gu8ovAAAADXRSTlMA4EXKBtQqvR0+sxmalc142gAAAFdJREFUCNdjYGDoamAAAjZbMxCVfvd6AgMDd+3du9UMDKx3hWSvMjBwXZww8RYDGuC53NB8h4GB8a617UUGBs7Yu3cjGRhYVO9eVQFKOskKOQApFmUgBwBZ+xXRTttNdAAAAABJRU5ErkJggg==)}.tablesorter-bootstrap tr.odd>td{background-color:#f9f9f9}.tablesorter-bootstrap tbody>.even:hover>td,.tablesorter-bootstrap tbody>.odd:hover>td{background-color:#f5f5f5}.tablesorter-bootstrap tr.even>td{background-color:#fff}.tablesorter-bootstrap .tablesorter-processing{background-image:url(data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=);position:absolute;z-index:1000}caption{background:#fff}.tablesorter-bootstrap .tablesorter-filter-row input.tablesorter-filter,.tablesorter-bootstrap .tablesorter-filter-row select.tablesorter-filter{width:98%;margin:0 auto;padding:4px 6px;background-color:#fff;color:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .1s ease;-moz-transition:height .1s ease;-o-transition:height .1s ease;transition:height .1s ease}.tablesorter-bootstrap .tablesorter-filter-row .tablesorter-filter.disabled{background:#eee;cursor:not-allowed}.tablesorter-bootstrap .tablesorter-filter-row{background:#eee}.tablesorter-bootstrap .tablesorter-filter-row td{background:#eee;line-height:normal;text-align:center;padding:4px 6px;vertical-align:middle;-webkit-transition:line-height .1s ease;-moz-transition:line-height .1s ease;-o-transition:line-height .1s ease;transition:line-height .1s ease}.tablesorter-bootstrap .tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0}.tablesorter-bootstrap .tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0;filter:alpha(opacity=0)}.tablesorter .filtered{display:none}.tablesorter-bootstrap .tablesorter-pager select{padding:4px 6px}.tablesorter-bootstrap .tablesorter-pager .pagedisplay{border:0}.tablesorter .tablesorter-errorRow td{text-align:center;cursor:pointer;background-color:#e6bf99} \ No newline at end of file diff --git a/dist/css/theme.dark.min.css b/dist/css/theme.dark.min.css new file mode 100644 index 00000000..2234573f --- /dev/null +++ b/dist/css/theme.dark.min.css @@ -0,0 +1 @@ +.tablesorter-dark{width:100%;font:11px/18px Arial,Sans-serif;color:#ccc;text-align:left;background-color:#000;border-spacing:0}.tablesorter-dark th,.tablesorter-dark thead td{padding:4px;font:700 12px/20px Arial,Sans-serif;color:#fff;background-color:#000;border-collapse:collapse}.tablesorter-dark thead th{border-bottom:#333 2px solid}.tablesorter-dark .header,.tablesorter-dark .tablesorter-header{padding:4px 20px 4px 4px;cursor:pointer;background-image:url(data:image/gif;base64,R0lGODlhFQAJAIAAAP///////yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==);background-position:center right;background-repeat:no-repeat}.tablesorter-dark thead .headerSortUp,.tablesorter-dark thead .tablesorter-headerAsc,.tablesorter-dark thead .tablesorter-headerSortUp{background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7);border-bottom:#888 1px solid}.tablesorter-dark thead .headerSortDown,.tablesorter-dark thead .tablesorter-headerDesc,.tablesorter-dark thead .tablesorter-headerSortDown{background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7);border-bottom:#888 1px solid}.tablesorter-dark thead .sorter-false{background-image:none;cursor:default;padding:4px}.tablesorter-dark tfoot .tablesorter-headerAsc,.tablesorter-dark tfoot .tablesorter-headerDesc,.tablesorter-dark tfoot .tablesorter-headerSortDown,.tablesorter-dark tfoot .tablesorter-headerSortUp{border-top:#888 1px solid;background-image:none}.tablesorter-dark td{padding:4px;background-color:#000;border-bottom:#333 1px solid;color:#ccc}.tablesorter-dark tbody>tr.even:hover>td,.tablesorter-dark tbody>tr.odd:hover>td,.tablesorter-dark tbody>tr:hover>td{background:#000}.tablesorter-dark .tablesorter-processing{background-position:center center!important;background-repeat:no-repeat!important;background-image:url(data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=)!important}.tablesorter-dark tr.odd>td{background-color:#202020}.tablesorter-dark tr.even>td{background-color:#101010}.tablesorter-dark td.primary,.tablesorter-dark tr.odd td.primary{background-color:#0a0a0a}.tablesorter-dark tr.even td.primary{background-color:#050505}.tablesorter-dark td.secondary,.tablesorter-dark tr.odd td.secondary{background-color:#0f0f0f}.tablesorter-dark tr.even td.secondary{background-color:#0a0a0a}.tablesorter-dark td.tertiary,.tablesorter-dark tr.odd td.tertiary{background-color:#191919}.tablesorter-dark tr.even td.tertiary{background-color:#0f0f0f}.tablesorter-dark .tablesorter-filter-row,caption{background:#202020}.tablesorter-dark .tablesorter-filter-row td{background:#202020;line-height:normal;text-align:center;-webkit-transition:line-height .1s ease;-moz-transition:line-height .1s ease;-o-transition:line-height .1s ease;transition:line-height .1s ease}.tablesorter-dark .tablesorter-filter-row .disabled{opacity:.5;filter:alpha(opacity=50);cursor:not-allowed}.tablesorter-dark .tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0;cursor:pointer}.tablesorter-dark .tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0;filter:alpha(opacity=0)}.tablesorter-dark input.tablesorter-filter,.tablesorter-dark select.tablesorter-filter{width:98%;height:auto;margin:4px;padding:4px;background-color:#111;border:1px solid #222;color:#ddd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .1s ease;-moz-transition:height .1s ease;-o-transition:height .1s ease;transition:height .1s ease}.tablesorter .filtered{display:none}.tablesorter .tablesorter-errorRow td{text-align:center;cursor:pointer;background-color:#e6bf99} \ No newline at end of file diff --git a/dist/css/theme.default.min.css b/dist/css/theme.default.min.css new file mode 100644 index 00000000..9f7d890c --- /dev/null +++ b/dist/css/theme.default.min.css @@ -0,0 +1 @@ +.tablesorter-default{width:100%;font:12px/18px Arial,Sans-serif;color:#333;background-color:#fff;border-spacing:0;margin:10px 0 15px;text-align:left}.tablesorter-default th,.tablesorter-default thead td{font:700 12px/18px Arial,Sans-serif;color:#000;background-color:#fff;border-collapse:collapse;border-bottom:#ccc 2px solid;padding:0}.tablesorter-default tfoot td,.tablesorter-default tfoot th{border:0}.tablesorter-default .header,.tablesorter-default .tablesorter-header{background-image:url(data:image/gif;base64,R0lGODlhFQAJAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==);background-position:center right;background-repeat:no-repeat;cursor:pointer;white-space:normal;padding:4px 20px 4px 4px}.tablesorter-default thead .headerSortUp,.tablesorter-default thead .tablesorter-headerAsc,.tablesorter-default thead .tablesorter-headerSortUp{background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7);border-bottom:#000 2px solid}.tablesorter-default thead .headerSortDown,.tablesorter-default thead .tablesorter-headerDesc,.tablesorter-default thead .tablesorter-headerSortDown{background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAACMtMP///yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7);border-bottom:#000 2px solid}.tablesorter-default thead .sorter-false{background-image:none;cursor:default;padding:4px}.tablesorter-default tfoot .tablesorter-headerAsc,.tablesorter-default tfoot .tablesorter-headerDesc,.tablesorter-default tfoot .tablesorter-headerSortDown,.tablesorter-default tfoot .tablesorter-headerSortUp{border-top:#000 2px solid}.tablesorter-default td{background-color:#fff;border-bottom:#ccc 1px solid;padding:4px;vertical-align:top}.tablesorter-default tbody>tr.even:hover>td,.tablesorter-default tbody>tr.odd:hover>td,.tablesorter-default tbody>tr:hover>td{background:#fff;color:#000}.tablesorter-default .tablesorter-processing{background-position:center center!important;background-repeat:no-repeat!important;background-image:url(data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=)!important}.tablesorter-default tr.odd>td{background-color:#dfdfdf}.tablesorter-default tr.even>td{background-color:#efefef}.tablesorter-default tr.odd td.primary{background-color:#bfbfbf}.tablesorter-default td.primary,.tablesorter-default tr.even td.primary,.tablesorter-default tr.odd td.secondary{background-color:#d9d9d9}.tablesorter-default td.secondary,.tablesorter-default tr.even td.secondary,.tablesorter-default tr.odd td.tertiary{background-color:#e6e6e6}.tablesorter-default td.tertiary,.tablesorter-default tr.even td.tertiary{background-color:#f2f2f2}caption{background:#fff}.tablesorter-default .tablesorter-filter-row{background:#eee}.tablesorter-default .tablesorter-filter-row td{background:#eee;border-bottom:#ccc 1px solid;line-height:normal;text-align:center;-webkit-transition:line-height .1s ease;-moz-transition:line-height .1s ease;-o-transition:line-height .1s ease;transition:line-height .1s ease}.tablesorter-default .tablesorter-filter-row .disabled{opacity:.5;filter:alpha(opacity=50);cursor:not-allowed}.tablesorter-default .tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0;cursor:pointer}.tablesorter-default .tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0;filter:alpha(opacity=0)}.tablesorter-default input.tablesorter-filter,.tablesorter-default select.tablesorter-filter{width:95%;height:auto;margin:4px;padding:4px;background-color:#fff;border:1px solid #bbb;color:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .1s ease;-moz-transition:height .1s ease;-o-transition:height .1s ease;transition:height .1s ease}.tablesorter .filtered{display:none}.tablesorter .tablesorter-errorRow td{text-align:center;cursor:pointer;background-color:#e6bf99} \ No newline at end of file diff --git a/dist/css/theme.dropbox.min.css b/dist/css/theme.dropbox.min.css new file mode 100644 index 00000000..b2f70640 --- /dev/null +++ b/dist/css/theme.dropbox.min.css @@ -0,0 +1 @@ +.tablesorter-dropbox{width:100%;font:13px/32px "Open Sans","lucida grande","Segoe UI",arial,verdana,"lucida sans unicode",tahoma,sans-serif;color:#555;text-align:left;background-color:#fff;border-collapse:collapse;border-top:1px solid #82cffa;border-spacing:0}.tablesorter-dropbox tfoot td,.tablesorter-dropbox tfoot th,.tablesorter-dropbox th,.tablesorter-dropbox thead td{background-color:#f0f9ff;border-color:#82cffa #e7f2fb #96c4ea;border-style:solid;border-width:1px;padding:3px 6px;font-size:13px;font-weight:400;line-height:29px;color:#2281CF;text-align:left}.tablesorter-dropbox .header,.tablesorter-dropbox .tablesorter-headerRow,.tablesorter-dropbox thead tr{background-color:#f0f9ff;border-bottom:1px solid #96c4ea;box-shadow:0 1px 1px rgba(0,0,0,.12),0 0 0 #000 inset;white-space:normal}.tablesorter-dropbox .tablesorter-headerAsc,.tablesorter-dropbox .tablesorter-headerDesc,.tablesorter-dropbox .tablesorter-headerSortDown,.tablesorter-dropbox .tablesorter-headerSortUp{font-weight:600}.tablesorter-dropbox .tablesorter-header{cursor:pointer}.tablesorter-dropbox .tablesorter-header i.tablesorter-icon{width:9px;height:9px;padding:0 10px 0 4px;display:inline-block;background-position:center right;background-repeat:no-repeat;content:""}.tablesorter-dropbox .tablesorter-headerAsc i.tablesorter-icon,.tablesorter-dropbox .tablesorter-headerSortUp i.tablesorter-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALhJREFUeNpi/P//PwMhwILMiexYx8bIxNTy/9+/muUVQb9g4kzIitg4edI4+YRLQTSyOCPMupjerUI8whK3OXgEhH58+fDuy9sXqkuKvd+hmMTOxdvCxS8sxMUvxACiQXwU6+Im7DDg5BNKY+fiY2BmYWMA0SA+SByuiJ2bbzIHrwAzMxsb0AGMDCAaxAeJg+SZ7wtaqfAISfQAdTIwMUM8ywhUyMTEzPD/71+5FXvPLWUkJpwAAgwAZqYvvHStbD4AAAAASUVORK5CYII=)}.tablesorter-dropbox .tablesorter-headerAsc:hover i.tablesorter-icon,.tablesorter-dropbox .tablesorter-headerSortUp:hover i.tablesorter-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALVJREFUeNpi/P//PwMhwILMCc+qZGNkYmr5/+9fzcpp7b9g4kzIitjYOdM4uXlLQTSyOCPMuqi8OiEefsHbHFzcQj++fX335eN71WWTmt6hmMTOwdXCycMnBDSJAUSD+CjWxRQ0GHBw86Sxc3AyMDOzMIBoEB8kDlfEzsk1mYOLByjPCnQAIwOIBvFB4iB55rsfmVS4+QV7QNYwMTNDHApUyMTExPDv/z+5Feu3L2UkJpwAAgwA244u+I9CleAAAAAASUVORK5CYII=)}.tablesorter-dropbox .tablesorter-headerDesc i.tablesorter-icon,.tablesorter-dropbox .tablesorter-headerSortDown i.tablesorter-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALdJREFUeNpi/P//PwMhwBLdtVGFhZ3zNhMzC4bkv79/GP78/K7KCDIpZ9mVw+xcfDaMTExwBf///WP4+e3TkSlROrZg7UxMLLns3HxnmFnZmGGK/v7+9ff3j2+5YHkQMSlC48Kv719m/f//D2IKkAbxQeJwRSDw4/OHmr+/fr0DqmAA0SA+TA6uaEq0zjugG+r//vkFcks9iA/3HbJvvn18O+vf379yP758mMXAoAAXZyQmnAACDADX316BiTFbMQAAAABJRU5ErkJggg==)}.tablesorter-dropbox .tablesorter-headerDesc:hover i.tablesorter-icon,.tablesorter-dropbox .tablesorter-headerSortDown:hover i.tablesorter-icon{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAJCAYAAADgkQYQAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAALNJREFUeNpi/P//PwMhwBJf3uP879e3PUzMzBiS//7+ZWBi43JhBJmU2z7nIzMzEx8jIyNcAUj8799/nyZXpvCzgARYuXjTWBkZVjCzIEz7++cvw+//DGkgNiPMTWVT1l5hZvynDTINbMp/pqtdOcE6IDkmmM5fv3/5//v37z9QBQOIBvFhcnBFEwoj7/5jZFnz9+8fBhAN4sN9h+ybH9++JrGxscr/+vE1CVmckZhwAggwANvlUyq5Dd1wAAAAAElFTkSuQmCC)}.tablesorter-dropbox thead .sorter-false{cursor:default}.tablesorter-dropbox thead .sorter-false i.tablesorter-icon,.tablesorter-dropbox thead .sorter-false:hover i.tablesorter-icon{background-image:none;padding:4px}.tablesorter-dropbox td{padding:5px 6px;line-height:32px;color:#555;text-align:left;border-top:1px solid #edf1f5;border-bottom:1px solid #edf1f5}.tablesorter-dropbox tbody>tr.even:hover>td,.tablesorter-dropbox tbody>tr.odd:hover>td,.tablesorter-dropbox tbody>tr:hover>td{background-color:rgba(230,245,255,.3);border-right:0;border-left:0;border-color:#c6d8e4;border-style:double}.tablesorter-dropbox .tablesorter-processing{background-position:center center!important;background-repeat:no-repeat!important;background-image:url(data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=)!important}.tablesorter-dropbox .tablesorter-filter-row,caption{background:#fff}.tablesorter-dropbox .tablesorter-filter-row td{background:#fff;line-height:normal;text-align:center;-webkit-transition:line-height .1s ease;-moz-transition:line-height .1s ease;-o-transition:line-height .1s ease;transition:line-height .1s ease}.tablesorter-dropbox .tablesorter-filter-row .disabled{opacity:.5;filter:alpha(opacity=50);cursor:not-allowed}.tablesorter-dropbox .tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0;cursor:pointer}.tablesorter-dropbox .tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0;filter:alpha(opacity=0)}.tablesorter-dropbox input.tablesorter-filter,.tablesorter-dropbox select.tablesorter-filter{width:98%;height:auto;margin:4px;background-color:#fff;border:1px solid #bbb;color:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .1s ease;-moz-transition:height .1s ease;-o-transition:height .1s ease;transition:height .1s ease}.tablesorter .filtered{display:none}.tablesorter .tablesorter-errorRow td{text-align:center;cursor:pointer;background-color:#e6bf99} \ No newline at end of file diff --git a/dist/css/theme.green.min.css b/dist/css/theme.green.min.css new file mode 100644 index 00000000..c0b5ec5a --- /dev/null +++ b/dist/css/theme.green.min.css @@ -0,0 +1 @@ +.tablesorter-green{width:100%;text-align:left;border-spacing:0;border:1px solid #cdcdcd;border-width:1px 0 0 1px}.tablesorter-green td,.tablesorter-green th{font:12px/18px Arial,Sans-serif;border:1px solid #cdcdcd;border-width:0 1px 1px 0}.tablesorter-green tfoot tr,.tablesorter-green thead tr .tablesorter-header{background:url(data:image/gif;base64,R0lGODlhAQBkAOYAAN/e39XU1fX19tTU1eXm5uTl5ePk5OLj4+Hi4vX29fT19PP08/Lz8vHy8fDx8O/w7+7v7uzt7Orr6ufo5/T08/Pz8ufn5uLi4eDg39/f3t3d3Nzc29HR0NDQz8/Pzuvq6urp6eno6Ojn5+fm5tfW1tbV1dTT09PS0tLR0dHQ0NDPz/f39/b29vX19fT09PPz8/Ly8vHx8e/v7+7u7u3t7ezs7Ovr6+rq6unp6ejo6Ofn5+bm5uXl5eTk5OPj4+Li4uHh4eDg4N/f397e3t3d3dzc3Nvb29ra2tnZ2djY2NfX19XV1dPT09LS0tHR0dDQ0M/Pz8rKysXFxf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAFMALAAAAAABAGQAAAdegCsrLC0tLi+ILi6FCSwsCS0KkhQVDA0OMjM0NTYfICEiIzw9P0AYGUQaG0ZHSEoDTU9Qs08pTk1MSyRJR0VDQT8+PTw7Ojg3NTMyMTAvi4WOhC0vMTI1OT9GTlFSgQA7) center center repeat-x}.tablesorter-green th,.tablesorter-green thead td{font-weight:700;border-right:#cdcdcd 1px solid;border-collapse:collapse;padding:6px}.tablesorter-green .header,.tablesorter-green .tablesorter-header-inner{background:url(data:image/gif;base64,R0lGODlhEAAQAOYAAA5NDBBYDlWWUzRUM5DVjp7inJ/fnQ1ECiCsGhyYFxqKFRFdDhBXDQxCCiO8HSK2HCCqGh2aGByUFxuPFhqNFhmHFRZ2EhVvERRpEBBVDSS8HiGyHB+mGh6fGRuTFxiAFBd5Eww/Cgs5CRp7Fiu+JRx8GCy/JjHAKyynKCuhJzXCMDbCMDnDMyNuHz3EODy9N0LFPSl7JkvIRjycOFDKS1LKTVPLT1XLUFTCT17OWTBkLmbQYnDTbHXVcXnWdoXago/djGmUZ112XCJEIEdjRf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAEUALAAAAAAQABAAAAdlgEWCg4SFhoIvh4cVLECKhCMeJjwFj0UlEwgaMD4Gii0WFAkRHQ47BIY6IQAZDAwBCyAPOJa1toRBGBAwNTY3OT0/AoZCDQoOKi4yNDOKRCIfGycrKZYDBxIkKLZDFxy3RTHgloEAOw==) 5px center no-repeat;border-collapse:collapse;white-space:normal;cursor:pointer}.tablesorter-green thead .headerSortUp .tablesorter-header-inner,.tablesorter-green thead .tablesorter-headerAsc .tablesorter-header-inner,.tablesorter-green thead .tablesorter-headerSortUp .tablesorter-header-inner{background-image:url(data:image/gif;base64,R0lGODlhEAAQANUAAA5NDBBYDpDVjp7inJ/fnSCsGhyYFxFdDhBXDSO8HSK2HB2aGBuPFhqNFhmHFRZ2EhBVDSS8Hh6fGRuTFxd5Eww/Chp7Fhx8GCy/JjnDMyNuHzy9N0LFPVTCTzBkLmbQYnDTbHnWdo/djP///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACMALAAAAAAQABAAAAY4wJFwSCwaj8ikcslMbpojR0bEtEwwoIHywihEOCECUvNoGBaSxEdg9FQAEAQicKAoOtC8fs8fBgEAOw==)}.tablesorter-green thead .headerSortDown .tablesorter-header-inner,.tablesorter-green thead .tablesorter-headerDesc .tablesorter-header-inner,.tablesorter-green thead .tablesorter-headerSortDown .tablesorter-header-inner{background-image:url(data:image/gif;base64,R0lGODlhEAAQANUAAFWWUzRUMw1EChqKFQxCCiO8HSCqGhyUFxVvERRpECGyHB+mGhiAFAs5CSu+JTHAKyynKCuhJzXCMDbCMD3EOELFPSl7JkvIRjycOFDKS1LKTVPLT1XLUF7OWXXVcYXagmmUZ112XCJEIEdjRf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACQALAAAAAAQABAAAAY4QJJwSCwaj8ikcskkghKGimbD6Xg+AGOIMChIKJcMBjlqMBSPSUQZEBwcEKYIsWiSLPa8fs9HBgEAOw==)}.tablesorter-green td.tablesorter-header .tablesorter-header-inner,.tablesorter-green th.tablesorter-header .tablesorter-header-inner{padding-left:23px}.tablesorter-green thead .tablesorter-header.sorter-false .tablesorter-header-inner{background-image:none;cursor:default;padding-left:6px}.tablesorter-green tbody td,.tablesorter-green tfoot th{padding:6px;vertical-align:top}.tablesorter-green td{color:#3d3d3d;padding:6px}.tablesorter-green tbody>tr.even:hover+tr.tablesorter-childRow+tr.tablesorter-childRow>td,.tablesorter-green tbody>tr.even:hover+tr.tablesorter-childRow>td,.tablesorter-green tbody>tr.even:hover>td,.tablesorter-green tbody>tr:hover+tr.tablesorter-childRow+tr.tablesorter-childRow>td,.tablesorter-green tbody>tr:hover+tr.tablesorter-childRow>td,.tablesorter-green tbody>tr:hover>td{background:#d9d9d9}.tablesorter-green tbody>tr.odd:hover+tr.tablesorter-childRow+tr.tablesorter-childRow>td,.tablesorter-green tbody>tr.odd:hover+tr.tablesorter-childRow>td,.tablesorter-green tbody>tr.odd:hover>td{background:#bfbfbf}.tablesorter-green .tablesorter-processing{background-position:center center!important;background-repeat:no-repeat!important;background-image:url(data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=)!important}.tablesorter-green tr.odd>td{background-color:#ebfaeb}.tablesorter-green tr.even>td{background-color:#fff}.tablesorter-green td.primary,.tablesorter-green tr.odd td.primary{background-color:#99e6a6}.tablesorter-green td.secondary,.tablesorter-green tr.even td.primary,.tablesorter-green tr.odd td.secondary{background-color:#c2f0c9}.tablesorter-green td.tertiary,.tablesorter-green tr.even td.secondary,.tablesorter-green tr.odd td.tertiary{background-color:#d6f5db}.tablesorter-green tr.even td.tertiary{background-color:#ebfaed}caption{background:#fff}.tablesorter-green .tablesorter-filter-row{background:#eee}.tablesorter-green .tablesorter-filter-row td{background:#eee;line-height:normal;text-align:center;-webkit-transition:line-height .1s ease;-moz-transition:line-height .1s ease;-o-transition:line-height .1s ease;transition:line-height .1s ease}.tablesorter-green .tablesorter-filter-row .disabled{opacity:.5;filter:alpha(opacity=50);cursor:not-allowed}.tablesorter-green .tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0;cursor:pointer}.tablesorter-green .tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0;filter:alpha(opacity=0)}.tablesorter-green input.tablesorter-filter,.tablesorter-green select.tablesorter-filter{width:98%;height:auto;margin:4px;padding:4px;background-color:#fff;border:1px solid #bbb;color:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .1s ease;-moz-transition:height .1s ease;-o-transition:height .1s ease;transition:height .1s ease}.tablesorter .filtered{display:none}.tablesorter .tablesorter-errorRow td{text-align:center;cursor:pointer;background-color:#e6bf99} \ No newline at end of file diff --git a/dist/css/theme.grey.min.css b/dist/css/theme.grey.min.css new file mode 100644 index 00000000..0badf384 --- /dev/null +++ b/dist/css/theme.grey.min.css @@ -0,0 +1 @@ +.tablesorter-grey{width:100%;margin:10px 0 15px;text-align:left;border-spacing:0;border-left:#555 1px solid}.tablesorter-grey th,.tablesorter-grey thead td{font:700 12px/18px Arial,Sans-serif;color:#c8c8c8;background-color:#3c3c3c;background-image:-moz-linear-gradient(top,#555,#3c3c3c);background-image:-ms-linear-gradient(top,#555,#3c3c3c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#555),to(#3c3c3c));background-image:-webkit-linear-gradient(top,#555,#3c3c3c);background-image:-o-linear-gradient(top,#555,#3c3c3c);background-image:linear-gradient(to bottom,#555,#3c3c3c);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#555555', endColorstr='#3c3c3c', GradientType=0);background-repeat:repeat-x;border-right:#555 1px solid;text-shadow:0 1px 0 rgba(128,128,128,.7);-webkit-box-shadow:inset 0 1px 0 #222;-moz-box-shadow:inset 0 1px 0 #222;box-shadow:inset 0 1px 0 #222;padding:4px}.tablesorter-grey .tablesorter-header-inner{position:relative;padding:4px 15px 4px 4px}.tablesorter-grey .header,.tablesorter-grey .tablesorter-header{cursor:pointer}.tablesorter-grey .header i,.tablesorter-grey .tablesorter-header i.tablesorter-icon{width:18px;height:10px;position:absolute;right:2px;top:50%;margin-top:-10px;background-image:url(data:image/gif;base64,R0lGODlhFQAJAIAAAP///////yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==);background-repeat:no-repeat;background-position:center right;padding:4px;white-space:normal}.tablesorter-grey th.headerSortDown,.tablesorter-grey th.headerSortUp,.tablesorter-grey th.tablesorter-headerSortDown,.tablesorter-grey th.tablesorter-headerSortUp{color:#ddd;background-color:#135185;background-image:-moz-linear-gradient(top,#195c93,#0e4776);background-image:-ms-linear-gradient(top,#195c93,#0e4776);background-image:-webkit-gradient(linear,0 0,0 100%,from(#195c93),to(#0e4776));background-image:-webkit-linear-gradient(top,#195c93,#0e4776);background-image:-o-linear-gradient(top,#195c93,#0e4776);background-image:linear-gradient(to bottom,#195c93,#0e4776);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#195c93', endColorstr='#0e4776', GradientType=0)}.tablesorter-grey .headerSortUp i.tablesorter-icon,.tablesorter-grey .tablesorter-headerAsc i.tablesorter-icon,.tablesorter-grey .tablesorter-headerSortUp i.tablesorter-icon{background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7)}.tablesorter-grey .headerSortDown i.tablesorter-icon,.tablesorter-grey .tablesorter-headerDesc i.tablesorter-icon,.tablesorter-grey .tablesorter-headerSortDown i.tablesorter-icon{background-image:url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7)}.tablesorter-grey thead .sorter-false{cursor:default}.tablesorter-grey thead .sorter-false i.tablesorter-icon{background-image:none;padding:4px}.tablesorter-grey tbody td,.tablesorter-grey tfoot td,.tablesorter-grey tfoot th{padding:4px;vertical-align:top;border-right:#555 1px solid}.tablesorter-grey tfoot td,.tablesorter-grey tfoot th{padding:8px}.tablesorter-grey td{color:#eee;background-color:#6d6d6d;padding:4px;vertical-align:top}.tablesorter-grey tbody>tr.even:hover+tr.tablesorter-childRow+tr.tablesorter-childRow>td,.tablesorter-grey tbody>tr.even:hover+tr.tablesorter-childRow>td,.tablesorter-grey tbody>tr.even:hover>td,.tablesorter-grey tbody>tr.odd:hover+tr.tablesorter-childRow+tr.tablesorter-childRow>td,.tablesorter-grey tbody>tr.odd:hover+tr.tablesorter-childRow>td,.tablesorter-grey tbody>tr.odd:hover>td,.tablesorter-grey tbody>tr:hover+tr.tablesorter-childRow+tr.tablesorter-childRow>td,.tablesorter-grey tbody>tr:hover+tr.tablesorter-childRow>td,.tablesorter-grey tbody>tr:hover>td{background:#134b78}.tablesorter-grey .tablesorter-processing{background-position:center center!important;background-repeat:no-repeat!important;background-image:url(data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=)!important}.tablesorter-grey tbody tr.odd>td{background-color:#5e5e5e}.tablesorter-grey tbody tr.even>td{background-color:#6d6d6d}.tablesorter-grey td.primary,.tablesorter-grey tr.odd td.primary{color:#ddd;background-color:#165388}.tablesorter-grey tr.even td.primary{color:#ddd;background-color:#195c93}.tablesorter-grey td.secondary,.tablesorter-grey tr.odd td.secondary{color:#ddd;background-color:#185C9A}.tablesorter-grey tr.even td.secondary{color:#ddd;background-color:#1D67A5}.tablesorter-grey td.tertiary,.tablesorter-grey tr.odd td.tertiary{color:#ddd;background-color:#1B67AD}.tablesorter-grey tr.even td.tertiary{color:#ddd;background-color:#2073B7}caption{background:#fff}.tablesorter-grey .tablesorter-filter-row{background:#3c3c3c}.tablesorter-grey .tablesorter-filter-row td{background:#3c3c3c;line-height:normal;text-align:center;-webkit-transition:line-height .1s ease;-moz-transition:line-height .1s ease;-o-transition:line-height .1s ease;transition:line-height .1s ease}.tablesorter-grey .tablesorter-filter-row .disabled{opacity:.5;filter:alpha(opacity=50);cursor:not-allowed}.tablesorter-grey .tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0;cursor:pointer}.tablesorter-grey .tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0;filter:alpha(opacity=0)}.tablesorter-grey input.tablesorter-filter,.tablesorter-grey select.tablesorter-filter{width:98%;height:auto;margin:0;padding:4px;background-color:#6d6d6d;border:1px solid #555;color:#ddd;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .1s ease;-moz-transition:height .1s ease;-o-transition:height .1s ease;transition:height .1s ease}.tablesorter .filtered{display:none}.tablesorter .tablesorter-errorRow td{text-align:center;cursor:pointer;background-color:#e6bf99} \ No newline at end of file diff --git a/dist/css/theme.ice.min.css b/dist/css/theme.ice.min.css new file mode 100644 index 00000000..4fc17cca --- /dev/null +++ b/dist/css/theme.ice.min.css @@ -0,0 +1 @@ +.tablesorter-ice{width:100%;background-color:#fff;margin:10px 0 15px;text-align:left;border-spacing:0;border:1px solid #ccc;border-width:1px 0 0 1px}.tablesorter-ice td,.tablesorter-ice th{border:1px solid #ccc;border-width:0 1px 1px 0}.tablesorter-ice th,.tablesorter-ice thead td{font:12px/18px Arial,Sans-serif;color:#555;background-color:#f6f8f9;border-collapse:collapse;padding:4px;text-shadow:0 1px 0 rgba(255,255,255,.7)}.tablesorter-ice tbody td,.tablesorter-ice tfoot td,.tablesorter-ice tfoot th{padding:4px;vertical-align:top}.tablesorter-ice .header,.tablesorter-ice .tablesorter-header{background:url(data:image/gif;base64,R0lGODlhDAAMAMQAAAJEjAJCiwJBigJAiANFjgNGjgNEjQRIkQRHkANIkAVMlAVQmAZWnQZUnAdYoAhdpAhZoAlhqQlepQliqQppsApmrQxutgtutQtutAxwtwxwtg1yug1zugxtsw1yuP8A/yH5BAEAAB8ALAAAAAAMAAwAAAUx4Cd+3GiOW4ado2d9VMVm1xg9ptadTsP+QNZEcjoQTBDGCAFgLRSfQgCYMAiCn8EvBAA7) center right no-repeat #f6f8f9;padding:4px 20px 4px 4px;white-space:normal;cursor:pointer}.tablesorter-ice .headerSortUp,.tablesorter-ice .tablesorter-headerAsc,.tablesorter-ice .tablesorter-headerSortUp{color:#333;background:url(data:image/gif;base64,R0lGODlhDAAMANUAAAJCiwNHkANFjgNEjQRIkQNJkQRMlARKkwRKkgVPlwZSmgdaogdYnwhfpghcowlhqgliqglgqAlgpwljqwporwpmrQplrAtsswtqsgtrsgtqsQxttAtvtQtttAxyuQxwtwxxtwxvtg10uw1zuQ1xuP8A/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACUALAAAAAAMAAwAAAY6wJKwJBoahyNQ6Dj0fDoZCpPEuWgqk4jxs8FQLI+Gg8Esm5kQydFQMC7IwkOAqUiUCAIzIjA4lwBlQQA7) center right no-repeat #ebedee}.tablesorter-ice .headerSortDown,.tablesorter-ice .tablesorter-headerDesc,.tablesorter-ice .tablesorter-headerSortDown{color:#333;background:url(data:image/gif;base64,R0lGODlhDAAMANUAAAE/iAJBigNFjgNEjQNFjQNDiwRHkQRHjwNHjwROlgRMlQRMlARJkgRKkgZQmAVPlgZWnQZSmgZRmAdXoAdXnwdUnAdbogdZoQhbowlhqAlepglkrAliqQtstAtqsQxyugxyuQxwuAxxuAxxtwxwtgxvtQ10vA12vA10u/8A/wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACkALAAAAAAMAAwAAAY6wJQwdRoah6bP6DhEiVIdDxNEGm4yxlDpiJkwv2AmR2OhVCSJBsJ4gUQeCwOB6VAwBAXwYRAIpwBfQQA7) center right no-repeat #ebedee}.tablesorter-ice thead .sorter-false{background-image:none;cursor:default;padding:4px}.tablesorter-ice tfoot .tablesorter-headerAsc,.tablesorter-ice tfoot .tablesorter-headerDesc,.tablesorter-ice tfoot .tablesorter-headerSortDown,.tablesorter-ice tfoot .tablesorter-headerSortUp{background:#ebedee}.tablesorter-ice td{color:#333}.tablesorter-ice tbody>tr.even:hover>td,.tablesorter-ice tbody>tr.odd:hover>td,.tablesorter-ice tbody>tr:hover>td{background:#ebf2fa}.tablesorter-ice .tablesorter-processing{background-position:center center!important;background-repeat:no-repeat!important;background-image:url(data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=)!important}.tablesorter-ice tr.odd>td{background-color:#dfdfdf}.tablesorter-ice tr.even>td{background-color:#efefef}.tablesorter-ice td.primary,.tablesorter-ice tr.odd td.primary{background-color:#9ae5e5}.tablesorter-ice td.secondary,.tablesorter-ice tr.even td.primary,.tablesorter-ice tr.odd td.secondary{background-color:#c2f0f0}.tablesorter-ice td.tertiary,.tablesorter-ice tr.even td.secondary,.tablesorter-ice tr.odd td.tertiary{background-color:#d5f5f5}.tablesorter-ice tr.even td.tertiary{background-color:#ebfafa}.tablesorter-ice.containsStickyHeaders thead tr:nth-child(1) td,.tablesorter-ice.containsStickyHeaders thead tr:nth-child(1) th{border-top:#ccc 1px solid}caption{background:#fff}.tablesorter-ice .tablesorter-filter-row{background:#eee}.tablesorter-ice .tablesorter-filter-row td{background:#eee;line-height:normal;text-align:center;-webkit-transition:line-height .1s ease;-moz-transition:line-height .1s ease;-o-transition:line-height .1s ease;transition:line-height .1s ease}.tablesorter-ice .tablesorter-filter-row .disabled{opacity:.5;filter:alpha(opacity=50);cursor:not-allowed}.tablesorter-ice .tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0;cursor:pointer}.tablesorter-ice .tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0;filter:alpha(opacity=0)}.tablesorter-ice input.tablesorter-filter,.tablesorter-ice select.tablesorter-filter{width:98%;height:auto;margin:4px;padding:4px;background-color:#fff;border:1px solid #bbb;color:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .1s ease;-moz-transition:height .1s ease;-o-transition:height .1s ease;transition:height .1s ease}.tablesorter .filtered{display:none}.tablesorter .tablesorter-errorRow td{text-align:center;cursor:pointer;background-color:#e6bf99} \ No newline at end of file diff --git a/dist/css/theme.jui.min.css b/dist/css/theme.jui.min.css new file mode 100644 index 00000000..ef6c39fd --- /dev/null +++ b/dist/css/theme.jui.min.css @@ -0,0 +1 @@ +.tablesorter-jui{width:100%;border-collapse:separate;border-spacing:2px;margin:10px 0 15px;padding:5px;font-size:.8em}.tablesorter-jui tfoot td,.tablesorter-jui tfoot th,.tablesorter-jui thead td,.tablesorter-jui thead th{position:relative;background-repeat:no-repeat;background-position:right center;font-weight:700!important;border-width:1px!important;text-align:left;padding:8px}.tablesorter-jui .header,.tablesorter-jui .tablesorter-header{cursor:pointer;white-space:normal}.tablesorter-jui .tablesorter-header-inner{padding-right:20px}.tablesorter-jui thead tr th .ui-icon{position:absolute;right:3px;top:50%;margin-top:-8px}.tablesorter-jui thead .sorter-false{cursor:default}.tablesorter-jui thead tr .sorter-false .ui-icon{display:none}.tablesorter-jui tfoot td,.tablesorter-jui tfoot th{font-weight:400!important;font-size:.9em;padding:2px}.tablesorter-jui td{padding:4px;vertical-align:top}.tablesorter-jui tbody>tr:hover td{opacity:.7;filter:alpha(opacity=70)}.tablesorter-jui .tablesorter-processing .tablesorter-header-inner{background-position:center center!important;background-repeat:no-repeat!important;background-image:url(data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=)!important}.tablesorter-jui tr.ui-state-default{background-image:none;font-weight:400}.tablesorter-jui .tablesorter-processing{background-color:#ddd;background-color:rgba(255,255,255,.8)}.tablesorter-jui caption{border:0}.tablesorter-jui .tablesorter-filter-row{background:0 0}.tablesorter-jui .tablesorter-filter-row td{background:0 0;line-height:normal;text-align:center;-webkit-transition:line-height .1s ease;-moz-transition:line-height .1s ease;-o-transition:line-height .1s ease;transition:line-height .1s ease}.tablesorter-jui .tablesorter-filter-row .disabled{opacity:.5;filter:alpha(opacity=50);cursor:not-allowed}.tablesorter-jui .tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0;cursor:pointer}.tablesorter-jui .tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0;filter:alpha(opacity=0)}.tablesorter-jui input.tablesorter-filter,.tablesorter-jui select.tablesorter-filter{width:98%;height:auto;margin:0;padding:4px;background-color:#fff;border:1px solid #bbb;color:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .1s ease;-moz-transition:height .1s ease;-o-transition:height .1s ease;transition:height .1s ease}.tablesorter .filtered{display:none}.tablesorter .tablesorter-errorRow td{text-align:center;cursor:pointer;background-color:#e6bf99} \ No newline at end of file diff --git a/dist/css/theme.metro-dark.min.css b/dist/css/theme.metro-dark.min.css new file mode 100644 index 00000000..4941f861 --- /dev/null +++ b/dist/css/theme.metro-dark.min.css @@ -0,0 +1 @@ +.tablesorter-metro-dark{width:100%;font:12px/18px 'Segoe UI Semilight','Open Sans',Verdana,Arial,Helvetica,sans-serif;color:#000;background-color:#333;border-spacing:0;margin:10px 0 15px;text-align:left}.tablesorter-metro-dark caption.dark-row,.tablesorter-metro-dark tr.dark-row td,.tablesorter-metro-dark tr.dark-row th{background-color:#222;color:#fff;padding:2px;text-align:left;font-size:14px}.tablesorter-metro-dark caption,.tablesorter-metro-dark tfoot td,.tablesorter-metro-dark tfoot th,.tablesorter-metro-dark th,.tablesorter-metro-dark thead td{font-weight:300;font-size:15px;color:#ddd;background-color:#333;padding:4px}.tablesorter-metro-dark .header,.tablesorter-metro-dark .tablesorter-header{background-image:url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAGFBMVEUAAADu7u7u7u7u7u7u7u7u7u7u7u7u7u5jNePWAAAACHRSTlMAMxIHKwEgMWD59H4AAABSSURBVAjXY2BgYFJgAAHzYhDJ6igSAKTYBAUTgJSioKAQAwNzoaCguAFDiCAQuDIkgigxBgiA8cJAVCpQt6AgSL+JoKAzA0gjUBsQqBcBCYhFAAE/CV4zeSzxAAAAAElFTkSuQmCC);background-position:right 5px center;background-repeat:no-repeat;cursor:pointer;white-space:normal}.tablesorter-metro-dark .tablesorter-header-inner{padding:0 18px 0 4px}.tablesorter-metro-dark thead .headerSortUp,.tablesorter-metro-dark thead .tablesorter-headerAsc,.tablesorter-metro-dark thead .tablesorter-headerSortUp{background-image:url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAAIVBMVEUAAADu7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u5meJAOAAAACnRSTlMAMwsqXt+gIBUGxGoDMAAAAFlJREFUCNctzC0SQAAUReEzGNQ3AlHRiSRZFCVZYgeswRL8hLdK7834wj3tAlGP6y7fYHpKS6w6WwbVG0I1NZVnZPG8/DYxOYlnhUYkA06R1s9ESsxR4NIdPhkPFDFYuEnMAAAAAElFTkSuQmCC)}.tablesorter-metro-dark thead .headerSortDown,.tablesorter-metro-dark thead .tablesorter-headerDesc,.tablesorter-metro-dark thead .tablesorter-headerSortDown{background-image:url(data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAQBAMAAADQT4M0AAAALVBMVEUAAADu7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7u7i0NViAAAADnRSTlMAMiweCQITTvDctZZqaTlM310AAABcSURBVAjXY2BgYEtgAAFHERDJqigUAKSYBQUNgFSioKAYAwOLIBA4MASBKFUGQxAlzAAF+94BwWuGKBC1lIFl3rt3Lx0YGCzevWsGSjK9e6cAUlT3HKyW9wADAwDRrBiDy6bKzwAAAABJRU5ErkJggg==)}.tablesorter-metro-dark thead .sorter-false{background-image:none;cursor:default;padding:4px}.tablesorter-metro-dark td{background-color:#fff;padding:4px;vertical-align:top}.tablesorter-metro-dark tbody>tr.even:hover>td,.tablesorter-metro-dark tbody>tr.odd:hover>td,.tablesorter-metro-dark tbody>tr:hover>td{background:#bbb;color:#000}.tablesorter-metro-dark .tablesorter-processing{background-position:center center!important;background-repeat:no-repeat!important;background-image:url(data:image/gif;base64,R0lGODlhFAAUAKEAAO7u7lpaWgAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh+QQBCgACACwAAAAAFAAUAAACQZRvoIDtu1wLQUAlqKTVxqwhXIiBnDg6Y4eyx4lKW5XK7wrLeK3vbq8J2W4T4e1nMhpWrZCTt3xKZ8kgsggdJmUFACH5BAEKAAIALAcAAAALAAcAAAIUVB6ii7jajgCAuUmtovxtXnmdUAAAIfkEAQoAAgAsDQACAAcACwAAAhRUIpmHy/3gUVQAQO9NetuugCFWAAAh+QQBCgACACwNAAcABwALAAACE5QVcZjKbVo6ck2AF95m5/6BSwEAIfkEAQoAAgAsBwANAAsABwAAAhOUH3kr6QaAcSrGWe1VQl+mMUIBACH5BAEKAAIALAIADQALAAcAAAIUlICmh7ncTAgqijkruDiv7n2YUAAAIfkEAQoAAgAsAAAHAAcACwAAAhQUIGmHyedehIoqFXLKfPOAaZdWAAAh+QQFCgACACwAAAIABwALAAACFJQFcJiXb15zLYRl7cla8OtlGGgUADs=)!important}.tablesorter-metro-dark .tablesorter-pager button{background-color:#444;color:#eee;border:1px solid #555;cursor:pointer}.tablesorter-metro-dark .tablesorter-pager button:hover{background-color:#555}.tablesorter-metro-dark tr.odd>td{background-color:#eee}.tablesorter-metro-dark tr.even>td{background-color:#fff}.tablesorter-metro-dark tr.odd td.primary{background-color:#bfbfbf}.tablesorter-metro-dark td.primary,.tablesorter-metro-dark tr.even td.primary,.tablesorter-metro-dark tr.odd td.secondary{background-color:#d9d9d9}.tablesorter-metro-dark td.secondary,.tablesorter-metro-dark tr.even td.secondary,.tablesorter-metro-dark tr.odd td.tertiary{background-color:#e6e6e6}.tablesorter-metro-dark td.tertiary,.tablesorter-metro-dark tr.even td.tertiary{background-color:#f2f2f2}.tablesorter-metro-dark .tablesorter-filter-row{background:#eee}.tablesorter-metro-dark .tablesorter-filter-row td{background:#eee;line-height:normal;text-align:center;-webkit-transition:line-height .1s ease;-moz-transition:line-height .1s ease;-o-transition:line-height .1s ease;transition:line-height .1s ease}.tablesorter-metro-dark .tablesorter-filter-row .disabled{opacity:.5;filter:alpha(opacity=50);cursor:not-allowed}.tablesorter-metro-dark .tablesorter-filter-row.hideme td{padding:2px;margin:0;line-height:0;cursor:pointer}.tablesorter-metro-dark .tablesorter-filter-row.hideme *{height:1px;min-height:0;border:0;padding:0;margin:0;opacity:0;filter:alpha(opacity=0)}.tablesorter-metro-dark input.tablesorter-filter,.tablesorter-metro-dark select.tablesorter-filter{width:95%;height:auto;margin:4px;padding:4px;background-color:#fff;border:1px solid #bbb;color:#333;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:height .1s ease;-moz-transition:height .1s ease;-o-transition:height .1s ease;transition:height .1s ease}.tablesorter .filtered{display:none}.tablesorter .tablesorter-errorRow td{text-align:center;cursor:pointer;background-color:#e6bf99} \ No newline at end of file diff --git a/dist/js/extras/jquery.dragtable.mod.min.js b/dist/js/extras/jquery.dragtable.mod.min.js new file mode 100644 index 00000000..ee465ed5 --- /dev/null +++ b/dist/js/extras/jquery.dragtable.mod.min.js @@ -0,0 +1,3 @@ +/*! Dragtable Mod for TableSorter - 2/7/2015 (v2.19.0) */ +!function(a){"use strict";function b(){var b=a('');a(document.head).append(b),a(document.body).attr("onselectstart","return false;").attr("unselectable","on"),window.getSelection?window.getSelection().removeAllRanges():document.selection.empty()}function c(){a("#__dragtable_disable_text_selection__").remove(),f?a(document.body).attr("onselectstart",f):a(document.body).removeAttr("onselectstart"),g?a(document.body).attr("unselectable",g):a(document.body).removeAttr("unselectable")}var d,e=a.tablesorter;e.dragtable={create:function(b){var c,d=b.originalTable.el,e=b.options.dragHandle.replace(".","");d.children("thead").children().children("th,td").each(function(){var d=a(this);d.find(b.options.dragHandle+",."+e+"-disabled").length||(c=b.options.dragaccept?d.hasClass(b.options.dragaccept.replace(".","")):!0,d.wrapInner('
').prepend('
'))})},start:function(b){b=a(b)[0],b&&b.config&&(b.config.widgetOptions.dragtableLast={search:a(b).data("lastSearch"),order:e.dragtable.getOrder(b)})},update:function(b){var c,d,f,g=b.originalTable,h=g.el[0],i=a(h),j=h.config,k=j&&j.widgetOptions,l=g.startIndex-1,m=g.endIndex-1,n=e.dragtable.getOrder(h)||[],o=e.hasWidget(i,"filter")||!1,p=k&&k.dragtableLast||{},q=[];(p.order||[]).join("")!==n.join("")&&(j.sortList.length&&(d=a.extend(!0,[],j.sortList),a.each(n,function(a,b){f=e.isValueInArray(parseInt(b,10),d),b!==p.order[a]&&f>=0&&(j.sortList[f][0]=a)})),o&&a.each(p.search||[],function(a){q[a]=p.search[n[a]]}),c=e.hasWidget(j.$table,"editable")?k.editable_columnsArray:!1,c&&(j.widgetOptions.editable_columnsArray=e.dragtable.reindexArrayItem(c,l,m)),c=e.hasWidget(j.$table,"math")?k.math_ignore:!1,c&&(j.widgetOptions.math_ignore=e.dragtable.reindexArrayItem(c,l,m)),c=e.hasWidget(j.$table,"resizable")?k.resizable_widths:!1,c&&(k.resizable_widths=e.dragtable.moveArrayItem(c,l,m)),i.trigger("updateAll",[!1,function(){o&&setTimeout(function(){j.lastCombinedFilter=null,j.$table.data("lastSearch",q),e.setFilters(i,q),a.isFunction(b.options.tablesorterComplete)&&b.options.tablesorterComplete(j.table)},10)}]))},getOrder:function(b){return a(b).children("thead").children("."+e.css.headerRow).children().map(function(){return a(this).attr("data-column")}).get()||[]},startColumnMove:function(b){var c,d=b.el[0].config,f=b.startIndex-1,g=b.endIndex-1,h=d.columns-1,i=g===h?!1:f>=g,j=d.$table.children().children("tr");d.debug&&e.log("Inserting column "+f+(i?" before":" after")+" column "+g),j.each(function(){c=a(this).children(),c.eq(f)[i?"insertBefore":"insertAfter"](c.eq(g))}),c=d.$table.children("colgroup").children(),c.eq(f)[i?"insertBefore":"insertAfter"](c.eq(g))},swapNodes:function(a,b){var c,d,e,f=a.length;for(c=0;f>c;c++)d=a[c].parentNode,e=a[c].nextSibling===b[c]?a[c]:a[c].nextSibling,b[c].parentNode.insertBefore(a[c],b[c]),d.insertBefore(b[c],e)},moveArrayItem:function(a,b,c){var e,f=a.length;if(c>=f)for(e=c-f;e--+1;)a.push(d);return a.splice(c,0,a.splice(b,1)[0]),a},reindexArrayItem:function(b,c,d){var e=a.inArray(d,b),f=a.inArray(c,b),g=(Math.max.apply(Math,b),[]);return e>=0&&f>=0?b:(a.each(b,function(a,b){c>d?g.push(b>=d?b+(c>b?1:0):b):d>c&&(b===c?g.push(d):d>b&&b>=c?g.push(b-1):d>=b?g.push(b):b>c&&g.push(b+(d>b?0:1)))}),g.sort())}},/*! dragtable v2.0.14 Mod */ +a.widget("akottr.dragtable",{options:{revert:!1,dragHandle:".table-handle",maxMovingRows:40,excludeFooter:!1,onlyHeaderThreshold:100,dragaccept:null,persistState:null,restoreState:null,exact:!0,clickDelay:10,containment:null,cursor:"move",cursorAt:!1,distance:0,tolerance:"pointer",axis:"x",beforeStart:a.noop,beforeMoving:a.noop,beforeReorganize:a.noop,beforeStop:a.noop,tablesorterComplete:null,sortClass:".sorter"},originalTable:{el:null,selectedHandle:null,sortOrder:null,startIndex:0,endIndex:0},sortableTable:{el:a(),selectedHandle:a(),movingRow:a()},persistState:function(){var b=this;this.originalTable.el.find("th").each(function(a){""!==this.id&&(b.originalTable.sortOrder[this.id]=a)}),a.ajax({url:this.options.persistState,data:this.originalTable.sortOrder})},_restoreState:function(b){for(var c in b)c in b&&(this.originalTable.startIndex=a("#"+c).closest("th").prevAll().length+1,this.originalTable.endIndex=parseInt(b[c],10)+1,this._bubbleCols())},_bubbleCols:function(){e.dragtable.startColumnMove(this.originalTable)},_rearrangeTableBackroundProcessing:function(){var b=this;return function(){b._bubbleCols(),b.options.beforeStop(b.originalTable),b.sortableTable.el.remove(),c(),e.dragtable.update(b),a.isFunction(b.options.persistState)?b.options.persistState(b.originalTable):b.persistState()}},_rearrangeTable:function(){var a=this;return function(){a.originalTable.selectedHandle.removeClass("dragtable-handle-selected"),a.sortableTable.el.sortable("disable"),a.sortableTable.el.addClass("dragtable-disabled"),a.options.beforeReorganize(a.originalTable,a.sortableTable),a.originalTable.endIndex=a.sortableTable.movingRow.prevAll().length+1,setTimeout(a._rearrangeTableBackroundProcessing(),50)}},_generateSortable:function(c){c.cancelBubble?c.cancelBubble=!0:c.stopPropagation();for(var d=this,e=this.originalTable.el[0].attributes,f="",g=0;g',s=[],t=m.eq(0).children("th, td").length;for(g=0;t>g;g++){var u=m.children(":nth-child("+(g+1)+")");u.is(":visible")&&(q=0,s[g]='
  • "+(p?'':"")+"",m.each(function(a){s[g]+=""+u[a].outerHTML+""}),s[g]+="",u=n.children(":nth-child("+(g+1)+")"),d.options.maxMovingRows>1&&(u=u.add(n.children(":nth-child("+(g+1)+")").slice(0,d.options.maxMovingRows-1))),u.each(function(a){s[g]+=""+this.outerHTML+""}),s[g]+="",d.options.excludeFooter||(s[g]+=""+l.filter("tfoot").children("tr:visible").children()[g].outerHTML+""),s[g]+="
  • ")}r+=s.join("")+"",this.sortableTable.el=this.originalTable.el.before(r).prev(),this.sortableTable.el.find("> li > table").each(function(b){a(this).css("width",j[b]+"px")}),this.sortableTable.selectedHandle=this.sortableTable.el.find("th .dragtable-handle-selected");var v=this.options.dragaccept?"li:has("+this.options.dragaccept+")":"li";this.sortableTable.el.sortable({items:v,stop:this._rearrangeTable(),revert:this.options.revert,tolerance:this.options.tolerance,containment:this.options.containment,cursor:this.options.cursor,cursorAt:this.options.cursorAt,distance:this.options.distance,axis:this.options.axis}),this.originalTable.startIndex=a(c.target).closest("th,td").prevAll().length+1,this.options.beforeMoving(this.originalTable,this.sortableTable),this.sortableTable.movingRow=this.sortableTable.el.children("li:nth-child("+this.originalTable.startIndex+")"),b(),this.sortableTable.movingRow.trigger(a.extend(a.Event(c.type),{which:1,clientX:c.clientX,clientY:c.clientY,pageX:c.pageX,pageY:c.pageY,screenX:c.screenX,screenY:c.screenY}));var w=this.sortableTable.el.find(".ui-sortable-placeholder");w.height()>0&&w.css("height",this.sortableTable.el.find(".ui-sortable-helper").height()),w.html('
    ')},bindTo:{},_create:function(){var b=this;b.originalTable={el:b.element,selectedHandle:a(),sortOrder:{},startIndex:0,endIndex:0},e.dragtable.create(b),b.bindTo="> thead > tr > "+(b.options.dragaccept||"th, td"),b.element.find(b.bindTo).find(b.options.dragHandle).length&&(b.bindTo+=" "+b.options.dragHandle),a.isFunction(b.options.restoreState)?b.options.restoreState(b.originalTable):b._restoreState(b.options.restoreState),b.originalTable.el.on("mousedown.dragtable",b.bindTo,function(c){1===c.which&&(e.dragtable.start(b.originalTable.el),b.options.beforeStart(b.originalTable)!==!1&&(clearTimeout(b.downTimer),b.downTimer=setTimeout(function(){b.originalTable.selectedHandle=a(b),b.originalTable.selectedHandle.addClass("dragtable-handle-selected"),b._generateSortable(c)},b.options.clickDelay)))}).on("mouseup.dragtable",b.options.dragHandle,function(){clearTimeout(b.downTimer)})},redraw:function(){this.destroy(),this._create()},destroy:function(){this.originalTable.el.off("mousedown.dragtable mouseup.dragtable",this.bindTo),a.Widget.prototype.destroy.apply(this,arguments)}});var f=a(document.body).attr("onselectstart"),g=a(document.body).attr("unselectable")}(jQuery); \ No newline at end of file diff --git a/dist/js/extras/jquery.metadata.min.js b/dist/js/extras/jquery.metadata.min.js new file mode 100644 index 00000000..27450afd --- /dev/null +++ b/dist/js/extras/jquery.metadata.min.js @@ -0,0 +1 @@ +!function($){$.extend({metadata:{defaults:{type:"class",name:"metadata",cre:/(\{.*\})/,single:"metadata"},setType:function(a,b){this.defaults.type=a,this.defaults.name=b},get:function(elem,opts){var data,m,e,attr,settings=$.extend({},this.defaults,opts);if(settings.single.length||(settings.single="metadata"),data=$.data(elem,settings.single))return data;if(data="{}","class"===settings.type)m=settings.cre.exec(elem.className),m&&(data=m[1]);else if("elem"===settings.type){if(!elem.getElementsByTagName)return void 0;e=elem.getElementsByTagName(settings.name),e.length&&(data=$.trim(e[0].innerHTML))}else void 0!==elem.getAttribute&&(attr=elem.getAttribute(settings.name),attr&&(data=attr));return data.indexOf("{")<0&&(data="{"+data+"}"),data=eval("("+data+")"),$.data(elem,settings.single,data),data}}}),$.fn.metadata=function(a){return $.metadata.get(this[0],a)}}(jQuery); \ No newline at end of file diff --git a/dist/js/extras/jquery.quicksearch.min.js b/dist/js/extras/jquery.quicksearch.min.js new file mode 100644 index 00000000..9fcb7ec6 --- /dev/null +++ b/dist/js/extras/jquery.quicksearch.min.js @@ -0,0 +1 @@ +!function(a,b){a.fn.quicksearch=function(c,d){var e,f,g,h,i="",j=this,k=a.extend({delay:100,selector:null,stripeRows:null,loader:null,noResults:"",childRow:"tablesorter-childRow",matchedResultsCount:0,bind:"keyup",onBefore:function(){},onAfter:function(){},show:function(){this.style.display=""},hide:function(){this.style.display="none"},prepareQuery:function(a){return a.toLowerCase().split(" ")},testQuery:function(a,b){for(var c=0;cc;c++)j||k.testQuery(h,f[c],g[c])||a(g[c]).hasClass(k.childRow)&&a(g[c>1?c-1:0]).is(":visible")?(k.show.apply(g[c]),e=!1,d++):k.hide.apply(g[c]);return e?this.results(!1):(this.results(!0),this.stripe()),this.matchedResultsCount=d,this.loader(!1),k.onAfter(),this},this.search=function(a){i=a,j.trigger()},this.currentMatchedResults=function(){return this.matchedResultsCount},this.stripe=function(){if("object"==typeof k.stripeRows&&null!==k.stripeRows){var b=k.stripeRows.join(" "),c=k.stripeRows.length;h.not(":hidden").each(function(d){a(this).removeClass(b).addClass(k.stripeRows[d%c])})}return this},this.strip_html=function(b){var c=b.replace(new RegExp("<[^<]+>","g"),"");return c=a.trim(c.toLowerCase())},this.results=function(b){return"string"==typeof k.noResults&&""!==k.noResults&&(b?a(k.noResults).hide():a(k.noResults).show()),this},this.loader=function(b){return"string"==typeof k.loader&&""!==k.loader&&(b?a(k.loader).show():a(k.loader).hide()),this},this.cache=function(){h=a(c),"string"==typeof k.noResults&&""!==k.noResults&&(h=h.not(k.noResults));var b="string"==typeof k.selector?h.find(k.selector):a(c).not(k.noResults);return f=b.map(function(){return j.strip_html(this.innerHTML)}),g=h.map(function(){return this}),i=i||this.val()||"",this.go()},this.trigger=function(){return this.loader(!0),k.onBefore(),b.clearTimeout(e),e=b.setTimeout(function(){j.go()},k.delay),this},this.cache(),this.results(!0),this.stripe(),this.loader(!1),this.each(function(){a(this).on(k.bind,function(){i=a(this).val(),j.trigger()})})}}(jQuery,this,document); \ No newline at end of file diff --git a/dist/js/extras/jquery.tablesorter.pager.min.js b/dist/js/extras/jquery.tablesorter.pager.min.js new file mode 100644 index 00000000..003b6e03 --- /dev/null +++ b/dist/js/extras/jquery.tablesorter.pager.min.js @@ -0,0 +1,6 @@ +/*! + * tablesorter (FORK) pager plugin + * updated 2/9/2015 (v2.19.1) + */ +!function(a){"use strict";var b=a.tablesorter;a.extend({tablesorterPager:new function(){this.defaults={container:null,ajaxUrl:null,customAjaxUrl:function(a,b){return b},ajaxObject:{dataType:"json"},processAjaxOnInit:!0,ajaxProcessing:function(){return[0,[],null]},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:!0,page:0,pageReset:0,size:10,maxOptionSize:20,savePages:!0,storageKey:"tablesorter-pager",fixedHeight:!1,countChildRows:!1,removeRows:!1,cssFirst:".first",cssPrev:".prev",cssNext:".next",cssLast:".last",cssGoto:".gotoPage",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize",cssErrorRow:"tablesorter-errorRow",cssDisabled:"disabled",totalRows:0,totalPages:0,filteredRows:0,filteredPages:0,ajaxCounter:0,currentFilters:[],startRow:0,endRow:0,$size:null,last:{}};var c="filterInit filterStart filterEnd sortEnd disable enable destroy updateComplete pageSize pageSet pageAndSize pagerUpdate ",d=this,e=function(a,b){var c="addClass",d="removeClass",e=a.cssDisabled,f=!!b,g=f||0===a.page,h=Math.min(a.totalPages,a.filteredPages),i=f||a.page===h-1||0===h;a.updateArrows&&(a.$container.find(a.cssFirst+","+a.cssPrev)[g?c:d](e).attr("aria-disabled",g),a.$container.find(a.cssNext+","+a.cssLast)[i?c:d](e).attr("aria-disabled",i))},f=function(b,c){var d,e=b.config,f=e.$table.hasClass("hasFilters");f&&!c.ajaxUrl?a.isEmptyObject(e.cache)?c.filteredRows=c.totalRows=e.$tbodies.eq(0).children("tr").not(c.countChildRows?"":"."+e.cssChildRow).length:(d=e.$table.children("tbody").index(e.$tbodies.eq(0)),c.filteredRows=0,a.each(e.cache[d].normalized,function(a,b){c.filteredRows+=c.regexRows.test(b[e.columns].$row[0].className)?0:1})):f||(c.filteredRows=c.totalRows)},g=function(c,d,g){if(!d.initializing){var j,k,l,m=c.config,n=d.size||d.settings.size||10;d.countChildRows&&k.push(m.cssChildRow),d.totalPages=Math.ceil(d.totalRows/n),m.totalRows=d.totalRows,f(c,d),m.filteredRows=d.filteredRows,d.filteredPages=Math.ceil(d.filteredRows/n)||0,Math.min(d.totalPages,d.filteredPages)>=0&&(k=d.size*d.page>d.filteredRows&&g,d.page=k?d.pageReset||0:d.page,d.startRow=k?d.size*d.page+1:0===d.filteredRows?0:d.size*d.page+1,d.endRow=Math.min(d.filteredRows,d.totalRows,d.size*(d.page+1)),l=d.$container.find(d.cssPageDisplay),j=(d.ajaxData&&d.ajaxData.output?d.ajaxData.output||d.output:d.output).replace(/\{page([\-+]\d+)?\}/gi,function(a,b){return d.totalPages?d.page+(b?parseInt(b,10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(a){var b,c,e=a.replace(/[{}\s]/g,""),f=e.split(":"),g=d.ajaxData,h=/(rows?|pages?)$/i.test(e)?0:"";return/(startRow|page)/.test(f[0])&&"input"===f[1]?(b=(""+("page"===f[0]?d.totalPages:d.totalRows)).length,c="page"===f[0]?d.page+1:d.startRow,''):f.length>1&&g&&g[f[0]]?g[f[0]][f[1]]:d[e]||(g?g[e]:h)||h}),d.$goto.length&&(k="",a.each(h(d),function(a,b){k+='"}),d.$goto.html(k).val(d.page+1)),l.length&&(l["INPUT"===l[0].tagName?"val":"html"](j),l.find(".ts-startRow, .ts-page").unbind("change.pager").bind("change.pager",function(){var b=a(this).val(),c=a(this).hasClass("ts-startRow")?Math.floor(b/d.size)+1:b;m.$table.trigger("pageSet.pager",[c])}))),e(d),i(c,d),d.initialized&&g!==!1&&(m.$table.trigger("pagerComplete",d),d.savePages&&b.storage&&b.storage(c,d.storageKey,{page:d.page,size:d.size}))}},h=function(b){var c,d,e,f,g,h,i=Math.min(b.totalPages,b.filteredPages)||1,j=5*Math.ceil(i/b.maxOptionSize/5),k=i>b.maxOptionSize,l=b.page+1,m=j,n=i-j,o=[1],p=k?j:1;for(c=p;i>=c;)o.push(c),c+=k?j:1;if(o.push(i),k){for(e=[],d=Math.max(Math.floor(b.maxOptionSize/j)-1,5),m=l-d,1>m&&(m=1),n=l+d,n>i&&(n=i),c=m;n>=c;c++)e.push(c);o=a.grep(o,function(b,c){return a.inArray(b,o)===c}),g=o.length,h=e.length,g-h>j/2&&g+h>b.maxOptionSize&&(f=Math.floor(g/2)-Math.floor(h/2),Array.prototype.splice.apply(o,[f,h])),o=o.concat(e)}return o=a.grep(o,function(b,c){return a.inArray(b,o)===c}).sort(function(a,b){return a-b})},i=function(b,c){var d,e,f=b.config,g=f.$tbodies.eq(0);g.find("tr.pagerSavedHeightSpacer").remove(),c.fixedHeight&&!c.isDisabled&&(e=a.data(b,"pagerSavedHeight"),e&&(d=e-g.height(),d>5&&a.data(b,"pagerLastSize")===c.size&&g.children("tr:visible").length')))},j=function(b,c){var d,e=b.config,f=e.$tbodies.eq(0);f.find("tr.pagerSavedHeightSpacer").remove(),f.children("tr:visible").length||f.append(' '),d=f.children("tr").eq(0).height()*c.size,a.data(b,"pagerSavedHeight",d),i(b,c),a.data(b,"pagerLastSize",c.size)},k=function(a,c){if(!c.ajaxUrl){var d,e=0,f=a.config,g=f.$tbodies.eq(0).children("tr"),h=g.length,i=c.page*c.size,j=i+c.size,k=f.widgetOptions&&f.widgetOptions.filter_filteredRow||"filtered",l=0,m=0;for(c.cacheIndex=[],d=0;h>d;d++)g[d].className.match(k)||(m===i&&g[d].className.match(f.cssChildRow)?g[d].style.display="none":(g[d].style.display=m>=i&&j>m?"":"none",l!==m&&m>=i&&j>m&&(c.cacheIndex.push(d),l=m),m+=g[d].className.match(f.cssChildRow+"|"+f.selectorRemove.slice(1))&&!c.countChildRows?0:1,m===j&&"none"!==g[d].style.display&&g[d].className.match(b.css.cssHasChild)&&(e=d)));if(e>0&&g[e].className.match(b.css.cssHasChild))for(;++ei;i++){for(u+="",j=0;j"+p[i][j]+"";u+=""}e.processAjaxOnInit&&s.$tbodies.eq(0).html(u)}e.processAjaxOnInit=!0,o&&o.length===w&&(k=t.hasClass("hasStickyHeaders"),m=k?s.widgetOptions.$sticky.children("thead:first").children("tr").children():"",l=t.find("tfoot tr:first").children(),s.$headers.filter("th").each(function(c){var d,e=a(this);e.find("."+b.css.icon).length?(d=e.find("."+b.css.icon).clone(!0),e.find(".tablesorter-header-inner").html(o[c]).append(d),k&&m.length&&(d=m.eq(c).find("."+b.css.icon).clone(!0),m.eq(c).find(".tablesorter-header-inner").html(o[c]).append(d))):(e.find(".tablesorter-header-inner").html(o[c]),k&&m.length&&m.eq(c).find(".tablesorter-header-inner").html(o[c])),l.eq(c).html(o[c])}))}s.showProcessing&&b.isProcessing(d),e.totalPages=Math.ceil(e.totalRows/(e.size||e.settings.size||10)),e.last.totalRows=e.totalRows,e.last.currentFilters=e.currentFilters,e.last.sortList=(s.sortList||[]).join(","),g(d,e,!1),t.trigger("updateCache",[function(){e.initialized&&setTimeout(function(){t.trigger("applyWidgets").trigger("pagerChange",e),g(d,e,!0)},0)}])}e.initialized||(e.initialized=!0,e.initializing=!1,a(d).trigger("applyWidgets").trigger("pagerInitialized",e),g(d,e))},n=function(c,d){var e,f=o(c,d),g=a(document),h=c.config;""!==f&&(h.showProcessing&&b.isProcessing(c,!0),g.bind("ajaxError.pager",function(a,b,e,f){m(null,c,d,b,f),g.unbind("ajaxError.pager")}),e=++d.ajaxCounter,d.last.ajaxUrl=f,d.ajaxObject.url=f,d.ajaxObject.success=function(a,b,f){eo)return void(m.debug&&b.log("Pager: no rows for pager to render"));if(e.page>=e.totalPages&&v(c,e),e.cacheIndex=[],e.isDisabled=!1,e.initialized&&l.trigger("pagerChange",e),e.removeRows){for(b.clearTableBody(c),f=b.processTbody(c,m.$tbodies.eq(0),!0),h=n?0:p,i=n?0:p,j=0;q>j&&hp&&q>=j&&(j++,e.cacheIndex.push(h),f.append(d[h]))),h++;b.processTbody(c,f,!1)}else k(c,e);g(c,e),c.isUpdating&&l.trigger("updateComplete",[c,!0])},q=function(c,d){d.ajax?e(d,!0):(d.isDisabled=!0,a.data(c,"pagerLastPage",d.page),a.data(c,"pagerLastSize",d.size),d.page=0,d.size=d.totalRows,d.totalPages=1,a(c).addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),p(c,c.config.rowsCopy,d),a(c).trigger("applyWidgets"),c.config.debug&&b.log("pager disabled")),d.$size.add(d.$goto).add(d.$container.find(".ts-startRow, .ts-page")).each(function(){a(this).attr("aria-disabled","true").addClass(d.cssDisabled)[0].disabled=!0})},r=function(a){var b=a.config,c=b.pager;b.$table.trigger("updateCache",[function(){var d,e=[],f=b.$table.children("tbody").index(b.$tbodies.eq(0)),g=a.config.cache[f].normalized;for(c.totalRows=g.length,d=0;dg-1&&0!==g&&(d.page=g-1),j.currentFilters=""===(j.currentFilters||[]).join("")?[]:j.currentFilters,d.currentFilters=""===(d.currentFilters||[]).join("")?[]:d.currentFilters,(j.page!==d.page||j.size!==d.size||j.totalRows!==d.totalRows||(j.currentFilters||[]).join(",")!==(d.currentFilters||[]).join(",")||(j.ajaxUrl||"")!==(d.ajaxObject.url||"")||(j.optAjaxUrl||"")!==(d.ajaxUrl||"")||j.sortList!==(h.sortList||[]).join(","))&&(h.debug&&b.log("Pager changing to page "+d.page),d.last={page:d.page,size:d.size,sortList:(h.sortList||[]).join(","),totalRows:d.totalRows,currentFilters:d.currentFilters||[],ajaxUrl:d.ajaxObject.url||"",optAjaxUrl:d.ajaxUrl||""},d.ajax?n(c,d):d.ajax||p(c,h.rowsCopy,d),a.data(c,"pagerLastPage",d.page),d.initialized&&e!==!1&&(i.trigger("pageMoved",d).trigger("applyWidgets"),c.isUpdating&&i.trigger("updateComplete",[c,!0])))))}},t=function(b,c,d){d.size=c||d.size||d.settings.size||10,d.$size.val(d.size),a.data(b,"pagerLastPage",d.page),a.data(b,"pagerLastSize",d.size),d.totalPages=Math.ceil(d.totalRows/d.size),d.filteredPages=Math.ceil(d.filteredRows/d.size),s(b,d)},u=function(a,b){b.page=0,s(a,b)},v=function(a,b){b.page=Math.min(b.totalPages,b.filteredPages)-1,s(a,b)},w=function(a,b){b.page++,b.page>=Math.min(b.totalPages,b.filteredPages)-1&&(b.page=Math.min(b.totalPages,b.filteredPages)-1),s(a,b)},x=function(a,b){b.page--,b.page<=0&&(b.page=0),s(a,b)},y=function(d,e){q(d,e),e.$container.hide(),d.config.appender=null,e.initialized=!1,delete d.config.rowsCopy,a(d).unbind(a.trim(c.split(" ").join(".pager "))),b.storage&&b.storage(d,e.storageKey,"")},z=function(c,d,e){var f,g=c.config;d.$size.add(d.$goto).add(d.$container.find(".ts-startRow, .ts-page")).removeClass(d.cssDisabled).removeAttr("disabled").attr("aria-disabled","false"),d.isDisabled=!1,d.page=a.data(c,"pagerLastPage")||d.page||0,d.size=a.data(c,"pagerLastSize")||parseInt(d.$size.find("option[selected]").val(),10)||d.size||d.settings.size||10,d.$size.val(d.size),d.totalPages=Math.ceil(Math.min(d.totalRows,d.filteredRows)/d.size),c.id&&(f=c.id+"_pager_info",d.$container.find(d.cssPageDisplay).attr("id",f),g.$table.attr("aria-describedby",f)),j(c,d),e&&(g.$table.trigger("updateRows"),t(c,d.size,d),l(c,d),g.debug&&b.log("pager enabled"))};d.appender=function(b,c){var d=b.config,e=d.pager;e.ajax||(d.rowsCopy=c,e.totalRows=e.countChildRows?d.$tbodies.eq(0).children("tr").length:c.length,e.size=a.data(b,"pagerLastSize")||e.size||e.settings.size||10,e.totalPages=Math.ceil(e.totalRows/e.size),p(b,c,e),g(b,e,!1))},d.construct=function(e){return this.each(function(){if(this.config&&this.hasInitialized){var f,h,i,m=this,n=m.config,o=n.widgetOptions,p=n.pager=a.extend(!0,{},a.tablesorterPager.defaults,e),A=n.$table,B=p.$container=a(p.container).addClass("tablesorter-pager").show();p.settings=a.extend(!0,{},a.tablesorterPager.defaults,e),n.debug&&b.log("Pager initializing"),p.oldAjaxSuccess=p.oldAjaxSuccess||p.ajaxObject.success,n.appender=d.appender,p.initializing=!0,p.savePages&&b.storage&&(f=b.storage(m,p.storageKey)||{},p.page=isNaN(f.page)?p.page:f.page,p.size=(isNaN(f.size)?p.size:f.size)||p.settings.size||10,a.data(m,"pagerLastSize",p.size)),p.regexRows=new RegExp("("+(o.filter_filteredRow||"filtered")+"|"+n.selectorRemove.slice(1)+"|"+n.cssChildRow+")"),A.unbind(a.trim(c.split(" ").join(".pager "))).bind("filterInit.pager filterStart.pager",function(b,c){p.currentFilters=a.isArray(c)?c:n.$table.data("lastSearch"),"filterStart"===b.type&&p.pageReset!==!1&&(n.lastCombinedFilter||"")!==(p.currentFilters||[]).join("")&&(p.page=p.pageReset)}).bind("filterEnd.pager sortEnd.pager",function(){p.currentFilters=n.$table.data("lastSearch"),(p.initialized||p.initializing)&&(n.delayInit&&n.rowsCopy&&0===n.rowsCopy.length&&r(m),g(m,p,!1),s(m,p,!1),n.$table.trigger("applyWidgets"))}).bind("disable.pager",function(a){a.stopPropagation(),q(m,p)}).bind("enable.pager",function(a){a.stopPropagation(),z(m,p,!0)}).bind("destroy.pager",function(a){a.stopPropagation(),y(m,p)}).bind("updateComplete.pager",function(a,b,c){if(a.stopPropagation(),b&&!c){var d=n.$tbodies.eq(0).children("tr").not(n.selectorRemove);p.totalRows=d.length-(p.countChildRows?0:d.filter("."+n.cssChildRow).length),p.totalPages=Math.ceil(p.totalRows/p.size),d.length&&n.rowsCopy&&0===n.rowsCopy.length&&r(b),p.page>=p.totalPages&&v(b,p),k(b,p),j(b,p),g(b,p,!0)}}).bind("pageSize.pager refreshComplete.pager",function(a,b){a.stopPropagation(),t(m,parseInt(b,10)||p.settings.size||10,p),k(m,p),g(m,p,!1)}).bind("pageSet.pager pagerUpdate.pager",function(a,b){a.stopPropagation(),p.page=(parseInt(b,10)||1)-1,"pagerUpdate"===a.type&&(p.last.page=!0),s(m,p,!0),g(m,p,!1)}).bind("pageAndSize.pager",function(a,b,c){a.stopPropagation(),p.page=(parseInt(b,10)||1)-1,t(m,parseInt(c,10)||p.settings.size||10,p),s(m,p,!0),k(m,p),g(m,p,!1)}),h=[p.cssFirst,p.cssPrev,p.cssNext,p.cssLast],i=[u,x,w,v],B.find(h.join(",")).attr("tabindex",0).unbind("click.pager").bind("click.pager",function(b){b.stopPropagation();var c,d=a(this),e=h.length;if(!d.hasClass(p.cssDisabled))for(c=0;e>c;c++)if(d.is(h[c])){i[c](m,p);break}}),p.$goto=B.find(p.cssGoto),p.$goto.length&&p.$goto.unbind("change.pager").bind("change.pager",function(){p.page=a(this).val()-1,s(m,p,!0),g(m,p,!1)}),p.$size=B.find(p.cssPageSize),p.$size.length&&(p.$size.find("option").removeAttr("selected"),p.$size.unbind("change.pager").bind("change.pager",function(){return p.$size.val(a(this).val()),a(this).hasClass(p.cssDisabled)||(t(m,parseInt(a(this).val(),10),p),j(m,p)),!1})),p.initialized=!1,A.trigger("pagerBeforeInitialized",p),z(m,p,!1),"string"==typeof p.ajaxUrl?(p.ajax=!0,n.widgetOptions.filter_serversideFiltering=!0,n.serverSideSorting=!0,s(m,p)):(p.ajax=!1,a(this).trigger("appendCache",!0),l(m,p)),p.ajax||p.initialized||(p.initializing=!1,p.initialized=!0,s(m,p),a(m).trigger("pagerInitialized",p),n.widgetOptions.filter_initialized&&b.hasWidget(m,"filter")||g(m,p,!1))}})}}}),b.showError=function(b,c){a(b).each(function(){var b,d=this.config,e=d.pager&&d.pager.cssErrorRow||d.widgetOptions.pager_css&&d.widgetOptions.pager_css.errorRow||"tablesorter-errorRow";d&&("undefined"==typeof c?d.$table.find("thead").find(d.selectorRemove).remove():b=a(/tr\>/.test(c)?c:''+c+"").click(function(){a(this).remove()}).appendTo(d.$table.find("thead:first")).addClass(e+" "+d.selectorRemove.slice(1)).attr({role:"alert","aria-live":"assertive"}))})},a.fn.extend({tablesorterPager:a.tablesorterPager.construct})}(jQuery),function(a){var b=a.tablesorter;a.extend({tablesorterPager:new function(){this.defaults={container:null,ajaxUrl:null,customAjaxUrl:function(a,b){return b},ajaxObject:{dataType:"json"},processAjaxOnInit:!0,ajaxProcessing:function(){return[0,[],null]},output:"{startRow} to {endRow} of {totalRows} rows",updateArrows:!0,page:0,pageReset:0,size:10,maxOptionSize:20,savePages:!0,storageKey:"tablesorter-pager",fixedHeight:!1,countChildRows:!1,removeRows:!1,cssFirst:".first",cssPrev:".prev",cssNext:".next",cssLast:".last",cssGoto:".gotoPage",cssPageDisplay:".pagedisplay",cssPageSize:".pagesize",cssErrorRow:"tablesorter-errorRow",cssDisabled:"disabled",totalRows:0,totalPages:0,filteredRows:0,filteredPages:0,ajaxCounter:0,currentFilters:[],startRow:0,endRow:0,$size:null,last:{}};var c=this,d=function(a,b){var c=a.cssDisabled,d=!!b,e=d||0===a.page,f=Math.min(a.totalPages,a.filteredPages),d=d||a.page===f-1||0===f;a.updateArrows&&(a.$container.find(a.cssFirst+","+a.cssPrev)[e?"addClass":"removeClass"](c).attr("aria-disabled",e),a.$container.find(a.cssNext+","+a.cssLast)[d?"addClass":"removeClass"](c).attr("aria-disabled",d))},e=function(b,c){var d,e=b.config;(d=e.$table.hasClass("hasFilters"))&&!c.ajaxUrl?a.isEmptyObject(e.cache)?c.filteredRows=c.totalRows=e.$tbodies.eq(0).children("tr").not(c.countChildRows?"":"."+e.cssChildRow).length:(d=e.$table.children("tbody").index(e.$tbodies.eq(0)),c.filteredRows=0,a.each(e.cache[d].normalized,function(a,b){c.filteredRows+=c.regexRows.test(b[e.columns].$row[0].className)?0:1})):d||(c.filteredRows=c.totalRows)},f=function(c,f,i){if(!f.initializing){var j,k,l,m=c.config;j=f.size||f.settings.size||10,f.countChildRows&&k.push(m.cssChildRow),f.totalPages=Math.ceil(f.totalRows/j),m.totalRows=f.totalRows,e(c,f),m.filteredRows=f.filteredRows,f.filteredPages=Math.ceil(f.filteredRows/j)||0,0<=Math.min(f.totalPages,f.filteredPages)&&(k=f.size*f.page>f.filteredRows&&i,f.page=k?f.pageReset||0:f.page,f.startRow=k?f.size*f.page+1:0===f.filteredRows?0:f.size*f.page+1,f.endRow=Math.min(f.filteredRows,f.totalRows,f.size*(f.page+1)),l=f.$container.find(f.cssPageDisplay),j=(f.ajaxData&&f.ajaxData.output?f.ajaxData.output||f.output:f.output).replace(/\{page([\-+]\d+)?\}/gi,function(a,b){return f.totalPages?f.page+(b?parseInt(b,10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(a){var b,c;b=a.replace(/[{}\s]/g,""),a=b.split(":"),c=f.ajaxData;var d=/(rows?|pages?)$/i.test(b)?0:"";return/(startRow|page)/.test(a[0])&&"input"===a[1]?(b=(""+("page"===a[0]?f.totalPages:f.totalRows)).length,c="page"===a[0]?f.page+1:f.startRow,''):1'+b+""}),f.$goto.html(k).val(f.page+1)),l.length&&(l["INPUT"===l[0].tagName?"val":"html"](j),l.find(".ts-startRow, .ts-page").unbind("change.pager").bind("change.pager",function(){var b=a(this).val(),b=a(this).hasClass("ts-startRow")?Math.floor(b/f.size)+1:b;m.$table.trigger("pageSet.pager",[b])}))),d(f),h(c,f),f.initialized&&!1!==i&&(m.$table.trigger("pagerComplete",f),f.savePages&&b.storage&&b.storage(c,f.storageKey,{page:f.page,size:f.size}))}},g=function(b){var c,d,e,f,g;g=Math.min(b.totalPages,b.filteredPages)||1;var h=5*Math.ceil(g/b.maxOptionSize/5);e=g>b.maxOptionSize,f=b.page+1,c=h,d=g-h;var i=[1];for(c=e?h:1;g>=c;)i.push(c),c+=e?h:1;if(i.push(g),e){for(e=[],d=Math.max(Math.floor(b.maxOptionSize/h)-1,5),c=f-d,1>c&&(c=1),d=f+d,d>g&&(d=g);d>=c;c++)e.push(c);i=a.grep(i,function(b,c){return a.inArray(b,i)===c}),f=i.length,g=e.length,f-g>h/2&&f+g>b.maxOptionSize&&(b=Math.floor(f/2)-Math.floor(g/2),Array.prototype.splice.apply(i,[b,g])),i=i.concat(e)}return i=a.grep(i,function(b,c){return a.inArray(b,i)===c}).sort(function(a,b){return a-b})},h=function(b,c){var d,e=b.config,f=e.$tbodies.eq(0);f.find("tr.pagerSavedHeightSpacer").remove(),c.fixedHeight&&!c.isDisabled&&(d=a.data(b,"pagerSavedHeight"))&&(d-=f.height(),d>5&&a.data(b,"pagerLastSize")===c.size&&f.children("tr:visible").length'))},i=function(b,c){var d;d=b.config;var e=d.$tbodies.eq(0);e.find("tr.pagerSavedHeightSpacer").remove(),e.children("tr:visible").length||e.append(' '),d=e.children("tr").eq(0).height()*c.size,a.data(b,"pagerSavedHeight",d),h(b,c),a.data(b,"pagerLastSize",c.size)},j=function(a,c){if(!c.ajaxUrl){var d,e=0,f=a.config,g=f.$tbodies.eq(0).children("tr"),h=g.length,i=c.page*c.size,j=i+c.size,k=f.widgetOptions&&f.widgetOptions.filter_filteredRow||"filtered",l=0,m=0;for(c.cacheIndex=[],d=0;h>d;d++)g[d].className.match(k)||(m===i&&g[d].className.match(f.cssChildRow)?g[d].style.display="none":(g[d].style.display=m>=i&&j>m?"":"none",l!==m&&m>=i&&j>m&&(c.cacheIndex.push(d),l=m),m+=g[d].className.match(f.cssChildRow+"|"+f.selectorRemove.slice(1))&&!c.countChildRows?0:1,m===j&&"none"!==g[d].style.display&&g[d].className.match(b.css.cssHasChild)&&(e=d)));if(e>0&&g[e].className.match(b.css.cssHasChild))for(;++ei;i++){for(q+="",h=0;h"+g[i][h]+"";q+=""}e.processAjaxOnInit&&o.$tbodies.eq(0).html(q)}e.processAjaxOnInit=!0,m&&m.length===c&&(l=(j=p.hasClass("hasStickyHeaders"))?o.widgetOptions.$sticky.children("thead:first").children("tr").children():"",k=p.find("tfoot tr:first").children(),o.$headers.filter("th").each(function(c){var d,e=a(this);e.find("."+b.css.icon).length?(d=e.find("."+b.css.icon).clone(!0),e.find(".tablesorter-header-inner").html(m[c]).append(d),j&&l.length&&(d=l.eq(c).find("."+b.css.icon).clone(!0),l.eq(c).find(".tablesorter-header-inner").html(m[c]).append(d))):(e.find(".tablesorter-header-inner").html(m[c]),j&&l.length&&l.eq(c).find(".tablesorter-header-inner").html(m[c])),k.eq(c).html(m[c])}))}o.showProcessing&&b.isProcessing(d),e.totalPages=Math.ceil(e.totalRows/(e.size||e.settings.size||10)),e.last.totalRows=e.totalRows,e.last.currentFilters=e.currentFilters,e.last.sortList=(o.sortList||[]).join(","),f(d,e,!1),p.trigger("updateCache",[function(){e.initialized&&setTimeout(function(){p.trigger("applyWidgets").trigger("pagerChange",e),f(d,e,!0)},0)}])}e.initialized||(e.initialized=!0,e.initializing=!1,a(d).trigger("applyWidgets").trigger("pagerInitialized",e),f(d,e))},m=function(c,d){var e,f=n(c,d),g=a(document),h=c.config;""!==f&&(h.showProcessing&&b.isProcessing(c,!0),g.bind("ajaxError.pager",function(a,b,e,f){l(null,c,d,b,f),g.unbind("ajaxError.pager")}),e=++d.ajaxCounter,d.last.ajaxUrl=f,d.ajaxObject.url=f,d.ajaxObject.success=function(a,b,f){e(d&&d.length||0))g.debug&&b.log("Pager: no rows for pager to render");else{if(e.page>=e.totalPages&&u(c,e),e.cacheIndex=[],e.isDisabled=!1,e.initialized&&l.trigger("pagerChange",e),e.removeRows){for(b.clearTableBody(c),g=b.processTbody(c,g.$tbodies.eq(0),!0),h=m?0:n,i=m?0:n,k=0;o>k&&hn&&o>=k&&(k++,e.cacheIndex.push(h),g.append(d[h]))),h++;b.processTbody(c,g,!1)}else j(c,e);f(c,e),c.isUpdating&&l.trigger("updateComplete",[c,!0])}},p=function(c,e){e.ajax?d(e,!0):(e.isDisabled=!0,a.data(c,"pagerLastPage",e.page),a.data(c,"pagerLastSize",e.size),e.page=0,e.size=e.totalRows,e.totalPages=1,a(c).addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),o(c,c.config.rowsCopy,e),a(c).trigger("applyWidgets"),c.config.debug&&b.log("pager disabled")),e.$size.add(e.$goto).add(e.$container.find(".ts-startRow, .ts-page")).each(function(){a(this).attr("aria-disabled","true").addClass(e.cssDisabled)[0].disabled=!0})},q=function(a){var b=a.config,c=b.pager;b.$table.trigger("updateCache",[function(){var d,e=[];d=b.$table.children("tbody").index(b.$tbodies.eq(0));var f=a.config.cache[d].normalized;for(c.totalRows=f.length,d=0;dd.page&&(d.page=0),d.page>g-1&&0!==g&&(d.page=g-1),j.currentFilters=""===(j.currentFilters||[]).join("")?[]:j.currentFilters,d.currentFilters=""===(d.currentFilters||[]).join("")?[]:d.currentFilters,(j.page!==d.page||j.size!==d.size||j.totalRows!==d.totalRows||(j.currentFilters||[]).join(",")!==(d.currentFilters||[]).join(",")||(j.ajaxUrl||"")!==(d.ajaxObject.url||"")||(j.optAjaxUrl||"")!==(d.ajaxUrl||"")||j.sortList!==(h.sortList||[]).join(","))&&(h.debug&&b.log("Pager changing to page "+d.page),d.last={page:d.page,size:d.size,sortList:(h.sortList||[]).join(","),totalRows:d.totalRows,currentFilters:d.currentFilters||[],ajaxUrl:d.ajaxObject.url||"",optAjaxUrl:d.ajaxUrl||""},d.ajax?m(c,d):d.ajax||o(c,h.rowsCopy,d),a.data(c,"pagerLastPage",d.page),d.initialized&&!1!==f&&(i.trigger("pageMoved",d).trigger("applyWidgets"),c.isUpdating&&i.trigger("updateComplete",[c,!0]))))}},s=function(b,c,d){d.size=c||d.size||d.settings.size||10,d.$size.val(d.size),a.data(b,"pagerLastPage",d.page),a.data(b,"pagerLastSize",d.size),d.totalPages=Math.ceil(d.totalRows/d.size),d.filteredPages=Math.ceil(d.filteredRows/d.size),r(b,d)},t=function(a,b){b.page=0,r(a,b)},u=function(a,b){b.page=Math.min(b.totalPages,b.filteredPages)-1,r(a,b)},v=function(a,b){b.page++,b.page>=Math.min(b.totalPages,b.filteredPages)-1&&(b.page=Math.min(b.totalPages,b.filteredPages)-1),r(a,b)},w=function(a,b){b.page--,0>=b.page&&(b.page=0),r(a,b)},x=function(c,d,e){var f,g=c.config;d.$size.add(d.$goto).add(d.$container.find(".ts-startRow, .ts-page")).removeClass(d.cssDisabled).removeAttr("disabled").attr("aria-disabled","false"),d.isDisabled=!1,d.page=a.data(c,"pagerLastPage")||d.page||0,d.size=a.data(c,"pagerLastSize")||parseInt(d.$size.find("option[selected]").val(),10)||d.size||d.settings.size||10,d.$size.val(d.size),d.totalPages=Math.ceil(Math.min(d.totalRows,d.filteredRows)/d.size),c.id&&(f=c.id+"_pager_info",d.$container.find(d.cssPageDisplay).attr("id",f),g.$table.attr("aria-describedby",f)),i(c,d),e&&(g.$table.trigger("updateRows"),s(c,d.size,d),k(c,d),g.debug&&b.log("pager enabled"))};c.appender=function(b,c){var d=b.config,e=d.pager;e.ajax||(d.rowsCopy=c,e.totalRows=e.countChildRows?d.$tbodies.eq(0).children("tr").length:c.length,e.size=a.data(b,"pagerLastSize")||e.size||e.settings.size||10,e.totalPages=Math.ceil(e.totalRows/e.size),o(b,c,e),f(b,e,!1))},c.construct=function(d){return this.each(function(){if(this.config&&this.hasInitialized){var e,g,h,l=this,m=l.config,n=m.widgetOptions,o=m.pager=a.extend(!0,{},a.tablesorterPager.defaults,d),y=m.$table,z=o.$container=a(o.container).addClass("tablesorter-pager").show();o.settings=a.extend(!0,{},a.tablesorterPager.defaults,d),m.debug&&b.log("Pager initializing"),o.oldAjaxSuccess=o.oldAjaxSuccess||o.ajaxObject.success,m.appender=c.appender,o.initializing=!0,o.savePages&&b.storage&&(e=b.storage(l,o.storageKey)||{},o.page=isNaN(e.page)?o.page:e.page,o.size=(isNaN(e.size)?o.size:e.size)||o.settings.size||10,a.data(l,"pagerLastSize",o.size)),o.regexRows=new RegExp("("+(n.filter_filteredRow||"filtered")+"|"+m.selectorRemove.slice(1)+"|"+m.cssChildRow+")"),y.unbind(a.trim("filterInit filterStart filterEnd sortEnd disable enable destroy updateComplete pageSize pageSet pageAndSize pagerUpdate ".split(" ").join(".pager "))).bind("filterInit.pager filterStart.pager",function(b,c){o.currentFilters=a.isArray(c)?c:m.$table.data("lastSearch"),"filterStart"===b.type&&!1!==o.pageReset&&(m.lastCombinedFilter||"")!==(o.currentFilters||[]).join("")&&(o.page=o.pageReset)}).bind("filterEnd.pager sortEnd.pager",function(){o.currentFilters=m.$table.data("lastSearch"),(o.initialized||o.initializing)&&(m.delayInit&&m.rowsCopy&&0===m.rowsCopy.length&&q(l),f(l,o,!1),r(l,o,!1),m.$table.trigger("applyWidgets"))}).bind("disable.pager",function(a){a.stopPropagation(),p(l,o)}).bind("enable.pager",function(a){a.stopPropagation(),x(l,o,!0) +}).bind("destroy.pager",function(c){c.stopPropagation(),p(l,o),o.$container.hide(),l.config.appender=null,o.initialized=!1,delete l.config.rowsCopy,a(l).unbind(a.trim("filterInit filterStart filterEnd sortEnd disable enable destroy updateComplete pageSize pageSet pageAndSize pagerUpdate ".split(" ").join(".pager "))),b.storage&&b.storage(l,o.storageKey,"")}).bind("updateComplete.pager",function(a,b,c){a.stopPropagation(),b&&!c&&(a=m.$tbodies.eq(0).children("tr").not(m.selectorRemove),o.totalRows=a.length-(o.countChildRows?0:a.filter("."+m.cssChildRow).length),o.totalPages=Math.ceil(o.totalRows/o.size),a.length&&m.rowsCopy&&0===m.rowsCopy.length&&q(b),o.page>=o.totalPages&&u(b,o),j(b,o),i(b,o),f(b,o,!0))}).bind("pageSize.pager refreshComplete.pager",function(a,b){a.stopPropagation(),s(l,parseInt(b,10)||o.settings.size||10,o),j(l,o),f(l,o,!1)}).bind("pageSet.pager pagerUpdate.pager",function(a,b){a.stopPropagation(),o.page=(parseInt(b,10)||1)-1,"pagerUpdate"===a.type&&(o.last.page=!0),r(l,o,!0),f(l,o,!1)}).bind("pageAndSize.pager",function(a,b,c){a.stopPropagation(),o.page=(parseInt(b,10)||1)-1,s(l,parseInt(c,10)||o.settings.size||10,o),r(l,o,!0),j(l,o),f(l,o,!1)}),g=[o.cssFirst,o.cssPrev,o.cssNext,o.cssLast],h=[t,w,v,u],z.find(g.join(",")).attr("tabindex",0).unbind("click.pager").bind("click.pager",function(b){b.stopPropagation();var c=a(this),d=g.length;if(!c.hasClass(o.cssDisabled))for(b=0;d>b;b++)if(c.is(g[b])){h[b](l,o);break}}),o.$goto=z.find(o.cssGoto),o.$goto.length&&o.$goto.unbind("change.pager").bind("change.pager",function(){o.page=a(this).val()-1,r(l,o,!0),f(l,o,!1)}),o.$size=z.find(o.cssPageSize),o.$size.length&&(o.$size.find("option").removeAttr("selected"),o.$size.unbind("change.pager").bind("change.pager",function(){return o.$size.val(a(this).val()),a(this).hasClass(o.cssDisabled)||(s(l,parseInt(a(this).val(),10),o),i(l,o)),!1})),o.initialized=!1,y.trigger("pagerBeforeInitialized",o),x(l,o,!1),"string"==typeof o.ajaxUrl?(o.ajax=!0,m.widgetOptions.filter_serversideFiltering=!0,m.serverSideSorting=!0,r(l,o)):(o.ajax=!1,a(this).trigger("appendCache",!0),k(l,o)),o.ajax||o.initialized||(o.initializing=!1,o.initialized=!0,r(l,o),a(l).trigger("pagerInitialized",o),m.widgetOptions.filter_initialized&&b.hasWidget(l,"filter")||f(l,o,!1))}})}}}),b.showError=function(b,c){a(b).each(function(){var b=this.config,d=b.pager&&b.pager.cssErrorRow||b.widgetOptions.pager_css&&b.widgetOptions.pager_css.errorRow||"tablesorter-errorRow";b&&("undefined"==typeof c?b.$table.find("thead").find(b.selectorRemove).remove():a(/tr\>/.test(c)?c:''+c+"").click(function(){a(this).remove()}).appendTo(b.$table.find("thead:first")).addClass(d+" "+b.selectorRemove.slice(1)).attr({role:"alert","aria-live":"assertive"}))})},a.fn.extend({tablesorterPager:a.tablesorterPager.construct})}(jQuery); \ No newline at end of file diff --git a/dist/js/extras/semver-mod.min.js b/dist/js/extras/semver-mod.min.js new file mode 100644 index 00000000..99fa29ae --- /dev/null +++ b/dist/js/extras/semver-mod.min.js @@ -0,0 +1 @@ +!function(){function a(a,b){var c=b?Q[fb]:Q[cb];return c.test(a)?new d(a,b):null}function b(b,c){var d=a(b,c);return d?d.version:null}function c(b,c){var d=a(b,c);return d?d.version:null}function d(a,b){if(a instanceof d){if(a.loose===b)return a;a=a.version}if(!(this instanceof d))return new d(a,b);N("SemVer",a,b),this.loose=b;var c=a.trim().match(b?Q[fb]:Q[cb]);if(!c)throw new TypeError("Invalid Version: "+a);this.raw=a,this.major=+c[1],this.minor=+c[2],this.patch=+c[3],this.prerelease=c[4]?c[4].split(".").map(function(a){return/^[0-9]+$/.test(a)?+a:a}):[],this.build=c[5]?c[5].split("."):[],this.format()}function e(a,b,c){try{return new d(a,c).inc(b).version}catch(e){return null}}function f(a,b){var c=Fb.test(a),d=Fb.test(b);return c&&d&&(a=+a,b=+b),c&&!d?-1:d&&!c?1:b>a?-1:a>b?1:0}function g(a,b){return f(b,a)}function h(a,b,c){return new d(a,c).compare(b)}function i(a,b){return h(a,b,!0)}function j(a,b,c){return h(b,a,c)}function k(a,b){return a.sort(function(a,c){return P.compare(a,c,b)})}function l(a,b){return a.sort(function(a,c){return P.rcompare(a,c,b)})}function m(a,b,c){return h(a,b,c)>0}function n(a,b,c){return h(a,b,c)<0}function o(a,b,c){return 0===h(a,b,c)}function p(a,b,c){return 0!==h(a,b,c)}function q(a,b,c){return h(a,b,c)>=0}function r(a,b,c){return h(a,b,c)<=0}function s(a,b,c,d){var e;switch(b){case"===":e=a===c;break;case"!==":e=a!==c;break;case"":case"=":case"==":e=o(a,c,d);break;case"!=":e=p(a,c,d);break;case">":e=m(a,c,d);break;case">=":e=q(a,c,d);break;case"<":e=n(a,c,d);break;case"<=":e=r(a,c,d);break;default:throw new TypeError("Invalid operator: "+b)}return e}function t(a,b){if(a instanceof t){if(a.loose===b)return a;a=a.value}return this instanceof t?(N("comparator",a,b),this.loose=b,this.parse(a),void(this.value=this.semver===Gb?"":this.operator+this.semver.version)):new t(a,b)}function u(a,b){if(a instanceof u&&a.loose===b)return a;if(!(this instanceof u))return new u(a,b);if(this.loose=b,this.raw=a,this.set=a.split(/\s*\|\|\s*/).map(function(a){return this.parseRange(a.trim())},this).filter(function(a){return a.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+a);this.format()}function v(a,b){return new u(a,b).set.map(function(a){return a.map(function(a){return a.value}).join(" ").trim().split(" ")})}function w(a,b){return N("comp",a),a=A(a,b),N("caret",a),a=y(a,b),N("tildes",a),a=C(a,b),N("xrange",a),a=E(a,b),N("stars",a),a}function x(a){return!a||"x"===a.toLowerCase()||"*"===a}function y(a,b){return a.trim().split(/\s+/).map(function(a){return z(a,b)}).join(" ")}function z(a,b){var c=b?Q[rb]:Q[qb];return a.replace(c,function(b,c,d,e,f){N("tilde",a,b,c,d,e,f);var g;return x(c)?g="":x(d)?g=">="+c+".0.0-0 <"+(+c+1)+".0.0-0":x(e)?g=">="+c+"."+d+".0-0 <"+c+"."+(+d+1)+".0-0":f?(N("replaceTilde pr",f),"-"!==f.charAt(0)&&(f="-"+f),g=">="+c+"."+d+"."+e+f+" <"+c+"."+(+d+1)+".0-0"):g=">="+c+"."+d+"."+e+"-0 <"+c+"."+(+d+1)+".0-0",N("tilde return",g),g})}function A(a,b){return a.trim().split(/\s+/).map(function(a){return B(a,b)}).join(" ")}function B(a,b){var c=b?Q[wb]:Q[vb];return a.replace(c,function(b,c,d,e,f){N("caret",a,b,c,d,e,f);var g;return x(c)?g="":x(d)?g=">="+c+".0.0-0 <"+(+c+1)+".0.0-0":x(e)?g="0"===c?">="+c+"."+d+".0-0 <"+c+"."+(+d+1)+".0-0":">="+c+"."+d+".0-0 <"+(+c+1)+".0.0-0":f?(N("replaceCaret pr",f),"-"!==f.charAt(0)&&(f="-"+f),g="0"===c?"0"===d?"="+c+"."+d+"."+e+f:">="+c+"."+d+"."+e+f+" <"+c+"."+(+d+1)+".0-0":">="+c+"."+d+"."+e+f+" <"+(+c+1)+".0.0-0"):g="0"===c?"0"===d?"="+c+"."+d+"."+e:">="+c+"."+d+"."+e+"-0 <"+c+"."+(+d+1)+".0-0":">="+c+"."+d+"."+e+"-0 <"+(+c+1)+".0.0-0",N("caret return",g),g})}function C(a,b){return N("replaceXRanges",a,b),a.split(/\s+/).map(function(a){return D(a,b)}).join(" ")}function D(a,b){a=a.trim();var c=b?Q[mb]:Q[lb];return a.replace(c,function(b,c,d,e,f,g){N("xRange",a,b,c,d,e,f,g);var h=x(d),i=h||x(e),j=i||x(f),k=j;return"="===c&&k&&(c=""),c&&k?(h&&(d=0),i&&(e=0),j&&(f=0),">"===c&&(c=">=",h||(i?(d=+d+1,e=0,f=0):j&&(e=+e+1,f=0))),b=c+d+"."+e+"."+f+"-0"):h?b="*":i?b=">="+d+".0.0-0 <"+(+d+1)+".0.0-0":j&&(b=">="+d+"."+e+".0-0 <"+d+"."+(+e+1)+".0-0"),N("xRange return",b),b})}function E(a,b){return N("replaceStars",a,b),a.trim().replace(Q[Db],"")}function F(a,b,c,d,e,f,g,h,i,j,k,l){return b=x(c)?"":x(d)?">="+c+".0.0-0":x(e)?">="+c+"."+d+".0-0":">="+b,h=x(i)?"":x(j)?"<"+(+i+1)+".0.0-0":x(k)?"<"+i+"."+(+j+1)+".0-0":l?"<="+i+"."+j+"."+k+"-"+l:"<="+h,(b+" "+h).trim()}function G(a,b){for(var c=0;c",c)}function M(a,b,c,e){a=new d(a,e),b=new u(b,e);var f,g,h,i,j;switch(c){case">":f=m,g=r,h=n,i=">",j=">=";break;case"<":f=n,g=q,h=m,i="<",j="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(H(a,b,e))return!1;for(var k=0;k)?=?)";var hb=S++;R[hb]=R[U]+"|x|X|\\*";var ib=S++;R[ib]=R[T]+"|x|X|\\*";var jb=S++;R[jb]="[v=\\s]*("+R[ib]+")(?:\\.("+R[ib]+")(?:\\.("+R[ib]+")(?:("+R[$]+"))?)?)?";var kb=S++;R[kb]="[v=\\s]*("+R[hb]+")(?:\\.("+R[hb]+")(?:\\.("+R[hb]+")(?:("+R[_]+"))?)?)?";var lb=S++;R[lb]="^"+R[gb]+"\\s*"+R[jb]+"$";var mb=S++;R[mb]="^"+R[gb]+"\\s*"+R[kb]+"$";var nb=S++;R[nb]="(?:~>?)";var ob=S++;R[ob]="(\\s*)"+R[nb]+"\\s+",Q[ob]=new RegExp(R[ob],"g");var pb="$1~",qb=S++;R[qb]="^"+R[nb]+R[jb]+"$";var rb=S++;R[rb]="^"+R[nb]+R[kb]+"$";var sb=S++;R[sb]="(?:\\^)";var tb=S++;R[tb]="(\\s*)"+R[sb]+"\\s+",Q[tb]=new RegExp(R[tb],"g");var ub="$1^",vb=S++;R[vb]="^"+R[sb]+R[jb]+"$";var wb=S++;R[wb]="^"+R[sb]+R[kb]+"$";var xb=S++;R[xb]="^"+R[gb]+"\\s*("+eb+")$|^$";var yb=S++;R[yb]="^"+R[gb]+"\\s*("+db+")$|^$";var zb=S++;R[zb]="(\\s*)"+R[gb]+"\\s*("+eb+"|"+R[jb]+")",Q[zb]=new RegExp(R[zb],"g");var Ab="$1$2$3",Bb=S++;R[Bb]="^\\s*("+R[jb]+")\\s+-\\s+("+R[jb]+")\\s*$";var Cb=S++;R[Cb]="^\\s*("+R[kb]+")\\s+-\\s+("+R[kb]+")\\s*$";var Db=S++;R[Db]="(<|>)?=?\\s*\\*";for(var Eb=0;S>Eb;Eb++)N(Eb,R[Eb]),Q[Eb]||(Q[Eb]=new RegExp(R[Eb]));P.parse=a,P.valid=b,P.clean=c,window.semver=P.SemVer=d,d.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},d.prototype.inspect=function(){return''},d.prototype.toString=function(){return this.version},d.prototype.compare=function(a){return N("SemVer.compare",this.version,this.loose,a),a instanceof d||(a=new d(a,this.loose)),this.compareMain(a)||this.comparePre(a)},d.prototype.compareMain=function(a){return a instanceof d||(a=new d(a,this.loose)),f(this.major,a.major)||f(this.minor,a.minor)||f(this.patch,a.patch)},d.prototype.comparePre=function(a){if(a instanceof d||(a=new d(a,this.loose)),this.prerelease.length&&!a.prerelease.length)return-1;if(!this.prerelease.length&&a.prerelease.length)return 1;if(!this.prerelease.lenth&&!a.prerelease.length)return 0;var b=0;do{var c=this.prerelease[b],e=a.prerelease[b];if(N("prerelease compare",b,c,e),void 0===c&&void 0===e)return 0;if(void 0===e)return 1;if(void 0===c)return-1;if(c!==e)return f(c,e)}while(++b)},d.prototype.inc=function(a){switch(a){case"major":this.major++,this.minor=-1;case"minor":this.minor++,this.patch=-1;case"patch":this.patch++,this.prerelease=[];break;case"prerelease":if(0===this.prerelease.length)this.prerelease=[0];else{for(var b=this.prerelease.length;--b>=0;)"number"==typeof this.prerelease[b]&&(this.prerelease[b]++,b=-2);-1===b&&this.prerelease.push(0)}break;default:throw new Error("invalid increment argument: "+a)}return this.format(),this},P.inc=e,P.compareIdentifiers=f;var Fb=/^[0-9]+$/;P.rcompareIdentifiers=g,P.compare=h,P.compareLoose=i,P.rcompare=j,P.sort=k,P.rsort=l,P.gt=m,P.lt=n,P.eq=o,P.neq=p,P.gte=q,P.lte=r,P.cmp=s,P.Comparator=t;var Gb={};t.prototype.parse=function(a){var b=this.loose?Q[xb]:Q[yb],c=a.match(b);if(!c)throw new TypeError("Invalid comparator: "+a);this.operator=c[1],c[2]?(this.semver=new d(c[2],this.loose),"<"!==this.operator||this.semver.prerelease.length||(this.semver.prerelease=["0"],this.semver.format())):this.semver=Gb},t.prototype.inspect=function(){return''},t.prototype.toString=function(){return this.value},t.prototype.test=function(a){return N("Comparator.test",a,this.loose),this.semver===Gb?!0:s(a,this.operator,this.semver,this.loose)},P.Range=u,u.prototype.inspect=function(){return''},u.prototype.format=function(){return this.range=this.set.map(function(a){return a.join(" ").trim()}).join("||").trim(),this.range},u.prototype.toString=function(){return this.range},u.prototype.parseRange=function(a){var b=this.loose;a=a.trim(),N("range",a,b);var c=b?Q[Cb]:Q[Bb];a=a.replace(c,F),N("hyphen replace",a),a=a.replace(Q[zb],Ab),N("comparator trim",a,Q[zb]),a=a.replace(Q[ob],pb),a=a.replace(Q[tb],ub),a=a.split(/\s+/).join(" ");var d=b?Q[xb]:Q[yb],e=a.split(" ").map(function(a){return w(a,b)}).join(" ").split(/\s+/);return this.loose&&(e=e.filter(function(a){return!!a.match(d)})),e=e.map(function(a){return new t(a,b)})},P.toComparators=v,u.prototype.test=function(a){if(!a)return!1;for(var b=0;b (class from cssIcon) + onRenderTemplate : null, // function(index, template){ return template; }, (template is a string) + onRenderHeader : null, // function(index){}, (nothing to return) + + // *** functionality + cancelSelection : true, // prevent text selection in the header + tabIndex : true, // add tabindex to header for keyboard accessibility + dateFormat : 'mmddyyyy', // other options: 'ddmmyyy' or 'yyyymmdd' + sortMultiSortKey : 'shiftKey', // key used to select additional columns + sortResetKey : 'ctrlKey', // key used to remove sorting on a column + usNumberFormat : true, // false for German '1.234.567,89' or French '1 234 567,89' + delayInit : false, // if false, the parsed table contents will not update until the first sort + serverSideSorting: false, // if true, server-side sorting should be performed because client-side sorting will be disabled, but the ui and events will still be used. + resort : true, // default setting to trigger a resort after an 'update', 'addRows', 'updateCell', etc has completed + + // *** sort options + headers : {}, // set sorter, string, empty, locked order, sortInitialOrder, filter, etc. + ignoreCase : true, // ignore case while sorting + sortForce : null, // column(s) first sorted; always applied + sortList : [], // Initial sort order; applied initially; updated when manually sorted + sortAppend : null, // column(s) sorted last; always applied + sortStable : false, // when sorting two rows with exactly the same content, the original sort order is maintained + + sortInitialOrder : 'asc', // sort direction on first click + sortLocaleCompare: false, // replace equivalent character (accented characters) + sortReset : false, // third click on the header will reset column to default - unsorted + sortRestart : false, // restart sort to 'sortInitialOrder' when clicking on previously unsorted columns + + emptyTo : 'bottom', // sort empty cell to bottom, top, none, zero, emptyMax, emptyMin + stringTo : 'max', // sort strings in numerical column as max, min, top, bottom, zero + textExtraction : 'basic', // text extraction method/function - function(node, table, cellIndex){} + textAttribute : 'data-text',// data-attribute that contains alternate cell text (used in default textExtraction function) + textSorter : null, // choose overall or specific column sorter function(a, b, direction, table, columnIndex) [alt: ts.sortText] + numberSorter : null, // choose overall numeric sorter function(a, b, direction, maxColumnValue) + + // *** widget options + widgets: [], // method to add widgets, e.g. widgets: ['zebra'] + widgetOptions : { + zebra : [ 'even', 'odd' ] // zebra widget alternating row class names + }, + initWidgets : true, // apply widgets on tablesorter initialization + widgetClass : 'widget-{name}', // table class name template to match to include a widget + + // *** callbacks + initialized : null, // function(table){}, + + // *** extra css class names + tableClass : '', + cssAsc : '', + cssDesc : '', + cssNone : '', + cssHeader : '', + cssHeaderRow : '', + cssProcessing : '', // processing icon applied to header during sort/filter + + cssChildRow : 'tablesorter-childRow', // class name indiciating that a row is to be attached to the its parent + cssIcon : 'tablesorter-icon', // if this class does not exist, the {icon} will not be added from the headerTemplate + cssIconNone : '', // class name added to the icon when there is no column sort + cssIconAsc : '', // class name added to the icon when the column has an ascending sort + cssIconDesc : '', // class name added to the icon when the column has a descending sort + cssInfoBlock : 'tablesorter-infoOnly', // don't sort tbody with this class name (only one class name allowed here!) + cssAllowClicks : 'tablesorter-allowClicks', // class name added to table header which allows clicks to bubble up + cssIgnoreRow : 'tablesorter-ignoreRow', // header row to ignore; cells within this row will not be added to c.$headers + + // *** selectors + selectorHeaders : '> thead th, > thead td', + selectorSort : 'th, td', // jQuery selector of content within selectorHeaders that is clickable to trigger a sort + selectorRemove : '.remove-me', + + // *** advanced + debug : false, + + // *** Internal variables + headerList: [], + empties: {}, + strings: {}, + parsers: [] + + // removed: widgetZebra: { css: ['even', 'odd'] } + + }; + + // internal css classes - these will ALWAYS be added to + // the table and MUST only contain one class name - fixes #381 + ts.css = { + table : 'tablesorter', + cssHasChild: 'tablesorter-hasChildRow', + childRow : 'tablesorter-childRow', + colgroup : 'tablesorter-colgroup', + header : 'tablesorter-header', + headerRow : 'tablesorter-headerRow', + headerIn : 'tablesorter-header-inner', + icon : 'tablesorter-icon', + info : 'tablesorter-infoOnly', + processing : 'tablesorter-processing', + sortAsc : 'tablesorter-headerAsc', + sortDesc : 'tablesorter-headerDesc', + sortNone : 'tablesorter-headerUnSorted' + }; + + // labels applied to sortable headers for accessibility (aria) support + ts.language = { + sortAsc : 'Ascending sort applied, ', + sortDesc : 'Descending sort applied, ', + sortNone : 'No sort applied, ', + nextAsc : 'activate to apply an ascending sort', + nextDesc : 'activate to apply a descending sort', + nextNone : 'activate to remove the sort' + }; + + /* debuging utils */ + function log() { + var a = arguments[0], + s = arguments.length > 1 ? Array.prototype.slice.call(arguments) : a; + if (typeof console !== 'undefined' && typeof console.log !== 'undefined') { + console[ /error/i.test(a) ? 'error' : /warn/i.test(a) ? 'warn' : 'log' ](s); + } else { + alert(s); + } + } + + function benchmark(s, d) { + log(s + ' (' + (new Date().getTime() - d.getTime()) + 'ms)'); + } + + ts.log = log; + ts.benchmark = benchmark; + + // $.isEmptyObject from jQuery v1.4 + function isEmptyObject(obj) { + /*jshint forin: false */ + for (var name in obj) { + return false; + } + return true; + } + + function getElementText(table, node, cellIndex) { + if (!node) { return ''; } + var te, + $node = $(node), + c = table.config, + t = c.textExtraction || ''; + if (typeof(t) === 'string') { + // check data-attribute first when set to 'basic'; don't use node.innerText - it's really slow! + return $.trim( (t === 'basic' ? $node.attr(c.textAttribute) || node.textContent : node.textContent ) || $node.text() || '' ); + } else { + if (typeof(t) === 'function') { + return $.trim( t(node, table, cellIndex) ); + } else if (typeof (te = ts.getColumnData( table, t, cellIndex )) === 'function') { + return $.trim( te(node, table, cellIndex) ); + } + } + // fallback + return $.trim( node.textContent || $node.text() || '' ); + } + + function detectParserForColumn(table, rows, rowIndex, cellIndex) { + var cur, $node, + i = ts.parsers.length, + node = false, + nodeValue = '', + keepLooking = true; + while (nodeValue === '' && keepLooking) { + rowIndex++; + if (rows[rowIndex]) { + node = rows[rowIndex].cells[cellIndex]; + nodeValue = getElementText(table, node, cellIndex); + $node = $(node); + if (table.config.debug) { + log('Checking if value was empty on row ' + rowIndex + ', column: ' + cellIndex + ': "' + nodeValue + '"'); + } + } else { + keepLooking = false; + } + } + while (--i >= 0) { + cur = ts.parsers[i]; + // ignore the default text parser because it will always be true + if (cur && cur.id !== 'text' && cur.is && cur.is(nodeValue, table, node, $node)) { + return cur; + } + } + // nothing found, return the generic parser (text) + return ts.getParserById('text'); + } + + function buildParserCache(table) { + var c = table.config, + // update table bodies in case we start with an empty table + tb = c.$tbodies = c.$table.children('tbody:not(.' + c.cssInfoBlock + ')'), + rows, list, l, i, h, ch, np, p, e, time, + j = 0, + parsersDebug = '', + len = tb.length; + if ( len === 0) { + return c.debug ? log('Warning: *Empty table!* Not building a parser cache') : ''; + } else if (c.debug) { + time = new Date(); + log('Detecting parsers for each column'); + } + list = { + extractors: [], + parsers: [] + }; + while (j < len) { + rows = tb[j].rows; + if (rows.length) { + l = c.columns; // rows[j].cells.length; + for (i = 0; i < l; i++) { + h = c.$headers.filter('[data-column="' + i + '"]:last'); + // get column indexed table cell + ch = ts.getColumnData( table, c.headers, i ); + // get column parser/extractor + e = ts.getParserById( ts.getData(h, ch, 'extractor') ); + p = ts.getParserById( ts.getData(h, ch, 'sorter') ); + np = ts.getData(h, ch, 'parser') === 'false'; + // empty cells behaviour - keeping emptyToBottom for backwards compatibility + c.empties[i] = ( ts.getData(h, ch, 'empty') || c.emptyTo || (c.emptyToBottom ? 'bottom' : 'top' ) ).toLowerCase(); + // text strings behaviour in numerical sorts + c.strings[i] = ( ts.getData(h, ch, 'string') || c.stringTo || 'max' ).toLowerCase(); + if (np) { + p = ts.getParserById('no-parser'); + } + if (!e) { + // For now, maybe detect someday + e = false; + } + if (!p) { + p = detectParserForColumn(table, rows, -1, i); + } + if (c.debug) { + parsersDebug += 'column:' + i + '; extractor:' + e.id + '; parser:' + p.id + '; string:' + c.strings[i] + '; empty: ' + c.empties[i] + '\n'; + } + list.parsers[i] = p; + list.extractors[i] = e; + } + } + j += (list.parsers.length) ? len : 1; + } + if (c.debug) { + log(parsersDebug ? parsersDebug : 'No parsers detected'); + benchmark('Completed detecting parsers', time); + } + c.parsers = list.parsers; + c.extractors = list.extractors; + } + + /* utils */ + function buildCache(table) { + var cc, t, tx, v, i, j, k, $row, rows, cols, cacheTime, + totalRows, rowData, colMax, + c = table.config, + $tb = c.$table.children('tbody'), + extractors = c.extractors, + parsers = c.parsers; + c.cache = {}; + c.totalRows = 0; + // if no parsers found, return - it's an empty table. + if (!parsers) { + return c.debug ? log('Warning: *Empty table!* Not building a cache') : ''; + } + if (c.debug) { + cacheTime = new Date(); + } + // processing icon + if (c.showProcessing) { + ts.isProcessing(table, true); + } + for (k = 0; k < $tb.length; k++) { + colMax = []; // column max value per tbody + cc = c.cache[k] = { + normalized: [] // array of normalized row data; last entry contains 'rowData' above + // colMax: # // added at the end + }; + + // ignore tbodies with class name from c.cssInfoBlock + if (!$tb.eq(k).hasClass(c.cssInfoBlock)) { + totalRows = ($tb[k] && $tb[k].rows.length) || 0; + for (i = 0; i < totalRows; ++i) { + rowData = { + // order: original row order # + // $row : jQuery Object[] + child: [], // child row text (filter widget) + raw: [] // original row text + }; + /** Add the table data to main data array */ + $row = $($tb[k].rows[i]); + rows = [ new Array(c.columns) ]; + cols = []; + // if this is a child row, add it to the last row's children and continue to the next row + // ignore child row class, if it is the first row + if ($row.hasClass(c.cssChildRow) && i !== 0) { + t = cc.normalized.length - 1; + cc.normalized[t][c.columns].$row = cc.normalized[t][c.columns].$row.add($row); + // add 'hasChild' class name to parent row + if (!$row.prev().hasClass(c.cssChildRow)) { + $row.prev().addClass(ts.css.cssHasChild); + } + // save child row content (un-parsed!) + rowData.child[t] = $.trim( $row[0].textContent || $row.text() || '' ); + // go to the next for loop + continue; + } + rowData.$row = $row; + rowData.order = i; // add original row position to rowCache + for (j = 0; j < c.columns; ++j) { + if (typeof parsers[j] === 'undefined') { + if (c.debug) { + log('No parser found for cell:', $row[0].cells[j], 'does it have a header?'); + } + continue; + } + t = getElementText(table, $row[0].cells[j], j); + rowData.raw.push(t); // save original row text + // do extract before parsing if there is one + if (typeof extractors[j].id === 'undefined') { + tx = t; + } else { + tx = extractors[j].format(t, table, $row[0].cells[j], j); + } + // allow parsing if the string is empty, previously parsing would change it to zero, + // in case the parser needs to extract data from the table cell attributes + v = parsers[j].id === 'no-parser' ? '' : parsers[j].format(tx, table, $row[0].cells[j], j); + cols.push( c.ignoreCase && typeof v === 'string' ? v.toLowerCase() : v ); + if ((parsers[j].type || '').toLowerCase() === 'numeric') { + // determine column max value (ignore sign) + colMax[j] = Math.max(Math.abs(v) || 0, colMax[j] || 0); + } + } + // ensure rowData is always in the same location (after the last column) + cols[c.columns] = rowData; + cc.normalized.push(cols); + } + cc.colMax = colMax; + // total up rows, not including child rows + c.totalRows += cc.normalized.length; + } + } + if (c.showProcessing) { + ts.isProcessing(table); // remove processing icon + } + if (c.debug) { + benchmark('Building cache for ' + totalRows + ' rows', cacheTime); + } + } + + // init flag (true) used by pager plugin to prevent widget application + function appendToTable(table, init) { + var c = table.config, + wo = c.widgetOptions, + b = table.tBodies, + rows = [], + cc = c.cache, + n, totalRows, $bk, $tb, + i, k, appendTime; + // empty table - fixes #206/#346 + if (isEmptyObject(cc)) { + // run pager appender in case the table was just emptied + return c.appender ? c.appender(table, rows) : + table.isUpdating ? c.$table.trigger('updateComplete', table) : ''; // Fixes #532 + } + if (c.debug) { + appendTime = new Date(); + } + for (k = 0; k < b.length; k++) { + $bk = $(b[k]); + if ($bk.length && !$bk.hasClass(c.cssInfoBlock)) { + // get tbody + $tb = ts.processTbody(table, $bk, true); + n = cc[k].normalized; + totalRows = n.length; + for (i = 0; i < totalRows; i++) { + rows.push(n[i][c.columns].$row); + // removeRows used by the pager plugin; don't render if using ajax - fixes #411 + if (!c.appender || (c.pager && (!c.pager.removeRows || !wo.pager_removeRows) && !c.pager.ajax)) { + $tb.append(n[i][c.columns].$row); + } + } + // restore tbody + ts.processTbody(table, $tb, false); + } + } + if (c.appender) { + c.appender(table, rows); + } + if (c.debug) { + benchmark('Rebuilt table', appendTime); + } + // apply table widgets; but not before ajax completes + if (!init && !c.appender) { ts.applyWidget(table); } + if (table.isUpdating) { + c.$table.trigger('updateComplete', table); + } + } + + function formatSortingOrder(v) { + // look for 'd' in 'desc' order; return true + return (/^d/i.test(v) || v === 1); + } + + function buildHeaders(table) { + var ch, $t, + h, i, t, lock, time, + c = table.config; + c.headerList = []; + c.headerContent = []; + if (c.debug) { + time = new Date(); + } + // children tr in tfoot - see issue #196 & #547 + c.columns = ts.computeColumnIndex( c.$table.children('thead, tfoot').children('tr') ); + // add icon if cssIcon option exists + i = c.cssIcon ? '' : ''; + // redefine c.$headers here in case of an updateAll that replaces or adds an entire header cell - see #683 + c.$headers = $( $.map( $(table).find(c.selectorHeaders), function(elem, index) { + $t = $(elem); + // ignore cell (don't add it to c.$headers) if row has ignoreRow class + if ($t.parent().hasClass(c.cssIgnoreRow)) { return; } + // make sure to get header cell & not column indexed cell + ch = ts.getColumnData( table, c.headers, index, true ); + // save original header content + c.headerContent[index] = $t.html(); + // if headerTemplate is empty, don't reformat the header cell + if ( c.headerTemplate !== '' && !$t.find('.' + ts.css.headerIn).length ) { + // set up header template + t = c.headerTemplate.replace(/\{content\}/g, $t.html()).replace(/\{icon\}/g, $t.find('.' + ts.css.icon).length ? '' : i); + if (c.onRenderTemplate) { + h = c.onRenderTemplate.apply($t, [index, t]); + if (h && typeof h === 'string') { t = h; } // only change t if something is returned + } + $t.html('
    ' + t + '
    '); // faster than wrapInner + } + if (c.onRenderHeader) { c.onRenderHeader.apply($t, [index, c, c.$table]); } + // *** remove this.column value if no conflicts found + elem.column = parseInt( $t.attr('data-column'), 10); + elem.order = formatSortingOrder( ts.getData($t, ch, 'sortInitialOrder') || c.sortInitialOrder ) ? [1,0,2] : [0,1,2]; + elem.count = -1; // set to -1 because clicking on the header automatically adds one + elem.lockedOrder = false; + lock = ts.getData($t, ch, 'lockedOrder') || false; + if (typeof lock !== 'undefined' && lock !== false) { + elem.order = elem.lockedOrder = formatSortingOrder(lock) ? [1,1,1] : [0,0,0]; + } + $t.addClass(ts.css.header + ' ' + c.cssHeader); + // add cell to headerList + c.headerList[index] = elem; + // add to parent in case there are multiple rows + $t.parent().addClass(ts.css.headerRow + ' ' + c.cssHeaderRow).attr('role', 'row'); + // allow keyboard cursor to focus on element + if (c.tabIndex) { $t.attr('tabindex', 0); } + return elem; + })); + $(table).find(c.selectorHeaders).attr({ + scope: 'col', + role : 'columnheader' + }); + // enable/disable sorting + updateHeader(table); + if (c.debug) { + benchmark('Built headers:', time); + log(c.$headers); + } + } + + function commonUpdate(table, resort, callback) { + var c = table.config; + // remove rows/elements before update + c.$table.find(c.selectorRemove).remove(); + // rebuild parsers + buildParserCache(table); + // rebuild the cache map + buildCache(table); + checkResort(c, resort, callback); + } + + function updateHeader(table) { + var s, $th, col, + c = table.config; + c.$headers.each(function(index, th){ + $th = $(th); + col = ts.getColumnData( table, c.headers, index, true ); + // add 'sorter-false' class if 'parser-false' is set + s = ts.getData( th, col, 'sorter' ) === 'false' || ts.getData( th, col, 'parser' ) === 'false'; + th.sortDisabled = s; + $th[ s ? 'addClass' : 'removeClass' ]('sorter-false').attr('aria-disabled', '' + s); + // aria-controls - requires table ID + if (table.id) { + if (s) { + $th.removeAttr('aria-controls'); + } else { + $th.attr('aria-controls', table.id); + } + } + }); + } + + function setHeadersCss(table) { + var f, i, j, + c = table.config, + list = c.sortList, + len = list.length, + none = ts.css.sortNone + ' ' + c.cssNone, + css = [ts.css.sortAsc + ' ' + c.cssAsc, ts.css.sortDesc + ' ' + c.cssDesc], + cssIcon = [ c.cssIconAsc, c.cssIconDesc, c.cssIconNone ], + aria = ['ascending', 'descending'], + // find the footer + $t = $(table).find('tfoot tr').children().add(c.$extraHeaders).removeClass(css.join(' ')); + // remove all header information + c.$headers + .removeClass(css.join(' ')) + .addClass(none).attr('aria-sort', 'none') + .find('.' + c.cssIcon) + .removeClass(cssIcon.join(' ')) + .addClass(cssIcon[2]); + for (i = 0; i < len; i++) { + // direction = 2 means reset! + if (list[i][1] !== 2) { + // multicolumn sorting updating - choose the :last in case there are nested columns + f = c.$headers.not('.sorter-false').filter('[data-column="' + list[i][0] + '"]' + (len === 1 ? ':last' : '') ); + if (f.length) { + for (j = 0; j < f.length; j++) { + if (!f[j].sortDisabled) { + f.eq(j) + .removeClass(none) + .addClass(css[list[i][1]]) + .attr('aria-sort', aria[list[i][1]]) + .find('.' + c.cssIcon) + .removeClass(cssIcon[2]) + .addClass(cssIcon[list[i][1]]); + } + } + // add sorted class to footer & extra headers, if they exist + if ($t.length) { + $t.filter('[data-column="' + list[i][0] + '"]').removeClass(none).addClass(css[list[i][1]]); + } + } + } + } + // add verbose aria labels + c.$headers.not('.sorter-false').each(function(){ + var $this = $(this), + nextSort = this.order[(this.count + 1) % (c.sortReset ? 3 : 2)], + txt = $.trim( $this.text() ) + ': ' + + ts.language[ $this.hasClass(ts.css.sortAsc) ? 'sortAsc' : $this.hasClass(ts.css.sortDesc) ? 'sortDesc' : 'sortNone' ] + + ts.language[ nextSort === 0 ? 'nextAsc' : nextSort === 1 ? 'nextDesc' : 'nextNone' ]; + $this.attr('aria-label', txt ); + }); + } + + function updateHeaderSortCount(table, list) { + var s, t, o, col, primary, + c = table.config, + sl = list || c.sortList; + c.sortList = []; + $.each(sl, function(i,v){ + // ensure all sortList values are numeric - fixes #127 + col = parseInt(v[0], 10); + // make sure header exists + o = c.$headers.filter('[data-column="' + col + '"]:last')[0]; + if (o) { // prevents error if sorton array is wrong + // o.count = o.count + 1; + t = ('' + v[1]).match(/^(1|d|s|o|n)/); + t = t ? t[0] : ''; + // 0/(a)sc (default), 1/(d)esc, (s)ame, (o)pposite, (n)ext + switch(t) { + case '1': case 'd': // descending + t = 1; + break; + case 's': // same direction (as primary column) + // if primary sort is set to 's', make it ascending + t = primary || 0; + break; + case 'o': + s = o.order[(primary || 0) % (c.sortReset ? 3 : 2)]; + // opposite of primary column; but resets if primary resets + t = s === 0 ? 1 : s === 1 ? 0 : 2; + break; + case 'n': + o.count = o.count + 1; + t = o.order[(o.count) % (c.sortReset ? 3 : 2)]; + break; + default: // ascending + t = 0; + break; + } + primary = i === 0 ? t : primary; + s = [ col, parseInt(t, 10) || 0 ]; + c.sortList.push(s); + t = $.inArray(s[1], o.order); // fixes issue #167 + o.count = t >= 0 ? t : s[1] % (c.sortReset ? 3 : 2); + } + }); + } + + function getCachedSortType(parsers, i) { + return (parsers && parsers[i]) ? parsers[i].type || '' : ''; + } + + function initSort(table, cell, event){ + if (table.isUpdating) { + // let any updates complete before initializing a sort + return setTimeout(function(){ initSort(table, cell, event); }, 50); + } + var arry, indx, col, order, s, + c = table.config, + key = !event[c.sortMultiSortKey], + $table = c.$table; + // Only call sortStart if sorting is enabled + $table.trigger('sortStart', table); + // get current column sort order + cell.count = event[c.sortResetKey] ? 2 : (cell.count + 1) % (c.sortReset ? 3 : 2); + // reset all sorts on non-current column - issue #30 + if (c.sortRestart) { + indx = cell; + c.$headers.each(function() { + // only reset counts on columns that weren't just clicked on and if not included in a multisort + if (this !== indx && (key || !$(this).is('.' + ts.css.sortDesc + ',.' + ts.css.sortAsc))) { + this.count = -1; + } + }); + } + // get current column index + indx = parseInt( $(cell).attr('data-column'), 10 ); + // user only wants to sort on one column + if (key) { + // flush the sort list + c.sortList = []; + if (c.sortForce !== null) { + arry = c.sortForce; + for (col = 0; col < arry.length; col++) { + if (arry[col][0] !== indx) { + c.sortList.push(arry[col]); + } + } + } + // add column to sort list + order = cell.order[cell.count]; + if (order < 2) { + c.sortList.push([indx, order]); + // add other columns if header spans across multiple + if (cell.colSpan > 1) { + for (col = 1; col < cell.colSpan; col++) { + c.sortList.push([indx + col, order]); + } + } + } + // multi column sorting + } else { + // get rid of the sortAppend before adding more - fixes issue #115 & #523 + if (c.sortAppend && c.sortList.length > 1) { + for (col = 0; col < c.sortAppend.length; col++) { + s = ts.isValueInArray(c.sortAppend[col][0], c.sortList); + if (s >= 0) { + c.sortList.splice(s,1); + } + } + } + // the user has clicked on an already sorted column + if (ts.isValueInArray(indx, c.sortList) >= 0) { + // reverse the sorting direction + for (col = 0; col < c.sortList.length; col++) { + s = c.sortList[col]; + order = c.$headers.filter('[data-column="' + s[0] + '"]:last')[0]; + if (s[0] === indx) { + // order.count seems to be incorrect when compared to cell.count + s[1] = order.order[cell.count]; + if (s[1] === 2) { + c.sortList.splice(col,1); + order.count = -1; + } + } + } + } else { + // add column to sort list array + order = cell.order[cell.count]; + if (order < 2) { + c.sortList.push([indx, order]); + // add other columns if header spans across multiple + if (cell.colSpan > 1) { + for (col = 1; col < cell.colSpan; col++) { + c.sortList.push([indx + col, order]); + } + } + } + } + } + if (c.sortAppend !== null) { + arry = c.sortAppend; + for (col = 0; col < arry.length; col++) { + if (arry[col][0] !== indx) { + c.sortList.push(arry[col]); + } + } + } + // sortBegin event triggered immediately before the sort + $table.trigger('sortBegin', table); + // setTimeout needed so the processing icon shows up + setTimeout(function(){ + // set css for headers + setHeadersCss(table); + multisort(table); + appendToTable(table); + $table.trigger('sortEnd', table); + }, 1); + } + + // sort multiple columns + function multisort(table) { /*jshint loopfunc:true */ + var i, k, num, col, sortTime, colMax, + cache, order, sort, x, y, + dir = 0, + c = table.config, + cts = c.textSorter || '', + sortList = c.sortList, + l = sortList.length, + bl = table.tBodies.length; + if (c.serverSideSorting || isEmptyObject(c.cache)) { // empty table - fixes #206/#346 + return; + } + if (c.debug) { sortTime = new Date(); } + for (k = 0; k < bl; k++) { + colMax = c.cache[k].colMax; + cache = c.cache[k].normalized; + + cache.sort(function(a, b) { + // cache is undefined here in IE, so don't use it! + for (i = 0; i < l; i++) { + col = sortList[i][0]; + order = sortList[i][1]; + // sort direction, true = asc, false = desc + dir = order === 0; + + if (c.sortStable && a[col] === b[col] && l === 1) { + return a[c.columns].order - b[c.columns].order; + } + + // fallback to natural sort since it is more robust + num = /n/i.test(getCachedSortType(c.parsers, col)); + if (num && c.strings[col]) { + // sort strings in numerical columns + if (typeof (c.string[c.strings[col]]) === 'boolean') { + num = (dir ? 1 : -1) * (c.string[c.strings[col]] ? -1 : 1); + } else { + num = (c.strings[col]) ? c.string[c.strings[col]] || 0 : 0; + } + // fall back to built-in numeric sort + // var sort = $.tablesorter['sort' + s](table, a[c], b[c], c, colMax[c], dir); + sort = c.numberSorter ? c.numberSorter(a[col], b[col], dir, colMax[col], table) : + ts[ 'sortNumeric' + (dir ? 'Asc' : 'Desc') ](a[col], b[col], num, colMax[col], col, table); + } else { + // set a & b depending on sort direction + x = dir ? a : b; + y = dir ? b : a; + // text sort function + if (typeof(cts) === 'function') { + // custom OVERALL text sorter + sort = cts(x[col], y[col], dir, col, table); + } else if (typeof(cts) === 'object' && cts.hasOwnProperty(col)) { + // custom text sorter for a SPECIFIC COLUMN + sort = cts[col](x[col], y[col], dir, col, table); + } else { + // fall back to natural sort + sort = ts[ 'sortNatural' + (dir ? 'Asc' : 'Desc') ](a[col], b[col], col, table, c); + } + } + if (sort) { return sort; } + } + return a[c.columns].order - b[c.columns].order; + }); + } + if (c.debug) { benchmark('Sorting on ' + sortList.toString() + ' and dir ' + order + ' time', sortTime); } + } + + function resortComplete(c, callback){ + if (c.table.isUpdating) { + c.$table.trigger('updateComplete', c.table); + } + if ($.isFunction(callback)) { + callback(c.table); + } + } + + function checkResort(c, resort, callback) { + var sl = $.isArray(resort) ? resort : c.sortList, + // if no resort parameter is passed, fallback to config.resort (true by default) + resrt = typeof resort === 'undefined' ? c.resort : resort; + // don't try to resort if the table is still processing + // this will catch spamming of the updateCell method + if (resrt !== false && !c.serverSideSorting && !c.table.isProcessing) { + if (sl.length) { + c.$table.trigger('sorton', [sl, function(){ + resortComplete(c, callback); + }, true]); + } else { + c.$table.trigger('sortReset', [function(){ + resortComplete(c, callback); + ts.applyWidget(c.table, false); + }]); + } + } else { + resortComplete(c, callback); + ts.applyWidget(c.table, false); + } + } + + function bindMethods(table){ + var c = table.config, + $table = c.$table, + events = ('sortReset update updateRows updateCell updateAll addRows updateComplete sorton appendCache ' + + 'updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ').split(' ') + .join(c.namespace + ' '); + // apply easy methods that trigger bound events + $table + .unbind( $.trim(events) ) + .bind('sortReset' + c.namespace, function(e, callback){ + e.stopPropagation(); + c.sortList = []; + setHeadersCss(table); + multisort(table); + appendToTable(table); + if ($.isFunction(callback)) { + callback(table); + } + }) + .bind('updateAll' + c.namespace, function(e, resort, callback){ + e.stopPropagation(); + table.isUpdating = true; + ts.refreshWidgets(table, true, true); + buildHeaders(table); + ts.bindEvents(table, c.$headers, true); + bindMethods(table); + commonUpdate(table, resort, callback); + }) + .bind('update' + c.namespace + ' updateRows' + c.namespace, function(e, resort, callback) { + e.stopPropagation(); + table.isUpdating = true; + // update sorting (if enabled/disabled) + updateHeader(table); + commonUpdate(table, resort, callback); + }) + .bind('updateCell' + c.namespace, function(e, cell, resort, callback) { + e.stopPropagation(); + table.isUpdating = true; + $table.find(c.selectorRemove).remove(); + // get position from the dom + var v, t, row, icell, + $tb = $table.find('tbody'), + $cell = $(cell), + // update cache - format: function(s, table, cell, cellIndex) + // no closest in jQuery v1.2.6 - tbdy = $tb.index( $(cell).closest('tbody') ),$row = $(cell).closest('tr'); + tbdy = $tb.index( $.fn.closest ? $cell.closest('tbody') : $cell.parents('tbody').filter(':first') ), + $row = $.fn.closest ? $cell.closest('tr') : $cell.parents('tr').filter(':first'); + cell = $cell[0]; // in case cell is a jQuery object + // tbody may not exist if update is initialized while tbody is removed for processing + if ($tb.length && tbdy >= 0) { + row = $tb.eq(tbdy).find('tr').index( $row ); + icell = $cell.index(); + c.cache[tbdy].normalized[row][c.columns].$row = $row; + if (typeof c.extractors[icell].id === 'undefined') { + t = getElementText(table, cell, icell); + } else { + t = c.extractors[icell].format( getElementText(table, cell, icell), table, cell, icell ); + } + v = c.parsers[icell].id === 'no-parser' ? '' : + c.parsers[icell].format( t, table, cell, icell ); + c.cache[tbdy].normalized[row][icell] = c.ignoreCase && typeof v === 'string' ? v.toLowerCase() : v; + if ((c.parsers[icell].type || '').toLowerCase() === 'numeric') { + // update column max value (ignore sign) + c.cache[tbdy].colMax[icell] = Math.max(Math.abs(v) || 0, c.cache[tbdy].colMax[icell] || 0); + } + v = resort !== 'undefined' ? resort : c.resort; + if (v !== false) { + // widgets will be reapplied + checkResort(c, v, callback); + } else { + // don't reapply widgets is resort is false, just in case it causes + // problems with element focus + if ($.isFunction(callback)) { + callback(table); + } + c.$table.trigger('updateComplete', c.table); + } + } + }) + .bind('addRows' + c.namespace, function(e, $row, resort, callback) { + e.stopPropagation(); + table.isUpdating = true; + if (isEmptyObject(c.cache)) { + // empty table, do an update instead - fixes #450 + updateHeader(table); + commonUpdate(table, resort, callback); + } else { + $row = $($row).attr('role', 'row'); // make sure we're using a jQuery object + var i, j, l, t, v, rowData, cells, + rows = $row.filter('tr').length, + tbdy = $table.find('tbody').index( $row.parents('tbody').filter(':first') ); + // fixes adding rows to an empty table - see issue #179 + if (!(c.parsers && c.parsers.length)) { + buildParserCache(table); + } + // add each row + for (i = 0; i < rows; i++) { + l = $row[i].cells.length; + cells = []; + rowData = { + child: [], + $row : $row.eq(i), + order: c.cache[tbdy].normalized.length + }; + // add each cell + for (j = 0; j < l; j++) { + if (typeof c.extractors[j].id === 'undefined') { + t = getElementText(table, $row[i].cells[j], j); + } else { + t = c.extractors[j].format( getElementText(table, $row[i].cells[j], j), table, $row[i].cells[j], j ); + } + v = c.parsers[j].id === 'no-parser' ? '' : + c.parsers[j].format( t, table, $row[i].cells[j], j ); + cells[j] = c.ignoreCase && typeof v === 'string' ? v.toLowerCase() : v; + if ((c.parsers[j].type || '').toLowerCase() === 'numeric') { + // update column max value (ignore sign) + c.cache[tbdy].colMax[j] = Math.max(Math.abs(cells[j]) || 0, c.cache[tbdy].colMax[j] || 0); + } + } + // add the row data to the end + cells.push(rowData); + // update cache + c.cache[tbdy].normalized.push(cells); + } + // resort using current settings + checkResort(c, resort, callback); + } + }) + .bind('updateComplete' + c.namespace, function(){ + table.isUpdating = false; + }) + .bind('sorton' + c.namespace, function(e, list, callback, init) { + var c = table.config; + e.stopPropagation(); + $table.trigger('sortStart', this); + // update header count index + updateHeaderSortCount(table, list); + // set css for headers + setHeadersCss(table); + // fixes #346 + if (c.delayInit && isEmptyObject(c.cache)) { buildCache(table); } + $table.trigger('sortBegin', this); + // sort the table and append it to the dom + multisort(table); + appendToTable(table, init); + $table.trigger('sortEnd', this); + ts.applyWidget(table); + if ($.isFunction(callback)) { + callback(table); + } + }) + .bind('appendCache' + c.namespace, function(e, callback, init) { + e.stopPropagation(); + appendToTable(table, init); + if ($.isFunction(callback)) { + callback(table); + } + }) + .bind('updateCache' + c.namespace, function(e, callback){ + // rebuild parsers + if (!(c.parsers && c.parsers.length)) { + buildParserCache(table); + } + // rebuild the cache map + buildCache(table); + if ($.isFunction(callback)) { + callback(table); + } + }) + .bind('applyWidgetId' + c.namespace, function(e, id) { + e.stopPropagation(); + ts.getWidgetById(id).format(table, c, c.widgetOptions); + }) + .bind('applyWidgets' + c.namespace, function(e, init) { + e.stopPropagation(); + // apply widgets + ts.applyWidget(table, init); + }) + .bind('refreshWidgets' + c.namespace, function(e, all, dontapply){ + e.stopPropagation(); + ts.refreshWidgets(table, all, dontapply); + }) + .bind('destroy' + c.namespace, function(e, c, cb){ + e.stopPropagation(); + ts.destroy(table, c, cb); + }) + .bind('resetToLoadState' + c.namespace, function(){ + // remove all widgets + ts.removeWidget(table, true, false); + // restore original settings; this clears out current settings, but does not clear + // values saved to storage. + c = $.extend(true, ts.defaults, c.originalSettings); + table.hasInitialized = false; + // setup the entire table again + ts.setup( table, c ); + }); + } + + /* public methods */ + ts.construct = function(settings) { + return this.each(function() { + var table = this, + // merge & extend config options + c = $.extend(true, {}, ts.defaults, settings); + // save initial settings + c.originalSettings = settings; + // create a table from data (build table widget) + if (!table.hasInitialized && ts.buildTable && this.tagName !== 'TABLE') { + // return the table (in case the original target is the table's container) + ts.buildTable(table, c); + } else { + ts.setup(table, c); + } + }); + }; + + ts.setup = function(table, c) { + // if no thead or tbody, or tablesorter is already present, quit + if (!table || !table.tHead || table.tBodies.length === 0 || table.hasInitialized === true) { + return c.debug ? log('ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized') : ''; + } + + var k = '', + $table = $(table), + m = $.metadata; + // initialization flag + table.hasInitialized = false; + // table is being processed flag + table.isProcessing = true; + // make sure to store the config object + table.config = c; + // save the settings where they read + $.data(table, 'tablesorter', c); + if (c.debug) { $.data( table, 'startoveralltimer', new Date()); } + + // removing this in version 3 (only supports jQuery 1.7+) + c.supportsDataObject = (function(version) { + version[0] = parseInt(version[0], 10); + return (version[0] > 1) || (version[0] === 1 && parseInt(version[1], 10) >= 4); + })($.fn.jquery.split('.')); + // digit sort text location; keeping max+/- for backwards compatibility + c.string = { 'max': 1, 'min': -1, 'emptymin': 1, 'emptymax': -1, 'zero': 0, 'none': 0, 'null': 0, 'top': true, 'bottom': false }; + // ensure case insensitivity + c.emptyTo = c.emptyTo.toLowerCase(); + c.stringTo = c.stringTo.toLowerCase(); + // add table theme class only if there isn't already one there + if (!/tablesorter\-/.test($table.attr('class'))) { + k = (c.theme !== '' ? ' tablesorter-' + c.theme : ''); + } + c.table = table; + c.$table = $table + .addClass(ts.css.table + ' ' + c.tableClass + k) + .attr('role', 'grid'); + c.$headers = $table.find(c.selectorHeaders); + + // give the table a unique id, which will be used in namespace binding + if (!c.namespace) { + c.namespace = '.tablesorter' + Math.random().toString(16).slice(2); + } else { + // make sure namespace starts with a period & doesn't have weird characters + c.namespace = '.' + c.namespace.replace(/\W/g,''); + } + + c.$table.children().children('tr').attr('role', 'row'); + c.$tbodies = $table.children('tbody:not(.' + c.cssInfoBlock + ')').attr({ + 'aria-live' : 'polite', + 'aria-relevant' : 'all' + }); + if (c.$table.children('caption').length) { + k = c.$table.children('caption')[0]; + if (!k.id) { k.id = c.namespace.slice(1) + 'caption'; } + c.$table.attr('aria-labelledby', k.id); + } + c.widgetInit = {}; // keep a list of initialized widgets + // change textExtraction via data-attribute + c.textExtraction = c.$table.attr('data-text-extraction') || c.textExtraction || 'basic'; + // build headers + buildHeaders(table); + // fixate columns if the users supplies the fixedWidth option + // do this after theme has been applied + ts.fixColumnWidth(table); + // try to auto detect column type, and store in tables config + buildParserCache(table); + // start total row count at zero + c.totalRows = 0; + // build the cache for the tbody cells + // delayInit will delay building the cache until the user starts a sort + if (!c.delayInit) { buildCache(table); } + // bind all header events and methods + ts.bindEvents(table, c.$headers, true); + bindMethods(table); + // get sort list from jQuery data or metadata + // in jQuery < 1.4, an error occurs when calling $table.data() + if (c.supportsDataObject && typeof $table.data().sortlist !== 'undefined') { + c.sortList = $table.data().sortlist; + } else if (m && ($table.metadata() && $table.metadata().sortlist)) { + c.sortList = $table.metadata().sortlist; + } + // apply widget init code + ts.applyWidget(table, true); + // if user has supplied a sort list to constructor + if (c.sortList.length > 0) { + $table.trigger('sorton', [c.sortList, {}, !c.initWidgets, true]); + } else { + setHeadersCss(table); + if (c.initWidgets) { + // apply widget format + ts.applyWidget(table, false); + } + } + + // show processesing icon + if (c.showProcessing) { + $table + .unbind('sortBegin' + c.namespace + ' sortEnd' + c.namespace) + .bind('sortBegin' + c.namespace + ' sortEnd' + c.namespace, function(e) { + clearTimeout(c.processTimer); + ts.isProcessing(table); + if (e.type === 'sortBegin') { + c.processTimer = setTimeout(function(){ + ts.isProcessing(table, true); + }, 500); + } + }); + } + + // initialized + table.hasInitialized = true; + table.isProcessing = false; + if (c.debug) { + ts.benchmark('Overall initialization time', $.data( table, 'startoveralltimer')); + } + $table.trigger('tablesorter-initialized', table); + if (typeof c.initialized === 'function') { c.initialized(table); } + }; + + // automatically add a colgroup with col elements set to a percentage width + ts.fixColumnWidth = function(table) { + table = $(table)[0]; + var overallWidth, percent, + c = table.config, + colgroup = c.$table.children('colgroup'); + // remove plugin-added colgroup, in case we need to refresh the widths + if (colgroup.length && colgroup.hasClass(ts.css.colgroup)) { + colgroup.remove(); + } + if (c.widthFixed && c.$table.children('colgroup').length === 0) { + colgroup = $(''); + overallWidth = c.$table.width(); + // only add col for visible columns - fixes #371 + $(table.tBodies).not('.' + c.cssInfoBlock).find('tr:first').children(':visible').each(function() { + percent = parseInt( ( $(this).width() / overallWidth ) * 1000, 10 ) / 10 + '%'; + colgroup.append( $('').css('width', percent) ); + }); + c.$table.prepend(colgroup); + } + }; + + ts.getColumnData = function(table, obj, indx, getCell, $headers){ + if (typeof obj === 'undefined' || obj === null) { return; } + table = $(table)[0]; + var $h, k, + c = table.config, + $cell = ( $headers || c.$headers ); + if (obj[indx]) { + return getCell ? obj[indx] : obj[$cell.index( $cell.filter('[data-column="' + indx + '"]:last') )]; + } + for (k in obj) { + if (typeof k === 'string') { + $h = $cell.filter('[data-column="' + indx + '"]:last') + // header cell with class/id + .filter(k) + // find elements within the header cell with cell/id + .add( $cell.filter('[data-column="' + indx + '"]:last').find(k) ); + if ($h.length) { + return obj[k]; + } + } + } + return; + }; + + // computeTableHeaderCellIndexes from: + // http://www.javascripttoolbox.com/lib/table/examples.php + // http://www.javascripttoolbox.com/temp/table_cellindex.html + ts.computeColumnIndex = function(trs) { + var matrix = [], + lookup = {}, + cols = 0, // determine the number of columns + i, j, k, l, $cell, cell, 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++) { + cell = cells[j]; + $cell = $(cell); + rowIndex = cell.parentNode.rowIndex; + cellId = rowIndex + '-' + $cell.index(); + rowSpan = cell.rowSpan || 1; + colSpan = cell.colSpan || 1; + if (typeof(matrix[rowIndex]) === 'undefined') { + matrix[rowIndex] = []; + } + // Find first available column in the first row + for (k = 0; k < matrix[rowIndex].length + 1; k++) { + if (typeof(matrix[rowIndex][k]) === 'undefined') { + firstAvailCol = k; + break; + } + } + lookup[cellId] = firstAvailCol; + cols = Math.max(firstAvailCol, cols); + // add data-column + $cell.attr({ 'data-column' : firstAvailCol }); // 'data-row' : rowIndex + for (k = rowIndex; k < rowIndex + rowSpan; k++) { + if (typeof(matrix[k]) === 'undefined') { + matrix[k] = []; + } + matrixrow = matrix[k]; + for (l = firstAvailCol; l < firstAvailCol + colSpan; l++) { + matrixrow[l] = 'x'; + } + } + } + } + // may not be accurate if # header columns !== # tbody columns + return cols + 1; // add one because it's a zero-based index + }; + + // *** Process table *** + // add processing indicator + ts.isProcessing = function(table, toggle, $ths) { + table = $(table); + var c = table[0].config, + // default to all headers + $h = $ths || table.find('.' + ts.css.header); + if (toggle) { + // don't use sortList if custom $ths used + if (typeof $ths !== 'undefined' && c.sortList.length > 0) { + // get headers from the sortList + $h = $h.filter(function(){ + // get data-column from attr to keep compatibility with jQuery 1.2.6 + return this.sortDisabled ? false : ts.isValueInArray( parseFloat($(this).attr('data-column')), c.sortList) >= 0; + }); + } + table.add($h).addClass(ts.css.processing + ' ' + c.cssProcessing); + } else { + table.add($h).removeClass(ts.css.processing + ' ' + c.cssProcessing); + } + }; + + // detach tbody but save the position + // don't use tbody because there are portions that look for a tbody index (updateCell) + ts.processTbody = function(table, $tb, getIt){ + table = $(table)[0]; + var holdr; + if (getIt) { + table.isProcessing = true; + $tb.before(''); + holdr = ($.fn.detach) ? $tb.detach() : $tb.remove(); + return holdr; + } + holdr = $(table).find('span.tablesorter-savemyplace'); + $tb.insertAfter( holdr ); + holdr.remove(); + table.isProcessing = false; + }; + + ts.clearTableBody = function(table) { + $(table)[0].config.$tbodies.children().detach(); + }; + + ts.bindEvents = function(table, $headers, core){ + table = $(table)[0]; + var downTime, + c = table.config; + if (core !== true) { + c.$extraHeaders = c.$extraHeaders ? c.$extraHeaders.add($headers) : $headers; + } + // apply event handling to headers and/or additional headers (stickyheaders, scroller, etc) + $headers + // http://stackoverflow.com/questions/5312849/jquery-find-self; + .find(c.selectorSort).add( $headers.filter(c.selectorSort) ) + .unbind( $.trim('mousedown mouseup sort keyup '.split(' ').join(c.namespace + ' ')) ) + .bind( $.trim('mousedown mouseup sort keyup '.split(' ').join(c.namespace + ' ')), function(e, external) { + var cell, type = e.type; + // only recognize left clicks or enter + if ( ((e.which || e.button) !== 1 && !/sort|keyup/.test(type)) || (type === 'keyup' && e.which !== 13) ) { + return; + } + // ignore long clicks (prevents resizable widget from initializing a sort) + if (type === 'mouseup' && external !== true && (new Date().getTime() - downTime > 250)) { return; } + // set timer on mousedown + if (type === 'mousedown') { + downTime = new Date().getTime(); + cell = $.fn.closest ? $(e.target).closest('td,th') : $(e.target).parents('td,th').filter(':first'); + return /(input|select|button|textarea)/i.test(e.target.tagName) || + // allow clicks to contents of selected cells + cell.hasClass(c.cssAllowClicks) ? '' : !c.cancelSelection; + } + if (c.delayInit && isEmptyObject(c.cache)) { buildCache(table); } + // jQuery v1.2.6 doesn't have closest() + cell = $.fn.closest ? $(this).closest('th, td')[0] : /TH|TD/.test(this.tagName) ? this : $(this).parents('th, td')[0]; + // reference original table headers and find the same cell + cell = c.$headers[ $headers.index( cell ) ]; + if (!cell.sortDisabled) { + initSort(table, cell, e); + } + }); + if (c.cancelSelection) { + // cancel selection + $headers + .attr('unselectable', 'on') + .bind('selectstart', false) + .css({ + 'user-select': 'none', + 'MozUserSelect': 'none' // not needed for jQuery 1.8+ + }); + } + }; + + // restore headers + ts.restoreHeaders = function(table){ + var $cell, + c = $(table)[0].config; + // don't use c.$headers here in case header cells were swapped + c.$table.find(c.selectorHeaders).each(function(i){ + $cell = $(this); + // only restore header cells if it is wrapped + // because this is also used by the updateAll method + if ($cell.find('.' + ts.css.headerIn).length){ + $cell.html( c.headerContent[i] ); + } + }); + }; + + ts.destroy = function(table, removeClasses, callback){ + table = $(table)[0]; + if (!table.hasInitialized) { return; } + // remove all widgets + ts.removeWidget(table, true, false); + var events, + $t = $(table), + c = table.config, + $h = $t.find('thead:first'), + $r = $h.find('tr.' + ts.css.headerRow).removeClass(ts.css.headerRow + ' ' + c.cssHeaderRow), + $f = $t.find('tfoot:first > tr').children('th, td'); + if (removeClasses === false && $.inArray('uitheme', c.widgets) >= 0) { + // reapply uitheme classes, in case we want to maintain appearance + $t.trigger('applyWidgetId', ['uitheme']); + $t.trigger('applyWidgetId', ['zebra']); + } + // remove widget added rows, just in case + $h.find('tr').not($r).remove(); + // disable tablesorter + events = 'sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache ' + + 'applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd resetToLoadState '.split(' ') + .join(c.namespace + ' '); + $t + .removeData('tablesorter') + .unbind( $.trim(events) ); + c.$headers.add($f) + .removeClass( [ts.css.header, c.cssHeader, c.cssAsc, c.cssDesc, ts.css.sortAsc, ts.css.sortDesc, ts.css.sortNone].join(' ') ) + .removeAttr('data-column') + .removeAttr('aria-label') + .attr('aria-disabled', 'true'); + $r.find(c.selectorSort).unbind( $.trim('mousedown mouseup keypress '.split(' ').join(c.namespace + ' ')) ); + ts.restoreHeaders(table); + $t.toggleClass(ts.css.table + ' ' + c.tableClass + ' tablesorter-' + c.theme, removeClasses === false); + // clear flag in case the plugin is initialized again + table.hasInitialized = false; + delete table.config.cache; + if (typeof callback === 'function') { + callback(table); + } + }; + + // *** sort functions *** + // regex used in natural sort + ts.regex = { + chunk : /(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi, // chunk/tokenize numbers & letters + chunks: /(^\\0|\\0$)/, // replace chunks @ ends + hex: /^0x[0-9a-f]+$/i // hex + }; + + // Natural sort - https://github.com/overset/javascript-natural-sort (date sorting removed) + // this function will only accept strings, or you'll see 'TypeError: undefined is not a function' + // I could add a = a.toString(); b = b.toString(); but it'll slow down the sort overall + ts.sortNatural = function(a, b) { + if (a === b) { return 0; } + var xN, xD, yN, yD, xF, yF, i, mx, + r = ts.regex; + // first try and sort Hex codes + if (r.hex.test(b)) { + xD = parseInt(a.match(r.hex), 16); + yD = parseInt(b.match(r.hex), 16); + if ( xD < yD ) { return -1; } + if ( xD > yD ) { return 1; } + } + // chunk/tokenize + xN = a.replace(r.chunk, '\\0$1\\0').replace(r.chunks, '').split('\\0'); + yN = b.replace(r.chunk, '\\0$1\\0').replace(r.chunks, '').split('\\0'); + mx = Math.max(xN.length, yN.length); + // natural sorting through split numeric strings and default strings + for (i = 0; i < mx; i++) { + // find floats not starting with '0', string or 0 if not defined + xF = isNaN(xN[i]) ? xN[i] || 0 : parseFloat(xN[i]) || 0; + yF = isNaN(yN[i]) ? yN[i] || 0 : parseFloat(yN[i]) || 0; + // handle numeric vs string comparison - number < string - (Kyle Adams) + if (isNaN(xF) !== isNaN(yF)) { return (isNaN(xF)) ? 1 : -1; } + // rely on string comparison if different types - i.e. '02' < 2 != '02' < '2' + if (typeof xF !== typeof yF) { + xF += ''; + yF += ''; + } + if (xF < yF) { return -1; } + if (xF > yF) { return 1; } + } + return 0; + }; + + ts.sortNaturalAsc = function(a, b, col, table, c) { + if (a === b) { return 0; } + var e = c.string[ (c.empties[col] || c.emptyTo ) ]; + if (a === '' && e !== 0) { return typeof e === 'boolean' ? (e ? -1 : 1) : -e || -1; } + if (b === '' && e !== 0) { return typeof e === 'boolean' ? (e ? 1 : -1) : e || 1; } + return ts.sortNatural(a, b); + }; + + ts.sortNaturalDesc = function(a, b, col, table, c) { + if (a === b) { return 0; } + var e = c.string[ (c.empties[col] || c.emptyTo ) ]; + if (a === '' && e !== 0) { return typeof e === 'boolean' ? (e ? -1 : 1) : e || 1; } + if (b === '' && e !== 0) { return typeof e === 'boolean' ? (e ? 1 : -1) : -e || -1; } + return ts.sortNatural(b, a); + }; + + // basic alphabetical sort + ts.sortText = function(a, b) { + return a > b ? 1 : (a < b ? -1 : 0); + }; + + // return text string value by adding up ascii value + // so the text is somewhat sorted when using a digital sort + // this is NOT an alphanumeric sort + ts.getTextValue = function(a, num, mx) { + if (mx) { + // make sure the text value is greater than the max numerical value (mx) + var i, l = a ? a.length : 0, n = mx + num; + for (i = 0; i < l; i++) { + n += a.charCodeAt(i); + } + return num * n; + } + return 0; + }; + + ts.sortNumericAsc = function(a, b, num, mx, col, table) { + if (a === b) { return 0; } + var c = table.config, + e = c.string[ (c.empties[col] || c.emptyTo ) ]; + if (a === '' && e !== 0) { return typeof e === 'boolean' ? (e ? -1 : 1) : -e || -1; } + if (b === '' && e !== 0) { return typeof e === 'boolean' ? (e ? 1 : -1) : e || 1; } + if (isNaN(a)) { a = ts.getTextValue(a, num, mx); } + if (isNaN(b)) { b = ts.getTextValue(b, num, mx); } + return a - b; + }; + + ts.sortNumericDesc = function(a, b, num, mx, col, table) { + if (a === b) { return 0; } + var c = table.config, + e = c.string[ (c.empties[col] || c.emptyTo ) ]; + if (a === '' && e !== 0) { return typeof e === 'boolean' ? (e ? -1 : 1) : e || 1; } + if (b === '' && e !== 0) { return typeof e === 'boolean' ? (e ? 1 : -1) : -e || -1; } + if (isNaN(a)) { a = ts.getTextValue(a, num, mx); } + if (isNaN(b)) { b = ts.getTextValue(b, num, mx); } + return b - a; + }; + + ts.sortNumeric = function(a, b) { + return a - b; + }; + + // used when replacing accented characters during sorting + ts.characterEquivalents = { + 'a' : '\u00e1\u00e0\u00e2\u00e3\u00e4\u0105\u00e5', // áàâãäąå + 'A' : '\u00c1\u00c0\u00c2\u00c3\u00c4\u0104\u00c5', // ÁÀÂÃÄĄÅ + 'c' : '\u00e7\u0107\u010d', // çćč + 'C' : '\u00c7\u0106\u010c', // ÇĆČ + 'e' : '\u00e9\u00e8\u00ea\u00eb\u011b\u0119', // éèêëěę + 'E' : '\u00c9\u00c8\u00ca\u00cb\u011a\u0118', // ÉÈÊËĚĘ + 'i' : '\u00ed\u00ec\u0130\u00ee\u00ef\u0131', // íìİîïı + 'I' : '\u00cd\u00cc\u0130\u00ce\u00cf', // ÍÌİÎÏ + 'o' : '\u00f3\u00f2\u00f4\u00f5\u00f6', // óòôõö + 'O' : '\u00d3\u00d2\u00d4\u00d5\u00d6', // ÓÒÔÕÖ + 'ss': '\u00df', // ß (s sharp) + 'SS': '\u1e9e', // ẞ (Capital sharp s) + 'u' : '\u00fa\u00f9\u00fb\u00fc\u016f', // úùûüů + 'U' : '\u00da\u00d9\u00db\u00dc\u016e' // ÚÙÛÜŮ + }; + ts.replaceAccents = function(s) { + var a, acc = '[', eq = ts.characterEquivalents; + if (!ts.characterRegex) { + ts.characterRegexArray = {}; + for (a in eq) { + if (typeof a === 'string') { + acc += eq[a]; + ts.characterRegexArray[a] = new RegExp('[' + eq[a] + ']', 'g'); + } + } + ts.characterRegex = new RegExp(acc + ']'); + } + if (ts.characterRegex.test(s)) { + for (a in eq) { + if (typeof a === 'string') { + s = s.replace( ts.characterRegexArray[a], a ); + } + } + } + return s; + }; + + // *** utilities *** + ts.isValueInArray = function(column, arry) { + var indx, len = arry.length; + for (indx = 0; indx < len; indx++) { + if (arry[indx][0] === column) { + return indx; + } + } + return -1; + }; + + ts.addParser = function(parser) { + var i, l = ts.parsers.length, a = true; + for (i = 0; i < l; i++) { + if (ts.parsers[i].id.toLowerCase() === parser.id.toLowerCase()) { + a = false; + } + } + if (a) { + ts.parsers.push(parser); + } + }; + + ts.getParserById = function(name) { + /*jshint eqeqeq:false */ + if (name == 'false') { return false; } + var i, l = ts.parsers.length; + for (i = 0; i < l; i++) { + if (ts.parsers[i].id.toLowerCase() === (name.toString()).toLowerCase()) { + return ts.parsers[i]; + } + } + return false; + }; + + ts.addWidget = function(widget) { + ts.widgets.push(widget); + }; + + ts.hasWidget = function(table, name){ + table = $(table); + return table.length && table[0].config && table[0].config.widgetInit[name] || false; + }; + + ts.getWidgetById = function(name) { + var i, w, l = ts.widgets.length; + for (i = 0; i < l; i++) { + w = ts.widgets[i]; + if (w && w.hasOwnProperty('id') && w.id.toLowerCase() === name.toLowerCase()) { + return w; + } + } + }; + + ts.applyWidget = function(table, init, callback) { + table = $(table)[0]; // in case this is called externally + var c = table.config, + wo = c.widgetOptions, + tableClass = ' ' + c.table.className + ' ', + widgets = [], + time, time2, w, wd; + // prevent numerous consecutive widget applications + if (init !== false && table.hasInitialized && (table.isApplyingWidgets || table.isUpdating)) { return; } + if (c.debug) { time = new Date(); } + // look for widgets to apply from in table class + // stop using \b otherwise this matches 'ui-widget-content' & adds 'content' widget + wd = new RegExp( '\\s' + c.widgetClass.replace( /\{name\}/i, '([\\w-]+)' )+ '\\s', 'g' ); + if ( tableClass.match( wd ) ) { + // extract out the widget id from the table class (widget id's can include dashes) + w = tableClass.match( wd ); + if ( w ) { + $.each( w, function( i,n ){ + c.widgets.push( n.replace( wd, '$1' ) ); + }); + } + } + if (c.widgets.length) { + table.isApplyingWidgets = true; + // ensure unique widget ids + c.widgets = $.grep(c.widgets, function(v, k){ + return $.inArray(v, c.widgets) === k; + }); + // build widget array & add priority as needed + $.each(c.widgets || [], function(i,n){ + wd = ts.getWidgetById(n); + if (wd && wd.id) { + // set priority to 10 if not defined + if (!wd.priority) { wd.priority = 10; } + widgets[i] = wd; + } + }); + // sort widgets by priority + widgets.sort(function(a, b){ + return a.priority < b.priority ? -1 : a.priority === b.priority ? 0 : 1; + }); + // add/update selected widgets + $.each(widgets, function(i,w){ + if (w) { + if (init || !(c.widgetInit[w.id])) { + // set init flag first to prevent calling init more than once (e.g. pager) + c.widgetInit[w.id] = true; + if (w.hasOwnProperty('options')) { + wo = table.config.widgetOptions = $.extend( true, {}, w.options, wo ); + } + if (w.hasOwnProperty('init')) { + if (c.debug) { time2 = new Date(); } + w.init(table, w, c, wo); + if (c.debug) { ts.benchmark('Initializing ' + w.id + ' widget', time2); } + } + } + if (!init && w.hasOwnProperty('format')) { + if (c.debug) { time2 = new Date(); } + w.format(table, c, wo, false); + if (c.debug) { ts.benchmark( ( init ? 'Initializing ' : 'Applying ' ) + w.id + ' widget', time2); } + } + } + }); + // callback executed on init only + if (!init && typeof callback === 'function') { + callback(table); + } + } + setTimeout(function(){ + table.isApplyingWidgets = false; + $.data(table, 'lastWidgetApplication', new Date()); + }, 0); + if (c.debug) { + w = c.widgets.length; + benchmark('Completed ' + (init === true ? 'initializing ' : 'applying ') + w + ' widget' + (w !== 1 ? 's' : ''), time); + } + }; + + ts.removeWidget = function(table, name, refreshing){ + table = $(table)[0]; + // if name === true, add all widgets from $.tablesorter.widgets + if (name === true) { + name = []; + $.each( ts.widgets, function(i, w){ + if (w && w.id) { + name.push( w.id ); + } + }); + } else { + // name can be either an array of widgets names, + // or a space/comma separated list of widget names + name = ( $.isArray(name) ? name.join(',') : name || '' ).toLowerCase().split( /[\s,]+/ ); + } + var i, widget, indx, + c = table.config, + len = name.length; + for (i = 0; i < len; i++) { + widget = ts.getWidgetById(name[i]); + indx = $.inArray( name[i], c.widgets ); + if ( widget && 'remove' in widget ) { + if (c.debug && indx >= 0) { log( 'Removing "' + name[i] + '" widget' ); } + widget.remove(table, c, c.widgetOptions, refreshing); + c.widgetInit[name[i]] = false; + } + // don't remove the widget from config.widget if refreshing + if (indx >= 0 && refreshing !== true) { + c.widgets.splice( indx, 1 ); + } + } + }; + + ts.refreshWidgets = function(table, doAll, dontapply) { + table = $(table)[0]; // see issue #243 + var c = table.config, + cw = c.widgets, + list = [], + callback = function(table){ + $(table).trigger('refreshComplete'); + }; + // remove widgets not defined in config.widgets, unless doAll is true + $.each( ts.widgets, function(i, w){ + if (w && w.id && (doAll || $.inArray( w.id, cw ) < 0)) { + list.push( w.id ); + } + }); + ts.removeWidget( table, list.join(','), true ); + if (dontapply !== true) { + // call widget init if + ts.applyWidget(table, doAll || false, callback ); + if (doAll) { + // apply widget format + ts.applyWidget(table, false, callback); + } + } else { + callback(table); + } + }; + + // get sorter, string, empty, etc options for each column from + // jQuery data, metadata, header option or header class name ('sorter-false') + // priority = jQuery data > meta > headers option > header class name + ts.getData = function(h, ch, key) { + var val = '', $h = $(h), m, cl; + if (!$h.length) { return ''; } + m = $.metadata ? $h.metadata() : false; + cl = ' ' + ($h.attr('class') || ''); + if (typeof $h.data(key) !== 'undefined' || typeof $h.data(key.toLowerCase()) !== 'undefined'){ + // 'data-lockedOrder' is assigned to 'lockedorder'; but 'data-locked-order' is assigned to 'lockedOrder' + // 'data-sort-initial-order' is assigned to 'sortInitialOrder' + val += $h.data(key) || $h.data(key.toLowerCase()); + } else if (m && typeof m[key] !== 'undefined') { + val += m[key]; + } else if (ch && typeof ch[key] !== 'undefined') { + val += ch[key]; + } else if (cl !== ' ' && cl.match(' ' + key + '-')) { + // include sorter class name 'sorter-text', etc; now works with 'sorter-my-custom-parser' + val = cl.match( new RegExp('\\s' + key + '-([\\w-]+)') )[1] || ''; + } + return $.trim(val); + }; + + ts.formatFloat = function(s, table) { + if (typeof s !== 'string' || s === '') { return s; } + // allow using formatFloat without a table; defaults to US number format + var i, + t = table && table.config ? table.config.usNumberFormat !== false : + typeof table !== 'undefined' ? table : true; + if (t) { + // US Format - 1,234,567.89 -> 1234567.89 + s = s.replace(/,/g,''); + } else { + // German Format = 1.234.567,89 -> 1234567.89 + // French Format = 1 234 567,89 -> 1234567.89 + s = s.replace(/[\s|\.]/g,'').replace(/,/g,'.'); + } + if(/^\s*\([.\d]+\)/.test(s)) { + // make (#) into a negative number -> (10) = -10 + s = s.replace(/^\s*\(([.\d]+)\)/, '-$1'); + } + i = parseFloat(s); + // return the text instead of zero + return isNaN(i) ? $.trim(s) : i; + }; + + ts.isDigit = function(s) { + // replace all unwanted chars and match + return isNaN(s) ? (/^[\-+(]?\d+[)]?$/).test(s.toString().replace(/[,.'"\s]/g, '')) : true; + }; + + }() + }); + + // make shortcut + var ts = $.tablesorter; + + // extend plugin scope + $.fn.extend({ + tablesorter: ts.construct + }); + + // add default parsers + ts.addParser({ + id: 'no-parser', + is: function() { + return false; + }, + format: function() { + return ''; + }, + type: 'text' + }); + + ts.addParser({ + id: 'text', + is: function() { + return true; + }, + format: function(s, table) { + var c = table.config; + if (s) { + s = $.trim( c.ignoreCase ? s.toLocaleLowerCase() : s ); + s = c.sortLocaleCompare ? ts.replaceAccents(s) : s; + } + return s; + }, + type: 'text' + }); + + ts.addParser({ + id: 'digit', + is: function(s) { + return ts.isDigit(s); + }, + format: function(s, table) { + var n = ts.formatFloat((s || '').replace(/[^\w,. \-()]/g, ''), table); + return s && typeof n === 'number' ? n : s ? $.trim( s && table.config.ignoreCase ? s.toLocaleLowerCase() : s ) : s; + }, + type: 'numeric' + }); + + ts.addParser({ + id: 'currency', + is: function(s) { + return (/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/).test((s || '').replace(/[+\-,. ]/g,'')); // £$€¤¥¢ + }, + format: function(s, table) { + var n = ts.formatFloat((s || '').replace(/[^\w,. \-()]/g, ''), table); + return s && typeof n === 'number' ? n : s ? $.trim( s && table.config.ignoreCase ? s.toLocaleLowerCase() : s ) : s; + }, + type: 'numeric' + }); + + ts.addParser({ + id: 'url', + is: function(s) { + return (/^(https?|ftp|file):\/\//).test(s); + }, + format: function(s) { + return s ? $.trim(s.replace(/(https?|ftp|file):\/\//, '')) : s; + }, + parsed : true, // filter widget flag + type: 'text' + }); + + ts.addParser({ + id: 'isoDate', + is: function(s) { + return (/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/).test(s); + }, + format: function(s, table) { + var date = s ? new Date( s.replace(/-/g, '/') ) : s; + return date instanceof Date && isFinite(date) ? date.getTime() : s; + }, + type: 'numeric' + }); + + ts.addParser({ + id: 'percent', + is: function(s) { + return (/(\d\s*?%|%\s*?\d)/).test(s) && s.length < 15; + }, + format: function(s, table) { + return s ? ts.formatFloat(s.replace(/%/g, ''), table) : s; + }, + type: 'numeric' + }); + + // added image parser to core v2.17.9 + ts.addParser({ + id: 'image', + is: function(s, table, node, $node){ + return $node.find('img').length > 0; + }, + format: function(s, table, cell) { + return $(cell).find('img').attr(table.config.imgAttr || 'alt') || s; + }, + parsed : true, // filter widget flag + type: 'text' + }); + + ts.addParser({ + id: 'usLongDate', + is: function(s) { + // two digit years are not allowed cross-browser + // Jan 01, 2013 12:34:56 PM or 01 Jan 2013 + return (/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i).test(s) || (/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i).test(s); + }, + format: function(s, table) { + var date = s ? new Date( s.replace(/(\S)([AP]M)$/i, '$1 $2') ) : s; + return date instanceof Date && isFinite(date) ? date.getTime() : s; + }, + type: 'numeric' + }); + + ts.addParser({ + id: 'shortDate', // 'mmddyyyy', 'ddmmyyyy' or 'yyyymmdd' + is: function(s) { + // testing for ##-##-#### or ####-##-##, so it's not perfect; time can be included + return (/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/).test((s || '').replace(/\s+/g,' ').replace(/[\-.,]/g, '/')); + }, + format: function(s, table, cell, cellIndex) { + if (s) { + var date, d, + c = table.config, + ci = c.$headers.filter('[data-column="' + cellIndex + '"]:last'), + format = ci.length && ci[0].dateFormat || ts.getData( ci, ts.getColumnData( table, c.headers, cellIndex ), 'dateFormat') || c.dateFormat; + d = s.replace(/\s+/g, ' ').replace(/[\-.,]/g, '/'); // escaped - because JSHint in Firefox was showing it as an error + if (format === 'mmddyyyy') { + d = d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/, '$3/$1/$2'); + } else if (format === 'ddmmyyyy') { + d = d.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/, '$3/$2/$1'); + } else if (format === 'yyyymmdd') { + d = d.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/, '$1/$2/$3'); + } + date = new Date(d); + return date instanceof Date && isFinite(date) ? date.getTime() : s; + } + return s; + }, + type: 'numeric' + }); + + ts.addParser({ + id: 'time', + is: function(s) { + return (/^(([0-2]?\d:[0-5]\d)|([0-1]?\d:[0-5]\d\s?([AP]M)))$/i).test(s); + }, + format: function(s, table) { + var date = s ? new Date( '2000/01/01 ' + s.replace(/(\S)([AP]M)$/i, '$1 $2') ) : s; + return date instanceof Date && isFinite(date) ? date.getTime() : s; + }, + type: 'numeric' + }); + + ts.addParser({ + id: 'metadata', + is: function() { + return false; + }, + format: function(s, table, cell) { + var c = table.config, + p = (!c.parserMetadataName) ? 'sortValue' : c.parserMetadataName; + return $(cell).metadata()[p]; + }, + type: 'numeric' + }); + + // add default widgets + ts.addWidget({ + id: 'zebra', + priority: 90, + format: function(table, c, wo) { + var $tb, $tv, $tr, row, even, time, k, + child = new RegExp(c.cssChildRow, 'i'), + b = c.$tbodies; + if (c.debug) { + time = new Date(); + } + for (k = 0; k < b.length; k++ ) { + // loop through the visible rows + row = 0; + $tb = b.eq(k); + $tv = $tb.children('tr:visible').not(c.selectorRemove); + // revered back to using jQuery each - strangely it's the fastest method + /*jshint loopfunc:true */ + $tv.each(function(){ + $tr = $(this); + // style child rows the same way the parent row was styled + if (!child.test(this.className)) { row++; } + even = (row % 2 === 0); + $tr.removeClass(wo.zebra[even ? 1 : 0]).addClass(wo.zebra[even ? 0 : 1]); + }); + } + }, + remove: function(table, c, wo, refreshing){ + if (refreshing) { return; } + var k, $tb, + b = c.$tbodies, + rmv = (wo.zebra || [ 'even', 'odd' ]).join(' '); + for (k = 0; k < b.length; k++ ){ + $tb = ts.processTbody(table, b.eq(k), true); // remove tbody + $tb.children().removeClass(rmv); + ts.processTbody(table, $tb, false); // restore tbody + } + } + }); + + return ts; +})); diff --git a/dist/js/jquery.tablesorter.min.js b/dist/js/jquery.tablesorter.min.js new file mode 100644 index 00000000..e56eed05 --- /dev/null +++ b/dist/js/jquery.tablesorter.min.js @@ -0,0 +1,3 @@ +/*! TableSorter (FORK) v2.19.1 */ +!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&"object"==typeof module.exports?module.exports=a(require("jquery")):a(jQuery)}(function(a){"use strict";a.extend({tablesorter:new function(){function b(){var a=arguments[0],b=arguments.length>1?Array.prototype.slice.call(arguments):a;"undefined"!=typeof console&&"undefined"!=typeof console.log?console[/error/i.test(a)?"error":/warn/i.test(a)?"warn":"log"](b):alert(b)}function c(a,c){b(a+" ("+((new Date).getTime()-c.getTime())+"ms)")}function d(a){for(var b in a)return!1;return!0}function e(b,c,d){if(!c)return"";var e,f=a(c),g=b.config,h=g.textExtraction||"";return a.trim("string"==typeof h?("basic"===h?f.attr(g.textAttribute)||c.textContent:c.textContent)||f.text()||"":"function"==typeof h?h(c,b,d):"function"==typeof(e=v.getColumnData(b,h,d))?e(c,b,d):c.textContent||f.text()||"")}function f(c,d,f,g){for(var h,i,j=v.parsers.length,k=!1,l="",m=!0;""===l&&m;)f++,d[f]?(k=d[f].cells[g],l=e(c,k,g),i=a(k),c.config.debug&&b("Checking if value was empty on row "+f+", column: "+g+': "'+l+'"')):m=!1;for(;--j>=0;)if(h=v.parsers[j],h&&"text"!==h.id&&h.is&&h.is(l,c,k,i))return h;return v.getParserById("text")}function g(a){var d,e,g,h,i,j,k,l,m,n,o=a.config,p=o.$tbodies=o.$table.children("tbody:not(."+o.cssInfoBlock+")"),q=0,r="",s=p.length;if(0===s)return o.debug?b("Warning: *Empty table!* Not building a parser cache"):"";for(o.debug&&(n=new Date,b("Detecting parsers for each column")),e={extractors:[],parsers:[]};s>q;){if(d=p[q].rows,d.length)for(g=o.columns,h=0;g>h;h++)i=o.$headers.filter('[data-column="'+h+'"]:last'),j=v.getColumnData(a,o.headers,h),m=v.getParserById(v.getData(i,j,"extractor")),l=v.getParserById(v.getData(i,j,"sorter")),k="false"===v.getData(i,j,"parser"),o.empties[h]=(v.getData(i,j,"empty")||o.emptyTo||(o.emptyToBottom?"bottom":"top")).toLowerCase(),o.strings[h]=(v.getData(i,j,"string")||o.stringTo||"max").toLowerCase(),k&&(l=v.getParserById("no-parser")),m||(m=!1),l||(l=f(a,d,-1,h)),o.debug&&(r+="column:"+h+"; extractor:"+m.id+"; parser:"+l.id+"; string:"+o.strings[h]+"; empty: "+o.empties[h]+"\n"),e.parsers[h]=l,e.extractors[h]=m;q+=e.parsers.length?s:1}o.debug&&(b(r?r:"No parsers detected"),c("Completed detecting parsers",n)),o.parsers=e.parsers,o.extractors=e.extractors}function h(d){var f,g,h,i,j,k,l,m,n,o,p,q,r,s,t=d.config,u=t.$table.children("tbody"),w=t.extractors,x=t.parsers;if(t.cache={},t.totalRows=0,!x)return t.debug?b("Warning: *Empty table!* Not building a cache"):"";for(t.debug&&(p=new Date),t.showProcessing&&v.isProcessing(d,!0),l=0;lj;++j)if(r={child:[],raw:[]},m=a(u[l].rows[j]),n=[new Array(t.columns)],o=[],m.hasClass(t.cssChildRow)&&0!==j)g=f.normalized.length-1,f.normalized[g][t.columns].$row=f.normalized[g][t.columns].$row.add(m),m.prev().hasClass(t.cssChildRow)||m.prev().addClass(v.css.cssHasChild),r.child[g]=a.trim(m[0].textContent||m.text()||"");else{for(r.$row=m,r.order=j,k=0;kj;j++)p.push(f[j][m.columns].$row),m.appender&&(!m.pager||m.pager.removeRows&&n.pager_removeRows||m.pager.ajax)||i.append(f[j][m.columns].$row);v.processTbody(b,i,!1)}m.appender&&m.appender(b,p),m.debug&&c("Rebuilt table",l),e||m.appender||v.applyWidget(b),b.isUpdating&&m.$table.trigger("updateComplete",b)}function j(a){return/^d/i.test(a)||1===a}function k(d){var e,f,g,h,i,k,l,n=d.config;n.headerList=[],n.headerContent=[],n.debug&&(l=new Date),n.columns=v.computeColumnIndex(n.$table.children("thead, tfoot").children("tr")),h=n.cssIcon?'':"",n.$headers=a(a.map(a(d).find(n.selectorHeaders),function(b,c){return f=a(b),f.parent().hasClass(n.cssIgnoreRow)?void 0:(e=v.getColumnData(d,n.headers,c,!0),n.headerContent[c]=f.html(),""===n.headerTemplate||f.find("."+v.css.headerIn).length||(i=n.headerTemplate.replace(/\{content\}/g,f.html()).replace(/\{icon\}/g,f.find("."+v.css.icon).length?"":h),n.onRenderTemplate&&(g=n.onRenderTemplate.apply(f,[c,i]),g&&"string"==typeof g&&(i=g)),f.html('
    '+i+"
    ")),n.onRenderHeader&&n.onRenderHeader.apply(f,[c,n,n.$table]),b.column=parseInt(f.attr("data-column"),10),b.order=j(v.getData(f,e,"sortInitialOrder")||n.sortInitialOrder)?[1,0,2]:[0,1,2],b.count=-1,b.lockedOrder=!1,k=v.getData(f,e,"lockedOrder")||!1,"undefined"!=typeof k&&k!==!1&&(b.order=b.lockedOrder=j(k)?[1,1,1]:[0,0,0]),f.addClass(v.css.header+" "+n.cssHeader),n.headerList[c]=b,f.parent().addClass(v.css.headerRow+" "+n.cssHeaderRow).attr("role","row"),n.tabIndex&&f.attr("tabindex",0),b)})),a(d).find(n.selectorHeaders).attr({scope:"col",role:"columnheader"}),m(d),n.debug&&(c("Built headers:",l),b(n.$headers))}function l(a,b,c){var d=a.config;d.$table.find(d.selectorRemove).remove(),g(a),h(a),t(d,b,c)}function m(b){var c,d,e,f=b.config;f.$headers.each(function(g,h){d=a(h),e=v.getColumnData(b,f.headers,g,!0),c="false"===v.getData(h,e,"sorter")||"false"===v.getData(h,e,"parser"),h.sortDisabled=c,d[c?"addClass":"removeClass"]("sorter-false").attr("aria-disabled",""+c),b.id&&(c?d.removeAttr("aria-controls"):d.attr("aria-controls",b.id))})}function n(b){var c,d,e,f=b.config,g=f.sortList,h=g.length,i=v.css.sortNone+" "+f.cssNone,j=[v.css.sortAsc+" "+f.cssAsc,v.css.sortDesc+" "+f.cssDesc],k=[f.cssIconAsc,f.cssIconDesc,f.cssIconNone],l=["ascending","descending"],m=a(b).find("tfoot tr").children().add(f.$extraHeaders).removeClass(j.join(" "));for(f.$headers.removeClass(j.join(" ")).addClass(i).attr("aria-sort","none").find("."+f.cssIcon).removeClass(k.join(" ")).addClass(k[2]),d=0;h>d;d++)if(2!==g[d][1]&&(c=f.$headers.not(".sorter-false").filter('[data-column="'+g[d][0]+'"]'+(1===h?":last":"")),c.length)){for(e=0;e=0?e:d[1]%(i.sortReset?3:2)}})}function p(a,b){return a&&a[b]?a[b].type||"":""}function q(b,c,d){if(b.isUpdating)return setTimeout(function(){q(b,c,d)},50);var e,f,g,h,j,k=b.config,l=!d[k.sortMultiSortKey],m=k.$table;if(m.trigger("sortStart",b),c.count=d[k.sortResetKey]?2:(c.count+1)%(k.sortReset?3:2),k.sortRestart&&(f=c,k.$headers.each(function(){this===f||!l&&a(this).is("."+v.css.sortDesc+",."+v.css.sortAsc)||(this.count=-1)})),f=parseInt(a(c).attr("data-column"),10),l){if(k.sortList=[],null!==k.sortForce)for(e=k.sortForce,g=0;gh&&(k.sortList.push([f,h]),c.colSpan>1))for(g=1;g1)for(g=0;g=0&&k.sortList.splice(j,1);if(v.isValueInArray(f,k.sortList)>=0)for(g=0;gh&&(k.sortList.push([f,h]),c.colSpan>1))for(g=1;ge;e++)i=q.cache[e].colMax,j=q.cache[e].normalized,j.sort(function(c,d){for(b=0;t>b;b++){if(g=s[b][0],k=s[b][1],o=0===k,q.sortStable&&c[g]===d[g]&&1===t)return c[q.columns].order-d[q.columns].order;if(f=/n/i.test(p(q.parsers,g)),f&&q.strings[g]?(f="boolean"==typeof q.string[q.strings[g]]?(o?1:-1)*(q.string[q.strings[g]]?-1:1):q.strings[g]?q.string[q.strings[g]]||0:0,l=q.numberSorter?q.numberSorter(c[g],d[g],o,i[g],a):v["sortNumeric"+(o?"Asc":"Desc")](c[g],d[g],f,i[g],g,a)):(m=o?c:d,n=o?d:c,l="function"==typeof r?r(m[g],n[g],o,g,a):"object"==typeof r&&r.hasOwnProperty(g)?r[g](m[g],n[g],o,g,a):v["sortNatural"+(o?"Asc":"Desc")](c[g],d[g],g,a,q)),l)return l}return c[q.columns].order-d[q.columns].order});q.debug&&c("Sorting on "+s.toString()+" and dir "+k+" time",h)}}function s(b,c){b.table.isUpdating&&b.$table.trigger("updateComplete",b.table),a.isFunction(c)&&c(b.table)}function t(b,c,d){var e=a.isArray(c)?c:b.sortList,f="undefined"==typeof c?b.resort:c;f===!1||b.serverSideSorting||b.table.isProcessing?(s(b,d),v.applyWidget(b.table,!1)):e.length?b.$table.trigger("sorton",[e,function(){s(b,d)},!0]):b.$table.trigger("sortReset",[function(){s(b,d),v.applyWidget(b.table,!1)}])}function u(b){var c=b.config,f=c.$table,j="sortReset update updateRows updateCell updateAll addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave ".split(" ").join(c.namespace+" ");f.unbind(a.trim(j)).bind("sortReset"+c.namespace,function(d,e){d.stopPropagation(),c.sortList=[],n(b),r(b),i(b),a.isFunction(e)&&e(b)}).bind("updateAll"+c.namespace,function(a,d,e){a.stopPropagation(),b.isUpdating=!0,v.refreshWidgets(b,!0,!0),k(b),v.bindEvents(b,c.$headers,!0),u(b),l(b,d,e)}).bind("update"+c.namespace+" updateRows"+c.namespace,function(a,c,d){a.stopPropagation(),b.isUpdating=!0,m(b),l(b,c,d)}).bind("updateCell"+c.namespace,function(d,g,h,i){d.stopPropagation(),b.isUpdating=!0,f.find(c.selectorRemove).remove();var j,k,l,m,n=f.find("tbody"),o=a(g),p=n.index(a.fn.closest?o.closest("tbody"):o.parents("tbody").filter(":first")),q=a.fn.closest?o.closest("tr"):o.parents("tr").filter(":first");g=o[0],n.length&&p>=0&&(l=n.eq(p).find("tr").index(q),m=o.index(),c.cache[p].normalized[l][c.columns].$row=q,k="undefined"==typeof c.extractors[m].id?e(b,g,m):c.extractors[m].format(e(b,g,m),b,g,m),j="no-parser"===c.parsers[m].id?"":c.parsers[m].format(k,b,g,m),c.cache[p].normalized[l][m]=c.ignoreCase&&"string"==typeof j?j.toLowerCase():j,"numeric"===(c.parsers[m].type||"").toLowerCase()&&(c.cache[p].colMax[m]=Math.max(Math.abs(j)||0,c.cache[p].colMax[m]||0)),j="undefined"!==h?h:c.resort,j!==!1?t(c,j,i):(a.isFunction(i)&&i(b),c.$table.trigger("updateComplete",c.table)))}).bind("addRows"+c.namespace,function(h,i,j,k){if(h.stopPropagation(),b.isUpdating=!0,d(c.cache))m(b),l(b,j,k);else{i=a(i).attr("role","row");var n,o,p,q,r,s,u,v=i.filter("tr").length,w=f.find("tbody").index(i.parents("tbody").filter(":first"));for(c.parsers&&c.parsers.length||g(b),n=0;v>n;n++){for(p=i[n].cells.length,u=[],s={child:[],$row:i.eq(n),order:c.cache[w].normalized.length},o=0;p>o;o++)q="undefined"==typeof c.extractors[o].id?e(b,i[n].cells[o],o):c.extractors[o].format(e(b,i[n].cells[o],o),b,i[n].cells[o],o),r="no-parser"===c.parsers[o].id?"":c.parsers[o].format(q,b,i[n].cells[o],o),u[o]=c.ignoreCase&&"string"==typeof r?r.toLowerCase():r,"numeric"===(c.parsers[o].type||"").toLowerCase()&&(c.cache[w].colMax[o]=Math.max(Math.abs(u[o])||0,c.cache[w].colMax[o]||0));u.push(s),c.cache[w].normalized.push(u)}t(c,j,k)}}).bind("updateComplete"+c.namespace,function(){b.isUpdating=!1}).bind("sorton"+c.namespace,function(c,e,g,j){var k=b.config;c.stopPropagation(),f.trigger("sortStart",this),o(b,e),n(b),k.delayInit&&d(k.cache)&&h(b),f.trigger("sortBegin",this),r(b),i(b,j),f.trigger("sortEnd",this),v.applyWidget(b),a.isFunction(g)&&g(b)}).bind("appendCache"+c.namespace,function(c,d,e){c.stopPropagation(),i(b,e),a.isFunction(d)&&d(b)}).bind("updateCache"+c.namespace,function(d,e){c.parsers&&c.parsers.length||g(b),h(b),a.isFunction(e)&&e(b)}).bind("applyWidgetId"+c.namespace,function(a,d){a.stopPropagation(),v.getWidgetById(d).format(b,c,c.widgetOptions)}).bind("applyWidgets"+c.namespace,function(a,c){a.stopPropagation(),v.applyWidget(b,c)}).bind("refreshWidgets"+c.namespace,function(a,c,d){a.stopPropagation(),v.refreshWidgets(b,c,d)}).bind("destroy"+c.namespace,function(a,c,d){a.stopPropagation(),v.destroy(b,c,d)}).bind("resetToLoadState"+c.namespace,function(){v.removeWidget(b,!0,!1),c=a.extend(!0,v.defaults,c.originalSettings),b.hasInitialized=!1,v.setup(b,c)})}var v=this;v.version="2.19.1",v.parsers=[],v.widgets=[],v.defaults={theme:"default",widthFixed:!1,showProcessing:!1,headerTemplate:"{content}",onRenderTemplate:null,onRenderHeader:null,cancelSelection:!0,tabIndex:!0,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",sortResetKey:"ctrlKey",usNumberFormat:!0,delayInit:!1,serverSideSorting:!1,resort:!0,headers:{},ignoreCase:!0,sortForce:null,sortList:[],sortAppend:null,sortStable:!1,sortInitialOrder:"asc",sortLocaleCompare:!1,sortReset:!1,sortRestart:!1,emptyTo:"bottom",stringTo:"max",textExtraction:"basic",textAttribute:"data-text",textSorter:null,numberSorter:null,widgets:[],widgetOptions:{zebra:["even","odd"]},initWidgets:!0,widgetClass:"widget-{name}",initialized:null,tableClass:"",cssAsc:"",cssDesc:"",cssNone:"",cssHeader:"",cssHeaderRow:"",cssProcessing:"",cssChildRow:"tablesorter-childRow",cssIcon:"tablesorter-icon",cssIconNone:"",cssIconAsc:"",cssIconDesc:"",cssInfoBlock:"tablesorter-infoOnly",cssAllowClicks:"tablesorter-allowClicks",cssIgnoreRow:"tablesorter-ignoreRow",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[]},v.css={table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",colgroup:"tablesorter-colgroup",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",info:"tablesorter-infoOnly",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"},v.language={sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"},v.log=b,v.benchmark=c,v.construct=function(b){return this.each(function(){var c=this,d=a.extend(!0,{},v.defaults,b);d.originalSettings=b,!c.hasInitialized&&v.buildTable&&"TABLE"!==this.tagName?v.buildTable(c,d):v.setup(c,d)})},v.setup=function(c,d){if(!c||!c.tHead||0===c.tBodies.length||c.hasInitialized===!0)return d.debug?b("ERROR: stopping initialization! No table, thead, tbody or tablesorter has already been initialized"):"";var e="",f=a(c),i=a.metadata;c.hasInitialized=!1,c.isProcessing=!0,c.config=d,a.data(c,"tablesorter",d),d.debug&&a.data(c,"startoveralltimer",new Date),d.supportsDataObject=function(a){return a[0]=parseInt(a[0],10),a[0]>1||1===a[0]&&parseInt(a[1],10)>=4}(a.fn.jquery.split(".")),d.string={max:1,min:-1,emptymin:1,emptymax:-1,zero:0,none:0,"null":0,top:!0,bottom:!1},d.emptyTo=d.emptyTo.toLowerCase(),d.stringTo=d.stringTo.toLowerCase(),/tablesorter\-/.test(f.attr("class"))||(e=""!==d.theme?" tablesorter-"+d.theme:""),d.table=c,d.$table=f.addClass(v.css.table+" "+d.tableClass+e).attr("role","grid"),d.$headers=f.find(d.selectorHeaders),d.namespace=d.namespace?"."+d.namespace.replace(/\W/g,""):".tablesorter"+Math.random().toString(16).slice(2),d.$table.children().children("tr").attr("role","row"),d.$tbodies=f.children("tbody:not(."+d.cssInfoBlock+")").attr({"aria-live":"polite","aria-relevant":"all"}),d.$table.children("caption").length&&(e=d.$table.children("caption")[0],e.id||(e.id=d.namespace.slice(1)+"caption"),d.$table.attr("aria-labelledby",e.id)),d.widgetInit={},d.textExtraction=d.$table.attr("data-text-extraction")||d.textExtraction||"basic",k(c),v.fixColumnWidth(c),g(c),d.totalRows=0,d.delayInit||h(c),v.bindEvents(c,d.$headers,!0),u(c),d.supportsDataObject&&"undefined"!=typeof f.data().sortlist?d.sortList=f.data().sortlist:i&&f.metadata()&&f.metadata().sortlist&&(d.sortList=f.metadata().sortlist),v.applyWidget(c,!0),d.sortList.length>0?f.trigger("sorton",[d.sortList,{},!d.initWidgets,!0]):(n(c),d.initWidgets&&v.applyWidget(c,!1)),d.showProcessing&&f.unbind("sortBegin"+d.namespace+" sortEnd"+d.namespace).bind("sortBegin"+d.namespace+" sortEnd"+d.namespace,function(a){clearTimeout(d.processTimer),v.isProcessing(c),"sortBegin"===a.type&&(d.processTimer=setTimeout(function(){v.isProcessing(c,!0)},500))}),c.hasInitialized=!0,c.isProcessing=!1,d.debug&&v.benchmark("Overall initialization time",a.data(c,"startoveralltimer")),f.trigger("tablesorter-initialized",c),"function"==typeof d.initialized&&d.initialized(c)},v.fixColumnWidth=function(b){b=a(b)[0];var c,d,e=b.config,f=e.$table.children("colgroup");f.length&&f.hasClass(v.css.colgroup)&&f.remove(),e.widthFixed&&0===e.$table.children("colgroup").length&&(f=a(''),c=e.$table.width(),a(b.tBodies).not("."+e.cssInfoBlock).find("tr:first").children(":visible").each(function(){d=parseInt(a(this).width()/c*1e3,10)/10+"%",f.append(a("").css("width",d))}),e.$table.prepend(f))},v.getColumnData=function(b,c,d,e,f){if("undefined"!=typeof c&&null!==c){b=a(b)[0];var g,h,i=b.config,j=f||i.$headers;if(c[d])return e?c[d]:c[j.index(j.filter('[data-column="'+d+'"]:last'))];for(h in c)if("string"==typeof h&&(g=j.filter('[data-column="'+d+'"]:last').filter(h).add(j.filter('[data-column="'+d+'"]:last').find(h)),g.length))return c[h]}},v.computeColumnIndex=function(b){var c,d,e,f,g,h,i,j,k,l,m,n,o,p=[],q={},r=0;for(c=0;ce;e++)for("undefined"==typeof p[e]&&(p[e]=[]),o=p[e],f=n;n+m>f;f++)o[f]="x"}return r+1},v.isProcessing=function(b,c,d){b=a(b);var e=b[0].config,f=d||b.find("."+v.css.header);c?("undefined"!=typeof d&&e.sortList.length>0&&(f=f.filter(function(){return this.sortDisabled?!1:v.isValueInArray(parseFloat(a(this).attr("data-column")),e.sortList)>=0})),b.add(f).addClass(v.css.processing+" "+e.cssProcessing)):b.add(f).removeClass(v.css.processing+" "+e.cssProcessing)},v.processTbody=function(b,c,d){b=a(b)[0];var e;return d?(b.isProcessing=!0,c.before(''),e=a.fn.detach?c.detach():c.remove()):(e=a(b).find("span.tablesorter-savemyplace"),c.insertAfter(e),e.remove(),void(b.isProcessing=!1))},v.clearTableBody=function(b){a(b)[0].config.$tbodies.children().detach()},v.bindEvents=function(b,c,e){b=a(b)[0];var f,g=b.config;e!==!0&&(g.$extraHeaders=g.$extraHeaders?g.$extraHeaders.add(c):c),c.find(g.selectorSort).add(c.filter(g.selectorSort)).unbind(a.trim("mousedown mouseup sort keyup ".split(" ").join(g.namespace+" "))).bind(a.trim("mousedown mouseup sort keyup ".split(" ").join(g.namespace+" ")),function(e,i){var j,k=e.type;if(!(1!==(e.which||e.button)&&!/sort|keyup/.test(k)||"keyup"===k&&13!==e.which||"mouseup"===k&&i!==!0&&(new Date).getTime()-f>250)){if("mousedown"===k)return f=(new Date).getTime(),j=a.fn.closest?a(e.target).closest("td,th"):a(e.target).parents("td,th").filter(":first"),/(input|select|button|textarea)/i.test(e.target.tagName)||j.hasClass(g.cssAllowClicks)?"":!g.cancelSelection;g.delayInit&&d(g.cache)&&h(b),j=a.fn.closest?a(this).closest("th, td")[0]:/TH|TD/.test(this.tagName)?this:a(this).parents("th, td")[0],j=g.$headers[c.index(j)],j.sortDisabled||q(b,j,e)}}),g.cancelSelection&&c.attr("unselectable","on").bind("selectstart",!1).css({"user-select":"none",MozUserSelect:"none"})},v.restoreHeaders=function(b){var c,d=a(b)[0].config;d.$table.find(d.selectorHeaders).each(function(b){c=a(this),c.find("."+v.css.headerIn).length&&c.html(d.headerContent[b])})},v.destroy=function(b,c,d){if(b=a(b)[0],b.hasInitialized){v.removeWidget(b,!0,!1);var e,f=a(b),g=b.config,h=f.find("thead:first"),i=h.find("tr."+v.css.headerRow).removeClass(v.css.headerRow+" "+g.cssHeaderRow),j=f.find("tfoot:first > tr").children("th, td");c===!1&&a.inArray("uitheme",g.widgets)>=0&&(f.trigger("applyWidgetId",["uitheme"]),f.trigger("applyWidgetId",["zebra"])),h.find("tr").not(i).remove(),e="sortReset update updateAll updateRows updateCell addRows updateComplete sorton appendCache updateCache "+"applyWidgetId applyWidgets refreshWidgets destroy mouseup mouseleave keypress sortBegin sortEnd resetToLoadState ".split(" ").join(g.namespace+" "),f.removeData("tablesorter").unbind(a.trim(e)),g.$headers.add(j).removeClass([v.css.header,g.cssHeader,g.cssAsc,g.cssDesc,v.css.sortAsc,v.css.sortDesc,v.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),i.find(g.selectorSort).unbind(a.trim("mousedown mouseup keypress ".split(" ").join(g.namespace+" "))),v.restoreHeaders(b),f.toggleClass(v.css.table+" "+g.tableClass+" tablesorter-"+g.theme,c===!1),b.hasInitialized=!1,delete b.config.cache,"function"==typeof d&&d(b)}},v.regex={chunk:/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i},v.sortNatural=function(a,b){if(a===b)return 0;var c,d,e,f,g,h,i,j,k=v.regex;if(k.hex.test(b)){if(d=parseInt(a.match(k.hex),16),f=parseInt(b.match(k.hex),16),f>d)return-1;if(d>f)return 1}for(c=a.replace(k.chunk,"\\0$1\\0").replace(k.chunks,"").split("\\0"),e=b.replace(k.chunk,"\\0$1\\0").replace(k.chunks,"").split("\\0"),j=Math.max(c.length,e.length),i=0;j>i;i++){if(g=isNaN(c[i])?c[i]||0:parseFloat(c[i])||0,h=isNaN(e[i])?e[i]||0:parseFloat(e[i])||0,isNaN(g)!==isNaN(h))return isNaN(g)?1:-1;if(typeof g!=typeof h&&(g+="",h+=""),h>g)return-1;if(g>h)return 1}return 0},v.sortNaturalAsc=function(a,b,c,d,e){if(a===b)return 0;var f=e.string[e.empties[c]||e.emptyTo];return""===a&&0!==f?"boolean"==typeof f?f?-1:1:-f||-1:""===b&&0!==f?"boolean"==typeof f?f?1:-1:f||1:v.sortNatural(a,b)},v.sortNaturalDesc=function(a,b,c,d,e){if(a===b)return 0;var f=e.string[e.empties[c]||e.emptyTo];return""===a&&0!==f?"boolean"==typeof f?f?-1:1:f||1:""===b&&0!==f?"boolean"==typeof f?f?1:-1:-f||-1:v.sortNatural(b,a)},v.sortText=function(a,b){return a>b?1:b>a?-1:0},v.getTextValue=function(a,b,c){if(c){var d,e=a?a.length:0,f=c+b;for(d=0;e>d;d++)f+=a.charCodeAt(d);return b*f}return 0},v.sortNumericAsc=function(a,b,c,d,e,f){if(a===b)return 0;var g=f.config,h=g.string[g.empties[e]||g.emptyTo];return""===a&&0!==h?"boolean"==typeof h?h?-1:1:-h||-1:""===b&&0!==h?"boolean"==typeof h?h?1:-1:h||1:(isNaN(a)&&(a=v.getTextValue(a,c,d)),isNaN(b)&&(b=v.getTextValue(b,c,d)),a-b)},v.sortNumericDesc=function(a,b,c,d,e,f){if(a===b)return 0;var g=f.config,h=g.string[g.empties[e]||g.emptyTo];return""===a&&0!==h?"boolean"==typeof h?h?-1:1:h||1:""===b&&0!==h?"boolean"==typeof h?h?1:-1:-h||-1:(isNaN(a)&&(a=v.getTextValue(a,c,d)),isNaN(b)&&(b=v.getTextValue(b,c,d)),b-a)},v.sortNumeric=function(a,b){return a-b},v.characterEquivalents={a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõö",O:"ÓÒÔÕÖ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},v.replaceAccents=function(a){var b,c="[",d=v.characterEquivalents;if(!v.characterRegex){v.characterRegexArray={};for(b in d)"string"==typeof b&&(c+=d[b],v.characterRegexArray[b]=new RegExp("["+d[b]+"]","g"));v.characterRegex=new RegExp(c+"]")}if(v.characterRegex.test(a))for(b in d)"string"==typeof b&&(a=a.replace(v.characterRegexArray[b],b));return a},v.isValueInArray=function(a,b){var c,d=b.length;for(c=0;d>c;c++)if(b[c][0]===a)return c;return-1},v.addParser=function(a){var b,c=v.parsers.length,d=!0;for(b=0;c>b;b++)v.parsers[b].id.toLowerCase()===a.id.toLowerCase()&&(d=!1);d&&v.parsers.push(a)},v.getParserById=function(a){if("false"==a)return!1;var b,c=v.parsers.length;for(b=0;c>b;b++)if(v.parsers[b].id.toLowerCase()===a.toString().toLowerCase())return v.parsers[b];return!1},v.addWidget=function(a){v.widgets.push(a)},v.hasWidget=function(b,c){return b=a(b),b.length&&b[0].config&&b[0].config.widgetInit[c]||!1},v.getWidgetById=function(a){var b,c,d=v.widgets.length;for(b=0;d>b;b++)if(c=v.widgets[b],c&&c.hasOwnProperty("id")&&c.id.toLowerCase()===a.toLowerCase())return c},v.applyWidget=function(b,d,e){b=a(b)[0];var f,g,h,i,j=b.config,k=j.widgetOptions,l=" "+j.table.className+" ",m=[];d!==!1&&b.hasInitialized&&(b.isApplyingWidgets||b.isUpdating)||(j.debug&&(f=new Date),i=new RegExp("\\s"+j.widgetClass.replace(/\{name\}/i,"([\\w-]+)")+"\\s","g"),l.match(i)&&(h=l.match(i),h&&a.each(h,function(a,b){j.widgets.push(b.replace(i,"$1"))})),j.widgets.length&&(b.isApplyingWidgets=!0,j.widgets=a.grep(j.widgets,function(b,c){return a.inArray(b,j.widgets)===c}),a.each(j.widgets||[],function(a,b){i=v.getWidgetById(b),i&&i.id&&(i.priority||(i.priority=10),m[a]=i)}),m.sort(function(a,b){return a.priorityf;f++)g=v.getWidgetById(d[f]),h=a.inArray(d[f],i.widgets),g&&"remove"in g&&(i.debug&&h>=0&&b('Removing "'+d[f]+'" widget'),g.remove(c,i,i.widgetOptions,e),i.widgetInit[d[f]]=!1),h>=0&&e!==!0&&i.widgets.splice(h,1)},v.refreshWidgets=function(b,c,d){b=a(b)[0];var e=b.config,f=e.widgets,g=[],h=function(b){a(b).trigger("refreshComplete")};a.each(v.widgets,function(b,d){d&&d.id&&(c||a.inArray(d.id,f)<0)&&g.push(d.id)}),v.removeWidget(b,g.join(","),!0),d!==!0?(v.applyWidget(b,c||!1,h),c&&v.applyWidget(b,!1,h)):h(b)},v.getData=function(b,c,d){var e,f,g="",h=a(b);return h.length?(e=a.metadata?h.metadata():!1,f=" "+(h.attr("class")||""),"undefined"!=typeof h.data(d)||"undefined"!=typeof h.data(d.toLowerCase())?g+=h.data(d)||h.data(d.toLowerCase()):e&&"undefined"!=typeof e[d]?g+=e[d]:c&&"undefined"!=typeof c[d]?g+=c[d]:" "!==f&&f.match(" "+d+"-")&&(g=f.match(new RegExp("\\s"+d+"-([\\w-]+)"))[1]||""),a.trim(g)):""},v.formatFloat=function(b,c){if("string"!=typeof b||""===b)return b;var d,e=c&&c.config?c.config.usNumberFormat!==!1:"undefined"!=typeof c?c:!0;return b=e?b.replace(/,/g,""):b.replace(/[\s|\.]/g,"").replace(/,/g,"."),/^\s*\([.\d]+\)/.test(b)&&(b=b.replace(/^\s*\(([.\d]+)\)/,"-$1")),d=parseFloat(b),isNaN(d)?a.trim(b):d},v.isDigit=function(a){return isNaN(a)?/^[\-+(]?\d+[)]?$/.test(a.toString().replace(/[,.'"\s]/g,"")):!0}}});var b=a.tablesorter;return a.fn.extend({tablesorter:b.construct}),b.addParser({id:"no-parser",is:function(){return!1},format:function(){return""},type:"text"}),b.addParser({id:"text",is:function(){return!0},format:function(c,d){var e=d.config;return c&&(c=a.trim(e.ignoreCase?c.toLocaleLowerCase():c),c=e.sortLocaleCompare?b.replaceAccents(c):c),c},type:"text"}),b.addParser({id:"digit",is:function(a){return b.isDigit(a)},format:function(c,d){var e=b.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),d);return c&&"number"==typeof e?e:c?a.trim(c&&d.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"}),b.addParser({id:"currency",is:function(a){return/^\(?\d+[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]|[\u00a3$\u20ac\u00a4\u00a5\u00a2?.]\d+\)?$/.test((a||"").replace(/[+\-,. ]/g,""))},format:function(c,d){var e=b.formatFloat((c||"").replace(/[^\w,. \-()]/g,""),d);return c&&"number"==typeof e?e:c?a.trim(c&&d.config.ignoreCase?c.toLocaleLowerCase():c):c},type:"numeric"}),b.addParser({id:"url",is:function(a){return/^(https?|ftp|file):\/\//.test(a)},format:function(b){return b?a.trim(b.replace(/(https?|ftp|file):\/\//,"")):b},parsed:!0,type:"text"}),b.addParser({id:"isoDate",is:function(a){return/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}/.test(a)},format:function(a){var b=a?new Date(a.replace(/-/g,"/")):a;return b instanceof Date&&isFinite(b)?b.getTime():a},type:"numeric"}),b.addParser({id:"percent",is:function(a){return/(\d\s*?%|%\s*?\d)/.test(a)&&a.length<15},format:function(a,c){return a?b.formatFloat(a.replace(/%/g,""),c):a},type:"numeric"}),b.addParser({id:"image",is:function(a,b,c,d){return d.find("img").length>0},format:function(b,c,d){return a(d).find("img").attr(c.config.imgAttr||"alt")||b},parsed:!0,type:"text"}),b.addParser({id:"usLongDate",is:function(a){return/^[A-Z]{3,10}\.?\s+\d{1,2},?\s+(\d{4})(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?$/i.test(a)||/^\d{1,2}\s+[A-Z]{3,10}\s+\d{4}/i.test(a)},format:function(a){var b=a?new Date(a.replace(/(\S)([AP]M)$/i,"$1 $2")):a;return b instanceof Date&&isFinite(b)?b.getTime():a},type:"numeric"}),b.addParser({id:"shortDate",is:function(a){return/(^\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4})|(^\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2})/.test((a||"").replace(/\s+/g," ").replace(/[\-.,]/g,"/"))},format:function(a,c,d,e){if(a){var f,g,h=c.config,i=h.$headers.filter('[data-column="'+e+'"]:last'),j=i.length&&i[0].dateFormat||b.getData(i,b.getColumnData(c,h.headers,e),"dateFormat")||h.dateFormat;return g=a.replace(/\s+/g," ").replace(/[\-.,]/g,"/"),"mmddyyyy"===j?g=g.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$1/$2"):"ddmmyyyy"===j?g=g.replace(/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,"$3/$2/$1"):"yyyymmdd"===j&&(g=g.replace(/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/,"$1/$2/$3")),f=new Date(g),f instanceof Date&&isFinite(f)?f.getTime():a}return a},type:"numeric"}),b.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){var b=a?new Date("2000/01/01 "+a.replace(/(\S)([AP]M)$/i,"$1 $2")):a;return b instanceof Date&&isFinite(b)?b.getTime():a},type:"numeric"}),b.addParser({id:"metadata",is:function(){return!1},format:function(b,c,d){var e=c.config,f=e.parserMetadataName?e.parserMetadataName:"sortValue"; +return a(d).metadata()[f]},type:"numeric"}),b.addWidget({id:"zebra",priority:90,format:function(b,c,d){var e,f,g,h,i,j,k,l=new RegExp(c.cssChildRow,"i"),m=c.$tbodies;for(c.debug&&(j=new Date),k=0;k table ID/index on page > data + if (!values[url]) { + values[url] = {}; + } + values[url][id] = value; + // *** set value *** + if (hasLocalStorage) { + localStorage[key] = JSON.stringify(values); + } else { + date = new Date(); + date.setTime(date.getTime() + (31536e+6)); // 365 days + document.cookie = key + '=' + (JSON.stringify(values)).replace(/\"/g,'\"') + '; expires=' + date.toGMTString() + '; path=/'; + } + } else { + return values && values[url] ? values[url][id] : ''; + } +}; + +})(jQuery, window, document); + +/*! Widget: uitheme */ +;(function ($) { +'use strict'; +var ts = $.tablesorter = $.tablesorter || {}; + +ts.themes = { + 'bootstrap' : { + table : 'table table-bordered table-striped', + caption : 'caption', + // header class names + header : 'bootstrap-header', // give the header a gradient background (theme.bootstrap_2.css) + sortNone : '', + sortAsc : '', + sortDesc : '', + active : '', // applied when column is sorted + hover : '', // custom css required - a defined bootstrap style may not override other classes + // icon class names + icons : '', // add "icon-white" to make them white; this icon class is added to the in the header + iconSortNone : 'bootstrap-icon-unsorted', // class name added to icon when column is not sorted + iconSortAsc : 'icon-chevron-up glyphicon glyphicon-chevron-up', // class name added to icon when column has ascending sort + iconSortDesc : 'icon-chevron-down glyphicon glyphicon-chevron-down', // class name added to icon when column has descending sort + filterRow : '', // filter row class + footerRow : '', + footerCells : '', + even : '', // even row zebra striping + odd : '' // odd row zebra striping + }, + 'jui' : { + table : 'ui-widget ui-widget-content ui-corner-all', // table classes + caption : 'ui-widget-content', + // header class names + header : 'ui-widget-header ui-corner-all ui-state-default', // header classes + sortNone : '', + sortAsc : '', + sortDesc : '', + active : 'ui-state-active', // applied when column is sorted + hover : 'ui-state-hover', // hover class + // icon class names + icons : 'ui-icon', // icon class added to the in the header + iconSortNone : 'ui-icon-carat-2-n-s', // class name added to icon when column is not sorted + iconSortAsc : 'ui-icon-carat-1-n', // class name added to icon when column has ascending sort + iconSortDesc : 'ui-icon-carat-1-s', // class name added to icon when column has descending sort + filterRow : '', + footerRow : '', + footerCells : '', + even : 'ui-widget-content', // even row zebra striping + odd : 'ui-state-default' // odd row zebra striping + } +}; + +$.extend(ts.css, { + wrapper : 'tablesorter-wrapper' // ui theme & resizable +}); + +ts.addWidget({ + id: "uitheme", + priority: 10, + format: function(table, c, wo) { + var i, hdr, icon, time, $header, $icon, $tfoot, $h, oldtheme, oldremove, oldIconRmv, hasOldTheme, + themesAll = ts.themes, + $table = c.$table.add( c.$extraTables ), + $headers = c.$headers.add( c.$extraHeaders ), + theme = c.theme || 'jui', + themes = themesAll[theme] || {}, + remove = $.trim( [ themes.sortNone, themes.sortDesc, themes.sortAsc, themes.active ].join( ' ' ) ), + iconRmv = $.trim( [ themes.iconSortNone, themes.iconSortDesc, themes.iconSortAsc ].join( ' ' ) ); + if (c.debug) { time = new Date(); } + // initialization code - run once + if (!$table.hasClass('tablesorter-' + theme) || c.theme !== c.appliedTheme || !wo.uitheme_applied) { + wo.uitheme_applied = true; + oldtheme = themesAll[c.appliedTheme] || {}; + hasOldTheme = !$.isEmptyObject(oldtheme); + oldremove = hasOldTheme ? [ oldtheme.sortNone, oldtheme.sortDesc, oldtheme.sortAsc, oldtheme.active ].join( ' ' ) : ''; + oldIconRmv = hasOldTheme ? [ oldtheme.iconSortNone, oldtheme.iconSortDesc, oldtheme.iconSortAsc ].join( ' ' ) : ''; + if (hasOldTheme) { + wo.zebra[0] = $.trim( ' ' + wo.zebra[0].replace(' ' + oldtheme.even, '') ); + wo.zebra[1] = $.trim( ' ' + wo.zebra[1].replace(' ' + oldtheme.odd, '') ); + c.$tbodies.children().removeClass( [oldtheme.even, oldtheme.odd].join(' ') ); + } + // update zebra stripes + if (themes.even) { wo.zebra[0] += ' ' + themes.even; } + if (themes.odd) { wo.zebra[1] += ' ' + themes.odd; } + // add caption style + $table.children('caption') + .removeClass(oldtheme.caption || '') + .addClass(themes.caption); + // add table/footer class names + $tfoot = $table + // remove other selected themes + .removeClass( (c.appliedTheme ? 'tablesorter-' + (c.appliedTheme || '') : '') + ' ' + (oldtheme.table || '') ) + .addClass('tablesorter-' + theme + ' ' + (themes.table || '')) // add theme widget class name + .children('tfoot'); + c.appliedTheme = c.theme; + + if ($tfoot.length) { + $tfoot + // if oldtheme.footerRow or oldtheme.footerCells are undefined, all class names are removed + .children('tr').removeClass(oldtheme.footerRow || '').addClass(themes.footerRow) + .children('th, td').removeClass(oldtheme.footerCells || '').addClass(themes.footerCells); + } + // update header classes + $headers + .removeClass( (hasOldTheme ? [oldtheme.header, oldtheme.hover, oldremove].join(' ') : '') || '' ) + .addClass(themes.header) + .not('.sorter-false') + .unbind('mouseenter.tsuitheme mouseleave.tsuitheme') + .bind('mouseenter.tsuitheme mouseleave.tsuitheme', function(event) { + // toggleClass with switch added in jQuery 1.3 + $(this)[ event.type === 'mouseenter' ? 'addClass' : 'removeClass' ](themes.hover || ''); + }); + + $headers.each(function(){ + var $this = $(this); + if (!$this.find('.' + ts.css.wrapper).length) { + // Firefox needs this inner div to position the icon & resizer correctly + $this.wrapInner('
    '); + } + }); + if (c.cssIcon) { + // if c.cssIcon is '', then no is added to the header + $headers + .find('.' + ts.css.icon) + .removeClass(hasOldTheme ? [oldtheme.icons, oldIconRmv].join(' ') : '') + .addClass(themes.icons || ''); + } + if ($table.hasClass('hasFilters')) { + $table.children('thead').children('.' + ts.css.filterRow) + .removeClass(hasOldTheme ? oldtheme.filterRow || '' : '') + .addClass(themes.filterRow || ''); + } + } + for (i = 0; i < c.columns; i++) { + $header = c.$headers.add(c.$extraHeaders).not('.sorter-false').filter('[data-column="' + i + '"]'); + $icon = (ts.css.icon) ? $header.find('.' + ts.css.icon) : $(); + $h = $headers.not('.sorter-false').filter('[data-column="' + i + '"]:last'); + if ($h.length) { + $header.removeClass(remove); + $icon.removeClass(iconRmv); + if ($h[0].sortDisabled) { + // no sort arrows for disabled columns! + $icon.removeClass(themes.icons || ''); + } else { + hdr = themes.sortNone; + icon = themes.iconSortNone; + if ($h.hasClass(ts.css.sortAsc)) { + hdr = [themes.sortAsc, themes.active].join(' '); + icon = themes.iconSortAsc; + } else if ($h.hasClass(ts.css.sortDesc)) { + hdr = [themes.sortDesc, themes.active].join(' '); + icon = themes.iconSortDesc; + } + $h + .addClass(hdr) + .find('.' + ts.css.icon) + .addClass(icon || ''); + } + } + } + if (c.debug) { + ts.benchmark("Applying " + theme + " theme", time); + } + }, + remove: function(table, c, wo, refreshing) { + if (!wo.uitheme_applied) { return; } + var $table = c.$table, + theme = c.appliedTheme || 'jui', + themes = ts.themes[ theme ] || ts.themes.jui, + $headers = $table.children('thead').children(), + remove = themes.sortNone + ' ' + themes.sortDesc + ' ' + themes.sortAsc, + iconRmv = themes.iconSortNone + ' ' + themes.iconSortDesc + ' ' + themes.iconSortAsc; + $table.removeClass('tablesorter-' + theme + ' ' + themes.table); + wo.uitheme_applied = false; + if (refreshing) { return; } + $table.find(ts.css.header).removeClass(themes.header); + $headers + .unbind('mouseenter.tsuitheme mouseleave.tsuitheme') // remove hover + .removeClass(themes.hover + ' ' + remove + ' ' + themes.active) + .filter('.' + ts.css.filterRow) + .removeClass(themes.filterRow); + $headers.find('.' + ts.css.icon).removeClass(themes.icons + ' ' + iconRmv); + } +}); + +})(jQuery); + +/*! Widget: columns */ +;(function ($) { +'use strict'; +var ts = $.tablesorter = $.tablesorter || {}; + +ts.addWidget({ + id: "columns", + priority: 30, + options : { + columns : [ "primary", "secondary", "tertiary" ] + }, + format: function(table, c, wo) { + var $tbody, tbodyIndex, $rows, rows, $row, $cells, remove, indx, + $table = c.$table, + $tbodies = c.$tbodies, + sortList = c.sortList, + len = sortList.length, + // removed c.widgetColumns support + css = wo && wo.columns || [ "primary", "secondary", "tertiary" ], + last = css.length - 1; + remove = css.join(' '); + // check if there is a sort (on initialization there may not be one) + for (tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) { + $tbody = ts.processTbody(table, $tbodies.eq(tbodyIndex), true); // detach tbody + $rows = $tbody.children('tr'); + // loop through the visible rows + $rows.each(function() { + $row = $(this); + if (this.style.display !== 'none') { + // remove all columns class names + $cells = $row.children().removeClass(remove); + // add appropriate column class names + if (sortList && sortList[0]) { + // primary sort column class + $cells.eq(sortList[0][0]).addClass(css[0]); + if (len > 1) { + for (indx = 1; indx < len; indx++) { + // secondary, tertiary, etc sort column classes + $cells.eq(sortList[indx][0]).addClass( css[indx] || css[last] ); + } + } + } + } + }); + ts.processTbody(table, $tbody, false); + } + // add classes to thead and tfoot + rows = wo.columns_thead !== false ? ['thead tr'] : []; + if (wo.columns_tfoot !== false) { + rows.push('tfoot tr'); + } + if (rows.length) { + $rows = $table.find( rows.join(',') ).children().removeClass(remove); + if (len) { + for (indx = 0; indx < len; indx++) { + // add primary. secondary, tertiary, etc sort column classes + $rows.filter('[data-column="' + sortList[indx][0] + '"]').addClass(css[indx] || css[last]); + } + } + } + }, + remove: function(table, c, wo) { + var tbodyIndex, $tbody, + $tbodies = c.$tbodies, + remove = (wo.columns || [ "primary", "secondary", "tertiary" ]).join(' '); + c.$headers.removeClass(remove); + c.$table.children('tfoot').children('tr').children('th, td').removeClass(remove); + for (tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) { + $tbody = ts.processTbody(table, $tbodies.eq(tbodyIndex), true); // remove tbody + $tbody.children('tr').each(function() { + $(this).children().removeClass(remove); + }); + ts.processTbody(table, $tbody, false); // restore tbody + } + } +}); + +})(jQuery); + +/*! Widget: filter */ +;(function ($) { +'use strict'; +var ts = $.tablesorter = $.tablesorter || {}; + +$.extend(ts.css, { + filterRow : 'tablesorter-filter-row', + filter : 'tablesorter-filter' +}); + +ts.addWidget({ + id: "filter", + priority: 50, + options : { + filter_childRows : false, // if true, filter includes child row content in the search + filter_columnFilters : true, // if true, a filter will be added to the top of each table column + filter_cellFilter : '', // css class name added to the filter cell (string or array) + filter_cssFilter : '', // css class name added to the filter row & each input in the row (tablesorter-filter is ALWAYS added) + filter_defaultFilter : {}, // add a default column filter type "~{query}" to make fuzzy searches default; "{q1} AND {q2}" to make all searches use a logical AND. + filter_excludeFilter : {}, // filters to exclude, per column + filter_external : '', // jQuery selector string (or jQuery object) of external filters + filter_filteredRow : 'filtered', // class added to filtered rows; needed by pager plugin + filter_formatter : null, // add custom filter elements to the filter row + filter_functions : null, // add custom filter functions using this option + filter_hideEmpty : true, // hide filter row when table is empty + filter_hideFilters : false, // collapse filter row when mouse leaves the area + filter_ignoreCase : true, // if true, make all searches case-insensitive + filter_liveSearch : true, // if true, search column content while the user types (with a delay) + filter_onlyAvail : 'filter-onlyAvail', // a header with a select dropdown & this class name will only show available (visible) options within the drop down + filter_placeholder : { search : '', select : '' }, // default placeholder text (overridden by any header "data-placeholder" setting) + filter_reset : null, // jQuery selector string of an element used to reset the filters + filter_saveFilters : false, // Use the $.tablesorter.storage utility to save the most recent filters + filter_searchDelay : 300, // typing delay in milliseconds before starting a search + filter_searchFiltered: true, // allow searching through already filtered rows in special circumstances; will speed up searching in large tables if true + filter_selectSource : null, // include a function to return an array of values to be added to the column filter select + filter_startsWith : false, // if true, filter start from the beginning of the cell contents + filter_useParsedData : false, // filter all data using parsed content + filter_serversideFiltering : false, // if true, server-side filtering should be performed because client-side filtering will be disabled, but the ui and events will still be used. + filter_defaultAttrib : 'data-value', // data attribute in the header cell that contains the default filter value + filter_selectSourceSeparator : '|' // filter_selectSource array text left of the separator is added to the option value, right into the option text + }, + format: function(table, c, wo) { + if (!c.$table.hasClass('hasFilters')) { + ts.filter.init(table, c, wo); + } + }, + remove: function(table, c, wo, refreshing) { + var tbodyIndex, $tbody, + $table = c.$table, + $tbodies = c.$tbodies, + events = 'addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search '.split(' ').join(c.namespace + 'filter '); + $table + .removeClass('hasFilters') + // add .tsfilter namespace to all BUT search + .unbind( $.trim(events) ) + // remove the filter row even if refreshing, because the column might have been moved + .find('.' + ts.css.filterRow).remove(); + if (refreshing) { return; } + for (tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) { + $tbody = ts.processTbody(table, $tbodies.eq(tbodyIndex), true); // remove tbody + $tbody.children().removeClass(wo.filter_filteredRow).show(); + ts.processTbody(table, $tbody, false); // restore tbody + } + if (wo.filter_reset) { + $(document).undelegate(wo.filter_reset, 'click.tsfilter'); + } + } +}); + +ts.filter = { + + // regex used in filter "check" functions - not for general use and not documented + regex: { + regex : /^\/((?:\\\/|[^\/])+)\/([mig]{0,3})?$/, // regex to test for regex + child : /tablesorter-childRow/, // child row class name; this gets updated in the script + filtered : /filtered/, // filtered (hidden) row class name; updated in the script + type : /undefined|number/, // check type + exact : /(^[\"\'=]+)|([\"\'=]+$)/g, // exact match (allow '==') + nondigit : /[^\w,. \-()]/g, // replace non-digits (from digit & currency parser) + operators : /[<>=]/g, // replace operators + query : '(q|query)' // replace filter queries + }, + // function( c, data ) { } + // c = table.config + // data.filter = array of filter input values; + // data.iFilter = same array, except lowercase (if wo.filter_ignoreCase is true) + // data.exact = table cell text (or parsed data if column parser enabled) + // data.iExact = same as data.exact, except lowercase (if wo.filter_ignoreCase is true) + // data.cache = table cell text from cache, so it has been parsed (& in all lower case if config.ignoreCase is true) + // data.index = column index; table = table element (DOM) + // data.parsed = array (by column) of boolean values (from filter_useParsedData or "filter-parsed" class) + types: { + // Look for regex + regex: function( c, data ) { + if ( ts.filter.regex.regex.test(data.iFilter) ) { + var matches, + regex = ts.filter.regex.regex.exec(data.iFilter); + try { + matches = new RegExp(regex[1], regex[2]).test( data.iExact ); + } catch (error) { + matches = false; + } + return matches; + } + return null; + }, + // Look for operators >, >=, < or <= + operators: function( c, data ) { + if ( /^[<>]=?/.test(data.iFilter) ) { + var cachedValue, result, + table = c.table, + index = data.index, + parsed = data.parsed[index], + query = ts.formatFloat( data.iFilter.replace(ts.filter.regex.operators, ''), table ), + parser = c.parsers[index], + savedSearch = query; + // parse filter value in case we're comparing numbers (dates) + if (parsed || parser.type === 'numeric') { + result = ts.filter.parseFilter(c, $.trim('' + data.iFilter.replace(ts.filter.regex.operators, '')), index, parsed, true); + query = ( typeof result === "number" && result !== '' && !isNaN(result) ) ? result : query; + } + + // iExact may be numeric - see issue #149; + // check if cached is defined, because sometimes j goes out of range? (numeric columns) + cachedValue = ( parsed || parser.type === 'numeric' ) && !isNaN(query) && typeof data.cache !== 'undefined' ? data.cache : + isNaN(data.iExact) ? ts.formatFloat( data.iExact.replace(ts.filter.regex.nondigit, ''), table) : + ts.formatFloat( data.iExact, table ); + + if ( />/.test(data.iFilter) ) { result = />=/.test(data.iFilter) ? cachedValue >= query : cachedValue > query; } + if ( /= 0); + } + } + return null; + }, + // Look for quotes or equals to get an exact match; ignore type since iExact could be numeric + exact: function( c, data ) { + /*jshint eqeqeq:false */ + if (ts.filter.regex.exact.test(data.iFilter)) { + var filter = ts.filter.parseFilter(c, data.iFilter.replace(ts.filter.regex.exact, ''), data.index, data.parsed[data.index]); + return data.anyMatch ? $.inArray(filter, data.rowArray) >= 0 : filter == data.iExact; + } + return null; + }, + // Look for an AND or && operator (logical and) + and : function( c, data ) { + if ( ts.filter.regex.andTest.test(data.filter) ) { + var index = data.index, + parsed = data.parsed[index], + query = data.iFilter.split( ts.filter.regex.andSplit ), + result = data.iExact.search( $.trim( ts.filter.parseFilter(c, query[0], index, parsed) ) ) >= 0, + indx = query.length - 1; + while (result && indx) { + result = result && data.iExact.search( $.trim( ts.filter.parseFilter(c, query[indx], index, parsed) ) ) >= 0; + indx--; + } + return result; + } + return null; + }, + // Look for a range (using " to " or " - ") - see issue #166; thanks matzhu! + range : function( c, data ) { + if ( ts.filter.regex.toTest.test(data.iFilter) ) { + var result, tmp, + table = c.table, + index = data.index, + parsed = data.parsed[index], + // make sure the dash is for a range and not indicating a negative number + query = data.iFilter.split( ts.filter.regex.toSplit ), + range1 = ts.formatFloat( ts.filter.parseFilter(c, query[0].replace(ts.filter.regex.nondigit, ''), index, parsed), table ), + range2 = ts.formatFloat( ts.filter.parseFilter(c, query[1].replace(ts.filter.regex.nondigit, ''), index, parsed), table ); + // parse filter value in case we're comparing numbers (dates) + if (parsed || c.parsers[index].type === 'numeric') { + result = c.parsers[index].format('' + query[0], table, c.$headers.eq(index), index); + range1 = (result !== '' && !isNaN(result)) ? result : range1; + result = c.parsers[index].format('' + query[1], table, c.$headers.eq(index), index); + range2 = (result !== '' && !isNaN(result)) ? result : range2; + } + result = ( parsed || c.parsers[index].type === 'numeric' ) && !isNaN(range1) && !isNaN(range2) ? data.cache : + isNaN(data.iExact) ? ts.formatFloat( data.iExact.replace(ts.filter.regex.nondigit, ''), table) : + ts.formatFloat( data.iExact, table ); + if (range1 > range2) { tmp = range1; range1 = range2; range2 = tmp; } // swap + return (result >= range1 && result <= range2) || (range1 === '' || range2 === ''); + } + return null; + }, + // Look for wild card: ? = single, * = multiple, or | = logical OR + wild : function( c, data ) { + if ( /[\?\*\|]/.test(data.iFilter) || ts.filter.regex.orReplace.test(data.filter) ) { + var index = data.index, + parsed = data.parsed[index], + query = ts.filter.parseFilter(c, data.iFilter.replace(ts.filter.regex.orReplace, "|"), index, parsed); + // look for an exact match with the "or" unless the "filter-match" class is found + if (!c.$headers.filter('[data-column="' + index + '"]:last').hasClass('filter-match') && /\|/.test(query)) { + // show all results while using filter match. Fixes #727 + if (query[ query.length - 1 ] === '|') { query += '*'; } + query = data.anyMatch && $.isArray(data.rowArray) ? '(' + query + ')' : '^(' + query + ')$'; + } + // parsing the filter may not work properly when using wildcards =/ + return new RegExp( query.replace(/\?/g, '\\S{1}').replace(/\*/g, '\\S*') ).test(data.iExact); + } + return null; + }, + // fuzzy text search; modified from https://github.com/mattyork/fuzzy (MIT license) + fuzzy: function( c, data ) { + if ( /^~/.test(data.iFilter) ) { + var indx, + patternIndx = 0, + len = data.iExact.length, + pattern = ts.filter.parseFilter(c, data.iFilter.slice(1), data.index, data.parsed[data.index]); + for (indx = 0; indx < len; indx++) { + if (data.iExact[indx] === pattern[patternIndx]) { + patternIndx += 1; + } + } + if (patternIndx === pattern.length) { + return true; + } + return false; + } + return null; + } + }, + init: function(table, c, wo) { + // filter language options + ts.language = $.extend(true, {}, { + to : 'to', + or : 'or', + and : 'and' + }, ts.language); + + var options, string, txt, $header, column, filters, val, fxn, noSelect, + regex = ts.filter.regex; + c.$table.addClass('hasFilters'); + + // define timers so using clearTimeout won't cause an undefined error + wo.searchTimer = null; + wo.filter_initTimer = null; + wo.filter_formatterCount = 0; + wo.filter_formatterInit = []; + wo.filter_anyColumnSelector = '[data-column="all"],[data-column="any"]'; + wo.filter_multipleColumnSelector = '[data-column*="-"],[data-column*=","]'; + + txt = '\\{' + ts.filter.regex.query + '\\}'; + $.extend( regex, { + child : new RegExp(c.cssChildRow), + filtered : new RegExp(wo.filter_filteredRow), + alreadyFiltered : new RegExp('(\\s+(' + ts.language.or + '|-|' + ts.language.to + ')\\s+)', 'i'), + toTest : new RegExp('\\s+(-|' + ts.language.to + ')\\s+', 'i'), + toSplit : new RegExp('(?:\\s+(?:-|' + ts.language.to + ')\\s+)' ,'gi'), + andTest : new RegExp('\\s+(' + ts.language.and + '|&&)\\s+', 'i'), + andSplit : new RegExp('(?:\\s+(?:' + ts.language.and + '|&&)\\s+)', 'gi'), + orReplace : new RegExp('\\s+(' + ts.language.or + ')\\s+', 'gi'), + iQuery : new RegExp(txt, 'i'), + igQuery : new RegExp(txt, 'ig') + }); + + // don't build filter row if columnFilters is false or all columns are set to "filter-false" - issue #156 + if (wo.filter_columnFilters !== false && c.$headers.filter('.filter-false, .parser-false').length !== c.$headers.length) { + // build filter row + ts.filter.buildRow(table, c, wo); + } + + txt = 'addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search '.split(' ').join(c.namespace + 'filter '); + c.$table.bind( $.trim(txt), function(event, filter) { + val = (wo.filter_hideEmpty && $.isEmptyObject(c.cache) && !(c.delayInit && event.type === 'appendCache')); + // hide filter row using the "filtered" class name + c.$table.find('.' + ts.css.filterRow).toggleClass(wo.filter_filteredRow, val ); // fixes #450 + if ( !/(search|filter)/.test(event.type) ) { + event.stopPropagation(); + ts.filter.buildDefault(table, true); + } + if (event.type === 'filterReset') { + c.$table.find('.' + ts.css.filter).add(wo.filter_$externalFilters).val(''); + ts.filter.searching(table, []); + } else if (event.type === 'filterEnd') { + ts.filter.buildDefault(table, true); + } else { + // send false argument to force a new search; otherwise if the filter hasn't changed, it will return + filter = event.type === 'search' ? filter : event.type === 'updateComplete' ? c.$table.data('lastSearch') : ''; + if (/(update|add)/.test(event.type) && event.type !== "updateComplete") { + // force a new search since content has changed + c.lastCombinedFilter = null; + c.lastSearch = []; + } + // pass true (skipFirst) to prevent the tablesorter.setFilters function from skipping the first input + // ensures all inputs are updated when a search is triggered on the table $('table').trigger('search', [...]); + ts.filter.searching(table, filter, true); + } + return false; + }); + + // reset button/link + if (wo.filter_reset) { + if (wo.filter_reset instanceof $) { + // reset contains a jQuery object, bind to it + wo.filter_reset.click(function(){ + c.$table.trigger('filterReset'); + }); + } else if ($(wo.filter_reset).length) { + // reset is a jQuery selector, use event delegation + $(document) + .undelegate(wo.filter_reset, 'click.tsfilter') + .delegate(wo.filter_reset, 'click.tsfilter', function() { + // trigger a reset event, so other functions (filter_formatter) know when to reset + c.$table.trigger('filterReset'); + }); + } + } + if (wo.filter_functions) { + for (column = 0; column < c.columns; column++) { + fxn = ts.getColumnData( table, wo.filter_functions, column ); + if (fxn) { + // remove "filter-select" from header otherwise the options added here are replaced with all options + $header = c.$headers.filter('[data-column="' + column + '"]:last').removeClass('filter-select'); + // don't build select if "filter-false" or "parser-false" set + noSelect = !($header.hasClass('filter-false') || $header.hasClass('parser-false')); + options = ''; + if ( fxn === true && noSelect ) { + ts.filter.buildSelect(table, column); + } else if ( typeof fxn === 'object' && noSelect ) { + // add custom drop down list + for (string in fxn) { + if (typeof string === 'string') { + options += options === '' ? + '' : ''; + val = string; + txt = string; + if (string.indexOf(wo.filter_selectSourceSeparator) >= 0) { + val = string.split(wo.filter_selectSourceSeparator); + txt = val[1]; + val = val[0]; + } + options += ''; + } + } + c.$table.find('thead').find('select.' + ts.css.filter + '[data-column="' + column + '"]').append(options); + } + } + } + } + // not really updating, but if the column has both the "filter-select" class & filter_functions set to true, + // it would append the same options twice. + ts.filter.buildDefault(table, true); + + ts.filter.bindSearch( table, c.$table.find('.' + ts.css.filter), true ); + if (wo.filter_external) { + ts.filter.bindSearch( table, wo.filter_external ); + } + + if (wo.filter_hideFilters) { + ts.filter.hideFilters(table, c); + } + + // show processing icon + if (c.showProcessing) { + c.$table + .unbind( $.trim('filterStart filterEnd '.split(' ').join(c.namespace + 'filter ')) ) + .bind( $.trim('filterStart filterEnd '.split(' ').join(c.namespace + 'filter ')), function(event, columns) { + // only add processing to certain columns to all columns + $header = (columns) ? c.$table.find('.' + ts.css.header).filter('[data-column]').filter(function() { + return columns[$(this).data('column')] !== ''; + }) : ''; + ts.isProcessing(table, event.type === 'filterStart', columns ? $header : ''); + }); + } + + // set filtered rows count (intially unfiltered) + c.filteredRows = c.totalRows; + + // add default values + c.$table + .unbind( $.trim('tablesorter-initialized pagerBeforeInitialized '.split(' ').join(c.namespace + 'filter ')) ) + .bind( $.trim('tablesorter-initialized pagerBeforeInitialized '.split(' ').join(c.namespace + 'filter ')), function() { + // redefine "wo" as it does not update properly inside this callback + var wo = this.config.widgetOptions; + filters = ts.filter.setDefaults(table, c, wo) || []; + if (filters.length) { + // prevent delayInit from triggering a cache build if filters are empty + if ( !(c.delayInit && filters.join('') === '') ) { + ts.setFilters(table, filters, true); + } + } + c.$table.trigger('filterFomatterUpdate'); + // trigger init after setTimeout to prevent multiple filterStart/End/Init triggers + setTimeout(function(){ + if (!wo.filter_initialized) { + ts.filter.filterInitComplete(c); + } + }, 100); + }); + // if filter widget is added after pager has initialized; then set filter init flag + if (c.pager && c.pager.initialized && !wo.filter_initialized) { + c.$table.trigger('filterFomatterUpdate'); + setTimeout(function(){ + ts.filter.filterInitComplete(c); + }, 100); + } + }, + // $cell parameter, but not the config, is passed to the + // filter_formatters, so we have to work with it instead + formatterUpdated: function($cell, column) { + var wo = $cell.closest('table')[0].config.widgetOptions; + if (!wo.filter_initialized) { + // add updates by column since this function + // may be called numerous times before initialization + wo.filter_formatterInit[column] = 1; + } + }, + filterInitComplete: function(c){ + var wo = c.widgetOptions, + count = 0, + completed = function(){ + wo.filter_initialized = true; + c.$table.trigger('filterInit', c); + ts.filter.findRows(c.table, c.$table.data('lastSearch') || []); + }; + if ( $.isEmptyObject( wo.filter_formatter ) ) { + completed(); + } else { + $.each( wo.filter_formatterInit, function(i, val) { + if (val === 1) { + count++; + } + }); + clearTimeout(wo.filter_initTimer); + if (!wo.filter_initialized && count === wo.filter_formatterCount) { + // filter widget initialized + completed(); + } else if (!wo.filter_initialized) { + // fall back in case a filter_formatter doesn't call + // $.tablesorter.filter.formatterUpdated($cell, column), and the count is off + wo.filter_initTimer = setTimeout(function(){ + completed(); + }, 500); + } + } + }, + + setDefaults: function(table, c, wo) { + var isArray, saved, indx, + // get current (default) filters + filters = ts.getFilters(table) || []; + if (wo.filter_saveFilters && ts.storage) { + saved = ts.storage( table, 'tablesorter-filters' ) || []; + isArray = $.isArray(saved); + // make sure we're not just getting an empty array + if ( !(isArray && saved.join('') === '' || !isArray) ) { filters = saved; } + } + // if no filters saved, then check default settings + if (filters.join('') === '') { + for (indx = 0; indx < c.columns; indx++) { + filters[indx] = c.$headers.filter('[data-column="' + indx + '"]:last').attr(wo.filter_defaultAttrib) || filters[indx]; + } + } + c.$table.data('lastSearch', filters); + return filters; + }, + parseFilter: function(c, filter, column, parsed, forceParse){ + return forceParse || parsed ? + c.parsers[column].format( filter, c.table, [], column ) : + filter; + }, + buildRow: function(table, c, wo) { + var col, column, $header, buildSelect, disabled, name, ffxn, + // c.columns defined in computeThIndexes() + columns = c.columns, + arry = $.isArray(wo.filter_cellFilter), + buildFilter = ''; + for (column = 0; column < columns; column++) { + if (arry) { + buildFilter += ''; + } else { + buildFilter += ''; + } + } + c.$filters = $(buildFilter += '').appendTo( c.$table.children('thead').eq(0) ).find('td'); + // build each filter input + for (column = 0; column < columns; column++) { + disabled = false; + // assuming last cell of a column is the main column + $header = c.$headers.filter('[data-column="' + column + '"]:last'); + ffxn = ts.getColumnData( table, wo.filter_functions, column ); + buildSelect = (wo.filter_functions && ffxn && typeof ffxn !== "function" ) || + $header.hasClass('filter-select'); + // get data from jQuery data, metadata, headers option or header class name + col = ts.getColumnData( table, c.headers, column ); + disabled = ts.getData($header[0], col, 'filter') === 'false' || ts.getData($header[0], col, 'parser') === 'false'; + + if (buildSelect) { + buildFilter = $('').appendTo( c.$filters.eq(column) ); + } + if (buildFilter) { + buildFilter.attr('placeholder', $header.data('placeholder') || $header.attr('data-placeholder') || wo.filter_placeholder.search || ''); + } + } + if (buildFilter) { + // add filter class name + name = ( $.isArray(wo.filter_cssFilter) ? + (typeof wo.filter_cssFilter[column] !== 'undefined' ? wo.filter_cssFilter[column] || '' : '') : + wo.filter_cssFilter ) || ''; + buildFilter.addClass( ts.css.filter + ' ' + name ).attr('data-column', column); + if (disabled) { + buildFilter.attr('placeholder', '').addClass('disabled')[0].disabled = true; // disabled! + } + } + } + }, + bindSearch: function(table, $el, internal) { + table = $(table)[0]; + $el = $($el); // allow passing a selector string + if (!$el.length) { return; } + var c = table.config, + wo = c.widgetOptions, + $ext = wo.filter_$externalFilters; + if (internal !== true) { + // save anyMatch element + wo.filter_$anyMatch = $el.filter(wo.filter_anyColumnSelector + ',' + wo.filter_multipleColumnSelector); + if ($ext && $ext.length) { + wo.filter_$externalFilters = wo.filter_$externalFilters.add( $el ); + } else { + wo.filter_$externalFilters = $el; + } + // update values (external filters added after table initialization) + ts.setFilters(table, c.$table.data('lastSearch') || [], internal === false); + } + $el + // use data attribute instead of jQuery data since the head is cloned without including the data/binding + .attr('data-lastSearchTime', new Date().getTime()) + .unbind( $.trim('keypress keyup search change '.split(' ').join(c.namespace + 'filter ')) ) + // include change for select - fixes #473 + .bind('keyup' + c.namespace + 'filter', function(event) { + $(this).attr('data-lastSearchTime', new Date().getTime()); + // emulate what webkit does.... escape clears the filter + if (event.which === 27) { + this.value = ''; + // live search + } else if ( wo.filter_liveSearch === false ) { + return; + // don't return if the search value is empty (all rows need to be revealed) + } else if ( this.value !== '' && ( + // liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace + ( typeof wo.filter_liveSearch === 'number' && this.value.length < wo.filter_liveSearch ) || + // let return & backspace continue on, but ignore arrows & non-valid characters + ( event.which !== 13 && event.which !== 8 && ( event.which < 32 || (event.which >= 37 && event.which <= 40) ) ) ) ) { + return; + } + // change event = no delay; last true flag tells getFilters to skip newest timed input + ts.filter.searching( table, true, true ); + }) + .bind( $.trim('search change keypress '.split(' ').join(c.namespace + 'filter ')), function(event){ + var column = $(this).data('column'); + // don't allow "change" event to process if the input value is the same - fixes #685 + if (event.which === 13 || event.type === 'search' || event.type === 'change' && this.value !== c.lastSearch[column]) { + event.preventDefault(); + // init search with no delay + $(this).attr('data-lastSearchTime', new Date().getTime()); + ts.filter.searching( table, false, true ); + } + }); + }, + searching: function(table, filter, skipFirst) { + var wo = table.config.widgetOptions; + clearTimeout(wo.searchTimer); + if (typeof filter === 'undefined' || filter === true) { + // delay filtering + wo.searchTimer = setTimeout(function() { + ts.filter.checkFilters(table, filter, skipFirst ); + }, wo.filter_liveSearch ? wo.filter_searchDelay : 10); + } else { + // skip delay + ts.filter.checkFilters(table, filter, skipFirst); + } + }, + checkFilters: function(table, filter, skipFirst) { + var c = table.config, + wo = c.widgetOptions, + filterArray = $.isArray(filter), + filters = (filterArray) ? filter : ts.getFilters(table, true), + combinedFilters = (filters || []).join(''); // combined filter values + // prevent errors if delay init is set + if ($.isEmptyObject(c.cache)) { + // update cache if delayInit set & pager has initialized (after user initiates a search) + if (c.delayInit && c.pager && c.pager.initialized) { + c.$table.trigger('updateCache', [function(){ + ts.filter.checkFilters(table, false, skipFirst); + }] ); + } + return; + } + // add filter array back into inputs + if (filterArray) { + ts.setFilters( table, filters, false, skipFirst !== true ); + if (!wo.filter_initialized) { c.lastCombinedFilter = ''; } + } + if (wo.filter_hideFilters) { + // show/hide filter row as needed + c.$table.find('.' + ts.css.filterRow).trigger( combinedFilters === '' ? 'mouseleave' : 'mouseenter' ); + } + // return if the last search is the same; but filter === false when updating the search + // see example-widget-filter.html filter toggle buttons + if (c.lastCombinedFilter === combinedFilters && filter !== false) { + return; + } else if (filter === false) { + // force filter refresh + c.lastCombinedFilter = null; + c.lastSearch = []; + } + if (wo.filter_initialized) { c.$table.trigger('filterStart', [filters]); } + if (c.showProcessing) { + // give it time for the processing icon to kick in + setTimeout(function() { + ts.filter.findRows(table, filters, combinedFilters); + return false; + }, 30); + } else { + ts.filter.findRows(table, filters, combinedFilters); + return false; + } + }, + hideFilters: function(table, c) { + var $filterRow, $filterRow2, timer; + $(table) + .find('.' + ts.css.filterRow) + .addClass('hideme') + .bind('mouseenter mouseleave', function(e) { + // save event object - http://bugs.jquery.com/ticket/12140 + var event = e; + $filterRow = $(this); + clearTimeout(timer); + timer = setTimeout(function() { + if ( /enter|over/.test(event.type) ) { + $filterRow.removeClass('hideme'); + } else { + // don't hide if input has focus + // $(':focus') needs jQuery 1.6+ + if ( $(document.activeElement).closest('tr')[0] !== $filterRow[0] ) { + // don't hide row if any filter has a value + if (c.lastCombinedFilter === '') { + $filterRow.addClass('hideme'); + } + } + } + }, 200); + }) + .find('input, select').bind('focus blur', function(e) { + $filterRow2 = $(this).closest('tr'); + clearTimeout(timer); + var event = e; + timer = setTimeout(function() { + // don't hide row if any filter has a value + if (ts.getFilters(c.$table).join('') === '') { + $filterRow2[ event.type === 'focus' ? 'removeClass' : 'addClass']('hideme'); + } + }, 200); + }); + }, + defaultFilter: function(filter, mask){ + if (filter === '') { return filter; } + var regex = ts.filter.regex.iQuery, + maskLen = mask.match( ts.filter.regex.igQuery ).length, + query = maskLen > 1 ? $.trim(filter).split(/\s/) : [ $.trim(filter) ], + len = query.length - 1, + indx = 0, + val = mask; + if ( len < 1 && maskLen > 1 ) { + // only one "word" in query but mask has >1 slots + query[1] = query[0]; + } + // replace all {query} with query words... + // if query = "Bob", then convert mask from "!{query}" to "!Bob" + // if query = "Bob Joe Frank", then convert mask "{q} OR {q}" to "Bob OR Joe OR Frank" + while (regex.test(val)) { + val = val.replace(regex, query[indx++] || ''); + if (regex.test(val) && indx < len && (query[indx] || '') !== '') { + val = mask.replace(regex, val); + } + } + return val; + }, + getLatestSearch: function( $input ) { + return $input.sort(function(a, b) { + return $(b).attr('data-lastSearchTime') - $(a).attr('data-lastSearchTime'); + }); + }, + multipleColumns: function( c, $input ) { + // look for multiple columns "1-3,4-6,8" in data-column + var ranges, singles, indx, + wo = c.widgetOptions, + // only target "all" column inputs on initialization + // & don't target "all" column inputs if they don't exist + targets = wo.filter_initialized || !$input.filter(wo.filter_anyColumnSelector).length, + columns = [], + val = $.trim( ts.filter.getLatestSearch( $input ).attr('data-column') ); + // process column range + if ( targets && /-/.test( val ) ) { + ranges = val.match( /(\d+)\s*-\s*(\d+)/g ); + $.each(ranges, function(i,v){ + var t, + range = v.split( /\s*-\s*/ ), + start = parseInt( range[0], 10 ) || 0, + end = parseInt( range[1], 10 ) || ( c.columns - 1 ); + if ( start > end ) { t = start; start = end; end = t; } // swap + if ( end >= c.columns ) { end = c.columns - 1; } + for ( ; start <= end; start++ ) { + columns.push(start); + } + // remove processed range from val + val = val.replace( v, '' ); + }); + } + // process single columns + if ( targets && /,/.test( val ) ) { + singles = val.split( /\s*,\s*/ ); + $.each( singles, function(i,v) { + if (v !== '') { + indx = parseInt( v, 10 ); + if ( indx < c.columns ) { + columns.push( indx ); + } + } + }); + } + // return all columns + if (!columns.length) { + for ( indx = 0; indx < c.columns; indx++ ) { + columns.push( indx ); + } + } + return columns; + }, + findRows: function(table, filters, combinedFilters) { + if (table.config.lastCombinedFilter === combinedFilters || !table.config.widgetOptions.filter_initialized) { return; } + var len, $rows, rowIndex, tbodyIndex, $tbody, $cells, $cell, columnIndex, + childRow, lastSearch, hasSelect, matches, result, showRow, time, val, indx, + notFiltered, searchFiltered, filterMatched, excludeMatch, fxn, ffxn, + regex = ts.filter.regex, + c = table.config, + wo = c.widgetOptions, + $tbodies = c.$table.children('tbody'), // target all tbodies #568 + // data object passed to filters; anyMatch is a flag for the filters + data = { anyMatch: false }, + // anyMatch really screws up with these types of filters + noAnyMatch = [ 'range', 'notMatch', 'operators' ]; + + // parse columns after formatter, in case the class is added at that point + data.parsed = c.$headers.map(function(columnIndex) { + return c.parsers && c.parsers[columnIndex] && c.parsers[columnIndex].parsed || + // getData won't return "parsed" if other "filter-" class names exist (e.g. ) + ts.getData && ts.getData(c.$headers.filter('[data-column="' + columnIndex + '"]:last'), ts.getColumnData( table, c.headers, columnIndex ), 'filter') === 'parsed' || + $(this).hasClass('filter-parsed'); + }).get(); + + if (c.debug) { + ts.log('Starting filter widget search', filters); + time = new Date(); + } + // filtered rows count + c.filteredRows = 0; + c.totalRows = 0; + // combindedFilters are undefined on init + combinedFilters = (filters || []).join(''); + + for (tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) { + if ($tbodies.eq(tbodyIndex).hasClass(c.cssInfoBlock || ts.css.info)) { continue; } // ignore info blocks, issue #264 + $tbody = ts.processTbody(table, $tbodies.eq(tbodyIndex), true); + // skip child rows & widget added (removable) rows - fixes #448 thanks to @hempel! + // $rows = $tbody.children('tr').not(c.selectorRemove); + columnIndex = c.columns; + // convert stored rows into a jQuery object + $rows = $( $.map(c.cache[tbodyIndex].normalized, function(el){ return el[columnIndex].$row.get(); }) ); + + if (combinedFilters === '' || wo.filter_serversideFiltering) { + $rows.removeClass(wo.filter_filteredRow).not('.' + c.cssChildRow).show(); + } else { + // filter out child rows + $rows = $rows.not('.' + c.cssChildRow); + len = $rows.length; + // optimize searching only through already filtered rows - see #313 + searchFiltered = wo.filter_searchFiltered; + lastSearch = c.lastSearch || c.$table.data('lastSearch') || []; + if (searchFiltered) { + // cycle through all filters; include last (columnIndex + 1 = match any column). Fixes #669 + for (indx = 0; indx < columnIndex + 1; indx++) { + val = filters[indx] || ''; + // break out of loop if we've already determined not to search filtered rows + if (!searchFiltered) { indx = columnIndex; } + // search already filtered rows if... + searchFiltered = searchFiltered && lastSearch.length && + // there are no changes from beginning of filter + val.indexOf(lastSearch[indx] || '') === 0 && + // if there is NOT a logical "or", or range ("to" or "-") in the string + !regex.alreadyFiltered.test(val) && + // if we are not doing exact matches, using "|" (logical or) or not "!" + !/[=\"\|!]/.test(val) && + // don't search only filtered if the value is negative ('> -10' => '> -100' will ignore hidden rows) + !(/(>=?\s*-\d)/.test(val) || /(<=?\s*\d)/.test(val)) && + // if filtering using a select without a "filter-match" class (exact match) - fixes #593 + !( val !== '' && c.$filters && c.$filters.eq(indx).find('select').length && !c.$headers.filter('[data-column="' + indx + '"]:last').hasClass('filter-match') ); + } + } + notFiltered = $rows.not('.' + wo.filter_filteredRow).length; + // can't search when all rows are hidden - this happens when looking for exact matches + if (searchFiltered && notFiltered === 0) { searchFiltered = false; } + if (c.debug) { + ts.log( "Searching through " + ( searchFiltered && notFiltered < len ? notFiltered : "all" ) + " rows" ); + } + if ((wo.filter_$anyMatch && wo.filter_$anyMatch.length) || filters[c.columns]) { + data.anyMatchFlag = true; + data.anyMatchFilter = wo.filter_$anyMatch && ts.filter.getLatestSearch( wo.filter_$anyMatch ).val() || filters[c.columns] || ''; + if (c.sortLocaleCompare) { + // replace accents + data.anyMatchFilter = ts.replaceAccents(data.anyMatchFilter); + } + if (wo.filter_defaultFilter && regex.iQuery.test( ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) || '')) { + data.anyMatchFilter = ts.filter.defaultFilter( data.anyMatchFilter, ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) ); + // clear search filtered flag because default filters are not saved to the last search + searchFiltered = false; + } + // make iAnyMatchFilter lowercase unless both filter widget & core ignoreCase options are true + // when c.ignoreCase is true, the cache contains all lower case data + data.iAnyMatchFilter = !(wo.filter_ignoreCase && c.ignoreCase) ? data.anyMatchFilter : data.anyMatchFilter.toLocaleLowerCase(); + } + + // loop through the rows + for (rowIndex = 0; rowIndex < len; rowIndex++) { + + data.cacheArray = c.cache[tbodyIndex].normalized[rowIndex]; + + childRow = $rows[rowIndex].className; + // skip child rows & already filtered rows + if ( regex.child.test(childRow) || (searchFiltered && regex.filtered.test(childRow)) ) { continue; } + showRow = true; + // *** nextAll/nextUntil not supported by Zepto! *** + childRow = $rows.eq(rowIndex).nextUntil('tr:not(.' + c.cssChildRow + ')'); + // so, if "table.config.widgetOptions.filter_childRows" is true and there is + // a match anywhere in the child row, then it will make the row visible + // checked here so the option can be changed dynamically + data.childRowText = (childRow.length && wo.filter_childRows) ? childRow.text() : ''; + data.childRowText = wo.filter_ignoreCase ? data.childRowText.toLocaleLowerCase() : data.childRowText; + $cells = $rows.eq(rowIndex).children(); + if (data.anyMatchFlag) { + // look for multiple columns "1-3,4-6,8" + columnIndex = ts.filter.multipleColumns( c, wo.filter_$anyMatch ); + data.anyMatch = true; + data.rowArray = $cells.map(function(i){ + if ( $.inArray(i, columnIndex) > -1 ) { + var txt; + if (data.parsed[i]) { + txt = data.cacheArray[i]; + } else { + txt = this ? this.getAttribute( c.textAttribute ) || this.textContent || $(this).text() : ''; + txt = $.trim( wo.filter_ignoreCase ? txt.toLowerCase() : txt ); + if (c.sortLocaleCompare) { + txt = ts.replaceAccents(txt); + } + } + return txt; + } + }).get(); + data.filter = data.anyMatchFilter; + data.iFilter = data.iAnyMatchFilter; + data.exact = data.rowArray.join(' '); + data.iExact = wo.filter_ignoreCase ? data.exact.toLowerCase() : data.exact; + data.cache = data.cacheArray.slice(0,-1).join(' '); + filterMatched = null; + $.each(ts.filter.types, function(type, typeFunction) { + if ($.inArray(type, noAnyMatch) < 0) { + matches = typeFunction( c, data ); + if (matches !== null) { + filterMatched = matches; + return false; + } + } + }); + if (filterMatched !== null) { + showRow = filterMatched; + } else { + if (wo.filter_startsWith) { + showRow = false; + columnIndex = c.columns; + while (!showRow && columnIndex > 0) { + columnIndex--; + showRow = showRow || data.rowArray[columnIndex].indexOf(data.iFilter) === 0; + } + } else { + showRow = (data.iExact + data.childRowText).indexOf(data.iFilter) >= 0; + } + } + data.anyMatch = false; + } + + for (columnIndex = 0; columnIndex < c.columns; columnIndex++) { + data.filter = filters[columnIndex]; + data.index = columnIndex; + + // filter types to exclude, per column + excludeMatch = ( ts.getColumnData( table, wo.filter_excludeFilter, columnIndex, true ) || '' ).split(/\s+/); + + // ignore if filter is empty or disabled + if (data.filter) { + data.cache = data.cacheArray[columnIndex]; + // check if column data should be from the cell or from parsed data + if (wo.filter_useParsedData || data.parsed[columnIndex]) { + data.exact = data.cache; + } else { + val = $cells[columnIndex]; + result = val ? $.trim( val.getAttribute( c.textAttribute ) || val.textContent || $cells.eq(columnIndex).text() ) : ''; + data.exact = c.sortLocaleCompare ? ts.replaceAccents(result) : result; // issue #405 + } + data.iExact = !regex.type.test(typeof data.exact) && wo.filter_ignoreCase ? data.exact.toLocaleLowerCase() : data.exact; + result = showRow; // if showRow is true, show that row + + // in case select filter option has a different value vs text "a - z|A through Z" + ffxn = wo.filter_columnFilters ? + c.$filters.add(c.$externalFilters).filter('[data-column="'+ columnIndex + '"]').find('select option:selected').attr('data-function-name') || '' : ''; + // replace accents - see #357 + if (c.sortLocaleCompare) { + data.filter = ts.replaceAccents(data.filter); + } + + val = true; + if (wo.filter_defaultFilter && regex.iQuery.test( ts.getColumnData( table, wo.filter_defaultFilter, columnIndex ) || '')) { + data.filter = ts.filter.defaultFilter( data.filter, ts.getColumnData( table, wo.filter_defaultFilter, columnIndex ) ); + // val is used to indicate that a filter select is using a default filter; so we override the exact & partial matches + val = false; + } + // data.iFilter = case insensitive (if wo.filter_ignoreCase is true), data.filter = case sensitive + data.iFilter = wo.filter_ignoreCase ? (data.filter || '').toLocaleLowerCase() : data.filter; + fxn = ts.getColumnData( table, wo.filter_functions, columnIndex ); + $cell = c.$headers.filter('[data-column="' + columnIndex + '"]:last'); + hasSelect = $cell.hasClass('filter-select'); + if ( fxn || ( hasSelect && val ) ) { + if (fxn === true || hasSelect) { + // default selector uses exact match unless "filter-match" class is found + result = ($cell.hasClass('filter-match')) ? data.iExact.search(data.iFilter) >= 0 : data.filter === data.exact; + } else if (typeof fxn === 'function') { + // filter callback( exact cell content, parser normalized content, filter input value, column index, jQuery row object ) + result = fxn(data.exact, data.cache, data.filter, columnIndex, $rows.eq(rowIndex)); + } else if (typeof fxn[ffxn || data.filter] === 'function') { + // selector option function + result = fxn[ffxn || data.filter](data.exact, data.cache, data.filter, columnIndex, $rows.eq(rowIndex)); + } + } else { + filterMatched = null; + // cycle through the different filters + // filters return a boolean or null if nothing matches + $.each(ts.filter.types, function(type, typeFunction) { + if ($.inArray(type, excludeMatch) < 0) { + matches = typeFunction( c, data ); + if (matches !== null) { + filterMatched = matches; + return false; + } + } + }); + if (filterMatched !== null) { + result = filterMatched; + // Look for match, and add child row data for matching + } else { + data.exact = (data.iExact + data.childRowText).indexOf( ts.filter.parseFilter(c, data.iFilter, columnIndex, data.parsed[columnIndex]) ); + result = ( (!wo.filter_startsWith && data.exact >= 0) || (wo.filter_startsWith && data.exact === 0) ); + } + } + showRow = (result) ? showRow : false; + } + } + $rows.eq(rowIndex) + .toggle(showRow) + .toggleClass(wo.filter_filteredRow, !showRow); + if (childRow.length) { + childRow.toggleClass(wo.filter_filteredRow, !showRow); + } + } + } + c.filteredRows += $rows.not('.' + wo.filter_filteredRow).length; + c.totalRows += $rows.length; + ts.processTbody(table, $tbody, false); + } + c.lastCombinedFilter = combinedFilters; // save last search + c.lastSearch = filters; + c.$table.data('lastSearch', filters); + if (wo.filter_saveFilters && ts.storage) { + ts.storage( table, 'tablesorter-filters', filters ); + } + if (c.debug) { + ts.benchmark("Completed filter widget search", time); + } + if (wo.filter_initialized) { c.$table.trigger('filterEnd', c ); } + setTimeout(function(){ + c.$table.trigger('applyWidgets'); // make sure zebra widget is applied + }, 0); + }, + getOptionSource: function(table, column, onlyAvail) { + table = $(table)[0]; + var cts, + c = table.config, + wo = c.widgetOptions, + parsed = [], + arry = false, + source = wo.filter_selectSource, + last = c.$table.data('lastSearch') || [], + fxn = $.isFunction(source) ? true : ts.getColumnData( table, source, column ); + + if (onlyAvail && last[column] !== '') { + onlyAvail = false; + } + + // filter select source option + if (fxn === true) { + // OVERALL source + arry = source(table, column, onlyAvail); + } else if ( fxn instanceof $ || ($.type(fxn) === 'string' && fxn.indexOf('') >= 0) ) { + // selectSource is a jQuery object or string of options + return fxn; + } else if ($.isArray(fxn)) { + arry = fxn; + } else if ($.type(source) === 'object' && fxn) { + // custom select source function for a SPECIFIC COLUMN + arry = fxn(table, column, onlyAvail); + } + if (arry === false) { + // fall back to original method + arry = ts.filter.getOptions(table, column, onlyAvail); + } + + // get unique elements and sort the list + // if $.tablesorter.sortText exists (not in the original tablesorter), + // then natural sort the list otherwise use a basic sort + arry = $.grep(arry, function(value, indx) { + return $.inArray(value, arry) === indx; + }); + + if (c.$headers.filter('[data-column="' + column + '"]:last').hasClass('filter-select-nosort')) { + // unsorted select options + return arry; + } else { + // parse select option values + $.each(arry, function(i, v){ + // parse array data using set column parser; this DOES NOT pass the original + // table cell to the parser format function + parsed.push({ t : v, p : c.parsers && c.parsers[column].format( v, table, [], column ) }); + }); + + // sort parsed select options + cts = c.textSorter || ''; + parsed.sort(function(a, b){ + // sortNatural breaks if you don't pass it strings + var x = a.p.toString(), y = b.p.toString(); + if ($.isFunction(cts)) { + // custom OVERALL text sorter + return cts(x, y, true, column, table); + } else if (typeof(cts) === 'object' && cts.hasOwnProperty(column)) { + // custom text sorter for a SPECIFIC COLUMN + return cts[column](x, y, true, column, table); + } else if (ts.sortNatural) { + // fall back to natural sort + return ts.sortNatural(x, y); + } + // using an older version! do a basic sort + return true; + }); + // rebuild arry from sorted parsed data + arry = []; + $.each(parsed, function(i, v){ + arry.push(v.t); + }); + return arry; + } + }, + getOptions: function(table, column, onlyAvail) { + table = $(table)[0]; + var rowIndex, tbodyIndex, len, row, cache, cell, + c = table.config, + wo = c.widgetOptions, + $tbodies = c.$table.children('tbody'), + arry = []; + for (tbodyIndex = 0; tbodyIndex < $tbodies.length; tbodyIndex++ ) { + if (!$tbodies.eq(tbodyIndex).hasClass(c.cssInfoBlock)) { + cache = c.cache[tbodyIndex]; + len = c.cache[tbodyIndex].normalized.length; + // loop through the rows + for (rowIndex = 0; rowIndex < len; rowIndex++) { + // get cached row from cache.row (old) or row data object (new; last item in normalized array) + row = cache.row ? cache.row[rowIndex] : cache.normalized[rowIndex][c.columns].$row[0]; + // check if has class filtered + if (onlyAvail && row.className.match(wo.filter_filteredRow)) { continue; } + // get non-normalized cell content + if (wo.filter_useParsedData || c.parsers[column].parsed || c.$headers.filter('[data-column="' + column + '"]:last').hasClass('filter-parsed')) { + arry.push( '' + cache.normalized[rowIndex][column] ); + } else { + cell = row.cells[column]; + if (cell) { + arry.push( $.trim( cell.getAttribute( c.textAttribute ) || cell.textContent || $(cell).text() ) ); + } + } + } + } + } + return arry; + }, + buildSelect: function(table, column, arry, updating, onlyAvail) { + table = $(table)[0]; + column = parseInt(column, 10); + if (!table.config.cache || $.isEmptyObject(table.config.cache)) { return; } + var indx, val, txt, t, $filters, $filter, + c = table.config, + wo = c.widgetOptions, + node = c.$headers.filter('[data-column="' + column + '"]:last'), + // t.data('placeholder') won't work in jQuery older than 1.4.3 + options = '', + // Get curent filter value + currentValue = c.$table.find('thead').find('select.' + ts.css.filter + '[data-column="' + column + '"]').val(); + // nothing included in arry (external source), so get the options from filter_selectSource or column data + if (typeof arry === 'undefined' || arry === '') { + arry = ts.filter.getOptionSource(table, column, onlyAvail); + } + + if ($.isArray(arry)) { + // build option list + for (indx = 0; indx < arry.length; indx++) { + txt = arry[indx] = ('' + arry[indx]).replace(/\"/g, """); + val = txt; + // allow including a symbol in the selectSource array + // "a-z|A through Z" so that "a-z" becomes the option value + // and "A through Z" becomes the option text + if (txt.indexOf(wo.filter_selectSourceSeparator) >= 0) { + t = txt.split(wo.filter_selectSourceSeparator); + val = t[0]; + txt = t[1]; + } + // replace quotes - fixes #242 & ignore empty strings - see http://stackoverflow.com/q/14990971/145346 + options += arry[indx] !== '' ? '' : ''; + } + // clear arry so it doesn't get appended twice + arry = []; + } + + // update all selects in the same column (clone thead in sticky headers & any external selects) - fixes 473 + $filters = ( c.$filters ? c.$filters : c.$table.children('thead') ).find('.' + ts.css.filter); + if (wo.filter_$externalFilters) { + $filters = $filters && $filters.length ? $filters.add(wo.filter_$externalFilters) : wo.filter_$externalFilters; + } + $filter = $filters.filter('select[data-column="' + column + '"]'); + + // make sure there is a select there! + if ($filter.length) { + $filter[ updating ? 'html' : 'append' ](options); + if (!$.isArray(arry)) { + // append options if arry is provided externally as a string or jQuery object + // options (default value) was already added + $filter.append(arry).val(currentValue); + } + $filter.val(currentValue); + } + }, + buildDefault: function(table, updating) { + var columnIndex, $header, noSelect, + c = table.config, + wo = c.widgetOptions, + columns = c.columns; + // build default select dropdown + for (columnIndex = 0; columnIndex < columns; columnIndex++) { + $header = c.$headers.filter('[data-column="' + columnIndex + '"]:last'); + noSelect = !($header.hasClass('filter-false') || $header.hasClass('parser-false')); + // look for the filter-select class; build/update it if found + if (($header.hasClass('filter-select') || ts.getColumnData( table, wo.filter_functions, columnIndex ) === true) && noSelect) { + ts.filter.buildSelect(table, columnIndex, '', updating, $header.hasClass(wo.filter_onlyAvail)); + } + } + } +}; + +ts.getFilters = function(table, getRaw, setFilters, skipFirst) { + var i, $filters, $column, cols, + filters = false, + c = table ? $(table)[0].config : '', + wo = c ? c.widgetOptions : ''; + if (getRaw !== true && wo && !wo.filter_columnFilters) { + return $(table).data('lastSearch'); + } + if (c) { + if (c.$filters) { + $filters = c.$filters.find('.' + ts.css.filter); + } + if (wo.filter_$externalFilters) { + $filters = $filters && $filters.length ? $filters.add(wo.filter_$externalFilters) : wo.filter_$externalFilters; + } + if ($filters && $filters.length) { + filters = setFilters || []; + for (i = 0; i < c.columns + 1; i++) { + cols = ( i === c.columns ? + // "all" columns can now include a range or set of columms (data-column="0-2,4,6-7") + wo.filter_anyColumnSelector + ',' + wo.filter_multipleColumnSelector : + '[data-column="' + i + '"]' ); + $column = $filters.filter(cols); + if ($column.length) { + // move the latest search to the first slot in the array + $column = ts.filter.getLatestSearch( $column ); + if ($.isArray(setFilters)) { + // skip first (latest input) to maintain cursor position while typing + if (skipFirst) { $column.slice(1); } + if (i === c.columns) { + // prevent data-column="all" from filling data-column="0,1" (etc) + cols = $column.filter(wo.filter_anyColumnSelector); + $column = cols.length ? cols : $column; + } + $column + .val( setFilters[i] ) + .trigger('change.tsfilter'); + } else { + filters[i] = $column.val() || ''; + // don't change the first... it will move the cursor + if (i === c.columns) { + // don't update range columns from "all" setting + $column.slice(1).filter('[data-column*="' + $column.attr('data-column') + '"]').val( filters[i] ); + } else { + $column.slice(1).val( filters[i] ); + } + } + // save any match input dynamically + if (i === c.columns && $column.length) { + wo.filter_$anyMatch = $column; + } + } + } + } + } + if (filters.length === 0) { + filters = false; + } + return filters; +}; + +ts.setFilters = function(table, filter, apply, skipFirst) { + var c = table ? $(table)[0].config : '', + valid = ts.getFilters(table, true, filter, skipFirst); + if (c && apply) { + // ensure new set filters are applied, even if the search is the same + c.lastCombinedFilter = null; + c.lastSearch = []; + ts.filter.searching(c.table, filter, skipFirst); + c.$table.trigger('filterFomatterUpdate'); + } + return !!valid; +}; + +})(jQuery); + +/*! Widget: stickyHeaders */ +;(function ($, window) { +'use strict'; +var ts = $.tablesorter = $.tablesorter || {}; + +$.extend(ts.css, { + sticky : 'tablesorter-stickyHeader', // stickyHeader + stickyVis : 'tablesorter-sticky-visible', + stickyWrap: 'tablesorter-sticky-wrapper' +}); + +// Add a resize event to table headers +ts.addHeaderResizeEvent = function(table, disable, settings) { + table = $(table)[0]; // make sure we're using a dom element + var headers, + defaults = { + timer : 250 + }, + options = $.extend({}, defaults, settings), + c = table.config, + wo = c.widgetOptions, + checkSizes = function(triggerEvent) { + wo.resize_flag = true; + headers = []; + c.$headers.each(function() { + var $header = $(this), + sizes = $header.data('savedSizes') || [0,0], // fixes #394 + width = this.offsetWidth, + height = this.offsetHeight; + if (width !== sizes[0] || height !== sizes[1]) { + $header.data('savedSizes', [ width, height ]); + headers.push(this); + } + }); + if (headers.length && triggerEvent !== false) { + c.$table.trigger('resize', [ headers ]); + } + wo.resize_flag = false; + }; + checkSizes(false); + clearInterval(wo.resize_timer); + if (disable) { + wo.resize_flag = false; + return false; + } + wo.resize_timer = setInterval(function() { + if (wo.resize_flag) { return; } + checkSizes(); + }, options.timer); +}; + +// Sticky headers based on this awesome article: +// http://css-tricks.com/13465-persistent-headers/ +// and https://github.com/jmosbech/StickyTableHeaders by Jonas Mosbech +// ************************** +ts.addWidget({ + id: "stickyHeaders", + priority: 60, // sticky widget must be initialized after the filter widget! + options: { + stickyHeaders : '', // extra class name added to the sticky header row + stickyHeaders_attachTo : null, // jQuery selector or object to attach sticky header to + stickyHeaders_xScroll : null, // jQuery selector or object to monitor horizontal scroll position (defaults: xScroll > attachTo > window) + stickyHeaders_yScroll : null, // jQuery selector or object to monitor vertical scroll position (defaults: yScroll > attachTo > window) + stickyHeaders_offset : 0, // number or jquery selector targeting the position:fixed element + stickyHeaders_filteredToTop: true, // scroll table top into view after filtering + stickyHeaders_cloneId : '-sticky', // added to table ID, if it exists + stickyHeaders_addResizeEvent : true, // trigger "resize" event on headers + stickyHeaders_includeCaption : true, // if false and a caption exist, it won't be included in the sticky header + stickyHeaders_zIndex : 2 // The zIndex of the stickyHeaders, allows the user to adjust this to their needs + }, + format: function(table, c, wo) { + // filter widget doesn't initialize on an empty table. Fixes #449 + if ( c.$table.hasClass('hasStickyHeaders') || ($.inArray('filter', c.widgets) >= 0 && !c.$table.hasClass('hasFilters')) ) { + return; + } + var $table = c.$table, + $attach = $(wo.stickyHeaders_attachTo), + namespace = c.namespace + 'stickyheaders ', + // element to watch for the scroll event + $yScroll = $(wo.stickyHeaders_yScroll || wo.stickyHeaders_attachTo || window), + $xScroll = $(wo.stickyHeaders_xScroll || wo.stickyHeaders_attachTo || window), + $thead = $table.children('thead:first'), + $header = $thead.children('tr').not('.sticky-false').children(), + $tfoot = $table.children('tfoot'), + $stickyOffset = isNaN(wo.stickyHeaders_offset) ? $(wo.stickyHeaders_offset) : '', + stickyOffset = $attach.length ? 0 : $stickyOffset.length ? + $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0, + // is this table nested? If so, find parent sticky header wrapper (div, not table) + $nestedSticky = $table.parent().closest('.' + ts.css.table).hasClass('hasStickyHeaders') ? + $table.parent().closest('table.tablesorter')[0].config.widgetOptions.$sticky.parent() : [], + nestedStickyTop = $nestedSticky.length ? $nestedSticky.height() : 0, + // clone table, then wrap to make sticky header + $stickyTable = wo.$sticky = $table.clone() + .addClass('containsStickyHeaders ' + ts.css.sticky + ' ' + wo.stickyHeaders) + .wrap('
    '), + $stickyWrap = $stickyTable.parent().css({ + position : $attach.length ? 'absolute' : 'fixed', + padding : parseInt( $stickyTable.parent().parent().css('padding-left'), 10 ), + top : stickyOffset + nestedStickyTop, + left : 0, + visibility : 'hidden', + zIndex : wo.stickyHeaders_zIndex || 2 + }), + $stickyThead = $stickyTable.children('thead:first'), + $stickyCells, + laststate = '', + spacing = 0, + setWidth = function($orig, $clone){ + $orig.filter(':visible').each(function(i) { + var width, border, + $cell = $clone.filter(':visible').eq(i), + $this = $(this); + // code from https://github.com/jmosbech/StickyTableHeaders + if ($this.css('box-sizing') === 'border-box') { + width = $this.outerWidth(); + } else { + if ($cell.css('border-collapse') === 'collapse') { + if (window.getComputedStyle) { + width = parseFloat( window.getComputedStyle(this, null).width ); + } else { + // ie8 only + border = parseFloat( $this.css('border-width') ); + width = $this.outerWidth() - parseFloat( $this.css('padding-left') ) - parseFloat( $this.css('padding-right') ) - border; + } + } else { + width = $this.width(); + } + } + $cell.css({ + 'min-width': width, + 'max-width': width + }); + }); + }, + resizeHeader = function() { + stickyOffset = $stickyOffset.length ? $stickyOffset.height() || 0 : parseInt(wo.stickyHeaders_offset, 10) || 0; + spacing = 0; + $stickyWrap.css({ + left : $attach.length ? parseInt($attach.css('padding-left'), 10) || 0 : + $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft() - spacing, + width: $table.outerWidth() + }); + setWidth( $table, $stickyTable ); + setWidth( $header, $stickyCells ); + }; + // save stickyTable element to config + // it is also saved to wo.$sticky + if (c.$extraTables && c.$extraTables.length) { + c.$extraTables.add($stickyTable); + } else { + c.$extraTables = $stickyTable; + } + // fix clone ID, if it exists - fixes #271 + if ($stickyTable.attr('id')) { $stickyTable[0].id += wo.stickyHeaders_cloneId; } + // clear out cloned table, except for sticky header + // include caption & filter row (fixes #126 & #249) - don't remove cells to get correct cell indexing + $stickyTable.find('thead:gt(0), tr.sticky-false').hide(); + $stickyTable.find('tbody, tfoot').remove(); + $stickyTable.find('caption').toggle(wo.stickyHeaders_includeCaption); + // issue #172 - find td/th in sticky header + $stickyCells = $stickyThead.children().children(); + $stickyTable.css({ height:0, width:0, margin: 0 }); + // remove resizable block + $stickyCells.find('.' + ts.css.resizer).remove(); + // update sticky header class names to match real header after sorting + $table + .addClass('hasStickyHeaders') + .bind( $.trim('pagerComplete' + namespace), function() { + resizeHeader(); + }); + + ts.bindEvents(table, $stickyThead.children().children('.tablesorter-header')); + + // add stickyheaders AFTER the table. If the table is selected by ID, the original one (first) will be returned. + $table.after( $stickyWrap ); + + // onRenderHeader is defined, we need to do something about it (fixes #641) + if (c.onRenderHeader) { + $stickyThead.children('tr').children().each(function(index){ + // send second parameter + c.onRenderHeader.apply( $(this), [ index, c, $stickyTable ] ); + }); + } + + // make it sticky! + $xScroll.add($yScroll) + .unbind( $.trim('scroll resize '.split(' ').join( namespace )) ) + .bind( $.trim('scroll resize '.split(' ').join( namespace )), function(event) { + if (!$table.is(':visible')) { return; } // fixes #278 + // Detect nested tables - fixes #724 + nestedStickyTop = $nestedSticky.length ? $nestedSticky.offset().top - $yScroll.scrollTop() + $nestedSticky.height() : 0; + var prefix = 'tablesorter-sticky-', + offset = $table.offset(), + yWindow = $.isWindow( $yScroll[0] ), // $.isWindow needs jQuery 1.4.3 + xWindow = $.isWindow( $xScroll[0] ), + // scrollTop = ( $attach.length ? $attach.offset().top : $yScroll.scrollTop() ) + stickyOffset + nestedStickyTop, + scrollTop = ( $attach.length ? ( yWindow ? $yScroll.scrollTop() : $yScroll.offset().top ) : $yScroll.scrollTop() ) + stickyOffset + nestedStickyTop, + tableHeight = $table.height() - ($stickyWrap.height() + ($tfoot.height() || 0)), + isVisible = ( scrollTop > offset.top ) && ( scrollTop < offset.top + tableHeight ) ? 'visible' : 'hidden', + cssSettings = { visibility : isVisible }; + + if ($attach.length) { + cssSettings.top = yWindow ? scrollTop : $attach.scrollTop(); + } + if (xWindow) { + // adjust when scrolling horizontally - fixes issue #143 + cssSettings.left = $table.offset().left - parseInt($table.css('margin-left'), 10) - $xScroll.scrollLeft() - spacing; + } + if ($nestedSticky.length) { + cssSettings.top = ( cssSettings.top || 0 ) + stickyOffset + nestedStickyTop; + } + $stickyWrap + .removeClass(prefix + 'visible ' + prefix + 'hidden') + .addClass(prefix + isVisible) + .css(cssSettings); + if (isVisible !== laststate || event.type === 'resize') { + // make sure the column widths match + resizeHeader(); + laststate = isVisible; + } + }); + if (wo.stickyHeaders_addResizeEvent) { + ts.addHeaderResizeEvent(table); + } + + // look for filter widget + if ($table.hasClass('hasFilters') && wo.filter_columnFilters) { + // scroll table into view after filtering, if sticky header is active - #482 + $table.bind( $.trim('filterEnd' + namespace), function() { + // $(':focus') needs jQuery 1.6+ + var $td = $(document.activeElement).closest('td'), + column = $td.parent().children().index($td); + // only scroll if sticky header is active + if ($stickyWrap.hasClass(ts.css.stickyVis) && wo.stickyHeaders_filteredToTop) { + // scroll to original table (not sticky clone) + window.scrollTo(0, $table.position().top); + // give same input/select focus; check if c.$filters exists; fixes #594 + if (column >= 0 && c.$filters) { + c.$filters.eq(column).find('a, select, input').filter(':visible').focus(); + } + } + }); + ts.filter.bindSearch( $table, $stickyCells.find('.' + ts.css.filter) ); + // support hideFilters + if (wo.filter_hideFilters) { + ts.filter.hideFilters($stickyTable, c); + } + } + + $table.trigger('stickyHeadersInit'); + + }, + remove: function(table, c, wo) { + var namespace = c.namespace + 'stickyheaders '; + c.$table + .removeClass('hasStickyHeaders') + .unbind( $.trim('pagerComplete filterEnd '.split(' ').join(namespace)) ) + .next('.' + ts.css.stickyWrap).remove(); + if (wo.$sticky && wo.$sticky.length) { wo.$sticky.remove(); } // remove cloned table + $(window) + .add(wo.stickyHeaders_xScroll) + .add(wo.stickyHeaders_yScroll) + .add(wo.stickyHeaders_attachTo) + .unbind( $.trim('scroll resize '.split(' ').join(namespace)) ); + ts.addHeaderResizeEvent(table, false); + } +}); + +})(jQuery, window); + +/*! Widget: resizable */ +;(function ($, window) { +'use strict'; +var ts = $.tablesorter = $.tablesorter || {}; + +$.extend(ts.css, { + resizer : 'tablesorter-resizer' // resizable +}); + +// this widget saves the column widths if +// $.tablesorter.storage function is included +// ************************** +ts.addWidget({ + id: "resizable", + priority: 40, + options: { + resizable : true, + resizable_addLastColumn : false, + resizable_widths : [], + resizable_throttle : false // set to true (5ms) or any number 0-10 range + }, + format: function(table, c, wo) { + if (c.$table.hasClass('hasResizable')) { return; } + c.$table.addClass('hasResizable'); + ts.resizableReset(table, true); // set default widths + var $rows, $columns, $column, column, timer, + storedSizes = {}, + $table = c.$table, + $wrap = $table.parent(), + overflow = $table.parent().css('overflow') === 'auto', + mouseXPosition = 0, + $target = null, + $next = null, + fullWidth = Math.abs($table.parent().width() - $table.width()) < 20, + mouseMove = function(event){ + if (mouseXPosition === 0 || !$target) { return; } + // resize columns + var leftEdge = event.pageX - mouseXPosition, + targetWidth = $target.width(); + $target.width( targetWidth + leftEdge ); + if ($target.width() !== targetWidth && fullWidth) { + $next.width( $next.width() - leftEdge ); + } else if (overflow) { + $table.width(function(i, w){ + return w + leftEdge; + }); + if (!$next.length) { + // if expanding right-most column, scroll the wrapper + $wrap[0].scrollLeft = $table.width(); + } + } + mouseXPosition = event.pageX; + }, + stopResize = function() { + if (ts.storage && $target && $next) { + storedSizes = {}; + storedSizes[$target.index()] = $target.width(); + storedSizes[$next.index()] = $next.width(); + $target.width( storedSizes[$target.index()] ); + $next.width( storedSizes[$next.index()] ); + if (wo.resizable !== false) { + // save all column widths + ts.storage(table, 'tablesorter-resizable', c.$headers.map(function(){ return $(this).width(); }).get() ); + } + } + mouseXPosition = 0; + $target = $next = null; + $(window).trigger('resize'); // will update stickyHeaders, just in case + }; + storedSizes = (ts.storage && wo.resizable !== false) ? ts.storage(table, 'tablesorter-resizable') : {}; + // process only if table ID or url match + if (storedSizes) { + for (column in storedSizes) { + if (!isNaN(column) && column < c.$headers.length) { + c.$headers.eq(column).width(storedSizes[column]); // set saved resizable widths + } + } + } + $rows = $table.children('thead:first').children('tr'); + // add resizable-false class name to headers (across rows as needed) + $rows.children().each(function() { + var canResize, + $column = $(this); + column = $column.attr('data-column'); + canResize = ts.getData( $column, ts.getColumnData( table, c.headers, column ), 'resizable') === "false"; + $rows.children().filter('[data-column="' + column + '"]')[canResize ? 'addClass' : 'removeClass']('resizable-false'); + }); + // add wrapper inside each cell to allow for positioning of the resizable target block + $rows.each(function() { + $column = $(this).children().not('.resizable-false'); + if (!$(this).find('.' + ts.css.wrapper).length) { + // Firefox needs this inner div to position the resizer correctly + $column.wrapInner('
    '); + } + // don't include the last column of the row + if (!wo.resizable_addLastColumn) { $column = $column.slice(0,-1); } + $columns = $columns ? $columns.add($column) : $column; + }); + $columns + .each(function() { + var $column = $(this), + padding = parseInt($column.css('padding-right'), 10) + 10; // 10 is 1/2 of the 20px wide resizer + $column + .find('.' + ts.css.wrapper) + .append('
    '); + }) + .find('.' + ts.css.resizer) + .bind('mousedown', function(event) { + // save header cell and mouse position + $target = $(event.target).closest('th'); + var $header = c.$headers.filter('[data-column="' + $target.attr('data-column') + '"]'); + if ($header.length > 1) { $target = $target.add($header); } + // if table is not as wide as it's parent, then resize the table + $next = event.shiftKey ? $target.parent().find('th').not('.resizable-false').filter(':last') : $target.nextAll(':not(.resizable-false)').eq(0); + mouseXPosition = event.pageX; + }); + $(document) + .bind('mousemove.tsresize', function(event) { + // ignore mousemove if no mousedown + if (mouseXPosition === 0 || !$target) { return; } + if (wo.resizable_throttle) { + clearTimeout(timer); + timer = setTimeout(function(){ + mouseMove(event); + }, isNaN(wo.resizable_throttle) ? 5 : wo.resizable_throttle ); + } else { + mouseMove(event); + } + }) + .bind('mouseup.tsresize', function() { + stopResize(); + }); + + // right click to reset columns to default widths + $table.find('thead:first').bind('contextmenu.tsresize', function() { + ts.resizableReset(table); + // $.isEmptyObject() needs jQuery 1.4+; allow right click if already reset + var allowClick = $.isEmptyObject ? $.isEmptyObject(storedSizes) : true; + storedSizes = {}; + return allowClick; + }); + }, + remove: function(table, c) { + c.$table + .removeClass('hasResizable') + .children('thead') + .unbind('mouseup.tsresize mouseleave.tsresize contextmenu.tsresize') + .children('tr').children() + .unbind('mousemove.tsresize mouseup.tsresize') + // don't remove "tablesorter-wrapper" as uitheme uses it too + .find('.' + ts.css.resizer).remove(); + ts.resizableReset(table); + } +}); +ts.resizableReset = function(table, nosave) { + $(table).each(function(){ + var $t, + c = this.config, + wo = c && c.widgetOptions; + if (table && c) { + c.$headers.each(function(i){ + $t = $(this); + if (wo.resizable_widths && wo.resizable_widths[i]) { + $t.css('width', wo.resizable_widths[i]); + } else if (!$t.hasClass('resizable-false')) { + // don't clear the width of any column that is not resizable + $t.css('width',''); + } + }); + if (ts.storage && !nosave) { ts.storage(this, 'tablesorter-resizable', {}); } + } + }); +}; + +})(jQuery, window); + +/*! Widget: saveSort */ +;(function ($) { +'use strict'; +var ts = $.tablesorter = $.tablesorter || {}; + +// this widget saves the last sort only if the +// saveSort widget option is true AND the +// $.tablesorter.storage function is included +// ************************** +ts.addWidget({ + id: 'saveSort', + priority: 20, + options: { + saveSort : true + }, + init: function(table, thisWidget, c, wo) { + // run widget format before all other widgets are applied to the table + thisWidget.format(table, c, wo, true); + }, + format: function(table, c, wo, init) { + var stored, time, + $table = c.$table, + saveSort = wo.saveSort !== false, // make saveSort active/inactive; default to true + sortList = { "sortList" : c.sortList }; + if (c.debug) { + time = new Date(); + } + if ($table.hasClass('hasSaveSort')) { + if (saveSort && table.hasInitialized && ts.storage) { + ts.storage( table, 'tablesorter-savesort', sortList ); + if (c.debug) { + ts.benchmark('saveSort widget: Saving last sort: ' + c.sortList, time); + } + } + } else { + // set table sort on initial run of the widget + $table.addClass('hasSaveSort'); + sortList = ''; + // get data + if (ts.storage) { + stored = ts.storage( table, 'tablesorter-savesort' ); + sortList = (stored && stored.hasOwnProperty('sortList') && $.isArray(stored.sortList)) ? stored.sortList : ''; + if (c.debug) { + ts.benchmark('saveSort: Last sort loaded: "' + sortList + '"', time); + } + $table.bind('saveSortReset', function(event) { + event.stopPropagation(); + ts.storage( table, 'tablesorter-savesort', '' ); + }); + } + // init is true when widget init is run, this will run this widget before all other widgets have initialized + // this method allows using this widget in the original tablesorter plugin; but then it will run all widgets twice. + if (init && sortList && sortList.length > 0) { + c.sortList = sortList; + } else if (table.hasInitialized && sortList && sortList.length > 0) { + // update sort change + $table.trigger('sorton', [sortList]); + } + } + }, + remove: function(table, c) { + c.$table.removeClass('hasSaveSort'); + // clear storage + if (ts.storage) { ts.storage( table, 'tablesorter-savesort', '' ); } + } +}); + +})(jQuery); diff --git a/dist/js/jquery.tablesorter.widgets.min.js b/dist/js/jquery.tablesorter.widgets.min.js new file mode 100644 index 00000000..df26b128 --- /dev/null +++ b/dist/js/jquery.tablesorter.widgets.min.js @@ -0,0 +1,4 @@ +/*! tablesorter (FORK) widgets - updated 02-12-2015 (v2.19.1)*/ +/*! Widget: storage */ +!function(a,b,c){"use strict";var d=a.tablesorter=a.tablesorter||{};d.storage=function(d,e,f,g){d=a(d)[0];var h,i,j,k=!1,l={},m=d.config,n=a(d),o=g&&g.id||n.attr(g&&g.group||"data-table-group")||d.id||a(".tablesorter").index(n),p=g&&g.url||n.attr(g&&g.page||"data-table-page")||m&&m.fixedUrl||b.location.pathname;if("localStorage"in b)try{b.localStorage.setItem("_tmptest","temp"),k=!0,b.localStorage.removeItem("_tmptest")}catch(q){}return a.parseJSON&&(k?l=a.parseJSON(localStorage[e]||"null")||{}:(i=c.cookie.split(/[;\s|=]/),h=a.inArray(e,i)+1,l=0!==h?a.parseJSON(i[h]||"null")||{}:{})),(f||""===f)&&b.JSON&&JSON.hasOwnProperty("stringify")?(l[p]||(l[p]={}),l[p][o]=f,k?localStorage[e]=JSON.stringify(l):(j=new Date,j.setTime(j.getTime()+31536e6),c.cookie=e+"="+JSON.stringify(l).replace(/\"/g,'"')+"; expires="+j.toGMTString()+"; path=/"),void 0):l&&l[p]?l[p][o]:""}}(jQuery,window,document),function(a){"use strict";var b=a.tablesorter=a.tablesorter||{};b.themes={bootstrap:{table:"table table-bordered table-striped",caption:"caption",header:"bootstrap-header",sortNone:"",sortAsc:"",sortDesc:"",active:"",hover:"",icons:"",iconSortNone:"bootstrap-icon-unsorted",iconSortAsc:"icon-chevron-up glyphicon glyphicon-chevron-up",iconSortDesc:"icon-chevron-down glyphicon glyphicon-chevron-down",filterRow:"",footerRow:"",footerCells:"",even:"",odd:""},jui:{table:"ui-widget ui-widget-content ui-corner-all",caption:"ui-widget-content",header:"ui-widget-header ui-corner-all ui-state-default",sortNone:"",sortAsc:"",sortDesc:"",active:"ui-state-active",hover:"ui-state-hover",icons:"ui-icon",iconSortNone:"ui-icon-carat-2-n-s",iconSortAsc:"ui-icon-carat-1-n",iconSortDesc:"ui-icon-carat-1-s",filterRow:"",footerRow:"",footerCells:"",even:"ui-widget-content",odd:"ui-state-default"}},a.extend(b.css,{wrapper:"tablesorter-wrapper"}),b.addWidget({id:"uitheme",priority:10,format:function(c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r=b.themes,s=d.$table.add(d.$extraTables),t=d.$headers.add(d.$extraHeaders),u=d.theme||"jui",v=r[u]||{},w=a.trim([v.sortNone,v.sortDesc,v.sortAsc,v.active].join(" ")),x=a.trim([v.iconSortNone,v.iconSortDesc,v.iconSortAsc].join(" "));for(d.debug&&(i=new Date),s.hasClass("tablesorter-"+u)&&d.theme===d.appliedTheme&&e.uitheme_applied||(e.uitheme_applied=!0,n=r[d.appliedTheme]||{},q=!a.isEmptyObject(n),o=q?[n.sortNone,n.sortDesc,n.sortAsc,n.active].join(" "):"",p=q?[n.iconSortNone,n.iconSortDesc,n.iconSortAsc].join(" "):"",q&&(e.zebra[0]=a.trim(" "+e.zebra[0].replace(" "+n.even,"")),e.zebra[1]=a.trim(" "+e.zebra[1].replace(" "+n.odd,"")),d.$tbodies.children().removeClass([n.even,n.odd].join(" "))),v.even&&(e.zebra[0]+=" "+v.even),v.odd&&(e.zebra[1]+=" "+v.odd),s.children("caption").removeClass(n.caption||"").addClass(v.caption),l=s.removeClass((d.appliedTheme?"tablesorter-"+(d.appliedTheme||""):"")+" "+(n.table||"")).addClass("tablesorter-"+u+" "+(v.table||"")).children("tfoot"),d.appliedTheme=d.theme,l.length&&l.children("tr").removeClass(n.footerRow||"").addClass(v.footerRow).children("th, td").removeClass(n.footerCells||"").addClass(v.footerCells),t.removeClass((q?[n.header,n.hover,o].join(" "):"")||"").addClass(v.header).not(".sorter-false").unbind("mouseenter.tsuitheme mouseleave.tsuitheme").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(b){a(this)["mouseenter"===b.type?"addClass":"removeClass"](v.hover||"")}),t.each(function(){var c=a(this);c.find("."+b.css.wrapper).length||c.wrapInner('
    ')}),d.cssIcon&&t.find("."+b.css.icon).removeClass(q?[n.icons,p].join(" "):"").addClass(v.icons||""),s.hasClass("hasFilters")&&s.children("thead").children("."+b.css.filterRow).removeClass(q?n.filterRow||"":"").addClass(v.filterRow||"")),f=0;f1)))for(m=1;q>m;m++)k.eq(p[m][0]).addClass(r[m]||r[s])}),b.processTbody(c,f,!1);if(i=e.columns_thead!==!1?["thead tr"]:[],e.columns_tfoot!==!1&&i.push("tfoot tr"),i.length&&(h=n.find(i.join(",")).children().removeClass(l),q))for(m=0;q>m;m++)h.filter('[data-column="'+p[m][0]+'"]').addClass(r[m]||r[s])},remove:function(c,d,e){var f,g,h=d.$tbodies,i=(e.columns||["primary","secondary","tertiary"]).join(" ");for(d.$headers.removeClass(i),d.$table.children("tfoot").children("tr").children("th, td").removeClass(i),f=0;f=]/g,query:"(q|query)"},types:{regex:function(a,c){if(b.filter.regex.regex.test(c.iFilter)){var d,e=b.filter.regex.regex.exec(c.iFilter);try{d=new RegExp(e[1],e[2]).test(c.iExact)}catch(f){d=!1}return d}return null},operators:function(c,d){if(/^[<>]=?/.test(d.iFilter)){var e,f,g=c.table,h=d.index,i=d.parsed[h],j=b.formatFloat(d.iFilter.replace(b.filter.regex.operators,""),g),k=c.parsers[h],l=j;return(i||"numeric"===k.type)&&(f=b.filter.parseFilter(c,a.trim(""+d.iFilter.replace(b.filter.regex.operators,"")),h,i,!0),j="number"!=typeof f||""===f||isNaN(f)?j:f),e=!i&&"numeric"!==k.type||isNaN(j)||"undefined"==typeof d.cache?isNaN(d.iExact)?b.formatFloat(d.iExact.replace(b.filter.regex.nondigit,""),g):b.formatFloat(d.iExact,g):d.cache,/>/.test(d.iFilter)&&(f=/>=/.test(d.iFilter)?e>=j:e>j),/=e:j>e),f||""!==l||(f=!0),f}return null},notMatch:function(c,d){if(/^\!/.test(d.iFilter)){var e,f=b.filter.parseFilter(c,d.iFilter.replace("!",""),d.index,d.parsed[d.index]);return b.filter.regex.exact.test(f)?(f=f.replace(b.filter.regex.exact,""),""===f?!0:a.trim(f)!==d.iExact):(e=d.iExact.search(a.trim(f)),""===f?!0:!(c.widgetOptions.filter_startsWith?0===e:e>=0))}return null},exact:function(c,d){if(b.filter.regex.exact.test(d.iFilter)){var e=b.filter.parseFilter(c,d.iFilter.replace(b.filter.regex.exact,""),d.index,d.parsed[d.index]);return d.anyMatch?a.inArray(e,d.rowArray)>=0:e==d.iExact}return null},and:function(c,d){if(b.filter.regex.andTest.test(d.filter)){for(var e=d.index,f=d.parsed[e],g=d.iFilter.split(b.filter.regex.andSplit),h=d.iExact.search(a.trim(b.filter.parseFilter(c,g[0],e,f)))>=0,i=g.length-1;h&&i;)h=h&&d.iExact.search(a.trim(b.filter.parseFilter(c,g[i],e,f)))>=0,i--;return h}return null},range:function(a,c){if(b.filter.regex.toTest.test(c.iFilter)){var d,e,f=a.table,g=c.index,h=c.parsed[g],i=c.iFilter.split(b.filter.regex.toSplit),j=b.formatFloat(b.filter.parseFilter(a,i[0].replace(b.filter.regex.nondigit,""),g,h),f),k=b.formatFloat(b.filter.parseFilter(a,i[1].replace(b.filter.regex.nondigit,""),g,h),f);return(h||"numeric"===a.parsers[g].type)&&(d=a.parsers[g].format(""+i[0],f,a.$headers.eq(g),g),j=""===d||isNaN(d)?j:d,d=a.parsers[g].format(""+i[1],f,a.$headers.eq(g),g),k=""===d||isNaN(d)?k:d),d=!h&&"numeric"!==a.parsers[g].type||isNaN(j)||isNaN(k)?isNaN(c.iExact)?b.formatFloat(c.iExact.replace(b.filter.regex.nondigit,""),f):b.formatFloat(c.iExact,f):c.cache,j>k&&(e=j,j=k,k=e),d>=j&&k>=d||""===j||""===k}return null},wild:function(c,d){if(/[\?\*\|]/.test(d.iFilter)||b.filter.regex.orReplace.test(d.filter)){var e=d.index,f=d.parsed[e],g=b.filter.parseFilter(c,d.iFilter.replace(b.filter.regex.orReplace,"|"),e,f);return!c.$headers.filter('[data-column="'+e+'"]:last').hasClass("filter-match")&&/\|/.test(g)&&("|"===g[g.length-1]&&(g+="*"),g=d.anyMatch&&a.isArray(d.rowArray)?"("+g+")":"^("+g+")$"),new RegExp(g.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(d.iExact)}return null},fuzzy:function(a,c){if(/^~/.test(c.iFilter)){var d,e=0,f=c.iExact.length,g=b.filter.parseFilter(a,c.iFilter.slice(1),c.index,c.parsed[c.index]);for(d=0;f>d;d++)c.iExact[d]===g[e]&&(e+=1);return e===g.length?!0:!1}return null}},init:function(c,d,e){b.language=a.extend(!0,{},{to:"to",or:"or",and:"and"},b.language);var f,g,h,i,j,k,l,m,n,o=b.filter.regex;if(d.$table.addClass("hasFilters"),e.searchTimer=null,e.filter_initTimer=null,e.filter_formatterCount=0,e.filter_formatterInit=[],e.filter_anyColumnSelector='[data-column="all"],[data-column="any"]',e.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]',h="\\{"+b.filter.regex.query+"\\}",a.extend(o,{child:new RegExp(d.cssChildRow),filtered:new RegExp(e.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+("+b.language.or+"|-|"+b.language.to+")\\s+)","i"),toTest:new RegExp("\\s+(-|"+b.language.to+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-|"+b.language.to+")\\s+)","gi"),andTest:new RegExp("\\s+("+b.language.and+"|&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+b.language.and+"|&&)\\s+)","gi"),orReplace:new RegExp("\\s+("+b.language.or+")\\s+","gi"),iQuery:new RegExp(h,"i"),igQuery:new RegExp(h,"ig")}),e.filter_columnFilters!==!1&&d.$headers.filter(".filter-false, .parser-false").length!==d.$headers.length&&b.filter.buildRow(c,d,e),h="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(d.namespace+"filter "),d.$table.bind(a.trim(h),function(f,g){return l=e.filter_hideEmpty&&a.isEmptyObject(d.cache)&&!(d.delayInit&&"appendCache"===f.type),d.$table.find("."+b.css.filterRow).toggleClass(e.filter_filteredRow,l),/(search|filter)/.test(f.type)||(f.stopPropagation(),b.filter.buildDefault(c,!0)),"filterReset"===f.type?(d.$table.find("."+b.css.filter).add(e.filter_$externalFilters).val(""),b.filter.searching(c,[])):"filterEnd"===f.type?b.filter.buildDefault(c,!0):(g="search"===f.type?g:"updateComplete"===f.type?d.$table.data("lastSearch"):"",/(update|add)/.test(f.type)&&"updateComplete"!==f.type&&(d.lastCombinedFilter=null,d.lastSearch=[]),b.filter.searching(c,g,!0)),!1}),e.filter_reset&&(e.filter_reset instanceof a?e.filter_reset.click(function(){d.$table.trigger("filterReset")}):a(e.filter_reset).length&&a(document).undelegate(e.filter_reset,"click.tsfilter").delegate(e.filter_reset,"click.tsfilter",function(){d.$table.trigger("filterReset")})),e.filter_functions)for(j=0;j'+(i.data("placeholder")||i.attr("data-placeholder")||e.filter_placeholder.select||"")+"":"",l=g,h=g,g.indexOf(e.filter_selectSourceSeparator)>=0&&(l=g.split(e.filter_selectSourceSeparator),h=l[1],l=l[0]),f+="");d.$table.find("thead").find("select."+b.css.filter+'[data-column="'+j+'"]').append(f)}b.filter.buildDefault(c,!0),b.filter.bindSearch(c,d.$table.find("."+b.css.filter),!0),e.filter_external&&b.filter.bindSearch(c,e.filter_external),e.filter_hideFilters&&b.filter.hideFilters(c,d),d.showProcessing&&d.$table.unbind(a.trim("filterStart filterEnd ".split(" ").join(d.namespace+"filter "))).bind(a.trim("filterStart filterEnd ".split(" ").join(d.namespace+"filter ")),function(e,f){i=f?d.$table.find("."+b.css.header).filter("[data-column]").filter(function(){return""!==f[a(this).data("column")]}):"",b.isProcessing(c,"filterStart"===e.type,f?i:"")}),d.filteredRows=d.totalRows,d.$table.unbind(a.trim("tablesorter-initialized pagerBeforeInitialized ".split(" ").join(d.namespace+"filter "))).bind(a.trim("tablesorter-initialized pagerBeforeInitialized ".split(" ").join(d.namespace+"filter ")),function(){var a=this.config.widgetOptions;k=b.filter.setDefaults(c,d,a)||[],k.length&&(d.delayInit&&""===k.join("")||b.setFilters(c,k,!0)),d.$table.trigger("filterFomatterUpdate"),setTimeout(function(){a.filter_initialized||b.filter.filterInitComplete(d)},100)}),d.pager&&d.pager.initialized&&!e.filter_initialized&&(d.$table.trigger("filterFomatterUpdate"),setTimeout(function(){b.filter.filterInitComplete(d)},100))},formatterUpdated:function(a,b){var c=a.closest("table")[0].config.widgetOptions;c.filter_initialized||(c.filter_formatterInit[b]=1)},filterInitComplete:function(c){var d=c.widgetOptions,e=0,f=function(){d.filter_initialized=!0,c.$table.trigger("filterInit",c),b.filter.findRows(c.table,c.$table.data("lastSearch")||[])};a.isEmptyObject(d.filter_formatter)?f():(a.each(d.filter_formatterInit,function(a,b){1===b&&e++}),clearTimeout(d.filter_initTimer),d.filter_initialized||e!==d.filter_formatterCount?d.filter_initialized||(d.filter_initTimer=setTimeout(function(){f()},500)):f())},setDefaults:function(c,d,e){var f,g,h,i=b.getFilters(c)||[];if(e.filter_saveFilters&&b.storage&&(g=b.storage(c,"tablesorter-filters")||[],f=a.isArray(g),f&&""===g.join("")||!f||(i=g)),""===i.join(""))for(h=0;h';for(g=0;m>g;g++)o+=n?"":"";for(d.$filters=a(o+="").appendTo(d.$table.children("thead").eq(0)).find("td"),g=0;m>g;g++)j=!1,h=d.$headers.filter('[data-column="'+g+'"]:last'),l=b.getColumnData(c,e.filter_functions,g),i=e.filter_functions&&l&&"function"!=typeof l||h.hasClass("filter-select"),f=b.getColumnData(c,d.headers,g),j="false"===b.getData(h[0],f,"filter")||"false"===b.getData(h[0],f,"parser"),i?o=a("').appendTo(d.$filters.eq(g)),o&&o.attr("placeholder",h.data("placeholder")||h.attr("data-placeholder")||e.filter_placeholder.search||"")),o&&(k=(a.isArray(e.filter_cssFilter)?"undefined"!=typeof e.filter_cssFilter[g]?e.filter_cssFilter[g]||"":"":e.filter_cssFilter)||"",o.addClass(b.css.filter+" "+k).attr("data-column",g),j&&(o.attr("placeholder","").addClass("disabled")[0].disabled=!0))},bindSearch:function(c,d,e){if(c=a(c)[0],d=a(d),d.length){var f=c.config,g=f.widgetOptions,h=g.filter_$externalFilters;e!==!0&&(g.filter_$anyMatch=d.filter(g.filter_anyColumnSelector+","+g.filter_multipleColumnSelector),g.filter_$externalFilters=h&&h.length?g.filter_$externalFilters.add(d):d,b.setFilters(c,f.$table.data("lastSearch")||[],e===!1)),d.attr("data-lastSearchTime",(new Date).getTime()).unbind(a.trim("keypress keyup search change ".split(" ").join(f.namespace+"filter "))).bind("keyup"+f.namespace+"filter",function(d){if(a(this).attr("data-lastSearchTime",(new Date).getTime()),27===d.which)this.value="";else{if(g.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof g.filter_liveSearch&&this.value.length=37&&d.which<=40)))return}b.filter.searching(c,!0,!0)}).bind(a.trim("search change keypress ".split(" ").join(f.namespace+"filter ")),function(d){var e=a(this).data("column");(13===d.which||"search"===d.type||"change"===d.type&&this.value!==f.lastSearch[e])&&(d.preventDefault(),a(this).attr("data-lastSearchTime",(new Date).getTime()),b.filter.searching(c,!1,!0))})}},searching:function(a,c,d){var e=a.config.widgetOptions;clearTimeout(e.searchTimer),"undefined"==typeof c||c===!0?e.searchTimer=setTimeout(function(){b.filter.checkFilters(a,c,d)},e.filter_liveSearch?e.filter_searchDelay:10):b.filter.checkFilters(a,c,d)},checkFilters:function(c,d,e){var f=c.config,g=f.widgetOptions,h=a.isArray(d),i=h?d:b.getFilters(c,!0),j=(i||[]).join("");return a.isEmptyObject(f.cache)?void(f.delayInit&&f.pager&&f.pager.initialized&&f.$table.trigger("updateCache",[function(){b.filter.checkFilters(c,!1,e)}])):(h&&(b.setFilters(c,i,!1,e!==!0),g.filter_initialized||(f.lastCombinedFilter="")),g.filter_hideFilters&&f.$table.find("."+b.css.filterRow).trigger(""===j?"mouseleave":"mouseenter"),f.lastCombinedFilter!==j||d===!1?(d===!1&&(f.lastCombinedFilter=null,f.lastSearch=[]),g.filter_initialized&&f.$table.trigger("filterStart",[i]),f.showProcessing?void setTimeout(function(){return b.filter.findRows(c,i,j),!1},30):(b.filter.findRows(c,i,j),!1)):void 0)},hideFilters:function(c,d){var e,f,g;a(c).find("."+b.css.filterRow).addClass("hideme").bind("mouseenter mouseleave",function(b){var c=b;e=a(this),clearTimeout(g),g=setTimeout(function(){/enter|over/.test(c.type)?e.removeClass("hideme"):a(document.activeElement).closest("tr")[0]!==e[0]&&""===d.lastCombinedFilter&&e.addClass("hideme")},200)}).find("input, select").bind("focus blur",function(c){f=a(this).closest("tr"),clearTimeout(g);var e=c;g=setTimeout(function(){""===b.getFilters(d.$table).join("")&&f["focus"===e.type?"removeClass":"addClass"]("hideme")},200)})},defaultFilter:function(c,d){if(""===c)return c;var e=b.filter.regex.iQuery,f=d.match(b.filter.regex.igQuery).length,g=f>1?a.trim(c).split(/\s/):[a.trim(c)],h=g.length-1,i=0,j=d;for(1>h&&f>1&&(g[1]=g[0]);e.test(j);)j=j.replace(e,g[i++]||""),e.test(j)&&h>i&&""!==(g[i]||"")&&(j=d.replace(e,j));return j},getLatestSearch:function(b){return b.sort(function(b,c){return a(c).attr("data-lastSearchTime")-a(b).attr("data-lastSearchTime")})},multipleColumns:function(c,d){var e,f,g,h=c.widgetOptions,i=h.filter_initialized||!d.filter(h.filter_anyColumnSelector).length,j=[],k=a.trim(b.filter.getLatestSearch(d).attr("data-column"));if(i&&/-/.test(k)&&(e=k.match(/(\d+)\s*-\s*(\d+)/g),a.each(e,function(a,b){var d,e=b.split(/\s*-\s*/),f=parseInt(e[0],10)||0,g=parseInt(e[1],10)||c.columns-1;for(f>g&&(d=f,f=g,g=d),g>=c.columns&&(g=c.columns-1);g>=f;f++)j.push(f);k=k.replace(b,"")})),i&&/,/.test(k)&&(f=k.split(/\s*,\s*/),a.each(f,function(a,b){""!==b&&(g=parseInt(b,10),gv;v++)u=d[v]||"",x||(v=m),x=!(!x||!o.length||0!==u.indexOf(o[v]||"")||C.alreadyFiltered.test(u)||/[=\"\|!]/.test(u)||/(>=?\s*-\d)/.test(u)||/(<=?\s*\d)/.test(u)||""!==u&&D.$filters&&D.$filters.eq(v).find("select").length&&!D.$headers.filter('[data-column="'+v+'"]:last').hasClass("filter-match"));for(w=g.not("."+E.filter_filteredRow).length,x&&0===w&&(x=!1),D.debug&&b.log("Searching through "+(x&&f>w?w:"all")+" rows"),(E.filter_$anyMatch&&E.filter_$anyMatch.length||d[D.columns])&&(G.anyMatchFlag=!0,G.anyMatchFilter=E.filter_$anyMatch&&b.filter.getLatestSearch(E.filter_$anyMatch).val()||d[D.columns]||"",D.sortLocaleCompare&&(G.anyMatchFilter=b.replaceAccents(G.anyMatchFilter)),E.filter_defaultFilter&&C.iQuery.test(b.getColumnData(c,E.filter_defaultFilter,D.columns,!0)||"")&&(G.anyMatchFilter=b.filter.defaultFilter(G.anyMatchFilter,b.getColumnData(c,E.filter_defaultFilter,D.columns,!0)),x=!1),G.iAnyMatchFilter=E.filter_ignoreCase&&D.ignoreCase?G.anyMatchFilter.toLocaleLowerCase():G.anyMatchFilter),h=0;f>h;h++)if(G.cacheArray=D.cache[i].normalized[h],n=g[h].className,!(C.child.test(n)||x&&C.filtered.test(n))){if(s=!0,n=g.eq(h).nextUntil("tr:not(."+D.cssChildRow+")"),G.childRowText=n.length&&E.filter_childRows?n.text():"",G.childRowText=E.filter_ignoreCase?G.childRowText.toLocaleLowerCase():G.childRowText,k=g.eq(h).children(),G.anyMatchFlag){if(m=b.filter.multipleColumns(D,E.filter_$anyMatch),G.anyMatch=!0,G.rowArray=k.map(function(c){if(a.inArray(c,m)>-1){var d;return G.parsed[c]?d=G.cacheArray[c]:(d=this?this.getAttribute(D.textAttribute)||this.textContent||a(this).text():"",d=a.trim(E.filter_ignoreCase?d.toLowerCase():d),D.sortLocaleCompare&&(d=b.replaceAccents(d))),d}}).get(),G.filter=G.anyMatchFilter,G.iFilter=G.iAnyMatchFilter,G.exact=G.rowArray.join(" "),G.iExact=E.filter_ignoreCase?G.exact.toLowerCase():G.exact,G.cache=G.cacheArray.slice(0,-1).join(" "),y=null,a.each(b.filter.types,function(b,c){return a.inArray(b,H)<0&&(q=c(D,G),null!==q)?(y=q,!1):void 0}),null!==y)s=y;else if(E.filter_startsWith)for(s=!1,m=D.columns;!s&&m>0;)m--,s=s||0===G.rowArray[m].indexOf(G.iFilter);else s=(G.iExact+G.childRowText).indexOf(G.iFilter)>=0;G.anyMatch=!1}for(m=0;m=0:G.filter===G.exact:"function"==typeof A?r=A(G.exact,G.cache,G.filter,m,g.eq(h)):"function"==typeof A[B||G.filter]&&(r=A[B||G.filter](G.exact,G.cache,G.filter,m,g.eq(h))):(y=null,a.each(b.filter.types,function(b,c){return a.inArray(b,z)<0&&(q=c(D,G),null!==q)?(y=q,!1):void 0}),null!==y?r=y:(G.exact=(G.iExact+G.childRowText).indexOf(b.filter.parseFilter(D,G.iFilter,m,G.parsed[m])),r=!E.filter_startsWith&&G.exact>=0||E.filter_startsWith&&0===G.exact)),s=r?s:!1);g.eq(h).toggle(s).toggleClass(E.filter_filteredRow,!s),n.length&&n.toggleClass(E.filter_filteredRow,!s)}}D.filteredRows+=g.not("."+E.filter_filteredRow).length,D.totalRows+=g.length,b.processTbody(c,j,!1)}D.lastCombinedFilter=e,D.lastSearch=d,D.$table.data("lastSearch",d),E.filter_saveFilters&&b.storage&&b.storage(c,"tablesorter-filters",d),D.debug&&b.benchmark("Completed filter widget search",t),E.filter_initialized&&D.$table.trigger("filterEnd",D),setTimeout(function(){D.$table.trigger("applyWidgets")},0)}},getOptionSource:function(c,d,e){c=a(c)[0];var f,g=c.config,h=g.widgetOptions,i=[],j=!1,k=h.filter_selectSource,l=g.$table.data("lastSearch")||[],m=a.isFunction(k)?!0:b.getColumnData(c,k,d);if(e&&""!==l[d]&&(e=!1),m===!0)j=k(c,d,e);else{if(m instanceof a||"string"===a.type(m)&&m.indexOf("")>=0)return m;a.isArray(m)?j=m:"object"===a.type(k)&&m&&(j=m(c,d,e))}return j===!1&&(j=b.filter.getOptions(c,d,e)),j=a.grep(j,function(b,c){return a.inArray(b,j)===c}),g.$headers.filter('[data-column="'+d+'"]:last').hasClass("filter-select-nosort")?j:(a.each(j,function(a,b){i.push({t:b,p:g.parsers&&g.parsers[d].format(b,c,[],d)})}),f=g.textSorter||"",i.sort(function(e,g){var h=e.p.toString(),i=g.p.toString();return a.isFunction(f)?f(h,i,!0,d,c):"object"==typeof f&&f.hasOwnProperty(d)?f[d](h,i,!0,d,c):b.sortNatural?b.sortNatural(h,i):!0}),j=[],a.each(i,function(a,b){j.push(b.t)}),j)},getOptions:function(b,c,d){b=a(b)[0];var e,f,g,h,i,j,k=b.config,l=k.widgetOptions,m=k.$table.children("tbody"),n=[];for(f=0;fe;e++)h=i.row?i.row[e]:i.normalized[e][k.columns].$row[0],d&&h.className.match(l.filter_filteredRow)||(l.filter_useParsedData||k.parsers[c].parsed||k.$headers.filter('[data-column="'+c+'"]:last').hasClass("filter-parsed")?n.push(""+i.normalized[e][c]):(j=h.cells[c],j&&n.push(a.trim(j.getAttribute(k.textAttribute)||j.textContent||a(j).text()))));return n},buildSelect:function(c,d,e,f,g){if(c=a(c)[0],d=parseInt(d,10),c.config.cache&&!a.isEmptyObject(c.config.cache)){var h,i,j,k,l,m,n=c.config,o=n.widgetOptions,p=n.$headers.filter('[data-column="'+d+'"]:last'),q='",r=n.$table.find("thead").find("select."+b.css.filter+'[data-column="'+d+'"]').val();if(("undefined"==typeof e||""===e)&&(e=b.filter.getOptionSource(c,d,g)),a.isArray(e)){for(h=0;h=0&&(k=j.split(o.filter_selectSourceSeparator),i=k[0],j=k[1]),q+=""!==e[h]?"":"";e=[]}l=(n.$filters?n.$filters:n.$table.children("thead")).find("."+b.css.filter),o.filter_$externalFilters&&(l=l&&l.length?l.add(o.filter_$externalFilters):o.filter_$externalFilters),m=l.filter('select[data-column="'+d+'"]'),m.length&&(m[f?"html":"append"](q),a.isArray(e)||m.append(e).val(r),m.val(r))}},buildDefault:function(a,c){var d,e,f,g=a.config,h=g.widgetOptions,i=g.columns;for(d=0;i>d;d++)e=g.$headers.filter('[data-column="'+d+'"]:last'),f=!(e.hasClass("filter-false")||e.hasClass("parser-false")),(e.hasClass("filter-select")||b.getColumnData(a,h.filter_functions,d)===!0)&&f&&b.filter.buildSelect(a,d,"",c,e.hasClass(h.filter_onlyAvail))}},b.getFilters=function(c,d,e,f){var g,h,i,j,k=!1,l=c?a(c)[0].config:"",m=l?l.widgetOptions:"";if(d!==!0&&m&&!m.filter_columnFilters)return a(c).data("lastSearch");if(l&&(l.$filters&&(h=l.$filters.find("."+b.css.filter)),m.filter_$externalFilters&&(h=h&&h.length?h.add(m.filter_$externalFilters):m.filter_$externalFilters),h&&h.length))for(k=e||[],g=0;g=0&&!e.$table.hasClass("hasFilters"))){var g,h=e.$table,i=a(f.stickyHeaders_attachTo),j=e.namespace+"stickyheaders ",k=a(f.stickyHeaders_yScroll||f.stickyHeaders_attachTo||b),l=a(f.stickyHeaders_xScroll||f.stickyHeaders_attachTo||b),m=h.children("thead:first"),n=m.children("tr").not(".sticky-false").children(),o=h.children("tfoot"),p=isNaN(f.stickyHeaders_offset)?a(f.stickyHeaders_offset):"",q=i.length?0:p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,r=h.parent().closest("."+c.css.table).hasClass("hasStickyHeaders")?h.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],s=r.length?r.height():0,t=f.$sticky=h.clone().addClass("containsStickyHeaders "+c.css.sticky+" "+f.stickyHeaders).wrap('
    '),u=t.parent().css({position:i.length?"absolute":"fixed",padding:parseInt(t.parent().parent().css("padding-left"),10),top:q+s,left:0,visibility:"hidden",zIndex:f.stickyHeaders_zIndex||2}),v=t.children("thead:first"),w="",x=0,y=function(c,d){c.filter(":visible").each(function(c){var e,f,g=d.filter(":visible").eq(c),h=a(this); +"border-box"===h.css("box-sizing")?e=h.outerWidth():"collapse"===g.css("border-collapse")?b.getComputedStyle?e=parseFloat(b.getComputedStyle(this,null).width):(f=parseFloat(h.css("border-width")),e=h.outerWidth()-parseFloat(h.css("padding-left"))-parseFloat(h.css("padding-right"))-f):e=h.width(),g.css({"min-width":e,"max-width":e})})},z=function(){q=p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,x=0,u.css({left:i.length?parseInt(i.css("padding-left"),10)||0:h.offset().left-parseInt(h.css("margin-left"),10)-l.scrollLeft()-x,width:h.outerWidth()}),y(h,t),y(n,g)};e.$extraTables&&e.$extraTables.length?e.$extraTables.add(t):e.$extraTables=t,t.attr("id")&&(t[0].id+=f.stickyHeaders_cloneId),t.find("thead:gt(0), tr.sticky-false").hide(),t.find("tbody, tfoot").remove(),t.find("caption").toggle(f.stickyHeaders_includeCaption),g=v.children().children(),t.css({height:0,width:0,margin:0}),g.find("."+c.css.resizer).remove(),h.addClass("hasStickyHeaders").bind(a.trim("pagerComplete"+j),function(){z()}),c.bindEvents(d,v.children().children(".tablesorter-header")),h.after(u),e.onRenderHeader&&v.children("tr").children().each(function(b){e.onRenderHeader.apply(a(this),[b,e,t])}),l.add(k).unbind(a.trim("scroll resize ".split(" ").join(j))).bind(a.trim("scroll resize ".split(" ").join(j)),function(b){if(h.is(":visible")){s=r.length?r.offset().top-k.scrollTop()+r.height():0;var c="tablesorter-sticky-",d=h.offset(),e=a.isWindow(k[0]),f=a.isWindow(l[0]),g=(i.length?e?k.scrollTop():k.offset().top:k.scrollTop())+q+s,j=h.height()-(u.height()+(o.height()||0)),m=g>d.top&&g=0&&e.$filters&&e.$filters.eq(g).find("a, select, input").filter(":visible").focus())}),c.filter.bindSearch(h,g.find("."+c.css.filter)),f.filter_hideFilters&&c.filter.hideFilters(t,e)),h.trigger("stickyHeadersInit")}},remove:function(d,e,f){var g=e.namespace+"stickyheaders ";e.$table.removeClass("hasStickyHeaders").unbind(a.trim("pagerComplete filterEnd ".split(" ").join(g))).next("."+c.css.stickyWrap).remove(),f.$sticky&&f.$sticky.length&&f.$sticky.remove(),a(b).add(f.stickyHeaders_xScroll).add(f.stickyHeaders_yScroll).add(f.stickyHeaders_attachTo).unbind(a.trim("scroll resize ".split(" ").join(g))),c.addHeaderResizeEvent(d,!1)}})}(jQuery,window),function(a,b){"use strict";var c=a.tablesorter=a.tablesorter||{};a.extend(c.css,{resizer:"tablesorter-resizer"}),c.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1,resizable_widths:[],resizable_throttle:!1},format:function(d,e,f){if(!e.$table.hasClass("hasResizable")){e.$table.addClass("hasResizable"),c.resizableReset(d,!0);var g,h,i,j,k,l={},m=e.$table,n=m.parent(),o="auto"===m.parent().css("overflow"),p=0,q=null,r=null,s=Math.abs(m.parent().width()-m.width())<20,t=function(a){if(0!==p&&q){var b=a.pageX-p,c=q.width();q.width(c+b),q.width()!==c&&s?r.width(r.width()-b):o&&(m.width(function(a,c){return c+b}),r.length||(n[0].scrollLeft=m.width())),p=a.pageX}},u=function(){c.storage&&q&&r&&(l={},l[q.index()]=q.width(),l[r.index()]=r.width(),q.width(l[q.index()]),r.width(l[r.index()]),f.resizable!==!1&&c.storage(d,"tablesorter-resizable",e.$headers.map(function(){return a(this).width()}).get())),p=0,q=r=null,a(b).trigger("resize")};if(l=c.storage&&f.resizable!==!1?c.storage(d,"tablesorter-resizable"):{})for(j in l)!isNaN(j)&&j
    '),f.resizable_addLastColumn||(i=i.slice(0,-1)),h=h?h.add(i):i}),h.each(function(){var b=a(this),d=parseInt(b.css("padding-right"),10)+10;b.find("."+c.css.wrapper).append('
    ')}).find("."+c.css.resizer).bind("mousedown",function(b){q=a(b.target).closest("th");var c=e.$headers.filter('[data-column="'+q.attr("data-column")+'"]');c.length>1&&(q=q.add(c)),r=b.shiftKey?q.parent().find("th").not(".resizable-false").filter(":last"):q.nextAll(":not(.resizable-false)").eq(0),p=b.pageX}),a(document).bind("mousemove.tsresize",function(a){0!==p&&q&&(f.resizable_throttle?(clearTimeout(k),k=setTimeout(function(){t(a)},isNaN(f.resizable_throttle)?5:f.resizable_throttle)):t(a))}).bind("mouseup.tsresize",function(){u()}),m.find("thead:first").bind("contextmenu.tsresize",function(){c.resizableReset(d);var b=a.isEmptyObject?a.isEmptyObject(l):!0;return l={},b})}},remove:function(a,b){b.$table.removeClass("hasResizable").children("thead").unbind("mouseup.tsresize mouseleave.tsresize contextmenu.tsresize").children("tr").children().unbind("mousemove.tsresize mouseup.tsresize").find("."+c.css.resizer).remove(),c.resizableReset(a)}}),c.resizableReset=function(b,d){a(b).each(function(){var e,f=this.config,g=f&&f.widgetOptions;b&&f&&(f.$headers.each(function(b){e=a(this),g.resizable_widths&&g.resizable_widths[b]?e.css("width",g.resizable_widths[b]):e.hasClass("resizable-false")||e.css("width","")}),c.storage&&!d&&c.storage(this,"tablesorter-resizable",{}))})}}(jQuery,window),function(a){"use strict";var b=a.tablesorter=a.tablesorter||{};b.addWidget({id:"saveSort",priority:20,options:{saveSort:!0},init:function(a,b,c,d){b.format(a,c,d,!0)},format:function(c,d,e,f){var g,h,i=d.$table,j=e.saveSort!==!1,k={sortList:d.sortList};d.debug&&(h=new Date),i.hasClass("hasSaveSort")?j&&c.hasInitialized&&b.storage&&(b.storage(c,"tablesorter-savesort",k),d.debug&&b.benchmark("saveSort widget: Saving last sort: "+d.sortList,h)):(i.addClass("hasSaveSort"),k="",b.storage&&(g=b.storage(c,"tablesorter-savesort"),k=g&&g.hasOwnProperty("sortList")&&a.isArray(g.sortList)?g.sortList:"",d.debug&&b.benchmark('saveSort: Last sort loaded: "'+k+'"',h),i.bind("saveSortReset",function(a){a.stopPropagation(),b.storage(c,"tablesorter-savesort","")})),f&&k&&k.length>0?d.sortList=k:c.hasInitialized&&k&&k.length>0&&i.trigger("sorton",[k]))},remove:function(a,c){c.$table.removeClass("hasSaveSort"),b.storage&&b.storage(a,"tablesorter-savesort","")}})}(jQuery); \ No newline at end of file diff --git a/dist/js/parsers/parser-date-extract.min.js b/dist/js/parsers/parser-date-extract.min.js new file mode 100644 index 00000000..8762b75b --- /dev/null +++ b/dist/js/parsers/parser-date-extract.min.js @@ -0,0 +1,18 @@ +/*! + * Extract out date parsers + * 10/26/2014 (v2.18.0) + */ +!function(a){"use strict";var b={usLong:/[A-Z]{3,10}\.?\s+\d{1,2},?\s+(?:\d{4})(?:\s+\d{1,2}:\d{2}(?::\d{2})?(?:\s+[AP]M)?)?/i,mdy:/(\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4}(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?)/i,dmy:/(\d{1,2}[\/\s]\d{1,2}[\/\s]\d{4}(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?)/i,dmyreplace:/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{4})/,ymd:/(\d{4}[\/\s]\d{1,2}[\/\s]\d{1,2}(\s+\d{1,2}:\d{2}(:\d{2})?(\s+[AP]M)?)?)/i,ymdreplace:/(\d{4})[\/\s](\d{1,2})[\/\s](\d{1,2})/};/*! extract US Long Date (ignore any other text) + * e.g. "Sue's Birthday! Jun 26, 2004 7:22 AM (8# 2oz)" + * demo: http://jsfiddle.net/Mottie/abkNM/4165/ + */ +a.tablesorter.addParser({id:"extractUSLongDate",is:function(){return!1},format:function(a){var c,d=a?a.match(b.usLong):a;return d?(c=new Date(d[0]),c instanceof Date&&isFinite(c)?c.getTime():a):a},type:"numeric"}),/*! extract MMDDYYYY (ignore any other text) + * demo: http://jsfiddle.net/Mottie/abkNM/4166/ + */ +a.tablesorter.addParser({id:"extractMMDDYYYY",is:function(){return!1},format:function(a){var c,d=a?a.replace(/\s+/g," ").replace(/[\-.,]/g,"/").match(b.mdy):a;return d?(c=new Date(d[0]),c instanceof Date&&isFinite(c)?c.getTime():a):a},type:"numeric"}),/*! extract DDMMYYYY (ignore any other text) + * demo: http://jsfiddle.net/Mottie/abkNM/4167/ + */ +a.tablesorter.addParser({id:"extractDDMMYYYY",is:function(){return!1},format:function(a){var c,d=a?a.replace(/\s+/g," ").replace(/[\-.,]/g,"/").match(b.dmy):a;return d?(c=new Date(d[0].replace(b.dmyreplace,"$2/$1/$3")),c instanceof Date&&isFinite(c)?c.getTime():a):a},type:"numeric"}),/*! extract YYYYMMDD (ignore any other text) + * demo: http://jsfiddle.net/Mottie/abkNM/4168/ + */ +a.tablesorter.addParser({id:"extractYYYYMMDD",is:function(){return!1},format:function(a){var c,d=a?a.replace(/\s+/g," ").replace(/[\-.,]/g,"/").match(b.ymd):a;return d?(c=new Date(d[0].replace(b.ymdreplace,"$2/$3/$1")),c instanceof Date&&isFinite(c)?c.getTime():a):a},type:"numeric"})}(jQuery); \ No newline at end of file diff --git a/dist/js/parsers/parser-date-iso8601.min.js b/dist/js/parsers/parser-date-iso8601.min.js new file mode 100644 index 00000000..eba634e6 --- /dev/null +++ b/dist/js/parsers/parser-date-iso8601.min.js @@ -0,0 +1,7 @@ +/*! ISO-8601 date parser - 10/26/2014 (v2.18.0) + * This parser will work with dates in ISO8601 format + * 2013-02-18T18:18:44+00:00 + * Written by Sean Ellingham :https://github.com/seanellingham + * See https://github.com/Mottie/tablesorter/issues/247 + */ +!function(a){"use strict";var b=/^([0-9]{4})(-([0-9]{2})(-([0-9]{2})(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?$/;a.tablesorter.addParser({id:"iso8601date",is:function(a){return a?a.match(b):!1},format:function(a){var c=a?a.match(b):a;if(c){var d=new Date(c[1],0,1);return c[3]&&d.setMonth(c[3]-1),c[5]&&d.setDate(c[5]),c[7]&&d.setHours(c[7]),c[8]&&d.setMinutes(c[8]),c[10]&&d.setSeconds(c[10]),c[12]&&d.setMilliseconds(1e3*Number("0."+c[12])),d.getTime()}return a},type:"numeric"})}(jQuery); \ No newline at end of file diff --git a/dist/js/parsers/parser-date-month.min.js b/dist/js/parsers/parser-date-month.min.js new file mode 100644 index 00000000..30c08edc --- /dev/null +++ b/dist/js/parsers/parser-date-month.min.js @@ -0,0 +1,4 @@ +/*! Month parser - 10/26/2014 (v2.18.0) + * Demo: http://jsfiddle.net/Mottie/abkNM/4169/ + */ +!function(a){"use strict";var b=a.tablesorter;b.dates=a.extend({},b.dates,{monthCased:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}),b.dates.monthLower=b.dates.monthCased.join(",").toLocaleLowerCase().split(","),b.addParser({id:"month",is:function(){return!1},format:function(c,d){if(c){var e=-1,f=d.config,g=f.ignoreCase?c.toLocaleLowerCase():c;return a.each(b.dates["month"+(f.ignoreCase?"Lower":"Cased")],function(a,b){return 0>e&&g.match(b)?(e=a,!1):void 0}),0>e?c:e}return c},type:"numeric"})}(jQuery); \ No newline at end of file diff --git a/dist/js/parsers/parser-date-two-digit-year.min.js b/dist/js/parsers/parser-date-two-digit-year.min.js new file mode 100644 index 00000000..94ed8a38 --- /dev/null +++ b/dist/js/parsers/parser-date-two-digit-year.min.js @@ -0,0 +1,4 @@ +/*! Two digit year parser - 10/26/2014 (v2.18.0) + * Demo: http://mottie.github.io/tablesorter/docs/example-parsers-dates.html + */ +!function(a){"use strict";var b=50,c=a.tablesorter,d=(new Date).getFullYear();c.dates=a.extend({},c.dates,{regxxxxyy:/(\d{1,2})[\/\s](\d{1,2})[\/\s](\d{2})/,regyyxxxx:/(\d{2})[\/\s](\d{1,2})[\/\s](\d{1,2})/}),c.formatDate=function(a,c,e,f){if(a){var g,h,i=a.replace(/\s+/g," ").replace(/[-.,]/g,"/").replace(c,e),j=new Date(i);if(j instanceof Date&&isFinite(j)){for(g=j.getFullYear(),h=f&&f.config.dateRange||b;d-g>h;)g+=100;return j.setFullYear(g)}}return a},a.tablesorter.addParser({id:"ddmmyy",is:function(){return!1},format:function(a,b){return c.formatDate(a,c.dates.regxxxxyy,"$2/$1/19$3",b)},type:"numeric"}),a.tablesorter.addParser({id:"mmddyy",is:function(){return!1},format:function(a,b){return c.formatDate(a,c.dates.regxxxxyy,"$1/$2/19$3",b)},type:"numeric"}),a.tablesorter.addParser({id:"yymmdd",is:function(){return!1},format:function(a,b){return c.formatDate(a,c.dates.regyyxxxx,"$2/$3/19$1",b)},type:"numeric"})}(jQuery); \ No newline at end of file diff --git a/dist/js/parsers/parser-date-weekday.min.js b/dist/js/parsers/parser-date-weekday.min.js new file mode 100644 index 00000000..f0abe037 --- /dev/null +++ b/dist/js/parsers/parser-date-weekday.min.js @@ -0,0 +1,4 @@ +/*! Weekday parser - 10/26/2014 (v2.18.0) + * Demo: http://jsfiddle.net/Mottie/abkNM/4169/ + */ +!function(a){"use strict";var b=a.tablesorter;b.dates=a.extend({},b.dates,{weekdayCased:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]}),b.dates.weekdayLower=b.dates.weekdayCased.join(",").toLocaleLowerCase().split(","),b.addParser({id:"weekday",is:function(){return!1},format:function(c,d){if(c){var e=-1,f=d.config;return c=f.ignoreCase?c.toLocaleLowerCase():c,a.each(b.dates["weekday"+(f.ignoreCase?"Lower":"Cased")],function(a,b){return 0>e&&c.match(b)?(e=a,!1):void 0}),0>e?c:e}return c},type:"numeric"})}(jQuery); \ No newline at end of file diff --git a/dist/js/parsers/parser-date.min.js b/dist/js/parsers/parser-date.min.js new file mode 100644 index 00000000..14a14f90 --- /dev/null +++ b/dist/js/parsers/parser-date.min.js @@ -0,0 +1,11 @@ +/*! + * Extract dates using popular natural language date parsers + * 10/26/2014 (v2.18.0) + */ +!function(a){"use strict";/*! Sugar (http://sugarjs.com/dates#comparing_dates) + * demo: http://jsfiddle.net/Mottie/abkNM/4163/ + */ +a.tablesorter.addParser({id:"sugar",is:function(){return!1},format:function(a){var b=Date.create?Date.create(a):a?new Date(a):a;return b instanceof Date&&isFinite(b)?b.getTime():a},type:"numeric"}),/*! Datejs (http://www.datejs.com/) + * demo: http://jsfiddle.net/Mottie/abkNM/4164/ + */ +a.tablesorter.addParser({id:"datejs",is:function(){return!1},format:function(a){var b=Date.parse?Date.parse(a):a?new Date(a):a;return b instanceof Date&&isFinite(b)?b.getTime():a},type:"numeric"})}(jQuery); \ No newline at end of file diff --git a/dist/js/parsers/parser-duration.min.js b/dist/js/parsers/parser-duration.min.js new file mode 100644 index 00000000..d80c11c5 --- /dev/null +++ b/dist/js/parsers/parser-duration.min.js @@ -0,0 +1,3 @@ +/*! Duration parser */ +!function(a){"use strict";a.tablesorter.addParser({id:"duration",is:function(){return!1},format:function(a,b){var c,d,e=b.config,f="",g="",h=e.durationLength||4,i=new Array(h+1).join("0"),j=(e.durationLabels||"(?:years|year|y),(?:days|day|d),(?:hours|hour|h),(?:minutes|minute|min|m),(?:seconds|second|sec|s)").split(/\s*,\s*/),k=j.length;if(!e.durationRegex){for(c=0;k>c;c++)f+="(?:(\\d+)\\s*"+j[c]+"\\s*)?";e.durationRegex=new RegExp(f,"i")}for(d=(e.usNumberFormat?a.replace(/,/g,""):a.replace(/(\d)(?:\.|\s*)(\d)/g,"$1$2")).match(e.durationRegex),c=1;k+1>c;c++)g+=(i+(d[c]||0)).slice(-h);return g},type:"text"}),/*! Countdown parser ( hh:mm:ss ) */ +a.tablesorter.addParser({id:"countdown",is:function(){return!1},format:function(a,b){for(var c=b.config.durationLength||4,d=new Array(c+1).join("0"),e=a.split(/\s*:\s*/),f=e.length,g=[];f;)g.push((d+(e[--f]||0)).slice(-c));return g.length?g.reverse().join(""):a},type:"text"})}(jQuery); \ No newline at end of file diff --git a/dist/js/parsers/parser-feet-inch-fraction.min.js b/dist/js/parsers/parser-feet-inch-fraction.min.js new file mode 100644 index 00000000..93984a30 --- /dev/null +++ b/dist/js/parsers/parser-feet-inch-fraction.min.js @@ -0,0 +1,6 @@ +/*! Distance parser +* This parser will parser numbers like 5'10" (5 foot 10 inches) +* and 31½ into sortable values. +* Demo: http://jsfiddle.net/Mottie/abkNM/154/ +*/ +!function(a){"use strict";var b=a.tablesorter;b.symbolRegex=/[\u215b\u215c\u215d\u215e\u00bc\u00bd\u00be]/g,b.processFractions=function(c,d){if(c){var e,f=0;c=a.trim(c.replace(/\"/,"")),/\s/.test(c)&&(f=b.formatFloat(c.split(" ")[0],d),c=a.trim(c.substring(c.indexOf(" "),c.length))),/\//g.test(c)?(e=c.split("/"),c=f+parseInt(e[0],10)/parseInt(e[1]||1,10)):b.symbolRegex.test(c)&&(c=f+c.replace(b.symbolRegex,function(a){return{"⅛":".125","⅜":".375","⅝":".625","⅞":".875","¼":".25","½":".5","¾":".75"}[a]}))}return c||0},a.tablesorter.addParser({id:"distance",is:function(){return!1},format:function(a,c){if(""===a)return"";var d=/^\s*\S*(\s+\S+)?\s*\'/.test(a)?a.split("'"):[0,a],e=b.processFractions(d[0],c),f=b.processFractions(d[1],c);return/[\'\"]/.test(a)?parseFloat(e)+(parseFloat(f)/12||0):parseFloat(e)+parseFloat(f)},type:"numeric"})}(jQuery); \ No newline at end of file diff --git a/dist/js/parsers/parser-file-type.min.js b/dist/js/parsers/parser-file-type.min.js new file mode 100644 index 00000000..28d1ee0a --- /dev/null +++ b/dist/js/parsers/parser-file-type.min.js @@ -0,0 +1,5 @@ +/*! File Type parser + * When a file type extension is found, the equivalent name is + * prefixed into the parsed data, so sorting occurs in groups + */ +!function(a){"use strict";a.tablesorter.fileTypes={separator:"|",equivalents:{"3D Image":"3dm|3ds|dwg|max|obj",Audio:"aif|aac|ape|flac|la|m4a|mid|midi|mp2|mp3|ogg|ra|raw|rm|wav|wma",Compressed:"7z|bin|cab|cbr|gz|gzip|iso|lha|lz|rar|tar|tgz|zip|zipx|zoo",Database:"csv|dat|db|dbf|json|ldb|mdb|myd|pdb|sql|tsv|wdb|wmdb|xlr|xls|xlsx|xml",Development:"asm|c|class|cls|cpp|cc|cs|cxx|cbp|cs|dba|fla|h|java|lua|pl|py|pyc|pyo|sh|sln|r|rb|vb",Document:"doc|docx|odt|ott|pages|pdf|rtf|tex|wpd|wps|wrd|wri",Executable:"apk|app|com|exe|gadget|lnk|msi",Fonts:"eot|fnt|fon|otf|ttf|woff",Icons:"ani|cur|icns|ico",Images:"bmp|gif|jpg|jpeg|jpe|jp2|pic|png|psd|tga|tif|tiff|wmf|webp",Presentation:"pps|ppt",Published:"chp|epub|lit|pub|ppp|fm|mobi",Script:"as|bat|cgi|cmd|jar|js|lua|scpt|scptd|sh|vbs|vb|wsf",Styles:"css|less|sass",Text:"info|log|md|markdown|nfo|tex|text|txt",Vectors:"awg|ai|eps|cdr|ps|svg",Video:"asf|avi|flv|m4v|mkv|mov|mp4|mpe|mpeg|mpg|ogg|rm|rv|swf|vob|wmv",Web:"asp|aspx|cer|cfm|htm|html|php|url|xhtml"}},a.tablesorter.addParser({id:"filetype",is:function(){return!1},format:function(b,c){var d,e=c.config,f=e.widgetOptions,g=b.lastIndexOf("."),h=a.tablesorter.fileTypes.separator,i=a.tablesorter.fileTypes.matching,j=a.tablesorter.fileTypes.equivalents;if(i||(d=[],a.each(j,function(a,b){d.push(b)}),i=a.tablesorter.fileTypes.matching=h+d.join(h)+h),g>=0&&(d=h+b.substring(g+1,b.length)+h,i.indexOf(d)>=0))for(g in j)if((h+j[g]+h).indexOf(d)>=0)return g+(f.group_separator?f.group_separator:"-")+b;return b},type:"text"})}(jQuery); \ No newline at end of file diff --git a/dist/js/parsers/parser-ignore-articles.min.js b/dist/js/parsers/parser-ignore-articles.min.js new file mode 100644 index 00000000..c1f0c225 --- /dev/null +++ b/dist/js/parsers/parser-ignore-articles.min.js @@ -0,0 +1,6 @@ +/*! Title parser - updated 9/15/2014 (v2.17.8) + * This parser will remove "The", "A" and "An" from the beginning of a book + * or movie title, so it sorts by the second word or number + * Demo: http://jsfiddle.net/Mottie/abkNM/5/ + */ +!function(a){"use strict";var b=a.tablesorter;b.ignoreArticles={en:"the, a, an",de:"der, die, das, des, dem, den, ein, eine, einer, eines, einem, einen",nl:"de, het, de, een",es:"el, la, lo, los, las, un, una, unos, unas",pt:"o, a, os, as, um, uma, uns, umas",fr:"le, la, l'_, les, un, une, des",it:"il, lo, la, l'_, i, gli, le, un', uno, una, un",hu:"a, az, egy"},b.addParser({id:"ignoreArticles",is:function(){return!1},format:function(c,d,e,f){var g,h,i,j=d.config,k=c||"";return j.headers&&j.headers[f]&&j.headers[f].ignoreArticlesRegex||(j.headers||(j.headers={}),j.headers[f]||(j.headers[f]={}),i=b.getData(j.$headers.eq(f),b.getColumnData(d,j.headers,f),"ignoreArticles"),g=(b.ignoreArticles[i]||"the, a, an")+"",j.headers[f].ignoreArticlesRegex=new RegExp("^("+a.trim(g.split(/\s*\,\s*/).join("\\s|")+"\\s").replace("_\\s","")+")","i"),h=b.getData(j.$headers.eq(f),b.getColumnData(d,j.headers,f),"ignoreArticlesExcept"),j.headers[f].ignoreArticlesRegex2=""!==h?new RegExp("^("+h.replace(/\s/g,"\\s")+")","i"):""),g=j.headers[f].ignoreArticlesRegex,!g.test(k)||(h=j.headers[f].ignoreArticlesRegex2,h&&h.test(k))?k:k.replace(g,"")},type:"text"})}(jQuery); \ No newline at end of file diff --git a/dist/js/parsers/parser-image.min.js b/dist/js/parsers/parser-image.min.js new file mode 100644 index 00000000..c4f9a4af --- /dev/null +++ b/dist/js/parsers/parser-image.min.js @@ -0,0 +1,4 @@ +/*! image alt attribute parser for jQuery 1.7+ & tablesorter 2.7.11+ + * New 7/17/2014 (v2.17.5) + */ +!function(a){"use strict";a.tablesorter.addParser({id:"image",is:function(){return!1},format:function(b,c,d){return a(d).find("img").attr(c.config.imgAttr||"alt")||b},parsed:!0,type:"text"})}(jQuery); \ No newline at end of file diff --git a/dist/js/parsers/parser-input-select.min.js b/dist/js/parsers/parser-input-select.min.js new file mode 100644 index 00000000..b77bfc48 --- /dev/null +++ b/dist/js/parsers/parser-input-select.min.js @@ -0,0 +1,5 @@ +/*! input & select parsers for jQuery 1.7+ & tablesorter 2.7.11+ + * Updated 2/7/2015 (v2.19.0) + * Demo: http://mottie.github.com/tablesorter/docs/example-widget-grouping.html + */ +!function(a){"use strict";var b=function(){};a.tablesorter.addParser({id:"inputs",is:function(){return!1},format:function(b,c,d){return a(d).find("input").val()||b},parsed:!0,type:"text"}),a.tablesorter.addParser({id:"checkbox",is:function(){return!1},format:function(b,c,d,e){var f=a(d),g=f.find('input[type="checkbox"]'),h=g.length?g[0].checked:"";return f.closest("tr").toggleClass("checked-"+e,h),g.length?h?"checked":"unchecked":b},parsed:!0,type:"text"}),a.tablesorter.addParser({id:"select",is:function(){return!1},format:function(b,c,d){return a(d).find("select").val()||b},parsed:!0,type:"text"}),a.tablesorter.addParser({id:"select-text",is:function(){return!1},format:function(b,c,d){var e=a(d).find("select");return e.length?e.find("option:selected").text()||"":b},parsed:!0,type:"text"}),a.tablesorter.addParser({id:"textarea",is:function(){return!1},format:function(b,c,d){return a(d).find("textarea").val()||b},parsed:!0,type:"text"}),a(function(){a("table").on("tablesorter-initialized",function(){var c=function(b){b&&a(":focus").blur()};a(this).children("tbody").on("mouseleave",function(a){c("TBODY"===a.target.tagName)}).on("focus","select, input, textarea",function(){a(this).data("ts-original-value",this.value)}).on("blur","input, textarea",function(){this.value=a(this).data("ts-original-value")}).on("change keyup","select, input, textarea",function(d){if(27===d.which)return void(this.value=a(this).data("ts-original-value"));if("change"===d.type||"keyup"===d.type&&13===d.which&&("INPUT"===d.target.tagName||"TEXTAREA"===d.target.tagName&&d.altKey)){var e,f=a(d.target),g=f.closest("td"),h=g.closest("table"),i=g[0].cellIndex,j=h[0].config||!1,k=j&&j.$headers&&j.$headers.eq(i);if(!j||k&&k.length&&(k.hasClass("parser-false")||k.hasClass("sorter-false")&&k.hasClass("filter-false")))return c();(f.val()!==f.data("ts-original-value")||"checkbox"===d.target.type)&&(f.data("ts-original-value",f.val()),h.trigger("updateCell",[f.closest("td"),e,function(){b(d,h,f)}]))}})})})}(jQuery); \ No newline at end of file diff --git a/dist/js/parsers/parser-metric.min.js b/dist/js/parsers/parser-metric.min.js new file mode 100644 index 00000000..1b8d3082 --- /dev/null +++ b/dist/js/parsers/parser-metric.min.js @@ -0,0 +1,7 @@ +/*! Metric parser + * Demo: http://jsfiddle.net/Mottie/abkNM/382/ + * Set the metric name in the header (defaults to "m|meter"), e.g. + * HDD Size + * Distance + */ +!function(a){"use strict";var b={"Y|Yotta|yotta":[1e24,Math.pow(1024,8)],"Z|Zetta|zetta":[1e21,Math.pow(1024,7)],"E|Exa|exa":[1e18,Math.pow(1024,6)],"P|Peta|peta":[1e15,Math.pow(1024,5)],"T|Tera|tera":[1e12,Math.pow(1024,4)],"G|Giga|giga":[1e9,Math.pow(1024,3)],"M|Mega|mega":[1e6,Math.pow(1024,2)],"k|Kilo|kilo":[1e3,1024],"h|hecto":[100,100],"da|deka":[10,10],"d|deci":[.1,.1],"c|centi":[.01,.01],"m|milli":[.001,.001],"µ|micro":[1e-6,1e-6],"n|nano":[1e-9,1e-9],"p|pico":[1e-12,1e-12],"f|femto":[1e-15,1e-15],"a|atto":[1e-18,1e-18],"z|zepto":[1e-21,1e-21],"y|yocto":[1e-24,1e-24]},c="(\\d+)(\\s+)?([Zz]etta|[Ee]xa|[Pp]eta|[Tt]era|[Gg]iga|[Mm]ega|kilo|hecto|deka|deci|centi|milli|micro|nano|pico|femto|atto|zepto|yocto)(",d="(\\d+)(\\s+)?(Z|E|P|T|G|M|k|h|da|d|c|m|µ|n|p|f|a|z|y)(";a.tablesorter.addParser({id:"metric",is:function(){return!1},format:function(e,f,g,h){var i,j,k="m|meter",l=a.tablesorter.formatFloat(e.replace(/[^\w,. \-()]/g,""),f),m=f.config.$headers.filter('[data-column="'+h+'"]'),n=m.data("metric");if(n||(j=(m.attr("data-metric-name")||k).split("|"),n=[j[1]||j[0].substring(1),j[0]],n[2]=new RegExp(c+n[0]+"|"+n[1]+")"),n[3]=new RegExp(d+n[1]+")"),m.data("metric",n)),j=e.match(n[2])||e.match(n[3]))for(k in b)if(j[3].match(k))return i=/^[b|bit|byte|o|octet]/.test(j[4])?1:0,l*b[k][i];return l},type:"numeric"})}(jQuery); \ No newline at end of file diff --git a/dist/js/parsers/parser-named-numbers.min.js b/dist/js/parsers/parser-named-numbers.min.js new file mode 100644 index 00000000..e9327229 --- /dev/null +++ b/dist/js/parsers/parser-named-numbers.min.js @@ -0,0 +1,4 @@ +/*! Named Numbers Parser - 10/26/2014 (v2.18.0) + * code modified from http://stackoverflow.com/a/12014376/145346 + */ +!function(a){"use strict";var b,c,d={negative:["negative","minus"],numbers:{zero:0,one:1,two:2,three:3,four:4,five:5,six:6,seven:7,eight:8,nine:9,ten:10,eleven:11,twelve:12,thirteen:13,fourteen:14,fifteen:15,sixteen:16,seventeen:17,eighteen:18,nineteen:19,twenty:20,thirty:30,forty:40,fourty:40,fifty:50,sixty:60,seventy:70,eighty:80,ninety:90},hundred:"hundred",powers:{thousand:1e3,million:1e6,billion:1e9,trillion:1e12,quadrillion:1e15,quintillion:1e18,sextillion:1e21,septillion:1e24,octillion:1e27,nonillion:1e30,decillion:1e33,undecillion:1e36,duodecillion:1e39,tredecillion:1e42,quattuordecillion:1e45,quindecillion:1e48,sexdecillion:1e51,septendecillion:1e54,octodecillion:1e57,novemdecillion:1e60,vigintillion:1e63,unvigintillion:1e66,duovigintillion:1e69,trevigintillion:1e72,quattuorvigintillion:1e75,quinvigintillion:1e78,sexvigintillion:1e81,septenvigintillion:1e84,octovigintillion:1e87,novemvigintillion:1e90,trigintillion:1e93,untrigintillion:1e96,duotrigintillion:1e99,googl:1e100}},e=new RegExp("("+d.negative.join("|")+")"),f=function(e,f){var g=d.numbers.hasOwnProperty(e)?d.numbers[e]:null,h=d.powers.hasOwnProperty(e)?d.powers[e]:null;g||isNaN(e)||(g=a.tablesorter.formatFloat(e||"",f)),null!==g?c+=g:e===d.hundred?c*=100:null!==h&&(b+=c*h,c=0)};a.tablesorter.addParser({id:"namedNumbers",is:function(){return!1},format:function(g,h){b=0,c=0;var i,j=(g||"").split(/[\s-]+/),k=j.length;for(i=0;k>i;i++)f(j[i].toLowerCase(),h);return b=(b+c)*(g.match(e)?-1:1),b||d.numbers.hasOwnProperty(g)?b:a.tablesorter.formatFloat(g||"",h)},type:"numeric"})}(jQuery); \ No newline at end of file diff --git a/dist/js/parsers/parser-network.min.js b/dist/js/parsers/parser-network.min.js new file mode 100644 index 00000000..ece87146 --- /dev/null +++ b/dist/js/parsers/parser-network.min.js @@ -0,0 +1,8 @@ +/*! Network parsers - IPv4, IPv6 and MAC Addresses - 10/26/2014 (v2.18.0) */ +!function(a){"use strict";var b,c,d=a.tablesorter;/*! IPv6 Address parser (WIP) + * IPv6 Address (ffff:0000:0000:0000:0000:0000:0000:0000) + * needs to support short versions like "::8" or "1:2::7:8" + * and "::00:192.168.10.184" (embedded IPv4 address) + * see http://www.intermapper.com/support/tools/IPV6-Validator.aspx + */ +a.extend(d.regex,{},{ipv4Validate:/((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})/,ipv4Extract:/([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/,ipv6Validate:/^\s*((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/i}),d.addParser({id:"ipv6Address",is:function(a){return d.regex.ipv6Validate.test(a)},format:function(a,b){var c,e,f,g,h,i=b?"boolean"==typeof b?b:b&&b.config.ipv6HexFormat||!1:!1,j="",k="",l=8;if(a=a.replace(/\s*/g,""),d.regex.ipv4Validate.test(a)){for(g=a.match(d.regex.ipv4Extract),e="",c=1;cc;c++)j+="0000:";j+=f[1]}for(g=j.split(":"),c=0;l>c;c++)g[c]=i?("0000"+g[c]).slice(-4):("00000"+(parseInt(g[c],16)||0)).slice(-5),k+=c!=l-1?g[c]+":":g[c];return i?k:k.replace(/:/g,"")},type:"numeric"}),c=function(a){return/^\d{1,3}[\.]\d{1,3}[\.]\d{1,3}[\.]\d{1,3}$/.test(a)},b=function(a,b){var c,e=a?a.split("."):"",f="",g=e.length;for(c=0;g>c;c++)f+=("000"+e[c]).slice(-3);return a?d.formatFloat(f,b):a},d.addParser({id:"ipAddress",is:c,format:b,type:"numeric"}),d.addParser({id:"ipv4Address",is:c,format:b,type:"numeric"}),d.addParser({id:"MAC",is:function(a){return d.regex.ipv6Validate.test(a)},format:function(b){var c="",d=b.replace(/[:.-]/g,"").match(/\w{2}/g);return a.each(d,function(a,b){c+=("000"+parseInt(b,16)).slice(-3)}),c},type:"numeric"})}(jQuery); \ No newline at end of file diff --git a/dist/js/parsers/parser-roman.min.js b/dist/js/parsers/parser-roman.min.js new file mode 100644 index 00000000..88d87a6c --- /dev/null +++ b/dist/js/parsers/parser-roman.min.js @@ -0,0 +1,6 @@ +/*! Roman numeral parsers + * code modified from both: + * Steven Levithan @ http://blog.stevenlevithan.com/archives/javascript-roman-numeral-converter + * Jonathan Snook comment @ http://blog.stevenlevithan.com/archives/javascript-roman-numeral-converter#comment-16140 + */ +!function(a){"use strict";var b=/^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/i,c=/\b([MCDLXVI]+\b)/gi,d={I:1,V:5,X:10,L:50,C:100,D:500,M:1e3};a.tablesorter.addParser({id:"roman",is:function(){return!1},format:function(a){var c,e=a.toUpperCase().split(""),f=0;if(!a||!b.test(a))return a;for(;e.length;)c=d[e.shift()],f+=c*(cg;g++){if(s=l.row?l.row[g]:l.normalized[g][c.columns].$row,m=s.find("td").eq(e.column).text().replace(/[ ]/g," "),n=(m.match(e.regex)||[]).length,n>0&&e.alignIndex>0)for(i=Math.min(e.alignIndex,n),h=0,k=0,j=0;h++j?k:j;else k=m.indexOf(e.align);k>=0?(t.push(m.substring(0,k)||""),u.push(m.substring(k,m.length)||"")):(t.push(n>=1&&e.alignIndex>=n?"":m||""),u.push(n>=1&&e.alignIndex>=n?m||"":""))}for(p=a.extend([],t).sort(function(a,b){return b.length-a.length})[0],q=a.extend([],u).sort(function(a,b){return b.length-a.length})[0],e.width=e.width||Math.floor(p.length/(p.length+q.length)*100)+e.adjust,p="min-width:"+e.width+"%",q="min-width:"+(100-e.width)+"%",f=0;fg;g++)r=a(d.alignChar_wrap).length?a(d.alignChar_wrap).html(e.align)[0].outerHTML:e.align,s=l.row?l.row[g]:l.normalized[g][c.columns].$row,j=u[g].slice(e.align.length),s.find("td").eq(e.column).html(''+t[g]+''+(j.length?r+j:"")+"");d.alignChar_initialized=!0}},remove:function(b,c,d){if(!a.isEmptyObject(c.cache)){var e,f,g,h,i,j;for(e=0;ef;f++)i=h.row?h.row[f]:h.normalized[f][c.columns].$row,j=i.find("td").eq(d),j.html(j.text().replace(/\s/g," "))}}},b.addWidget({id:"alignChar",priority:100,options:{alignChar_wrap:"",alignChar_charAttrib:"data-align-char",alignChar_indexAttrib:"data-align-index",alignChar_adjustAttrib:"data-align-adjust"},init:function(a,c,d,e){e.alignChar_initialized=!1,e.alignChar_savedVars=[],b.alignChar.init(a,d,e),d.$table.on("pagerEnd refreshAlign",function(){d.$headers.filter("["+e.alignChar_charAttrib+"]").each(function(){b.alignChar.remove(a,d,this.column)}),b.alignChar.init(a,d,e)})},format:function(a,b,c){c.alignChar_initialized||b.$table.trigger("refreshAlign")},remove:function(a,c,d,e){e||(c.$headers.filter("["+d.alignChar_charAttrib+"]").each(function(){b.alignChar.remove(a,c,this.column)}),d.alignChar_initialized=!1)}})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-build-table.min.js b/dist/js/widgets/widget-build-table.min.js new file mode 100644 index 00000000..3d8fe3e9 --- /dev/null +++ b/dist/js/widgets/widget-build-table.min.js @@ -0,0 +1,4 @@ +/*! Build Table widget for tableSorter v2.16.0; updated 2/7/2015 (v2.19.0) + * by Rob Garrison + */ +!function(a){"use strict";var b=a.tablesorter=a.tablesorter||{},c=b.buildTable=function(d,e){var f="TABLE"===d.tagName?a(d):a("").appendTo(d),g=f[0],h=e.widgetOptions=a.extend(!0,{},c.defaults,e.widgetOptions),i=h.build_processing,j=h.build_type,k=h.build_source||e.data,l=function(b){var d=a.type(b),f=b instanceof jQuery;if("function"==typeof i&&(b=i(b,h)),e.data=b,f||"string"===d){if(f||/<\s*\/tr\s*>/.test(b))return c.html(g,b,h);try{if(b=a.parseJSON(b||"null"))return c.object(g,b,h)}catch(k){}}return"array"===d||"string"===d||"array"===j||"csv"===j?c.csv(g,b,h):c.object(g,b,h)};return g.config=e,b.buildTable.hasOwnProperty(j)||""===j?void(k instanceof jQuery?l(a.trim(k.html())):k&&(k.hasOwnProperty("url")||"json"===j)?a.ajax(h.build_source).done(function(a){l(a)}).fail(function(a,c){e.debug&&b.log("aborting build table widget, failed ajax load"),f.html('")}):l(k)):(e.debug&&b.log("aborting build table widget, incorrect build type"),!1)};c.defaults={build_type:"",build_source:"",build_processing:null,build_complete:"tablesorter-build-complete",build_headers:{rows:1,classes:[],text:[],widths:[]},build_footers:{rows:1,classes:[],text:[]},build_numbers:{addColumn:!1,sortable:!1},build_csvStartLine:0,build_csvSeparator:",",build_objectRowKey:"rows",build_objectCellKey:"cells",build_objectHeaderKey:"headers",build_objectFooterKey:"footers"},c.build={colgroup:function(b){var c="";return b&&b.length&&(c+="",a.each(b,function(a,b){c+=""}),c+=""),c},cell:function(b,c,d,e,f){var g,h,i=f?a(""):"",j=c.build_headers.classes,k=c.build_headers.widths;if(/string|number/.test(typeof b))h=a("<"+d+(j&&j[e]?' class="'+j[e]+'"':"")+">"+b+""),f&&k&&k[e]&&i.width(k[e]||"");else{h=a("<"+d+">");for(g in b)b.hasOwnProperty(g)&&("text"===g||"html"===g?h[g](b[g]):f&&"width"===g?i.width(b[g]||""):h.attr(g,b[g]))}return[h,i]},header:function(b,c){var d=c.build_headers.text,e=c.build_headers.classes,f=""+(c.build_numbers.addColumn?""+c.build_numbers.addColumn+"":"");return a.each(b,function(a,b){f+=/<\s*\/t(d|h)\s*>/.test(b)?b:""+(d&&d[a]?d[a]:b)+""}),f+""},rows:function(b,c,d,e,f,g){var h=g?"th":"td",i=""+(e.build_numbers.addColumn?"<"+h+">"+(g?"":f)+"":"");return a.each(b,function(a,b){i+=/<\s*\/t(d|h)\s*>/.test(b)?b:"<"+(g?h+(d&&d[a]?' class="'+d[a]+'"':""):h)+">"+(g&&c&&c.length&&c[a]?c[a]:b)+""}),i+""}},c.buildComplete=function(c,d){a(c).trigger(d.build_complete),b.setup(c,c.config)},c.array=function(a,b,d){return c.csv(a,b,d)},c.csv=function(b,d,e){var f,g,h,i="csv"===e.build_type||"string"==typeof d,j=a(b),k=i?d.replace("\r","").split("\n"):d,l=k.length,m=0,n=!1,o=e.build_headers.rows+(i?e.build_csvStartLine:0),p=e.build_footers.rows,q=0,r="",s=c.build.colgroup(e.build_headers.widths)+"";a.each(k,function(a,b){a>=l-p&&(n=!0),(i?a>=e.build_csvStartLine:!0)&&o>a?(g=i?c.splitCSV(b,e.build_csvSeparator):b,q=g.length,s+=c.build.header(g,e)):a>=o&&(a===o&&(s+=""),h=i?c.splitCSV(b,e.build_csvSeparator):b,n&&p>0&&(s+=(a===l-p?"":"")+(a===l?"":"")),h.length>1&&(m++,h.length!==q&&(r+="error on line "+a+": Item count ("+h.length+") does not match header count ("+q+") \n"),f=n?e.build_footers.classes:"",s+=c.build.rows(h,e.build_footers.text,f,e,m,n)))}),s+=p>0?"":"",r?j.html(r):(j.html(s),c.buildComplete(b,e))},c.splitCSV=function(b,c){var d,e,f=a.trim(b).split(c=c||",");for(d=f.length-1;d>=0;d--)'"'===f[d].replace(/\"\s+$/,'"').charAt(f[d].length-1)?(e=f[d].replace(/^\s+\"/,'"')).length>1&&'"'===e.charAt(0)?f[d]=f[d].replace(/^\s*"|"\s*$/g,"").replace(/""/g,'"'):d?f.splice(d-1,2,[f[d-1],f[d]].join(c)):f=f.shift().split(c).concat(f):f[d].replace(/""/g,'"');return f},c.html=function(b,d,e){var f=a(b);d instanceof jQuery?f.empty().append(d):f.html(d),c.buildComplete(b,e)},c.object=function(d,e,f){var g,h,i,j,k,l,m,n=d.config,o=f.build_objectHeaderKey,p=f.build_objectRowKey,q=e.hasOwnProperty(o)&&!a.isEmptyObject(e.kh)?e.kh:e.hasOwnProperty("headers")?e.headers:!1,r=e.hasOwnProperty(p)&&!a.isEmptyObject(e.kr)?e.kr:e.hasOwnProperty("rows")?e.rows:!1;return q&&r&&0!==q.length&&0!==r.length?(j=a(""),k=a("
    '+a.status+" "+c+"
    "),a.each(q,function(b,d){for(m=a("").appendTo(k.find("thead")),h=d.length,g=0;h>g;g++)i=c.build.cell(d[g],f,"th",g,0===b),i[0]&&i[0].length&&i[0].appendTo(m),0===b&&i[1]&&i[1].appendTo(j)}),j.find("col[style]").length&&k.prepend(j),l=a(""),a.each(r,function(b,d){var e;if(i="object"===a.type(d),i&&d.newTbody){l=a("").appendTo(k);for(e in d)d.hasOwnProperty(e)&&"newTbody"!==e&&l.attr(e,d[e])}else{if(0===b&&l.appendTo(k),m=a("").appendTo(l),i){for(e in d)d.hasOwnProperty(e)&&e!==f.build_objectCellKey&&m.attr(e,d[e]);d.hasOwnProperty(f.build_objectCellKey)&&(d=d.cells)}for(h=d.length,e=0;h>e;e++)j=c.build.cell(d[e],f,"td",e),j[0]&&j[0].length&&j[0].appendTo(m)}}),e.hasOwnProperty(f.build_objectFooterKey)&&(i=e[f.build_objectFooterKey],"clone"===i?(j=k.find("thead").html(),k.append(""+j+"")):(j=a("").appendTo(k),a.each(i,function(b,d){for(m=a("").appendTo(j),h=d.length,g=0;h>g;g++)l=c.build.cell(d[g],f,"th",g),l[0]&&l[0].length&&l[0].appendTo(m)}))),a(d).html(k.html()),void c.buildComplete(d,f)):(n.debug&&b.log("aborting build table widget, missing data for object build"),!1)},c.ajax=c.json=function(a,b,d){return c.object(a,b,d)}}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-chart.min.js b/dist/js/widgets/widget-chart.min.js new file mode 100644 index 00000000..b5bc747e --- /dev/null +++ b/dist/js/widgets/widget-chart.min.js @@ -0,0 +1 @@ +!function(a){"use strict";var b=a.tablesorter,c=[],d=[],e=[],f=[],g=[],h=[],i=[],j=[],k=b.chart={nonDigit:/[^\d,.\-()]/g,init:function(a,b){a.$table.off(b.chart_event).on(b.chart_event,function(){if(this.hasInitialized){var a=this.config;k.getCols(a,a.widgetOptions),k.getData(a,a.widgetOptions)}})},getCols:function(d,e){var f;for(c=[],h=[],j=[],f=0;f=0?j.push(e[f]):(g=i[f].getAttribute(c.textAttribute)||i[f].textContent||i.eq(f).text(),j.push(a.trim(g)));l.push(j)}}),l.sort(function(a,c){return 1===d.chart_sort[0][1]?b.sortNatural(c[d.chart_sort[0][0]],a[d.chart_sort[0][0]]):b.sortNatural(a[d.chart_sort[0][0]],c[d.chart_sort[0][0]])}),a.each(l,function(f,l){var m,n=0,o=[],p=l[d.chart_labelCol];o.push(""+p),a.each(l,function(e,f){var l;return e===d.chart_labelCol?(g.push(f),i.push({label:f}),!0):(m=!1,d.chart_useSelector&&b.hasWidget(c.table,"columnSelector")&&!c.selector.auto?c.selector.states[e]&&a.inArray(e,d.chart_ignoreColumns)<0&&(m=""+f):a.inArray(e,d.chart_ignoreColumns)<0&&(m=""+f),void(m!==!1&&(/s/i.test(""+d.chart_layout[o.length])?(o.push(m),h[n].data.push(m),j[n].data.push(m)):(l=b.formatFloat(m.replace(k.nonDigit,""),c.table),l=isNaN(l)?m:l,o.push(l),h[n].data.push(l),j[n].data.push({value:l})),n++)))}),e.push(o)})},remove:function(a,b){a.$table.off(b.chart_event)}};b.addWidget({id:"chart",options:{chart_incRows:"filtered",chart_useSelector:!1,chart_ignoreColumns:[],chart_parsed:[],chart_layout:{0:"string"},chart_labelCol:0,chart_sort:[[0,0]],chart_event:"chartData"},init:function(a,b,c,d){k.init(c,d)},remove:function(a,b,c){k.remove(b,c)}})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-columnSelector.min.js b/dist/js/widgets/widget-columnSelector.min.js new file mode 100644 index 00000000..f38c7413 --- /dev/null +++ b/dist/js/widgets/widget-columnSelector.min.js @@ -0,0 +1 @@ +!function(a){"use strict";var b=a.tablesorter,c=".tscolsel",d=b.columnSelector={queryAll:"@media only all { [columns] { display: none; } } ",queryBreak:"@media all and (min-width: [size]) { [columns] { display: table-cell; } } ",init:function(e,f,g){var h,i;return h=a(g.columnSelector_layout),h.find("input").add(h.filter("input")).length?(f.tableId="tablesorter"+(new Date).getTime(),f.$table.addClass(f.tableId),i=f.selector={$container:a(g.columnSelector_container||"
    ")},i.$style=a("").prop("disabled",!0).appendTo("head"),i.$breakpoints=a("").prop("disabled",!0).appendTo("head"),i.isInitializing=!0,d.setupSelector(e,f,g),g.columnSelector_mediaquery&&d.setupBreakpoints(f,g),i.isInitializing=!1,i.$container.length&&d.updateCols(f,g),void f.$table.off("refreshColumnSelector"+c).on("refreshColumnSelector"+c,function(b,c){var e,f=a.isArray(c),g=this.config,h=g.widgetOptions;if(c&&g.selector.$container.length){if(f)for(a.each(c,function(a,b){c[a]=parseInt(b,10)}),e=0;e=0);d.updateAuto(g,h,i.$container.find('input[data-column="auto"]').prop("checked",!f))}else d.updateBreakpoints(g,h),d.updateCols(g,h)})):void(f.debug&&b.log("*** ERROR: Column Selector aborting, no input found in the layout! ***"))},setupSelector:function(c,e,f){var g,h=e.selector,i=h.$container,j=f.columnSelector_saveColumns&&b.storage,k=j?b.storage(c,"tablesorter-columnSelector"):[],l=j?b.storage(c,"tablesorter-columnSelector-auto"):{};h.auto=a.isEmptyObject(l)||"boolean"!==a.type(l.auto)?f.columnSelector_mediaqueryState:l.auto,h.states=[],h.$column=[],h.$wrapper=[],h.$checkbox=[],e.$table.children("thead").find("tr:first th",c).each(function(){var c=a(this),j=c.attr(f.columnSelector_priority)||1,l=c.attr("data-column"),m=b.getData(this,e.headers[l],"columnSelector");return isNaN(j)&&j.length>0||"disable"===m||f.columnSelector_columns[l]&&"disable"===f.columnSelector_columns[l]?!0:(h.states[l]=k&&"undefined"!=typeof k[l]?k[l]:"undefined"!=typeof f.columnSelector_columns[l]?f.columnSelector_columns[l]:"true"===m||"false"!==m,h.$column[l]=a(this),g=c.attr(f.columnSelector_name)||c.text(),void(i.length&&(h.$wrapper[l]=a(f.columnSelector_layout.replace(/\{name\}/g,g)).appendTo(i),h.$checkbox[l]=h.$wrapper[l].find("input").add(h.$wrapper[l].filter("input")).attr("data-column",l).toggleClass(f.columnSelector_cssChecked,h.states[l]).prop("checked",h.states[l]).on("change",function(){h.states[l]=this.checked,d.updateCols(e,f)}).change())))})},setupBreakpoints:function(b,e){var f=b.selector;e.columnSelector_mediaquery&&(f.lastIndex=-1,d.updateBreakpoints(b,e),b.$table.off("updateAll"+c).on("updateAll"+c,function(){d.updateBreakpoints(b,e),d.updateCols(b,e)})),f.$container.length&&(e.columnSelector_mediaquery&&(f.$auto=a(e.columnSelector_layout.replace(/\{name\}/g,e.columnSelector_mediaqueryName)).prependTo(f.$container),f.$auto.find("input").add(f.$auto.filter("input")).attr("data-column","auto").prop("checked",f.auto).toggleClass(e.columnSelector_cssChecked,f.auto).on("change",function(){d.updateAuto(b,e,a(this))}).change()),b.$table.off("update"+c).on("update"+c,function(){d.updateCols(b,e)}))},updateAuto:function(c,e,f){var g=c.selector;g.auto=f.prop("checked")||!1,a.each(g.$checkbox,function(a,b){b&&(b[0].disabled=g.auto,g.$wrapper[a].toggleClass("disabled",g.auto))}),e.columnSelector_mediaquery&&d.updateBreakpoints(c,e),d.updateCols(c,e),c.selector.$popup&&c.selector.$popup.find(".tablesorter-column-selector").html(g.$container.html()).find("input").each(function(){var b=a(this).attr("data-column");a(this).prop("checked","auto"===b?g.auto:g.states[b])}),e.columnSelector_saveColumns&&b.storage&&b.storage(c.$table[0],"tablesorter-columnSelector-auto",{auto:g.auto}),g.auto&&c.$table.trigger("columnUpdate")},updateBreakpoints:function(b,c){var e,f,g,h=b.selector,i="."+b.tableId,j=[],k="";if(c.columnSelector_mediaquery&&!h.auto)return h.$breakpoints.prop("disabled",!0),void h.$style.prop("disabled",!1);for(e=0;6>e;e++)g=[],b.$headers.filter("["+c.columnSelector_priority+"="+(e+1)+"]").each(function(){f=parseInt(a(this).attr("data-column"),10)+1,g.push(i+" col:nth-child("+f+")"),g.push(i+" tr th:nth-child("+f+")"),g.push(i+" tr td:nth-child("+f+")")}),g.length&&(j=j.concat(g),k+=d.queryBreak.replace(/\[size\]/g,c.columnSelector_breakpoints[e]).replace(/\[columns\]/g,g.join(",")));h.$style&&h.$style.prop("disabled",!0),j.length&&h.$breakpoints.prop("disabled",!1).html(d.queryAll.replace(/\[columns\]/g,j.join(","))+k)},updateCols:function(c,d){if(!(d.columnSelector_mediaquery&&c.selector.auto||c.selector.isInitializing)){var e,f=c.selector,g=[],h="."+c.tableId;f.$container.find("input[data-column]").filter('[data-column!="auto"]').each(function(){this.checked||(e=parseInt(a(this).attr("data-column"),10)+1,g.push(h+" col:nth-child("+e+")"),g.push(h+" tr th:nth-child("+e+")"),g.push(h+" tr td:nth-child("+e+")")),a(this).toggleClass(d.columnSelector_cssChecked,this.checked)}),d.columnSelector_mediaquery&&f.$breakpoints.prop("disabled",!0),f.$style&&f.$style.prop("disabled",!1).html(g.length?g.join(",")+" { display: none; }":""),d.columnSelector_saveColumns&&b.storage&&b.storage(c.$table[0],"tablesorter-columnSelector",f.states),c.$table.trigger("columnUpdate")}},attachTo:function(b,c){b=a(b)[0];var d,e,f,g=b.config,h=a(c);h.length&&g&&(h.find(".tablesorter-column-selector").length||h.append(''),d=g.selector,e=g.widgetOptions,h.find(".tablesorter-column-selector").html(d.$container.html()).find("input").each(function(){var b=a(this).attr("data-column"),c="auto"===b?d.auto:d.states[b];a(this).toggleClass(e.columnSelector_cssChecked,c).prop("checked",c)}),d.$popup=h.on("change","input",function(){f=a(this).toggleClass(e.columnSelector_cssChecked,this.checked).attr("data-column"),d.$container.find('input[data-column="'+f+'"]').prop("checked",this.checked).trigger("change")}))}};b.addWidget({id:"columnSelector",priority:10,options:{columnSelector_container:null,columnSelector_columns:{},columnSelector_saveColumns:!0,columnSelector_layout:'',columnSelector_name:"data-selector-name",columnSelector_mediaquery:!0,columnSelector_mediaqueryName:"Auto: ",columnSelector_mediaqueryState:!0,columnSelector_breakpoints:["20em","30em","40em","50em","60em","70em"],columnSelector_priority:"data-priority",columnSelector_cssChecked:"checked"},init:function(a,b,c,e){d.init(a,c,e)},remove:function(a,b,d,e){if(!e){var f=b.selector;f.$container.empty(),f.$popup&&f.$popup.empty(),f.$style.remove(),f.$breakpoints.remove(),b.$table.off("updateAll"+c+" update"+c)}}})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-columns.min.js b/dist/js/widgets/widget-columns.min.js new file mode 100644 index 00000000..6efea140 --- /dev/null +++ b/dist/js/widgets/widget-columns.min.js @@ -0,0 +1,2 @@ +/*! Widget: columns */ +!function(a){"use strict";var b=a.tablesorter=a.tablesorter||{};b.addWidget({id:"columns",priority:30,options:{columns:["primary","secondary","tertiary"]},format:function(c,d,e){var f,g,h,i,j,k,l,m,n=d.$table,o=d.$tbodies,p=d.sortList,q=p.length,r=e&&e.columns||["primary","secondary","tertiary"],s=r.length-1;for(l=r.join(" "),g=0;g1)))for(m=1;q>m;m++)k.eq(p[m][0]).addClass(r[m]||r[s])}),b.processTbody(c,f,!1);if(i=e.columns_thead!==!1?["thead tr"]:[],e.columns_tfoot!==!1&&i.push("tfoot tr"),i.length&&(h=n.find(i.join(",")).children().removeClass(l),q))for(m=0;q>m;m++)h.filter('[data-column="'+p[m][0]+'"]').addClass(r[m]||r[s])},remove:function(c,d,e){var f,g,h=d.$tbodies,i=(e.columns||["primary","secondary","tertiary"]).join(" ");for(d.$headers.removeClass(i),d.$table.children("tfoot").children("tr").children("th, td").removeClass(i),f=0;f0&&c>=x?x:0,z=l?n.children().children():n;l&&e.$table.data("cssStickyHeaderBottom",(r.length?d:0)-(f.cssStickyHeaders_addCaption?b:0)),f.cssStickyHeaders_addCaption&&(z=z.add(o)),t!==f.cssStickyHeaders_addCaption&&(t=f.cssStickyHeaders_addCaption,t||w(o,0)),w(z,y)}),j.unbind(a.trim("filterEnd"+m)).bind(a.trim("filterEnd"+m),function(){f.cssStickyHeaders_filteredToTop&&window.scrollTo(0,j.position().top)})},remove:function(b,c,d,e){if(!e){var f=c.namespace+"cssstickyheader ";a(window).unbind(a.trim("scroll resize ".split(" ").join(f))),c.$table.unbind(a.trim("filterEnd scroll resize ".split(" ").join(f))).add(c.$table.children("thead").children().children()).children("thead, caption").css({transform:"","-ms-transform":"","-webkit-transform":""})}}})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-editable.min.js b/dist/js/widgets/widget-editable.min.js new file mode 100644 index 00000000..ad95975f --- /dev/null +++ b/dist/js/widgets/widget-editable.min.js @@ -0,0 +1,5 @@ +/*! tablesorter Editable Content widget - updated 2/9/2015 (v2.19.1) + * Requires tablesorter v2.8+ and jQuery 1.7+ + * by Rob Garrison + */ +!function(a){"use strict";var b=a.tablesorter.editable={editComplete:function(a,b,c,d){c.removeClass("tseditable-last-edited-cell").trigger(b.editable_editComplete,[a]),d&&setTimeout(function(){c.focus()},50)},selectAll:function(a){setTimeout(function(){var b,c=document.createRange();c.selectNodeContents(a),b=window.getSelection(),b.removeAllRanges(),b.addRange(c)},100)},update:function(b,c){var d,e,f,g=[],h=[];if(!c.editable_columnsArray&&"string"===a.type(c.editable_columns)&&c.editable_columns.indexOf("-")>=0)for(e=c.editable_columns.split(/\s*-\s*/),d=parseInt(e[0],10)||0,e=parseInt(e[1],10)||b.columns-1,e>b.columns&&(e=b.columns-1);e>=d;d++)g.push(d),h.push("td:nth-child("+(d+1)+")");else a.isArray(c.editable_columns)&&a.each(c.editable_columnsArray||c.editable_columns,function(a,c){c").wrapInner(c.editable_wrapContent).children().length||a.isFunction(c.editable_wrapContent),b.$tbodies.find(h.join(",")).not("."+c.editable_noEdit).each(function(){f=a(this),e&&0===f.children().length&&f.wrapInner(c.editable_wrapContent),f.children().length?f.children().not("."+c.editable_noEdit).each(function(){var b=a(this);c.editable_trimContent&&b.text(function(b,c){return a.trim(c)}),b.prop("contenteditable",!0)}):(c.editable_trimContent&&f.text(function(b,c){return a.trim(c)}),f.prop("contenteditable",!0))})},bindEvents:function(c,d){c.$table.off(a.trim("updateComplete pagerComplete ".split(" ").join(".tseditable"))).on(a.trim("updateComplete pagerComplete ".split(" ").join(".tseditable")),function(){b.update(c,c.widgetOptions)}),c.$tbodies.off(a.trim("mouseleave focus blur focusout keydown ".split(" ").join(".tseditable "))).on("mouseleave.tseditable",function(){c.$table.data("contentFocused")&&(c.$table.data("contentFocused",!0),a(":focus").trigger("focusout"))}).on("focus.tseditable","[contenteditable]",function(e){clearTimeout(a(this).data("timer")),c.$table.data("contentFocused",e.target);var f=a(this),g=d.editable_selectAll,h=f.closest("td").index(),i=a.trim(f.text());d.editable_enterToAccept&&f.on("keydown.tseditable",function(a){13===a.which&&a.preventDefault()}),f.data({before:i,original:i}),"function"==typeof d.editable_focused&&d.editable_focused(i,h,f),g&&("function"==typeof g?g(i,h,f)&&b.selectAll(f[0]):b.selectAll(f[0]))}).on(a.trim("blur focusout keydown ".split(" ").join(".tseditable ")),"[contenteditable]",function(e){if(c.$table.data("contentFocused")){var f,g,h=!1,i=a(e.target),j=a.trim(i.text()),k=i.closest("td").index();if(27===e.which)return i.html(a.trim(i.data("original"))).trigger("blur.tseditable"),c.$table.data("contentFocused",!1),!1;if(f=13===e.which&&(d.editable_enterToAccept||e.altKey)||d.editable_autoAccept&&"keydown"!==e.type,f&&i.data("before")!==j){if(g=d.editable_validate,h=j,"function"==typeof g?h=g(j,i.data("original"),k,i):"function"==typeof(g=a.tablesorter.getColumnData(c.table,g,k))&&(h=g(j,i.data("original"),k,i)),f&&h!==!1)return c.$table.find(".tseditable-last-edited-cell").removeClass("tseditable-last-edited-cell"),i.addClass("tseditable-last-edited-cell").html(a.trim(h)).data("before",h).data("original",h).trigger("change"),c.$table.trigger("updateCell",[i.closest("td"),!1,function(){d.editable_autoResort?setTimeout(function(){c.$table.trigger("sorton",[c.sortList,function(){b.editComplete(c,d,c.$table.find(".tseditable-last-edited-cell"),!0)},!0])},10):b.editComplete(c,d,c.$table.find(".tseditable-last-edited-cell"))}]),!1}else h||"keydown"===e.type||(clearTimeout(i.data("timer")),i.data("timer",setTimeout(function(){a.isFunction(d.editable_blur)&&d.editable_blur(a.trim(i.text()),k,i)},100)),i.html(a.trim(i.data("original"))))}})}};a.tablesorter.addWidget({id:"editable",options:{editable_columns:[],editable_enterToAccept:!0,editable_autoAccept:!0,editable_autoResort:!1,editable_wrapContent:"
    ",editable_trimContent:!0,editable_validate:null,editable_focused:null,editable_blur:null,editable_selectAll:!1,editable_noEdit:"no-edit",editable_editComplete:"editComplete"},init:function(a,c,d,e){e.editable_columns.length&&(b.update(d,e),b.bindEvents(d,e))}})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-filter-formatter-html5.min.js b/dist/js/widgets/widget-filter-formatter-html5.min.js new file mode 100644 index 00000000..1f2d89ba --- /dev/null +++ b/dist/js/widgets/widget-filter-formatter-html5.min.js @@ -0,0 +1,2 @@ +/*! Filter widget formatter html5 functions */ +!function(a){"use strict";var b=a.tablesorter||{},c=".compare-select",d=b.filterFormatter={addCompare:function(b,d,e){if(e.compare&&a.isArray(e.compare)&&e.compare.length>1){var f="",g=[c.slice(1)," "+c.slice(1),""],h=e.cellText?'":"";a.each(e.compare,function(a,b){f+=""}),b.wrapInner('
    ').prepend(h+'').appendTo(e),l=j.skipTest||"number"===k.attr("type")&&"test"!==k.val(),m=[],n=e.closest("table")[0].config,o=function(b,d){var f=j.addToggle?e.find(".toggle").is(":checked"):!0,g=e.find(".number").val(),h=(a.isArray(j.compare)?e.find(c).val()||j.compare[j.selected||0]:j.compare)||"",k=n.$table[0].hasInitialized?(b?b:j.delayed)||"":!0;i.val(!j.addToggle||f?(h?h:j.exactMatch?"=":"")+g:"").trigger(d?"":"search",k).end().find(".number").val(g),e.find(".number").length&&(e.find(".number")[0].disabled=j.disabled||!f),m.length&&(m.find(".number").val(g)[0].disabled=j.disabled||!f,m.find(c).val(h),j.addToggle&&(m.find(".toggle")[0].checked=f))};return k.remove(),l&&(h=j.addToggle?'
    ':"",h+='',e.append(h+'').find(".toggle, .number").bind("change",function(){o()}).closest("thead").find("th[data-column="+f+"]").addClass("filter-parsed").closest("table").bind("filterReset",function(){a.isArray(j.compare)&&e.add(m).find(c).val(j.compare[j.selected||0]),j.addToggle&&(e.find(".toggle")[0].checked=!1,m.length&&(m.find(".toggle")[0].checked=!1)),e.find(".number").val(j.value),setTimeout(function(){o()},0)}),i=e.find("input[type=hidden]").bind("change",function(){e.find(".number").val(this.value),o()}),n.$table.bind("filterFomatterUpdate",function(){var a=d.updateCompare(e,i,j)[0]||j.value;e.find(".number").val(((a||"")+"").replace(/[><=]/g,"")),o(!1,!0),b.filter.formatterUpdated(e,f)}),j.compare&&(d.addCompare(e,f,j),e.find(c).bind("change",function(){o()})),n.$table.bind("stickyHeadersInit",function(){m=n.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(f).empty(),m.append(h).find(".toggle, .number").bind("change",function(){e.find(".number").val(a(this).val()),o()}),j.compare&&(d.addCompare(m,f,j),m.find(c).bind("change",function(){e.find(c).val(a(this).val()),o()})),o()}),o()),l?e.find('input[type="hidden"]'):a('')},html5Range:function(e,f,g){var h,i=a.extend({value:0,min:0,max:100,step:1,delayed:!0,valueToHeader:!0,exactMatch:!0,cellText:"",compare:"",allText:"all",skipTest:!1},g),j=a('').appendTo(e),k=i.skipTest||"range"===j.attr("type")&&"test"!==j.val(),l=[],m=e.closest("table")[0].config,n=function(b,d,g){b=("undefined"==typeof b?h.val():b).toString().replace(/[<>=]/g,"")||i.value;var j=(a.isArray(i.compare)?e.find(c).val()||i.compare[i.selected||0]:i.compare)||"",k=" ("+(j?j+b:b==i.min?i.allText:b)+")",n=m.$table[0].hasInitialized?(d?d:i.delayed)||"":!0;e.find("input[type=hidden]").val(j?j+b:b==i.min?"":(i.exactMatch?"=":"")+b).trigger(g?"":"search",n).end().find(".range").val(b),e.closest("thead").find("th[data-column="+f+"]").find(".curvalue").html(k),l.length&&(l.find(".range").val(b).end().find(c).val(j),l.closest("thead").find("th[data-column="+f+"]").find(".curvalue").html(k))};return j.remove(),k&&(e.html('').closest("thead").find("th[data-column="+f+"]").addClass("filter-parsed").find(".tablesorter-header-inner").append(''),h=e.find("input[type=hidden]").bind("change"+m.namespace+"filter",function(){var b=this.value,d=(a.isArray(i.compare)?e.find(c).val()||i.compare[i.selected||0]:i.compare)||"";b!==this.lastValue&&(this.lastValue=d?d+b:b==i.min?"":(i.exactMatch?"=":"")+b,this.value=this.lastValue,n(b))}),e.find(".range").bind("change",function(){n(this.value)}),m.$table.bind("filterFomatterUpdate",function(){var a=d.updateCompare(e,h,i)[0];e.find(".range").val(a),n(a,!1,!0),b.filter.formatterUpdated(e,f)}),i.compare&&(d.addCompare(e,f,i),e.find(c).bind("change",function(){n()})),m.$table.bind("stickyHeadersInit",function(){l=m.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(f).empty(),l.html('').find(".range").bind("change",function(){n(l.find(".range").val())}),n(),i.compare&&(d.addCompare(l,f,i),l.find(c).bind("change",function(){e.find(c).val(a(this).val()),n()}))}),e.closest("table").bind("filterReset",function(){a.isArray(i.compare)&&e.add(l).find(c).val(i.compare[i.selected||0]),setTimeout(function(){n(i.value,!1,!0)},0)}),n()),k?e.find('input[type="hidden"]'):a('')},html5Color:function(c,d,e){var f,g,h=a.extend({value:"#000000",disabled:!1,addToggle:!0,exactMatch:!0,valueToHeader:!1,skipTest:!1},e),i=a('').appendTo(c),j=h.skipTest||"color"===i.attr("type")&&"test"!==i.val(),k=[],l=c.closest("table")[0].config,m=function(a,b){a=("undefined"==typeof a?g.val():a).toString().replace("=","")||h.value;var e=!0,f=" ("+a+")";h.addToggle&&(e=c.find(".toggle").is(":checked")),c.find(".colorpicker").length&&(c.find(".colorpicker").val(a)[0].disabled=h.disabled||!e),g.val(e?a+(h.exactMatch?"=":""):"").trigger(!l.$table[0].hasInitialized||b?"":"search"),h.valueToHeader?c.closest("thead").find("th[data-column="+d+"]").find(".curcolor").html(f):c.find(".currentColor").html(f),k.length&&(k.find(".colorpicker").val(a)[0].disabled=h.disabled||!e,h.addToggle&&(k.find(".toggle")[0].checked=e),h.valueToHeader?k.closest("thead").find("th[data-column="+d+"]").find(".curcolor").html(f):k.find(".currentColor").html(f))};return i.remove(),j&&(f=""+d+Math.round(100*Math.random()),f='
    '+(h.addToggle?'
    ':"")+''+(h.valueToHeader?"":'(#000000)')+"
    ",c.html(f),h.valueToHeader&&c.closest("thead").find("th[data-column="+d+"]").find(".tablesorter-header-inner").append(''),c.find(".toggle, .colorpicker").bind("change",function(){m(c.find(".colorpicker").val())}),g=c.find("input[type=hidden]").bind("change"+l.namespace+"filter",function(){m(this.value)}),l.$table.bind("filterFomatterUpdate",function(){m(g.val(),!0),b.filter.formatterUpdated(c,d)}),c.closest("table").bind("filterReset",function(){h.addToggle&&(c.find(".toggle")[0].checked=!1),setTimeout(function(){m()},0)}),l.$table.bind("stickyHeadersInit",function(){k=l.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(d),k.html(f).find(".toggle, .colorpicker").bind("change",function(){m(k.find(".colorpicker").val())}),m(k.find(".colorpicker").val())}),m(h.value)),j?c.find('input[type="hidden"]'):a('')}}}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-filter-formatter-jui.min.js b/dist/js/widgets/widget-filter-formatter-jui.min.js new file mode 100644 index 00000000..362389b8 --- /dev/null +++ b/dist/js/widgets/widget-filter-formatter-jui.min.js @@ -0,0 +1,2 @@ +/*! Filter widget formatter jQuery UI functions */ +!function(a){"use strict";var b=a.tablesorter||{},c=".compare-select",d=b.filterFormatter={addCompare:function(b,d,e){if(e.compare&&a.isArray(e.compare)&&e.compare.length>1){var f="",g=[c.slice(1)," "+c.slice(1),""],h=e.cellText?'":"";a.each(e.compare,function(a,b){f+=""}),b.wrapInner('
    ').prepend(h+'').appendTo(e).bind("change"+i.namespace+"filter",function(){l({value:this.value,delayed:!1})}),k=[],l=function(d,f){var g,j=!0,l=d&&d.value&&b.formatFloat((d.value+"").replace(/[><=]/g,""))||e.find(".spinner").val()||h.value,m=(a.isArray(h.compare)?e.find(c).val()||h.compare[h.selected||0]:h.compare)||"",n=d&&"boolean"==typeof d.delayed?d.delayed:i.$table[0].hasInitialized?h.delayed||"":!0;h.addToggle&&(j=e.find(".toggle").is(":checked")),g=h.disabled||!j?"disable":"enable",e.find(".filter").val(j?(m?m:h.exactMatch?"=":"")+l:"").trigger(f?"":"search",n).end().find(".spinner").spinner(g).val(l),k.length&&(k.find(".spinner").spinner(g).val(l).end().find(c).val(m),h.addToggle&&(k.find(".toggle")[0].checked=j))};return h.oldcreate=h.create,h.oldspin=h.spin,h.create=function(a,b){l(),"function"==typeof h.oldcreate&&h.oldcreate(a,b)},h.spin=function(a,b){l(b),"function"==typeof h.oldspin&&h.oldspin(a,b)},h.addToggle&&a('
    ').appendTo(e).find(".toggle").bind("change",function(){l()}),e.closest("thead").find("th[data-column="+f+"]").addClass("filter-parsed"),a('').val(h.value).appendTo(e).spinner(h).bind("change keyup",function(){l()}),i.$table.bind("filterFomatterUpdate",function(){var a=d.updateCompare(e,j,h)[0];e.find(".spinner").val(a),l({value:a},!0),b.filter.formatterUpdated(e,f)}),h.compare&&(d.addCompare(e,f,h),e.find(c).bind("change",function(){l()})),i.$table.bind("stickyHeadersInit",function(){k=i.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(f).empty(),h.addToggle&&a('
    ').appendTo(k).find(".toggle").bind("change",function(){e.find(".toggle")[0].checked=this.checked,l()}),a('').val(h.value).appendTo(k).spinner(h).bind("change keyup",function(){e.find(".spinner").val(this.value),l()}),h.compare&&(d.addCompare(k,f,h),k.find(c).bind("change",function(){e.find(c).val(a(this).val()),l()}))}),i.$table.bind("filterReset",function(){a.isArray(h.compare)&&e.add(k).find(c).val(h.compare[h.selected||0]),h.addToggle&&(e.find(".toggle")[0].checked=!1),e.find(".spinner").spinner("value",h.value),setTimeout(function(){l()},0)}),l(),j},uiSlider:function(e,f,g){var h=a.extend({delayed:!0,valueToHeader:!1,exactMatch:!0,cellText:"",compare:"",allText:"all",value:0,min:0,max:100,step:1,range:"min"},g),i=e.closest("table")[0].config,j=a('').appendTo(e).bind("change"+i.namespace+"filter",function(){l({value:this.value})}),k=[],l=function(d,g){var j="undefined"!=typeof d?b.formatFloat((d.value+"").replace(/[><=]/g,""))||h.value:h.value,l=h.compare?j:j===h.min?h.allText:j,m=(a.isArray(h.compare)?e.find(c).val()||h.compare[h.selected||0]:h.compare)||"",n=m+l,o=d&&"boolean"==typeof d.delayed?d.delayed:i.$table[0].hasInitialized?h.delayed||"":!0;h.valueToHeader?e.closest("thead").find("th[data-column="+f+"]").find(".curvalue").html(" ("+n+")"):e.find(".ui-slider-handle").addClass("value-popup").attr("data-value",n),e.find(".filter").val(m?m+j:j===h.min?"":(h.exactMatch?"=":"")+j).trigger(g?"":"search",o).end().find(".slider").slider("value",j),k.length&&(k.find(c).val(m).end().find(".slider").slider("value",j),h.valueToHeader?k.closest("thead").find("th[data-column="+f+"]").find(".curvalue").html(" ("+n+")"):k.find(".ui-slider-handle").addClass("value-popup").attr("data-value",n))};return e.closest("thead").find("th[data-column="+f+"]").addClass("filter-parsed"),h.valueToHeader&&e.closest("thead").find("th[data-column="+f+"]").find(".tablesorter-header-inner").append(''),h.oldcreate=h.create,h.oldslide=h.slide,h.create=function(a,b){l(),"function"==typeof h.oldcreate&&h.oldcreate(a,b)},h.slide=function(a,b){l(b),"function"==typeof h.oldslide&&h.oldslide(a,b)},a('
    ').appendTo(e).slider(h),i.$table.bind("filterFomatterUpdate",function(){var a=d.updateCompare(e,j,h)[0];e.find(".slider").slider("value",a),l({value:a},!1),b.filter.formatterUpdated(e,f)}),h.compare&&(d.addCompare(e,f,h),e.find(c).bind("change",function(){l({value:e.find(".slider").slider("value")})})),i.$table.bind("filterReset",function(){a.isArray(h.compare)&&e.add(k).find(c).val(h.compare[h.selected||0]),setTimeout(function(){l({value:h.value})},0)}),i.$table.bind("stickyHeadersInit",function(){k=i.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(f).empty(),a('
    ').val(h.value).appendTo(k).slider(h).bind("change keyup",function(){e.find(".slider").slider("value",this.value),l()}),h.compare&&(d.addCompare(k,f,h),k.find(c).bind("change",function(){e.find(c).val(a(this).val()),l()}))}),j},uiRange:function(c,d,e){var f=a.extend({delayed:!0,valueToHeader:!1,values:[0,100],min:0,max:100,range:!0},e),g=c.closest("table")[0].config,h=a('').appendTo(c).bind("change"+g.namespace+"filter",function(){j()}),i=[],j=function(){var a=h.val(),b=a.split(" - ");""===a&&(b=[f.min,f.max]),b&&b[1]&&k({values:b,delay:!1},!0)},k=function(a,b){var e=a&&a.values||f.values,h=e[0]+" - "+e[1],j=e[0]===f.min&&e[1]===f.max?"":h,k=a&&"boolean"==typeof a.delayed?a.delayed:g.$table[0].hasInitialized?f.delayed||"":!0;f.valueToHeader?c.closest("thead").find("th[data-column="+d+"]").find(".currange").html(" ("+h+")"):c.find(".ui-slider-handle").addClass("value-popup").eq(0).attr("data-value",e[0]).end().eq(1).attr("data-value",e[1]),c.find(".filter").val(j).trigger(b?"":"search",k).end().find(".range").slider("values",e),i.length&&(i.find(".range").slider("values",e),f.valueToHeader?i.closest("thead").find("th[data-column="+d+"]").find(".currange").html(" ("+h+")"):i.find(".ui-slider-handle").addClass("value-popup").eq(0).attr("data-value",e[0]).end().eq(1).attr("data-value",e[1]))};return c.closest("thead").find("th[data-column="+d+"]").addClass("filter-parsed"),f.valueToHeader&&c.closest("thead").find("th[data-column="+d+"]").find(".tablesorter-header-inner").append(''),f.oldcreate=f.create,f.oldslide=f.slide,f.create=function(a,b){k(),"function"==typeof f.oldcreate&&f.oldcreate(a,b)},f.slide=function(a,b){k(b),"function"==typeof f.oldslide&&f.oldslide(a,b)},a('
    ').appendTo(c).slider(f),g.$table.bind("filterFomatterUpdate",function(){j(),b.filter.formatterUpdated(c,d)}),g.$table.bind("filterReset",function(){c.find(".range").slider("values",f.values),setTimeout(function(){k()},0)}),g.$table.bind("stickyHeadersInit",function(){i=g.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(d).empty(),a('
    ').val(f.value).appendTo(i).slider(f).bind("change keyup",function(){c.find(".range").val(this.value),k()})}),h},uiDateCompare:function(e,f,g){var h,i,j=a.extend({cellText:"",compare:"",endOfDay:!0,defaultDate:"",changeMonth:!0,changeYear:!0,numberOfMonths:1},g),k=e.closest("table")[0].config,l=e.closest("thead").find("th[data-column="+f+"]").addClass("filter-parsed"),m=a('').appendTo(e).bind("change"+k.namespace+"filter",function(){var a=this.value;a&&j.onClose(a)}),n=[],o=function(b){var d,f,g=h.datepicker("getDate")||"",i=(a.isArray(j.compare)?e.find(c).val()||j.compare[j.selected||0]:j.compare)||"",l=k.$table[0].hasInitialized?j.delayed||"":!0;h.datepicker("setDate",(""===g?"":g)||null),""===g&&(b=!1),d=h.datepicker("getDate"),f=d?(j.endOfDay&&/<=/.test(i)?d.setHours(23,59,59):d.getTime())||"":"",d&&j.endOfDay&&"="===i&&(i="",f+=" - "+d.setHours(23,59,59),b=!1),e.find(".dateCompare").val(i+f).trigger(b?"":"search",l).end(),n.length&&n.find(".dateCompare").val(i+f).end().find(c).val(i)};return i='',h=a(i).appendTo(e),j.oldonClose=j.onClose,j.onClose=function(a,b){o(),"function"==typeof j.oldonClose&&j.oldonClose(a,b)},h.datepicker(j),k.$table.bind("filterReset",function(){a.isArray(j.compare)&&e.add(n).find(c).val(j.compare[j.selected||0]),e.add(n).find(".date").val(j.defaultDate).datepicker("setDate",j.defaultDate||null),setTimeout(function(){o()},0)}),k.$table.bind("filterFomatterUpdate",function(){var a,g=m.val();/\s+-\s+/.test(g)?(e.find(c).val("="),a=g.split(/\s+-\s+/)[0],h.datepicker("setDate",a||null)):(a=d.updateCompare(e,m,j)[1].toString()||"",a=""!==a?/\d{5}/g.test(a)?new Date(Number(a)):a||"":""),e.add(n).find(".date").datepicker("setDate",a||null),setTimeout(function(){o(!0),b.filter.formatterUpdated(e,f)},0)}),j.compare&&(d.addCompare(e,f,j),e.find(c).bind("change",function(){o()})),k.$table.bind("stickyHeadersInit",function(){n=k.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(f).empty(),n.append(i).find(".date").datepicker(j),j.compare&&(d.addCompare(n,f,j),n.find(c).bind("change",function(){e.find(c).val(a(this).val()),o()}))}),m.val(j.defaultDate?j.defaultDate:"")},uiDatepicker:function(c,d,e){var f,g,h=a.extend({endOfDay:!0,textFrom:"from",textTo:"to",from:"",to:"",changeMonth:!0,changeYear:!0,numberOfMonths:1},e),i=[],j=c.closest("table")[0].config,k=function(a){return a instanceof Date&&isFinite(a)},l=a('').appendTo(c).bind("change"+j.namespace+"filter",function(){var a=this.value;a.match(" - ")?(a=a.split(" - "),c.find(".dateTo").val(a[1]),g(a[0])):a.match(">=")?g(a.replace(">=","")):a.match("<=")&&g(a.replace("<=",""))}),m=c.closest("thead").find("th[data-column="+d+"]").addClass("filter-parsed");return f="',a(f).appendTo(c),h.oldonClose=h.onClose,g=h.onClose=function(a,b){var d,e=c.find(".dateFrom").datepicker("getDate"),f=c.find(".dateTo").datepicker("getDate");e=k(e)?e.getTime():"",f=k(f)?(h.endOfDay?f.setHours(23,59,59):f.getTime())||"":"",d=e?f?e+" - "+f:">="+e:f?"<="+f:"",c.add(i).find(".dateRange").val(d).trigger("search"),e=e?new Date(e):"",f=f?new Date(f):"",/<=/.test(d)?c.add(i).find(".dateFrom").datepicker("option","maxDate",f||null).end().find(".dateTo").datepicker("option","minDate",null).datepicker("setDate",f||null):/>=/.test(d)?c.add(i).find(".dateFrom").datepicker("option","maxDate",null).datepicker("setDate",e||null).end().find(".dateTo").datepicker("option","minDate",e||null):c.add(i).find(".dateFrom").datepicker("option","maxDate",null).datepicker("setDate",e||null).end().find(".dateTo").datepicker("option","minDate",null).datepicker("setDate",f||null),"function"==typeof h.oldonClose&&h.oldonClose(a,b)},h.defaultDate=h.from||"",c.find(".dateFrom").datepicker(h),h.defaultDate=h.to||"+7d",c.find(".dateTo").datepicker(h),j.$table.bind("filterFomatterUpdate",function(){var a=l.val()||"",e="",f="";/\s+-\s+/.test(a)?(a=a.split(/\s+-\s+/)||[],e=a[0]||"",f=a[1]||""):/>=/.test(a)?e=a.replace(/>=/,"")||"":/<=/.test(a)&&(f=a.replace(/<=/,"")||""),e=""!==e?/\d{5}/g.test(e)?new Date(Number(e)):e||"":"",f=""!==f?/\d{5}/g.test(f)?new Date(Number(f)):f||"":"",c.add(i).find(".dateFrom").datepicker("setDate",e||null),c.add(i).find(".dateTo").datepicker("setDate",f||null),setTimeout(function(){g(),b.filter.formatterUpdated(c,d)},0)}),j.$table.bind("stickyHeadersInit",function(){i=j.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(d).empty(),i.append(f),h.defaultDate=h.from||"",i.find(".dateFrom").datepicker(h),h.defaultDate=h.to||"+7d",i.find(".dateTo").datepicker(h)}),c.closest("table").bind("filterReset",function(){c.add(i).find(".dateFrom").val("").datepicker("setDate",h.from||null),c.add(i).find(".dateTo").val("").datepicker("setDate",h.to||null),setTimeout(function(){g()},0)}),l.val(h.from?h.to?h.from+" - "+h.to:">="+h.from:h.to?"<="+h.to:"")}}}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-filter-formatter-select2.min.js b/dist/js/widgets/widget-filter-formatter-select2.min.js new file mode 100644 index 00000000..80566520 --- /dev/null +++ b/dist/js/widgets/widget-filter-formatter-select2.min.js @@ -0,0 +1,4 @@ +/*! Filter widget select2 formatter function - updated 2/7/2015 (v2.19.0) + * requires: jQuery 1.7.2+, tableSorter (FORK) 2.16+, filter widget 2.16+ and select2 v3.4.6+ plugin + */ +!function(a){"use strict";var b=a.tablesorter||{};b.filterFormatter=b.filterFormatter||{},b.filterFormatter.select2=function(c,d,e){var f,g,h=a.extend({cellText:"",match:!0,value:"",multiple:!0,width:"100%"},e),i=c.closest("table")[0].config,j=i.widgetOptions,k=a('').appendTo(c).bind("change"+i.namespace+"filter",function(){var a=this.value;a=a.replace(/[/()$^]/g,"").split("|"),c.find(".select2").select2("val",a),q()}),l=i.$headers.filter('[data-column="'+d+'"]:last'),m=l.hasClass(j.filter_onlyAvail),n=[],o=h.match?"":"^",p=h.match?"":"$",q=function(){var b=!1,d=c.find(".select2").select2("val")||h.value||"";a.isArray(d)&&(b=!0,d=d.join("\x00")),d=d.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),b&&(d=d.split("\x00")),k.val(a.isArray(d)&&d.length&&""!==d.join("")?"/("+o+(d||[]).join(p+"|"+o)+p+")/":"").trigger("search").end().find(".select2").select2("val",d),n.length&&n.find(".select2").select2("val",d)},r=function(){g=[],f=b.filter.getOptionSource(i.$table[0],d,m)||[],a.each(f,function(a,b){g.push({id:b,text:b})}),h.data=g};return l.toggleClass("filter-match",h.match),h.cellText&&c.prepend(""),h.ajax&&!a.isEmptyObject(h.ajax)||h.data||(r(),m&&i.$table.bind("filterEnd",function(){r(),c.add(n).find(".select2").select2(h)})),a('').val(h.value).appendTo(c).select2(h).bind("change",function(){q()}),i.$table.bind("filterFomatterUpdate",function(){var a=i.$table.data("lastSearch")[d]||"";a=a.replace(/^\/\(\^?/,"").replace(/\$\|\^/g,"|").replace(/\$?\)\/$/g,"").split("|"),c.find(".select2").select2("val",a),q(),b.filter.formatterUpdated(c,d)}),i.$table.bind("stickyHeadersInit",function(){n=i.widgetOptions.$sticky.find(".tablesorter-filter-row").children().eq(d).empty(),a('').val(h.value).appendTo(n).select2(h).bind("change",function(){c.find(".select2").select2("val",n.find(".select2").select2("val")),q()}),h.cellText&&n.prepend("")}),i.$table.bind("filterReset",function(){c.find(".select2").select2("val",h.value||""),setTimeout(function(){q()},0)}),q(),k}}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-filter.min.js b/dist/js/widgets/widget-filter.min.js new file mode 100644 index 00000000..ed7f7cb3 --- /dev/null +++ b/dist/js/widgets/widget-filter.min.js @@ -0,0 +1,2 @@ +/*! Widget: filter */ +!function(a){"use strict";var b=a.tablesorter=a.tablesorter||{};a.extend(b.css,{filterRow:"tablesorter-filter-row",filter:"tablesorter-filter"}),b.addWidget({id:"filter",priority:50,options:{filter_childRows:!1,filter_columnFilters:!0,filter_cellFilter:"",filter_cssFilter:"",filter_defaultFilter:{},filter_excludeFilter:{},filter_external:"",filter_filteredRow:"filtered",filter_formatter:null,filter_functions:null,filter_hideEmpty:!0,filter_hideFilters:!1,filter_ignoreCase:!0,filter_liveSearch:!0,filter_onlyAvail:"filter-onlyAvail",filter_placeholder:{search:"",select:""},filter_reset:null,filter_saveFilters:!1,filter_searchDelay:300,filter_searchFiltered:!0,filter_selectSource:null,filter_startsWith:!1,filter_useParsedData:!1,filter_serversideFiltering:!1,filter_defaultAttrib:"data-value",filter_selectSourceSeparator:"|"},format:function(a,c,d){c.$table.hasClass("hasFilters")||b.filter.init(a,c,d)},remove:function(c,d,e,f){var g,h,i=d.$table,j=d.$tbodies,k="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(d.namespace+"filter ");if(i.removeClass("hasFilters").unbind(a.trim(k)).find("."+b.css.filterRow).remove(),!f){for(g=0;g=]/g,query:"(q|query)"},types:{regex:function(a,c){if(b.filter.regex.regex.test(c.iFilter)){var d,e=b.filter.regex.regex.exec(c.iFilter);try{d=new RegExp(e[1],e[2]).test(c.iExact)}catch(f){d=!1}return d}return null},operators:function(c,d){if(/^[<>]=?/.test(d.iFilter)){var e,f,g=c.table,h=d.index,i=d.parsed[h],j=b.formatFloat(d.iFilter.replace(b.filter.regex.operators,""),g),k=c.parsers[h],l=j;return(i||"numeric"===k.type)&&(f=b.filter.parseFilter(c,a.trim(""+d.iFilter.replace(b.filter.regex.operators,"")),h,i,!0),j="number"!=typeof f||""===f||isNaN(f)?j:f),e=!i&&"numeric"!==k.type||isNaN(j)||"undefined"==typeof d.cache?isNaN(d.iExact)?b.formatFloat(d.iExact.replace(b.filter.regex.nondigit,""),g):b.formatFloat(d.iExact,g):d.cache,/>/.test(d.iFilter)&&(f=/>=/.test(d.iFilter)?e>=j:e>j),/=e:j>e),f||""!==l||(f=!0),f}return null},notMatch:function(c,d){if(/^\!/.test(d.iFilter)){var e,f=b.filter.parseFilter(c,d.iFilter.replace("!",""),d.index,d.parsed[d.index]);return b.filter.regex.exact.test(f)?(f=f.replace(b.filter.regex.exact,""),""===f?!0:a.trim(f)!==d.iExact):(e=d.iExact.search(a.trim(f)),""===f?!0:!(c.widgetOptions.filter_startsWith?0===e:e>=0))}return null},exact:function(c,d){if(b.filter.regex.exact.test(d.iFilter)){var e=b.filter.parseFilter(c,d.iFilter.replace(b.filter.regex.exact,""),d.index,d.parsed[d.index]);return d.anyMatch?a.inArray(e,d.rowArray)>=0:e==d.iExact}return null},and:function(c,d){if(b.filter.regex.andTest.test(d.filter)){for(var e=d.index,f=d.parsed[e],g=d.iFilter.split(b.filter.regex.andSplit),h=d.iExact.search(a.trim(b.filter.parseFilter(c,g[0],e,f)))>=0,i=g.length-1;h&&i;)h=h&&d.iExact.search(a.trim(b.filter.parseFilter(c,g[i],e,f)))>=0,i--;return h}return null},range:function(a,c){if(b.filter.regex.toTest.test(c.iFilter)){var d,e,f=a.table,g=c.index,h=c.parsed[g],i=c.iFilter.split(b.filter.regex.toSplit),j=b.formatFloat(b.filter.parseFilter(a,i[0].replace(b.filter.regex.nondigit,""),g,h),f),k=b.formatFloat(b.filter.parseFilter(a,i[1].replace(b.filter.regex.nondigit,""),g,h),f);return(h||"numeric"===a.parsers[g].type)&&(d=a.parsers[g].format(""+i[0],f,a.$headers.eq(g),g),j=""===d||isNaN(d)?j:d,d=a.parsers[g].format(""+i[1],f,a.$headers.eq(g),g),k=""===d||isNaN(d)?k:d),d=!h&&"numeric"!==a.parsers[g].type||isNaN(j)||isNaN(k)?isNaN(c.iExact)?b.formatFloat(c.iExact.replace(b.filter.regex.nondigit,""),f):b.formatFloat(c.iExact,f):c.cache,j>k&&(e=j,j=k,k=e),d>=j&&k>=d||""===j||""===k}return null},wild:function(c,d){if(/[\?\*\|]/.test(d.iFilter)||b.filter.regex.orReplace.test(d.filter)){var e=d.index,f=d.parsed[e],g=b.filter.parseFilter(c,d.iFilter.replace(b.filter.regex.orReplace,"|"),e,f);return!c.$headers.filter('[data-column="'+e+'"]:last').hasClass("filter-match")&&/\|/.test(g)&&("|"===g[g.length-1]&&(g+="*"),g=d.anyMatch&&a.isArray(d.rowArray)?"("+g+")":"^("+g+")$"),new RegExp(g.replace(/\?/g,"\\S{1}").replace(/\*/g,"\\S*")).test(d.iExact)}return null},fuzzy:function(a,c){if(/^~/.test(c.iFilter)){var d,e=0,f=c.iExact.length,g=b.filter.parseFilter(a,c.iFilter.slice(1),c.index,c.parsed[c.index]);for(d=0;f>d;d++)c.iExact[d]===g[e]&&(e+=1);return e===g.length?!0:!1}return null}},init:function(c,d,e){b.language=a.extend(!0,{},{to:"to",or:"or",and:"and"},b.language);var f,g,h,i,j,k,l,m,n,o=b.filter.regex;if(d.$table.addClass("hasFilters"),e.searchTimer=null,e.filter_initTimer=null,e.filter_formatterCount=0,e.filter_formatterInit=[],e.filter_anyColumnSelector='[data-column="all"],[data-column="any"]',e.filter_multipleColumnSelector='[data-column*="-"],[data-column*=","]',h="\\{"+b.filter.regex.query+"\\}",a.extend(o,{child:new RegExp(d.cssChildRow),filtered:new RegExp(e.filter_filteredRow),alreadyFiltered:new RegExp("(\\s+("+b.language.or+"|-|"+b.language.to+")\\s+)","i"),toTest:new RegExp("\\s+(-|"+b.language.to+")\\s+","i"),toSplit:new RegExp("(?:\\s+(?:-|"+b.language.to+")\\s+)","gi"),andTest:new RegExp("\\s+("+b.language.and+"|&&)\\s+","i"),andSplit:new RegExp("(?:\\s+(?:"+b.language.and+"|&&)\\s+)","gi"),orReplace:new RegExp("\\s+("+b.language.or+")\\s+","gi"),iQuery:new RegExp(h,"i"),igQuery:new RegExp(h,"ig")}),e.filter_columnFilters!==!1&&d.$headers.filter(".filter-false, .parser-false").length!==d.$headers.length&&b.filter.buildRow(c,d,e),h="addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search ".split(" ").join(d.namespace+"filter "),d.$table.bind(a.trim(h),function(f,g){return l=e.filter_hideEmpty&&a.isEmptyObject(d.cache)&&!(d.delayInit&&"appendCache"===f.type),d.$table.find("."+b.css.filterRow).toggleClass(e.filter_filteredRow,l),/(search|filter)/.test(f.type)||(f.stopPropagation(),b.filter.buildDefault(c,!0)),"filterReset"===f.type?(d.$table.find("."+b.css.filter).add(e.filter_$externalFilters).val(""),b.filter.searching(c,[])):"filterEnd"===f.type?b.filter.buildDefault(c,!0):(g="search"===f.type?g:"updateComplete"===f.type?d.$table.data("lastSearch"):"",/(update|add)/.test(f.type)&&"updateComplete"!==f.type&&(d.lastCombinedFilter=null,d.lastSearch=[]),b.filter.searching(c,g,!0)),!1}),e.filter_reset&&(e.filter_reset instanceof a?e.filter_reset.click(function(){d.$table.trigger("filterReset")}):a(e.filter_reset).length&&a(document).undelegate(e.filter_reset,"click.tsfilter").delegate(e.filter_reset,"click.tsfilter",function(){d.$table.trigger("filterReset")})),e.filter_functions)for(j=0;j'+(i.data("placeholder")||i.attr("data-placeholder")||e.filter_placeholder.select||"")+"":"",l=g,h=g,g.indexOf(e.filter_selectSourceSeparator)>=0&&(l=g.split(e.filter_selectSourceSeparator),h=l[1],l=l[0]),f+="");d.$table.find("thead").find("select."+b.css.filter+'[data-column="'+j+'"]').append(f)}b.filter.buildDefault(c,!0),b.filter.bindSearch(c,d.$table.find("."+b.css.filter),!0),e.filter_external&&b.filter.bindSearch(c,e.filter_external),e.filter_hideFilters&&b.filter.hideFilters(c,d),d.showProcessing&&d.$table.unbind(a.trim("filterStart filterEnd ".split(" ").join(d.namespace+"filter "))).bind(a.trim("filterStart filterEnd ".split(" ").join(d.namespace+"filter ")),function(e,f){i=f?d.$table.find("."+b.css.header).filter("[data-column]").filter(function(){return""!==f[a(this).data("column")]}):"",b.isProcessing(c,"filterStart"===e.type,f?i:"")}),d.filteredRows=d.totalRows,d.$table.unbind(a.trim("tablesorter-initialized pagerBeforeInitialized ".split(" ").join(d.namespace+"filter "))).bind(a.trim("tablesorter-initialized pagerBeforeInitialized ".split(" ").join(d.namespace+"filter ")),function(){var a=this.config.widgetOptions;k=b.filter.setDefaults(c,d,a)||[],k.length&&(d.delayInit&&""===k.join("")||b.setFilters(c,k,!0)),d.$table.trigger("filterFomatterUpdate"),setTimeout(function(){a.filter_initialized||b.filter.filterInitComplete(d)},100)}),d.pager&&d.pager.initialized&&!e.filter_initialized&&(d.$table.trigger("filterFomatterUpdate"),setTimeout(function(){b.filter.filterInitComplete(d)},100))},formatterUpdated:function(a,b){var c=a.closest("table")[0].config.widgetOptions;c.filter_initialized||(c.filter_formatterInit[b]=1)},filterInitComplete:function(c){var d=c.widgetOptions,e=0,f=function(){d.filter_initialized=!0,c.$table.trigger("filterInit",c),b.filter.findRows(c.table,c.$table.data("lastSearch")||[])};a.isEmptyObject(d.filter_formatter)?f():(a.each(d.filter_formatterInit,function(a,b){1===b&&e++}),clearTimeout(d.filter_initTimer),d.filter_initialized||e!==d.filter_formatterCount?d.filter_initialized||(d.filter_initTimer=setTimeout(function(){f()},500)):f())},setDefaults:function(c,d,e){var f,g,h,i=b.getFilters(c)||[];if(e.filter_saveFilters&&b.storage&&(g=b.storage(c,"tablesorter-filters")||[],f=a.isArray(g),f&&""===g.join("")||!f||(i=g)),""===i.join(""))for(h=0;h';for(g=0;m>g;g++)o+=n?"":"";for(d.$filters=a(o+="").appendTo(d.$table.children("thead").eq(0)).find("td"),g=0;m>g;g++)j=!1,h=d.$headers.filter('[data-column="'+g+'"]:last'),l=b.getColumnData(c,e.filter_functions,g),i=e.filter_functions&&l&&"function"!=typeof l||h.hasClass("filter-select"),f=b.getColumnData(c,d.headers,g),j="false"===b.getData(h[0],f,"filter")||"false"===b.getData(h[0],f,"parser"),i?o=a("').appendTo(d.$filters.eq(g)),o&&o.attr("placeholder",h.data("placeholder")||h.attr("data-placeholder")||e.filter_placeholder.search||"")),o&&(k=(a.isArray(e.filter_cssFilter)?"undefined"!=typeof e.filter_cssFilter[g]?e.filter_cssFilter[g]||"":"":e.filter_cssFilter)||"",o.addClass(b.css.filter+" "+k).attr("data-column",g),j&&(o.attr("placeholder","").addClass("disabled")[0].disabled=!0))},bindSearch:function(c,d,e){if(c=a(c)[0],d=a(d),d.length){var f=c.config,g=f.widgetOptions,h=g.filter_$externalFilters;e!==!0&&(g.filter_$anyMatch=d.filter(g.filter_anyColumnSelector+","+g.filter_multipleColumnSelector),g.filter_$externalFilters=h&&h.length?g.filter_$externalFilters.add(d):d,b.setFilters(c,f.$table.data("lastSearch")||[],e===!1)),d.attr("data-lastSearchTime",(new Date).getTime()).unbind(a.trim("keypress keyup search change ".split(" ").join(f.namespace+"filter "))).bind("keyup"+f.namespace+"filter",function(d){if(a(this).attr("data-lastSearchTime",(new Date).getTime()),27===d.which)this.value="";else{if(g.filter_liveSearch===!1)return;if(""!==this.value&&("number"==typeof g.filter_liveSearch&&this.value.length=37&&d.which<=40)))return}b.filter.searching(c,!0,!0)}).bind(a.trim("search change keypress ".split(" ").join(f.namespace+"filter ")),function(d){var e=a(this).data("column");(13===d.which||"search"===d.type||"change"===d.type&&this.value!==f.lastSearch[e])&&(d.preventDefault(),a(this).attr("data-lastSearchTime",(new Date).getTime()),b.filter.searching(c,!1,!0))})}},searching:function(a,c,d){var e=a.config.widgetOptions;clearTimeout(e.searchTimer),"undefined"==typeof c||c===!0?e.searchTimer=setTimeout(function(){b.filter.checkFilters(a,c,d)},e.filter_liveSearch?e.filter_searchDelay:10):b.filter.checkFilters(a,c,d)},checkFilters:function(c,d,e){var f=c.config,g=f.widgetOptions,h=a.isArray(d),i=h?d:b.getFilters(c,!0),j=(i||[]).join("");return a.isEmptyObject(f.cache)?void(f.delayInit&&f.pager&&f.pager.initialized&&f.$table.trigger("updateCache",[function(){b.filter.checkFilters(c,!1,e)}])):(h&&(b.setFilters(c,i,!1,e!==!0),g.filter_initialized||(f.lastCombinedFilter="")),g.filter_hideFilters&&f.$table.find("."+b.css.filterRow).trigger(""===j?"mouseleave":"mouseenter"),f.lastCombinedFilter!==j||d===!1?(d===!1&&(f.lastCombinedFilter=null,f.lastSearch=[]),g.filter_initialized&&f.$table.trigger("filterStart",[i]),f.showProcessing?void setTimeout(function(){return b.filter.findRows(c,i,j),!1},30):(b.filter.findRows(c,i,j),!1)):void 0)},hideFilters:function(c,d){var e,f,g;a(c).find("."+b.css.filterRow).addClass("hideme").bind("mouseenter mouseleave",function(b){var c=b;e=a(this),clearTimeout(g),g=setTimeout(function(){/enter|over/.test(c.type)?e.removeClass("hideme"):a(document.activeElement).closest("tr")[0]!==e[0]&&""===d.lastCombinedFilter&&e.addClass("hideme")},200)}).find("input, select").bind("focus blur",function(c){f=a(this).closest("tr"),clearTimeout(g);var e=c;g=setTimeout(function(){""===b.getFilters(d.$table).join("")&&f["focus"===e.type?"removeClass":"addClass"]("hideme")},200)})},defaultFilter:function(c,d){if(""===c)return c;var e=b.filter.regex.iQuery,f=d.match(b.filter.regex.igQuery).length,g=f>1?a.trim(c).split(/\s/):[a.trim(c)],h=g.length-1,i=0,j=d;for(1>h&&f>1&&(g[1]=g[0]);e.test(j);)j=j.replace(e,g[i++]||""),e.test(j)&&h>i&&""!==(g[i]||"")&&(j=d.replace(e,j));return j},getLatestSearch:function(b){return b.sort(function(b,c){return a(c).attr("data-lastSearchTime")-a(b).attr("data-lastSearchTime")})},multipleColumns:function(c,d){var e,f,g,h=c.widgetOptions,i=h.filter_initialized||!d.filter(h.filter_anyColumnSelector).length,j=[],k=a.trim(b.filter.getLatestSearch(d).attr("data-column"));if(i&&/-/.test(k)&&(e=k.match(/(\d+)\s*-\s*(\d+)/g),a.each(e,function(a,b){var d,e=b.split(/\s*-\s*/),f=parseInt(e[0],10)||0,g=parseInt(e[1],10)||c.columns-1;for(f>g&&(d=f,f=g,g=d),g>=c.columns&&(g=c.columns-1);g>=f;f++)j.push(f);k=k.replace(b,"")})),i&&/,/.test(k)&&(f=k.split(/\s*,\s*/),a.each(f,function(a,b){""!==b&&(g=parseInt(b,10),gv;v++)u=d[v]||"",x||(v=m),x=!(!x||!o.length||0!==u.indexOf(o[v]||"")||C.alreadyFiltered.test(u)||/[=\"\|!]/.test(u)||/(>=?\s*-\d)/.test(u)||/(<=?\s*\d)/.test(u)||""!==u&&D.$filters&&D.$filters.eq(v).find("select").length&&!D.$headers.filter('[data-column="'+v+'"]:last').hasClass("filter-match"));for(w=g.not("."+E.filter_filteredRow).length,x&&0===w&&(x=!1),D.debug&&b.log("Searching through "+(x&&f>w?w:"all")+" rows"),(E.filter_$anyMatch&&E.filter_$anyMatch.length||d[D.columns])&&(G.anyMatchFlag=!0,G.anyMatchFilter=E.filter_$anyMatch&&b.filter.getLatestSearch(E.filter_$anyMatch).val()||d[D.columns]||"",D.sortLocaleCompare&&(G.anyMatchFilter=b.replaceAccents(G.anyMatchFilter)),E.filter_defaultFilter&&C.iQuery.test(b.getColumnData(c,E.filter_defaultFilter,D.columns,!0)||"")&&(G.anyMatchFilter=b.filter.defaultFilter(G.anyMatchFilter,b.getColumnData(c,E.filter_defaultFilter,D.columns,!0)),x=!1),G.iAnyMatchFilter=E.filter_ignoreCase&&D.ignoreCase?G.anyMatchFilter.toLocaleLowerCase():G.anyMatchFilter),h=0;f>h;h++)if(G.cacheArray=D.cache[i].normalized[h],n=g[h].className,!(C.child.test(n)||x&&C.filtered.test(n))){if(s=!0,n=g.eq(h).nextUntil("tr:not(."+D.cssChildRow+")"),G.childRowText=n.length&&E.filter_childRows?n.text():"",G.childRowText=E.filter_ignoreCase?G.childRowText.toLocaleLowerCase():G.childRowText,k=g.eq(h).children(),G.anyMatchFlag){if(m=b.filter.multipleColumns(D,E.filter_$anyMatch),G.anyMatch=!0,G.rowArray=k.map(function(c){if(a.inArray(c,m)>-1){var d;return G.parsed[c]?d=G.cacheArray[c]:(d=this?this.getAttribute(D.textAttribute)||this.textContent||a(this).text():"",d=a.trim(E.filter_ignoreCase?d.toLowerCase():d),D.sortLocaleCompare&&(d=b.replaceAccents(d))),d}}).get(),G.filter=G.anyMatchFilter,G.iFilter=G.iAnyMatchFilter,G.exact=G.rowArray.join(" "),G.iExact=E.filter_ignoreCase?G.exact.toLowerCase():G.exact,G.cache=G.cacheArray.slice(0,-1).join(" "),y=null,a.each(b.filter.types,function(b,c){return a.inArray(b,H)<0&&(q=c(D,G),null!==q)?(y=q,!1):void 0}),null!==y)s=y;else if(E.filter_startsWith)for(s=!1,m=D.columns;!s&&m>0;)m--,s=s||0===G.rowArray[m].indexOf(G.iFilter);else s=(G.iExact+G.childRowText).indexOf(G.iFilter)>=0;G.anyMatch=!1}for(m=0;m=0:G.filter===G.exact:"function"==typeof A?r=A(G.exact,G.cache,G.filter,m,g.eq(h)):"function"==typeof A[B||G.filter]&&(r=A[B||G.filter](G.exact,G.cache,G.filter,m,g.eq(h))):(y=null,a.each(b.filter.types,function(b,c){return a.inArray(b,z)<0&&(q=c(D,G),null!==q)?(y=q,!1):void 0}),null!==y?r=y:(G.exact=(G.iExact+G.childRowText).indexOf(b.filter.parseFilter(D,G.iFilter,m,G.parsed[m])),r=!E.filter_startsWith&&G.exact>=0||E.filter_startsWith&&0===G.exact)),s=r?s:!1);g.eq(h).toggle(s).toggleClass(E.filter_filteredRow,!s),n.length&&n.toggleClass(E.filter_filteredRow,!s)}}D.filteredRows+=g.not("."+E.filter_filteredRow).length,D.totalRows+=g.length,b.processTbody(c,j,!1)}D.lastCombinedFilter=e,D.lastSearch=d,D.$table.data("lastSearch",d),E.filter_saveFilters&&b.storage&&b.storage(c,"tablesorter-filters",d),D.debug&&b.benchmark("Completed filter widget search",t),E.filter_initialized&&D.$table.trigger("filterEnd",D),setTimeout(function(){D.$table.trigger("applyWidgets")},0)}},getOptionSource:function(c,d,e){c=a(c)[0];var f,g=c.config,h=g.widgetOptions,i=[],j=!1,k=h.filter_selectSource,l=g.$table.data("lastSearch")||[],m=a.isFunction(k)?!0:b.getColumnData(c,k,d);if(e&&""!==l[d]&&(e=!1),m===!0)j=k(c,d,e);else{if(m instanceof a||"string"===a.type(m)&&m.indexOf("")>=0)return m;a.isArray(m)?j=m:"object"===a.type(k)&&m&&(j=m(c,d,e))}return j===!1&&(j=b.filter.getOptions(c,d,e)),j=a.grep(j,function(b,c){return a.inArray(b,j)===c}),g.$headers.filter('[data-column="'+d+'"]:last').hasClass("filter-select-nosort")?j:(a.each(j,function(a,b){i.push({t:b,p:g.parsers&&g.parsers[d].format(b,c,[],d)})}),f=g.textSorter||"",i.sort(function(e,g){var h=e.p.toString(),i=g.p.toString();return a.isFunction(f)?f(h,i,!0,d,c):"object"==typeof f&&f.hasOwnProperty(d)?f[d](h,i,!0,d,c):b.sortNatural?b.sortNatural(h,i):!0}),j=[],a.each(i,function(a,b){j.push(b.t)}),j)},getOptions:function(b,c,d){b=a(b)[0];var e,f,g,h,i,j,k=b.config,l=k.widgetOptions,m=k.$table.children("tbody"),n=[];for(f=0;fe;e++)h=i.row?i.row[e]:i.normalized[e][k.columns].$row[0],d&&h.className.match(l.filter_filteredRow)||(l.filter_useParsedData||k.parsers[c].parsed||k.$headers.filter('[data-column="'+c+'"]:last').hasClass("filter-parsed")?n.push(""+i.normalized[e][c]):(j=h.cells[c],j&&n.push(a.trim(j.getAttribute(k.textAttribute)||j.textContent||a(j).text()))));return n},buildSelect:function(c,d,e,f,g){if(c=a(c)[0],d=parseInt(d,10),c.config.cache&&!a.isEmptyObject(c.config.cache)){var h,i,j,k,l,m,n=c.config,o=n.widgetOptions,p=n.$headers.filter('[data-column="'+d+'"]:last'),q='",r=n.$table.find("thead").find("select."+b.css.filter+'[data-column="'+d+'"]').val();if(("undefined"==typeof e||""===e)&&(e=b.filter.getOptionSource(c,d,g)),a.isArray(e)){for(h=0;h=0&&(k=j.split(o.filter_selectSourceSeparator),i=k[0],j=k[1]),q+=""!==e[h]?"":"";e=[]}l=(n.$filters?n.$filters:n.$table.children("thead")).find("."+b.css.filter),o.filter_$externalFilters&&(l=l&&l.length?l.add(o.filter_$externalFilters):o.filter_$externalFilters),m=l.filter('select[data-column="'+d+'"]'),m.length&&(m[f?"html":"append"](q),a.isArray(e)||m.append(e).val(r),m.val(r))}},buildDefault:function(a,c){var d,e,f,g=a.config,h=g.widgetOptions,i=g.columns;for(d=0;i>d;d++)e=g.$headers.filter('[data-column="'+d+'"]:last'),f=!(e.hasClass("filter-false")||e.hasClass("parser-false")),(e.hasClass("filter-select")||b.getColumnData(a,h.filter_functions,d)===!0)&&f&&b.filter.buildSelect(a,d,"",c,e.hasClass(h.filter_onlyAvail))}},b.getFilters=function(c,d,e,f){var g,h,i,j,k=!1,l=c?a(c)[0].config:"",m=l?l.widgetOptions:"";if(d!==!0&&m&&!m.filter_columnFilters)return a(c).data("lastSearch");if(l&&(l.$filters&&(h=l.$filters.find("."+b.css.filter)),m.filter_$externalFilters&&(h=h&&h.length?h.add(m.filter_$externalFilters):m.filter_$externalFilters),h&&h.length))for(k=e||[],g=0;gf;f++)for(l.$row=g.normalized[f][c.columns].$row,l.$cells=l.$row.children("th, td"),j=0;j1&&""!==d?c.hasClass(b.css.sortAsc)?(g=Math.floor(parseFloat(d)/e)*e,g>parseFloat(f||0)?g:parseFloat(f||0)):(g=Math.ceil(parseFloat(d)/e)*e,g=e?h[e-1]:d||"")},separator:function(b,c,d,e){var f=(d+"").split(b.widgetOptions.group_separator);return a.trim(f&&e>0&&f.length>=e?f[(e||1)-1]:"")},word:function(a,b,c,d){var e=(c+" ").match(/\w+/g);return e&&e.length>=d?e[d-1]:c||""},letter:function(a,b,c,d){return c?(c+" ").substring(0,d):""},date:function(a,b,c,d){var e=a.widgetOptions,f=new Date(c||""),g=f.getHours();return"year"===d?f.getFullYear():"month"===d?e.group_months[f.getMonth()]:"monthyear"===d?e.group_months[f.getMonth()]+" "+f.getFullYear():"day"===d?e.group_months[f.getMonth()]+" "+f.getDate():"week"===d?e.group_week[f.getDay()]:"time"===d?("00"+(g>12?g-12:0===g?g+12:g)).slice(-2)+":"+("00"+f.getMinutes()).slice(-2)+" "+("00"+e.group_time[g>=12?1:0]).slice(-2):e.group_dateString(f)}},update:function(c,d,e){if(!a.isEmptyObject(d.cache)){var f,g,h,i,j,k,l,m,n,o=e.grouping_language,p="",q=!1,r=d.sortList[0]?d.sortList[0][0]:-1;if(d.$table.find("tr.group-hidden").removeClass("group-hidden").end().find("tr.group-header").remove(),e.group_collapsible&&d.$table.data("pagerSavedHeight",0),r>=0&&!d.$headers.filter('[data-column="'+r+'"]:last').hasClass("group-false")){for(e.group_currentGroup="",e.group_currentGroups={},j=(d.$headers.filter('[data-column="'+r+'"]:last').attr("class")||"").match(/(group-\w+(-\w+)?)/g),k=j?j[0].split("-"):["group","letter",1],e.group_collapsible&&e.group_saveGroups&&b.storage&&(e.group_currentGroups=b.storage(c,"tablesorter-groups")||{},n="number"===k[1]&&k[2]>1?"dir"+d.sortList[0][1]:"",m=e.group_currentGroup=""+r+n+k.join(""),e.group_currentGroups[m]?q=!0:e.group_currentGroups[m]=[]),g=0;g1&&""!==h&&(h+=" - "+(parseInt(h,10)+(parseInt(k[2],10)-1)*(d.$headers.filter('[data-column="'+r+'"]:last').hasClass(b.css.sortAsc)?1:-1))),a.isFunction(e.group_formatter)&&(h=e.group_formatter((h||"").toString(),r,c,d,e)||h),i.eq(f).before(''+(e.group_collapsible?"":"")+''+h+''),e.group_saveGroups&&!q&&e.group_collapsed&&e.group_collapsible&&e.group_currentGroups[e.group_currentGroup].push(h)));d.$table.find("tr.group-header").bind("selectstart",!1).each(function(){var b,d,f,g=a(this),h=g.nextUntil("tr.group-header").filter(":visible");(e.group_count||a.isFunction(e.group_callback))&&(d=g.find(".group-count"),d.length&&(e.group_count&&d.html(e.group_count.replace(/\{num\}/g,h.length)),a.isFunction(e.group_callback)&&e.group_callback(g.find("td"),h,r,c))),e.group_saveGroups&&e.group_currentGroups[e.group_currentGroup].length?(f=g.find(".group-name").text().toLowerCase(),b=a.inArray(f,e.group_currentGroups[e.group_currentGroup])>-1,g.toggleClass("collapsed",b),h.toggleClass("group-hidden",b)):e.group_collapsed&&e.group_collapsible&&(g.addClass("collapsed"),h.addClass("group-hidden"))}),d.$table.trigger(e.group_complete)}}},bindEvents:function(c,d,e){e.group_collapsible&&(e.group_currentGroups=[],d.$table.on("click toggleGroup","tr.group-header",function(f){f.stopPropagation();var g,h,i,j=a(this),k=j.find(".group-name").text().toLowerCase();"click"===f.type&&f.shiftKey&&j.siblings(".group-header").trigger("toggleGroup"),j.toggleClass("collapsed"),j.nextUntil("tr.group-header").toggleClass("group-hidden",j.hasClass("collapsed")),e.group_saveGroups&&b.storage&&(h=d.$table.find(".group-header"),g=j.hasClass("collapsed"),e.group_currentGroups[e.group_currentGroup]||(e.group_currentGroups[e.group_currentGroup]=[]),g&&e.group_currentGroup?e.group_currentGroups[e.group_currentGroup].push(k):e.group_currentGroup&&(i=a.inArray(k,e.group_currentGroups[e.group_currentGroup]),i>-1&&e.group_currentGroups[e.group_currentGroup].splice(i,1)),b.storage(c,"tablesorter-groups",e.group_currentGroups))})),a(e.group_saveReset).on("click",function(){b.grouping.clearSavedGroups(c)}),d.$table.on("pagerChange.tsgrouping",function(){b.grouping.update(c,d,e)})},clearSavedGroups:function(a){a&&b.storage&&(b.storage(a,"tablesorter-groups",""),b.grouping.update(a,a.config,a.config.widgetOptions))}},b.addWidget({id:"group",priority:100,options:{group_collapsible:!0,group_collapsed:!1,group_saveGroups:!0,group_saveReset:null,group_count:" ({num})",group_separator:"-",group_formatter:null,group_callback:null,group_complete:"groupingComplete",group_months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],group_week:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],group_time:["AM","PM"],group_dateString:function(a){return a.toLocaleString()}},init:function(a,c,d,e){b.grouping.bindEvents(a,d,e)},format:function(a,c,d){b.grouping.update(a,c,d)},remove:function(a,b){b.$table.off("click","tr.group-header").off("pagerChange.tsgrouping").find(".group-hidden").removeClass("group-hidden").end().find("tr.group-header").remove()}})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-headerTitles.min.js b/dist/js/widgets/widget-headerTitles.min.js new file mode 100644 index 00000000..f7fbe43b --- /dev/null +++ b/dist/js/widgets/widget-headerTitles.min.js @@ -0,0 +1,5 @@ +/*! tablesorter headerTitles widget - updated 3/5/2014 (core v2.15.6) + * Requires tablesorter v2.8+ and jQuery 1.7+ + * by Rob Garrison + */ +!function(a){"use strict";var b=a.tablesorter;b.addWidget({id:"headerTitles",options:{headerTitle_useAria:!1,headerTitle_tooltip:"",headerTitle_cur_text:[" sort: A - Z"," sort: Z - A","ly unsorted"],headerTitle_cur_numeric:[" sort: 0 - 9"," sort: 9 - 0","ly unsorted"],headerTitle_nxt_text:[" sort: A - Z"," sort: Z - A","remove sort"],headerTitle_nxt_numeric:[" sort: 0 - 9"," sort: 9 - 0","remove sort"],headerTitle_output_sorted:"current{current}; activate to {next}",headerTitle_output_unsorted:"current{current}; activate to {next} ",headerTitle_output_nosort:"No sort available",headerTitle_type:[],headerTitle_callback:null},init:function(b,c,d,e){d.$table.on("refreshHeaderTitle",function(){c.format(b,d,e)}),a.isArray(e.headerTitle_tooltip)?d.$headers.each(function(){a(this).addClass(e.headerTitle_tooltip[this.column]||"")}):""!==e.headerTitle_tooltip&&d.$headers.addClass(e.headerTitle_tooltip)},format:function(c,d,e){var f;d.$headers.each(function(){var c=this,g=a(this),h=e.headerTitle_type[c.column]||d.parsers[c.column].type||"text",i=g.hasClass(b.css.sortAsc)?0:g.hasClass(b.css.sortDesc)?1:2,j=c.order[(c.count+1)%(d.sortReset?3:2)];e.headerTitle_useAria?f=g.hasClass("sorter-false")?e.headerTitle_output_nosort:g.attr("aria-label")||"":(f=(e.headerTitle_prefix||"")+(g.hasClass("sorter-false")?e.headerTitle_output_nosort:b.isValueInArray(c.column,d.sortList)>=0?e.headerTitle_output_sorted:e.headerTitle_output_unsorted),f=f.replace(/\{(current|next|name)\}/gi,function(a){return{"{name}":g.text(),"{current}":e["headerTitle_cur_"+h][i]||"","{next}":e["headerTitle_nxt_"+h][j]||""}[a.toLowerCase()]})),g.attr("title",a.isFunction(e.headerTitle_callback)?e.headerTitle_callback(g,f):f)})},remove:function(b,c,d){c.$headers.attr("title",""),c.$table.off("refreshHeaderTitle"),a.isArray(d.headerTitle_tooltip)?c.$headers.each(function(){a(this).removeClass(d.headerTitle_tooltip[this.column]||"")}):""!==d.headerTitle_tooltip&&c.$headers.removeClass(d.headerTitle_tooltip)}})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-math.min.js b/dist/js/widgets/widget-math.min.js new file mode 100644 index 00000000..038df1ed --- /dev/null +++ b/dist/js/widgets/widget-math.min.js @@ -0,0 +1,12 @@ +/*! tablesorter math widget - updated 2/9/2015 (v2.19.1) +* Requires tablesorter v2.16+ and jQuery 1.7+ +* by Rob Garrison +*/ +!function(a){"use strict";var b=a.tablesorter,c={events:"tablesorter-initialized update updateAll updateRows addRows updateCell filterReset filterEnd ".split(" ").join(".tsmath "),getRow:function(c,d,e,f){var g,h,i=c.config,j=[],k=e.closest("tr"),l=k.children();return k.hasClass(d.filter_filteredRow||"filtered")||(d.math_ignore.length&&(l=l.not("["+f+"=ignore]").not("[data-column="+d.math_ignore.join("],[data-column=")+"]")),j=l.not(e).map(function(){return g=a(this),h=g.attr(i.textAttribute),"undefined"==typeof h&&(h=this.textContent||g.text()),h=b.formatFloat(h.replace(/[^\w,. \-()]/g,""),c),isNaN(h)?0:h}).get()),j},getColumn:function(c,d,e,f,g){var h,i,j,k,l,m=[],n=c.config,o=d.filter_filteredRow||"filtered",p=parseInt(e.attr("data-column"),10),q=n.$table.children("tbody").children(),r=e.closest("tr");if("above"===f)for(k=q.index(r),h=k;h>=0;)j=q.eq(h).children().filter("[data-column="+p+"]"),l=j.filter("["+g+"^=above]").length,(!q.eq(h).hasClass(o)&&q.eq(h).not("["+g+"=ignore]").length&&h!==k||l&&h!==k)&&(l?h=0:j.length&&(i=j.attr(n.textAttribute),"undefined"==typeof i&&(i=j[0].textContent||j.text()),i=b.formatFloat(i.replace(/[^\w,. \-()]/g,""),c),m.push(isNaN(i)?0:i))),h--;else q.each(function(){j=a(this).children().filter("[data-column="+p+"]"),a(this).hasClass(o)||!j.not("["+g+"^=above],["+g+"^=col]").length||j.is(e)||(i=j.attr(n.textAttribute),"undefined"==typeof i&&(i=(j[0]?j[0].textContent:"")||j.text()),i=b.formatFloat(i.replace(/[^\w,. \-()]/g,""),c),m.push(isNaN(i)?0:i))});return m},getAll:function(c,d,e){var f,g,h,i=[],j=c.config,k=d.filter_filteredRow||"filtered",l=j.$table.children("tbody").children();return l.each(function(){a(this).hasClass(k)||a(this).children().each(function(){g=a(this),h=parseInt(g.attr("data-column"),10),!g.filter("["+e+"]").length&&a.inArray(h,d.math_ignore)<0&&(f=g.attr(j.textAttribute),"undefined"==typeof f&&(f=(g[0]?g[0].textContent:"")||g.text()),f=b.formatFloat(f.replace(/[^\w,. \-()]/g,""),c),i.push(isNaN(f)?0:f))})}),i},recalculate:function(a,d,e,f){if(d&&(!e.math_isUpdating||f)){f&&b.computeColumnIndex(d.$table.children("tbody").children());var g="data-"+(e.math_data||"math"),h=d.$tbodies.find("["+g+"]");c.mathType(a,e,h,e.math_priority,g),h=d.$table.find("."+d.cssInfoBlock+", tfoot").find("["+g+"]"),c.mathType(a,e,h,e.math_priority,g),c.mathType(a,e,d.$table.find("["+g+"^=all]"),["all"],g),e.math_isUpdating=!0,d.$table.trigger("update")}},mathType:function(d,e,f,g,h){if(f.length){var i,j,k,l,m,n=b.equations;"all"===g[0]&&(m=c.getAll(d,e,h)),a.each(g,function(b,g){f.filter("["+h+"^="+g+"]").each(function(){k=a(this),i=(k.attr(h)||"").replace(g+"-",""),l="row"===g?c.getRow(d,e,k,h):"all"===g?m:c.getColumn(d,e,k,g,h),n[i]&&(j=n[i](l),d.config.debug&&console&&console.log&&console.log(k.attr(h),l,"=",j),c.output(k,e,j,l))})})}},output:function(c,d,e,f){var g=b.formatMask(c.attr("data-"+d.math_data+"-mask")||d.math_mask,e,d.math_wrapPrefix,d.math_wrapSuffix);a.isFunction(d.math_complete)&&(g=d.math_complete(c,d,g,e,f)),g!==!1&&c.html(g)}};/** + * @preserve IntegraXor Web SCADA - JavaScript Number Formatter + * http:// www.integraxor.com/ + * author: KPL, KHL + * (c)2011 ecava + * Dual licensed under the MIT or GPL Version 2 licenses. + */ +b.formatMask=function(a,b,c,d){if(!a||isNaN(+b))return b;var e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x="",y="";if(s=a.length,t=a.search(/[0-9\-\+#]/),u=t>0?a.substring(0,t):"",x=u,t>0&&c&&(x=/\{content\}/.test(c||"")?(c||"").replace(/\{content\}/g,u||""):(c||"")+u),w=a.split("").reverse().join(""),v=w.search(/[0-9\-\+#]/),q=s-v,q+="."===a.substring(q,q+1)?1:0,u=v>0?a.substring(q,s):"",y=u,""!==u&&d&&(y=/\{content\}/.test(d||"")?(d||"").replace(/\{content\}/g,u||""):u+(d||"")),a=a.substring(t,q),b="-"==a.charAt(0)?-b:+b,e=0>b?b=-b:0,f=a.match(/[^\d\-\+#]/g),g=f&&f[f.length-1]||".",h=f&&f[1]&&f[0]||",",a=a.split(g),b=b.toFixed(a[1]&&a[1].length),b=+b+"",j=a[1]&&a[1].lastIndexOf("0"),l=b.split("."),(!l[1]||l[1]&&l[1].length<=j)&&(b=(+b).toFixed(j+1)),m=a[0].split(h),a[0]=m.join(""),i=a[0]&&a[0].indexOf("0"),i>-1)for(;l[0].lengthq;q++)o+=n.charAt(q),!((q-p+1)%k)&&r-k>q&&(o+=h);b[0]=o}return b[1]=a[1]&&b[1]?g+b[1]:"",x+((e?"-":"")+b[0]+b[1])+y},b.equations={count:function(a){return a.length},sum:function(b){var c=0;return a.each(b,function(a){c+=b[a]}),c},mean:function(a){var c=b.equations.sum(a);return c/a.length},median:function(a){a.sort(function(a,b){return a-b});var b=Math.floor(a.length/2);return a.length%2?a[b]:(a[b-1]+a[b])/2},mode:function(a){if(0===a.length)return"none";var b,c,d={},e=1,f=[a[0]];for(b=0;be?(f=[c],e=d[c]):d[c]===e&&(f.push(c),e=d[c]);return f.sort(function(a,b){return a-b})},max:function(a){return Math.max.apply(Math,a)},min:function(a){return Math.min.apply(Math,a)},range:function(a){var b=a.sort(function(a,b){return a-b});return b[a.length-1]-b[0]},variance:function(a,c){for(var d=b.equations.mean(a),e=0,f=a.length;f--;)e+=Math.pow(a[f]-d,2);return e/=a.length-(c?0:1)},varp:function(a){return b.equations.variance(a,!0)},vars:function(a){return b.equations.variance(a)},stdevs:function(a){var c=b.equations.variance(a);return Math.sqrt(c)},stdevp:function(a){var c=b.equations.variance(a,!0);return Math.sqrt(c)}},b.addWidget({id:"math",priority:100,options:{math_data:"math",math_ignore:[],math_mask:"#,##0.00",math_complete:null,math_priority:["row","above","col"],math_prefix:"",math_suffix:"",math_event:"recalculate"},init:function(d,e,f,g){f.$table.off(a.trim(c.events)+" "+a.trim("updateComplete.tsmath "+g.math_event)).on(a.trim(c.events)+" "+g.math_event,function(a){var e="tablesorter-initialized"===a.type;"updateAll"===a.type?b.computeColumnIndex(f.$table.children("tbody").children()):(!g.math_isUpdating||e)&&c.recalculate(d,f,g,e)}).on("updateComplete.tsmath",function(){setTimeout(function(){g.math_isUpdating=!1},500)}),g.math_isUpdating=!1},remove:function(b,d,e,f){f||a(b).off(a.trim(c.events)+" "+a.trim("updateComplete.tsmath "+e.math_event)).find("[data-"+e.math_data+"]").empty()}})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-output.min.js b/dist/js/widgets/widget-output.min.js new file mode 100644 index 00000000..a7d907b6 --- /dev/null +++ b/dist/js/widgets/widget-output.min.js @@ -0,0 +1 @@ +!function(a){"use strict";var b=a.tablesorter,c=b.output={event:"outputTable",regexQuote:/([\n\t]|<[^<]+>)/,regexBR:/(|\n)/g,regexIMG:/]+alt\s*=\s*['"]([^'"]+)['"][^>]*>/i,regexHTML:/<[^<]+>/g,replaceCR:"\\n",replaceTab:"\\t",popupTitle:"Output",popupStyle:"width:100%;height:100%;",message:"Your device does not support downloading. Please try again in desktop browser.",init:function(a){a.$table.off(c.event).on(c.event,function(){c.process(a,a.widgetOptions)})},processRow:function(b,d,e,f){var g,h,i,j,k,l,m=b.widgetOptions,n=[],o=m.output_duplicateSpans,p=e&&f&&m.output_headerRows&&a.isFunction(m.output_callbackJSON),q=0;return d.each(function(b){n[b]||(n[b]=[]),q=0,a(this).children().each(function(){if(g=a(this),g.filter("[rowspan]").length)for(j=parseInt(g.attr("rowspan"),10)-1,l=c.formatData(m,g.attr(m.output_dataAttrib)||g.html(),e),h=1;j>=h;h++)n[b+h]||(n[b+h]=[]),n[b+h][q]=e?l:o?l:"";if(g.filter("[colspan]").length)for(k=parseInt(g.attr("colspan"),10)-1,l=c.formatData(m,g.attr(m.output_dataAttrib)||g.html(),e),i=1;k>=i;i++)if(g.filter("[rowspan]").length)for(j=parseInt(g.attr("rowspan"),10),h=0;j>h;h++)n[b+h]||(n[b+h]=[]),n[b+h][q+i]=p?m.output_callbackJSON(g,l,q+i)||l+"("+(q+i)+")":e?l:o?l:"";else n[b][q+i]=p?m.output_callbackJSON(g,l,q+i)||l+"("+(q+i)+")":e?l:o?l:"";if("none"!==g.css("display")){for(;"undefined"!=typeof n[b][q];)q++;n[b][q]=n[b][q]||c.formatData(m,g.attr(m.output_dataAttrib)||g.html(),e),q++}})}),n},ignoreColumns:function(b,c){return a.each(c,function(d,e){c[d]=a.grep(e,function(c,d){return a.inArray(d,b.output_ignoreColumns)<0})}),c},process:function(d,e){var f,g,h,i,j,k,l=window.JSON&&JSON.hasOwnProperty("stringify"),m=0,n=(e.output_separator||",").toLowerCase(),o="json"===n,p="array"===n,q=o||p?",":e.output_separator,r=d.$table;e.output_regex=new RegExp("("+(/\\/.test(q)?"\\":"")+q+")"),g=r.find("thead tr:visible").not("."+(b.css.filterRow||"tablesorter-filter-row")),i=c.processRow(d,g,!0,o),h=r.children("tbody").children("tr"),h=/f/.test(e.output_saveRows)?h.not("."+(e.filter_filteredRow||"filtered")):/v/.test(e.output_saveRows)?h.filter(":visible"):h,j=c.processRow(d,h),k=i.length,e.output_ignoreColumns.length&&(i=c.ignoreColumns(e,i),j=c.ignoreColumns(e,j)),o?(n=[],a.each(j,function(a,b){n.push(c.row2Hash(i[k>1&&e.output_headerRows?a%k:k-1],b))}),f=l?JSON.stringify(n):n):(n=c.row2CSV(e,e.output_headerRows?i:[i[k>1&&e.output_headerRows?m%k:k-1]],p).concat(c.row2CSV(e,j,p)),f=p&&l?JSON.stringify(n):n.join("\n")),(!a.isFunction(e.output_callback)||e.output_callback(d,f))&&(/p/.test((e.output_delivery||"").toLowerCase())?c.popup(f,e.output_popupStyle,o||p):c.download(e,f))},row2CSV:function(a,b,c){var d,e,f=[],g=b.length;for(e=0;g>e;e++)d=b[e].join("").replace(/\"/g,""),b[e].length>0&&""!==d&&(f[f.length]=c?b[e]:b[e].join(a.output_separator));return f},row2Hash:function(b,c){var d={};return a.each(c,function(a,c){a"+c.popupTitle+'"),e.document.close(),e.focus(),!0},download:function(a,b){var d,e,f,g=window.navigator,h=document.createElement("a");if(/(iP)/g.test(g.userAgent))return alert(c.message),!1;try{f=!!new Blob}catch(i){f=!1}return f?(window.URL=window.webkitURL||window.URL,e=new Blob([b],{type:a.output_encoding}),g.msSaveBlob?g.msSaveBlob(e,a.output_saveFileName):(h.href=window.URL.createObjectURL(e),h.download=a.output_saveFileName,document.createEvent&&(d=document.createEvent("MouseEvents"),d.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),h.dispatchEvent(d))),!1):(window.open(a.output_encoding+encodeURIComponent(b)+"?download","_self"),!0)},remove:function(a){a.$table.off(c.event)}};b.addWidget({id:"output",options:{output_separator:",",output_ignoreColumns:[],output_dataAttrib:"data-name",output_headerRows:!1,output_delivery:"popup",output_saveRows:"filtered",output_duplicateSpans:!0,output_replaceQuote:"“;",output_includeHTML:!1,output_trimSpaces:!0,output_wrapQuotes:!1,output_popupStyle:"width=500,height=300",output_saveFileName:"mytable.csv",output_callback:function(){return!0},output_callbackJSON:function(a,b,c){return b+"("+c+")"},output_encoding:"data:application/octet-stream;charset=utf8,"},init:function(a,b,d){c.init(d)},remove:function(a,b){c.remove(b)}})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-pager.min.js b/dist/js/widgets/widget-pager.min.js new file mode 100644 index 00000000..a1ab1ed9 --- /dev/null +++ b/dist/js/widgets/widget-pager.min.js @@ -0,0 +1 @@ +!function(a){"use strict";var b,c=a.tablesorter;c.addWidget({id:"pager",priority:55,options:{pager_output:"{startRow} to {endRow} of {totalRows} rows",pager_updateArrows:!0,pager_startPage:0,pager_pageReset:0,pager_size:10,pager_maxOptionSize:20,pager_savePages:!0,pager_storageKey:"tablesorter-pager",pager_fixedHeight:!1,pager_countChildRows:!1,pager_removeRows:!1,pager_ajaxUrl:null,pager_customAjaxUrl:function(a,b){return b},pager_ajaxObject:{dataType:"json"},pager_processAjaxOnInit:!0,pager_ajaxProcessing:function(){return[0,[],null]},pager_css:{container:"tablesorter-pager",errorRow:"tablesorter-errorRow",disabled:"disabled"},pager_selectors:{container:".pager",first:".first",prev:".prev",next:".next",last:".last",gotoPage:".gotoPage",pageDisplay:".pagedisplay",pageSize:".pagesize"}},init:function(a){b.init(a)},format:function(a,c){return c.pager&&c.pager.initialized?void b.moveToPage(a,c.pager,!1):b.initComplete(a,c)},remove:function(a,c,d,e){b.destroyPager(a,c,e)}}),b=c.pager={init:function(d){if(!d.hasInitialized||!d.config.pager.initialized){var e,f=d.config,g=f.widgetOptions,h=g.pager_selectors,i=f.pager=a.extend({totalPages:0,filteredRows:0,filteredPages:0,currentFilters:[],page:g.pager_startPage,startRow:0,endRow:0,ajaxCounter:0,$size:null,last:{},setSize:g.pager_size,setPage:g.pager_startPage,events:"filterInit filterStart filterEnd sortEnd disable enable destroy updateComplete pageSize pageSet pageAndSize pagerUpdate "},f.pager);i.isInitializing||(i.isInitializing=!0,f.debug&&c.log("Pager initializing"),i.size=a.data(d,"pagerLastSize")||g.pager_size,i.$container=a(h.container).addClass(g.pager_css.container).show(),i.$goto=i.$container.find(h.gotoPage),i.$size=i.$container.find(h.pageSize),i.totalRows=f.$tbodies.eq(0).children("tr").not(g.pager_countChildRows?"":"."+f.cssChildRow).length,i.oldAjaxSuccess=i.oldAjaxSuccess||g.pager_ajaxObject.success,f.appender=b.appender,i.initializing=!0,g.pager_savePages&&c.storage&&(e=c.storage(d,g.pager_storageKey)||{},i.page=(isNaN(e.page)?i.page:e.page)||i.setPage||0,i.size=(isNaN(e.size)?i.size:e.size)||i.setSize||10,a.data(d,"pagerLastSize",i.size)),i.regexRows=new RegExp("("+(g.filter_filteredRow||"filtered")+"|"+f.selectorRemove.slice(1)+"|"+f.cssChildRow+")"),i.initialized=!1,f.$table.trigger("pagerBeforeInitialized",f),b.enablePager(d,f,!1),i.ajaxObject=g.pager_ajaxObject,i.ajaxObject.url=g.pager_ajaxUrl,"string"==typeof g.pager_ajaxUrl?(i.ajax=!0,g.filter_serversideFiltering=!0,f.serverSideSorting=!0,b.moveToPage(d,i)):(i.ajax=!1,f.$table.trigger("appendCache",[{},!0])))}},initComplete:function(a,d){var e=d.pager;b.bindEvents(a,d),b.setPageSize(a,0,d),e.ajax||b.hideRowsSetup(a,d),e.initialized=!0,e.initializing=!1,e.isInitializing=!1,d.$table.trigger("pagerInitialized",d),d.widgetOptions.filter_initialized&&c.hasWidget(a,"filter")||b.updatePageDisplay(a,d,!e.ajax)},bindEvents:function(c,d){var e,f,g=d.pager,h=d.widgetOptions,i=h.pager_selectors;d.$table.off(a.trim(g.events.split(" ").join(".pager "))).on("filterInit.pager filterStart.pager",function(b,c){g.currentFilters=a.isArray(c)?c:d.$table.data("lastSearch"),"filterStart"===b.type&&h.pager_pageReset!==!1&&(d.lastCombinedFilter||"")!==(g.currentFilters||[]).join("")&&(g.page=h.pager_pageReset)}).on("filterEnd.pager sortEnd.pager",function(){g.currentFilters=d.$table.data("lastSearch"),(g.initialized||g.initializing)&&(d.delayInit&&d.rowsCopy&&0===d.rowsCopy.length&&b.updateCache(c),b.updatePageDisplay(c,d,!1),d.$table.trigger("applyWidgets"))}).on("disable.pager",function(a){a.stopPropagation(),b.showAllRows(c,d)}).on("enable.pager",function(a){a.stopPropagation(),b.enablePager(c,d,!0)}).on("destroy.pager",function(a,e){a.stopPropagation(),b.destroyPager(c,d,e)}).on("updateComplete.pager",function(a,c,e){if(a.stopPropagation(),c&&!e){var f=d.$tbodies.eq(0).children("tr").not(d.selectorRemove);g.totalRows=f.length-(h.pager_countChildRows?0:f.filter("."+d.cssChildRow).length),g.totalPages=Math.ceil(g.totalRows/g.size),f.length&&d.rowsCopy&&0===d.rowsCopy.length&&b.updateCache(c),g.page>=g.totalPages&&b.moveToLastPage(c,g),b.hideRows(c,d),b.changeHeight(c,d),b.updatePageDisplay(c,d,!1),d.$table.trigger("applyWidgets"),b.updatePageDisplay(c,d)}}).on("pageSize.pager refreshComplete.pager",function(a,e){a.stopPropagation(),b.setPageSize(c,parseInt(e,10)||g.setSize||10,d),b.hideRows(c,d),b.updatePageDisplay(c,d,!1)}).on("pageSet.pager pagerUpdate.pager",function(a,e){a.stopPropagation(),g.page=(parseInt(e,10)||1)-1,"pagerUpdate"===a.type&&(g.last.page=!0),b.moveToPage(c,g,!0),b.updatePageDisplay(c,d,!1)}).on("pageAndSize.pager",function(a,e,f){a.stopPropagation(),g.page=(parseInt(e,10)||1)-1,b.setPageSize(c,parseInt(f,10)||g.setSize||10,d),b.moveToPage(c,g,!0),b.hideRows(c,d),b.updatePageDisplay(c,d,!1)}),e=[i.first,i.prev,i.next,i.last],f=["moveToFirstPage","moveToPrevPage","moveToNextPage","moveToLastPage"],g.$container.find(e.join(",")).attr("tabindex",0).off("click.pager").on("click.pager",function(d){d.stopPropagation();var i,j=a(this),k=e.length;if(!j.hasClass(h.pager_css.disabled))for(i=0;k>i;i++)if(j.is(e[i])){b[f[i]](c,g);break}}),g.$goto.length&&g.$goto.off("change.pager").on("change.pager",function(){g.page=a(this).val()-1,b.moveToPage(c,g,!0),b.updatePageDisplay(c,d,!1)}),g.$size.length&&(g.$size.find("option").removeAttr("selected"),g.$size.off("change.pager").on("change.pager",function(){return g.$size.val(a(this).val()),a(this).hasClass(h.pager_css.disabled)||(b.setPageSize(c,parseInt(a(this).val(),10),d),b.changeHeight(c,d)),!1}))},pagerArrows:function(a,b){var c=a.pager,d=!!b,e=d||0===c.page,f=Math.min(c.totalPages,c.filteredPages),g=d||c.page===f-1||0===f,h=a.widgetOptions,i=h.pager_selectors;h.pager_updateArrows&&(c.$container.find(i.first+","+i.prev).toggleClass(h.pager_css.disabled,e).attr("aria-disabled",e),c.$container.find(i.next+","+i.last).toggleClass(h.pager_css.disabled,g).attr("aria-disabled",g))},calcFilters:function(b,c){var d,e=c.widgetOptions,f=c.pager,g=c.$table.hasClass("hasFilters");g&&!e.pager_ajaxUrl?a.isEmptyObject(c.cache)?f.filteredRows=f.totalRows=c.$tbodies.eq(0).children("tr").not(e.pager_countChildRows?"":"."+c.cssChildRow).length:(d=c.$table.children("tbody").index(c.$tbodies.eq(0)),f.filteredRows=0,a.each(c.cache[d].normalized,function(a,b){f.filteredRows+=f.regexRows.test(b[c.columns].$row[0].className)?0:1})):g||(f.filteredRows=f.totalRows)},updatePageDisplay:function(d,e,f){if(!e.pager.initializing){var g,h,i,j=e.widgetOptions,k=e.pager,l=k.size||k.setSize||10;j.pager_countChildRows&&h.push(e.cssChildRow),k.$size.add(k.$goto).removeClass(j.pager_css.disabled).removeAttr("disabled").attr("aria-disabled","false"),k.totalPages=Math.ceil(k.totalRows/l),e.totalRows=k.totalRows,b.calcFilters(d,e),e.filteredRows=k.filteredRows,k.filteredPages=Math.ceil(k.filteredRows/l)||0,Math.min(k.totalPages,k.filteredPages)>=0&&(h=k.size*k.page>k.filteredRows&&f,k.page=h?j.pager_pageReset||0:k.page,k.startRow=h?k.size*k.page+1:0===k.filteredRows?0:k.size*k.page+1,k.endRow=Math.min(k.filteredRows,k.totalRows,k.size*(k.page+1)),i=k.$container.find(j.pager_selectors.pageDisplay),g=(k.ajaxData&&k.ajaxData.output?k.ajaxData.output||j.pager_output:j.pager_output).replace(/\{page([\-+]\d+)?\}/gi,function(a,b){return k.totalPages?k.page+(b?parseInt(b,10):1):0}).replace(/\{\w+(\s*:\s*\w+)?\}/gi,function(a){var b,c,d=a.replace(/[{}\s]/g,""),e=d.split(":"),f=k.ajaxData,g=/(rows?|pages?)$/i.test(d)?0:"";return/(startRow|page)/.test(e[0])&&"input"===e[1]?(b=(""+("page"===e[0]?k.totalPages:k.totalRows)).length,c="page"===e[0]?k.page+1:k.startRow,''):e.length>1&&f&&f[e[0]]?f[e[0]][e[1]]:k[d]||(f?f[d]:g)||g}),k.$goto.length&&(h="",a.each(b.buildPageSelect(k,e),function(a,b){h+='"}),k.$goto.html(h).val(k.page+1)),i.length&&(i["INPUT"===i[0].tagName?"val":"html"](g),i.find(".ts-startRow, .ts-page").off("change.pager").on("change.pager",function(){var b=a(this).val(),c=a(this).hasClass("ts-startRow")?Math.floor(b/k.size)+1:b;e.$table.trigger("pageSet.pager",[c])}))),b.pagerArrows(e),b.fixHeight(d,e),k.initialized&&f!==!1&&(e.$table.trigger("pagerComplete",e),j.pager_savePages&&c.storage&&c.storage(d,j.pager_storageKey,{page:k.page,size:k.size}))}},buildPageSelect:function(b,c){var d,e,f,g,h,i,j=c.widgetOptions,k=Math.min(b.totalPages,b.filteredPages)||1,l=5*Math.ceil(k/j.pager_maxOptionSize/5),m=k>j.pager_maxOptionSize,n=b.page+1,o=l,p=k-l,q=[1],r=m?l:1;for(d=r;k>=d;)q.push(d),d+=m?l:1;if(q.push(k),m){for(f=[],e=Math.max(Math.floor(j.pager_maxOptionSize/l)-1,5),o=n-e,1>o&&(o=1),p=n+e,p>k&&(p=k),d=o;p>=d;d++)f.push(d);q=a.grep(q,function(b,c){return a.inArray(b,q)===c}),h=q.length,i=f.length,h-i>l/2&&h+i>j.pager_maxOptionSize&&(g=Math.floor(h/2)-Math.floor(i/2),Array.prototype.splice.apply(q,[g,i])),q=q.concat(f)}return q=a.grep(q,function(b,c){return a.inArray(b,q)===c}).sort(function(a,b){return a-b})},fixHeight:function(b,c){var d,e,f=c.pager,g=c.widgetOptions,h=c.$tbodies.eq(0);h.find("tr.pagerSavedHeightSpacer").remove(),g.pager_fixedHeight&&!f.isDisabled&&(e=a.data(b,"pagerSavedHeight"),e&&(d=e-h.height(),d>5&&a.data(b,"pagerLastSize")===f.size&&h.children("tr:visible").length')))},changeHeight:function(c,d){var e,f=d.$tbodies.eq(0);f.find("tr.pagerSavedHeightSpacer").remove(),f.children("tr:visible").length||f.append(' '),e=f.children("tr").eq(0).height()*d.pager.size,a.data(c,"pagerSavedHeight",e),b.fixHeight(c,d),a.data(c,"pagerLastSize",d.pager.size)},hideRows:function(a,b){if(!b.widgetOptions.pager_ajaxUrl){var d,e=0,f=b.pager,g=b.widgetOptions,h=b.$tbodies.eq(0).children("tr"),i=h.length,j=f.page*f.size,k=j+f.size,l=g&&g.filter_filteredRow||"filtered",m=0,n=0;for(f.cacheIndex=[],d=0;i>d;d++)h[d].className.match(l)||(n===j&&h[d].className.match(b.cssChildRow)?h[d].style.display="none":(h[d].style.display=n>=j&&k>n?"":"none",m!==n&&n>=j&&k>n&&(f.cacheIndex.push(d),m=n),n+=h[d].className.match(b.cssChildRow+"|"+b.selectorRemove.slice(1))&&!g.pager_countChildRows?0:1,n===k&&"none"!==h[d].style.display&&h[d].className.match(c.css.cssHasChild)&&(e=d)));if(e>0&&h[e].className.match(c.css.cssHasChild))for(;++ek;k++){for(v+="",l=0;l"+r[k][l]+"";v+=""}j.pager_processAjaxOnInit&&f.$tbodies.eq(0).html(v)}j.pager_processAjaxOnInit=!0,q&&q.length===x&&(n=u.hasClass("hasStickyHeaders"),p=n?j.$sticky.children("thead:first").children("tr").children():"",o=u.find("tfoot tr:first").children(),f.$headers.filter("th").each(function(b){var d,e=a(this);e.find("."+c.css.icon).length?(d=e.find("."+c.css.icon).clone(!0),e.find(".tablesorter-header-inner").html(q[b]).append(d),n&&p.length&&(d=p.eq(b).find("."+c.css.icon).clone(!0),p.eq(b).find(".tablesorter-header-inner").html(q[b]).append(d))):(e.find(".tablesorter-header-inner").html(q[b]),n&&p.length&&p.eq(b).find(".tablesorter-header-inner").html(q[b])),o.eq(b).html(q[b])}))}f.showProcessing&&c.isProcessing(e),i.totalPages=Math.ceil(i.totalRows/(i.size||i.setSize||10)),i.last.totalRows=i.totalRows,i.last.currentFilters=i.currentFilters,i.last.sortList=(f.sortList||[]).join(","),i.initializing=!1,b.updatePageDisplay(e,f,!1),u.trigger("updateCache",[function(){i.initialized&&setTimeout(function(){u.trigger("applyWidgets").trigger("pagerChange",i),b.updatePageDisplay(e,f)},0)}])}i.initialized||f.$table.trigger("applyWidgets")},getAjax:function(d,e){var f,g=b.getAjaxUrl(d,e),h=a(document),i=e.pager;""!==g&&(e.showProcessing&&c.isProcessing(d,!0),h.on("ajaxError.pager",function(a,c,f,g){b.renderAjax(null,d,e,c,g),h.off("ajaxError.pager")}),f=++i.ajaxCounter,i.last.ajaxUrl=g,i.ajaxObject.url=g,i.ajaxObject.success=function(a,c,g){fm)return void(i.debug&&c.log("Pager: no rows for pager to render"));if(j.page>=j.totalPages)return b.moveToLastPage(a,j);if(j.cacheIndex=[],j.isDisabled=!1,j.initialized&&i.$table.trigger("pagerChange",i),k.pager_removeRows){for(c.clearTableBody(a),e=c.processTbody(a,i.$tbodies.eq(0),!0),f=l?0:n,g=l?0:n,h=0;o>h&&fn&&o>=h&&(h++,j.cacheIndex.push(f),e.append(d[f]))),f++;c.processTbody(a,e,!1)}else b.hideRows(a,i);b.updatePageDisplay(a,i),k.pager_startPage=j.page,k.pager_size=j.size,a.isUpdating&&i.$table.trigger("updateComplete",[a,!0])},showAllRows:function(d,e){var f=e.pager,g=e.widgetOptions;f.ajax?b.pagerArrows(e,!0):(f.isDisabled=!0,a.data(d,"pagerLastPage",f.page),a.data(d,"pagerLastSize",f.size),f.page=0,f.size=f.totalRows,f.totalPages=1,e.$table.addClass("pagerDisabled").removeAttr("aria-describedby").find("tr.pagerSavedHeightSpacer").remove(),b.renderTable(d,e.rowsCopy),e.$table.trigger("applyWidgets"),e.debug&&c.log("pager disabled")),f.$size.add(f.$goto).each(function(){a(this).attr("aria-disabled","true").addClass(g.pager_css.disabled)[0].disabled=!0})},updateCache:function(c){var d=c.config,e=d.pager;d.$table.trigger("updateCache",[function(){if(!a.isEmptyObject(c.config.cache)){var f,g=[],h=d.$table.children("tbody").index(d.$tbodies.eq(0)),i=c.config.cache[h].normalized;for(e.totalRows=i.length,f=0;fg-1&&0!==g&&(e.page=g-1),j.currentFilters=""===(j.currentFilters||[]).join("")?[]:j.currentFilters,e.currentFilters=""===(e.currentFilters||[]).join("")?[]:e.currentFilters,(j.page!==e.page||j.size!==e.size||j.totalRows!==e.totalRows||(j.currentFilters||[]).join(",")!==(e.currentFilters||[]).join(",")||(j.ajaxUrl||"")!==(e.ajaxObject.url||"")||(j.optAjaxUrl||"")!==(i.pager_ajaxUrl||"")||j.sortList!==(h.sortList||[]).join(","))&&(h.debug&&c.log("Pager changing to page "+e.page),e.last={page:e.page,size:e.size,sortList:(h.sortList||[]).join(","),totalRows:e.totalRows,currentFilters:e.currentFilters||[],ajaxUrl:e.ajaxObject.url||"",optAjaxUrl:i.pager_ajaxUrl},e.ajax?b.getAjax(d,h):e.ajax||b.renderTable(d,h.rowsCopy),a.data(d,"pagerLastPage",e.page),e.initialized&&f!==!1&&(h.$table.trigger("pageMoved",h).trigger("applyWidgets"),!e.ajax&&d.isUpdating&&h.$table.trigger("updateComplete",[d,!0]))))}},setPageSize:function(c,d,e){var f=e.pager;f.size=d||f.size||f.setSize||10,f.$size.val(f.size),a.data(c,"pagerLastPage",f.page),a.data(c,"pagerLastSize",f.size),f.totalPages=Math.ceil(f.totalRows/f.size),f.filteredPages=Math.ceil(f.filteredRows/f.size),b.moveToPage(c,f,!0)},moveToFirstPage:function(a,c){c.page=0,b.moveToPage(a,c,!0)},moveToLastPage:function(a,c){c.page=Math.min(c.totalPages,c.filteredPages)-1,b.moveToPage(a,c,!0)},moveToNextPage:function(a,c){c.page++,c.page>=Math.min(c.totalPages,c.filteredPages)-1&&(c.page=Math.min(c.totalPages,c.filteredPages)-1),b.moveToPage(a,c,!0)},moveToPrevPage:function(a,c){c.page--,c.page<=0&&(c.page=0),b.moveToPage(a,c,!0)},destroyPager:function(d,e,f){var g=e.pager;g.initialized=!1,e.$table.off(a.trim(g.events.split(" ").join(".pager "))),f||(b.showAllRows(d,e),g.$container.hide(),e.appender=null,delete d.config.rowsCopy,c.storage&&c.storage(d,e.widgetOptions.pager_storageKey,""))},enablePager:function(d,e,f){var g,h=e.pager;h.isDisabled=!1,h.page=a.data(d,"pagerLastPage")||h.page||0,h.size=a.data(d,"pagerLastSize")||parseInt(h.$size.find("option[selected]").val(),10)||h.size||h.setSize||10,h.$size.val(h.size),h.totalPages=Math.ceil(Math.min(h.totalRows,h.filteredRows)/h.size),e.$table.removeClass("pagerDisabled"),d.id&&(g=d.id+"_pager_info",h.$container.find(e.widgetOptions.pager_selectors.pageDisplay).attr("id",g),e.$table.attr("aria-describedby",g)),b.changeHeight(d,e),f&&(e.$table.trigger("updateRows"),b.setPageSize(d,h.size,e),b.hideRowsSetup(d,e),e.debug&&c.log("pager enabled"))},appender:function(c,d){var e=c.config,f=e.widgetOptions,g=e.pager;g.ajax?b.moveToPage(c,g,!0):(e.rowsCopy=d,g.totalRows=f.pager_countChildRows?e.$tbodies.eq(0).children("tr").length:d.length,g.size=a.data(c,"pagerLastSize")||g.size||f.pager_size||g.setSize||10,g.totalPages=Math.ceil(g.totalRows/g.size),b.moveToPage(c,g),b.updatePageDisplay(c,e,!1))}},c.showError=function(b,c){a(b).each(function(){var b,d=this.config,e=d.widgetOptions,f=d.pager&&d.pager.cssErrorRow||e.pager_css&&e.pager_css.errorRow||"tablesorter-errorRow";d&&("undefined"==typeof c?d.$table.find("thead").find(d.selectorRemove).remove():b=a(/tr\>/.test(c)?c:''+c+"").click(function(){a(this).remove()}).appendTo(d.$table.find("thead:first")).addClass(f+" "+d.selectorRemove.slice(1)).attr({role:"alert","aria-live":"assertive"}))})}}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-print.min.js b/dist/js/widgets/widget-print.min.js new file mode 100644 index 00000000..ab123ca0 --- /dev/null +++ b/dist/js/widgets/widget-print.min.js @@ -0,0 +1 @@ +!function(a){"use strict";var b=a.tablesorter,c=b.printTable={event:"printTable",basicStyle:"table, tr, td, th { border : solid 1px black; border-collapse : collapse; } td, th { padding: 2px; }",init:function(a){a.$table.unbind(c.event).bind(c.event,function(){c.process(a,a.widgetOptions)})},process:function(b,d){var e,f=a("
    ").append(b.$table.clone()),g=c.basicStyle+"table { width: 100% }.tablesorter-filter-row { display: none }.tablesorter-header { background-image: none !important; }";f.find("["+d.print_dataAttrib+"]").each(function(){e=a(this),e.text(e.attr(d.print_dataAttrib))}),/a/i.test(d.print_rows)?g+="tbody tr { display: table-row !important; }":/f/i.test(d.print_rows)&&(g+="tbody tr:not(."+(d.filter_filteredRow||"filtered")+") { display: table-row !important; }"),/s/i.test(d.print_columns)&&b.selector&&b.widgets.indexOf("columnSelector")>=0?g+=d.columnSelector_mediaquery&&b.selector.auto?"":b.selector.$style.text():/a/i.test(d.print_columns)&&(g+="td, th { display: table-cell !important; }"),g+=d.print_extraCSS,a.isFunction(d.print_callback)?d.print_callback(b,f,g):c.printOutput(b,f.html(),g)},printOutput:function(a,b,c){var d=a.widgetOptions,e=window.open("",d.print_title,"width=500,height=300"),f=d.print_title||a.$table.find("caption").text()||a.$table[0].id||document.title||"table";return e.document.write(""+f+""+(d.print_styleSheet?'':"")+""+b+""),e.document.close(),e.print(),e.close(),!0},remove:function(a){a.$table.off(c.event)}};b.addWidget({id:"print",options:{print_title:"",print_dataAttrib:"data-name",print_rows:"filtered",print_columns:"selected",print_extraCSS:"",print_styleSheet:"",print_callback:null},init:function(a,b,d){c.init(d)},remove:function(a,b){c.remove(b)}})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-reflow.min.js b/dist/js/widgets/widget-reflow.min.js new file mode 100644 index 00000000..80f20af7 --- /dev/null +++ b/dist/js/widgets/widget-reflow.min.js @@ -0,0 +1 @@ +!function(a){"use strict";var b=a.tablesorter,c={init:function(b,d,e){var f,g=e.reflow_dataAttrib,h=e.reflow_headerAttrib,i=[];d.$table.addClass(e.reflow_className).off("refresh.tsreflow updateComplete.tsreflow2").on("refresh.tsreflow updateComplete.tsreflow2",function(){c.init(b,d,e)}),d.$headers.each(function(){f=a(this),i.push(a.trim(f.attr(h)||f.text()))}),d.$tbodies.children().each(function(){a(this).children().each(function(b){a(this).attr(g,i[b])})})},init2:function(d,e,f){var g,h,i,j,k,l,m=e.columns,n=f.reflow2_headerAttrib,o=[];for(e.$table.addClass(f.reflow2_className).off("refresh.tsreflow2 updateComplete.tsreflow2").on("refresh.tsreflow2 updateComplete.tsreflow2",function(){c.init2(d,e,f)}),i=0;m>i;i++)j=e.$headers.filter('[data-column="'+i+'"]'),j.length>1?(k=[],j.each(function(){g=a(this),g.hasClass(f.reflow2_classIgnore)||k.push(g.attr(n)||g.text())})):k=[j.attr(n)||j.text()],o.push(k);k='=0;)g.prepend(k+(0===i&&l>1?" "+f.reflow2_labelTop:"")+'">'+o[b][i]+""),i--}),b.processTbody(d,h,!1)})},remove:function(a,b,c){b.$table.removeClass(c.reflow_className)},remove2:function(a,b,c){b.$table.removeClass(c.reflow2_className)}};b.addWidget({id:"reflow",options:{reflow_className:"ui-table-reflow",reflow_headerAttrib:"data-name",reflow_dataAttrib:"data-title"},init:function(a,b,d,e){c.init(a,d,e)},remove:function(a,b,d){c.remove(a,b,d)}}),b.addWidget({id:"reflow2",options:{reflow2_className:"ui-table-reflow",reflow2_classIgnore:"ui-table-reflow-ignore",reflow2_headerAttrib:"data-name",reflow2_labelClass:"ui-table-cell-label",reflow2_labelTop:"ui-table-cell-label-top"},init:function(a,b,d,e){c.init2(a,d,e)},remove:function(a,b,d){c.remove2(a,b,d)}})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-repeatheaders.min.js b/dist/js/widgets/widget-repeatheaders.min.js new file mode 100644 index 00000000..408b83f7 --- /dev/null +++ b/dist/js/widgets/widget-repeatheaders.min.js @@ -0,0 +1,5 @@ +/*! tablesorter repeatHeaders widget - updated 2/7/2015 (v2.19.0) +* Requires tablesorter v2.8+ and jQuery 1.7+ +* Original by Christian Bach from the example-widgets.html demo +*/ +!function(a){"use strict";a.tablesorter.addWidget({id:"repeatHeaders",priority:10,options:{rowsToSkip:4},format:function(b,c,d){var e,f,g,h,i="";if(!d.repeatHeaders){for(i='',e=0;e"+a.trim(c.$headers.eq(e).text())+"";d.repeatHeaders=i+""}for(h=d&&d.rowsToSkip||4,c.$table.find("tr.repeated-header").remove(),f=c.$tbodies.find("tr"),g=f.length,e=h;g>e;e+=h)f.eq(e).before(d.repeatHeaders)},remove:function(a,b,c){c.repeatHeaders="",b.$table.find("tr.repeated-header").remove()}})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-resizable.min.js b/dist/js/widgets/widget-resizable.min.js new file mode 100644 index 00000000..64ff543e --- /dev/null +++ b/dist/js/widgets/widget-resizable.min.js @@ -0,0 +1,2 @@ +/*! Widget: resizable */ +!function(a,b){"use strict";var c=a.tablesorter=a.tablesorter||{};a.extend(c.css,{resizer:"tablesorter-resizer"}),c.addWidget({id:"resizable",priority:40,options:{resizable:!0,resizable_addLastColumn:!1,resizable_widths:[],resizable_throttle:!1},format:function(d,e,f){if(!e.$table.hasClass("hasResizable")){e.$table.addClass("hasResizable"),c.resizableReset(d,!0);var g,h,i,j,k,l={},m=e.$table,n=m.parent(),o="auto"===m.parent().css("overflow"),p=0,q=null,r=null,s=Math.abs(m.parent().width()-m.width())<20,t=function(a){if(0!==p&&q){var b=a.pageX-p,c=q.width();q.width(c+b),q.width()!==c&&s?r.width(r.width()-b):o&&(m.width(function(a,c){return c+b}),r.length||(n[0].scrollLeft=m.width())),p=a.pageX}},u=function(){c.storage&&q&&r&&(l={},l[q.index()]=q.width(),l[r.index()]=r.width(),q.width(l[q.index()]),r.width(l[r.index()]),f.resizable!==!1&&c.storage(d,"tablesorter-resizable",e.$headers.map(function(){return a(this).width()}).get())),p=0,q=r=null,a(b).trigger("resize")};if(l=c.storage&&f.resizable!==!1?c.storage(d,"tablesorter-resizable"):{})for(j in l)!isNaN(j)&&j
    '),f.resizable_addLastColumn||(i=i.slice(0,-1)),h=h?h.add(i):i}),h.each(function(){var b=a(this),d=parseInt(b.css("padding-right"),10)+10;b.find("."+c.css.wrapper).append('
    ')}).find("."+c.css.resizer).bind("mousedown",function(b){q=a(b.target).closest("th");var c=e.$headers.filter('[data-column="'+q.attr("data-column")+'"]');c.length>1&&(q=q.add(c)),r=b.shiftKey?q.parent().find("th").not(".resizable-false").filter(":last"):q.nextAll(":not(.resizable-false)").eq(0),p=b.pageX}),a(document).bind("mousemove.tsresize",function(a){0!==p&&q&&(f.resizable_throttle?(clearTimeout(k),k=setTimeout(function(){t(a)},isNaN(f.resizable_throttle)?5:f.resizable_throttle)):t(a))}).bind("mouseup.tsresize",function(){u()}),m.find("thead:first").bind("contextmenu.tsresize",function(){c.resizableReset(d);var b=a.isEmptyObject?a.isEmptyObject(l):!0;return l={},b})}},remove:function(a,b){b.$table.removeClass("hasResizable").children("thead").unbind("mouseup.tsresize mouseleave.tsresize contextmenu.tsresize").children("tr").children().unbind("mousemove.tsresize mouseup.tsresize").find("."+c.css.resizer).remove(),c.resizableReset(a)}}),c.resizableReset=function(b,d){a(b).each(function(){var e,f=this.config,g=f&&f.widgetOptions;b&&f&&(f.$headers.each(function(b){e=a(this),g.resizable_widths&&g.resizable_widths[b]?e.css("width",g.resizable_widths[b]):e.hasClass("resizable-false")||e.css("width","")}),c.storage&&!d&&c.storage(this,"tablesorter-resizable",{}))})}}(jQuery,window); \ No newline at end of file diff --git a/dist/js/widgets/widget-saveSort.min.js b/dist/js/widgets/widget-saveSort.min.js new file mode 100644 index 00000000..469157b9 --- /dev/null +++ b/dist/js/widgets/widget-saveSort.min.js @@ -0,0 +1,2 @@ +/*! Widget: saveSort */ +!function(a){"use strict";var b=a.tablesorter=a.tablesorter||{};b.addWidget({id:"saveSort",priority:20,options:{saveSort:!0},init:function(a,b,c,d){b.format(a,c,d,!0)},format:function(c,d,e,f){var g,h,i=d.$table,j=e.saveSort!==!1,k={sortList:d.sortList};d.debug&&(h=new Date),i.hasClass("hasSaveSort")?j&&c.hasInitialized&&b.storage&&(b.storage(c,"tablesorter-savesort",k),d.debug&&b.benchmark("saveSort widget: Saving last sort: "+d.sortList,h)):(i.addClass("hasSaveSort"),k="",b.storage&&(g=b.storage(c,"tablesorter-savesort"),k=g&&g.hasOwnProperty("sortList")&&a.isArray(g.sortList)?g.sortList:"",d.debug&&b.benchmark('saveSort: Last sort loaded: "'+k+'"',h),i.bind("saveSortReset",function(a){a.stopPropagation(),b.storage(c,"tablesorter-savesort","")})),f&&k&&k.length>0?d.sortList=k:c.hasInitialized&&k&&k.length>0&&i.trigger("sorton",[k]))},remove:function(a,c){c.$table.removeClass("hasSaveSort"),b.storage&&b.storage(a,"tablesorter-savesort","")}})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-scroller.min.js b/dist/js/widgets/widget-scroller.min.js new file mode 100644 index 00000000..0dcdfea0 --- /dev/null +++ b/dist/js/widgets/widget-scroller.min.js @@ -0,0 +1,34 @@ +/*! + Copyright (C) 2011 T. Connell & Associates, Inc. + + Dual-licensed under the MIT and GPL licenses + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE + FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + Resizable scroller widget for the jQuery tablesorter plugin + + Version 2.0 - modified by Rob Garrison 4/12/2013; updated 2/7/2015 (v2.19.0) + Requires jQuery v1.7+ + Requires the tablesorter plugin, v2.8+, available at http://mottie.github.com/tablesorter/docs/ + + Usage: + + $(function() { + + $('table.tablesorter').tablesorter({ + widgets: ['zebra', 'scroller'], + widgetOptions : { + scroller_height : 300, // height of scroll window + scroller_barWidth : 18, // scroll bar width + scroller_jumpToHeader : true, // header snap to browser top when scrolling the tbody + } + }); + + }); + + Website: www.tconnell.com +*/ +!function(a,b){"use strict";a.fn.hasScrollBar=function(){return this.get(0).scrollHeight>this.height()};var c=a.tablesorter;c.window_resize=function(){this.resize_timer&&clearTimeout(this.resize_timer),this.resize_timer=setTimeout(function(){a(this).trigger("resizeEnd")},250)},a(function(){var b="";a(b).appendTo("body")}),c.addWidget({id:"scroller",priority:60,options:{scroller_height:300,scroller_jumpToHeader:!0,scroller_upAfterSort:!0,scroller_barWidth:null},init:function(d,e,f){var g=a(b),h=f.namespace+"tsscroller";g.bind("resize"+h,c.window_resize).bind("resizeEnd"+h,function(){a.isFunction(d.config.widgetOptions.scroller_resizeWidth)&&(g.unbind("resize"+h,c.window_resize),d.config.widgetOptions.scroller_resizeWidth(),g.bind("resize"+h,c.window_resize))})},format:function(d,e,f){var g,h,i,j,k,l,m=e.namespace.slice(1)+"tsscroller",n=a(b),o=e.$table;e.isScrolling||(g=f.scroller_height||300,h=o.children("tbody").height(),0!==h&&g>h&&(g=h+10),i=a(''+o.find("thead:first").html()+"
    "),e.$extraTables=e.$extraTables&&e.$extraTables.length?e.$extraTables.add(i):i,o.wrap('
    ').before(i).find(".tablesorter-filter-row").addClass("hideme"),l=i.wrap('
    ').find("."+c.css.header),o.wrap('
    '),c.bindEvents(d,l),o.hasClass("hasFilters")&&c.filter.bindSearch(o,i.find("."+c.css.filter)),k=function(){var b=a('
    ').appendTo("body"),c=b[0],d=c.offsetWidth-c.clientWidth;return b.remove(),d},j=function(){var b,c,e,g,h,j=a('div.tablesorter-scroller[id != "'+m+'"]').hide();o.children("thead").show(),o.children("colgroup.tablesorter-colgroup").remove(),i.children("colgroup").remove(),o.addClass("tablesorter-scroller-reset").children("thead").find(".tablesorter-header-inner").addClass("tablesorter-scroller-reset").end().find(".tablesorter-filter-row").show(),b=o.parent(),b.addClass("tablesorter-scroller-reset"),b.parent().trigger("resize"),c=parseInt(o.css("border-left-width"),10)+parseInt(o.css("border-right-width"),10),h=(f.scroller_barWidth||k())+c,b.width(b.parent().innerWidth()-(b.parent().hasScrollBar()?h:0)),h=b.innerWidth()-(b.hasScrollBar()?h:0),o.width(h),i.width(h),i.parent().width(h),o.closest(".tablesorter-scroller").find(".tablesorter-scroller-reset").removeClass("tablesorter-scroller-reset"),e=i.find("thead").children().children(),o.children("thead").children().children().each(function(b,d){g=a(d).find(".tablesorter-header-inner"),g.length&&(h=parseInt(g.css("min-width").replace("auto","0").replace(/(px|em)/,""),10),g.width()b&&b>0&&n.scrollTop(i.offset().top)}i.parent().scrollLeft(a(this).scrollLeft())})),f.scroller_upAfterSort&&o.parent().animate({scrollTop:0},"fast")},remove:function(c,d){var e=d.$table,f=d.namespace+"tsscroller";e.closest(".tablesorter-scroller").find(".tablesorter-scroller-header").remove(),e.unwrap().find(".tablesorter-filter-row").removeClass("hideme").end().find("thead").show().css("visibility","visible"),a(b).unbind("resize"+f+" resizeEnd"+f),d.isScrolling=!1}})}(jQuery,window); \ No newline at end of file diff --git a/dist/js/widgets/widget-staticRow.min.js b/dist/js/widgets/widget-staticRow.min.js new file mode 100644 index 00000000..6eb7e1d8 --- /dev/null +++ b/dist/js/widgets/widget-staticRow.min.js @@ -0,0 +1 @@ +!function(a){"use strict";var b=a.tablesorter,c=function(b){var c,d,e,f,g,h=b.config;h&&(d=h.widgetOptions,h.$tbodies.each(function(){c=a(this).children(),g=c.length,c.filter(d.staticRow_class).each(function(){c=a(this),f=c.data(d.staticRow_index),"undefined"!=typeof f?(e=parseFloat(f),f=/%/.test(f)?Math.round(e/100*g):e):f=c.index(),c.data(d.staticRow_data,f)})}))};b.addWidget({id:"staticRow",options:{staticRow_class:".static",staticRow_data:"static-index",staticRow_index:"row-index",staticRow_event:"staticRowsRefresh"},init:function(b,d,e,f){c(b),e.$table.unbind(a.trim("updateComplete.tsstaticrows "+f.staticRow_event)).bind(a.trim("updateComplete.tsstaticrows "+f.staticRow_event),function(){c(b),e.$table.trigger("applyWidgets")})},format:function(b,c,d){var e,f,g,h,i,j,k,l;c.$tbodies.each(function(){for(i=a.tablesorter.processTbody(b,a(this),!0),j=!0,g=0,k=i.children(d.staticRow_class),h=i.children("tr").length-1,l=k.length;j&&l>g;)j=!1,k.each(function(){e=a(this).data(d.staticRow_data),e=e>=h?h:0>e?0:e,e!==a(this).index()&&(j=!0,f=a(this).detach(),e>=h?f.appendTo(i):0===e?f.prependTo(i):f.insertBefore(i.find("tr:eq("+e+")")))}),g++;a.tablesorter.processTbody(b,i,!1)}),c.$table.trigger("staticRowsComplete",b)},remove:function(b,c,d){c.$table.unbind(a.trim("updateComplete.tsstaticrows "+d.staticRow_event))}})}(jQuery); \ No newline at end of file diff --git a/dist/js/widgets/widget-stickyHeaders.min.js b/dist/js/widgets/widget-stickyHeaders.min.js new file mode 100644 index 00000000..d55db86e --- /dev/null +++ b/dist/js/widgets/widget-stickyHeaders.min.js @@ -0,0 +1,2 @@ +/*! Widget: stickyHeaders */ +!function(a,b){"use strict";var c=a.tablesorter=a.tablesorter||{};a.extend(c.css,{sticky:"tablesorter-stickyHeader",stickyVis:"tablesorter-sticky-visible",stickyWrap:"tablesorter-sticky-wrapper"}),c.addHeaderResizeEvent=function(b,c,d){b=a(b)[0];var e,f={timer:250},g=a.extend({},f,d),h=b.config,i=h.widgetOptions,j=function(b){i.resize_flag=!0,e=[],h.$headers.each(function(){var b=a(this),c=b.data("savedSizes")||[0,0],d=this.offsetWidth,f=this.offsetHeight;(d!==c[0]||f!==c[1])&&(b.data("savedSizes",[d,f]),e.push(this))}),e.length&&b!==!1&&h.$table.trigger("resize",[e]),i.resize_flag=!1};return j(!1),clearInterval(i.resize_timer),c?(i.resize_flag=!1,!1):void(i.resize_timer=setInterval(function(){i.resize_flag||j()},g.timer))},c.addWidget({id:"stickyHeaders",priority:60,options:{stickyHeaders:"",stickyHeaders_attachTo:null,stickyHeaders_xScroll:null,stickyHeaders_yScroll:null,stickyHeaders_offset:0,stickyHeaders_filteredToTop:!0,stickyHeaders_cloneId:"-sticky",stickyHeaders_addResizeEvent:!0,stickyHeaders_includeCaption:!0,stickyHeaders_zIndex:2},format:function(d,e,f){if(!(e.$table.hasClass("hasStickyHeaders")||a.inArray("filter",e.widgets)>=0&&!e.$table.hasClass("hasFilters"))){var g,h=e.$table,i=a(f.stickyHeaders_attachTo),j=e.namespace+"stickyheaders ",k=a(f.stickyHeaders_yScroll||f.stickyHeaders_attachTo||b),l=a(f.stickyHeaders_xScroll||f.stickyHeaders_attachTo||b),m=h.children("thead:first"),n=m.children("tr").not(".sticky-false").children(),o=h.children("tfoot"),p=isNaN(f.stickyHeaders_offset)?a(f.stickyHeaders_offset):"",q=i.length?0:p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,r=h.parent().closest("."+c.css.table).hasClass("hasStickyHeaders")?h.parent().closest("table.tablesorter")[0].config.widgetOptions.$sticky.parent():[],s=r.length?r.height():0,t=f.$sticky=h.clone().addClass("containsStickyHeaders "+c.css.sticky+" "+f.stickyHeaders).wrap('
    '),u=t.parent().css({position:i.length?"absolute":"fixed",padding:parseInt(t.parent().parent().css("padding-left"),10),top:q+s,left:0,visibility:"hidden",zIndex:f.stickyHeaders_zIndex||2}),v=t.children("thead:first"),w="",x=0,y=function(c,d){c.filter(":visible").each(function(c){var e,f,g=d.filter(":visible").eq(c),h=a(this);"border-box"===h.css("box-sizing")?e=h.outerWidth():"collapse"===g.css("border-collapse")?b.getComputedStyle?e=parseFloat(b.getComputedStyle(this,null).width):(f=parseFloat(h.css("border-width")),e=h.outerWidth()-parseFloat(h.css("padding-left"))-parseFloat(h.css("padding-right"))-f):e=h.width(),g.css({"min-width":e,"max-width":e})})},z=function(){q=p.length?p.height()||0:parseInt(f.stickyHeaders_offset,10)||0,x=0,u.css({left:i.length?parseInt(i.css("padding-left"),10)||0:h.offset().left-parseInt(h.css("margin-left"),10)-l.scrollLeft()-x,width:h.outerWidth()}),y(h,t),y(n,g)};e.$extraTables&&e.$extraTables.length?e.$extraTables.add(t):e.$extraTables=t,t.attr("id")&&(t[0].id+=f.stickyHeaders_cloneId),t.find("thead:gt(0), tr.sticky-false").hide(),t.find("tbody, tfoot").remove(),t.find("caption").toggle(f.stickyHeaders_includeCaption),g=v.children().children(),t.css({height:0,width:0,margin:0}),g.find("."+c.css.resizer).remove(),h.addClass("hasStickyHeaders").bind(a.trim("pagerComplete"+j),function(){z()}),c.bindEvents(d,v.children().children(".tablesorter-header")),h.after(u),e.onRenderHeader&&v.children("tr").children().each(function(b){e.onRenderHeader.apply(a(this),[b,e,t])}),l.add(k).unbind(a.trim("scroll resize ".split(" ").join(j))).bind(a.trim("scroll resize ".split(" ").join(j)),function(b){if(h.is(":visible")){s=r.length?r.offset().top-k.scrollTop()+r.height():0;var c="tablesorter-sticky-",d=h.offset(),e=a.isWindow(k[0]),f=a.isWindow(l[0]),g=(i.length?e?k.scrollTop():k.offset().top:k.scrollTop())+q+s,j=h.height()-(u.height()+(o.height()||0)),m=g>d.top&&g=0&&e.$filters&&e.$filters.eq(g).find("a, select, input").filter(":visible").focus())}),c.filter.bindSearch(h,g.find("."+c.css.filter)),f.filter_hideFilters&&c.filter.hideFilters(t,e)),h.trigger("stickyHeadersInit")}},remove:function(d,e,f){var g=e.namespace+"stickyheaders ";e.$table.removeClass("hasStickyHeaders").unbind(a.trim("pagerComplete filterEnd ".split(" ").join(g))).next("."+c.css.stickyWrap).remove(),f.$sticky&&f.$sticky.length&&f.$sticky.remove(),a(b).add(f.stickyHeaders_xScroll).add(f.stickyHeaders_yScroll).add(f.stickyHeaders_attachTo).unbind(a.trim("scroll resize ".split(" ").join(g))),c.addHeaderResizeEvent(d,!1)}})}(jQuery,window); \ No newline at end of file diff --git a/dist/js/widgets/widget-storage.min.js b/dist/js/widgets/widget-storage.min.js new file mode 100644 index 00000000..931e49b4 --- /dev/null +++ b/dist/js/widgets/widget-storage.min.js @@ -0,0 +1,2 @@ +/*! Widget: storage */ +!function(a,b,c){"use strict";var d=a.tablesorter=a.tablesorter||{};d.storage=function(d,e,f,g){d=a(d)[0];var h,i,j,k=!1,l={},m=d.config,n=a(d),o=g&&g.id||n.attr(g&&g.group||"data-table-group")||d.id||a(".tablesorter").index(n),p=g&&g.url||n.attr(g&&g.page||"data-table-page")||m&&m.fixedUrl||b.location.pathname;if("localStorage"in b)try{b.localStorage.setItem("_tmptest","temp"),k=!0,b.localStorage.removeItem("_tmptest")}catch(q){}return a.parseJSON&&(k?l=a.parseJSON(localStorage[e]||"null")||{}:(i=c.cookie.split(/[;\s|=]/),h=a.inArray(e,i)+1,l=0!==h?a.parseJSON(i[h]||"null")||{}:{})),(f||""===f)&&b.JSON&&JSON.hasOwnProperty("stringify")?(l[p]||(l[p]={}),l[p][o]=f,k?localStorage[e]=JSON.stringify(l):(j=new Date,j.setTime(j.getTime()+31536e6),c.cookie=e+"="+JSON.stringify(l).replace(/\"/g,'"')+"; expires="+j.toGMTString()+"; path=/"),void 0):l&&l[p]?l[p][o]:""}}(jQuery,window,document); \ No newline at end of file diff --git a/dist/js/widgets/widget-uitheme.min.js b/dist/js/widgets/widget-uitheme.min.js new file mode 100644 index 00000000..136c7f94 --- /dev/null +++ b/dist/js/widgets/widget-uitheme.min.js @@ -0,0 +1,2 @@ +/*! Widget: uitheme */ +!function(a){"use strict";var b=a.tablesorter=a.tablesorter||{};b.themes={bootstrap:{table:"table table-bordered table-striped",caption:"caption",header:"bootstrap-header",sortNone:"",sortAsc:"",sortDesc:"",active:"",hover:"",icons:"",iconSortNone:"bootstrap-icon-unsorted",iconSortAsc:"icon-chevron-up glyphicon glyphicon-chevron-up",iconSortDesc:"icon-chevron-down glyphicon glyphicon-chevron-down",filterRow:"",footerRow:"",footerCells:"",even:"",odd:""},jui:{table:"ui-widget ui-widget-content ui-corner-all",caption:"ui-widget-content",header:"ui-widget-header ui-corner-all ui-state-default",sortNone:"",sortAsc:"",sortDesc:"",active:"ui-state-active",hover:"ui-state-hover",icons:"ui-icon",iconSortNone:"ui-icon-carat-2-n-s",iconSortAsc:"ui-icon-carat-1-n",iconSortDesc:"ui-icon-carat-1-s",filterRow:"",footerRow:"",footerCells:"",even:"ui-widget-content",odd:"ui-state-default"}},a.extend(b.css,{wrapper:"tablesorter-wrapper"}),b.addWidget({id:"uitheme",priority:10,format:function(c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q,r=b.themes,s=d.$table.add(d.$extraTables),t=d.$headers.add(d.$extraHeaders),u=d.theme||"jui",v=r[u]||{},w=a.trim([v.sortNone,v.sortDesc,v.sortAsc,v.active].join(" ")),x=a.trim([v.iconSortNone,v.iconSortDesc,v.iconSortAsc].join(" "));for(d.debug&&(i=new Date),s.hasClass("tablesorter-"+u)&&d.theme===d.appliedTheme&&e.uitheme_applied||(e.uitheme_applied=!0,n=r[d.appliedTheme]||{},q=!a.isEmptyObject(n),o=q?[n.sortNone,n.sortDesc,n.sortAsc,n.active].join(" "):"",p=q?[n.iconSortNone,n.iconSortDesc,n.iconSortAsc].join(" "):"",q&&(e.zebra[0]=a.trim(" "+e.zebra[0].replace(" "+n.even,"")),e.zebra[1]=a.trim(" "+e.zebra[1].replace(" "+n.odd,"")),d.$tbodies.children().removeClass([n.even,n.odd].join(" "))),v.even&&(e.zebra[0]+=" "+v.even),v.odd&&(e.zebra[1]+=" "+v.odd),s.children("caption").removeClass(n.caption||"").addClass(v.caption),l=s.removeClass((d.appliedTheme?"tablesorter-"+(d.appliedTheme||""):"")+" "+(n.table||"")).addClass("tablesorter-"+u+" "+(v.table||"")).children("tfoot"),d.appliedTheme=d.theme,l.length&&l.children("tr").removeClass(n.footerRow||"").addClass(v.footerRow).children("th, td").removeClass(n.footerCells||"").addClass(v.footerCells),t.removeClass((q?[n.header,n.hover,o].join(" "):"")||"").addClass(v.header).not(".sorter-false").unbind("mouseenter.tsuitheme mouseleave.tsuitheme").bind("mouseenter.tsuitheme mouseleave.tsuitheme",function(b){a(this)["mouseenter"===b.type?"addClass":"removeClass"](v.hover||"")}),t.each(function(){var c=a(this);c.find("."+b.css.wrapper).length||c.wrapInner('
    ')}),d.cssIcon&&t.find("."+b.css.icon).removeClass(q?[n.icons,p].join(" "):"").addClass(v.icons||""),s.hasClass("hasFilters")&&s.children("thead").children("."+b.css.filterRow).removeClass(q?n.filterRow||"":"").addClass(v.filterRow||"")),f=0;f