1(function() { 2 'use strict'; 3 4 // 5 // ãµã¤ãå ±éJavaScriptæ©è½ 6 // åæ©è½ãã¢ã¸ã¥ã¼ã«åãã¦ç®¡ç 7 // ============================================= 8 9 10 // 11 // 12 // ããã¦ã³ã¹é¢æ° 13 // çæéã«é£ç¶ãã¦çºçããã¤ãã³ããå¶å¾¡ããæå¾ã®ã¤ãã³ãããä¸å®æéçµéå¾ã«1åã ã颿°ãå®è¡ 14 // https://developer.mozilla.org/ja/docs/Web/API/setTimeout 15 // https://developer.mozilla.org/ja/docs/Web/API/clearTimeout 16 // --------------------------------------------- 17 function debounce(func, delay) { 18 let timeoutId; 19 return function(...args) { 20 // https://developer.mozilla.org/ja/docs/Web/API/clearTimeout 21 clearTimeout(timeoutId); 22 // https://developer.mozilla.org/ja/docs/Web/API/setTimeout 23 timeoutId = setTimeout(() => func.apply(this, args), delay); 24 }; 25 } 26 27 /** 28 * ã¿ããã¤ãã³ãã®ããã©ã¼ãã³ã¹æé©å 29 * https://developer.mozilla.org/ja/docs/Web/API/EventTarget/addEventListener 30 */ 31 function touchStartOptimization() { 32 // https://developer.mozilla.org/ja/docs/Web/API/Document/addEventListener 33 document.addEventListener("touchstart", function () {}, { passive: true }); 34 } 35 36 /** 37 * ã¹ã¯ãã¼ã«å¶å¾¡ã¢ã¸ã¥ã¼ã« 38 * ï¼perfect scrollbarã¨ä½µç¨æã«ä½¿ç¨ï¼ 39 */ 40 const scrollController = { 41 /** 42 * ã¹ã¯ãã¼ã«ç¦æ¢é¢æ° 43 * https://developer.mozilla.org/ja/docs/Web/API/Event/preventDefault 44 */ 45 preventScroll: function(event) { 46 event.preventDefault(); 47 }, 48 49 /** 50 * ããã¯ã¼å ãé¤å¤ããã¹ã¯ãã¼ã«ç¦æ¢é¢æ° 51 * https://developer.mozilla.org/ja/docs/Web/API/Element/closest 52 */ 53 preventScrollExceptDrawer: function(event) { 54 // ããã¯ã¼å ã®è¦ç´ ããã§ã㯠55 const isInsideDrawer = event.target.closest('.l-commonHeader__nav'); 56 57 // ããã¯ã¼å ã§ãªãå ´åã®ã¿ã¹ã¯ãã¼ã«ãç¦æ¢ 58 if (!isInsideDrawer) { 59 event.preventDefault(); 60 } 61 }, 62 63 /** 64 * ã¹ã¯ãã¼ã«ç¦æ¢ãæå¹å 65 * https://developer.mozilla.org/ja/docs/Web/API/EventTarget/addEventListener 66 */ 67 disable: function() { 68 document.addEventListener("wheel", this.preventScroll, { passive: false }); 69 document.addEventListener("touchmove", this.preventScroll, { passive: false }); 70 }, 71 72 /** 73 * ã¹ã¯ãã¼ã«ç¦æ¢ãè§£é¤ 74 * https://developer.mozilla.org/ja/docs/Web/API/EventTarget/removeEventListener 75 */ 76 enable: function() { 77 document.removeEventListener("wheel", this.preventScroll, { passive: false }); 78 document.removeEventListener("touchmove", this.preventScroll, { passive: false }); 79 } 80 }; 81 82 /** 83 * ãã¬ã¤ã¯ãã¤ã³ã管çã¢ã¸ã¥ã¼ã« 84 * https://developer.mozilla.org/ja/docs/Web/API/Window/matchMedia 85 */ 86 const breakPointManager = { 87 /** 88 * ãã¬ã¤ã¯ãã¤ã³ãã«å¿ããå¦çã®å®è¡ 89 */ 90 checkBreakPoint: function() { 91 if (window.matchMedia("screen and (max-width: calc(0.0625rem * 520))").matches) { 92 // 520px以ä¸ã®å¦ç 93 this.handleMobile(); 94 } else if (window.matchMedia("screen and (max-width: calc(0.0625rem * 880))").matches) { 95 // 521pxã880pxã®å¦ç 96 this.handleTablet(); 97 } 98 99 if (window.matchMedia("screen and (min-width: calc(0.0625rem * 881))").matches) { 100 // 881px以ä¸ã®å¦ç 101 this.handleDesktop(); 102 } 103 }, 104 105 /** 106 * ã¢ãã¤ã«è¡¨ç¤ºæã®å¦ç 107 */ 108 handleMobile: function() { 109 // ã¢ãã¤ã«åºæã®å¦çãããã«è¨è¿° 110 }, 111 112 /** 113 * ã¿ãã¬ãã表示æã®å¦ç 114 */ 115 handleTablet: function() { 116 // ã¿ãã¬ããåºæã®å¦çãããã«è¨è¿° 117 }, 118 119 /** 120 * ãã¹ã¯ããã表示æã®å¦ç 121 */ 122 handleDesktop: function() { 123 // ãã¹ã¯ãããåºæã®å¦çãããã«è¨è¿° 124 }, 125 126 /** 127 * ãªãµã¤ãºã¤ãã³ãã®åæåï¼ããã¦ã³ã¹å¦çä»ãï¼ 128 * https://developer.mozilla.org/ja/docs/Web/API/Window/resize_event 129 */ 130 initResize: function() { 131 // 132 // breakPointManagerã¸æ ¼ç´ãã颿°ã®å®è¡ã®ãã 133 // thisãselfã«æ ¼ç´ããªãã¸ã§ã¯ãã¸ã®åç §ãåºå® 134 // --------------------------------------------- 135 const self = this; 136 137 // ããã¦ã³ã¹å¦çãé©ç¨ãããªãµã¤ãºãã³ãã©ã¼ 138 const debouncedResize = debounce(function() { 139 self.checkBreakPoint(); 140 }, 300); 141 142 // https://developer.mozilla.org/ja/docs/Web/API/EventTarget/addEventListener 143 window.addEventListener('resize', debouncedResize); 144 } 145 }; 146 147 /** 148 * ã¢ã³ã«ã¼ãªã³ã¯å¦çã¢ã¸ã¥ã¼ã« 149 */ 150 const anchorLinkHandler = { 151 /** 152 * ã¢ã³ã«ã¼ãªã³ã¯ã®ã¹ã ã¼ã¹ã¹ã¯ãã¼ã«è¨å® 153 * https://developer.mozilla.org/ja/docs/Web/API/Document/querySelectorAll 154 */ 155 init: function() { 156 const htmlElement = document.querySelector("html"); 157 const anchorLinks = document.querySelectorAll('a[href^="#"]'); 158 159 anchorLinks.forEach(function(element) { 160 element.addEventListener("click", function() { 161 htmlElement.style.scrollBehavior = "smooth"; 162 163 // https://developer.mozilla.org/ja/docs/Web/API/setTimeout 164 setTimeout(function() { 165 htmlElement.style.scrollBehavior = ""; 166 }, 500); 167 }); 168 }); 169 } 170 }; 171 172 /** 173 * ã¡ã¼ã«ã¢ãã¬ã¹å¤ææ©è½ã¢ã¸ã¥ã¼ã«ï¼Luftæ¹å¼ï¼ 174 */ 175 const mailConverter = { 176 /** 177 * æåå夿颿° 178 * https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/String/charCodeAt 179 * https://developer.mozilla.org/ja/docs/Web/JavaScript/Reference/Global_Objects/String/fromCharCode 180 */ 181 convert: function(encodedString) { 182 let decodedString = ""; 183 let charCode = ""; 184 185 for (let i = 0; i < encodedString.length; i++) {
186 charCode = encodedString.charCodeAt(i); 187 decodedString += String.fromCharCode(charCode + 1); 188 } 189 190 return decodedString; 191 } 192 }; 193 194 195 // 196 // ãã¼ãã«ã®ã¹ã¯ãã¼ã«å¦çã¢ã¸ã¥ã¼ã« 197 // --------------------------------------------- 198 const tableScrollHandler = { 199 200 noticeTableIsScrollable: function() { 201 const table = document.querySelector('.c-expandTableInSmallScreen'); 202 if (!table) return; 203 204 // 520px以ä¸ã®æã ããã³ãè¦ç´ ãå¶å¾¡ 205 if (window.matchMedia('(max-width: calc(0.0625rem * 520))').matches) { 206 207 // ã¹ã¯ãã¼ã«ä½ç½®ãåå¾ 208 const scrollLeft = table.scrollLeft; 209 console.log(scrollLeft); 210 211 // ã¹ã¯ãã¼ã«ç¶æ ã«åºã¥ãã¦ãã³ãè¦ç´ ã追å 212 if (scrollLeft <= 70) { 213 // ã¾ã£ããå³ã«ã¹ã¯ãã¼ã«ããã¦ããªãå ´åï¼æ«å°¾ã«ãã³ãã追å 214 table.classList.add('js-no-scrolled'); 215 table.classList.remove('js-scrolled'); 216 } else { 217 // 70px以ä¸ã¹ã¯ãã¼ã«ãããå ´åï¼æåã«ãã³ãã追å 218 table.classList.remove('js-no-scrolled'); 219 table.classList.add('js-scrolled'); 220 } 221 // å³ç«¯ã¾ã§è¡ã£ãå ´åã¯ä½ãããªãï¼ãã³ãè¦ç´ ãªãï¼ 222 } else { 223 // 520pxãã大ããå ´åã¯æ¢åã®ãã³ãè¦ç´ ãåé¤ 224 table.classList.remove('js-no-scrolled'); 225 table.classList.remove('js-scrolled'); 226 } 227 }, 228 229 // 230 // ã¹ã¯ãã¼ã«ã¤ãã³ãã®è¨å® 231 // --------------------------------------------- 232 initScrollListener: function() { 233 const table = document.querySelector('.c-expandTableInSmallScreen'); 234 if (!table) return; 235 236 // 520px以ä¸ã®æã ãã¹ã¯ãã¼ã«ã¤ãã³ããè¨å® 237 if (window.matchMedia('(max-width: calc(0.0625rem * 520))').matches) { 238 // ããã¦ã³ã¹ãªãã§ãªã¢ã«ã¿ã¤ã å¦ç 239 table.addEventListener('scroll', () => { 240 this.noticeTableIsScrollable(); 241 }); 242 } 243 }, 244 245 // 246 // åæåå¦ç 247 // --------------------------------------------- 248 init: function() { 249 this.noticeTableIsScrollable(); 250 this.initScrollListener(); 251 } 252 }; 253 254 255 // 256 // åæå颿° 257 // ãã¼ã¸èªã¿è¾¼ã¿å®äºæã«å®è¡ãããå¦ç 258 // --------------------------------------------- 259 function init() { 260 // ã¿ããã¤ãã³ãæé©å 261 touchStartOptimization(); 262 263 // ãã¬ã¤ã¯ãã¤ã³ã管çã®åæå 264 breakPointManager.checkBreakPoint(); 265 breakPointManager.initResize(); 266 267 // ã¢ã³ã«ã¼ãªã³ã¯å¦çã®åæå 268 anchorLinkHandler.init(); 269 270 // ãã¼ãã«ã®ã¹ã¯ãã¼ã«å¦çã®åæå 271 tableScrollHandler.init(); 272 } 273 274 // ãã¼ã¸èªã¿è¾¼ã¿å®äºæã«åæåå®è¡ 275 // https://developer.mozilla.org/ja/docs/Web/API/Window/load_event 276 window.addEventListener('load', init); 277 278 279 // ã¦ã£ã³ãã¦ãªãµã¤ãºæã®å¦ç 280 // https://developer.mozilla.org/ja/docs/Web/API/Window/resize_event 281 window.addEventListener('resize', function() { 282 283 // ãã¼ãã«ã®ã¹ã¯ãã¼ã«ç¶æ ãæ´æ° 284 tableScrollHandler.noticeTableIsScrollable(); 285 }); 286 287})(); 288
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.