jquery-tablesorter 1.14.0 → 1.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /*! tableSorter (FORK) 2.16+ widgets - updated 2/7/2015 (v2.19.0)
1
+ /*! tableSorter (FORK) 2.16+ widgets - updated 2/9/2015 (v2.19.1)
2
2
  *
3
3
  * Column Styles
4
4
  * Column Filters
@@ -201,7 +201,7 @@ ts.addWidget({
201
201
  wo.uitheme_applied = true;
202
202
  oldtheme = themesAll[c.appliedTheme] || {};
203
203
  hasOldTheme = !$.isEmptyObject(oldtheme);
204
- oldremove = hasOldTheme ? [ oldtheme.sortNone, oldtheme.sortDesc, oldtheme.sortAsc, oldtheme.active ].join( ' ' ) : '',
204
+ oldremove = hasOldTheme ? [ oldtheme.sortNone, oldtheme.sortDesc, oldtheme.sortAsc, oldtheme.active ].join( ' ' ) : '';
205
205
  oldIconRmv = hasOldTheme ? [ oldtheme.iconSortNone, oldtheme.iconSortDesc, oldtheme.iconSortAsc ].join( ' ' ) : '';
206
206
  if (hasOldTheme) {
207
207
  wo.zebra[0] = $.trim( ' ' + wo.zebra[0].replace(' ' + oldtheme.even, '') );
@@ -429,11 +429,12 @@ ts.addWidget({
429
429
  remove: function(table, c, wo, refreshing) {
430
430
  var tbodyIndex, $tbody,
431
431
  $table = c.$table,
432
- $tbodies = c.$tbodies;
432
+ $tbodies = c.$tbodies,
433
+ events = 'addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search '.split(' ').join(c.namespace + 'filter ');
433
434
  $table
434
435
  .removeClass('hasFilters')
435
436
  // add .tsfilter namespace to all BUT search
436
- .unbind('addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search '.split(' ').join(c.namespace + 'filter '))
437
+ .unbind( $.trim(events) )
437
438
  // remove the filter row even if refreshing, because the column might have been moved
438
439
  .find('.' + ts.css.filterRow).remove();
439
440
  if (refreshing) { return; }
@@ -660,7 +661,7 @@ ts.filter = {
660
661
  }
661
662
 
662
663
  txt = 'addRows updateCell update updateRows updateComplete appendCache filterReset filterEnd search '.split(' ').join(c.namespace + 'filter ');
663
- c.$table.bind(txt, function(event, filter) {
664
+ c.$table.bind( $.trim(txt), function(event, filter) {
664
665
  val = (wo.filter_hideEmpty && $.isEmptyObject(c.cache) && !(c.delayInit && event.type === 'appendCache'));
665
666
  // hide filter row using the "filtered" class name
666
667
  c.$table.find('.' + ts.css.filterRow).toggleClass(wo.filter_filteredRow, val ); // fixes #450
@@ -752,7 +753,9 @@ ts.filter = {
752
753
 
753
754
  // show processing icon
754
755
  if (c.showProcessing) {
755
- c.$table.bind('filterStart' + c.namespace + 'filter filterEnd' + c.namespace + 'filter', function(event, columns) {
756
+ c.$table
757
+ .unbind( $.trim('filterStart filterEnd '.split(' ').join(c.namespace + 'filter ')) )
758
+ .bind( $.trim('filterStart filterEnd '.split(' ').join(c.namespace + 'filter ')), function(event, columns) {
756
759
  // only add processing to certain columns to all columns
757
760
  $header = (columns) ? c.$table.find('.' + ts.css.header).filter('[data-column]').filter(function() {
758
761
  return columns[$(this).data('column')] !== '';
@@ -765,7 +768,9 @@ ts.filter = {
765
768
  c.filteredRows = c.totalRows;
766
769
 
767
770
  // add default values
768
- c.$table.bind('tablesorter-initialized pagerBeforeInitialized', function() {
771
+ c.$table
772
+ .unbind( $.trim('tablesorter-initialized pagerBeforeInitialized '.split(' ').join(c.namespace + 'filter ')) )
773
+ .bind( $.trim('tablesorter-initialized pagerBeforeInitialized '.split(' ').join(c.namespace + 'filter ')), function() {
769
774
  // redefine "wo" as it does not update properly inside this callback
770
775
  var wo = this.config.widgetOptions;
771
776
  filters = ts.filter.setDefaults(table, c, wo) || [];
@@ -937,7 +942,7 @@ ts.filter = {
937
942
  $el
938
943
  // use data attribute instead of jQuery data since the head is cloned without including the data/binding
939
944
  .attr('data-lastSearchTime', new Date().getTime())
940
- .unbind('keypress keyup search change '.split(' ').join(c.namespace + 'filter '))
945
+ .unbind( $.trim('keypress keyup search change '.split(' ').join(c.namespace + 'filter ')) )
941
946
  // include change for select - fixes #473
942
947
  .bind('keyup' + c.namespace + 'filter', function(event) {
943
948
  $(this).attr('data-lastSearchTime', new Date().getTime());
@@ -958,7 +963,7 @@ ts.filter = {
958
963
  // change event = no delay; last true flag tells getFilters to skip newest timed input
959
964
  ts.filter.searching( table, true, true );
960
965
  })
961
- .bind('search change keypress '.split(' ').join(c.namespace + 'filter '), function(event){
966
+ .bind( $.trim('search change keypress '.split(' ').join(c.namespace + 'filter ')), function(event){
962
967
  var column = $(this).data('column');
963
968
  // don't allow "change" event to process if the input value is the same - fixes #685
964
969
  if (event.which === 13 || event.type === 'search' || event.type === 'change' && this.value !== c.lastSearch[column]) {
@@ -1772,7 +1777,7 @@ ts.addWidget({
1772
1777
  // update sticky header class names to match real header after sorting
1773
1778
  $table
1774
1779
  .addClass('hasStickyHeaders')
1775
- .bind('pagerComplete' + namespace, function() {
1780
+ .bind( $.trim('pagerComplete' + namespace), function() {
1776
1781
  resizeHeader();
1777
1782
  });
1778
1783
 
@@ -1791,8 +1796,8 @@ ts.addWidget({
1791
1796
 
1792
1797
  // make it sticky!
1793
1798
  $xScroll.add($yScroll)
1794
- .unbind('scroll resize '.split(' ').join( namespace ) )
1795
- .bind('scroll resize '.split(' ').join( namespace ), function(event) {
1799
+ .unbind( $.trim('scroll resize '.split(' ').join( namespace )) )
1800
+ .bind( $.trim('scroll resize '.split(' ').join( namespace )), function(event) {
1796
1801
  if (!$table.is(':visible')) { return; } // fixes #278
1797
1802
  // Detect nested tables - fixes #724
1798
1803
  nestedStickyTop = $nestedSticky.length ? $nestedSticky.offset().top - $yScroll.scrollTop() + $nestedSticky.height() : 0;
@@ -1833,7 +1838,7 @@ ts.addWidget({
1833
1838
  // look for filter widget
1834
1839
  if ($table.hasClass('hasFilters') && wo.filter_columnFilters) {
1835
1840
  // scroll table into view after filtering, if sticky header is active - #482
1836
- $table.bind('filterEnd' + namespace, function() {
1841
+ $table.bind( $.trim('filterEnd' + namespace), function() {
1837
1842
  // $(':focus') needs jQuery 1.6+
1838
1843
  var $td = $(document.activeElement).closest('td'),
1839
1844
  column = $td.parent().children().index($td);
@@ -1861,14 +1866,14 @@ ts.addWidget({
1861
1866
  var namespace = c.namespace + 'stickyheaders ';
1862
1867
  c.$table
1863
1868
  .removeClass('hasStickyHeaders')
1864
- .unbind( 'pagerComplete filterEnd '.split(' ').join(namespace) )
1869
+ .unbind( $.trim('pagerComplete filterEnd '.split(' ').join(namespace)) )
1865
1870
  .next('.' + ts.css.stickyWrap).remove();
1866
1871
  if (wo.$sticky && wo.$sticky.length) { wo.$sticky.remove(); } // remove cloned table
1867
1872
  $(window)
1868
1873
  .add(wo.stickyHeaders_xScroll)
1869
1874
  .add(wo.stickyHeaders_yScroll)
1870
1875
  .add(wo.stickyHeaders_attachTo)
1871
- .unbind( 'scroll resize '.split(' ').join(namespace) );
1876
+ .unbind( $.trim('scroll resize '.split(' ').join(namespace)) );
1872
1877
  ts.addHeaderResizeEvent(table, false);
1873
1878
  }
1874
1879
  });
@@ -234,8 +234,8 @@
234
234
  });
235
235
  },
236
236
 
237
- remove: function(c) {
238
- c.$table.off(chart.event);
237
+ remove: function(c, wo) {
238
+ c.$table.off(wo.chart_event);
239
239
  }
240
240
 
241
241
  };
@@ -269,7 +269,7 @@
269
269
  },
270
270
 
271
271
  remove: function(table, c, wo) {
272
- chart.remove(c);
272
+ chart.remove(c, wo);
273
273
  }
274
274
  });
275
275
 
@@ -1,4 +1,4 @@
1
- /*! tablesorter CSS Sticky Headers widget - updated 2/7/2015 (v2.19.0)
1
+ /*! tablesorter CSS Sticky Headers widget - updated 2/9/2015 (v2.19.1)
2
2
  * Requires a modern browser, tablesorter v2.8+
3
3
  */
