1const fileIcons = [ 2 { 3 id: 'pdf', 4 title: 'PDFãã¡ã¤ã«ãéã', 5 href: '/assets/common/images/icon-pdf-symbol.svg#pdf', 6 extensions: ['.pdf'], 7 }, 8]; 9const blankIcon = { 10 id: 'blank', 11 title: 'å¥ã¦ã£ã³ãã¦ã§éã', 12 href: '/assets/common/images/icon-blank-symbol.svg#blank', 13}; 14const renderIcon = (parentElement, icon) => { 15 const svgHTML = `<svg class="m-icon-link" data-id="${icon.id}"><title>${icon.title}</title><use xlink:href="${icon.href}"></use></svg>`; 16 // ããã¹ãé¨åï¼.m-link-list__textï¼ãããã°ãã®ç´å¾ããªããã°å¾æ¥éã 17 const textElement = parentElement.querySelector('.m-link-list__text'); 18 if (textElement) { 19 textElement.insertAdjacentHTML('beforeend', svgHTML); 20 } 21 else { 22 // é常ï¼aéãã¿ã°ç´åã«æ¿å ¥ï¼ 23 parentElement.insertAdjacentHTML('beforeend', svgHTML); 24 } 25}; 26const renderLinkIcon = (linkElement, parentElement) => { 27 const extension = `.${linkElement.href.split('.').pop()}`; 28 const fileIcon = fileIcons.find((icon) => icon.extensions.includes(extension)); 29 if (fileIcon) { 30 renderIcon(parentElement, fileIcon); 31 return; 32 } 33 if (linkElement.target === '_blank') { 34 renderIcon(parentElement, blankIcon); 35 } 36}; 37const linkElements = document.querySelectorAll('.js-link-icon'); 38document.addEventListener('DOMContentLoaded', () => { 39 linkElements.forEach((linkElement) => { 40 const parentElement = linkElement.querySelector('.js-link-icon__parent') ?? 41 linkElement; 42 renderLinkIcon(linkElement, parentElement); 43 }); 44}); 45export {};
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.