jquery-tablesorter 1.24.5 → 1.25.0

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.
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
@@ -4,7 +4,7 @@
4
4
  */
5
5
  /*jshint browser:true, jquery:true, unused:false */
6
6
  /*global jQuery: false */
7
- ;(function($){
7
+ ;(function($) {
8
8
  'use strict';
9
9
 
10
10
  var ts = $.tablesorter || {};
@@ -33,7 +33,7 @@
33
33
  $input = $('<input class="filter" type="hidden">')
34
34
  .appendTo($cell)
35
35
  // hidden filter update namespace trigger by filter widget
36
- .bind('change' + c.namespace + 'filter', function(){
36
+ .bind('change' + c.namespace + 'filter', function() {
37
37
  var val = convertRegex(this.value);
38
38
  c.$table.find('.select2col' + indx + ' .select2').select2('val', val);
39
39
  updateSelect2();
@@ -88,11 +88,11 @@
88
88
  },
89
89
 
90
90
  // get options from table cell content or filter_selectSource (v2.16)
91
- updateOptions = function(){
91
+ updateOptions = function() {
92
92
  data = [];
93
93
  arry = ts.filter.getOptionSource(c.$table[0], indx, onlyAvail) || [];
94
94
  // build select2 data option
95
- $.each(arry, function(i, v){
95
+ $.each(arry, function(i, v) {
96
96
  // getOptionSource returns { parsed: "value", text: "value" } in v2.24.4
97
97
  data.push({ id: '' + v.parsed, text: v.text });
98
98
  });
@@ -109,7 +109,7 @@
109
109
  // data options are already defined
110
110
  if (!(o.ajax && !$.isEmptyObject(o.ajax)) && !o.data) {
111
111
  updateOptions();
112
- c.$table.bind('filterEnd', function(){
112
+ c.$table.bind('filterEnd', function() {
113
113
  updateOptions();
114
114
  c.$table
115
115
  .find('.select2col' + indx)
@@ -123,7 +123,7 @@
123
123
  .val(o.value)
124
124
  .appendTo($cell)
125
125
  .select2(o)
126
- .bind('change', function(){
126
+ .bind('change', function() {
127
127
  updateSelect2();
128
128
  });
129
129
 
@@ -138,14 +138,14 @@
138
138
  });
139
139
 
140
140
  // has sticky headers?
141
- c.$table.bind('stickyHeadersInit', function(){
141
+ c.$table.bind('stickyHeadersInit', function() {
142
142
  var $shcell = c.widgetOptions.$sticky.find('.select2col' + indx).empty();
143
143
  // add a select2!
144
144
  $('<input class="select2 select2-' + indx + '" type="hidden">')
145
145
  .val(o.value)
146
146
  .appendTo($shcell)
147
147
  .select2(o)
148
- .bind('change', function(){
148
+ .bind('change', function() {
149
149
  c.$table.find('.select2col' + indx)
150
150
  .find('.select2')
151
151
  .select2('val', c.widgetOptions.$sticky.find('.select2col' + indx + ' .select2').select2('val') );
@@ -157,9 +157,9 @@
157
157
  });
158
158
 
159
159
  // on reset
160
- c.$table.bind('filterReset', function(){
160
+ c.$table.bind('filterReset', function() {
161
161
  c.$table.find('.select2col' + indx).find('.select2').select2('val', o.value || '');
162
- setTimeout(function(){
162
+ setTimeout(function() {
163
163
  updateSelect2();
164
164
  }, 0);
165
165
  });
@@ -1,5 +1,5 @@
1
1
  /*! Widget: filter, insideRange filter type - updated 12/10/2015 (v2.25.0) */
2
- ;(function($){
2
+ ;(function($) {
3
3
  'use strict';
4
4
 
5
5
  // Add insideRange filter type
@@ -1,4 +1,4 @@
1
- /*! Widget: filter - updated 2018-01-30 (v2.29.5) *//*
1
+ /*! Widget: filter - updated 2018-03-18 (v2.30.0) *//*
2
2
  * Requires tablesorter v2.8+ and jQuery 1.7+
3
3
  * by Rob Garrison
4
4
  */
@@ -280,6 +280,7 @@
280
280
  if ( tsfRegex.exact.test( data.iFilter ) ) {
281
281
  var txt = data.iFilter.replace( tsfRegex.exact, '' ),
282
282
  filter = tsf.parseFilter( c, txt, data ) || '';
283
+ // eslint-disable-next-line eqeqeq
283
284
  return data.anyMatch ? $.inArray( filter, data.rowArray ) >= 0 : filter == data.iExact;
284
285
  }
285
286
  return null;
@@ -453,7 +454,7 @@
453
454
  c.lastCombinedFilter = null;
454
455
  c.lastSearch = [];
455
456
  // update filterFormatters after update (& small delay) - Fixes #1237
456
- setTimeout(function(){
457
+ setTimeout(function() {
457
458
  c.$table.triggerHandler( 'filterFomatterUpdate' );
458
459
  }, 100);
459
460
  }
@@ -547,7 +548,7 @@
547
548
 
548
549
  // show processing icon
549
550
  if ( c.showProcessing ) {
550
- txt = 'filterStart filterEnd '.split( ' ' ).join( c.namespace + 'filter ' );
551
+ txt = 'filterStart filterEnd '.split( ' ' ).join( c.namespace + 'filter-sp ' );
551
552
  c.$table
552
553
  .unbind( txt.replace( ts.regex.spaces, ' ' ) )
553
554
  .bind( txt, function( event, columns ) {
@@ -626,6 +627,9 @@
626
627
  c.lastSearch = c.$table.data( 'lastSearch' );
627
628
  c.$table.triggerHandler( 'filterInit', c );
628
629
  tsf.findRows( c.table, c.lastSearch || [] );
630
+ if (ts.debug(c, 'filter')) {
631
+ console.log('Filter >> Widget initialized');
632
+ }
629
633
  };
630
634
  if ( $.isEmptyObject( wo.filter_formatter ) ) {
631
635
  completed();
@@ -1326,6 +1330,7 @@
1326
1330
  storedFilters = $.extend( [], filters ),
1327
1331
  c = table.config,
1328
1332
  wo = c.widgetOptions,
1333
+ debug = ts.debug(c, 'filter'),
1329
1334
  // data object passed to filters; anyMatch is a flag for the filters
1330
1335
  data = {
1331
1336
  anyMatch: false,
@@ -1342,7 +1347,6 @@
1342
1347
  defaultColFilter : [],
1343
1348
  defaultAnyFilter : ts.getColumnData( table, wo.filter_defaultFilter, c.columns, true ) || ''
1344
1349
  };
1345
-
1346
1350
  // parse columns after formatter, in case the class is added at that point
1347
1351
  data.parsed = [];
1348
1352
  for ( columnIndex = 0; columnIndex < c.columns; columnIndex++ ) {
@@ -1364,8 +1368,8 @@
1364
1368
  ( ts.getColumnData( table, wo.filter_excludeFilter, columnIndex, true ) || '' ).split( /\s+/ );
1365
1369
  }
1366
1370
 
1367
- if ( c.debug ) {
1368
- console.log( 'Filter: Starting filter widget search', filters );
1371
+ if ( debug ) {
1372
+ console.log( 'Filter >> Starting filter widget search', filters );
1369
1373
  time = new Date();
1370
1374
  }
1371
1375
  // filtered rows count
@@ -1463,8 +1467,8 @@
1463
1467
  notFiltered = $rows.not( '.' + wo.filter_filteredRow ).length;
1464
1468
  // can't search when all rows are hidden - this happens when looking for exact matches
1465
1469
  if ( searchFiltered && notFiltered === 0 ) { searchFiltered = false; }
1466
- if ( c.debug ) {
1467
- console.log( 'Filter: Searching through ' +
1470
+ if ( debug ) {
1471
+ console.log( 'Filter >> Searching through ' +
1468
1472
  ( searchFiltered && notFiltered < len ? notFiltered : 'all' ) + ' rows' );
1469
1473
  }
1470
1474
  if ( data.anyMatchFlag ) {
@@ -1567,8 +1571,8 @@
1567
1571
  if ( wo.filter_saveFilters && ts.storage ) {
1568
1572
  ts.storage( table, 'tablesorter-filters', tsf.processFilters( storedFilters, true ) );
1569
1573
  }
1570
- if ( c.debug ) {
1571
- console.log( 'Completed filter widget search' + ts.benchmark(time) );
1574
+ if ( debug ) {
1575
+ console.log( 'Filter >> Completed search' + ts.benchmark(time) );
1572
1576
  }
1573
1577
  if ( wo.filter_initialized ) {
1574
1578
  c.$table.triggerHandler( 'filterBeforeEnd', c );
@@ -1783,13 +1787,13 @@
1783
1787
  options += '<option';
1784
1788
  for ( val in option ) {
1785
1789
  if ( option.hasOwnProperty( val ) && val !== 'text' ) {
1786
- options += ' ' + val + '="' + option[ val ] + '"';
1790
+ options += ' ' + val + '="' + option[ val ].replace( tsfRegex.quote, '&quot;' ) + '"';
1787
1791
  }
1788
1792
  }
1789
1793
  if ( !option.value ) {
1790
- options += ' value="' + option.text + '"';
1794
+ options += ' value="' + option.text.replace( tsfRegex.quote, '&quot;' ) + '"';
1791
1795
  }
1792
- options += '>' + option.text + '</option>';
1796
+ options += '>' + option.text.replace( tsfRegex.quote, '&quot;' ) + '</option>';
1793
1797
  // above code is needed in jQuery < v1.8
1794
1798
 
1795
1799
  // make sure we don't turn an object into a string (objects without a "text" property)
@@ -4,7 +4,7 @@
4
4
  */
5
5
  /*jshint browser:true, jquery:true, unused:false */
6
6
  /*global jQuery: false */
7
- ;(function($){
7
+ ;(function($) {
8
8
  'use strict';
9
9
  var ts = $.tablesorter;
10
10
 
@@ -33,7 +33,7 @@
33
33
  formatter[ column ] = ts.getColumnData( c.table, wo.formatter_column, column ) || false;
34
34
  }
35
35
  // main loop
36
- for ( tbodyIndex = 0; tbodyIndex < c.$tbodies.length; tbodyIndex++ ){
36
+ for ( tbodyIndex = 0; tbodyIndex < c.$tbodies.length; tbodyIndex++ ) {
37
37
  $tbody = ts.processTbody( c.table, c.$tbodies.eq( tbodyIndex ), true ); // detach tbody
38
38
  rows = c.cache[ tbodyIndex ];
39
39
  len = rows.normalized.length;
@@ -4,7 +4,7 @@
4
4
  */
5
5
  /*jshint browser:true, jquery:true, unused:false */
6
6
  /*global jQuery: false */
7
- ;(function($){
7
+ ;(function($) {
8
8
  'use strict';
9
9
  var ts = $.tablesorter,
10
10
 
@@ -12,7 +12,7 @@
12
12
 
13
13
  types : {
14
14
  number : function(c, $column, txt, num) {
15
- var word, result,
15
+ var result,
16
16
  ascSort = $column.hasClass( ts.css.sortAsc );
17
17
  if ( num > 1 && txt !== '' ) {
18
18
  if ( ascSort ) {
@@ -43,7 +43,7 @@
43
43
  letter : function(c, $column, txt, num) {
44
44
  return txt ? (txt + ' ').substring(0, num) : '';
45
45
  },
46
- date : function(c, $column, txt, part, group) {
46
+ date : function(c, $column, txt, part) {
47
47
  var year, month,
48
48
  wo = c.widgetOptions,
49
49
  time = new Date(txt || '');
@@ -203,7 +203,7 @@
203
203
  return savedGroup;
204
204
  },
205
205
  findColumnGroups : function( c, wo, data ) {
206
- var tbodyIndex, norm_rows, $row, rowIndex, end, undef,
206
+ var tbodyIndex, norm_rows, rowIndex, end, undef,
207
207
  hasPager = ts.hasWidget( c.table, 'pager' ),
208
208
  p = c.pager || {};
209
209
  data.groupIndex = 0;
@@ -251,15 +251,15 @@
251
251
  }
252
252
  },
253
253
 
254
- bindEvents : function(table, c, wo){
254
+ bindEvents : function(table, c, wo) {
255
255
  if (wo.group_collapsible) {
256
256
  wo.group_collapsedGroups = [];
257
257
  // .on() requires jQuery 1.7+
258
- c.$table.on('click toggleGroup keyup', 'tr.group-header', function(event){
258
+ c.$table.on('click toggleGroup keyup', 'tr.group-header', function(event) {
259
259
  event.stopPropagation();
260
260
  // pressing enter will toggle the group
261
261
  if (event.type === 'keyup' && event.which !== 13) { return; }
262
- var isCollapsed, $groups, indx,
262
+ var isCollapsed, indx,
263
263
  $this = $(this),
264
264
  name = $this.find('.group-name').text().toLowerCase() + $this.attr('data-group-index');
265
265
  // use shift-click to toggle ALL groups
@@ -276,7 +276,6 @@
276
276
  }
277
277
  // save collapsed groups
278
278
  if (wo.group_saveGroups && ts.storage) {
279
- $groups = c.$table.find('.group-header');
280
279
  if (!wo.group_collapsedGroups[wo.group_collapsedGroup]) {
281
280
  wo.group_collapsedGroups[wo.group_collapsedGroup] = [];
282
281
  }
@@ -292,15 +291,15 @@
292
291
  }
293
292
  });
294
293
  }
295
- $(wo.group_saveReset).on('click', function(){
294
+ $(wo.group_saveReset).on('click', function() {
296
295
  tsg.clearSavedGroups(table);
297
296
  });
298
- c.$table.on('pagerChange.tsgrouping', function(){
297
+ c.$table.on('pagerChange.tsgrouping', function() {
299
298
  tsg.update(table);
300
299
  });
301
300
  },
302
301
 
303
- clearSavedGroups: function(table){
302
+ clearSavedGroups: function(table) {
304
303
  if (table && ts.storage) {
305
304
  ts.storage(table, 'tablesorter-groups', '');
306
305
  tsg.update(table);
@@ -320,7 +319,7 @@
320
319
  group_count : ' ({num})', // if not false, the '{num}' string is replaced with the number of rows in the group
321
320
  group_separator : '-', // group name separator; used when group-separator-# class is used.
322
321
  group_formatter : null, // function(txt, column, table, c, wo) { return txt; }
323
- group_callback : null, // function($cell, $rows, column, table){}, callback allowing modification of the group header labels
322
+ group_callback : null, // function($cell, $rows, column, table) {}, callback allowing modification of the group header labels
324
323
  group_complete : 'groupingComplete', // event triggered on the table when the grouping widget has finished work
325
324
 
326
325
  // apply the grouping widget only to selected column
@@ -344,13 +343,13 @@
344
343
  // reference: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date#Conversion_getter
345
344
  group_dateString : function(date) { return date.toLocaleString(); }
346
345
  },
347
- init: function(table, thisWidget, c, wo){
346
+ init: function(table, thisWidget, c, wo) {
348
347
  tsg.bindEvents(table, c, wo);
349
348
  },
350
- format: function(table, c, wo) {
349
+ format: function(table) {
351
350
  tsg.update(table);
352
351
  },
353
- remove : function(table, c, wo){
352
+ remove : function(table, c) {
354
353
  c.$table
355
354
  .off('click', 'tr.group-header')
356
355
  .off('pagerChange.tsgrouping')
@@ -4,7 +4,7 @@
4
4
  */
5
5
  /*jshint browser:true, jquery:true, unused:false */
6
6
  /*global jQuery: false */
7
- ;(function($){
7
+ ;(function($) {
8
8
  'use strict';
9
9
  var ts = $.tablesorter;
10
10
 
@@ -35,14 +35,14 @@
35
35
  // manipulate the title as desired
36
36
  headerTitle_callback : null // function($cell, txt) { return txt; }
37
37
  },
38
- init: function(table, thisWidget, c, wo){
38
+ init: function(table, thisWidget, c, wo) {
39
39
  // force refresh
40
- c.$table.on('refreshHeaderTitle', function(){
40
+ c.$table.on('refreshHeaderTitle', function() {
41
41
  thisWidget.format(table, c, wo);
42
42
  });
43
43
  // add tooltip class
44
44
  if ($.isArray(wo.headerTitle_tooltip)) {
45
- c.$headers.each(function(){
45
+ c.$headers.each(function() {
46
46
  $(this).addClass( wo.headerTitle_tooltip[this.column] || '' );
47
47
  });
48
48
  } else if (wo.headerTitle_tooltip !== '') {
@@ -51,9 +51,8 @@
51
51
  },
52
52
  format: function (table, c, wo) {
53
53
  var txt;
54
- c.$headers.each(function(){
55
- var t = this,
56
- $this = $(this),
54
+ c.$headers.each(function() {
55
+ var $this = $(this),
57
56
  col = parseInt( $this.attr( 'data-column' ), 10 ),
58
57
  sortType = wo.headerTitle_type[ col ] || c.parsers[ col ].type || 'text',
59
58
  sortDirection = $this.hasClass(ts.css.sortAsc) ? 0 : $this.hasClass(ts.css.sortDesc) ? 1 : 2,
@@ -64,7 +63,7 @@
64
63
  txt = (wo.headerTitle_prefix || '') + // now deprecated
65
64
  ($this.hasClass('sorter-false') ? wo.headerTitle_output_nosort :
66
65
  ts.isValueInArray( col, c.sortList ) >= 0 ? wo.headerTitle_output_sorted : wo.headerTitle_output_unsorted);
67
- txt = txt.replace(/\{(current|next|name)\}/gi, function(m){
66
+ txt = txt.replace(/\{(current|next|name)\}/gi, function(m) {
68
67
  return {
69
68
  '{name}' : $this.text(),
70
69
  '{current}' : wo[ 'headerTitle_cur_' + sortType ][ sortDirection ] || '',
@@ -80,7 +79,7 @@
80
79
  c.$table.off('refreshHeaderTitle');
81
80
  // remove tooltip class
82
81
  if ($.isArray(wo.headerTitle_tooltip)) {
83
- c.$headers.each(function(){
82
+ c.$headers.each(function() {
84
83
  $(this).removeClass( wo.headerTitle_tooltip[this.column] || '' );
85
84
  });
86
85
  } else if (wo.headerTitle_tooltip !== '') {
@@ -51,7 +51,7 @@
51
51
  $(window).scroll();
52
52
  }, 1);
53
53
  },
54
- remove : function( c, wo ) {
54
+ remove : function( c ) {
55
55
  c.$table.off( c.namespace + 'lazyload' );
56
56
  }
57
57
  };
@@ -200,26 +200,26 @@
200
200
  var settings = {
201
201
  threshold : 0,
202
202
  failure_limit : 0,
203
- event : "scroll",
204
- effect : "show",
203
+ event : 'scroll',
204
+ effect : 'show',
205
205
  container : window,
206
- data_attribute : "original",
206
+ data_attribute : 'original',
207
207
  skip_invisible : false,
208
208
  appear : null,
209
209
  load : null,
210
- placeholder : "data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="
210
+ placeholder : 'data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=='
211
211
  };
212
212
  function update() {
213
213
  var counter = 0;
214
214
  elements.each(function() {
215
215
  var $this = $(this);
216
- if (settings.skip_invisible && !$this.is(":visible")) {
216
+ if (settings.skip_invisible && !$this.is(':visible')) {
217
217
  return;
218
218
  }
219
219
  if ($.abovethetop(this, settings) || $.leftofbegin(this, settings)) {
220
220
  /* Nothing. */
221
221
  } else if (!$.belowthefold(this, settings) && !$.rightoffold(this, settings)) {
222
- $this.trigger("appear");
222
+ $this.trigger('appear');
223
223
  /* if we found an image we'll load, reset the counter */
224
224
  counter = 0;
225
225
  } else {
@@ -245,7 +245,7 @@
245
245
  $container = (settings.container === undefined ||
246
246
  settings.container === window) ? $window : $(settings.container);
247
247
  /* Fire one scroll event per scroll. Not one scroll event per image. */
248
- if (0 === settings.event.indexOf("scroll")) {
248
+ if (0 === settings.event.indexOf('scroll')) {
249
249
  $container.bind(settings.event, function() {
250
250
  return update();
251
251
  });
@@ -255,26 +255,26 @@
255
255
  var $self = $(self);
256
256
  self.loaded = false;
257
257
  /* If no src attribute given use data:uri. */
258
- if ($self.attr("src") === undefined || $self.attr("src") === false) {
259
- if ($self.is("img")) {
260
- $self.attr("src", settings.placeholder);
258
+ if ($self.attr('src') === undefined || $self.attr('src') === false) {
259
+ if ($self.is('img')) {
260
+ $self.attr('src', settings.placeholder);
261
261
  }
262
262
  }
263
263
  /* When appear is triggered load original image. */
264
- $self.one("appear", function() {
264
+ $self.one('appear', function() {
265
265
  if (!this.loaded) {
266
266
  if (settings.appear) {
267
267
  var elements_left = elements.length;
268
268
  settings.appear.call(self, elements_left, settings);
269
269
  }
270
- $("<img />")
271
- .bind("load", function() {
272
- var original = $self.attr("data-" + settings.data_attribute);
270
+ $('<img />')
271
+ .bind('load', function() {
272
+ var original = $self.attr('data-' + settings.data_attribute);
273
273
  $self.hide();
274
- if ($self.is("img")) {
275
- $self.attr("src", original);
274
+ if ($self.is('img')) {
275
+ $self.attr('src', original);
276
276
  } else {
277
- $self.css("background-image", "url('" + original + "')");
277
+ $self.css('background-image', 'url("' + original + '")');
278
278
  }
279
279
  $self[settings.effect](settings.effect_speed);
280
280
  self.loaded = true;
@@ -288,30 +288,30 @@
288
288
  settings.load.call(self, elements_left, settings);
289
289
  }
290
290
  })
291
- .attr("src", $self.attr("data-" + settings.data_attribute));
291
+ .attr('src', $self.attr('data-' + settings.data_attribute));
292
292
  }
293
293
  });
294
294
  /* When wanted event is triggered load original image */
295
295
  /* by triggering appear. */
296
- if (0 !== settings.event.indexOf("scroll")) {
296
+ if (0 !== settings.event.indexOf('scroll')) {
297
297
  $self.bind(settings.event, function() {
298
298
  if (!self.loaded) {
299
- $self.trigger("appear");
299
+ $self.trigger('appear');
300
300
  }
301
301
  });
302
302
  }
303
303
  });
304
304
  /* Check if something appears when window is resized. */
305
- $window.bind("resize", function() {
305
+ $window.bind('resize', function() {
306
306
  update();
307
307
  });
308
308
  /* With IOS5 force loading images when navigating with back button. */
309
309
  /* Non optimal workaround. */
310
310
  if ((/(?:iphone|ipod|ipad).*os 5/gi).test(navigator.appVersion)) {
311
- $window.bind("pageshow", function(event) {
311
+ $window.bind('pageshow', function(event) {
312
312
  if (event.originalEvent && event.originalEvent.persisted) {
313
313
  elements.each(function() {
314
- $(this).trigger("appear");
314
+ $(this).trigger('appear');
315
315
  });
316
316
  }
317
317
  });
@@ -365,17 +365,17 @@
365
365
  !$.belowthefold(element, settings) && !$.abovethetop(element, settings);
366
366
  };
367
367
  /* Custom selectors for your convenience. */
368
- /* Use as $("img:below-the-fold").something() or */
369
- /* $("img").filter(":below-the-fold").something() which is faster */
370
- $.extend($.expr[":"], {
371
- "below-the-fold" : function(a) { return $.belowthefold(a, {threshold : 0}); },
372
- "above-the-top" : function(a) { return !$.belowthefold(a, {threshold : 0}); },
373
- "right-of-screen": function(a) { return $.rightoffold(a, {threshold : 0}); },
374
- "left-of-screen" : function(a) { return !$.rightoffold(a, {threshold : 0}); },
375
- "in-viewport" : function(a) { return $.inviewport(a, {threshold : 0}); },
368
+ /* Use as $('img:below-the-fold').something() or */
369
+ /* $('img').filter(':below-the-fold').something() which is faster */
370
+ $.extend($.expr[':'], {
371
+ 'below-the-fold' : function(a) { return $.belowthefold(a, {threshold : 0}); },
372
+ 'above-the-top' : function(a) { return !$.belowthefold(a, {threshold : 0}); },
373
+ 'right-of-screen': function(a) { return $.rightoffold(a, {threshold : 0}); },
374
+ 'left-of-screen' : function(a) { return !$.rightoffold(a, {threshold : 0}); },
375
+ 'in-viewport' : function(a) { return $.inviewport(a, {threshold : 0}); },
376
376
  /* Maintain BC for couple of versions. */
377
- "above-the-fold" : function(a) { return !$.belowthefold(a, {threshold : 0}); },
378
- "right-of-fold" : function(a) { return $.rightoffold(a, {threshold : 0}); },
379
- "left-of-fold" : function(a) { return !$.rightoffold(a, {threshold : 0}); }
377
+ 'above-the-fold' : function(a) { return !$.belowthefold(a, {threshold : 0}); },
378
+ 'right-of-fold' : function(a) { return $.rightoffold(a, {threshold : 0}); },
379
+ 'left-of-fold' : function(a) { return !$.rightoffold(a, {threshold : 0}); }
380
380
  });
381
381
  })(jQuery, window, document);