jquery-tablesorter 1.16.1 → 1.16.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 829c54cea1f515c1cfa40720c377143067718de0
4
- data.tar.gz: 77e79f0f644401ad0dba7ed025fbc41b6176bc65
3
+ metadata.gz: ccbde787981d827d7b3dbc159fe3da131a047d40
4
+ data.tar.gz: efc7453655e3b187b2c188993c64f540ed38dd2d
5
5
  SHA512:
6
- metadata.gz: 18a6169fa726b92e7634f1fa2ddef07ba134c61bae955de9f7290a8f25cabbfad689797fa61a166445990ee802f18d4d2ffe86330d7b0a1708c6e4bb47670998
7
- data.tar.gz: a5874b4304c01c4899b21a79ca2df2efa86121093769ad4890c7ab8e253d176f8d9017b6ef093abc9f39908f79b2aaa4848d5732021a05e01518b0693193134e
6
+ metadata.gz: 281fb01a0cd7b6605bf22f5d026c7523fe1f89a9fad5aad4d3b700b5a6d439beeed1e8d333b1d7dbcc93465736cc04826e3d9453b04d9630a25e81fb4e308fbf
7
+ data.tar.gz: af6d1fc76d055a5f4005adb808cfc408ad81f77322370b4d040ccb885f7bc468d511069849619cbe2c204130f85a9de786c64e2a4ae3829ea70cfa8f79107552
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.21.1 (3/10/2015), [documentation]
7
+ Current tablesorter version: 2.21.2 (3/13/2015), [documentation]
8
8
 
