1// Example of js-plugin; How to extend the Abou namespace 2; (function (window, document, Abou, $, undefined) { 3 4 // Custom namespace (plugin) 5 Abou.responsiveimages = (function () { 6 var currentWidth = 0; 7 8 var monitorResize = function () { 9 10 // Check if the window have changed size - if yes, check if images need to be changed 11 if (currentWidth != window.innerWidth) 12 { 13 // Only check images that have a class with the name 'responsiveImage' 14 $(".responsiveImage").each(function () { 15 var $imageTag = $(this); 16 if (Abou.common.isMobileMode() && $imageTag.data('mobilesrc')) { 17 // Mobile is indicated - lets show the mobile image if one exist 18 $imageTag.attr('src', $imageTag.data('mobilesrc')); 19 } 20 else if ($imageTag.data('fullscreensrc')) { 21 // Lets show the original sized image if it exist 22 $imageTag.attr('src', $imageTag.data('fullscreensrc')); 23 } 24 }); 25 26 currentWidth = window.innerWidth; 27 } 28 29 // Check again in 500 ms 30 setTimeout(function () { monitorResize() }, 500); 31 } 32 33 // Public properties 34 return { 35 36 init: function () { 37 monitorResize(); 38 } 39 }; 40 }()); 41 42}(this, this.document, window.Abou = window.Abou || {}, jQuery));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.