PageSourceSearch

https://archaeology.jp/themes/contrib/nadru/js/nadru.js?t=1790243454

js archaeology.jp collected 2026-09-24 09:51:14 UTC 26,317 bytes, 570 lines download raw bytes

1/* Load jQuery.
2------------------------------------------------*/
3jQuery(document).ready(function ($) {
4
5  // window.dataLayer = window.dataLayer || [];
6  // function gtag(){dataLayer.push(arguments);}
7  // gtag('js', new Date());
8  // gtag('config', 'G-4VR28L47T3');
9
10  // Disable edit button on admin preview content
11  if ($('#toolbar-administration').length) {
12    $('.user-logged-in button.trigger.focusable').remove();
13  }
14
15  const currentUrl = encodeURIComponent(window.location.href);
16
17  function openCenteredPopup(url, width, height) {
18    const screenWidth = window.screen.width;
19    const screenHeight = window.screen.height;
20
21    const left = (screenWidth - width) / 2;
22    const top = (screenHeight - height) / 2;
23
24    window.open(url, '_blank', `width=${width},height=${height},top=${top},left=${left},scrollbars=no,resizable=no`);
25  }
26
27  $('.facebook').click(function() {
28    const facebookUrl = `https://www.facebook.com/sharer/sharer.php?u=${currentUrl}`;
29    openCenteredPopup(facebookUrl, 600, 400);
30  });
31
32  $('.twitter').click(function() {
33    const twitterUrl = `https://twitter.com/intent/tweet?url=${currentUrl}`;
34    openCenteredPopup(twitterUrl, 600, 400);
35  });
36
37  $('.line').click(function() {
38    const lineUrl = `https://social-plugins.line.me/lineit/share?url=${currentUrl}`;
39    openCenteredPopup(lineUrl, 600, 400);
40  });
41
42  $('a[href$=".pdf"]').each(function () {
43    if (!$(this).attr('target')) {
44      $(this).attr('target', '_blank');
45    }
46    if (window.location.pathname !== '/en/web-accessibility' && window.location.pathname !== '/ja/web-accessibility' && window.location.pathname !== '/web-accessibility') {
47      $(this).wrap('<div class="pdf-wrapper"></div>');
48      if ($('.membership-page').length) {
49        $(this).before(`
50        <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
51        <path d="M12 16L7 11L8.4 9.55L11 12.15V4H13V12.15L15.6 9.55L17 11L12 16ZM6 20C5.45 20 4.97917 19.8042 4.5875 19.4125C4.19583 19.0208 4 18.55 4 18V15H6V18H18V15H20V18C20 18.55 19.8042 19.0208 19.4125 19.4125C19.0208 19.8042 18.55 20 18 20H6Z" fill="#69256E"/>
52        </svg>
53        `);
54      } else {
55        $(this).before(`
56        <svg width="27" height="32" viewBox="0 0 27 32" fill="none" xmlns="http://www.w3.org/2000/svg">
57        <path d="M22.7235 3.71262L26.4299 7.41902V30.8395H1.25366V0.5H19.5108L22.7235 3.71262Z" fill="#FFFEFE" stroke="#949494"/>
58        <path d="M12.6204 2.09961H0.0664062V7.71675H12.6204V2.09961Z" fill="#B43331"/>
59        <path d="M4.56942 3.94066C4.51409 3.80683 4.44019 3.68688 4.33871 3.5854C4.23724 3.48392 4.1126 3.40083 3.96958 3.3455C3.82196 3.28548 3.65578 3.25781 3.47121 3.25781H2.09155V6.81993H2.78828V5.47722H3.47121C3.65578 5.47722 3.82187 5.44955 3.96958 5.38953C4.1126 5.33419 4.23724 5.2511 4.33871 5.14963C4.44019 5.04815 4.51409 4.9328 4.56942 4.79437C4.62016 4.66054 4.64783 4.51752 4.64783 4.3699C4.64783 4.21751 4.62016 4.0744 4.56942 3.94066ZM3.81728 4.72038C3.72499 4.80807 3.59576 4.85421 3.43895 4.85421H2.78837V3.87604H3.43895C3.59585 3.87604 3.72499 3.92218 3.81728 4.01447C3.90496 4.10215 3.9511 4.2221 3.9511 4.36972C3.9511 4.51274 3.90496 4.63278 3.81728 4.72038Z" fill="#FFFEFE"/>
60        <path d="M7.90088 4.63738C7.89628 4.51283 7.89169 4.40208 7.87781 4.30051C7.86393 4.19903 7.84086 4.10675 7.8086 4.01906C7.77633 3.93597 7.73479 3.85297 7.67936 3.77916C7.55482 3.59919 7.40251 3.46536 7.23182 3.38236C7.05645 3.29927 6.84881 3.25781 6.60431 3.25781H5.32153V6.81993H6.60431C6.8489 6.81993 7.05654 6.77838 7.23182 6.69538C7.40251 6.61229 7.55482 6.47855 7.67936 6.29858C7.7347 6.22477 7.77624 6.14168 7.8086 6.05868C7.84086 5.97099 7.86393 5.8787 7.87781 5.77723C7.89169 5.67575 7.89628 5.56499 7.90088 5.44036C7.90548 5.32041 7.90548 5.18658 7.90548 5.03896C7.90548 4.89134 7.90557 4.75733 7.90088 4.63738ZM7.20416 5.39872C7.20416 5.50488 7.19496 5.58789 7.18568 5.66169C7.17649 5.73091 7.16261 5.79552 7.14414 5.84166C7.12566 5.8924 7.09799 5.93854 7.06573 5.98009C6.95038 6.12771 6.775 6.19692 6.54429 6.19692H6.01366V3.87595H6.54429C6.775 3.87595 6.95038 3.94976 7.06573 4.09747C7.09799 4.13901 7.12575 4.18056 7.14414 4.2313C7.16261 4.28203 7.1764 4.34206 7.18568 4.41586C7.19487 4.48508 7.20416 4.57276 7.20416 4.67424C7.20875 4.77572 7.20875 4.90035 7.20875 5.03878C7.20875 5.1772 7.20875 5.29716 7.20416 5.39872Z" fill="#FFFEFE"/>
61        <path d="M10.877 3.87613V3.25781H8.52832V6.81993H9.22504V5.37565H10.6324V4.75274H9.22504V3.87604L10.877 3.87613Z" fill="#FFFEFE"/>
62        <path d="M4.56942 3.94066C4.51409 3.80683 4.44019 3.68688 4.33871 3.5854C4.23724 3.48392 4.1126 3.40083 3.96958 3.3455C3.82196 3.28548 3.65578 3.25781 3.47121 3.25781H2.09155V6.81993H2.78828V5.47722H3.47121C3.65578 5.47722 3.82187 5.44955 3.96958 5.38953C4.1126 5.33419 4.23724 5.2511 4.33871 5.14963C4.44019 5.
6204815 4.51409 4.9328 4.56942 4.79437C4.62016 4.66054 4.64783 4.51752 4.64783 4.3699C4.64783 4.21751 4.62016 4.0744 4.56942 3.94066ZM3.81728 4.72038C3.72499 4.80807 3.59576 4.85421 3.43895 4.85421H2.78837V3.87604H3.43895C3.59585 3.87604 3.72499 3.92218 3.81728 4.01447C3.90496 4.10215 3.9511 4.2221 3.9511 4.36972C3.9511 4.51274 3.90496 4.63278 3.81728 4.72038Z" fill="#FFFEFE"/>
63        <path opacity="0.08" d="M26.9299 7.21222V31.3398H0.753662V25.6828L12.9904 13.4461L13.7148 12.7216L14.1163 12.3202L14.7854 11.6511L15.579 10.8574L23.077 3.35938L26.9299 7.21222Z" fill="#040000"/>
64        <path d="M26.9299 7.21281H19.717V0L26.9299 7.21281Z" fill="#BBBBBA"/>
65        <path d="M23.1922 22.6879C23.0399 22.4203 22.8323 22.1665 22.5739 21.9358C22.3617 21.742 22.1125 21.562 21.831 21.396C20.696 20.7269 19.0764 20.4039 16.8754 20.4039H16.6539C16.5339 20.2931 16.4093 20.1824 16.2801 20.067C15.445 19.3149 14.7805 18.4982 14.2638 17.5893C15.2789 15.3514 15.7634 13.3581 15.7034 11.66C15.6942 11.374 15.6526 11.1063 15.5788 10.8571C15.4681 10.4557 15.2835 10.1004 15.0251 9.80975C15.0205 9.80516 15.0205 9.80516 15.0159 9.80056C14.6052 9.33914 14.0331 9.07617 13.4517 9.07617C12.8657 9.07617 12.3258 9.32995 11.9336 9.79597C11.546 10.2574 11.3384 10.8895 11.3292 11.6324C11.3153 12.7675 11.4076 13.8427 11.6014 14.8347C11.6199 14.9131 11.6337 14.9916 11.6522 15.07C11.8459 15.9698 12.1321 16.8234 12.5012 17.617C12.0674 18.4983 11.6291 19.2596 11.3246 19.7765C11.0939 20.1687 10.8401 20.5794 10.5771 20.99C9.39131 21.2023 8.38538 21.4607 7.50869 21.7837C6.32288 22.2128 5.37228 22.7665 4.68944 23.4263C4.24649 23.8507 3.94657 24.303 3.79887 24.7736C3.64197 25.2581 3.65125 25.7426 3.82653 26.1763C3.98803 26.5777 4.27876 26.9146 4.66628 27.1453C4.75856 27.2006 4.85544 27.2468 4.95701 27.2883C5.25233 27.4083 5.57533 27.4729 5.91211 27.4729C6.69192 27.4729 7.49481 27.136 8.17306 26.5316C9.43736 25.4011 10.7431 23.5831 11.5137 22.4341C12.1459 22.3373 12.8334 22.2542 13.6086 22.1712C14.5222 22.0789 15.3297 22.0236 16.0633 21.9958C16.2894 22.1988 16.5063 22.3926 16.7139 22.5772C17.8674 23.6062 18.7441 24.349 19.5377 24.8704C19.5377 24.875 19.5423 24.875 19.5469 24.875C19.8607 25.0826 20.1607 25.2533 20.4606 25.3917C20.7974 25.5486 21.1388 25.6316 21.4896 25.6316C21.9325 25.6316 22.3478 25.4978 22.6939 25.2533C23.0445 24.9995 23.2983 24.635 23.4137 24.2243C23.5476 23.7307 23.4691 23.1817 23.1922 22.6879ZM12.9903 13.4458C12.9257 12.8736 12.898 12.2783 12.9072 11.6508C12.9164 11.0556 13.1333 10.6542 13.4517 10.6542C13.6916 10.6542 13.9454 10.871 14.0607 11.2863C14.093 11.4108 14.1161 11.554 14.1208 11.7154C14.1299 11.9092 14.1254 12.1122 14.1162 12.3199C14.0885 12.9059 13.9869 13.5288 13.8116 14.1978C13.7055 14.627 13.5671 15.0745 13.3964 15.5405C13.2025 14.8854 13.0641 14.1886 12.9903 13.4458ZM5.29379 25.5903C5.21538 25.3965 5.30298 25.0227 5.78287 24.5613C6.51655 23.8599 7.6655 23.3062 9.26658 22.8863C8.96206 23.3016 8.66214 23.6799 8.37141 24.0259C7.92847 24.5612 7.50391 25.0134 7.12099 25.3549C6.7934 25.6502 6.43346 25.8348 6.09199 25.8809C6.03197 25.8901 5.97204 25.8948 5.91202 25.8948C5.61219 25.8948 5.36769 25.7748 5.29379 25.5903ZM12.6673 20.6853L12.6996 20.6346L12.6488 20.6438C12.658 20.6207 12.6719 20.5977 12.6858 20.5792C12.8795 20.2516 13.1241 19.8317 13.3871 19.3472L13.4102 19.398L13.4702 19.2734C13.6639 19.5503 13.8763 19.8225 14.0977 20.0855C14.2038 20.2101 14.3145 20.3301 14.4253 20.45L14.3515 20.4546L14.4161 20.5147C14.2269 20.5285 14.0285 20.5469 13.8301 20.5654C13.7056 20.5793 13.5763 20.5885 13.4471 20.6023C13.1794 20.63 12.9165 20.6577 12.6673 20.6853ZM20.433 23.5646C19.8839 23.214 19.2703 22.7202 18.5135 22.0604C19.5887 22.1712 20.433 22.4065 21.0328 22.7571C21.2958 22.9094 21.4943 23.0662 21.6281 23.2186C21.8496 23.4539 21.928 23.6661 21.8865 23.8092C21.8495 23.9522 21.688 24.0491 21.4897 24.0491C21.3743 24.0491 21.2544 24.0214 21.1297 23.9614C20.9175 23.8599 20.696 23.7353 20.4607 23.5831C20.4514 23.5831 20.4422 23.5739 20.433 23.5646Z" fill="#B43331"/>
66        </svg>
67        `);
68      }
69    }
70  });
71
72  $('.pdf-wrapper').click(function(e) {
73    const link = $(this).find('a').attr('href');
74    if (link) {
75      window.open(link, '_blank');
76    }
77  });
78
79
80  $('#icon-search-pc').on('click', function () {
81    handleSearch('pc');
82  });
83  $('#icon-search-mb').on('click', function () {
84    handleSearch('mb');
85  });
86
87  $('#input-search-pc').on('keypress', function (e) {
88    if (e.which === 13) {
89      e.preventDefault();
90      handleSearch('pc');
91    }
92  });
93
94  $('#input-search-mb').on('keypress', function (e) {
95    if (e.which === 13) {
96      e.preventDefault();
97      handleSearch('mb');
98    }
99  });
100
101  let activeLang = $('a.language-link.is-active').attr('hreflang');
102
103  function handleSearch(type) {
104    let inputValue = '';
105
106    if (type === 'pc') {
107      inputValue = $('#input-search-pc').val();
108    } else {
109      inputValue = $('#input-search-mb').val();
110    }
111
112    if (inputValue.trim()) {
113      const keywordParam = btoa(encodeURIComponent(inputValue.trim()));
114
115      if (keywordParam) {
116        const langPrefix = activeLang === 'ja' ? '' : '/en';
117        const searchLanguage = activeLang === 'ja' ? '/searchResultJa' : '/searchResultEn';
118
119        window.location.href = langPrefix + searchLanguage + '?keyword=' + keywordParam + '&langcode=' + activeLang;
120      }
121    }
122  }
123
124  $('a.language-link.is-active[hreflang="ja"]').on('click', function (e) {
125    e.preventDefault();
126    e.stopPropagation();
127  });
128
129  $('a.language-link.is-active[hreflang="ja"]').attr('tabindex', '-1');
130
131  if ($('a.language-link.is-active[hreflang="ja"]').length > 0) {
132    $('a.language-link.is-active[hreflang="ja"]').css('cursor', 'default');
133  }
134
135  $('a.language-link').click(function(e) {
136    let clickedLanguage = $(this).attr('hreflang');
137    if (clickedLanguage === 'en') {
138      $(this).attr('href', '/en');
139    } else if (clickedLanguage === 'ja') {
140      $(this).attr('href', '/');
141    }
142  });
143
144  window.isTabbing = false;
145
146  $(window).on('keydown', function (e) {
147    if (e.key === 'Tab') {
148      window.isTabbing = true;
149    }
150  });
151
152  $(window).on('mousedown', function () {
153    window.isTabbing = false;
154  });
155
156  //focus tab
157  const focusConfigs = [
158    {
159      selector: '.site-branding-region #block-nadru-logoen .block-content a, .site-branding a',
160      onFocus: ($el) => $el.find('img').addClass('tab-focus-border-radius'),
161      onBlur: ($el) => $el.find('img').removeClass('tab-focus-border-radius'),
162    },
163    {
164      selector: '.links .language-link',
165      onFocus: ($el) => {
166        if (!($el.is('[hreflang="ja"]') && $el.hasClass('is-active'))) {
167          $el.closest('li').addClass('tab-focus-border-radius');
168        }
169      },
170      onBlur: ($el) => $el.closest('li').removeClass('tab-focus-border-radius'),
171    },
172    {
173      selector: '#input-search-pc',
174      onFocus: ($el) => $el.addClass('input-tab-border'),
175      onBlur: ($el) => $el.removeClass('input-tab-border'),
176    },
177    {
178      selector: '.menu-wrap .main-menu li a, .menu-wrap .menu li a, ' +
179        '.detail-footer-bottom .link-footer-bottom .url a, ' +
180        '.detail-footer-bottom .link-footer-bottom .site-map a, ' +
181        '.group-prize .prize-content .multi-data a, .pager__item a,' +
182        '.breadcrumb .breadcrumb-items .breadcrumb-item a',
183      onFocus: ($el) => $el.addClass('tab-focus-border-radius'),
184      onBlur: ($el) => $el.removeClass('tab-focus-border-radius'),
185    },
186    {
187      selector: '#membership .link-items ul li a',
188      onFocus: ($el) => $el.find('img').addClass('tab-img-border'),
189      onBlur: ($el) => $el.find('img').removeClass('tab-img-border'),
190    },
191    {
192      selector: '.url-activity-detail .background-url .button-grid-activity a',
193      onFocus: ($el) => $el.addClass('tab-focus-border'),
194      onBlur: ($el) => $el.removeClass('tab-focus-border'),
195    },
196    {
197      selector: '.logo-archaeology a',
198      onFocus: ($el) => $el.find('img').addClass('tab-focus-border-radius'),
199      onBlur: ($el) => $el.find('img').removeClass('tab-focus-border-radius'),
200    },
201  ];
202
203  focusConfigs.forEach(({ selector, onFocus, onBlur }) => {
204    $(selector).on('focus', function () {
205      if (isTabbing) onFocus($(this));
206    });
207    $(selector).on('blur', function () {
208      onBlur($(this));
209    });
210  });
211
212  //not focus slider image
213  $('.slider-without-link').attr('tabindex', '-1');
214
215  $(document).on('keydown', function (e) {
216    if (e.key === 'Enter' || e.keyCode === 13) {
217      const $target = $(e.target);
218
219      if ($target.is('.custom-slider .block-btn-pause')) {
220        const $btn = $target.find('.btn-pause').length
221          ? $target.find('.btn-pause')
222          : $target.find('.btn-resume');
223        $btn.trigger('click');
224      }
225
226      if ($target.is('.detail-user-login')) {
227        window.location.href = '/mypage';
228      }
229
230      if ($target.is('.detail-user-not-login')) {
231        window.location.href = '/login';
232      }
233
234      if ($target.is('.twitter, .line, .facebook, .pdf-wrapper')) {
235        $target.trigger('click');
236      }
237    }
238  });
239
240  //focus pdf
241  $('.pdf-wrapper a').on('focus', function () {
242    $(this).closest('.pdf-wrapper').addClass('focus-border-pdf');
243  }).on('blur', function () {
244    $(this).closest('.pdf-wrapper').removeClass('focus-border-pdf');
245  });
246
247  // Mobile menu.
248  $('.mobile-menu').on('click touchstart', function (e) {
249    e.preventDefault();
250    e.stopPropagation();
251
252    $(this).toggleClass('menu-icon-active');
253    $(this).next('.primary-menu-wrapper').toggleClass('active-menu');
254
255    if ($(this).hasClass('menu-icon-active')) {
256      $('.header-right-region').css('display', 'block');
257      $('.footer-header-mb').css('border-top', '1px solid #767676');
258      $('body').css('overflow', 'hidden');
259      $('.dialog-off-canvas-main-canvas').css('overflow', 'hidden');
260      $('.dialog-off-canvas-main-canvas').css('height', '124px');
261
262    } else {
263      $('.herder-mb .header-right-region').css('display', 'none');
264      $('.footer-header-mb').css('border-top', 'none');
265      $('body').css('overflow', 'auto');
266      $('.dialog-off-canvas-main-canvas').css('overflow', 'auto');
267      $('.dialog-off-canvas-main-canvas').css('height', 'unset');
268    }
269  });
270
271  $('.main-menu-item').click(function () {
272    const windowWidth = $(window).width();
273    if (windowWidth < 768) {
274      $('.mobile-menu').trigger('click');
275    }
276  });
277
278  $('.icon-and-id').click(function () {
279    window.location.href = '/mypage';
280  });
281
282
283  $('.url-activity-detail').on('click', '.url', function(e) {
284    let url = $(this).find('a').attr('href');
285    if (url) {
286      window.location.href = url;
287    }
288  });
289
290  $('.url-activity-detail').on('click', '.url a', function(e) {
291    e.preventDefault();
292  });
293
294  $('.icon-setting-logout').click(function(event) {
295    event.stopPropagation();
296    $('.dropdown-options-setting-and-logout').toggle();
297  });
298
299  $(document).click(function() {
300    $('.dropdown-options-setting-and-logout').hide();
301  });
302
303  $('.dropdown-options-setting-and-logout').click(function(event) {
304    event.stopPropagation();
305  });
306
307  $('.close-mobile-menu').click(function () {
308    $(this).closest('.primary-menu-wrapper').toggleClass('active-menu');
309    $('.mobile-menu').removeClass('menu-icon-active');
310  });
311
312  // Full page search.
313  $('.search-icon').click(function () {
314    $('.search-box').css('display', 'flex');
315    return false;
316  });
317  $('.search-box-close').click(function () {
318    $('.search-box').css('display', 'none');
319    return false;
320  });
321
322  // Scroll To Top.
323  $(window).scroll(function () {
324    if ($(this).scrollTop() > 80) {
325      $('.scrolltop').css('display', 'flex');
326    } else {
327      $('.scrolltop').fadeOut('slow');
328    }
329  });
330  $('.scrolltop').click(function () {
331    $('html, body').scrollTop(0);
332  });
333
334  $('.pager__goto-input').on('change', function () {
335    var page = $(this).val();
336    if (page > 0) {
337      var url = new URL(window.location.href);
338      url.searchParams.set('page', page - 1); // Drupal pages are zero-indexed
339      window.location.href = url.toString();
340    }
341  });
342  function triggerMobileMenu() {
343    if ($(window).width() > 768) {
344      $(".menu-icon-active").trigger("click");
345    }
346  }
347
348  triggerMobileMenu();
349
350  $(window).resize(function () {
351    triggerMobileMenu();
352  });
353// End document ready.
354  if (document.querySelector('#main-wrapper form#user-login-form')) {
355    var messageError = document.querySelector('#highlighted .message-error .status-error');
356    if (messageError) {
357      var text = messageError.textContent.trim();
358      if (text.includes('ログイン失敗回数が5回を超えましたので、アカウントを一時的にロックしました。')) {
359        messageError.parentElement.style.display = 'block';
360      }
361
362      var statusList = document.querySelector('ul.status-message-list');
363      if (statusList && statusList.children.length >= 2) {
364        statusList.removeChild(statusList.children[1]);
365      }
366    }
367  }
368
369  $(document).on('click', '.redirect-login', function() {
370    window.location.href = '/login';
371  });
372
373  $('.btn-custom-logout').click(function () {
374    localStorage.setItem('isLogout', 1);
375  });
376
377  window.addEventListener('pageshow', function () {
378    const isLogout = localStorage.getItem('isLogout');
379    if (isLogout == 1) {
380      $('.detail-user-login').html(
381        '<div class="redirect-login">\n' +
382        '                    <svg class="icon-user" width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">\n' +
383        '                      <path d="M3.84976 15.1C4.69976 14.45 5.64976 13.9375 6.69976 13.5625C7.74976 13.1875 8.84976 13 9.99976 13C11.1498 13 12.2498 13.1875 13.2998 13.5625C14.3498 13.9375 15.2998 14.45 16.1498 15.1C16.7331 14.4167 17.1873 13.6417 17.5123 12.775C17.8373 11.9083 17.9998 10.9833 17.9998 10C17.9998 7.78333 17.2206 5.89583 15.6623 4.3375C14.1039 2.77917 12.2164 2 9.99976 2C7.78309 2 5.89559 2.77917 4.33726 4.3375C2.77892 5.89583 1.99976 7.78333 1.99976 10C1.99976 10.9833 2.16226 11.9083 2.48726 12.775C2.81226 13.6417 3.26642 14.4167 3.84976 15.1ZM9.99976 11C9.01642 11 8.18726 10.6625 7.51226 9.9875C6.83726 9.3125 6.49976 8.48333 6.49976 7.5C6.49976 6.51667 6.83726 5.6875 7.51226 5.0125C8.18726 4.3375 9.01642 4 9.99976 4C10.9831 4 11.8123 4.3375 12.4873 5.0125C13.1623 5.6875 13.4998 6.51667 13.4998 7.5C13.4998 8.48333 13.1623 9.3125 12.4873 9.9875C11.8123 10.6625 10.9831 11 9.99976 11ZM9.99976 20C8.61642 20 7.31642 19.7375 6.09976 19.2125C4.88309 18.6875 3.82476 17.975 2.92476 17.075C2.02476 16.175 1.31226 15.1167 0.787256 13.9C0.262256 12.6833 -0.000244141 11.3833 -0.000244141 10C-0.000244141 8.61667 0.262256 7.31667 0.787256 6.1C1.31226 4.88333 2.02476 3.825 2.92476 2.925C3.82476 2.025 4.88309 1.3125 6.09976 0.7875C7.31642 0.2625 8.61642 0 9.99976 0C11.3831 0 12.6831 0.2625 13.8998 0.7875C15.1164 1.3125 16.1748 2.025 17.0748 2.925C17.9748 3.825 18.6873 4.88333 19.2123 6.1C19.7373 7.31667 19.9998 8.61667 19.9998 10C19.9998 11.3833 19.7373 12.6833 19.2123 13.9C18.6873 15.1167 17.9748 16.175 17.0748 17.075C16.1748 17.975 15.1164 18.6875 13.8998 19.2125C12.6831 19.7375 11.3831 20 9.99976 20Z" fill="#69256E"/>\n' +
384        '                    </svg>\n' +
385        '                    <div class="text-user-login">会員ログイン</div>\n' +
386        '                    <div class="icon-redirect-login">\n' +
387        '                      <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n' +
388        '                        <path d="M9 18V16H16V2H9V0H16C16.55 0 17.0208 0.195833 17.4125 0.5875C17.8042 0.979167 18 1.45 18 2V16C18 16.55 17.8042 17.0208 17.4125 17.4125C17.0208 17.8042 16.55 18 16 18H9ZM7 14L5.625 12.55L8.175 10H0V8H8.175L5.625 5.45L7 4L12 9L7 14Z" fill="#5F6368"/>\n' +
389        '                      </svg>\n' +
390        '                    </div>\n' +
391        '                  </div>'
392      ).removeClass('detail-user-login').addClass('detail-user-not-login');
393      $('.dropdown-options-setting-and-logout').hide();
394    }
395  });
396});
397
398/* Function if device width is more than 767px.
399------------------------------------------------*/
400jQuery(window).on('load', function () {
401  // Add empty space for fixed footer.
402  if (jQuery(window).width() > 767) {
403    var footerheight = jQuery('#footer').outerHeight(true) + 4;
404    jQuery('#last-section').css('height', footerheight);
405  }
406
407// end window on load
408});
409
410(function ($, Drupal, once) {
411  'use strict';
412  Drupal.behaviors.advancedPager = {
413    attach: function (context, settings) {
414      once('advanced-pager', '.pager-items, .js-pager__items', context).forEach(function(pagerElement) {
415        const $pagerItems = $(pagerElement);
416
417        const $pageItems = $pagerItems.find('.pager__item').not('.pager__item--previous, .pager__item--next');
418
419        let currentPage = 1;
420        let totalPages = 0;
421
422        $pageItems.each(function() {
423          const $item = $(this);
424          if ($item.hasClass('is-active')) {
425            currentPage = parseInt($item.text().trim());
426          }
427
428          const pageNum = parseInt($item.text().trim());
429          if (!isNaN(pageNum)) {
430            totalPages = Math.max(totalPages, pageNum);
431          }
432        });
433
434        if (totalPages < 8) {
435          return;
436        }
437
438        const pageUrls = {};
439        $pageItems.each(function() {
440          const $item = $(this);
441          const pageNum = parseInt($item.text().trim());
442          if (!isNaN(pageNum)) {
443            const $link = $item.find('a');
444            if ($link.length) {
445              pageUrls[pageNum] = $link.attr('href');
446            }
447          }
448        });
449
450        $pageItems.remove();
451
452        function createPageItem(pageNum, isActive = false) {
453          const $item = $('<li class="pager__item"></li>');
454          if (isActive) {
455            $item.addClass('is-active');
456            $item.append($('<span></span>').text(pageNum));
457          } else if (pageUrls[pageNum]) {
458            $item.append(
459              $('<a></a>')
460                .attr('href', pageUrls[pageNum])
461                .attr('title', Drupal.t('Go to page @num', {'@num': pageNum}))
462                .text(pageNum)
463            );
464          } else {
465            const url = new URL(window.location.href);
466            url.searchParams.set('page', pageNum - 1);
467
468            $item.append(
469              $('<a></a>')
470                .attr('href', url.toString())
471                .attr('title', Drupal.t('Go to page @num', {'@num': pageNum}))
472                .text(pageNum)
473            );
474          }
475          return $item;
476        }
477
478        function createEllipsis() {
479          return $('<li class="pager__item pager__item--ellipsis">...</li>');
480        }
481
482        const $previousButton = $pagerItems.find('.pager__item--previous');
483
484        let $newItems = $();
485
486        $newItems = $newItems.add(createPageItem(1, currentPage === 1));
487
488        if (currentPage <= 4) {
489          for (let i = 2; i <= 5; i++) {
490            if (i <= totalPages) {
491              $newItems = $newItems.add(createPageItem(i, currentPage === i));
492            }
493          }
494
495          if (totalPages > 6) {
496            $newItems = $newItems.add(createEllipsis());
497          }
498
499          if (totalPages > 5) {
500            $newItems = $newItems.add(createPageItem(totalPages, currentPage === totalPages));
501          }
502        }
503        else if (currentPage >= totalPages - 3) {
504          $newItems = $newItems.add(createEllipsis());
505
506          for (let i = totalPages - 4; i <= totalPages; i++) {
507            if (i > 1) {
508              $newItems = $newItems.add(createPageItem(i, currentPage === i));
509            }
510          }
511        }
512        else {
513          $newItems = $newItems.add(createEllipsis());
514
515          for (let i = currentPage - 1; i <= currentPage + 1; i++) {
516            if (i > 1 && i < totalPages) {
517              $newItems = $newItems.add(createPageItem(i, currentPage === i));
518            }
519          }
520
521          $newItems = $newItems.add(createEllipsis());
522
523          $newItems = $newItems.add(createPageItem(totalPages, currentPage === totalPages));
524        }
525
526        if ($previousButton.length) {
527          $previousButton.after($newItems);
528        } else {
529          $pagerItems.prepend($newItems);
530        }
531      });
532
533      once('goto-handler', '.pager__goto-input', context).forEach(function(gotoInput) {
534        const $gotoInput = $(gotoInput);
535        $gotoInput.on('keypress', function(e) {
536          if (e.which === 13) { // Enter key
537            e.preventDefault();
538            const pageNum = parseInt($(this).val());
539
540            if (isNaN(pageNum) || pageNum < 1) {
541              return;
542            }
543
544            const $pagerItems = $('.pager-items, .js-pager__items');
545            const $pageLinks = $pagerItems.find('.pager__item a');
546            let targetUrl = null;
547
548            $pageLinks.each(function() {
549              const $link = $(this);
550              const linkText = $link.text().trim();
551              if (linkText === String(pageNum)) {
552                targetUrl = $link.attr('href');
553                return false;
554              }
555            });
556
557            if (!targetUrl) {
558              const url = new URL(window.location.href);
559              url.searchParams.set('page', pageNum - 1);
560              targetUrl = url.toString();
561            }
562
563            window.location.href = targetUrl;
564          }
565        });
566      });
567    }
568  };
569
570})(jQuery, Drupal, once);

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.