1/* globals $ visitorId customerId */ 2/* 3 * ãµã¤ãåºæã®ãã°ã¤ã³ã»ãã·ã§ã³ç³»ã®å¦çãè¡ãã 4 * ã»ã·ãªã¢ã«çªå·ãã¬ã³ã¡ã³ãã®æ°¸ç¶ã¯ããã¼ã®çæ 5 * 6 * /res/s/js/common.js ã«ãå ¨ãåã sessionModule å®è£ ãããããåããã¦æ´æ°ã®ãã¨ã 7 */ 8if (!window["sessionModule"]) { 9 10 var sessionModule = (function () { 11 var COOKIE_EXPIRY = new Date(3000, 0, 1); /* 3000å¹´1æ1æ¥ */ 12 var COOKIE_SERIALNUMBER_ALT = 'duid'; 13 var COOKIE_RECOMMEND_PERSIST = 'SET_RCMDID'; 14 var COOKIE_NICKNAME = 'review_nickname'; 15 var COOKIE_SP_THUM_LAYOUTNUM = 'num' 16 var STORAGE_SERIALNUMBER = 'duid'; 17 var STORAGE_RECOMMEND_PERSIST = 'nol_set_rcmdid'; 18 var STORAGE_NICKNAME = 'nol_review_nickname'; 19 var STORAGE_SP_THUM_LAYOUTNUM = 'nol_sp_thum_layoutnum' 20 21 /* 22 * ãã°ã¢ã¦ããã¦ãããã¨ã表ãCookieå. 23 * 1:ä¼å¡ãã°ãªãæä½ãè¡ããã 24 * 2:䏿¦ãã°ã¤ã³ãã 25 * åå¨ããªã:æ°è¦å°å ¥ã¨ãã¦ãã°ã¤ã³ç¶æ ååã¨ã¿ãªã 26 */ 27 var COOKIE_LOGOUT_STATUS = 'EFS_LOGOUTED'; 28 var STORAGE_LOGOUT_STATUS = 'nol_logouted'; 29 var enterLoggedIn = false; /* ãã®ãªã¯ã¨ã¹ãå ã§ãã°ã¤ã³ç¶æ ã«ç§»è¡ããã¨å¤æããéã« true ã«è¨å®ããã */ 30 31 /* 32 * ãã°ã¤ã³ç¶æ 33 * 0:ãã°ã¢ã¦ãç¶æ 34 * 1:ã·ã£ãã¼ãã°ã¤ã³ 35 * 2:ãã£ã¼ããã°ã¤ã³ 36 */ 37 var STORAGE_LOGIN_STATUS = 'nol_login_status'; 38 39 // ãã£ã¼ããã°ã¤ã³æå徿åã®ã¢ã¯ã»ã¹ã 40 var firstDeepLogin = false; 41 42 /* 43 * localStorageã®get颿°ï¼errorçºçæã«catchããããã®é¢æ°ï¼ 44 */ 45 function getLocalStorage(storageKey) { 46 try { 47 return localStorage.getItem(storageKey); 48 } catch (e) { 49 console.warn(e, "localStorageãgetã§ãã¾ãã"); 50 return null; 51 } 52 } 53 54 /* 55 * localStorageã®set颿°ï¼errorçºçæã«catchããããã®é¢æ°ï¼ 56 */ 57 function setLocalStorage(storageKey, storageData) { 58 try { 59 localStorage.setItem(storageKey, storageData); 60 } catch (e) { 61 console.warn(e, "localStorageãsetã§ãã¾ãã"); 62 } 63 } 64 65 /* 66 * Safari ITP2.1対å¿ï¼Cookie7æ¥éåé¡å¯¾å¿ï¼ R#74616 67 * 䏿¦Cookieã«å ¥ã£ã¦ãããã¼ã¿ãlocalStorageã«ä¿æããï¼Cookieã¯åé¤ããªãï¼ 68 */ 69 function copyLocalStorage(cookieKey, storageKey) { 70 var storageData = getLocalStorage(storageKey); 71 if (!storageData) { 72 var cookieData = Cookies.get(cookieKey); 73 if (cookieData) { 74 setLocalStorage(storageKey, cookieData); 75 } 76 } 77 } 78 copyLocalStorage(COOKIE_RECOMMEND_PERSIST, STORAGE_RECOMMEND_PERSIST); 79 copyLocalStorage(COOKIE_SERIALNUMBER_ALT, STORAGE_SERIALNUMBER); 80 copyLocalStorage(COOKIE_LOGOUT_STATUS, STORAGE_LOGOUT_STATUS); 81 copyLocalStorage(COOKIE_NICKNAME, STORAGE_NICKNAME); // res/p/review/zeta-voice.jsã§ä½¿ç¨ 82 copyLocalStorage(COOKIE_SP_THUM_LAYOUTNUM, STORAGE_SP_THUM_LAYOUTNUM); // res/s/search/search.jsã§ä½¿ç¨ 83 84 // ãã°ã¢ã¦ãæã®ã¬ã³ã¡ã³ãè¨æ¸¬ç¨localStorageã®æ´æ°(ãã°ã¢ã¦ãæã¯ã¯ãªã¢ãã¦æ¬¡åã¢ã¯ã»ã¹æã«è¨ªåè IDãè¨å®) 85 function clearRecommendData() { 86 localStorage.removeItem(STORAGE_RECOMMEND_PERSIST); 87 } 88 89 // ã¬ã³ã¡ã³ãè¨æ¸¬ç¨localStorageã¯æªè¨å®ã§ããã°ãã®æç¹ã®è¨ªåè IDãå ¥ããã 90 function ensureRecommendData() { 91 var recommendData = getLocalStorage(STORAGE_RECOMMEND_PERSIST); 92 if (!recommendData) { 93 setLocalStorage(STORAGE_RECOMMEND_PERSIST, visitorId); 94 } 95 } 96 97 // ã·ãªã¢ã«çªå·localStorageã¯æªè¨å®ã§ããã°ãã®æç¹ã®è¨ªåè IDãå ¥ããã 98 // ï¼duidã¯å¥jsã§ã使ç¨ããã¦ããããCookieã«ãä¿æããï¼
99 // ã»å ã ããduidã䏿£å¤ã®å ´åã¯ç©ºã«ããã 100 // ã»è¨ªåè IDã空ã®å ´åã¯ä½æããªãã 101 102 function ensureSerialNumData() { 103 var serialNumData = getLocalStorage(STORAGE_SERIALNUMBER); 104 if ( serialNumData && serialNumData.startsWith('.') && !(serialNumData.length == 46 || serialNumData.length == 50) ) { 105 //䏿£ãªå¤ã®æduidåé¤ 106 Cookies.remove(COOKIE_SERIALNUMBER_ALT); 107 localStorage.removeItem(STORAGE_SERIALNUMBER); 108 serialNumData = null; 109 } 110 if ( !serialNumData && visitorId ) { 111 serialNumData = Cookies.get(COOKIE_SERIALNUMBER_ALT) || visitorId + '.' + new Date().getTime(); 112 setLocalStorage(STORAGE_SERIALNUMBER, serialNumData); 113 } 114 if ( serialNumData ) { 115 Cookies.set(COOKIE_SERIALNUMBER_ALT, serialNumData, { 116 path: '/', 117 expires: COOKIE_EXPIRY 118 }); 119 } 120 121 return serialNumData; 122 } 123 124 // ãã°ã¤ã³ç¶æ ãlocalStorage(Cookie)ã«ä¿åãã¦ããã1:ä¼å¡ãã°ãªãæä½ãè¡ãããã2:䏿¦ãã°ã¤ã³ãã 125 function setLogoutStatus(logoutStatus) { 126 setLocalStorage(STORAGE_LOGOUT_STATUS, logoutStatus); 127 } 128 129 /** 130 * ç¾å¨ãã°ã¤ã³ç¶æ ãªã ture ãè¿ãã 131 * ãåæã 132 * HTMLå ã«ä¼å¡ã®æ å ±ã表ãJS夿°ãé©åã«è¨ç½®ããã¦ãããã¨ã 133 * 134 * @returns ãã°ã¤ã³ç¶æ ãªã true 135 */ 136 function isLoggedIn() { 137 if (typeof customerId !== 'undefined') { 138 return customerId !== null && customerId.length > 0; 139 } 140 return false; 141 } 142 143 /** 144 * ãã®ãã©ã¦ã¶å ã§ãã°ã¤ã³ç¶æ ã«ãªã£ã¦ååã®ãªã¯ã¨ã¹ãä¸ã§ããã°trueãè¿ãã 145 * ãã®ä»çµãä¸åº¦ãå®è¡ããã¦ããªã(cookieãåå¨ããªãï¼å ´åããã°ã¤ã³ç¶æ ã§ããã°ååã¯å®è¡ãããããã 146 * å¿ ããããã°ã¤ã³ããç¬éã®ã¿ã¤ãã³ã°ã§ã¯ãªããã¨ã«æ³¨æã 147 * 148 * @returns ãã®ãã©ã¦ã¶å ã§ãã°ã¤ã³ç¶æ ã«ãªã£ã¦ååã®ãªã¯ã¨ã¹ãä¸ã§ããã°trueãè¿ã 149 */ 150 function isEnteredLoggedIn() { 151 return enterLoggedIn; 152 } 153 154 /** 155 * ãã°ã¤ã³ç¶æ ãJSããå©ç¨ããããã®ç¶æ ç¶æãè¡ãã 156 * localStorageç¶æ ã®ç¶æã¨ååãã°ã¤ã³ã®ç¶æ ã®è¨å®ã 157 */ 158 function ensureLoginStatus() { 159 if (isLoggedIn()) { // ãã°ã¤ã³ç¶æ ã®å ´å 160 var logoutStatus = getLocalStorage(STORAGE_LOGOUT_STATUS); 161 if (!logoutStatus || logoutStatus === "1") { // åå¨ããªã or 0ï¼ç¡å¹å¤ï¼or ãã°ã¢ã¦ãããç¶æ 162 // ç»é¢ããã®ãã°ã¢ã¦ãå¦çãè¡ããã¦ããããããã¯ããã°ã¤ã³ç¶æ 管çå°å ¥å¾ã®ååã®ã¨ã㯠163 // enterLoggedInãtrueã«ãã¦ããã®ãªã¯ã¨ã¹ãä¸ã¯ãã°ã¤ã³å¾ã®ååã§ãããã¨ãä¿æ(ã·ã£ãã¼ç¶æ ãå«ã)ã 164 enterLoggedIn = true; 165 } 166 // ãã°ã¤ã³ç¶æ ã«ãªã£ã¦ãããlocalStorageã«ç¶æ ãåæ ãã¦ãã 167 setLogoutStatus("2"); 168 } 169 } 170 171 function onLogout() { 172 clearRecommendData(); 173 174 // ãã°ã¢ã¦ããããã¨ãlocalStorageã«ä¿åãã¦ããã2:ç»é¢ãããã°ã¢ã¦ãããã 175 setLogoutStatus("1"); 176 } 177 178 function onAccess() { 179 ensureLoginStatus(); 180 ensureRecommendData(); 181 ensureSerialNumData(); 182 } 183 184 /** 185 * ä¸è¨ã®å ´åãfirstDeepLoginã夿°ããtrueãã«ã»ãããã 186 * - ãã°ã¢ã¦ãç¶æ ã0ãâãã£ã¼ããã°ã¤ã³ã2ã 187 * - ã·ã£ãã¼ãã°ã¤ã³ã1ãâãã£ã¼ããã°ã¤ã³ã2ã 188 * ãã¼ã«ã«ã¹ãã¬ã¼ã¸ã«ãã°ã¤ã³ç¶æ ãnol_login_statusããä¿åãã 189 * 190 * @param {string} status ãã°ã¤ã³ç¶æ ï¼ 0:ãã°ã¢ã¦ãç¶æ ã1:ã·ã£ãã¼ãã°ã¤ã³ 2:ãã£ã¼ããã°ã¤ã³ï¼ 191 */ 192 function changeLoginStatus(status) { 193 // ãã¼ã«ã«ã¹ãã¬ã¼ã¸ã«ä¿åãããã°ã¤ã³ç¶æ 194 let curStatus = getLocalStorage(STORAGE_LOGIN_STATUS); 195 if ((curStatus === "0" || curStatus === "1") && status === "2") { 196 firstDeepLogin = true; 197 } 198 199 // ç¾å¨ã®ãã°ã¤ã³ç¶æ ããã¼ã«ã«ã¹ãã¬ã¼ã¸ã«ä¿åãã 200 setLocalStorage(STORAGE_LOGIN_STATUS, status); 201 } 202 203 /** 204 * ãã®ãã©ã¦ã¶å ã§ãã£ã¼ããã°ã¤ã³ç¶æ ã«ãªã£ã¦ååã®ãªã¯ã¨ã¹ãä¸ã§ããã°trueãè¿ãã 205 * ä¸è¨ã®ã±ã¼ã¹ã®ã¿ãtrueããè¿ã 206 * 1- ããã°ã¢ã¦ããç¶æ ããããã£ã¼ããã°ã¤ã³ãç¶æ ã«ãªã£ã¦ 207 * 2- ãã·ã£ãã¼ãã°ã¤ã³ãç¶æ ããããã£ã¼ããã°ã¤ã³ãç¶æ ã«ãªã£ã¦ 208 * 209 * @returns ãã®ãã©ã¦ã¶å ã§ãã£ã¼ããã°ã¤ã³ç¶æ ã«ãªã£ã¦ååã®ãªã¯ã¨ã¹ãä¸ã§ããã°trueãè¿ã 210 */ 211 function isFirstDeepLogin() { 212 return firstDeepLogin; 213 } 214 215 return { 216 onAccess: onAccess, 217 onLogout: onLogout, 218 isLoggedIn: isLoggedIn, 219 isEnteredLoggedIn: isEnteredLoggedIn, 220 getDuid: ensureSerialNumData, 221 changeLoginStatus: changeLoginStatus, 222 isFirstDeepLogin: isFirstDeepLogin 223 } 224 })(); 225 226 // æ¯åã¢ã¯ã»ã¹ 227 sessionModule.onAccess(); 228} 229 230// modal_overlay 231$(function () { 232 if ($('#modal_overlay').length === 0) { 233 var wrapper = '<div id="modal_overlay" style="display:none;"></div>'; 234 $('body').append(wrapper); 235 } 236}); 237 238 239 240// ãããã¼è¨å® 241$(function () { 242 // ã«ã¼ãååæ° 243 $('#cart_quantity').text(totalCartCount); 244}); 245 246
247// ãªã³ã¯é¸ææã®æ¤ç´¢å¦ç 248function searchFunction(keyword) { 249 $("#keyword").val(keyword); 250 251 if ($('#searchArea form').eq(0).length > 0) { 252 $('#searchArea form').eq(0).submit(); //for sp submit 253 return false; 254 } 255 $('form[name=searchbox]').submit() 256} 257 258/** 259 * ä¼¼ã¦ããååã¯ãã¡ãã鏿æã®å¦ç 260 */ 261function open_similar_items_modal(deviceType, itemCodeString) { 262 var templateHtmlString = ''; 263 templateHtmlString += '<div class="similar-items-modal m-modal">'; 264 templateHtmlString += ' <div id="loading-recommend" class="m-modal_inr loading_inr">'; 265 templateHtmlString += ' <div class="loader">'; 266 templateHtmlString += ' loading...'; 267 templateHtmlString += ' </div>'; 268 templateHtmlString += ' </div>'; 269 templateHtmlString += ' <div id="endloading" class="m-modal_inr" style="display:none">'; 270 templateHtmlString += ' <p class="m-modal_close" onclick="modalModule.flush();">'; 271 if (deviceType == "SP" || deviceType == "reserveSP") { 272 templateHtmlString += 'éãã'; 273 } 274 templateHtmlString += ' </p>'; 275 if (deviceType == "reservePC" || deviceType == "reserveSP") { 276 templateHtmlString += ' <section class="check-recent nissen-recommend recommend_NR-18-013" data-slot="detail_rm_sim_yoyaku">'; 277 } 278 else { 279 templateHtmlString += ' <section class="check-recent nissen-recommend recommend_NR-18-013" data-slot="detail_rm_sim_keppin">'; 280 } 281 templateHtmlString += ' <div class="title-wrap">'; 282 if (deviceType == "reservePC" || deviceType == "reserveSP") { 283 templateHtmlString += ' <h2 class="sec-tit">ããå±ãä¼¼ã¦ããåå</h2>'; 284 } 285 else { 286 templateHtmlString += ' <h2 class="sec-tit">ä¼¼ã¦ããååã¯ãã¡ã</h2>'; 287 } 288 templateHtmlString += ' </div>'; 289 templateHtmlString += ' <div id="itemFound">'; 290 templateHtmlString += ' <div class="row js-recommend" style="overflow-y: scroll;height: 400px;"></div>'; 291 templateHtmlString += ' <p class="notice">â»ãæ¡å ãã¦ããååã«ã¤ãã¦ããä¸é¨ã®è²ã»ãµã¤ãºã§ã売åãã®å ´åããããã¾ãããäºæ¿ãã ããã</p>'; 292 templateHtmlString += ' </div>'; 293 templateHtmlString += ' <div class="container" id="itemNotFound">'; 294 templateHtmlString += ' <p class="no-item">'; 295 templateHtmlString += ' <img class="img" src="/res/p/img/recommend/gomennasai.gif" alt="ç³ã訳ãããã¾ãããä¼¼ã¦ããååãè¦ã¤ããã¾ããã§ããã">'; 296 templateHtmlString += ' </p>'; 297 templateHtmlString += ' <p class="close_no-item" onclick="modalModule.flush();">éãã</p>'; 298 templateHtmlString += ' </div>'; 299 templateHtmlString += ' </section>'; 300 templateHtmlString += ' </div>'; 301 templateHtmlString += '</div>'; 302 templateHtmlString += '<style>'; 303 templateHtmlString += '.recommend_NR-18-013 .js-item-review .m-item_list_reviewstars {'; 304 templateHtmlString += ' width: 55.5px;'; 305 templateHtmlString += '}'; 306 templateHtmlString += '.recommend_NR-18-013 .m-item_list_discount,'; 307 templateHtmlString += '.recommend_NR-18-013 .m-item_list_quickview,'; 308 templateHtmlString += '.recommend_NR-18-013 .m-item_list_fav,'; 309 templateHtmlString += '.recommend_NR-18-013 .m-item_list_stock {'; 310 templateHtmlString += ' display: none!important;'; 311 templateHtmlString += '}'; 312 templateHtmlString += '.recommend_NR-18-013 .col-item-parts {'; 313 templateHtmlString += ' margin-bottom: 20px;'; 314 templateHtmlString += '}'; 315 templateHtmlString += '</style>'; 316 modalModule.push($(templateHtmlString)); 317 318 var option = { 319 basicItemCd: itemCodeString, 320 reserveFlag: deviceType == "reservePC" || deviceType == "reserveSP" 321 } 322 nissen_recommend_build_area_modal("NR-18-013", option).then(function (data) { 323 $('#endloading').show(); 324 $('#loading-recommend').hide(); 325 if (typeof (data) !== "object" || data.length === 0) { 326 $('#itemNotFound').show(); 327 $('#itemFound').hide(); 328 $('.recommend_NR-18-013').show(); 329 } 330 else { 331 $('#itemFound').show(); 332 $('#itemNotFound').hide(); 333 } 334 335 // ã¢ã¼ãã«ã®ãµã¤ãºãèª¿æ´ 336 if (deviceType == "PC" || deviceType == "reservePC") { 337 $('recommend_NR-18-013 .js-recommend').height(Math.max(298, $(window).height() - 450)); 338 339 $(window).on('resize', function () { 340 // ã¢ã¼ãã«ã®ãµã¤ãºãèª¿æ´ 341 $('.recommend_NR-18-013 .js-recommend').height(Math.max(298, $(window).height() - 450)); 342 }); 343 } 344 }); 345} 346 347/** 348 * Get the URL parameter value 349 * 350 * @param name {string} ãã©ã¡ã¼ã¿ã®ãã¼æåå 351 * @return url {url} 対象ã®URLæååï¼ä»»æï¼ 352 */ 353function nolGetURLParam(name, url) { 354 if (!url) url = window.location.href; 355 name = name.replace(/[\[\]]/g, "\\$&"); 356 var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"), 357 results = regex.exec(url); 358 if (!results) return undefined; 359 if (!results[2]) return ""; 360 return decodeURIComponent(results[2].replace(/\+/g, " ")); 361} 362 363var nissenHoverTimerID; 364function hoverNavigation(navi) { 365 clearTimeout(nissenHoverTimerID); 366 // ã°ãã¼ãã«ãã 367 var $modal = $('#modal_overlay'); 368 var $this = $(navi); 369 370 $this.siblings().removeClass('active'); 371 372 nissenHoverTimerID = setTimeout(function () { 373 $this.addClass('active'); 374 $('.hdr').addClass('layerup'); 375 $modal.show().stop(true, true); 376 }, 100); 377} 378 379function leaveNavigation() { 380 clearTimeout(nissenHoverTimerID); 381 // ã°ãã¼ãã«ãã 382 var $modal = $('#modal_overlay');
383 var $gNav = $('.hdr_gnav_cat'); 384 nissenHoverTimerID = setTimeout(function () { 385 $gNav.removeClass('active'); 386 $modal.hide(); 387 }, 100); 388} 389 390 391// googleæ¨å¥¨ãç»åé å»¶èªã¿è¾¼ã¿ 392//ãã©ã¦ã¶å¤å®ã誤å¤å®é²æ¢ã®ãããä¸è¨é ã«ã¦å¤å®ãè¡ãã 393//IEã¨safariã®ã¿polyfillä½¿ç¨ 394var intersectionObserver = false; 395 396if (!('IntersectionObserver' in window) || 397 !('IntersectionObserverEntry' in window) || 398 !('isIntersecting' in window.IntersectionObserverEntry.prototype)) { 399 (function(undefined) {!function(){function e(e,t){for(var n=-1,o=e.length;++n<o;)if(n in e&&e[n]===t)return n;return-1}var t={click:1,dblclick:1,keyup:1,keypress:1,keydown:1,mousedown:1,mouseup:1,mousemove:1,mouseover:1,mouseenter:1,mouseleave:1,mouseout:1,storage:1,storagecommit:1,textinput:1};if("undefined"!=typeof document&&"undefined"!=typeof window){var n=window.Event&&window.Event.prototype||null;window.Event=Window.prototype.Event=function(e,t){if(!e)throw new Error("Not enough arguments");var n;if("createEvent"in document){n=document.createEvent("Event");var o=!(!t||t.bubbles===undefined)&&t.bubbles,i=!(!t||t.cancelable===undefined)&&t.cancelable;return n.initEvent(e,o,i),n}return n=document.createEventObject(),n.type=e,n.bubbles=!(!t||t.bubbles===undefined)&&t.bubbles,n.cancelable=!(!t||t.cancelable===undefined)&&t.cancelable,n},n&&Object.defineProperty(window.Event,"prototype",{configurable:!1,enumerable:!1,writable:!0,value:n}),"createEvent"in document||(window.addEventListener=Window.prototype.addEventListener=Document.prototype.addEventListener=Element.prototype.addEventListener=function(){var n=this,o=arguments[0],i=arguments[1];if(n===window&&o in t)throw new Error("In IE8 the event: "+o+" is not available on the window object. Please see https://github.com/Financial-Times/polyfill-service/issues/317 for more information.");n._events||(n._events={}),n._events[o]||(n._events[o]=function(t){var o,i=n._events[t.type].list,r=i.slice(),c=-1,a=r.length;for(t.preventDefault=function(){!1!==t.cancelable&&(t.returnValue=!1)},t.stopPropagation=function(){t.cancelBubble=!0},t.stopImmediatePropagation=function(){t.cancelBubble=!0,t.cancelImmediate=!0},t.currentTarget=n,t.relatedTarget=t.fromElement||null,t.target=t.target||t.srcElement||n,t.timeStamp=(new Date).getTime(),t.clientX&&(t.pageX=t.clientX+document.documentElement.scrollLeft,t.pageY=t.clientY+document.documentElement.scrollTop);++c<a&&!t.cancelImmediate;)c in r&&(o=r[c],-1!==e(i,o)&&"function"==typeof o&&o.call(n,t))},n._events[o].list=[],n.attachEvent&&n.attachEvent("on"+o,n._events[o])),n._events[o].list.push(i)},window.removeEventListener=Window.prototype.removeEventListener=Document.prototype.removeEventListener=Element.prototype.removeEventListener=function(){var t,n=this,o=arguments[0],i=arguments[1];n._events&&n._events[o]&&n._events[o].list&&-1!==(t=e(n._events[o].list,i))&&(n._events[o].list.splice(t,1),n._events[o].list.length||(n.detachEvent&&n.detachEvent("on"+o,n._events[o]),delete n._events[o]))},window.dispatchEvent=Window.prototype.dispatchEvent=Document.prototype.dispatchEvent=Element.prototype.dispatchEvent=function(e){if(!arguments.length)throw new Error("Not enough arguments");if(!e||"string"!=typeof e.type)throw new Error("DOM Events Exception 0");var t=this,n=e.type;try{if(!e.bubbles){e.cancelBubble=!0;var o=function(e){e.cancelBubble=!0,(t||window).detachEvent("on"+n,o)};this.attachEvent("on"+n,o)}this.fireEvent("on"+n,e)}catch(i){e.target=t;do{e.currentTarget=t,"_events"in t&&"function"==typeof t._events[n]&&t._events[n].call(t,e),"function"==typeof t["on"+n]&&t["on"+n].call(t,e),t=9===t.nodeType?t.parentWindow:t.parentNode}while(t&&!e.cancelBubble)}return!0},document.attachEvent("onreadystatechange",function(){"complete"===document.readyState&&document.dispatchEvent(new Event("DOMContentLoaded",{bubbles:!0}))}))}}();!function(t,e){"use strict";function n(t){this.time=t.time,this.target=t.target,this.rootBounds=t.rootBounds,this.boundingClientRect=t.boundingClientRect,this.intersectionRect=t.intersectionRect||a();try{this.isIntersecting=!!t.intersectionRect}catch(r){}var e=this.boundingClientRect,n=e.width*e.height,o=this.intersectionRect,i=o.width*o.height;this.intersectionRatio=n?i/n:this.isIntersecting?1:0}function o(t,e){var n=e||{};if("function"!=typeof t)throw new Error("callback must be a function");if(n.root&&1!=n.root.nodeType)throw new Error("root must be an Element");this._checkForIntersections=r(this._checkForIntersections.bind(this),this.THROTTLE_TIMEOUT),this._callback=t,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(n.rootMargin),this.thresholds=this._initThresholds(n.threshold),this.root=n.root||null,this.rootMargin=this._rootMarginValues.map(function(t){return t.value+t.unit}).join(" ")}function i(){return t.performance&&performance.now&&performance.now()}function r(t,e){var n=null;return function(){n||(n=setTimeout(function(){t(),n=null},e))}}function s(t,e,n,o){"function"==typeof t.addEventListener?t.addEventListener(e,n,o||!1):"function"==typeof t.attachEvent&&t.attachEvent("on"+e,n)}function h(t,e,n,o){"function"==typeof t.removeEventListener?t.removeEventListener(e,n,o||!1):"function"==typeof t.detatchEvent&&t.detatchEvent("on"+e,n)}function c(t,e){var n=Math.max(t.top,e.top),o=Math.min(t.bottom,e.bottom),i=Math.max(t.left,e.left),r=Math.min(t.right,e.right),s=r-i,h=o-n;return s>=0&&h>
399=0&&{top:n,bottom:o,left:i,right:r,width:s,height:h}}function u(t){var e;try{e=t.getBoundingClientRect()}catch(n){}return e?(e.width&&e.height||(e={top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.right-e.left,height:e.bottom-e.top}),e):a()}function a(){return{top:0,bottom:0,left:0,right:0,width:0,height:0}}function l(t,e){for(var n=e;n;){if(n==t)return!0;n=p(n)}return!1}function p(t){var e=t.parentNode;return e&&11==e.nodeType&&e.host?e.host:e}if(!("IntersectionObserver"in t&&"IntersectionObserverEntry"in t&&"intersectionRatio"in t.IntersectionObserverEntry.prototype)){var f=[];o.prototype.THROTTLE_TIMEOUT=100,o.prototype.POLL_INTERVAL=null,o.prototype.observe=function(t){if(!this._observationTargets.some(function(e){return e.element==t})){if(!t||1!=t.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:t,entry:null}),this._monitorIntersections()}},o.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter(function(e){return e.element!=t}),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},o.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},o.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},o.prototype._initThresholds=function(t){var e=t||[0];return Array.isArray(e)||(e=[e]),e.sort().filter(function(t,e,n){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==n[e-1]})},o.prototype._parseRootMargin=function(t){var e=t||"0px",n=e.split(/\s+/).map(function(t){var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!e)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(e[1]),unit:e[2]}});return n[1]=n[1]||n[0],n[2]=n[2]||n[0],n[3]=n[3]||n[1],n},o.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this._checkForIntersections(),this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(s(t,"resize",this._checkForIntersections,!0),s(e,"scroll",this._checkForIntersections,!0),"MutationObserver"in t&&(this._domObserver=new MutationObserver(this._checkForIntersections),this._domObserver.observe(e,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))))},o.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,h(t,"resize",this._checkForIntersections,!0),h(e,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},o.prototype._checkForIntersections=function(){var t=this._rootIsInDom(),e=t?this._getRootRect():a();this._observationTargets.forEach(function(o){var r=o.element,s=u(r),h=this._rootContainsTarget(r),c=o.entry,a=t&&h&&this._computeTargetAndRootIntersection(r,e),l=o.entry=new n({time:i(),target:r,boundingClientRect:s,rootBounds:e,intersectionRect:a});c?t&&h?this._hasCrossedThreshold(c,l)&&this._queuedEntries.push(l):c&&c.isIntersecting&&this._queuedEntries.push(l):this._queuedEntries.push(l)},this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},o.prototype._computeTargetAndRootIntersection=function(n,o){if("none"!=t.getComputedStyle(n).display){for(var i=u(n),r=i,s=p(n),h=!1;!h;){var a=null,l=1==s.nodeType?t.getComputedStyle(s):{};if("none"==l.display)return;if(s==this.root||s==e?(h=!0,a=o):s!=e.body&&s!=e.documentElement&&"visible"!=l.overflow&&(a=u(s)),a&&!(r=c(a,r)))break;s=p(s)}return r}},o.prototype._getRootRect=function(){var t;if(this.root)t=u(this.root);else{var n=e.documentElement,o=e.body;t={top:0,left:0,right:n.clientWidth||o.clientWidth,width:n.clientWidth||o.clientWidth,bottom:n.clientHeight||o.clientHeight,height:n.clientHeight||o.clientHeight}}return this._expandRectByRootMargin(t)},o.prototype._expandRectByRootMargin=function(t){var e=this._rootMarginValues.map(function(e,n){return"px"==e.unit?e.value:e.value*(n%2?t.width:t.height)/100}),n={top:t.top-e[0],right:t.right+e[1],bottom:t.bottom+e[2],left:t.left-e[3]};return n.width=n.right-n.left,n.height=n.bottom-n.top,n},o.prototype._hasCrossedThreshold=function(t,e){var n=t&&t.isIntersecting?t.intersectionRatio||0:-1,o=e.isIntersecting?e.intersectionRatio||0:-1;if(n!==o)for(var i=0;i<this.thresholds.length;i++){var r=this.thresholds[i];if(r==n||r==o||r<n!=r<o)return!0}},o.prototype._rootIsInDom=function(){return!this.root||l(e,this.root)},o.prototype._rootContainsTarget=function(t){return l(this.root||e,t)},o.prototype._registerInstance=function(){f.indexOf(this)<0&&f.push(this)},o.prototype._unregisterInstance=function(){var t=f.indexOf(this);-1!=t&&f.splice(t,1)},t.IntersectionObserver=o,t.IntersectionObserverEntry=n}}(window,document);}).call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {}); 400 intersectionObserver = true; 401 } 402 403var lazyImages = []; 404function LazyImageIntersectionObserver(classNameTxt){ 405 lazyImages = [].slice.call(document.querySelectorAll("img."+classNameTxt)); 406 407 //IntersectionObserver対å¿ãã©ã¦ã¶ãå¤å®
408 //IntersectionObserveré対å¿ã ãpolyfillã使ç¨ãããã¨ã§å¯¾å¿å¯è½ã¨ãªãå ´åã¯å¯ 409 if (('IntersectionObserver' in window && 410 'IntersectionObserverEntry' in window && 411 'isIntersecting' in window.IntersectionObserverEntry.prototype) || 412 ('IntersectionObserver' in window && intersectionObserver === true) 413 ){ 414 var lazyImageObserver = new IntersectionObserver(function(entries, observer) { 415 entries.forEach(function(entry) { 416 if (entry.isIntersecting) { 417 var lazyImage = entry.target; 418 lazyImage.src = lazyImage.dataset.src; 419 lazyImage.classList.add("show_img"); 420 lazyImage.classList.remove(classNameTxt); 421 lazyImageObserver.unobserve(lazyImage); 422 } 423 }); 424 }); 425 lazyImages.forEach(function(lazyImage) { 426 lazyImageObserver.observe(lazyImage); 427 }); 428 return; 429 } 430 431 //IntersectionObserveré対å¿ã®å ´å 432 loadFunc(); 433 $(window).scroll(loadFunc); 434 function loadFunc() { 435 var target = $('img[data-src]'); 436 $.each(target, function (i, item) { 437 var targetPos = $(item).offset().top - $(window).height() - 500; 438 if ($(window).scrollTop() > targetPos && !$(item).is('.active')) { 439 var imgSrc = $(item).data('src'); 440 $(item).addClass('active').attr('src', imgSrc).hide().fadeIn(800); 441 } 442 }); 443 } 444} 445 446document.addEventListener("DOMContentLoaded", function() { 447 LazyImageIntersectionObserver("lazy_img"); 448}); 449 450function addLazyImages(classNameTxt){ 451 if(lazyImages){ 452 lazyImages = [].slice.call(document.querySelectorAll("img"+classNameTxt)); 453 } 454} 455 456var utilModule = (function () { 457 458 var $body; 459 var bodyCssStore = {}; 460 461 var toggle = function ($ele, $self) { 462 if(!($ele instanceof jQuery)){ 463 $ele = $($ele); 464 } 465 if(!($self instanceof jQuery)){ 466 $self = $($self); 467 } 468 469 470 if($ele.hasClass("switch-on")){ 471 $ele.removeClass("switch-on"); 472 $ele.addClass("switch-off"); 473 $('html,body').animate({ 474 scrollTop: $ele.offset().top 475 }, 0); 476 } else { 477 $ele.removeClass("switch-off"); 478 $ele.addClass("switch-on"); 479 } 480 481 if($self.hasClass("switch-btn-on")){ 482 $self.removeClass("switch-btn-on"); 483 $self.addClass("switch-btn-off") 484 } else { 485 $self.removeClass("switch-btn-off"); 486 $self.addClass("switch-btn-on"); 487 } 488 489 }; 490 491 var modal = function ($modal) { 492 if(!($modal instanceof jQuery)){ 493 $modal = $($modal); 494 } 495 496 if($modal.hasClass("modal-on")){ 497 $modal.scrollTop(0); 498 $modal.removeClass("modal-on"); 499 $modal.addClass("modal-off"); 500 $("body").removeClass("fixed-on"); 501 $("body").addClass("fixed-off"); 502 $(".m-modal").css({'position': '', 'top': '', 'left': '', 'width': '', 'height': ''}); 503 $(".m-modal_wrap").attr('style',''); 504 modalModule.endScl(); 505 } else { 506 modalModule.modalInit(); 507 $modal.removeClass("modal-off"); 508 $modal.addClass("modal-on"); 509 $("body").css({'position': ''}); 510 $("body").removeClass("fixed-off"); 511 $("body").addClass("fixed-on"); 512 $(".m-modal_wrap").attr('style','z-index:30'); 513 } 514 }; 515 516 var toSingleByte = function (e) { 517 var val = e.val(); 518 var str = val.replace(/[A-Zï½-ï½ï¼-ï¼]/g, function (s) { 519 return String.fromCharCode(s.charCodeAt(0) - 0xFEE0) 520 }); 521 522 if (val.match(/[A-Zï½-ï½ï¼-ï¼]/g)) { 523 $(e).val(str); 524 } 525 }; 526 527 return { 528 toggle: toggle, 529 modal: modal, 530 toSingleByte: toSingleByte 531 }; 532 })(); 533 $(function(){ 534 $(window).on('scroll', function() { 535 if ($(this).scrollTop() > 200) { 536 $('.page-top').fadeIn(200); 537 } else { 538 $('.page-top').fadeOut(200); 539 } 540 }); 541 $('.page-top').on('click', function(event) { 542 event.preventDefault(); 543 $('html, body').animate({scrollTop: 0}, 600); 544 }); 545 }); 546 547// ãã£ã¨è¦ãç¨DOM 548function viewMoreDom(viewMorePoint) { 549 var classNames = viewMorePoint.classList; 550 var classListArray = Array.from(classNames); 551 var filteredClassList = classListArray.filter(function(className) { 552 return className !== 'switch-off' && className !== 'switch-on'; 553 }); 554 var moreClass = "'" + filteredClassList.map(function (className) { 555 return '.' + className; 556 }).join('') + "'"; 557 var viewMoreHtml = document.createElement('div'); 558 viewMoreHtml.classList.add('item_btn_wrap'); 559 viewMoreHtml.setAttribute('onclick', 'utilModule.toggle(' + moreClass + ')'); 560 viewMoreHtml.innerHTML = '<a class="switch-btn-off second-more-opn">ãã£ã¨è¦ã<span class="m-plus-btn"></span></a><a class="switch-btn-on second-more-cls">éãã<span class="m-minus-btn"></span></a></div></div>'; 561 viewMorePoint.appendChild(viewMoreHtml); 562}
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.