1// ScrollHint åæå 2// 対象: 横ã¹ã¯ãã¼ã«ãæ³å®ãããè¦ç´ ã« .js-scrollable ãä»ä¸ãã¦ããï¼æ¢åDOMã§ãOKï¼ 3// åè: https://github.com/ignorant-ghost/scroll-hint 4 5 6(function () { 7 function ready(fn) { 8 if (document.readyState === 'loading') { 9 document.addEventListener('DOMContentLoaded', fn); 10 } else { 11 fn(); 12 } 13 } 14 15 function ensureCss() { 16 var has = Array.prototype.some.call( 17 document.styleSheets, 18 function (s) { return (s.href || '').indexOf('scroll-hint') !== -1; } 19 ); 20 if (has) return Promise.resolve(); 21 return new Promise(function (resolve) { 22 var link = document.createElement('link'); 23 link.rel = 'stylesheet'; 24 link.href = (window.scrollHintLocalBase || '') + '/vendor/scroll-hint/scroll-hint.css'; 25 link.onload = resolve; 26 link.onerror = resolve; // CSS失æã§ãç¶è¡ 27 document.head.appendChild(link); 28 console.log('append link', link); 29 }); 30 } 31 32 function loadScript(url) { 33 return new Promise(function (resolve, reject) { 34 var s = document.createElement('script'); 35 s.src = url; 36 s.defer = true; 37 s.onload = resolve; 38 s.onerror = reject; 39 document.head.appendChild(s); 40 console.log('append script', s); 41 }); 42 } 43 44 function initScrollHint() { 45 if (window.__scrollHintInitialized) return; 46 window.__scrollHintInitialized = true; 47 48 // æ¢åã®ãã¤ã³ãã»ã¯ã·ã§ã³å ã®æ¨ªã¹ã¯ãã¼ã«é åãåæå 49 var targets = document.querySelectorAll( 50 '.p-sec-point__ctt__list__item__ft__table, .p-sec-point__ctt__list__item__ft__img, .p-sec-point__ctt__list__item__ft__img2' 51 ); 52 targets.forEach(function (el) { el.classList.add('js-scrollable'); }); 53 54 var DEBUG_STICKY = false; // æ¬çª: ãããã°ç¡å¹ï¼å¿ è¦æã®ã¿ true ï¼ 55 var sh = new ScrollHint('.js-scrollable', { 56 i18n: { scrollable: 'ã¹ã¯ãã¼ã«ã§ãã¾ã' }, 57 // ã¢ã³ã¼ãã£ãªã³å ã§é表示ã®ã¾ã¾ã¿ã¤ã ã¢ã¦ãããªããããæéçµéã§æ¶ããªã 58 remainingTime: -1, 59 applyToParents: false 60 }); 61 try { window.__scrollHintInstance = sh; } catch (e) {} 62 63 // ç»åããã©ã³ãã®é å»¶èªã¿è¾¼ã¿å¾ã«å¤å®ãåå®è¡ 64 if (typeof window !== 'undefined') { 65 window.addEventListener('load', function () { 66 try { sh.updateItems && sh.updateItems(); } catch (e) {} 67 }); 68 setTimeout(function () { 69 try { sh.updateItems && sh.updateItems(); } catch (e) {} 70 }, 400); 71 } 72 } 73 74 ready(function () { 75 // ãã¼ã«ã«ãã¼ã¹URLãç®åºï¼/wp-content/themes/.../network/src_202508ï¼ 76 try { 77 var cs = document.currentScript && document.currentScript.src; 78 if (cs) { 79 var u = new URL(cs, window.location.href); 80 var p = u.pathname; // /wp-content/themes/gaiathemes/network/src_202508/js/common/scroll-hint-init.js 81 var key = '/network/src_202508/'; 82 var idx = p.indexOf(key); 83 if (idx !== -1) { 84 window.scrollHintLocalBase = u.origin + p.slice(0, idx + key.length - 1); // æ«å°¾ã¯ /network/src_202508 85 } 86 } 87 } catch (e) {} 88 89 // 対象è¦ç´ ãç¡ããã°ä½ãããªãï¼ä¸è¦ãã¼ã¸ã§ã¯èªã¿è¾¼ã¾ãªãï¼ 90 var hasTargets = document.querySelector( 91 '.p-sec-point__ctt__list__item__ft__table, .p-sec-point__ctt__list__item__ft__img, .p-sec-point__ctt__list__item__ft__img2' 92 ); 93 if (!hasTargets) return; 94 95 // ã©ã¤ãã©ãªæªãã¼ãæã®ã¿ãã¼ã«ã«ããåçãã¼ã 96 if (typeof ScrollHint === 'undefined') { 97 ensureCss().then(function(){ 98 return loadScript((window.scrollHintLocalBase || '') + '/vendor/scroll-hint/scroll-hint.min.js'); 99 }).then(function(){ 100 if (typeof ScrollHint !== 'undefined') initScrollHint(); 101 }).catch(function(){ 102 // 失ææã¯é»ã£ã¦ã¹ããã 103 }); 104 } else { 105 ensureCss().then(initScrollHint); 106 } 107 }); 108})(); 109 110
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.