9
9
  Any issue associated with the js/css files, please report to [Mottie's fork].
10
10
 
@@ -1,3 +1,3 @@
1
1
  module JqueryTablesorter
2
- VERSION = '1.16.1'
2
+ VERSION = '1.16.2'
3
3
  end
@@ -705,7 +705,6 @@
705
705
  pg = Math.min( p.totalPages, p.filteredPages );
706
706
  if ( p.page < 0 ) { p.page = 0; }
707
707
  if ( p.page > ( pg - 1 ) && pg !== 0 ) { p.page = pg - 1; }
708
-
709
708
  // fixes issue where one currentFilter is [] and the other is ['','',''],
710
709
  // making the next if comparison think the filters are different (joined by commas). Fixes #202.
711
710
  l.currentFilters = (l.currentFilters || []).join('') === '' ? [] : l.currentFilters;
@@ -911,7 +910,8 @@
911
910
  .bind('updateComplete.pager', function(e, table, triggered){
912
911
  e.stopPropagation();
913
912
  // table can be unintentionally undefined in tablesorter v2.17.7 and earlier
914
- if ( !table || triggered ) { return; }
913
+ // don't recalculate total rows/pages if using ajax
914
+ if ( !table || triggered || p.ajax ) { return; }
915
915
  var $rows = c.$tbodies.eq(0).children('tr').not(c.selectorRemove);
916
916
  p.totalRows = $rows.length - ( p.countChildRows ? 0 : $rows.filter('.' + c.cssChildRow).length );
917
917
  p.totalPages = Math.ceil( p.totalRows / p.size );
@@ -1,4 +1,4 @@
1
- /*! TableSorter (FORK) v2.21.1 *//*
1
+ /*! TableSorter (FORK) v2.21.2 *//*
2
2
  * Client-side table sorting with ease!
3
3
  * @requires jQuery v1.2.6+
4
4
  *
@@ -34,7 +34,7 @@
34
34
 
35
35
  var ts = this;
36
36
 
37
- ts.version = '2.21.1';
37
+ ts.version = '2.21.2';
38
38
 
39
39
  ts.parsers = [];
40
40
  ts.widgets = [];
@@ -1252,7 +1252,6 @@
1252
1252
  ts.computeColumnIndex = function(trs) {
1253
1253
  var matrix = [],
1254
1254
  lookup = {},
1255
- cols = 0, // determine the number of columns
1256
1255
  i, j, k, l, $cell, cell, cells, rowIndex, cellId, rowSpan, colSpan, firstAvailCol, matrixrow;
1257
1256
  for (i = 0; i < trs.length; i++) {
1258
1257
  cells = trs[i].cells;
@@ -1274,7 +1273,6 @@
1274
1273
  }
1275
1274
  }
1276
1275
  lookup[cellId] = firstAvailCol;
1277
- cols = Math.max(firstAvailCol, cols);
1278
1276
  // add data-column
1279
1277
  $cell.attr({ 'data-column' : firstAvailCol }); // 'data-row' : rowIndex
1280
1278
  for (k = rowIndex; k < rowIndex + rowSpan; k++) {
@@ -1288,8 +1286,7 @@
1288
1286
  }
1289
1287
  }
1290
1288
  }
1291
- // may not be accurate if # header columns !== # tbody columns
1292
- return cols + 1; // add one because it's a zero-based index
1289
+ return matrixrow.length;
1293
1290
  };
1294
1291
 
1295
1292
  // *** Process table ***
@@ -4,7 +4,7 @@
4
4
  ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██▀▀ ▀▀▀▀██
5
5
  █████▀ ▀████▀ ██ ██ ▀████▀ ██ ██ ██ ██ ▀████▀ █████▀ ██ ██ █████▀
6
6
  */
7
- /*! tablesorter (FORK) widgets - updated 03-10-2015 (v2.21.1)*/
7
+ /*! tablesorter (FORK) widgets - updated 03-13-2015 (v2.21.2)*/
8
8
  /* Includes: storage,uitheme,columns,filter,stickyHeaders,resizable,saveSort */
9
9
  (function(factory) {
10
10
  if (typeof define === 'function' && define.amd) {
@@ -244,10 +244,8 @@ ts.addWidget({
244
244
  hdr = [themes.sortDesc, themes.active].join(' ');
245
245
  icon = themes.iconSortDesc;
246
246
  }
247
- $h
248
- .addClass(hdr)
249
- .find('.' + ts.css.icon)
250
- .addClass(icon || '');
247
+ $header.addClass(hdr);
248
+ $icon.addClass(icon || '');
251
249
  }
252
250
  }
253
251
  }
@@ -501,7 +499,7 @@ ts.filter = {
501
499
  notMatch: function( c, data ) {
502
500
  if ( /^\!/.test(data.iFilter) ) {
503
501
  var indx,
504
- filter = ts.filter.parseFilter(c, data.iFilter.replace('!', ''), data.index, data.parsed[data.index]);
502
+ filter = ts.filter.parseFilter(c, data.iFilter.replace('!', ''), data.index, data.parsed[data.index]) || '';
505
503
  if (ts.filter.regex.exact.test(filter)) {
506
504
  // look for exact not matches - see #628
507
505
  filter = filter.replace(ts.filter.regex.exact, '');
@@ -517,7 +515,7 @@ ts.filter = {
517
515
  exact: function( c, data ) {
518
516
  /*jshint eqeqeq:false */
519
517
  if (ts.filter.regex.exact.test(data.iFilter)) {
520
- var filter = ts.filter.parseFilter(c, data.iFilter.replace(ts.filter.regex.exact, ''), data.index, data.parsed[data.index]);
518
+ var filter = ts.filter.parseFilter(c, data.iFilter.replace(ts.filter.regex.exact, ''), data.index, data.parsed[data.index]) || '';
521
519
  return data.anyMatch ? $.inArray(filter, data.rowArray) >= 0 : filter == data.iExact;
522
520
  }
523
521
  return null;
@@ -547,8 +545,8 @@ ts.filter = {
547
545
  parsed = data.parsed[index],
548
546
  // make sure the dash is for a range and not indicating a negative number
549
547
  query = data.iFilter.split( ts.filter.regex.toSplit ),
550
- range1 = ts.formatFloat( ts.filter.parseFilter(c, query[0].replace(ts.filter.regex.nondigit, ''), index, parsed), table ),
551
- range2 = ts.formatFloat( ts.filter.parseFilter(c, query[1].replace(ts.filter.regex.nondigit, ''), index, parsed), table );
548
+ range1 = ts.formatFloat( ts.filter.parseFilter(c, query[0].replace(ts.filter.regex.nondigit, '') || '', index, parsed), table ),
549
+ range2 = ts.formatFloat( ts.filter.parseFilter(c, query[1].replace(ts.filter.regex.nondigit, '') || '', index, parsed), table );
552
550
  // parse filter value in case we're comparing numbers (dates)
553
551
  if (parsed || c.parsers[index].type === 'numeric') {
554
552
  result = c.parsers[index].format('' + query[0], table, c.$headers.eq(index), index);
@@ -569,7 +567,7 @@ ts.filter = {
569
567
  if ( /[\?\*\|]/.test(data.iFilter) || ts.filter.regex.orReplace.test(data.filter) ) {
570
568
  var index = data.index,
571
569
  parsed = data.parsed[index],
572
- query = ts.filter.parseFilter(c, data.iFilter.replace(ts.filter.regex.orReplace, "|"), index, parsed);
570
+ query = ts.filter.parseFilter(c, data.iFilter.replace(ts.filter.regex.orReplace, "|"), index, parsed) || '';
573
571
  // look for an exact match with the "or" unless the "filter-match" class is found
574
572
  if (!c.$headerIndexed[index].hasClass('filter-match') && /\|/.test(query)) {
575
573
  // show all results while using filter match. Fixes #727
@@ -587,7 +585,7 @@ ts.filter = {
587
585
  var indx,
588
586
  patternIndx = 0,
589
587
  len = data.iExact.length,
590
- pattern = ts.filter.parseFilter(c, data.iFilter.slice(1), data.index, data.parsed[data.index]);
588
+ pattern = ts.filter.parseFilter(c, data.iFilter.slice(1), data.index, data.parsed[data.index]) || '';
591
589
  for (indx = 0; indx < len; indx++) {
592
590
  if (data.iExact[indx] === pattern[patternIndx]) {
593
591
  patternIndx += 1;
@@ -95,8 +95,8 @@ var tse = $.tablesorter.editable = {
95
95
 
96
96
  bindEvents: function( c, wo ) {
97
97
  c.$table
98
- .off( ( 'updateComplete pagerComplete '.split( ' ' ).join( '.tseditable' ) ).replace( /\s+/g, ' ' ) )
99
- .on( 'updateComplete pagerComplete '.split( ' ' ).join( '.tseditable' ), function() {
98
+ .off( ( 'updateComplete pagerComplete '.split( ' ' ).join( '.tseditable ' ) ).replace( /\s+/g, ' ' ) )
99
+ .on( 'updateComplete pagerComplete '.split( ' ' ).join( '.tseditable ' ), function() {
100
100
  tse.update( c, c.widgetOptions );
101
101
  });
102
102
 
@@ -142,7 +142,7 @@ ts.filter = {
142
142
  notMatch: function( c, data ) {
143
143
  if ( /^\!/.test(data.iFilter) ) {
144
144
  var indx,
145
- filter = ts.filter.parseFilter(c, data.iFilter.replace('!', ''), data.index, data.parsed[data.index]);
145
+ filter = ts.filter.parseFilter(c, data.iFilter.replace('!', ''), data.index, data.parsed[data.index]) || '';
146
146
  if (ts.filter.regex.exact.test(filter)) {
147
147
  // look for exact not matches - see #628
148
148
  filter = filter.replace(ts.filter.regex.exact, '');
@@ -158,7 +158,7 @@ ts.filter = {
158
158
  exact: function( c, data ) {
159
159
  /*jshint eqeqeq:false */
160
160
  if (ts.filter.regex.exact.test(data.iFilter)) {
161
- var filter = ts.filter.parseFilter(c, data.iFilter.replace(ts.filter.regex.exact, ''), data.index, data.parsed[data.index]);
161
+ var filter = ts.filter.parseFilter(c, data.iFilter.replace(ts.filter.regex.exact, ''), data.index, data.parsed[data.index]) || '';
162
162
  return data.anyMatch ? $.inArray(filter, data.rowArray) >= 0 : filter == data.iExact;
163
163
  }
164
164
  return null;
@@ -188,8 +188,8 @@ ts.filter = {
188
188
  parsed = data.parsed[index],
189
189
  // make sure the dash is for a range and not indicating a negative number
190
190
  query = data.iFilter.split( ts.filter.regex.toSplit ),
191
- range1 = ts.formatFloat( ts.filter.parseFilter(c, query[0].replace(ts.filter.regex.nondigit, ''), index, parsed), table ),
192
- range2 = ts.formatFloat( ts.filter.parseFilter(c, query[1].replace(ts.filter.regex.nondigit, ''), index, parsed), table );
191
+ range1 = ts.formatFloat( ts.filter.parseFilter(c, query[0].replace(ts.filter.regex.nondigit, '') || '', index, parsed), table ),
192
+ range2 = ts.formatFloat( ts.filter.parseFilter(c, query[1].replace(ts.filter.regex.nondigit, '') || '', index, parsed), table );
193
193
  // parse filter value in case we're comparing numbers (dates)
194
194
  if (parsed || c.parsers[index].type === 'numeric') {
195
195
  result = c.parsers[index].format('' + query[0], table, c.$headers.eq(index), index);
@@ -210,7 +210,7 @@ ts.filter = {
210
210
  if ( /[\?\*\|]/.test(data.iFilter) || ts.filter.regex.orReplace.test(data.filter) ) {
211
211
  var index = data.index,
212
212
  parsed = data.parsed[index],
213
- query = ts.filter.parseFilter(c, data.iFilter.replace(ts.filter.regex.orReplace, "|"), index, parsed);
213
+ query = ts.filter.parseFilter(c, data.iFilter.replace(ts.filter.regex.orReplace, "|"), index, parsed) || '';
214
214
  // look for an exact match with the "or" unless the "filter-match" class is found
215
215
  if (!c.$headerIndexed[index].hasClass('filter-match') && /\|/.test(query)) {
216
216
  // show all results while using filter match. Fixes #727
@@ -228,7 +228,7 @@ ts.filter = {
228
228
  var indx,
229
229
  patternIndx = 0,
230
230
  len = data.iExact.length,
231
- pattern = ts.filter.parseFilter(c, data.iFilter.slice(1), data.index, data.parsed[data.index]);
231
+ pattern = ts.filter.parseFilter(c, data.iFilter.slice(1), data.index, data.parsed[data.index]) || '';
232
232
  for (indx = 0; indx < len; indx++) {
233
233
  if (data.iExact[indx] === pattern[patternIndx]) {
234
234
  patternIndx += 1;
@@ -16,13 +16,13 @@ output = ts.output = {
16
16
  event : 'outputTable',
17
17
 
18
18
  // wrap line breaks & tabs in quotes
19
- regexQuote : /([\n\t]|<[^<]+>)/, // test
19
+ regexQuote : /([\n\t\x09\x0d\x0a]|<[^<]+>)/, // test if cell needs wrapping quotes
20
20
  regexBR : /(<br([\s\/])?>|\n)/g, // replace
21
21
  regexIMG : /<img[^>]+alt\s*=\s*['"]([^'"]+)['"][^>]*>/i, // match
22
22
  regexHTML : /<[^<]+>/g, // replace
23
23
 
24
- replaceCR : '\\n',
25
- replaceTab : '\\t',
24
+ replaceCR : '\x0d\x0a',
25
+ replaceTab : '\x09',
26
26
 
27
27
  popupTitle : 'Output',
28
28
  popupStyle : 'width:100%;height:100%;', // for textarea
@@ -268,7 +268,8 @@ tsp = ts.pager = {
268
268
  .on('updateComplete.pager', function(e, table, triggered){
269
269
  e.stopPropagation();
270
270
  // table can be unintentionally undefined in tablesorter v2.17.7 and earlier
271
- if (!table || triggered) { return; }
271
+ // don't recalculate total rows/pages if using ajax
272
+ if (!table || triggered || p.ajax) { return; }
272
273
  var $rows = c.$tbodies.eq(0).children('tr').not(c.selectorRemove);
273
274
  p.totalRows = $rows.length - ( wo.pager_countChildRows ? 0 : $rows.filter('.' + c.cssChildRow).length );
274
275
  p.totalPages = Math.ceil( p.totalRows / p.size );
@@ -149,10 +149,8 @@ ts.addWidget({
149
149
  hdr = [themes.sortDesc, themes.active].join(' ');
150
150
  icon = themes.iconSortDesc;
151
151
  }
152
- $h
153
- .addClass(hdr)
154
- .find('.' + ts.css.icon)
155
- .addClass(icon || '');
152
+ $header.addClass(hdr);
153
+ $icon.addClass(icon || '');
156
154
  }
157
155
  }
158
156
  }
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.16.1
4
+ version: 1.16.2
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-03-10 00:00:00.000000000 Z
12
+ date: 2015-03-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties