1/** 2 * SNSã·ã§ã¢: URLã³ãã¼æ©è½ 3 * 4 * ã¤ãã³ãå§è²ã§åç追å è¦ç´ ï¼.js-copy-linkï¼ã«ãå¯¾å¿ 5 * 6 * @package madameFIGARO.jp 7 */ 8document.addEventListener('click', function (e) { 9 var link = e.target.closest('.js-copy-link'); 10 if (!link) return; 11 e.preventDefault(); 12 13 var url = link.getAttribute('data-copy-url'); 14 15 if (navigator.clipboard && navigator.clipboard.writeText) { 16 navigator.clipboard.writeText(url).then(function () { 17 alert('URLãã³ãã¼ãã¾ãã'); 18 }).catch(function (err) { 19 console.error('ã³ãã¼ã«å¤±æãã¾ãã:', err); 20 }); 21 } else { 22 // Clipboard API é対å¿ãã©ã¦ã¶ç¨ãã©ã¼ã«ãã㯠23 var textarea = document.createElement('textarea'); 24 textarea.value = url; 25 textarea.style.position = 'fixed'; 26 textarea.style.opacity = '0'; 27 document.body.appendChild(textarea); 28 textarea.select(); 29 try { 30 document.execCommand('copy'); 31 alert('URLãã³ãã¼ãã¾ãã'); 32 } catch (err) { 33 console.error('ã³ãã¼ã«å¤±æãã¾ãã:', err); 34 } 35 document.body.removeChild(textarea); 36 } 37});
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.