jquery-tablesorter 1.12.2 → 1.12.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a9fef9e55fa0f429cfc6e395a74cb7409b0caae
4
- data.tar.gz: f0f56588cd17f5cc605031f94f2e2032980781b9
3
+ metadata.gz: a5253701a4f87cd7b7d769b85e70b40516e1c2d5
4
+ data.tar.gz: 3d6374f8bb6c3f2b75d727831bfa1177f2e2ef05
5
5
  SHA512:
6
- metadata.gz: 40578fd063f0ecb0b276b5ef7eafbe2ece5f1320b3b137a4ecb5337c5f38f4538cdeb2b6942cc9aff6ec3b947fe48da85e76c8e9ef47f8eef134e2a4ca49a137
7
- data.tar.gz: c332bbf0a7f920f2889ceac65817b5dcbca4563234cb1e8b3fa559d070a5bde09cf723f0d6e54cd3d0440261a313d26b9c763c5388c65202d1ccd31442d17d7b
6
+ metadata.gz: 7831c01cbf8d368c9b17ba7a5846c382d8291f1526fd81c7548545d235c273032dad16613f6566c7192fa5b83ccda5b4220544233ef82cc6ded89598a70287ad
7
+ data.tar.gz: 604e4f8511ce3f449d615fca60e02a8745fb8178e59dae3f13499975a8ff6caa4849a0bbf26ac7cc3a4e7af4046c05b0834fcee1953395ae209e9a1bbc83e0dd
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Simple integration of jquery-tablesorter into the asset pipeline.
6
6
 
7
- Current tablesorter version: 2.17.2 (6/18/2014), [documentation]
7
+ Current tablesorter version: 2.17.3 (6/28/2014), [documentation]
8
8
 
