jquery-tablesorter 1.24.5 → 1.25.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/jquery-tablesorter/version.rb +2 -2
  4. data/vendor/assets/javascripts/jquery-tablesorter/addons/pager/jquery.tablesorter.pager.js +85 -85
  5. data/vendor/assets/javascripts/jquery-tablesorter/beta-testing/widget-reorder.js +17 -18
  6. data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.combined.js +128 -101
  7. data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.js +70 -58
  8. data/vendor/assets/javascripts/jquery-tablesorter/jquery.tablesorter.widgets.js +58 -43
  9. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-extract.js +1 -1
  10. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-iso8601.js +1 -1
  11. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-month.js +1 -1
  12. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-range.js +1 -1
  13. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-two-digit-year.js +2 -2
  14. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date-weekday.js +1 -1
  15. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-date.js +1 -1
  16. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-duration.js +1 -1
  17. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-feet-inch-fraction.js +2 -2
  18. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-file-type.js +2 -2
  19. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-ignore-articles.js +1 -1
  20. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-image.js +2 -2
  21. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-input-select.js +1 -1
  22. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-leading-zeros.js +1 -0
  23. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-named-numbers.js +1 -1
  24. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-network.js +4 -4
  25. data/vendor/assets/javascripts/jquery-tablesorter/parsers/parser-roman.js +5 -5
  26. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-alignChar.js +15 -15
  27. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-build-table.js +28 -18
  28. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-chart.js +1 -1
  29. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-columnSelector.js +22 -18
  30. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-cssStickyHeaders.js +1 -1
  31. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter-formatter-html5.js +34 -31
  32. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter-formatter-jui.js +46 -46
  33. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter-formatter-select2.js +10 -10
  34. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter-type-insideRange.js +1 -1
  35. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-filter.js +17 -13
  36. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-formatter.js +2 -2
  37. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-grouping.js +14 -15
  38. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-headerTitles.js +8 -9
  39. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-lazyload.js +35 -35
  40. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-math.js +8 -9
  41. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-output.js +7 -6
  42. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-pager.js +60 -56
  43. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-print.js +1 -1
  44. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-reflow.js +11 -11
  45. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-repeatheaders.js +2 -2
  46. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-resizable.js +3 -3
  47. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-saveSort.js +23 -12
  48. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-scroller.js +3 -4
  49. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-sort2Hash.js +2 -2
  50. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-sortTbodies.js +1 -1
  51. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-staticRow.js +7 -7
  52. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-stickyHeaders.js +2 -2
  53. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-storage.js +5 -6
  54. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-uitheme.js +7 -6
  55. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-vertical-group.js +10 -12
  56. data/vendor/assets/javascripts/jquery-tablesorter/widgets/widget-view.js +3 -3
  57. metadata +2 -2
@@ -2,7 +2,7 @@
2
2
  * Requires a modern browser, tablesorter v2.8+
3
3
  */
4
4
  /*jshint jquery:true, unused:false */
