1jQuery(document).ready(function ($) { 2 // lazy load 3 if (fifuImageVars.fifu_lazy) { 4 jQuery.extend(jQuery.lazyLoadXT, { 5 srcAttr: 'data-src', 6 visibleOnly: false, 7 updateEvent: 'load orientationchange resize scroll touchmove focus hover' 8 }); 9 } 10 11 // woocommerce lightbox/zoom 12 disableClick($); 13 disableLink($); 14 15 // for all images at single product page 16 setTimeout(function () { 17 resizeImg($); 18 jQuery('a.woocommerce-product-gallery__trigger').css('visibility', 'visible'); 19 }, 2500); 20 21 // zoomImg 22 setTimeout(function () { 23 jQuery('img.zoomImg').css('z-index', ''); 24 }, 1000); 25}); 26 27jQuery(window).on('ajaxComplete', function () { 28 if (fifuImageVars.fifu_lazy) { 29 setTimeout(function () { 30 jQuery(window).lazyLoadXT(); 31 }, 300); 32 } 33}); 34 35jQuery(window).on('load', function () { 36 jQuery('.flex-viewport').css('height', '100%'); 37}); 38 39function resizeImg($) { 40 var imgSelector = ".post img, .page img, .widget-content img, .product img, .wp-admin img, .tax-product_cat img, .fifu img"; 41 var resizeImage = function (sSel) { 42 jQuery(sSel).each(function () { 43 //original size 44 var width = $(this)['0'].naturalWidth; 45 var height = $(this)['0'].naturalHeight; 46 47 //100% 48 var ratio = width / height; 49 jQuery(this).attr('data-large_image_width', jQuery(window).width() * ratio); 50 jQuery(this).attr('data-large_image_height', jQuery(window).width()); 51 }); 52 }; 53 resizeImage(imgSelector); 54} 55 56function disableClick($) { 57 if (!fifuImageVars.fifu_woo_lbox_enabled) { 58 firstParentClass = ''; 59 parentClass = ''; 60 jQuery('figure.woocommerce-product-gallery__wrapper').find('div.woocommerce-product-gallery__image').each(function (index) { 61 parentClass = jQuery(this).parent().attr('class').split(' ')[0]; 62 if (!firstParentClass) 63 firstParentClass = parentClass; 64 65 if (parentClass != firstParentClass) 66 return false; 67 68 jQuery(this).children().click(function () { 69 return false; 70 }); 71 jQuery(this).children().children().css("cursor", "default"); 72 }); 73 } 74} 75 76function disableLink($) { 77 if (!fifuImageVars.fifu_woo_lbox_enabled) { 78 firstParentClass = ''; 79 parentClass = ''; 80 jQuery('figure.woocommerce-product-gallery__wrapper').find('div.woocommerce-product-gallery__image').each(function (index) { 81 parentClass = jQuery(this).parent().attr('class').split(' ')[0]; 82 if (!firstParentClass) 83 firstParentClass = parentClass; 84 85 if (parentClass != firstParentClass) 86 return false; 87 88 jQuery(this).children().attr("href", ""); 89 }); 90 } 91}
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.