1(function ($) { 2 "use strict"; 3 4 $(document).on('clotyaShopPageInit', function () { 5 clotyaThemeModule.productshare(); 6 }); 7 8 clotyaThemeModule.productshare = function() { 9 const button = document.querySelector('.product-extra-buttons .share-product'); 10 const close = document.querySelector( '.product-share-holder .share-close' ); 11 const container = document.querySelector( '.product-share-holder' ); 12 const shareInput = document.querySelector( '.share-link-input' ); 13 const value = document.querySelector( '.copy-link .link-value' ); 14 const copied = document.querySelector( '.copy-link p .copied' ); 15 16 if ( button !== null ) { 17 button.addEventListener( 'click', function(e) { 18 e.preventDefault(); 19 container.classList.add( 'active' ); 20 }); 21 22 if (close !== null) { 23 close.addEventListener( 'click', function(e) { 24 e.preventDefault(); 25 container.classList.remove( 'active' ); 26 }); 27 } 28 29 if ( shareInput !== null ) { 30 const copyUrl = () => { 31 console.log( 'copy' ); 32 shareInput.select(); 33 shareInput.setSelectionRange(0, 99999); /* For mobile devices */ 34 35 /* Copy the text inside the text field */ 36 navigator.clipboard.writeText(shareInput.value); 37 copied.classList.add('active'); 38 } 39 40 value.addEventListener( 'click', copyUrl); 41 } 42 } 43 } 44 $(document).ready(function() { 45 clotyaThemeModule.productshare(); 46 }); 47 48})(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.