1(function ($) { 2 'use strict'; 3 4 window.pioOldText = {}; 5 6 $(document).on('click', '.pio-elementor-copy-btn', function (e) { 7 8 e.preventDefault(); 9 e.stopPropagation(); 10 11 var pioEle = $(this); 12 var txt2Copy = pioEle.attr('pioec-copy-text'); 13 var pioecId = pioEle.attr('pioec-id'); 14 15 if (!txt2Copy) { 16 return false; 17 } 18 19 function copied() { 20 21 console.log('Copied:', txt2Copy); 22 23 var copiedText = pioEle.attr('pioec-button-text'); 24 25 if (copiedText) { 26 27 if (!window.pioOldText[pioecId]) { 28 window.pioOldText[pioecId] = pioEle.find('.elementor-button-text').first().text(); 29 } 30 31 pioEle.find('.elementor-button-text').text(copiedText); 32 33 pioEle.addClass('pioPulseAnimation'); 34 35 setTimeout(function () { 36 pioEle.removeClass('pioPulseAnimation'); 37 }, 500); 38 39 setTimeout(function () { 40 pioEle.find('.elementor-button-text').text(window.pioOldText[pioecId]); 41 }, 5000); 42 } 43 } 44 45 function fallbackCopy(text) { 46 47 var textarea = document.createElement("textarea"); 48 textarea.value = text; 49 50 textarea.style.position = "fixed"; 51 textarea.style.opacity = 0; 52 53 document.body.appendChild(textarea); 54 55 textarea.focus(); 56 textarea.select(); 57 58 try { 59 document.execCommand("copy"); 60 copied(); 61 } catch (err) { 62 console.error(err); 63 alert("Copy failed"); 64 } 65 66 document.body.removeChild(textarea); 67 } 68 69 if (navigator.clipboard && window.isSecureContext) { 70 71 navigator.clipboard.writeText(txt2Copy) 72 .then(copied) 73 .catch(function () { 74 fallbackCopy(txt2Copy); 75 }); 76 77 } else { 78 79 fallbackCopy(txt2Copy); 80 81 } 82 83 return false; 84 85 }); 86 87})(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.