146. Araxis Merge File Comparison Report

Produced by Araxis Merge on 2021-07-21 10:22:12 +0000. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

146.1 Files compared

#LocationFileLast Modified
1/Applications/Ampps/www/Porto v4.0.0/Theme Files/Magento 2.x/Porto Theme/app/design/frontend/Smartwave/porto/web/jsjquery.lazyload.js2018-06-12 05:23:24 +0000
2/Applications/Ampps/www/Porto v4.0.1/Theme Files/Magento 2.x/Porto Theme/app/design/frontend/Smartwave/porto/web/jsjquery.lazyload.js2018-06-12 05:23:24 +0000

146.2 Comparison summary

DescriptionBetween
Files 1 and 2
Text BlocksLines
Unchanged1530
Changed00
Inserted00
Removed00

146.3 Comparison options

WhitespaceConsecutive whitespace is treated as a single space
Character caseDifferences in character case are significant
Line endingsDifferences in line endings (CR and LF characters) are ignored
CR/LF charactersNot shown in the comparison detail
Active line-pairing rules

146.4 Active regular expressions

No regular expressions were active.

146.5 Comparison detail

1 /*! 1 /*!
2  * Lazy Load - jQuery plugin for lazy loading images 2  * Lazy Load - jQuery plugin for lazy loading images
3  * 3  *
4  * Copyright (c) 2007-2015 Mika Tuupola 4  * Copyright (c) 2007-2015 Mika Tuupola
5  * 5  *
6  * Licensed under the MIT license: 6  * Licensed under the MIT license:
7  *   http://www.opensource.org/licenses/mit-license.php 7  *   http://www.opensource.org/licenses/mit-license.php
8  * 8  *
9  * Project home: 9  * Project home:
10  *   http://www.appelsiini.net/projects/lazyload 10  *   http://www.appelsiini.net/projects/lazyload
11  * 11  *
12  * Version:  1.9.7 12  * Version:  1.9.7
13  * 13  *
14  */ 14  */
15 (function (factory) { 15 (function (factory) {
16     'use strict'; 16     'use strict';
17  17 
18     if (typeof define === 'function' && define.amd) { 18     if (typeof define === 'function' && define.amd) {
19         define([ 19         define([
20             'jquery' 20             'jquery'
21         ], factory); 21         ], factory);
22     } else { 22     } else {
23         factory(window.jQuery); 23         factory(window.jQuery);
24     } 24     }
25 }(function ($) { 25 }(function ($) {
26     'use strict'; 26     'use strict';
27  27 
28     var $window = $(window); 28     var $window = $(window);
29  29 
30     $.fn.lazyload = function(options) { 30     $.fn.lazyload = function(options) {
31         var elements = this; 31         var elements = this;
32         var $container; 32         var $container;
33         var settings = { 33         var settings = {
34             threshold       : 0, 34             threshold       : 0,
35             failure_limit   : 0, 35             failure_limit   : 0,
36             event           : "scroll", 36             event           : "scroll",
37             effect          : "show", 37             effect          : "show",
38             container       : window, 38             container       : window,
39             data_attribute  : "src", 39             data_attribute  : "src",
40             data_srcset     : "srcset", 40             data_srcset     : "srcset",
41             skip_invisible  : false, 41             skip_invisible  : false,
42             appear          : null, 42             appear          : null,
43             load            : null, 43             load            : null,
44             placeholder     : "data:image/gif;base64,R0lGODlhAQABAIAAAPT09P///yH5BAEAAAEALAAAAAABAAEAAAICRAEAOw==" 44             placeholder     : "data:image/gif;base64,R0lGODlhAQABAIAAAPT09P///yH5BAEAAAEALAAAAAABAAEAAAICRAEAOw=="
45         }; 45         };
46  46 
47         function update() { 47         function update() {
48             var counter = 0; 48             var counter = 0;
49  49 
50             elements.each(function() { 50             elements.each(function() {
51                 var $this = $(this); 51                 var $this = $(this);
52                 if (settings.skip_invisible && !$this.is(":visible")) { 52                 if (settings.skip_invisible && !$this.is(":visible")) {
53                     return; 53                     return;
54                 } 54                 }
55                 if ($.abovethetop(this, settings) || 55                 if ($.abovethetop(this, settings) ||
56                     $.leftofbegin(this, settings)) { 56                     $.leftofbegin(this, settings)) {
57                         /* Nothing. */ 57                         /* Nothing. */
58                 } else if (!$.belowthefold(this, settings) && 58                 } else if (!$.belowthefold(this, settings) &&
59                     !$.rightoffold(this, settings)) { 59                     !$.rightoffold(this, settings)) {
60                         $this.trigger("appear"); 60                         $this.trigger("appear");
61                         /* if we found an image we'll load, reset the counter */ 61                         /* if we found an image we'll load, reset the counter */
62                         counter = 0; 62                         counter = 0;
63                 } else { 63                 } else {
64                     if (++counter > settings.failure_limit) { 64                     if (++counter > settings.failure_limit) {
65                         return false; 65                         return false;
66                     } 66                     }
67                 } 67                 }
68             }); 68             });
69  69 
70         } 70         }
71  71 
72         if(options) { 72         if(options) {
73             /* Maintain BC for a couple of versions. */ 73             /* Maintain BC for a couple of versions. */
74             if (undefined !== options.failurelimit) { 74             if (undefined !== options.failurelimit) {
75                 options.failure_limit = options.failurelimit; 75                 options.failure_limit = options.failurelimit;
76                 delete options.failurelimit; 76                 delete options.failurelimit;
77             } 77             }
78             if (undefined !== options.effectspeed) { 78             if (undefined !== options.effectspeed) {
79                 options.effect_speed = options.effectspeed; 79                 options.effect_speed = options.effectspeed;
80                 delete options.effectspeed; 80                 delete options.effectspeed;
81             } 81             }
82  82 
83             $.extend(settings, options); 83             $.extend(settings, options);
84         } 84         }
85  85 
86         /* Cache container as jQuery as object. */ 86         /* Cache container as jQuery as object. */
87         $container = (settings.container === undefined || 87         $container = (settings.container === undefined ||
88                       settings.container === window) ? $window : $(settings.container); 88                       settings.container === window) ? $window : $(settings.container);
89  89 
90         /* Fire one scroll event per scroll. Not one scroll event per image. */ 90         /* Fire one scroll event per scroll. Not one scroll event per image. */
91         if (0 === settings.event.indexOf("scroll")) { 91         if (0 === settings.event.indexOf("scroll")) {
92             $container.bind(settings.event, function() { 92             $container.bind(settings.event, function() {
93                 return update(); 93                 return update();
94             }); 94             });
95         } 95         }
96  96 
97         this.each(function() { 97         this.each(function() {
98             var self = this; 98             var self = this;
99             var $self = $(self); 99             var $self = $(self);
100  100 
101             self.loaded = false; 101             self.loaded = false;
102  102 
103             /* If no src attribute given use data:uri. */ 103             /* If no src attribute given use data:uri. */
104             //if ($self.attr("src") === undefined || $self.attr("src") === false) { 104             //if ($self.attr("src") === undefined || $self.attr("src") === false) {
105                 if ($self.is("img")) { 105                 if ($self.is("img")) {
106                     $self.attr("src", settings.placeholder); 106                     $self.attr("src", settings.placeholder);
107                     if ($self.attr("width")) 107                     if ($self.attr("width"))
108                         $self.css("height",$self.width()*$self.attr("height")/$self.attr("width") + "px"); 108                         $self.css("height",$self.width()*$self.attr("height")/$self.attr("width") + "px");
109                 } 109                 }
110             //} 110             //}
111  111 
112             /* When appear is triggered load original image. */ 112             /* When appear is triggered load original image. */
113             $self.one("appear", function() { 113             $self.one("appear", function() {
114                 if (!this.loaded) { 114                 if (!this.loaded) {
115                     if (settings.appear) { 115                     if (settings.appear) {
116                         var elements_left = elements.length; 116                         var elements_left = elements.length;
117                         settings.appear.call(self, elements_left, settings); 117                         settings.appear.call(self, elements_left, settings);
118                     } 118                     }
119                     $("<img />") 119                     $("<img />")
120                         .bind("load", function() { 120                         .bind("load", function() {
121  121 
122                             var original = $self.attr("data-" + settings.data_attribute), 122                             var original = $self.attr("data-" + settings.data_attribute),
123                                 srcset = $self.attr("data-" + settings.data_srcset); 123                                 srcset = $self.attr("data-" + settings.data_srcset);
124                             $self.hide(); 124                             $self.hide();
125                             if ($self.is("img")) { 125                             if ($self.is("img")) {
126                                 $self.attr("src", original); 126                                 $self.attr("src", original);
127                                 if(srcset) { 127                                 if(srcset) {
128                                     $self.attr("srcset", srcset); 128                                     $self.attr("srcset", srcset);
129                                 } 129                                 }
130                             } else { 130                             } else {
131                                 $self.css("background-image", "url('" + original + "')"); 131                                 $self.css("background-image", "url('" + original + "')");
132                             } 132                             }
133                             $self[settings.effect](settings.effect_speed); 133                             $self[settings.effect](settings.effect_speed);
134  134 
135                             self.loaded = true; 135                             self.loaded = true;
136  136 
137                             /* Remove image from array so it is not looped next time. */ 137                             /* Remove image from array so it is not looped next time. */
138                             var temp = $.grep(elements, function(element) { 138                             var temp = $.grep(elements, function(element) {
139                                 return !element.loaded; 139                                 return !element.loaded;
140                             }); 140                             });
141                             elements = $(temp); 141                             elements = $(temp);
142                             $self.addClass("porto-lazyload-loaded"); 142                             $self.addClass("porto-lazyload-loaded");
143                             $self.css("height",""); 143                             $self.css("height","");
144                             if (settings.load) { 144                             if (settings.load) {
145                                 var elements_left = elements.length; 145                                 var elements_left = elements.length;
146                                 settings.load.call(self, elements_left, settings); 146                                 settings.load.call(self, elements_left, settings);
147                             } 147                             }
148                         }) 148                         })
149                         .attr("src", $self.attr("data-" + settings.data_attribute)); 149                         .attr("src", $self.attr("data-" + settings.data_attribute));
150                 } 150                 }
151             }); 151             });
152  152 
153             /* When wanted event is triggered load original image */ 153             /* When wanted event is triggered load original image */
154             /* by triggering appear.                              */ 154             /* by triggering appear.                              */
155             if (0 !== settings.event.indexOf("scroll")) { 155             if (0 !== settings.event.indexOf("scroll")) {
156                 $self.bind(settings.event, function() { 156                 $self.bind(settings.event, function() {
157                     if (!self.loaded) { 157                     if (!self.loaded) {
158                         $self.trigger("appear"); 158                         $self.trigger("appear");
159                     } 159                     }
160                 }); 160                 });
161             } 161             }
162  162 
163             if ($self.is(":hidden") && !self.loaded) { 163             if ($self.is(":hidden") && !self.loaded) {
164                 $self.trigger("appear"); 164                 $self.trigger("appear");
165             } 165             }
166         }); 166         });
167  167 
168         /* Check if something appears when window is resized. */ 168         /* Check if something appears when window is resized. */
169         $window.bind("resize", function() { 169         $window.bind("resize", function() {
170             update(); 170             update();
171         }); 171         });
172  172 
173         /* With IOS5 force loading images when navigating with back button. */ 173         /* With IOS5 force loading images when navigating with back button. */
174         /* Non optimal workaround. */ 174         /* Non optimal workaround. */
175         if ((/(?:iphone|ipod|ipad).*os 5/gi).test(navigator.appVersion)) { 175         if ((/(?:iphone|ipod|ipad).*os 5/gi).test(navigator.appVersion)) {
176             $window.bind("pageshow", function(event) { 176             $window.bind("pageshow", function(event) {
177                 if (event.originalEvent && event.originalEvent.persisted) { 177                 if (event.originalEvent && event.originalEvent.persisted) {
178                     elements.each(function() { 178                     elements.each(function() {
179                         $(this).trigger("appear"); 179                         $(this).trigger("appear");
180                     }); 180                     });
181                 } 181                 }
182             }); 182             });
183         } 183         }
184  184 
185         /* Force initial check if images should appear. */ 185         /* Force initial check if images should appear. */
186         $(document).ready(function() { 186         $(document).ready(function() {
187             update(); 187             update();
188         }); 188         });
189  189 
190         return this; 190         return this;
191     }; 191     };
192  192 
193     /* Convenience methods in jQuery namespace.           */ 193     /* Convenience methods in jQuery namespace.           */
194     /* Use as  $.belowthefold(element, {threshold : 100, container : window}) */ 194     /* Use as  $.belowthefold(element, {threshold : 100, container : window}) */
195  195 
196     $.belowthefold = function(element, settings) { 196     $.belowthefold = function(element, settings) {
197         var fold; 197         var fold;
198  198 
199         if (settings.container === undefined || settings.container === window) { 199         if (settings.container === undefined || settings.container === window) {
200             fold = (window.innerHeight ? window.innerHeight : $window.height()) + $window.scrollTop(); 200             fold = (window.innerHeight ? window.innerHeight : $window.height()) + $window.scrollTop();
201         } else { 201         } else {
202             fold = $(settings.container).offset().top + $(settings.container).height(); 202             fold = $(settings.container).offset().top + $(settings.container).height();
203         } 203         }
204  204 
205         return fold <= $(element).offset().top - settings.threshold; 205         return fold <= $(element).offset().top - settings.threshold;
206     }; 206     };
207  207 
208     $.rightoffold = function(element, settings) { 208     $.rightoffold = function(element, settings) {
209         var fold; 209         var fold;
210  210 
211         if (settings.container === undefined || settings.container === window) { 211         if (settings.container === undefined || settings.container === window) {
212             fold = $window.width() + $window.scrollLeft(); 212             fold = $window.width() + $window.scrollLeft();
213         } else { 213         } else {
214             fold = $(settings.container).offset().left + $(settings.container).width(); 214             fold = $(settings.container).offset().left + $(settings.container).width();
215         } 215         }
216  216 
217         return fold <= $(element).offset().left - settings.threshold; 217         return fold <= $(element).offset().left - settings.threshold;
218     }; 218     };
219  219 
220     $.abovethetop = function(element, settings) { 220     $.abovethetop = function(element, settings) {
221         var fold; 221         var fold;
222  222 
223         if (settings.container === undefined || settings.container === window) { 223         if (settings.container === undefined || settings.container === window) {
224             fold = $window.scrollTop(); 224             fold = $window.scrollTop();
225         } else { 225         } else {
226             fold = $(settings.container).offset().top; 226             fold = $(settings.container).offset().top;
227         } 227         }
228  228 
229         return fold >= $(element).offset().top + settings.threshold  + $(element).height(); 229         return fold >= $(element).offset().top + settings.threshold  + $(element).height();
230     }; 230     };
231  231 
232     $.leftofbegin = function(element, settings) { 232     $.leftofbegin = function(element, settings) {
233         var fold; 233         var fold;
234  234 
235         if (settings.container === undefined || settings.container === window) { 235         if (settings.container === undefined || settings.container === window) {
236             fold = $window.scrollLeft(); 236             fold = $window.scrollLeft();
237         } else { 237         } else {
238             fold = $(settings.container).offset().left; 238             fold = $(settings.container).offset().left;
239         } 239         }
240  240 
241         return fold >= $(element).offset().left + settings.threshold + $(element).width(); 241         return fold >= $(element).offset().left + settings.threshold + $(element).width();
242     }; 242     };
243  243 
244     $.inviewport = function(element, settings) { 244     $.inviewport = function(element, settings) {
245          return !$.rightoffold(element, settings) && !$.leftofbegin(element, settings) && 245          return !$.rightoffold(element, settings) && !$.leftofbegin(element, settings) &&
246                 !$.belowthefold(element, settings) && !$.abovethetop(element, settings); 246                 !$.belowthefold(element, settings) && !$.abovethetop(element, settings);
247      }; 247      };
248  248 
249     /* Custom selectors for your convenience.   */ 249     /* Custom selectors for your convenience.   */
250     /* Use as $("img:below-the-fold").something() or */ 250     /* Use as $("img:below-the-fold").something() or */
251     /* $("img").filter(":below-the-fold").something() which is faster */ 251     /* $("img").filter(":below-the-fold").something() which is faster */
252  252 
253     $.extend($.expr[":"], { 253     $.extend($.expr[":"], {
254         "below-the-fold" : function(a) { return $.belowthefold(a, {threshold : 0}); }, 254         "below-the-fold" : function(a) { return $.belowthefold(a, {threshold : 0}); },
255         "above-the-top"  : function(a) { return !$.belowthefold(a, {threshold : 0}); }, 255         "above-the-top"  : function(a) { return !$.belowthefold(a, {threshold : 0}); },
256         "right-of-screen": function(a) { return $.rightoffold(a, {threshold : 0}); }, 256         "right-of-screen": function(a) { return $.rightoffold(a, {threshold : 0}); },
257         "left-of-screen" : function(a) { return !$.rightoffold(a, {threshold : 0}); }, 257         "left-of-screen" : function(a) { return !$.rightoffold(a, {threshold : 0}); },
258         "in-viewport"    : function(a) { return $.inviewport(a, {threshold : 0}); }, 258         "in-viewport"    : function(a) { return $.inviewport(a, {threshold : 0}); },
259         /* Maintain BC for couple of versions. */ 259         /* Maintain BC for couple of versions. */
260         "above-the-fold" : function(a) { return !$.belowthefold(a, {threshold : 0}); }, 260         "above-the-fold" : function(a) { return !$.belowthefold(a, {threshold : 0}); },
261         "right-of-fold"  : function(a) { return $.rightoffold(a, {threshold : 0}); }, 261         "right-of-fold"  : function(a) { return $.rightoffold(a, {threshold : 0}); },
262         "left-of-fold"   : function(a) { return !$.rightoffold(a, {threshold : 0}); } 262         "left-of-fold"   : function(a) { return !$.rightoffold(a, {threshold : 0}); }
263     }); 263     });
264  264 
265 })); 265 }));