9
9
  Any issue associated with the js/css files, please report to [Mottie's fork].
10
10
 
@@ -26,7 +26,7 @@ Or install it yourself as:
26
26
 
27
27
  Rails 3.1 and higher (tested up to 4.1)
28
28
 
29
- Tested with ruby 1.9.3 - 2.1.1
29
+ Tested with ruby 1.9.3 - 2.1.2
30
30
 
31
31
  ## Usage
32
32
 
@@ -1,3 +1,3 @@
1
1
  module JqueryTablesorter
2
- VERSION = '1.12.2'
2
+ VERSION = '1.12.3'
3
3
  end
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * tablesorter pager plugin
3
- * updated 6/18/2014 (v2.17.2)
3
+ * updated 6/28/2014 (v2.17.3)
4
4
  */
5
5
  /*jshint browser:true, jquery:true, unused:false */
6
6
  ;(function($) {
@@ -121,7 +121,7 @@
121
121
  dis = !!disable,
122
122
  first = ( dis || p.page === 0 ),
123
123
  tp = Math.min( p.totalPages, p.filteredPages ),
124
- last = ( dis || (p.page === tp - 1) || p.totalPages === 0 );
124
+ last = ( dis || (p.page === tp - 1) || tp === 0 );
125
125
  if ( p.updateArrows ) {
126
126
  p.$container.find(p.cssFirst + ',' + p.cssPrev)[ first ? a : r ](d).attr('aria-disabled', first);
127
127
  p.$container.find(p.cssNext + ',' + p.cssLast)[ last ? a : r ](d).attr('aria-disabled', last);
@@ -131,21 +131,22 @@
131
131
  updatePageDisplay = function(table, p, completed) {
132
132
  var i, pg, s, out, regex,
133
133
  c = table.config,
134
- f = c.$table.hasClass('hasFilters') && !p.ajaxUrl,
134
+ f = c.$table.hasClass('hasFilters'),
135
135
  t = [],
136
136
  sz = p.size || 10; // don't allow dividing by zero
137
- t = [ (c.widgetOptions && c.widgetOptions.filter_filteredRow || 'filtered'), c.selectorRemove ];
137
+ t = [ (c.widgetOptions && c.widgetOptions.filter_filteredRow || 'filtered'), c.selectorRemove.replace(/^(\w+\.)/g,'') ];
138
138
  if (p.countChildRows) { t.push(c.cssChildRow); }
139
139
  regex = new RegExp( '(' + t.join('|') + ')' );
140
140
  p.totalPages = Math.ceil( p.totalRows / sz ); // needed for "pageSize" method
141
- p.filteredRows = (f) ? 0 : p.totalRows;
142
- p.filteredPages = p.totalPages;
143
- if (f) {
141
+ if (f && !p.ajaxUrl) {
142
+ p.filteredRows = 0;
144
143
  $.each(c.cache[0].normalized, function(i, el) {
145
144
  p.filteredRows += p.regexRows.test(el[c.columns].$row[0].className) ? 0 : 1;
146
145
  });
147
- p.filteredPages = Math.ceil( p.filteredRows / sz ) || 0;
146
+ } else if (!f) {
147
+ p.filteredRows = p.totalRows;
148
148
  }
149
+ p.filteredPages = Math.ceil( p.filteredRows / sz ) || 0;
149
150
  if ( Math.min( p.totalPages, p.filteredPages ) >= 0 ) {
150
151
  t = (p.size * p.page > p.filteredRows);
151
152
  p.startRow = (t) ? 1 : (p.filteredRows === 0 ? 0 : p.size * p.page + 1);
@@ -202,7 +203,7 @@
202
203
  if (h) {
203
204
  d = h - $b.height();
204
205
  if ( d > 5 && $.data(table, 'pagerLastSize') === p.size && $b.children('tr:visible').length < p.size ) {
205
- $b.append('<tr class="pagerSavedHeightSpacer ' + c.selectorRemove.replace(/(tr)?\./g,'') + '" style="height:' + d + 'px;"></tr>');
206
+ $b.append('<tr class="pagerSavedHeightSpacer ' + c.selectorRemove.replace(/^(\w+\.)/g,'') + '" style="height:' + d + 'px;"></tr>');
206
207
  }
207
208
  }
208
209
  }
@@ -235,7 +236,7 @@
235
236
  } else {
236
237
  rows[i].style.display = ( j >= s && j < e ) ? '' : 'none';
237
238
  // don't count child rows
238
- j += rows[i].className.match(c.cssChildRow + '|' + c.selectorRemove.slice(1)) && !p.countChildRows ? 0 : 1;
239
+ j += rows[i].className.match(c.cssChildRow + '|' + c.selectorRemove.replace(/^(\w+\.)/g,'')) && !p.countChildRows ? 0 : 1;
239
240
  if ( j === e && rows[i].style.display !== 'none' && rows[i].className.match(ts.css.cssHasChild) ) {
240
241
  lastIndex = i;
241
242
  }
@@ -296,6 +297,7 @@
296
297
  if (!$.isArray(result)) {
297
298
  p.ajaxData = result;
298
299
  p.totalRows = result.total;
300
+ p.filteredRows = typeof result.filteredRows !== 'undefined' ? result.filteredRows : result.total;
299
301
  th = result.headers;
300
302
  d = result.rows;
301
303
  } else {
@@ -696,7 +698,7 @@
696
698
  }
697
699
 
698
700
  // skipped rows
699
- p.regexRows = new RegExp('(' + (wo.filter_filteredRow || 'filtered') + '|' + c.selectorRemove.substring(1) + '|' + c.cssChildRow + ')');
701
+ p.regexRows = new RegExp('(' + (wo.filter_filteredRow || 'filtered') + '|' + c.selectorRemove.replace(/^(\w+\.)/g,'') + '|' + c.cssChildRow + ')');
700
702
 
701
703
  $t
702
704
  .unbind('filterStart filterEnd sortEnd disable enable destroy update updateRows updateAll addRows pageSize '.split(' ').join('.pager '))
@@ -845,7 +847,7 @@
845
847
  })
846
848
  // add error row to thead instead of tbody, or clicking on the header will result in a parser error
847
849
  .appendTo( c.$table.find('thead:first') )
848
- .addClass( errorRow + ' ' + c.selectorRemove.replace(/^[.#]/, '') )
850
+ .addClass( errorRow + ' ' + c.selectorRemove.replace(/^(\w+\.)/g,'') )
849
851
  .attr({
850
852
  role : 'alert',
851
853
  'aria-live' : 'assertive'
@@ -1,5 +1,5 @@
1
1
  /**!
2
- * TableSorter 2.17.2 - Client-side table sorting with ease!
2
+ * TableSorter 2.17.3 - Client-side table sorting with ease!
3
3
  * @requires jQuery v1.2.6+
4
4
  *
5
5
  * Copyright (c) 2007 Christian Bach
@@ -24,7 +24,7 @@
24
24
 
25
25
  var ts = this;
26
26
 
27
- ts.version = "2.17.2";
27
+ ts.version = "2.17.3";
28
28
 
29
29
  ts.parsers = [];
30
30
  ts.widgets = [];
@@ -1181,9 +1181,9 @@
1181
1181
  return this.sortDisabled ? false : ts.isValueInArray( parseFloat($(this).attr('data-column')), c.sortList) >= 0;
1182
1182
  });
1183
1183
  }
1184
- $h.addClass(ts.css.processing + ' ' + c.cssProcessing);
1184
+ table.add($h).addClass(ts.css.processing + ' ' + c.cssProcessing);
1185
1185
  } else {
1186
- $h.removeClass(ts.css.processing + ' ' + c.cssProcessing);
1186
+ table.add($h).removeClass(ts.css.processing + ' ' + c.cssProcessing);
1187
1187
  }
1188
1188
  };
1189
1189
 
@@ -1,4 +1,4 @@
1
- /*! tableSorter 2.16+ widgets - updated 6/18/2014 (v2.17.2)
1
+ /*! tableSorter 2.16+ widgets - updated 6/28/2014 (v2.17.3)
2
2
  *
3
3
  * Column Styles
4
4
  * Column Filters
@@ -568,6 +568,9 @@ ts.filter = {
568
568
  }
569
569
  c.$table.addClass('hasFilters');
570
570
 
571
+ // define searchTimer so using clearTimeout won't cause an undefined error
572
+ wo.searchTimer = null;
573
+
571
574
  $.extend( regex, {
572
575
  child : new RegExp(c.cssChildRow),
573
576
  filtered : new RegExp(wo.filter_filteredRow),
@@ -592,6 +595,7 @@ ts.filter = {
592
595
  ts.filter.buildDefault(table, true);
593
596
  }
594
597
  if (event.type === 'filterReset') {
598
+ c.$table.find('.' + ts.css.filter).add(wo.filter_$externalFilters).val('');
595
599
  ts.filter.searching(table, []);
596
600
  } else if (event.type === 'filterEnd') {
597
601
  ts.filter.buildDefault(table, true);
@@ -788,29 +792,45 @@ ts.filter = {
788
792
  .attr('data-lastSearchTime', new Date().getTime())
789
793
  .unbind('keypress keyup search change '.split(' ').join(c.namespace + 'filter '))
790
794
  // include change for select - fixes #473
791
- .bind('keyup search change '.split(' ').join(c.namespace + 'filter '), function(event) {
795
+ .bind('keyup' + c.namespace + 'filter', function(event) {
792
796
  $(this).attr('data-lastSearchTime', new Date().getTime());
793
797
  // emulate what webkit does.... escape clears the filter
794
798
  if (event.which === 27) {
795
799
  this.value = '';
796
- // liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace
797
- } else if ( (typeof wo.filter_liveSearch === 'number' && this.value.length < wo.filter_liveSearch && this.value !== '') ||
798
- ( event.type === 'keyup' && ( (event.which < 32 && event.which !== 8 && wo.filter_liveSearch === true && event.which !== 13) ||
799
- ( event.which >= 37 && event.which <= 40 ) || (event.which !== 13 && wo.filter_liveSearch === false) ) ) ) {
800
- return;
800
+ // live search
801
+ } else if ( wo.filter_liveSearch === false ) {
802
+ return;
803
+ // don't return if the search value is empty (all rows need to be revealed)
804
+ } else if ( this.value !== '' && (
805
+ // liveSearch can contain a min value length; ignore arrow and meta keys, but allow backspace
806
+ ( typeof wo.filter_liveSearch === 'number' && this.value.length < wo.filter_liveSearch ) ||
807
+ // let return & backspace continue on, but ignore arrows & non-valid characters
808
+ ( event.which !== 13 && event.which !== 8 && ( event.which < 32 || (event.which >= 37 && event.which <= 40) ) ) ) ) {
809
+ return;
801
810
  }
802
811
  // change event = no delay; last true flag tells getFilters to skip newest timed input
803
- ts.filter.searching( table, event.type !== 'change', true );
812
+ ts.filter.searching( table, true, true );
804
813
  })
805
- .bind('keypress.' + c.namespace + 'filter', function(event){
806
- if (event.which === 13) {
814
+ .bind('search change keypress '.split(' ').join(c.namespace + 'filter '), function(event){
815
+ if (event.which === 13 || event.type === 'search' || event.type === 'change') {
807
816
  event.preventDefault();
808
- $(this).blur();
817
+ // init search with no delay
818
+ ts.filter.searching( table, false, true );
809
819
  }
810
820
  });
811
- c.$table.bind('filterReset', function(){
812
- $el.val('');
813
- });
821
+ },
822
+ searching: function(table, filter, skipFirst) {
823
+ var wo = table.config.widgetOptions;
824
+ clearTimeout(wo.searchTimer);
825
+ if (typeof filter === 'undefined' || filter === true) {
826
+ // delay filtering
827
+ wo.searchTimer = setTimeout(function() {
828
+ ts.filter.checkFilters(table, filter, skipFirst );
829
+ }, wo.filter_liveSearch ? wo.filter_searchDelay : 10);
830
+ } else {
831
+ // skip delay
832
+ ts.filter.checkFilters(table, filter, skipFirst);
833
+ }
814
834
  },
815
835
  checkFilters: function(table, filter, skipFirst) {
816
836
  var c = table.config,
@@ -1221,19 +1241,6 @@ ts.filter = {
1221
1241
  ts.filter.buildSelect(table, columnIndex, updating, $header.hasClass(wo.filter_onlyAvail));
1222
1242
  }
1223
1243
  }
1224
- },
1225
- searching: function(table, filter, skipFirst) {
1226
- if (typeof filter === 'undefined' || filter === true) {
1227
- var wo = table.config.widgetOptions;
1228
- // delay filtering
1229
- clearTimeout(wo.searchTimer);
1230
- wo.searchTimer = setTimeout(function() {
1231
- ts.filter.checkFilters(table, filter, skipFirst );
1232
- }, wo.filter_liveSearch ? wo.filter_searchDelay : 10);
1233
- } else {
1234
- // skip delay
1235
- ts.filter.checkFilters(table, filter, skipFirst);
1236
- }
1237
1244
  }
1238
1245
  };
1239
1246
 
@@ -0,0 +1,117 @@
1
+ /*! Roman numeral parsers
2
+ * code modified from both:
3
+ * Steven Levithan @ http://blog.stevenlevithan.com/archives/javascript-roman-numeral-converter
4
+ * Jonathan Snook comment @ http://blog.stevenlevithan.com/archives/javascript-roman-numeral-converter#comment-16140
5
+ */
6
+ /*jshint jquery:true, unused:false */
7
+ ;(function($){
8
+ "use strict";
9
+
10
+ // allow lower case roman numerals, since lists use i, ii, iii, etc.
11
+ var validator = /^M*(?:D?C{0,3}|C[MD])(?:L?X{0,3}|X[CL])(?:V?I{0,3}|I[XV])$/i,
12
+ matcher = /\b([MCDLXVI]+\b)/gi,
13
+ lookup = { I:1, V:5, X:10, L:50, C:100, D:500, M:1000 };
14
+
15
+ $.tablesorter.addParser({
16
+ id: 'roman',
17
+ is: function(){
18
+ return false;
19
+ },
20
+ format: function(s) {
21
+ var val,
22
+ roman = s.toUpperCase().split(''),
23
+ num = 0;
24
+
25
+ // roman numerals not found!
26
+ if ( !(s && validator.test(s)) ) {
27
+ return s;
28
+ }
29
+
30
+ while (roman.length) {
31
+ val = lookup[roman.shift()];
32
+ num += val * (val < lookup[roman[0]] ? -1 : 1);
33
+ }
34
+
35
+ return num;
36
+ },
37
+ type: "numeric"
38
+ });
39
+
40
+ $.tablesorter.addParser({
41
+ id: 'roman-ignore',
42
+ is: function(){
43
+ return false;
44
+ },
45
+ format: function(s, table, cell, column) {
46
+ var val, orig,
47
+ c = table.config,
48
+ ignore = $.isArray(c.roman_ignore) ? c.roman_ignore[column] : 0,
49
+ // find roman numerals
50
+ roman = ( isNaN(ignore) ?
51
+ // ignore can be a regex or string
52
+ $.trim( s.replace(ignore, '') ) :
53
+ // or a number to ignore the last x letters...
54
+ $.trim( s.substring(0, s.length - ignore) )
55
+ ).match(matcher),
56
+ v = validator.test(roman),
57
+ num = 0;
58
+
59
+ // roman numerals not found!
60
+ if ( !(v) ) {
61
+ return s;
62
+ }
63
+
64
+ // save roman numeral for replacement
65
+ orig = roman[0];
66
+ roman = orig.toUpperCase().split('');
67
+
68
+ while (roman.length) {
69
+ val = lookup[roman.shift()];
70
+ // ignore non-roman numerals
71
+ if (val) {
72
+ num += val * (val < lookup[roman[0]] ? -1 : 1);
73
+ }
74
+ }
75
+
76
+ return num ? s.replace(orig, num) : s;
77
+ },
78
+ type: "text"
79
+ });
80
+
81
+ $.tablesorter.addParser({
82
+ id: 'roman-extract',
83
+ is: function(){
84
+ return false;
85
+ },
86
+ format: function(s) {
87
+ var val,
88
+ // find roman numerals
89
+ roman = $.grep(s.split(/\b/), function(v, i){
90
+ return validator.test(v) ? v : '';
91
+ }).join('').match(matcher),
92
+
93
+ v = roman ? validator.test(roman) : 0,
94
+ num = 0;
95
+
96
+ // roman numerals not found!
97
+ if ( !(v) ) {
98
+ return s;
99
+ }
100
+
101
+ // save roman numeral for replacement
102
+ roman = roman[0].toUpperCase().split('');
103
+
104
+ while (roman.length) {
105
+ val = lookup[roman.shift()];
106
+ // ignore non-roman numerals
107
+ if (val) {
108
+ num += val * (val < lookup[roman[0]] ? -1 : 1);
109
+ }
110
+ }
111
+
112
+ return num ? num : s;
113
+ },
114
+ type: "numeric"
115
+ });
116
+
117
+ })(jQuery);
@@ -1,4 +1,4 @@
1
- /* Pager widget (beta) for TableSorter 6/18/2014 (v2.17.2) */
1
+ /* Pager widget (beta) for TableSorter 6/28/2014 (v2.17.3) */
2
2
  /*jshint browser:true, jquery:true, unused:false */
3
3
  ;(function($){
4
4
  "use strict";
@@ -93,7 +93,7 @@ ts.addWidget({
93
93
  prev : '.prev', // previous page arrow
94
94
  next : '.next', // next page arrow
95
95
  last : '.last', // go to last page arrow
96
- goto : '.gotoPage', // go to page selector - select dropdown that sets the current page
96
+ gotoPage : '.gotoPage', // go to page selector - select dropdown that sets the current page
97
97
  pageDisplay : '.pagedisplay', // location of where the "output" is displayed
98
98
  pageSize : '.pagesize' // page size selector - select dropdown that sets the "size" option
99
99
  }
@@ -150,7 +150,7 @@ tsp = ts.pager = {
150
150
  // added in case the pager is reinitialized after being destroyed.
151
151
  p.$container = $(s.container).addClass(wo.pager_css.container).show();
152
152
  // goto selector
153
- p.$goto = p.$container.find(s.goto);
153
+ p.$goto = p.$container.find(s.gotoPage); // goto is a reserved word #657
154
154
  // page size selector
155
155
  p.$size = p.$container.find(s.pageSize);
156
156
  p.totalRows = c.$tbodies.eq(0).children('tr').length;
@@ -170,7 +170,7 @@ tsp = ts.pager = {
170
170
  }
171
171
 
172
172
  // skipped rows
173
- p.regexRows = new RegExp('(' + (wo.filter_filteredRow || 'filtered') + '|' + c.selectorRemove.substring(1) + '|' + c.cssChildRow + ')');
173
+ p.regexRows = new RegExp('(' + (wo.filter_filteredRow || 'filtered') + '|' + c.selectorRemove.replace(/^(\w+\.)/g,'') + '|' + c.cssChildRow + ')');
174
174
 
175
175
  // clear initialized flag
176
176
  p.initialized = false;
@@ -322,7 +322,7 @@ tsp = ts.pager = {
322
322
  dis = !!disable,
323
323
  first = dis || p.page === 0,
324
324
  tp = Math.min( p.totalPages, p.filteredPages ),
325
- last = dis || p.page === tp - 1 || p.totalPages === 0,
325
+ last = dis || p.page === tp - 1 || tp === 0,
326
326
  wo = c.widgetOptions,
327
327
  s = wo.pager_selectors;
328
328
  if ( wo.pager_updateArrows ) {
@@ -335,22 +335,23 @@ tsp = ts.pager = {
335
335
  var i, pg, s, out, regex,
336
336
  wo = c.widgetOptions,
337
337
  p = c.pager,
338
- f = c.$table.hasClass('hasFilters') && !wo.pager_ajaxUrl,
338
+ f = c.$table.hasClass('hasFilters'),
339
339
  t = [],
340
340
  sz = p.size || 10; // don't allow dividing by zero
341
- t = [ wo && wo.filter_filteredRow || 'filtered', c.selectorRemove ];
341
+ t = [ wo && wo.filter_filteredRow || 'filtered', c.selectorRemove.replace(/^(\w+\.)/g,'') ];
342
342
  if (wo.pager_countChildRows) { t.push(c.cssChildRow); }
343
343
  regex = new RegExp( '(' + t.join('|') + ')' );
344
344
  p.$size.add(p.$goto).removeClass(wo.pager_css.disabled).removeAttr('disabled').attr('aria-disabled', 'false');
345
345
  p.totalPages = Math.ceil( p.totalRows / sz ); // needed for "pageSize" method
346
- p.filteredRows = (f) ? 0 : p.totalRows;
347
- p.filteredPages = p.totalPages;
348
- if (f) {
346
+ if (f && !wo.pager_ajaxUrl) {
347
+ p.filteredRows = 0;
349
348
  $.each(c.cache[0].normalized, function(i, el) {
350
349
  p.filteredRows += p.regexRows.test(el[c.columns].$row[0].className) ? 0 : 1;
351
350
  });
352
- p.filteredPages = Math.ceil( p.filteredRows / sz ) || 0;
351
+ } else if (!f) {
352
+ p.filteredRows = p.totalRows;
353
353
  }
354
+ p.filteredPages = Math.ceil( p.filteredRows / sz ) || 0;
354
355
  if ( Math.min( p.totalPages, p.filteredPages ) >= 0 ) {
355
356
  t = (p.size * p.page > p.filteredRows);
356
357
  p.startRow = (t) ? 1 : (p.filteredRows === 0 ? 0 : p.size * p.page + 1);
@@ -408,7 +409,7 @@ tsp = ts.pager = {
408
409
  if (h) {
409
410
  d = h - $b.height();
410
411
  if ( d > 5 && $.data(table, 'pagerLastSize') === p.size && $b.children('tr:visible').length < p.size ) {
411
- $b.append('<tr class="pagerSavedHeightSpacer ' + wo.pager_selectors.remove.replace(/(tr)?\./g,'') + '" style="height:' + d + 'px;"></tr>');
412
+ $b.append('<tr class="pagerSavedHeightSpacer ' + wo.pager_selectors.remove.replace(/^(\w+\.)/g,'') + '" style="height:' + d + 'px;"></tr>');
412
413
  }
413
414
  }
414
415
  }
@@ -442,7 +443,7 @@ tsp = ts.pager = {
442
443
  } else {
443
444
  rows[i].style.display = ( j >= s && j < e ) ? '' : 'none';
444
445
  // don't count child rows
445
- j += rows[i].className.match(c.cssChildRow + '|' + c.selectorRemove.slice(1)) && !wo.pager_countChildRows ? 0 : 1;
446
+ j += rows[i].className.match(c.cssChildRow + '|' + c.selectorRemove.replace(/^(\w+\.)/g,'')) && !wo.pager_countChildRows ? 0 : 1;
446
447
  if ( j === e && rows[i].style.display !== 'none' && rows[i].className.match(ts.css.cssHasChild) ) {
447
448
  lastIndex = i;
448
449
  }
@@ -498,6 +499,7 @@ tsp = ts.pager = {
498
499
  if (!$.isArray(result)) {
499
500
  p.ajaxData = result;
500
501
  p.totalRows = result.total;
502
+ p.filteredRows = typeof result.filteredRows !== 'undefined' ? result.filteredRows : result.total;
501
503
  th = result.headers;
502
504
  d = result.rows;
503
505
  } else {
@@ -892,7 +894,7 @@ ts.showError = function(table, message){
892
894
  })
893
895
  // add error row to thead instead of tbody, or clicking on the header will result in a parser error
894
896
  .appendTo( c.$table.find('thead:first') )
895
- .addClass( errorRow + ' ' + c.selectorRemove.replace(/^[.#]/, '') )
897
+ .addClass( errorRow + ' ' + c.selectorRemove.replace(/^(\w+\.)/g,'') )
896
898
  .attr({
897
899
  role : 'alert',
898
900
  'aria-live' : 'assertive'
@@ -10,7 +10,7 @@
10
10
 
11
11
  Resizable scroller widget for the jQuery tablesorter plugin
12
12
 
13
- Version 2.0 - modified by Rob Garrison 4/12/2013; updated 6/18/2014 (v2.17.2)
13
+ Version 2.0 - modified by Rob Garrison 4/12/2013; updated 6/28/2014 (v2.17.3)
14
14
  Requires jQuery v1.7+
15
15
  Requires the tablesorter plugin, v2.8+, available at http://mottie.github.com/tablesorter/docs/
16
16
 
@@ -73,6 +73,7 @@ ts.addWidget({
73
73
  scroller_height : 300,
74
74
  scroller_barWidth : 18,
75
75
  scroller_jumpToHeader: true,
76
+ scroller_upAfterSort: true,
76
77
  scroller_idPrefix : 's_'
77
78
  },
78
79
  init: function(table, thisWidget, c, wo){
@@ -198,7 +199,9 @@ ts.addWidget({
198
199
  }
199
200
 
200
201
  // Sorting, so scroll to top
201
- $tbl.parent().animate({ scrollTop: 0 }, 'fast');
202
+ if (wo.scroller_upAfterSort) {
203
+ $tbl.parent().animate({ scrollTop: 0 }, 'fast');
204
+ }
202
205
 
203
206
  },
204
207
  remove : function(table, c, wo){
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  * StaticRow widget for jQuery TableSorter 2.0
3
- * Version 1.1 - modified by Rob Garrison (4/22/2014 for tablesorter v2.16.1-beta)
3
+ * Version 1.2 - modified by Rob Garrison (6/28/2014 for tablesorter v2.16.1-beta+)
4
4
  * Requires:
5
5
  * jQuery v1.4+
6
6
  * tablesorter plugin, v2.8+, available at http://mottie.github.com/tablesorter/docs/
@@ -73,8 +73,9 @@ ts.addWidget({
73
73
  // Loop thru static rows, moving them to their original "indexed" position,
74
74
  // & repeat until no more re-shuffling is needed
75
75
  var targetIndex, $thisRow, indx, numRows, $tbody, hasShuffled, $rows, max;
76
+
76
77
  c.$tbodies.each(function(){
77
- $tbody = $(this);
78
+ $tbody = $.tablesorter.processTbody(table, $(this), true); // remove tbody
78
79
  hasShuffled = true;
79
80
  indx = 0;
80
81
  $rows = $tbody.children(wo.staticRow_class);
@@ -84,7 +85,6 @@ ts.addWidget({
84
85
  // don't allow the while loop to cycle more times than the set number of static rows
85
86
  while (hasShuffled && indx < max) {
86
87
  hasShuffled = false;
87
-
88
88
  /*jshint loopfunc:true */
89
89
  $rows.each(function() {
90
90
  targetIndex = $(this).data(wo.staticRow_data);
@@ -107,10 +107,11 @@ ts.addWidget({
107
107
  }
108
108
  });
109
109
  indx++;
110
-
111
110
  }
112
111
 
112
+ $.tablesorter.processTbody(table, $tbody, false); // restore tbody
113
113
  });
114
+
114
115
  c.$table.trigger('staticRowsComplete', table);
115
116
  },
116
117
 
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.12.2
4
+ version: 1.12.3
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: 2014-06-19 00:00:00.000000000 Z
12
+ date: 2014-06-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -96,6 +96,7 @@ files:
96
96
  - vendor/assets/javascripts/jquery-tablesorter/parsers/parser-input-select.js
97
97
  - vendor/assets/javascripts/jquery-tablesorter/parsers/parser-ipv6.js
98
98
  - vendor/assets/javascripts/jquery-tablesorter/parsers/parser-metric.js
99
+ - vendor/assets/javascripts/jquery-tablesorter/parsers/parser-roman.js
99
100
  - vendor/assets/javascripts/jquery-tablesorter/widgets/widget-alignChar.js
100
101
  - vendor/assets/javascripts/jquery-tablesorter/widgets/widget-build-table.js
101
102
  - vendor/assets/javascripts/jquery-tablesorter/widgets/widget-columnSelector.js