PageSourceSearch

https://www.tokyodome-hotels.co.jp/assets/common/scripts/modules/linkIcon.js

js tokyodome-hotels.co.jp collected 2026-10-01 14:07:35 UTC 1,662 bytes, 45 lines download raw bytes

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.