1export default function copyModule() { 2 const copyBtn = document.querySelector(".copyJS"); 3 if (copyBtn) { 4 const copyTxt = copyBtn.querySelector(".txt"); 5 copyBtn.addEventListener("click", () => { 6 copyUrl(); 7 }); 8 9 function copyUrl() { 10 const url = window.location.href; // Lấy URL hiá»n tại 11 navigator.clipboard.writeText(url).then(() => { 12 copyBtn.classList.add("active"); 13 setTimeout(() => { 14 copyBtn.classList.remove("active"); 15 }, 500); 16 }); 17 } 18 } 19 20 // lấy link 21 function ShareSocial() { 22 jQuery(document).ready(function ($) { 23 // Copy link bà i viết 24 const coppyLink = $(".icon-coppy-link"); 25 if (!coppyLink.length) return; 26 27 coppyLink.on("click", function (e) { 28 e.preventDefault(); 29 const urlToCopy = window.location.href; 30 navigator.clipboard.writeText(urlToCopy).then( 31 function () { 32 coppyLink.addClass("active"); 33 setTimeout(() => { 34 coppyLink.removeClass("active"); 35 }, 1000); 36 }, 37 function (err) { 38 console.error("Lá»i khi sao chép liên kết:", err); 39 }, 40 ); 41 }); 42 }); 43 } 44 ShareSocial(); 45}
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.