4
4
  /*jshint jquery:true, unused:false */
@@ -59,8 +59,8 @@
59
59
  }
60
60
 
61
61
  $win
62
- .unbind('scroll resize '.split(' ').join(namespace))
63
- .bind('scroll resize '.split(' ').join(namespace), function() {
62
+ .unbind( $.trim('scroll resize '.split(' ').join(namespace)) )
63
+ .bind( $.trim('scroll resize '.split(' ').join(namespace)), function() {
64
64
  // make sure "wo" is current otherwise changes to widgetOptions
65
65
  // are not dynamic (like the add caption button in the demo)
66
66
  wo = c.widgetOptions;
@@ -126,7 +126,7 @@
126
126
  setTransform( $cells, finalY );
127
127
 
128
128
  });
129
- $table.unbind('filterEnd' + namespace).bind('filterEnd' + namespace, function() {
129
+ $table.unbind( $.trim('filterEnd' + namespace) ).bind( $.trim('filterEnd' + namespace), function() {
130
130
  if (wo.cssStickyHeaders_filteredToTop) {
131
131
  // scroll top of table into view
132
132
  window.scrollTo(0, $table.position().top);
@@ -137,9 +137,9 @@
137
137
  remove: function(table, c, wo, refreshing) {
138
138
  if (refreshing) { return; }
139
139
  var namespace = c.namespace + 'cssstickyheader ';
140
- $(window).unbind('scroll resize '.split(' ').join(namespace));
140
+ $(window).unbind( $.trim('scroll resize '.split(' ').join(namespace)) );
141
141
  c.$table
142
- .unbind('filterEnd scroll resize '.split(' ').join(namespace))
142
+ .unbind( $.trim('filterEnd scroll resize '.split(' ').join(namespace)) )
143
143
  .add( c.$table.children('thead').children().children() )
144
144
  .children('thead, caption').css({
145
145
  'transform' : '',
@@ -1,4 +1,4 @@
1
- /*! tablesorter Editable Content widget - updated 2/7/2015 (v2.19.0)
1
+ /*! tablesorter Editable Content widget - updated 2/9/2015 (v2.19.1)
2
2
  * Requires tablesorter v2.8+ and jQuery 1.7+
3
3
  * by Rob Garrison
4
4
  */
@@ -95,13 +95,13 @@ var tse = $.tablesorter.editable = {
95
95
 
96
96
  bindEvents: function( c, wo ) {
97
97
  c.$table
98
- .off( 'updateComplete pagerComplete '.split( ' ' ).join( '.tseditable' ) )
99
- .on( 'updateComplete pagerComplete '.split( ' ' ).join( '.tseditable' ), function() {
98
+ .off( $.trim( 'updateComplete pagerComplete '.split( ' ' ).join( '.tseditable' ) ) )
99
+ .on( $.trim( 'updateComplete pagerComplete '.split( ' ' ).join( '.tseditable' ) ), function() {
100
100
  tse.update( c, c.widgetOptions );
101
101
  });
102
102
 
103
103
  c.$tbodies
104
- .off( 'mouseleave focus blur focusout keydown '.split( ' ' ).join( '.tseditable ' ) )
104
+ .off( $.trim( 'mouseleave focus blur focusout keydown '.split( ' ' ).join( '.tseditable ' ) ) )
105
105
  .on( 'mouseleave.tseditable', function() {
106
106
  if ( c.$table.data( 'contentFocused' ) ) {
107
107
  // change to 'true' instead of element to allow focusout to process
@@ -140,7 +140,7 @@ var tse = $.tablesorter.editable = {
140
140
  }
141
141
  }
142
142
  })
143
- .on( 'blur focusout keydown '.split( ' ' ).join( '.tseditable ' ), '[contenteditable]', function( e ) {
143
+ .on( $.trim( 'blur focusout keydown '.split( ' ' ).join( '.tseditable ' ) ), '[contenteditable]', function( e ) {
144
144
  if ( !c.$table.data( 'contentFocused' ) ) { return; }
145
145
  var t, validate,
146
146
  valid = false,
@@ -1,4 +1,4 @@
1
- /*! tablesorter Formatter widget - 2/7/2015 (v2.19.0)
1
+ /*! tablesorter Formatter widget - 2/9/2015 (v2.19.1)
2
2
  * Requires tablesorter v2.8+ and jQuery 1.7+
3
3
  * by Rob Garrison
4
4
  */
@@ -10,11 +10,13 @@
10
10
 
11
11
  ts.formatter = {
12
12
  init : function( c ) {
13
- var events = $.trim( c.widgetOptions.formatter_event ) + ' pagerComplete updateComplete '
14
- .split(' ').join('.tsformatter ');
15
- c.$table.on( events, function() {
16
- ts.formatter.setup( c );
17
- });
13
+ var events = $.trim( c.widgetOptions.formatter_event ) +
14
+ ' pagerComplete updateComplete '.split(' ').join('.tsformatter ');
15
+ c.$table
16
+ .off( $.trim(events) )
17
+ .on( $.trim(events), function() {
18
+ ts.formatter.setup( c );
19
+ });
18
20
  ts.formatter.setup( c );
19
21
  },
20
22
  setup : function( c ) {
@@ -1,4 +1,4 @@
1
- /*! tablesorter math widget - updated 2/7/2015 (v2.19.0)
1
+ /*! tablesorter math widget - updated 2/9/2015 (v2.19.1)
2
2
  * Requires tablesorter v2.16+ and jQuery 1.7+
3
3
  * by Rob Garrison
4
4
  */
@@ -8,10 +8,12 @@
8
8
  "use strict";
9
9
 
10
10
  var ts = $.tablesorter,
11
- events = ( 'tablesorter-initialized update updateAll updateRows addRows updateCell ' +
12
- 'filterReset filterEnd recalculate ' ).split(' ').join('.tsmath '),
11
+
13
12
  math = {
14
13
 
14
+ events : ( 'tablesorter-initialized update updateAll updateRows addRows updateCell ' +
15
+ 'filterReset filterEnd ' ).split(' ').join('.tsmath '),
16
+
15
17
  // get all of the row numerical values in an arry
16
18
  getRow : function(table, wo, $el, dataAttrib) {
17
19
  var $t, txt,
@@ -386,12 +388,13 @@
386
388
  // template for or just prepend the mask prefix & suffix with this HTML
387
389
  // e.g. '<span class="red">{content}</span>'
388
390
  math_prefix : '',
389
- math_suffix : ''
391
+ math_suffix : '',
392
+ math_event : 'recalculate'
390
393
  },
391
394
  init : function(table, thisWidget, c, wo){
392
395
  c.$table
393
- .unbind(events + ' updateComplete.tsmath')
394
- .bind(events, function(e){
396
+ .off( $.trim(math.events) + ' ' + $.trim('updateComplete.tsmath ' + wo.math_event) )
397
+ .on( $.trim(math.events) + ' ' + wo.math_event, function(e){
395
398
  var init = e.type === 'tablesorter-initialized';
396
399
  if (e.type === 'updateAll') {
397
400
  // redo data-column indexes in case columns were rearranged
@@ -400,7 +403,7 @@
400
403
  math.recalculate( table, c, wo, init );
401
404
  }
402
405
  })
403
- .bind('updateComplete.tsmath', function(){
406
+ .on('updateComplete.tsmath', function(){
404
407
  setTimeout(function(){
405
408
  wo.math_isUpdating = false;
406
409
  }, 500);
@@ -412,9 +415,9 @@
412
415
  remove: function(table, c, wo, refreshing){
413
416
  if (refreshing) { return; }
414
417
  $(table)
415
- .unbind(events + ' updateComplete.tsmath')
418
+ .off( $.trim(math.events) + ' ' + $.trim('updateComplete.tsmath ' + wo.math_event) )
416
419
  .find('[data-' + wo.math_data + ']').empty();
417
420
  }
418
421
  });
419
422
 
420
- })(jQuery);
423
+ })(jQuery);
@@ -1,4 +1,4 @@
1
- /* Output widget for TableSorter 2/7/2015 (v2.19.0)
1
+ /* Output widget for TableSorter 2/9/2015 (v2.19.1)
2
2
  * Requires tablesorter v2.8+ and jQuery 1.7+
3
3
  * Modified from:
4
4
  * HTML Table to CSV: http://www.kunalbabre.com/projects/table2CSV.php (License unknown?)
@@ -1,4 +1,4 @@
1
- /* Pager widget for TableSorter 2/7/2015 (v2.19.0) - requires jQuery 1.7+ */
1
+ /* Pager widget for TableSorter 2/9/2015 (v2.19.1) - requires jQuery 1.7+ */
2
2
  /*jshint browser:true, jquery:true, unused:false */
3
3
  ;(function($){
4
4
  "use strict";
@@ -229,7 +229,7 @@ tsp = ts.pager = {
229
229
  s = wo.pager_selectors;
230
230
 
231
231
  c.$table
232
- .off(p.events.split(' ').join('.pager '))
232
+ .off( $.trim(p.events.split(' ').join('.pager ')) )
233
233
  .on('filterInit.pager filterStart.pager', function(e, filters) {
234
234
  p.currentFilters = $.isArray(filters) ? filters : c.$table.data('lastSearch');
235
235
  // don't change page if filters are the same (pager updating, etc)
@@ -330,8 +330,8 @@ tsp = ts.pager = {
330
330
 
331
331
  if ( p.$goto.length ) {
332
332
  p.$goto
333
- .off('change')
334
- .on('change', function(){
333
+ .off('change.pager')
334
+ .on('change.pager', function(){
335
335
  p.page = $(this).val() - 1;
336
336
  tsp.moveToPage(table, p, true);
337
337
  tsp.updatePageDisplay(table, c, false);
@@ -443,7 +443,7 @@ tsp = ts.pager = {
443
443
  if ($out.length) {
444
444
  $out[ ($out[0].tagName === 'INPUT') ? 'val' : 'html' ](s);
445
445
  // rebind startRow/page inputs
446
- $out.find('.ts-startRow, .ts-page').off('change').on('change', function(){
446
+ $out.find('.ts-startRow, .ts-page').off('change.pager').on('change.pager', function(){
447
447
  var v = $(this).val(),
448
448
  pg = $(this).hasClass('ts-startRow') ? Math.floor( v/p.size ) + 1 : v;
449
449
  c.$table.trigger('pageSet.pager', [ pg ]);
@@ -1012,7 +1012,7 @@ tsp = ts.pager = {
1012
1012
  destroyPager: function(table, c, refreshing){
1013
1013
  var p = c.pager;
1014
1014
  p.initialized = false;
1015
- c.$table.off(p.events.split(' ').join('.pager '));
1015
+ c.$table.off( $.trim(p.events.split(' ').join('.pager ')) );
1016
1016
  if (refreshing) { return; }
1017
1017
  tsp.showAllRows(table, c);
1018
1018
  p.$container.hide(); // hide pager
@@ -1,6 +1,5 @@
1
- /*
2
- * StaticRow widget for jQuery TableSorter 2.0
3
- * Version 1.2 - modified by Rob Garrison (6/28/2014 for tablesorter v2.16.1-beta+)
1
+ /* StaticRow widget for jQuery TableSorter 2.0 - updated 2/9/2015 (v2.19.1)
2
+ * Version 1.2 mod by Rob Garrison (requires tablesorter v2.16+)
4
3
  * Requires:
5
4
  * jQuery v1.4+
6
5
  * tablesorter plugin, v2.8+, available at http://mottie.github.com/tablesorter/docs/
@@ -16,9 +15,6 @@
16
15
  "use strict";
17
16
  var ts = $.tablesorter,
18
17
 
19
- // events triggered on the table that update this widget
20
- events = 'staticRowsRefresh updateComplete '.split(' ').join('.tsstaticrows '),
21
-
22
18
  // add/refresh row indexes
23
19
  addIndexes = function(table){
24
20
  var $tr, wo, v, indx, rows,
@@ -55,15 +51,16 @@ ts.addWidget({
55
51
  options: {
56
52
  staticRow_class : '.static',
57
53
  staticRow_data : 'static-index',
58
- staticRow_index : 'row-index'
54
+ staticRow_index : 'row-index',
55
+ staticRow_event : 'staticRowsRefresh'
59
56
  },
60
57
 
61
58
  init: function(table, thisWidget, c, wo){
62
59
  addIndexes(table);
63
60
  // refresh static rows after updates
64
61
  c.$table
65
- .unbind(events)
66
- .bind(events, function(){
62
+ .unbind( $.trim('updateComplete.tsstaticrows ' + wo.staticRow_event) )
63
+ .bind( $.trim('updateComplete.tsstaticrows ' + wo.staticRow_event), function(){
67
64
  addIndexes(table);
68
65
  c.$table.trigger('applyWidgets');
69
66
  });
@@ -116,7 +113,7 @@ ts.addWidget({
116
113
  },
117
114
 
118
115
  remove : function(table, c, wo){
119
- c.$table.unbind(events);
116
+ c.$table.unbind( $.trim('updateComplete.tsstaticrows ' + wo.staticRow_event) );
120
117
  }
121
118
 
122
119
  });
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery-tablesorter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.14.0
4
+ version: 1.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jun Lin
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-02-07 00:00:00.000000000 Z
12
+ date: 2015-02-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
156
156
  version: '0'
157
157
  requirements: []
158
158
  rubyforge_project:
159
- rubygems_version: 2.4.3
159
+ rubygems_version: 2.4.5
160
160
  signing_key:
161
161
  specification_version: 4
162
162
  summary: Simple integration of jquery-tablesorter (Mottie's fork) into the Rails asset