5
- ;(function($, window){
5
+ ;(function($, window) {
6
6
  'use strict';
7
7
 
8
8
  var ts = $.tablesorter;
@@ -7,7 +7,7 @@
7
7
  */
8
8
  /*jshint browser:true, jquery:true, unused:false */
9
9
  /*global jQuery: false */
10
- ;(function($){
10
+ ;(function($) {
11
11
  'use strict';
12
12
 
13
13
  var ts = $.tablesorter || {},
@@ -17,12 +17,12 @@
17
17
 
18
18
  tsff = ts.filterFormatter = $.extend( {}, ts.filterFormatter, {
19
19
 
20
- addCompare: function($cell, indx, options){
20
+ addCompare: function($cell, indx, options) {
21
21
  if (options.compare && $.isArray(options.compare) && options.compare.length > 1) {
22
22
  var opt = '',
23
23
  compareSelectClass = [ compareSelect.slice(1), ' ' + compareSelect.slice(1), '' ],
24
24
  txt = options.cellText ? '<label class="' + compareSelectClass.join('-label') + indx + '">' + options.cellText + '</label>' : '';
25
- $.each(options.compare, function(i, c){
25
+ $.each(options.compare, function(i, c) {
26
26
  opt += '<option ' + (options.selected === i ? 'selected' : '') + '>' + c + '</option>';
27
27
  });
28
28
  $cell
@@ -38,7 +38,7 @@
38
38
  num = val.replace(/\s*?[><=]\s*?/g, ''),
39
39
  compare = val.match(/[><=]/g) || '';
40
40
  if (o.compare) {
41
- if ($.isArray(o.compare)){
41
+ if ($.isArray(o.compare)) {
42
42
  compare = (compare || []).join('') || o.compare[o.selected || 0];
43
43
  }
44
44
  $cell.find(compareSelect).val( compare );
@@ -72,7 +72,7 @@
72
72
  $shcell = [],
73
73
  c = $cell.closest('table')[0].config,
74
74
 
75
- updateNumber = function(delayed, notrigger){
75
+ updateNumber = function(delayed, notrigger) {
76
76
  var chkd = o.addToggle ? $cell.find('.toggle').is(':checked') : true,
77
77
  v = $cell.find('.number').val(),
78
78
  compare = ($.isArray(o.compare) ? $cell.find(compareSelect).val() || o.compare[ o.selected || 0] : o.compare) || '',
@@ -104,13 +104,13 @@
104
104
  // add HTML5 number (spinner)
105
105
  $cell
106
106
  .append(t + '<input type="hidden" />')
107
- .find('.toggle, .number').bind('change', function(){
107
+ .find('.toggle, .number').bind('change', function() {
108
108
  updateNumber();
109
109
  })
110
110
  .closest('thead').find('th[data-column=' + indx + ']')
111
111
  .addClass('filter-parsed') // get exact numbers from column
112
112
  // on reset
113
- .closest('table').bind('filterReset', function(){
113
+ .closest('table').bind('filterReset', function() {
114
114
  if ($.isArray(o.compare)) {
115
115
  $cell.add($shcell).find(compareSelect).val( o.compare[ o.selected || 0 ] );
116
116
  }
@@ -122,17 +122,17 @@
122
122
  }
123
123
  }
124
124
  $cell.find('.number').val( o.value );
125
- setTimeout(function(){
125
+ setTimeout(function() {
126
126
  updateNumber();
127
127
  }, 0);
128
128
  });
129
- $input = $cell.find('input[type=hidden]').bind('change', function(){
129
+ $input = $cell.find('input[type=hidden]').bind('change', function() {
130
130
  $cell.find('.number').val( this.value );
131
131
  updateNumber();
132
132
  });
133
133
 
134
134
  // update slider from hidden input, in case of saved filters
135
- c.$table.bind('filterFomatterUpdate', function(){
135
+ c.$table.bind('filterFomatterUpdate', function() {
136
136
  var val = tsff.updateCompare($cell, $input, o)[0] || o.value;
137
137
  $cell.find('.number').val( ((val || '') + '').replace(/[><=]/g, '') );
138
138
  updateNumber(false, true);
@@ -142,17 +142,17 @@
142
142
  if (o.compare) {
143
143
  // add compare select
144
144
  tsff.addCompare($cell, indx, o);
145
- $cell.find(compareSelect).bind('change', function(){
145
+ $cell.find(compareSelect).bind('change', function() {
146
146
  updateNumber();
147
147
  });
148
148
  }
149
149
 
150
150
  // has sticky headers?
151
- c.$table.bind('stickyHeadersInit', function(){
151
+ c.$table.bind('stickyHeadersInit', function() {
152
152
  $shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
153
153
  $shcell
154
154
  .append(t)
155
- .find('.toggle, .number').bind('change', function(){
155
+ .find('.toggle, .number').bind('change', function() {
156
156
  $cell.find('.number').val( $(this).val() );
157
157
  updateNumber();
158
158
  });
@@ -160,7 +160,7 @@
160
160
  if (o.compare) {
161
161
  // add compare select
162
162
  tsff.addCompare($shcell, indx, o);
163
- $shcell.find(compareSelect).bind('change', function(){
163
+ $shcell.find(compareSelect).bind('change', function() {
164
164
  $cell.find(compareSelect).val( $(this).val() );
165
165
  updateNumber();
166
166
  });
@@ -203,15 +203,17 @@
203
203
  $shcell = [],
204
204
  c = $cell.closest('table')[0].config,
205
205
 
206
- updateRange = function(v, delayed, notrigger){
206
+ updateRange = function(v, delayed, notrigger) {
207
207
  /*jshint eqeqeq:false */
208
208
  // hidden input changes may include compare symbols
209
209
  v = ( typeof v === 'undefined' ? $input.val() : v ).toString().replace(/[<>=]/g, '') || o.value;
210
210
  var compare = ($.isArray(o.compare) ? $cell.find(compareSelect).val() || o.compare[ o.selected || 0] : o.compare) || '',
211
+ // eslint-disable-next-line eqeqeq
211
212
  t = ' (' + (compare ? compare + v : v == o.min ? o.allText : v) + ')',
212
213
  searchType = c.$table[0].hasInitialized ? (delayed ? delayed : o.delayed) || '' : true;
213
214
  $cell.find('input[type=hidden]')
214
215
  // add equal to the beginning, so we filter exact numbers
216
+ // eslint-disable-next-line eqeqeq
215
217
  .val( ( compare ? compare + v : ( v == o.min ? '' : ( o.exactMatch ? '=' : '' ) + v ) ) )
216
218
  // ( val == o.min ? '' : val + (o.exactMatch ? '=' : ''))
217
219
  .trigger( notrigger ? '' : 'search', searchType ).end()
@@ -237,23 +239,24 @@
237
239
  // add span to header for the current slider value
238
240
  .find('.tablesorter-header-inner').append('<span class="curvalue" />');
239
241
  // hidden filter update namespace trigger by filter widget
240
- $input = $cell.find('input[type=hidden]').bind('change' + c.namespace + 'filter', function(){
242
+ $input = $cell.find('input[type=hidden]').bind('change' + c.namespace + 'filter', function() {
241
243
  /*jshint eqeqeq:false */
242
244
  var v = this.value,
243
245
  compare = ($.isArray(o.compare) ? $cell.find(compareSelect).val() || o.compare[ o.selected || 0] : o.compare) || '';
244
246
  if (v !== this.lastValue) {
247
+ // eslint-disable-next-line eqeqeq
245
248
  this.lastValue = ( compare ? compare + v : ( v == o.min ? '' : ( o.exactMatch ? '=' : '' ) + v ) );
246
249
  this.value = this.lastValue;
247
250
  updateRange( v );
248
251
  }
249
252
  });
250
253
 
251
- $cell.find('.range').bind('change', function(){
254
+ $cell.find('.range').bind('change', function() {
252
255
  updateRange( this.value );
253
256
  });
254
257
 
255
258
  // update spinner from hidden input, in case of saved filters
256
- c.$table.bind('filterFomatterUpdate', function(){
259
+ c.$table.bind('filterFomatterUpdate', function() {
257
260
  var val = tsff.updateCompare($cell, $input, o)[0];
258
261
  $cell.find('.range').val( val );
259
262
  updateRange(val, false, true);
@@ -263,17 +266,17 @@
263
266
  if (o.compare) {
264
267
  // add compare select
265
268
  tsff.addCompare($cell, indx, o);
266
- $cell.find(compareSelect).bind('change', function(){
269
+ $cell.find(compareSelect).bind('change', function() {
267
270
  updateRange();
268
271
  });
269
272
  }
270
273
 
271
274
  // has sticky headers?
272
- c.$table.bind('stickyHeadersInit', function(){
275
+ c.$table.bind('stickyHeadersInit', function() {
273
276
  $shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
274
277
  $shcell
275
278
  .html('<input class="range" type="range" min="' + o.min + '" max="' + o.max + '" value="' + o.value + '" />')
276
- .find('.range').bind('change', function(){
279
+ .find('.range').bind('change', function() {
277
280
  updateRange( $shcell.find('.range').val() );
278
281
  });
279
282
  updateRange();
@@ -281,7 +284,7 @@
281
284
  if (o.compare) {
282
285
  // add compare select
283
286
  tsff.addCompare($shcell, indx, o);
284
- $shcell.find(compareSelect).bind('change', function(){
287
+ $shcell.find(compareSelect).bind('change', function() {
285
288
  $cell.find(compareSelect).val( $(this).val() );
286
289
  updateRange();
287
290
  });
@@ -290,11 +293,11 @@
290
293
  });
291
294
 
292
295
  // on reset
293
- $cell.closest('table').bind('filterReset', function(){
296
+ $cell.closest('table').bind('filterReset', function() {
294
297
  if ($.isArray(o.compare)) {
295
298
  $cell.add($shcell).find(compareSelect).val( o.compare[ o.selected || 0 ] );
296
299
  }
297
- setTimeout(function(){
300
+ setTimeout(function() {
298
301
  updateRange(o.value, false, true);
299
302
  }, 0);
300
303
  });
@@ -378,23 +381,23 @@
378
381
  $cell.closest('thead').find('th[data-column=' + indx + ']').find('.tablesorter-header-inner').append('<span class="curcolor" />');
379
382
  }
380
383
 
381
- $cell.find('.toggle, .colorpicker').bind('change', function(){
384
+ $cell.find('.toggle, .colorpicker').bind('change', function() {
382
385
  updateColor( $cell.find('.colorpicker').val() );
383
386
  });
384
387
 
385
388
  // hidden filter update namespace trigger by filter widget
386
- $input = $cell.find('input[type=hidden]').bind('change' + c.namespace + 'filter', function(){
389
+ $input = $cell.find('input[type=hidden]').bind('change' + c.namespace + 'filter', function() {
387
390
  updateColor( this.value );
388
391
  });
389
392
 
390
393
  // update slider from hidden input, in case of saved filters
391
- c.$table.bind('filterFomatterUpdate', function(){
394
+ c.$table.bind('filterFomatterUpdate', function() {
392
395
  updateColor( $input.val(), true );
393
396
  ts.filter.formatterUpdated($cell, indx);
394
397
  });
395
398
 
396
399
  // on reset
397
- $cell.closest('table').bind('filterReset', function(){
400
+ $cell.closest('table').bind('filterReset', function() {
398
401
  // just turn off the colorpicker
399
402
  if (o.addToggle) {
400
403
  $cell.find('.toggle')[0].checked = false;
@@ -402,17 +405,17 @@
402
405
  // delay needed because default color needs to be set in the filter
403
406
  // there is no compare option here, so if addToggle = false,
404
407
  // default color is #000000 (even with no value set)
405
- setTimeout(function(){
408
+ setTimeout(function() {
406
409
  updateColor();
407
410
  }, 0);
408
411
  });
409
412
 
410
413
  // has sticky headers?
411
- c.$table.bind('stickyHeadersInit', function(){
414
+ c.$table.bind('stickyHeadersInit', function() {
412
415
  $shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx);
413
416
  $shcell
414
417
  .html(t)
415
- .find('.toggle, .colorpicker').bind('change', function(){
418
+ .find('.toggle, .colorpicker').bind('change', function() {
416
419
  updateColor( $shcell.find('.colorpicker').val() );
417
420
  });
418
421
  updateColor( $shcell.find('.colorpicker').val() );
@@ -9,7 +9,7 @@
9
9
  */
10
10
  /*jshint browser:true, jquery:true, unused:false */
11
11
  /*global jQuery: false */
12
- ;(function($){
12
+ ;(function($) {
13
13
  'use strict';
14
14
 
15
15
  var ts = $.tablesorter || {},
@@ -19,12 +19,12 @@
19
19
 
20
20
  tsff = ts.filterFormatter = $.extend( {}, ts.filterFormatter, {
21
21
 
22
- addCompare: function($cell, indx, options){
22
+ addCompare: function($cell, indx, options) {
23
23
  if (options.compare && $.isArray(options.compare) && options.compare.length > 1) {
24
24
  var opt = '',
25
25
  compareSelectClass = [ compareSelect.slice(1), ' ' + compareSelect.slice(1), '' ],
26
26
  txt = options.cellText ? '<label class="' + compareSelectClass.join('-label') + indx + '">' + options.cellText + '</label>' : '';
27
- $.each(options.compare, function(i, c){
27
+ $.each(options.compare, function(i, c) {
28
28
  opt += '<option ' + (options.selected === i ? 'selected' : '') + '>' + c + '</option>';
29
29
  });
30
30
  $cell
@@ -40,7 +40,7 @@
40
40
  num = val.replace(/\s*?[><=]\s*?/g, ''),
41
41
  compare = val.match(/[><=]/g) || '';
42
42
  if (o.compare) {
43
- if ($.isArray(o.compare)){
43
+ if ($.isArray(o.compare)) {
44
44
  compare = (compare || []).join('') || o.compare[o.selected || 0];
45
45
  }
46
46
  $cell.find(compareSelect).val( compare );
@@ -72,7 +72,7 @@
72
72
  $input = $('<input class="filter" type="hidden">')
73
73
  .appendTo($cell)
74
74
  // hidden filter update namespace trigger by filter widget
75
- .bind('change' + c.namespace + 'filter', function(){
75
+ .bind('change' + c.namespace + 'filter', function() {
76
76
  updateSpinner({ value: this.value, delayed: false });
77
77
  }),
78
78
  $shcell = [],
@@ -123,7 +123,7 @@
123
123
  '<label for="uispinnerbutton' + indx + '"></label></div>')
124
124
  .appendTo($cell)
125
125
  .find('.toggle')
126
- .bind('change', function(){
126
+ .bind('change', function() {
127
127
  updateSpinner();
128
128
  });
129
129
  }
@@ -134,12 +134,12 @@
134
134
  .val(o.value)
135
135
  .appendTo($cell)
136
136
  .spinner(o)
137
- .bind('change keyup', function(){
137
+ .bind('change keyup', function() {
138
138
  updateSpinner();
139
139
  });
140
140
 
141
141
  // update spinner from hidden input, in case of saved filters
142
- c.$table.bind('filterFomatterUpdate' + c.namespace + 'filter', function(){
142
+ c.$table.bind('filterFomatterUpdate' + c.namespace + 'filter', function() {
143
143
  var val = tsff.updateCompare($cell, $input, o)[0];
144
144
  $cell.find('.spinner').val( val );
145
145
  updateSpinner({ value: val }, true);
@@ -149,20 +149,20 @@
149
149
  if (o.compare) {
150
150
  // add compare select
151
151
  tsff.addCompare($cell, indx, o);
152
- $cell.find(compareSelect).bind('change', function(){
152
+ $cell.find(compareSelect).bind('change', function() {
153
153
  updateSpinner();
154
154
  });
155
155
  }
156
156
 
157
157
  // has sticky headers?
158
- c.$table.bind('stickyHeadersInit' + c.namespace + 'filter', function(){
158
+ c.$table.bind('stickyHeadersInit' + c.namespace + 'filter', function() {
159
159
  $shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
160
160
  if (o.addToggle) {
161
161
  $('<div class="button"><input id="stickyuispinnerbutton' + indx + '" type="checkbox" class="toggle" />' +
162
162
  '<label for="stickyuispinnerbutton' + indx + '"></label></div>')
163
163
  .appendTo($shcell)
164
164
  .find('.toggle')
165
- .bind('change', function(){
165
+ .bind('change', function() {
166
166
  $cell.find('.toggle')[0].checked = this.checked;
167
167
  updateSpinner();
168
168
  });
@@ -172,7 +172,7 @@
172
172
  .val(o.value)
173
173
  .appendTo($shcell)
174
174
  .spinner(o)
175
- .bind('change keyup', function(){
175
+ .bind('change keyup', function() {
176
176
  $cell.find('.spinner').val( this.value );
177
177
  updateSpinner();
178
178
  });
@@ -180,7 +180,7 @@
180
180
  if (o.compare) {
181
181
  // add compare select
182
182
  tsff.addCompare($shcell, indx, o);
183
- $shcell.find(compareSelect).bind('change', function(){
183
+ $shcell.find(compareSelect).bind('change', function() {
184
184
  $cell.find(compareSelect).val( $(this).val() );
185
185
  updateSpinner();
186
186
  });
@@ -189,7 +189,7 @@
189
189
  });
190
190
 
191
191
  // on reset
192
- c.$table.bind('filterReset' + c.namespace + 'filter', function(){
192
+ c.$table.bind('filterReset' + c.namespace + 'filter', function() {
193
193
  if ($.isArray(o.compare)) {
194
194
  $cell.add($shcell).find(compareSelect).val( o.compare[ o.selected || 0 ] );
195
195
  }
@@ -198,7 +198,7 @@
198
198
  $cell.find('.toggle')[0].checked = false;
199
199
  }
200
200
  $cell.find('.spinner').spinner('value', o.value);
201
- setTimeout(function(){
201
+ setTimeout(function() {
202
202
  updateSpinner();
203
203
  }, 0);
204
204
  });
@@ -232,7 +232,7 @@
232
232
  $input = $('<input class="filter" type="hidden">')
233
233
  .appendTo($cell)
234
234
  // hidden filter update namespace trigger by filter widget
235
- .bind('change' + c.namespace + 'filter', function(){
235
+ .bind('change' + c.namespace + 'filter', function() {
236
236
  updateSlider({ value: this.value });
237
237
  }),
238
238
  $shcell = [],
@@ -300,7 +300,7 @@
300
300
  .slider(o);
301
301
 
302
302
  // update slider from hidden input, in case of saved filters
303
- c.$table.bind('filterFomatterUpdate' + c.namespace + 'filter', function(){
303
+ c.$table.bind('filterFomatterUpdate' + c.namespace + 'filter', function() {
304
304
  var val = tsff.updateCompare($cell, $input, o)[0];
305
305
  $cell.find('.slider').slider('value', val );
306
306
  updateSlider({ value: val }, false);
@@ -310,23 +310,23 @@
310
310
  if (o.compare) {
311
311
  // add compare select
312
312
  tsff.addCompare($cell, indx, o);
313
- $cell.find(compareSelect).bind('change', function(){
313
+ $cell.find(compareSelect).bind('change', function() {
314
314
  updateSlider({ value: $cell.find('.slider').slider('value') });
315
315
  });
316
316
  }
317
317
 
318
318
  // on reset
319
- c.$table.bind('filterReset' + c.namespace + 'filter', function(){
319
+ c.$table.bind('filterReset' + c.namespace + 'filter', function() {
320
320
  if ($.isArray(o.compare)) {
321
321
  $cell.add($shcell).find(compareSelect).val( o.compare[ o.selected || 0 ] );
322
322
  }
323
- setTimeout(function(){
323
+ setTimeout(function() {
324
324
  updateSlider({ value: o.value });
325
325
  }, 0);
326
326
  });
327
327
 
328
328
  // has sticky headers?
329
- c.$table.bind('stickyHeadersInit' + c.namespace + 'filter', function(){
329
+ c.$table.bind('stickyHeadersInit' + c.namespace + 'filter', function() {
330
330
  $shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
331
331
 
332
332
  // add a jQuery UI slider!
@@ -334,7 +334,7 @@
334
334
  .val(o.value)
335
335
  .appendTo($shcell)
336
336
  .slider(o)
337
- .bind('change keyup', function(){
337
+ .bind('change keyup', function() {
338
338
  $cell.find('.slider').slider('value', this.value );
339
339
  updateSlider();
340
340
  });
@@ -342,7 +342,7 @@
342
342
  if (o.compare) {
343
343
  // add compare select
344
344
  tsff.addCompare($shcell, indx, o);
345
- $shcell.find(compareSelect).bind('change', function(){
345
+ $shcell.find(compareSelect).bind('change', function() {
346
346
  $cell.find(compareSelect).val( $(this).val() );
347
347
  updateSlider();
348
348
  });
@@ -373,12 +373,12 @@
373
373
  $input = $('<input class="filter" type="hidden">')
374
374
  .appendTo($cell)
375
375
  // hidden filter update namespace trigger by filter widget
376
- .bind('change' + c.namespace + 'filter', function(){
376
+ .bind('change' + c.namespace + 'filter', function() {
377
377
  getRange();
378
378
  }),
379
379
  $shcell = [],
380
380
 
381
- getRange = function(){
381
+ getRange = function() {
382
382
  var val = $input.val(),
383
383
  v = val.split(' - ');
384
384
  if (val === '') { v = [ o.min, o.max ]; }
@@ -449,21 +449,21 @@
449
449
  .slider(o);
450
450
 
451
451
  // update slider from hidden input, in case of saved filters
452
- c.$table.bind('filterFomatterUpdate' + c.namespace + 'filter', function(){
452
+ c.$table.bind('filterFomatterUpdate' + c.namespace + 'filter', function() {
453
453
  getRange();
454
454
  ts.filter.formatterUpdated($cell, indx);
455
455
  });
456
456
 
457
457
  // on reset
458
- c.$table.bind('filterReset' + c.namespace + 'filter', function(){
458
+ c.$table.bind('filterReset' + c.namespace + 'filter', function() {
459
459
  $cell.find('.range').slider('values', o.values);
460
- setTimeout(function(){
460
+ setTimeout(function() {
461
461
  updateUiRange();
462
462
  }, 0);
463
463
  });
464
464
 
465
465
  // has sticky headers?
466
- c.$table.bind('stickyHeadersInit' + c.namespace + 'filter', function(){
466
+ c.$table.bind('stickyHeadersInit' + c.namespace + 'filter', function() {
467
467
  $shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
468
468
 
469
469
  // add a jQuery UI slider!
@@ -471,7 +471,7 @@
471
471
  .val(o.value)
472
472
  .appendTo($shcell)
473
473
  .slider(o)
474
- .bind('change keyup', function(){
474
+ .bind('change keyup', function() {
475
475
  $cell.find('.range').val( this.value );
476
476
  updateUiRange();
477
477
  });
@@ -508,7 +508,7 @@
508
508
  $input = $('<input class="dateCompare" type="hidden">')
509
509
  .appendTo($cell)
510
510
  // hidden filter update namespace trigger by filter widget
511
- .bind('change' + c.namespace + 'filter', function(){
511
+ .bind('change' + c.namespace + 'filter', function() {
512
512
  var v = this.value;
513
513
  if (v) {
514
514
  o.onClose(v);
@@ -558,18 +558,18 @@
558
558
  $date.datepicker(o);
559
559
 
560
560
  // on reset
561
- c.$table.bind('filterReset' + c.namespace + 'filter', function(){
561
+ c.$table.bind('filterReset' + c.namespace + 'filter', function() {
562
562
  if ($.isArray(o.compare)) {
563
563
  $cell.add($shcell).find(compareSelect).val( o.compare[ o.selected || 0 ] );
564
564
  }
565
565
  $cell.add($shcell).find('.date').val(o.defaultDate).datepicker('setDate', o.defaultDate || null);
566
- setTimeout(function(){
566
+ setTimeout(function() {
567
567
  date1Compare();
568
568
  }, 0);
569
569
  });
570
570
 
571
571
  // update date compare from hidden input, in case of saved filters
572
- c.$table.bind('filterFomatterUpdate' + c.namespace + 'filter', function(){
572
+ c.$table.bind('filterFomatterUpdate' + c.namespace + 'filter', function() {
573
573
  var num, v = $input.val();
574
574
  if (/\s+-\s+/.test(v)) {
575
575
  // date range found; assume an exact match on one day
@@ -582,7 +582,7 @@
582
582
  num = num !== '' ? /\d{5}/g.test(num) ? new Date(Number(num)) : num || '' : '';
583
583
  }
584
584
  $cell.add($shcell).find('.date').datepicker( 'setDate', num || null );
585
- setTimeout(function(){
585
+ setTimeout(function() {
586
586
  date1Compare(true);
587
587
  ts.filter.formatterUpdated($cell, indx);
588
588
  }, 0);
@@ -591,13 +591,13 @@
591
591
  if (o.compare) {
592
592
  // add compare select
593
593
  tsff.addCompare($cell, indx, o);
594
- $cell.find(compareSelect).bind('change', function(){
594
+ $cell.find(compareSelect).bind('change', function() {
595
595
  date1Compare();
596
596
  });
597
597
  }
598
598
 
599
599
  // has sticky headers?
600
- c.$table.bind('stickyHeadersInit' + c.namespace + 'filter', function(){
600
+ c.$table.bind('stickyHeadersInit' + c.namespace + 'filter', function() {
601
601
  $shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
602
602
 
603
603
  // add a jQuery datepicker!
@@ -609,7 +609,7 @@
609
609
  if (o.compare) {
610
610
  // add compare select
611
611
  tsff.addCompare($shcell, indx, o);
612
- $shcell.find(compareSelect).bind('change', function(){
612
+ $shcell.find(compareSelect).bind('change', function() {
613
613
  $cell.find(compareSelect).val( $(this).val() );
614
614
  date1Compare();
615
615
  });
@@ -639,14 +639,14 @@
639
639
  }, defDate),
640
640
  t, closeDate, $shcell = [],
641
641
  c = $cell.closest('table')[0].config,
642
- validDate = function(d){
642
+ validDate = function(d) {
643
643
  return d instanceof Date && isFinite(d);
644
644
  },
645
645
  // Add a hidden input to hold the range values
646
646
  $input = $('<input class="dateRange" type="hidden">')
647
647
  .appendTo($cell)
648
648
  // hidden filter update namespace trigger by filter widget
649
- .bind('change' + c.namespace + 'filter', function(){
649
+ .bind('change' + c.namespace + 'filter', function() {
650
650
  var v = this.value;
651
651
  if (v.match(' - ')) {
652
652
  v = v.split(' - ');
@@ -708,12 +708,12 @@
708
708
  $cell.find('.dateTo').datepicker(o);
709
709
 
710
710
  // update date compare from hidden input, in case of saved filters
711
- c.$table.bind('filterFomatterUpdate' + c.namespace + 'filter', function(){
711
+ c.$table.bind('filterFomatterUpdate' + c.namespace + 'filter', function() {
712
712
  var val = $input.val() || '',
713
713
  from = '',
714
714
  to = '';
715
715
  // date range
716
- if (/\s+-\s+/.test(val)){
716
+ if (/\s+-\s+/.test(val)) {
717
717
  val = val.split(/\s+-\s+/) || [];
718
718
  from = val[0] || '';
719
719
  to = val[1] || '';
@@ -732,14 +732,14 @@
732
732
  $cell.add($shcell).find('.dateFrom').datepicker('setDate', from || null);
733
733
  $cell.add($shcell).find('.dateTo').datepicker('setDate', to || null);
734
734
  // give datepicker time to process
735
- setTimeout(function(){
735
+ setTimeout(function() {
736
736
  closeDate();
737
737
  ts.filter.formatterUpdated($cell, indx);
738
738
  }, 0);
739
739
  });
740
740
 
741
741
  // has sticky headers?
742
- c.$table.bind('stickyHeadersInit' + c.namespace + 'filter', function(){
742
+ c.$table.bind('stickyHeadersInit' + c.namespace + 'filter', function() {
743
743
  $shcell = c.widgetOptions.$sticky.find('.tablesorter-filter-row').children().eq(indx).empty();
744
744
  $shcell.append(t);
745
745
 
@@ -753,10 +753,10 @@
753
753
  });
754
754
 
755
755
  // on reset
756
- $cell.closest('table').bind('filterReset' + c.namespace + 'filter', function(){
756
+ $cell.closest('table').bind('filterReset' + c.namespace + 'filter', function() {
757
757
  $cell.add($shcell).find('.dateFrom').val('').datepicker('setDate', o.from || null );
758
758
  $cell.add($shcell).find('.dateTo').val('').datepicker('setDate', o.to || null );
759
- setTimeout(function(){
759
+ setTimeout(function() {
760
760
  closeDate();
761
761
  }, 0);
762
762
  });