1'use strict'; 2/*global google */ 3var comJs = {}; 4 5comJs.uaInfo = (function() { 6 var that = {}; 7 var userAgent = window.navigator.userAgent; 8 var appVersion = window.navigator.appVersion.toLowerCase(); 9 that.browser = null; 10 that.os = null; 11 that.ieVr = null; 12 that.oldIe = false; 13 that.terminal = null; 14 that.fixedSupport = true; 15 that.legacyAndroid = false; 16 that.interface = 'mouse'; 17 18 if (userAgent.indexOf('iPhone') > 0 || userAgent.indexOf('iPod') > 0) { 19 that.os = 'ios'; 20 that.terminal = 'iPhone'; 21 that.interface = 'touch'; 22 if (userAgent.indexOf('OS 4') !== -1 || userAgent.indexOf('OS 3') !== -1 || userAgent.indexOf('OS 2') !== -1) { 23 that.fixedSupport = false; 24 } 25 } else if (userAgent.indexOf('iPad') > 0) { 26 that.os = 'ios'; 27 that.terminal = 'iPad'; 28 that.interface = 'touch'; 29 if (userAgent.indexOf('OS 4') !== -1 || userAgent.indexOf('OS 3') !== -1 || userAgent.indexOf('OS 2') !== -1) { 30 that.fixedSupport = false; 31 } 32 } else if (userAgent.indexOf('Android') > 0) { 33 that.os = 'android'; 34 that.interface = 'touch'; 35 if (userAgent.indexOf('Mobile') > 0) { 36 that.terminal = 'androidMob'; 37 } else { 38 that.terminal = 'androidTab'; 39 } 40 if (userAgent.indexOf('Android 3.') !== -1 || userAgent.indexOf('Android 2.') !== -1 || userAgent.indexOf('Android 1.') !== -1) { 41 that.fixedSupport = false; 42 } 43 if (userAgent.indexOf('Android 4.') > 0 || userAgent.indexOf('Android 3.') > 0 || userAgent.indexOf('Android 2.') > 0 || userAgent.indexOf('Android 1.') > 0) { 44 that.legacyAndroid = true; 45 } 46 } else if (userAgent.match(/Mac|PPC/)) { 47 that.os = 'mac'; 48 } else { 49 that.os = 'other'; 50 } 51 52 var ua = userAgent.toLowerCase(); 53 54 if (ua.indexOf('msie') !== -1 || ua.indexOf('trident') >= 0) { 55 that.browser = 'ie'; 56 if (ua.indexOf('msie 6.') !== -1) { 57 that.ieVr = 6; 58 that.fixedSupport = false; 59 that.oldIe = true; 60 } else if (appVersion.indexOf('msie 7.') !== -1) { 61 that.ieVr = 7; 62 that.oldIe = true; 63 } else if (appVersion.indexOf('msie 8.') !== -1) { 64 that.ieVr = 8; 65 that.oldIe = true; 66 } else if (appVersion.indexOf('msie 9.') !== -1) { 67 that.ieVr = 9; 68 that.oldIe = true; 69 } else if (appVersion.indexOf('msie 10.') !== -1) { 70 that.ieVr = 10; 71 that.oldIe = true; 72 } 73 } else if (ua.indexOf('edge') !== -1) { 74 that.browser = 'edge'; 75 } else if (ua.indexOf('chrome') !== -1) { 76 that.browser = 'chrome'; 77 } else if (ua.indexOf('safari') !== -1) { 78 that.browser = 'safari'; 79 } else if (ua.indexOf('firefox') !== -1) { 80 that.browser = 'firefox'; 81 } 82 83 84 if (that.os) { 85 $('html').addClass('is_' + that.os); 86 } 87 if (that.browser) { 88 $('html').addClass('is_' + that.browser); 89 } 90 if (that.ieVr) { 91 $('html').addClass('is_' + that.browser + that.ieVr); 92 } 93 if (that.oldIe) { 94 $('html').addClass('is_oldIe'); 95 } 96 if (that.terminal) { 97 $('html').addClass('is_' + that.terminal); 98 } 99 if (!that.fixedSupport) { 100 $('html').addClass('is_no_fixedsupport'); 101 } else { 102 $('html').addClass('is_fixedsupport'); 103 } 104 if (that.interface) { 105 $('html').addClass('is_' + that.interface); 106 } 107 if (that.legacyAndroid) { 108 $('html').addClass('is_legacyAndroid'); 109 } 110 111 return that; 112}()); 113 114if (!comJs.uaInfo.oldIe) { 115 comJs.observerFuncAry = []; 116 comJs.changeAction = function () { 117 $.each(comJs.observerFuncAry, function (idx) { 118 comJs.observerFuncAry[idx](); 119 }); 120 }; 121 comJs.addFunc = function (func) { 122 comJs.observerFuncAry.push(func); 123 }; 124 comJs.observer = new MutationObserver(function () { 125 comJs.ctsSetting(); 126 comJs.changeAction(); 127 }); 128 comJs.observerConfig = { 129 childList: true, 130 subtree: true 131 }; 132} 133 134 135$(function() { 136 comJs.comInit(); 137 138 if (!comJs.uaInfo.oldIe) { 139 //ç£è¦éå§ 140 comJs.observer.observe($('#wrap').get(0), comJs.observerConfig); 141 } 142}); 143 144 145comJs.comInit = function () { 146 147 $(window).resize(function() { 148 //console.log($(window).width()); 149 }); 150 151 152 $(document).on('focus', 'a', function () { 153 this.blur(); 154 }); 155 156 157 //ã¢ã³ã«ã¼ã¹ã¯ãã¼ã« 158 $(document).on('click', 'a[href^="#"]', function (e) { 159 e.preventDefault(); 160 var $this = $(this); 161 if ($this.attr('href') === '#') { 162 return; 163 } 164 if (!$($this.attr('href')).length) { 165 return; 166 } 167 comJs.ancScr($($(this).attr('href'))); 168 }); 169 170 comJs.responseFlagObj = comJs.responseFlag(); 171 /*comJs.responseFlagObj.addFunc(function(flag) { 172 console.log(flag); 173 });*/ 174
175 176 comJs.imagesLoadedWrap({ 177 $wrap: $('#wrap'), 178 late: false, 179 progressFunc: function(progPercent){ 180 //console.log(progPercent); 181 }, 182 doneFunc: function() { 183 //console.log('done'); 184 $('.js-shWrapDelay').each(function() { 185 comJs.sameHeightCall($(this)); 186 }); 187 } 188 }); 189 190 /*comJs.loadCompFuncAry.push(function(){ 191 console.log('push'); 192 });*/ 193 194 $('.js-flexWrap').each(function() { 195 comJs.flexBox($(this)); 196 }); 197 198 $('.js-shWrap').each(function() { 199 comJs.sameHeightCall($(this)); 200 }); 201 202 $('.md-network').each(function () { 203 comJs.mappingFadeFunc($(this)); 204 }); 205 206 $('.md-tabWrap').each(function () { 207 comJs.tabContainFunc($(this)); 208 }); 209 210 $('.md-historyTabWrap').each(function () { 211 comJs.historyTabContainFunc($(this)); 212 }); 213 214 $('.js-catWrap').each(function () { 215 comJs.catShowFunc($(this)); 216 }); 217 218 $('.js-selectFeadFunc').each(function () { 219 comJs.fiscalPeriodFunc($(this)); 220 }); 221 222 223 comJs.hdFuntion(); 224 comJs.ftFuntion(); 225 comJs.ctsSetting(); 226 227 if ($('.md-shareBtn').length) { 228 comJs.spNavBottomSet($('.md-shareBtn')); 229 } 230 231 $('.md-tableWrap').each(function () { 232 comJs.tableSlideInit($(this)); 233 }); 234 $('.md-explainPointsWrap').each(function () { 235 comJs.tableSlideInit($(this)); 236 }); 237 238 239 if ($('.md-recommendBanner').length) { 240 comJs.recommendPosition($('.md-recommendBanner')); 241 } 242 243 $('header .langBtn').each(function () { 244 comJs.langChange($(this)); 245 }); 246 247 // ã¢ãã¡ã¼ã·ã§ã³JS-çºç« 248 $('.main').setAni(true); 249}; 250 251 252 253 254comJs.langChange = function (_$langBtn) { 255 var _that = {}; 256 var _$btn = _$langBtn.find('a'); 257 258 var _url = $(location).attr('href'); 259 var _host = 'https://' + $(location).attr('host'); 260 var _href; 261 262 var _init = function () { 263 if (_url.indexOf('/news') !== -1) { 264 if (_url.indexOf('/english/') !== -1) { 265 _href = /news/; 266 _$btn.attr('href', _href); 267 } else { 268 _href = '/english/news/'; 269 _$btn.attr('href', _href); 270 } 271 } else { 272 if (_url.indexOf('/english/') !== -1) { 273 _href = _url.replace(_host + '/english', ''); 274 _$btn.attr('href', _href); 275 } else { 276 _href = '/english' + _url.replace(_host, ''); 277 _$btn.attr('href', _href); 278 } 279 } 280 } 281 282 _init(); 283 return _that; 284} 285 286 287 288comJs.recommendPosition = function (_$wrap) { 289 var _that = {}; 290 var _$main = $('.main'); 291 292 var _init = function () { 293 _$wrap.appendTo(_$main); 294 } 295 296 _init(); 297 return _that; 298} 299 300 301 302 303 304comJs.fiscalPeriodFunc = function (_$feadWrap) { 305 var _that = {}; 306 var _$selectYear = _$feadWrap.find('.filter.--selectYear'); 307 var _$select = _$selectYear.find('.md-select .select'); 308 var _$secFiscalPeriod = $('.md-secFiscalPeriod'); 309 var _$secInr = _$secFiscalPeriod.find('.secInr'); 310 311 var _val; 312 var _data; 313 var _speed = 800; 314 315 var _init = function () { 316 _$select.on('change', function () { 317 _val = $(this).val(); 318 hideFunc(_val); 319 }); 320 } 321 322 var hideFunc = function (_targetVal) { 323 _$secInr.css('opacity', 0); 324 325 _$secFiscalPeriod.each(function () { 326 _data = $(this).data('fiscal-period'); 327 $(this).addClass('js-active'); 328 329 if (_targetVal) { 330 if (_targetVal != _data) { 331 $(this).removeClass('js-show'); 332 $(this).css('display', 'none'); 333 } else { 334 $(this).addClass('js-show'); 335 $(this).css('display', 'block'); 336 } 337 } else { 338 $(this).removeClass('js-show'); 339 $(this).css('display', 'block'); 340 } 341 }); 342 showFunc(); 343 } 344 345 var showFunc = function () { 346 _$secInr.stop().animate({ 347 opacity: 1 348 }, _speed); 349 } 350 351 _init(); 352 return _that; 353} 354 355 356 357 358comJs.catShowFunc = function (_$catWrap) { 359 var _that = {}; 360 var _$checkLine = _$catWrap.find('.cat input[type="checkbox"]'); 361 var _checkCatAry = []; 362 var _$listWrap = $('.js-catListWrap .articleListWrap'); 363 var _$list = false; 364 365 var _init = function () { 366 _$checkLine.each(function () { 367 var $this = $(this); 368 var value = $this.val(); 369 370 $this.on('change', function () { 371 if ($this.prop('checked')) { 372 _checkCatAry.push(value); 373 } else { 374 var index = _checkCatAry.indexOf(value); 375 if (index !== -1) { 376 _checkCatAry.splice(index, 1); 377 } 378 } 379 380 toggleDisplayFunc(); 381 }); 382 });
383 } 384 385 var toggleDisplayFunc = function () { 386 if (!_$list) { 387 _$list = _$listWrap.find('.list'); 388 } 389 390 _$list.each(function () { 391 var $this = $(this); 392 if (_checkCatAry.length != 0) { 393 if ($.inArray($this.data('catvalue'), _checkCatAry) != -1) { 394 $this.css('display', 'block'); 395 } else { 396 $this.css('display', 'none'); 397 } 398 } else { 399 _$list.attr('style', ''); 400 } 401 }); 402 } 403 404 _init(); 405 return _that; 406} 407 408 409 410comJs.tabContainFunc = function (_$wrap) { 411 var _that = {}; 412 var _$tabBtn = _$wrap.find('.tabWrap .tabList .btn'); 413 var _url = $(location).attr('pathname'); 414 415 var _currentClass = 'js-current'; 416 417 var _init = function () { 418 _$tabBtn.each(function () { 419 var $href = $(this).attr('href'); 420 if (_url == $href) { 421 $(this).addClass(_currentClass); 422 } 423 }) 424 } 425 426 _init(); 427 return _that; 428} 429 430 431comJs.historyTabContainFunc = function(_$wrap) { 432 var _that = {}; 433 var _$tabBtn = _$wrap.find('.tabWrap .tabList .btn'); 434 var _url = $(location).attr('pathname'); 435 var _urlParts = _url.split('/'); 436 var _lastUrl = _urlParts[_urlParts.length - 1]; 437 438 var _currentClass = 'js-current'; 439 440 var _init = function () { 441 _$tabBtn.each(function () { 442 443 var href = $(this).attr('href'); 444 var pathParts = href.split('/'); 445 var lastPart = pathParts[pathParts.length - 1]; 446 447 if (!_lastUrl) { 448 _$tabBtn.eq(0).addClass(_currentClass); 449 } else { 450 if (_lastUrl == lastPart) { 451 $(this).addClass(_currentClass); 452 } 453 } 454 }); 455 } 456 457 _init(); 458 return _that; 459} 460 461 462 463 464comJs.mappingFadeFunc = function (_$wrap) { 465 var _that = {}; 466 var _$area = _$wrap.find('.areaBase .area'); 467 // var _$list = _$wrap.find('.list .btn'); 468 var _$hasDataItem = _$wrap.find('[data-area]'); 469 var _$id; 470 471 var _init = function () { 472 _$hasDataItem.each(function () { 473 var $this = $(this); 474 $this.on({ 475 'mouseenter': function () { 476 _$id = $('#' + $this.data('area')); 477 478 _$area.not(_$id).stop().animate({ 479 opacity: 0.2 480 }); 481 }, 482 'mouseleave': function () { 483 _$area.stop().animate({ 484 opacity: 1 485 }); 486 } 487 }); 488 }); 489 } 490 491 _init(); 492 return _that; 493} 494 495 496 497 498/*=========================================================================== 499â SNSãã¿ã³è¡¨ç¤ºç®æåãæ¿ã â 500===========================================================================*/ 501comJs.spNavBottomSet = function (_$target) { 502 var _that = {}; 503 var _$mdNewsTtlLine = $('.md-newsTtlLine .md-ctsWid'); 504 var _$mdpagerWrap = $('.md-pagerWrap'); 505 506 var _mediaSize = window.matchMedia("(max-width: 768px)"); 507 var _flag = (_mediaSize.matches) ? false : true; 508 509 var _init = function () { 510 if (_mediaSize.matches) { 511 if (!_flag) { 512 _flag = true; 513 spShowNav(); 514 } 515 } else { 516 if (_flag) { 517 _flag = false; 518 pcShowNav(); 519 } 520 }; 521 522 $(window).on('resize', function () { 523 if (_mediaSize.matches) { 524 if (!_flag) { 525 _flag = true; 526 spShowNav(); 527 } 528 } else { 529 if (_flag) { 530 _flag = false; 531 pcShowNav(); 532 } 533 }; 534 }); 535 } 536 537 var pcShowNav = function () { 538 _$mdNewsTtlLine.append(_$target); 539 } 540 var spShowNav = function () { 541 _$mdpagerWrap.before(_$target); 542 } 543 544 _init(); 545 return _that; 546} 547 548 549 550 551/*=========================================================================== 552â table SPã¹ã©ã¤ã â 553===========================================================================*/ 554comJs.tableSlideInit = function ($Wrap) { 555 var that = {}; 556 var tableArry = []; 557 var $table = $Wrap.find('table'); 558 var tableScrollClass = '.js-secTblScroll'; 559 var $tableWrapHtml = $('<div class="dtlTableWrap">\ 560 <div class= "md-spSlideTxt">\ 561 <p class="txt">The table can be scrolled left or right with a swipe.</p>\ 562 </div>\ 563 <div class= "js-secTblScroll" ></div >\ 564 </div>'); 565 566 var init = function () { 567 $table.each(function () { 568 tableArry.push($(this)); 569 }); 570 $table.replaceWith($tableWrapHtml); 571 for (var i = 0; i < tableArry.length; i++) { 572 $Wrap.find(tableScrollClass).eq(i).append($table.eq(i)); 573 } 574 if ($Wrap.find(tableScrollClass).length) { 575 $Wrap.find(tableScrollClass).customHorizontalScroll({ 576 mouseDrag: true 577 }); 578 } 579 }; 580 581 init(); 582 return that; 583}; 584 585 586
587comJs.ctsSetting = function () { 588 comJs.imgSvgToHtmlSvgCall(); 589}; 590 591/*=========================================================================== 592âã¢ãã¡ã¼ã·ã§ã³ã»ããâ 593===========================================================================*/ 594/** 595 * ã¢ãã¡ã¼ã·ã§ã³ 596 * æå®æ¹æ³(ã¢ãã¡ã¼ã·ã§ã³å¯¾è±¡è¦ç´ ã«è¨è¿°) 597 * æå®æ¹æ³1(åå¥æå® åªå é ä½:é«) 598 * âã¢ãã¡ã¼ã·ã§ã³è¦ç´ ã«ãdata-ãã§æå®ãæå®ã¿ã¤ãã¯ä¸è¨ 599 * âdata-anijs-class ã¢ãã¡ã¼ã·ã§ã³è¦ç´ ã«ä»ãã䏿ã®ã¯ã©ã¹(èªåçã«ã¯ã©ã¹ã®æå¾ã«å ¨ä½é£çªä»ä¸) 600 * âdata-anijs-type ã¢ãã¡ã¼ã·ã§ã³ã¿ã¤ãæå®(ã¿ã¤ãã¯ä¸è¨åç §) 601 * âdata-anijs-delay ã¢ãã¡ã¼ã·ã§ã³é å»¶(msåä½) 602 * âdata-anijs-duration ã¢ãã¡ã¼ã·ã§ã³å®äºã¾ã§ã®æé(msåä½) 603 * âdata-anijs-point ã¢ãã¡ã¼ã·ã§ã³ç§»åè·é¢(pxåä½) 604 * âdata-anijs-sp-delay SPç¨ã¢ãã¡ã¼ã·ã§ã³é å»¶(msåä½) 605 * âdata-anijs-sp-duration SPç¨ã¢ãã¡ã¼ã·ã§ã³å®äºã¾ã§ã®æé(msåä½) 606 * âdata-anijs-sp-point SPç¨ã¢ãã¡ã¼ã·ã§ã³ç§»åè·é¢(pxåä½) 607 * âdata-anijs-ease ã¢ãã¡ã¼ã·ã§ã³ã¤ã¼ã¸ã³ã° 608 * âdata-anijs-parent ã¢ãã¡ã¼ã·ã§ã³ã¹ã¿ã¼ãã®åºæºè¦ç´ (æå®ããªããã°ã¢ãã¡ã¼ã·ã§ã³è¦ç´ ãåºæº) 609 * âdata-anijs-after-color coverã¢ãã¡ã¼ã·ã§ã³ç¨ã®è²æå®(after) 610 * âdata-anijs-before-color coverã¢ãã¡ã¼ã·ã§ã³ç¨ã®è²æå®(before) 611 * 612 * æå®æ¹æ³2(ã¯ã©ã¹æå® åªå é ä½:ä½) 613 * âã¯ã©ã¹ã§ã¢ãã¡ã¼ã·ã§ã³æå®(animationInit()å ã§ç»é²ã®éã«ãªãã·ã§ã³æå®) 614 * âaniClass ã¢ãã¡ã¼ã·ã§ã³è¦ç´ ã«ä»ãã䏿ã®ã¯ã©ã¹(èªåçã«ã¯ã©ã¹ã®æå¾ã«å ¨ä½é£çªä»ä¸) 615 * âaniType ã¢ãã¡ã¼ã·ã§ã³ã¿ã¤ãæå®(ã¿ã¤ãã¯ä¸è¨åç §) 616 * âaniDelay ã¢ãã¡ã¼ã·ã§ã³é å»¶(msåä½) 617 * âaniDuration ã¢ãã¡ã¼ã·ã§ã³å®äºã¾ã§ã®æé(msåä½) 618 * âaniPoint ã¢ãã¡ã¼ã·ã§ã³ç§»åè·é¢(pxåä½) 619 * âaniSpDelay SPç¨ã¢ãã¡ã¼ã·ã§ã³é å»¶(msåä½) 620 * âaniSpDuration SPç¨ã¢ãã¡ã¼ã·ã§ã³å®äºã¾ã§ã®æé(msåä½) 621 * âaniSpPoint SPç¨ã¢ãã¡ã¼ã·ã§ã³ç§»åè·é¢(pxåä½) 622 * âaniEase ã¢ãã¡ã¼ã·ã§ã³ã¤ã¼ã¸ã³ã° 623 * âaniParent ã¢ãã¡ã¼ã·ã§ã³ã¹ã¿ã¼ãã®åºæºè¦ç´ (æå®ããªããã°ã¢ãã¡ã¼ã·ã§ã³è¦ç´ ãåºæº) 624 * âaniAfterColor coverã¢ãã¡ã¼ã·ã§ã³ç¨ã®è²æå®(after) 625 * âaniBeforeColor coverã¢ãã¡ã¼ã·ã§ã³ç¨ã®è²æå®(before) 626 * 627 * ã¢ãã¡ã¼ã·ã§ã³ã¿ã¤ã(å ±éãªãã·ã§ã³ã»å°ç¨ãªãã·ã§ã³æ) 628 * "noSetAni" ã¢ãã¡ã¼ã·ã§ã³æªè¨å® 629 * "fade" ãã§ã¼ãã¤ã³ 630 * "fadeInBottom" ä¸ãããã§ã¼ãã¤ã³ 631 * "fadeInRight" å³ãããã§ã¼ãã¤ã³ 632 * "fadeInLeft" å·¦ãããã§ã¼ãã¤ã³ 633 * "slideInRight" å³ããã¹ã©ã¤ã 634 * "slideInLeft" å·¦ããã¹ã©ã¤ã 635 * "coverSlideRight" å³ããå·¦ã¸è¦ç´ ã®ä¸ã«è¢«ããè²ã2ææéå·®ã§åºã 636 * "coverSlideLeft" å·¦ããå³ã¸è¦ç´ ã®ä¸ã«è¢«ããè²ã2ææéå·®ã§åºã 637**/ 638 639aniJs.animationInit = function () { 640 var d = new $.Deferred; 641 const setDuration = 800; 642 const setSpDuration = 800; 643 const setPoint = 50; 644 const setSpPoint = 25; 645 646 //ã¢ãã¡ã¼ã·ã§ã³æ å ±ç»é²(JSON追å ) 647 var init = function () { 648 649 $('.js-showElm').each(function () { 650 aniJs.conversionJs($(this), { 651 aniType: 'noSetAni' 652 }); 653 }); 654 655 $('.js-fadeIn').each(function () { 656 aniJs.conversionJs($(this), { 657 aniType: 'fadeInBottom', 658 aniDuration: setDuration, 659 aniEase: 'ease-out', 660 aniPoint: setPoint, 661 aniSpPoint: setSpPoint, 662 aniSpDuration: setSpDuration 663 }); 664 }); 665 666 $('.js-fade').each(function () { 667 aniJs.conversionJs($(this), { 668 aniType: 'fade', 669 aniDuration: setDuration, 670 aniEase: 'ease-out', 671 aniPoint: setPoint, 672 aniSpPoint: setSpPoint, 673 aniSpDuration: setSpDuration, 674 }); 675 }); 676 677 $('.js-fadeInRight').each(function () { 678 aniJs.conversionJs($(this), { 679 aniType: 'fadeInRight', 680 aniDuration: setDuration, 681 aniEase: 'ease-out', 682 aniPoint: setPoint, 683 aniSpPoint: setSpPoint, 684 aniSpDuration: setSpDuration 685 }); 686 }); 687 688 $('.js-fadeInLeft').each(function () { 689 aniJs.conversionJs($(this), { 690 aniType: 'fadeInLeft', 691 aniDuration: setDuration, 692 aniEase: 'ease-out', 693 aniPoint: setPoint, 694 aniSpPoint: setSpPoint, 695 aniSpDuration: setSpDuration 696 }); 697 }); 698 699 d.resolve(); 700 }; 701 702 init(); 703 return d.promise(); 704}; 705 706/*=========================================================================== 707âãããã¼é¢é£å¦çâ 708===========================================================================*/ 709comJs.hdFuntion = function () { 710 const hdJs = {}; 711 const $hd = $('.hd');
712 const $main = $('main'); 713 714 const openClass = 'js-open'; 715 const speed = 300; 716 717 var _winScroll = $(window).scrollTop(); 718 var _borderLine; 719 var _$newsTtl = $('.md-newsTtlLine .pageTtl'); 720 721 const hdInit = function () { 722 hdJs.pcSearch(); 723 hdJs.pcColor(); 724 hdJs.spToggle(); 725 726 $('[data-js-spToggle]').each(function () { 727 hdJs.spListToggle($(this)); 728 }); 729 730 if (!$main.hasClass('top') && !$main.hasClass('secondary')) { 731 $hd.addClass('_js-color'); 732 } 733 734 735 $(window).on('scroll', function () { 736 _winScroll = $(window).scrollTop(); 737 738 if ($('.md-breadcrumb').length) { 739 if ($(_$newsTtl).length) { 740 _borderLine = (_$newsTtl.offset().top + _$newsTtl.innerHeight()); 741 hdJs.borderAddFunc(_borderLine); 742 } else { 743 _borderLine = $('.md-breadcrumb').offset().top; 744 hdJs.borderAddFunc(_borderLine); 745 } 746 } else { 747 _borderLine = $('.md-kvListWrap').innerHeight(); 748 hdJs.borderAddFunc(_borderLine); 749 } 750 }); 751 752 if ($('.md-breadcrumb').length) { 753 if ($(_$newsTtl).length) { 754 _borderLine = (_$newsTtl.offset().top + _$newsTtl.innerHeight()); 755 hdJs.borderAddFunc(_borderLine); 756 } else { 757 _borderLine = $('.md-breadcrumb').offset().top; 758 hdJs.borderAddFunc(_borderLine); 759 } 760 } else { 761 _borderLine = $('.md-kvListWrap').innerHeight(); 762 hdJs.borderAddFunc(_borderLine); 763 } 764 }; 765 766 hdJs.pcColor = function () { 767 const $win = $(window); 768 769 const onClass = "_js-onColor"; 770 771 const init = function () { 772 $win.trigger('scroll'); 773 $win.on('scroll', function () { 774 const winScrTop = $win.scrollTop(); 775 const hdH = $hd.innerHeight(); 776 if (winScrTop > hdH) { 777 $hd.addClass(onClass); 778 } else { 779 $hd.removeClass(onClass); 780 } 781 }); 782 }; 783 784 init(); 785 }; 786 787 hdJs.pcSearch = function () { 788 const $wrap = $('[data-js-search]'); 789 const $box = $wrap.find('[data-js-searchBox]'); 790 const $btn = $wrap.find('[data-js-searchBtn]'); 791 792 let flag = false; 793 794 const init = function () { 795 $btn.on('click', function () { 796 if (flag) { 797 return; 798 } 799 flag = true; 800 801 if ($wrap.hasClass(openClass)) { 802 close(); 803 } else { 804 open(); 805 } 806 }); 807 }; 808 809 const open = function () { 810 $wrap.addClass(openClass); 811 $box.css({ 812 'width': 0, 813 'display': 'block' 814 }); 815 816 let tmpW = $box.width(); 817 $box.css('width', 'auto'); 818 let toH = $box.width(); 819 $box.css('width',tmpW); 820 $box.animate({ 821 'width': toH 822 }, speed, function() { 823 $box.css('width', 'auto'); 824 $box.find('input').focus(); 825 flag = false; 826 }); 827 } 828 829 var close = function() { 830 $wrap.removeClass(openClass); 831 $box.animate({ 832 'width': 0 833 }, speed, function() { 834 $box.css('display', 'none'); 835 flag = false; 836 }); 837 }; 838 839 840 init(); 841 }; 842 843 hdJs.spToggle = function () { 844 const $win = $(window); 845 const $wrap = $hd; 846 const $box = $hd.find('[data-js-hdNav]'); 847 const $hdBtn = $hd.find('[data-js-hdBtn]'); 848 849 let flag = false; 850 let setWid = $win.innerWidth(); 851 852 const init = function () { 853 if (!spFlag()) { 854 flag = true; 855 } 856 $hdBtn.on('click', function () { 857 if (flag) { 858 return; 859 } 860 flag = true; 861 if ($wrap.hasClass(openClass)) { 862 close(); 863 } else { 864 open(); 865 } 866 }); 867 868 $win.resize(function () { 869 let tmpWid = $win.innerWidth(); 870 if (setWid !== tmpWid) { 871 setWid = $win.innerWidth(); 872 close(); 873 flag = true; 874 resetStyle(); 875 }; 876 if (spFlag()) { 877 flag = false; 878 } 879 }); 880 } 881 882 const open = function() { 883 $wrap.addClass(openClass); 884 $box.stop(); 885 if(!$box.is(':visible')) { 886 $box.css({ 887 'height': 0, 888 'display': 'flex' 889 }); 890 } 891 let tmpH = $box.height(); 892 let toH = $(window).innerHeight(); 893 $box.css('height', tmpH); 894 $box.animate({ 895 'height': toH 896 }, speed, function() { 897 flag = false; 898 }); 899 }; 900 901 const close = function() { 902 $wrap.removeClass(openClass); 903 $box.stop(); 904 $box.animate({ 905 'height': 0 906 }, speed, function() { 907 $box.css('display', 'none'); 908 flag = false; 909 }); 910 }; 911 912 const resetStyle = function () { 913 $box.attr('style', ''); 914 }; 915 916 init(); 917 }; 918 919 hdJs.spListToggle = function ($wrap) { 920 const $win = $(window); 921 const $btn = $wrap.find('[data-js-spToggleBtn]'); 922 const $box = $wrap.find('[data-js-spToggleBox]'); 923 924 let flag = false; 925 let setWid = $win.innerWidth(); 926 927 let setTime = null; 928 929 const init = function () { 930 if (!spFlag()) { 931 flag = true; 932 } 933 934 $btn.on('click', function () { 935 if (flag) { 936 return; 937 } 938 flag = true; 939 if ($wrap.hasClass(openClass)) { 940 close(); 941 } else { 942 open(); 943 } 944 }); 945 946 $win.resize(function () { 947 clearTimeout(setTime); 948 setTime = setTimeout(() => { 949 let tmpWid = $win.innerWidth(); 950 if (setWid !== tmpWid) { 951 setWid = $win.innerWidth(); 952 close(); 953 }; 954 }, 100); 955 }); 956 }; 957 958 const open = function() { 959 $wrap.addClass(openClass); 960 $box.stop(); 961 if(!$box.is(':visible')) { 962 $box.css({ 963 'height': 0, 964 'display': 'block' 965 }); 966 } 967 let tmpH = $box.height(); 968 $box.css('height','auto'); 969 let toH = $box.height(); 970 $box.css('height',tmpH); 971 $box.animate({ 972 'height': toH 973 }, speed, function() { 974 $box.css('height', 'auto'); 975 flag = false; 976 }); 977 }; 978 979 const close = function () { 980 $wrap.removeClass(openClass); 981 $box.stop(); 982 $box.animate({ 983 'height': 0 984 }, speed, function() { 985 $box.css('display', 'none'); 986 if (spFlag()) { 987 flag = false; 988 } else { 989 flag = true; 990 } 991 resetStyle(); 992 }); 993 }; 994 995 const resetStyle = function () { 996 $box.attr('style', ''); 997 }; 998 999 init(); 1000 }; 1001 1002 1003 hdJs.borderAddFunc = function (_addClassLine) { 1004 var scrollVol = _winScroll + $hd.innerHeight(); 1005 if (scrollVol >= (_addClassLine - 1)) { 1006 $('.hd').addClass('hasBorder'); 1007 } else { 1008 $('.hd').removeClass('hasBorder'); 1009 } 1010 } 1011
1012 hdInit(); 1013}; 1014 1015/*=========================================================================== 1016âããã¿ã¼é¢é£å¦çâ 1017===========================================================================*/ 1018comJs.ftFuntion = function () { 1019 const ftJs = {}; 1020 const $ft = $('.ft'); 1021 1022 const openClass = 'js-open'; 1023 const speed = 300; 1024 1025 // console.log(spFlag()); 1026 1027 const hdInit = function () { 1028 ftJs.topBtnToggle(); 1029 1030 $('[data-js-spFtToggle]').each(function () { 1031 ftJs.spListToggle($(this)); 1032 }); 1033 }; 1034 1035 ftJs.spListToggle = function ($wrap) { 1036 const $win = $(window); 1037 const $btn = $wrap.find('[data-js-spFtToggleBtn]'); 1038 const $box = $wrap.find('[data-js-spFtToggleBox]'); 1039 1040 let flag = false; 1041 let setWid = $win.innerWidth(); 1042 1043 let setTime = null; 1044 1045 const init = function () { 1046 if (!spFlag()) { 1047 flag = true; 1048 } 1049 1050 $btn.on('click', function () { 1051 if (flag) { 1052 return; 1053 } 1054 flag = true; 1055 if ($wrap.hasClass(openClass)) { 1056 close(); 1057 } else { 1058 open(); 1059 } 1060 }); 1061 1062 $win.resize(function () { 1063 clearTimeout(setTime); 1064 setTime = setTimeout(() => { 1065 let tmpWid = $win.innerWidth(); 1066 if (setWid !== tmpWid) { 1067 setWid = $win.innerWidth(); 1068 close(); 1069 }; 1070 }, 100); 1071 }); 1072 }; 1073 1074 const open = function() { 1075 $wrap.addClass(openClass); 1076 $box.stop(); 1077 if(!$box.is(':visible')) { 1078 $box.css({ 1079 'height': 0, 1080 'display': 'block' 1081 }); 1082 } 1083 let tmpH = $box.height(); 1084 $box.css('height','auto'); 1085 let toH = $box.height(); 1086 $box.css('height',tmpH); 1087 $box.animate({ 1088 'height': toH 1089 }, speed, function() { 1090 $box.css('height', 'auto'); 1091 flag = false; 1092 }); 1093 }; 1094 1095 const close = function () { 1096 $wrap.removeClass(openClass); 1097 $box.stop(); 1098 $box.animate({ 1099 'height': 0 1100 }, speed, function() { 1101 $box.css('display', 'none'); 1102 if (spFlag()) { 1103 flag = false; 1104 } else { 1105 flag = true; 1106 } 1107 resetStyle(); 1108 }); 1109 }; 1110 1111 const resetStyle = function () { 1112 $box.attr('style', ''); 1113 }; 1114 1115 init(); 1116 }; 1117 1118 ftJs.topBtnToggle = function () { 1119 const $win = $(window); 1120 const $btn = $('[data-js-topBtn]'); 1121 1122 const init = function () { 1123 $win.on('scroll', function () { 1124 const scrollTop = $(this).scrollTop(); 1125 scrollAct(scrollTop); 1126 }); 1127 }; 1128 1129 const scrollAct = function (scrollTop) { 1130 const winH = $win.innerHeight(); 1131 if ((winH / 2) < scrollTop) { 1132 show(); 1133 } else { 1134 hide(); 1135 } 1136 }; 1137 1138 const show = function () { 1139 $btn.css({ 1140 'opacity': 1 1141 }); 1142 }; 1143 1144 const hide = function () { 1145 $btn.css({ 1146 'opacity': 0 1147 }); 1148 }; 1149 1150 init(); 1151 }; 1152 1153 1154 1155 hdInit(); 1156}; 1157 1158/*=========================================================================== 1159âãclass="js-swapSvg"ãã®ããimgç½®ãã®SVGãèªã¿è¾¼ã¿ç´é ç½®ã«å¤æ´ãclass="js-svg"ãâ 1160===========================================================================*/ 1161comJs.imgSvgToHtmlSvgCall = function () { 1162 var ns = 'imgSvgToHtmlSvg'; 1163 var setClass = 'js-already-' + ns; 1164 var $svgImgs = $('img[src$=".svg"].js-swapSvg').not('.' + setClass); 1165 $svgImgs.each(function () { 1166 $(this).addClass(setClass); 1167 comJs.imgSvgToHtmlSvg($(this)); 1168 }); 1169}; 1170comJs.imgSvgToHtmlSvg = function ($target) { 1171 var that = {}; 1172 1173 var init = function () { 1174 var svgPass = $target.attr('src'); 1175 $.ajax({ 1176 url: svgPass, 1177 type: 'GET', 1178 dataType: 'html', 1179 }).done(function (data) { 1180 var $data = $(data); 1181 $data.addClass('js-svg'); 1182 $target.after($data); 1183 $target.remove(); 1184 }); 1185 }; 1186 1187 init(); 1188 return that; 1189}; 1190 1191 1192/*=========================================================================== 1193âãã¼ãã£ã³ã°â 1194===========================================================================*/ 1195comJs.loadCompFuncAry = []; 1196comJs.imagesLoadedWrap = function(option) { 1197 var that = {}; 1198 var opt = option || {}; 1199 var $wrap = opt.$wrap || $('#wrap'); 1200 var late = (opt.late === undefined) ? false : opt.late; 1201 var lateStepTime = opt.lateStepTime || 10;
1202 var doneFunc = opt.doneFunc || function(){}; 1203 var progressFunc = opt.progressFunc || function(){}; 1204 var tmpPercent = 0; 1205 var percent = 0; 1206 var pregTimer = null; 1207 1208 var init = function(){ 1209 $wrap.imagesLoaded({ 1210 background: true 1211 }).progress( function( instance, image ) { 1212 if(instance) { 1213 //console.log(instance.images.length); 1214 //console.log(instance.progressedCount); 1215 percent = instance.progressedCount / instance.images.length * 100; 1216 //console.log(percent); 1217 if(!late) { 1218 progressFunc(percent); 1219 } 1220 } 1221 }).fail( function( instance ) { 1222 //console.log('fail'); 1223 if(!late) { 1224 doneFunc(); 1225 imagesLoadedDone(); 1226 } 1227 }).done( function( instance ) { 1228 //console.log('done'); 1229 if(!late) { 1230 doneFunc(); 1231 imagesLoadedDone(); 1232 } 1233 }); 1234 1235 if(late) { 1236 pregTimer = setInterval(function(){ 1237 imagesLoadedLateProgress(); 1238 },lateStepTime); 1239 } 1240 }; 1241 var imagesLoadedDone = function(){ 1242 $.each(comJs.loadCompFuncAry, function(idx) { 1243 comJs.loadCompFuncAry[idx](); 1244 }); 1245 }; 1246 1247 var imagesLoadedLateProgress = function() { 1248 if(percent > tmpPercent) { 1249 tmpPercent += 1; 1250 } 1251 progressFunc(tmpPercent); 1252 if(tmpPercent === 100) { 1253 clearInterval(pregTimer); 1254 pregTimer = null; 1255 doneFunc(); 1256 imagesLoadedDone(); 1257 } 1258 }; 1259 1260 init(); 1261 return that; 1262}; 1263 1264 1265/*=========================================================================== 1266âè¦ç´ ééâ 1267===========================================================================*/ 1268comJs.flexBox = function ($wrap) { 1269 var ns = 'flexBox'; 1270 var setClass = 'js-already-' + ns; 1271 1272 if ($wrap.hasClass(setClass)) { 1273 return; 1274 } else { 1275 $wrap.addClass(setClass); 1276 } 1277 1278 var that = {}; 1279 var $btn = $wrap.find('.js-flexBtn'); 1280 var $box = $wrap.find('.js-flexBox'); 1281 var openClass = "js-open"; 1282 1283 var speed = 500; 1284 var easing = 'easeOutQuart'; 1285 1286 var init = function() { 1287 $btn.on('click',function(){ 1288 if(!$wrap.hasClass(openClass)) { 1289 boxOpen(); 1290 } else { 1291 boxClose(); 1292 } 1293 }); 1294 }; 1295 1296 var boxOpen = function() { 1297 $wrap.addClass(openClass); 1298 $box.stop(); 1299 if(!$box.is(':visible')) { 1300 $box.css({ 1301 'height': 0, 1302 'display': 'block' 1303 }); 1304 } 1305 var tmpH = $box.height(); 1306 $box.css('height','auto'); 1307 var toH = $box.height(); 1308 $box.css('height',tmpH); 1309 $box.animate({ 1310 'height': toH 1311 }, speed, easing, function() { 1312 $box.css('height','auto'); 1313 }); 1314 }; 1315 1316 var boxClose = function() { 1317 $wrap.removeClass(openClass); 1318 $box.stop(); 1319 $box.animate({ 1320 'height': 0 1321 }, speed, easing, function() { 1322 $box.css('display','none'); 1323 }); 1324 }; 1325 1326 init(); 1327 return that; 1328}; 1329 1330 1331/*=========================================================================== 1332âè¦ç´ ã®é«ããæãã å¼ã³åºãâ 1333===========================================================================*/ 1334comJs.sameHeightCall = function($target) { 1335 $target.each(function() { 1336 var $this = $(this); 1337 var num = $this.data('jsprop-num'); 1338 var spNum = $this.data('jsprop-spnum'); 1339 var itemClass = $this.data('jsprop-shitem') || 'js-shItem'; 1340 var $item = $this.find('.' + itemClass); 1341 var shObj = null; 1342 if($item.length) { 1343 if(num) { 1344 shObj = comJs.sameHeightNum($item, num); 1345 1346 if(spNum) { 1347 if($('html').hasClass('viewport_pc')) { 1348 shObj.setNum(num); 1349 }else { 1350 shObj.setNum(spNum); 1351 } 1352 comJs.responseFlagObj.addFunc(function(){ 1353 if($('html').hasClass('viewport_pc')) { 1354 shObj.setNum(num); 1355 }else { 1356 shObj.setNum(spNum); 1357 } 1358 }); 1359 } 1360 }else { 1361 shObj = comJs.sameHeightNum($item); 1362 } 1363 } 1364 }); 1365}; 1366 1367 1368/*=========================================================================== 1369âè¦ç´ ã®é«ããæããâ 1370===========================================================================*/ 1371comJs.sameHeight = function($target) { 1372 $target.css('height', 'auto'); 1373 if ($target.length > 1) { 1374 var maxH = 0; 1375 $target.each(function() { 1376 if (maxH < $(this).height()) { 1377 maxH = Math.ceil($(this).height()); 1378 } 1379 }); 1380 $target.height(maxH); 1381 } 1382}; 1383 1384 1385/*=========================================================================== 1386âè¦ç´ ãæ°æ¯ã«é«ããæããâ 1387===========================================================================*/ 1388comJs.sameHeightNum = function($target, num) { 1389 var that = {}; 1390 var $win = $(window); 1391 that.num = num || null; 1392 //that.timer = null; 1393 1394 var init = function() { 1395 /*that.timer = setInterval(function() { 1396 sameHeightFunc(); 1397 }, 1500);*/ 1398 1399 $win.on('resize.sameHeightNum',function(){ 1400 sameHeightFunc(); 1401 }); 1402 1403 that.timer = setTimeout(function() { 1404 sameHeightFunc(); 1405 }, 1500); 1406 1407 sameHeightFunc(); 1408 }; 1409 1410 var sameHeightFunc = function() { 1411 var tmpArySet = []; 1412 var $tmpSet = null; 1413 if(that.num) { 1414 $target.each(function(index, element) { 1415 if (index % that.num === 0) { 1416 if ($tmpSet) { 1417 tmpArySet.push($tmpSet); 1418 } 1419 $tmpSet = $(element); 1420 } else { 1421 $tmpSet = $tmpSet.add($(element)); 1422 } 1423 }); 1424 }else { 1425 $target.each(function(index, element) { 1426 if (index === 0) { 1427 $tmpSet = $(element); 1428 } else { 1429 $tmpSet = $tmpSet.add($(element)); 1430 } 1431 }); 1432 } 1433 1434 tmpArySet.push($tmpSet); 1435 1436 for (var i = 0, len = tmpArySet.length; i < len; i++) { 1437 comJs.sameHeight(tmpArySet[i]); 1438 } 1439 }; 1440 1441 that.setNum = function(newNum) { 1442 that.num = newNum; 1443 }; 1444 1445 that.triggerSameHeight = function() { 1446 sameHeightFunc(); 1447 }; 1448 1449 $.data($target.get(0), "sameHeightNum", { 1450 'sameHeightNum': that 1451 }); 1452 1453 init(); 1454 return that; 1455}; 1456 1457 1458 1459/*=========================================================================== 1460âã¹ã¯ãã¼ã«ç§»åâ 1461===========================================================================*/ 1462comJs.ancScr = function($ancTarget, option) { 1463 var position; 1464 var opt = option || {}; 1465 var speed = opt.speed || 1200; 1466 var easing = opt.easing || 'easeOutExpo'; 1467 1468 if (!$ancTarget.length) { 1469 return false; 1470 } 1471 1472 position = $ancTarget.offset().top; 1473 1474 $('body, html').stop().animate({ 1475 scrollTop: position 1476 }, speed, easing); 1477}; 1478 1479 1480 1481/*=========================================================================== 1482âã¬ã¹ãã³ã·ãåãæ¿ãå¤å®â 1483===========================================================================*/ 1484comJs.responseFlag = function() { 1485 var that = {}; 1486 var flagElmCss = { 1487 'position': 'fixed', 1488 'top': '-999px', 1489 'display': 'none' 1490 }; 1491 var $flagElmPc = $('<div id="responseFlagPc" class="responseFlag"> </div>').css(flagElmCss); 1492 var $flagElmTab = $('<div id="responseFlagTab" class="responseFlag"> </div>').css(flagElmCss); 1493 var $flagElmSp = $('<div id="responseFlagSp" class="responseFlag"> </div>').css(flagElmCss); 1494 1495 $('body').append($flagElmPc, $flagElmTab, $flagElmSp); 1496 1497 var funcAry = []; 1498 var flag = null; 1499 1500 var init = function() { 1501 setInterval(function() { 1502 responseCheck(); 1503 }, 500); 1504 responseCheck(); 1505 }; 1506
1507 var responseCheck = function() { 1508 var tmpFlag = flag; 1509 if ($('#responseFlagPc').is(':visible')) { 1510 $('html').addClass('viewport_pc'); 1511 $('html').removeClass('viewport_tab'); 1512 $('html').removeClass('viewport_sp'); 1513 flag = 'pc'; 1514 //console.log('is_pc'); 1515 } else if ($('#responseFlagTab').is(':visible')) { 1516 $('html').removeClass('viewport_pc'); 1517 $('html').addClass('viewport_tab'); 1518 $('html').removeClass('viewport_sp'); 1519 flag = 'tab'; 1520 //console.log('is_tab'); 1521 } else if ($('#responseFlagSp').is(':visible')) { 1522 $('html').removeClass('viewport_pc'); 1523 $('html').removeClass('viewport_tab'); 1524 $('html').addClass('viewport_sp'); 1525 flag = 'sp'; 1526 //console.log('is_sp'); 1527 } 1528 1529 //console.log(window.outerWidth); 1530 //console.log(flag); 1531 if (tmpFlag !== flag) { 1532 that.changeAction(); 1533 } 1534 }; 1535 1536 that.changeAction = function() { 1537 $.each(funcAry, function(idx) { 1538 funcAry[idx](flag); 1539 }); 1540 }; 1541 1542 that.addFunc = function(func) { 1543 funcAry.push(func); 1544 func(flag); 1545 }; 1546 1547 init(); 1548 return that; 1549}; 1550 1551/*=========================================================================== 1552âsnsãã¿ã³URLã»ããâ 1553===========================================================================*/ 1554comJs.setSnsBtnUrl = function() { 1555 var $btnTw = $("a.js-btnTw"); 1556 var $btnFb = $("a.js-btnFb"); 1557 var $btnLine = $("a.js-btnLine"); 1558 1559 var twBaseUrl = "http://twitter.com/intent/tweet"; 1560 var fbBaseUrl = "http://www.facebook.com/sharer.php"; 1561 var lineBaseUrl = "http://line.me/R/msg/text/"; 1562 1563 var init = function() { 1564 1565 var twTxt = $("title").eq(0).text(); 1566 var twUrl = location.href.replace(location.hash, ""); 1567 1568 $btnTw.each(function() { 1569 var $this = $(this); 1570 $this.off('click'); 1571 $this.attr("href", twBaseUrl + "?url=" + encodeURI(twUrl) + "&text=" + encodeURI(twTxt)); 1572 $this.attr('target','_blank'); 1573 $this.on("click", function(e) { 1574 e.preventDefault(); 1575 window.open($(this).attr("href"), 1576 "sharewindow", 1577 "width=550, height=450, personalbar=0, toolbar=0, scrollbars=1, resizable=1"); 1578 }); 1579 }); 1580 1581 1582 var fbUrl = location.href.replace(location.hash, ""); 1583 1584 $btnFb.each(function() { 1585 var $this = $(this); 1586 $this.off('click'); 1587 $this.attr("href", fbBaseUrl + "?u=" + fbUrl); 1588 $this.attr('target','_blank'); 1589 $this.on("click", function(e) { 1590 e.preventDefault(); 1591 window.open($(this).attr("href"), 1592 "sharewindow", 1593 "width=550, height=450, personalbar=0, toolbar=0, scrollbars=1, resizable=1"); 1594 }); 1595 }); 1596 1597 1598 var lineTxt = $("title").eq(0).text(); 1599 var lineUrl = location.href.replace(location.hash, ""); 1600 var encodLineTxt = encodeURI(lineTxt + " " + lineUrl); 1601 1602 $btnLine.each(function(index, element) { 1603 var $this = $(this); 1604 $this.off('click'); 1605 $this.attr('target','_blank'); 1606 if($('html').hasClass('is_ios')) { 1607 $this.attr('target',''); 1608 } 1609 $this.attr("href", lineBaseUrl + "?" + encodLineTxt); 1610 if ($('html').hasClass('is_mouse')) { 1611 $this.on("click", function(e) { 1612 e.preventDefault(); 1613 window.open($(this).attr("href"), 1614 "sharewindow", 1615 "width=550, height=450, personalbar=0, toolbar=0, scrollbars=1, resizable=1"); 1616 }); 1617 } 1618 }); 1619 1620 }; 1621 1622 init(); 1623}; 1624 1625 1626 1627/*=========================================================================== 1628âãã¼ã¸ãããã®ãã¸ã·ã§ã³â 1629===========================================================================*/ 1630comJs.pagetopPosSetting = function () { 1631 var that = {}; 1632 1633 var $html = $('html'); 1634 var $win = $(window); 1635 var $ft = $('#footer'); 1636 var $pagetop = $ft.find('.pageTopWrap'); 1637 1638 1639 var namespace = 'pagetopPosSetting'; 1640 var posAbsClass = 'js-posAbs'; 1641 var showClass = 'js-show'; 1642 1643 var init = function () { 1644 $win.on('resize.' + namespace + ' scroll.' + namespace, function () { 1645 winResize(); 1646 }).trigger('resize.' + namespace); 1647 }; 1648 1649 var winResize = function () { 1650 var winW = $win.width(); 1651 var winH = $win.height(); 1652 var ftImgH = $ft.find('.ftImg').innerHeight(); 1653 if ($('html').hasClass('is_touch')) { 1654 winH = window.innerHeight; 1655 } 1656 var winScrTop = $win.scrollTop(); 1657 var winScrLeft = $win.scrollLeft(); 1658 1659 if (winScrTop > 300) { 1660 if (!$pagetop.hasClass(showClass)) { 1661 $pagetop.addClass(showClass); 1662 $pagetop.stop(); 1663 if (!$pagetop.is(':visible')) { 1664 $pagetop.css({ 1665 display: 'block', 1666 opacity: 0 1667 });
1668 } 1669 1670 $pagetop.animate({ 1671 opacity: 1 1672 }, 300); 1673 } 1674 1675 1676 if (winScrTop + winH >= $ft.offset().top + ftImgH) { 1677 $pagetop.addClass(posAbsClass); 1678 } else { 1679 $pagetop.removeClass(posAbsClass); 1680 if ($html.hasClass('viewport_pc')) { 1681 if (winW < 1120) { 1682 $pagetop.css({ 1683 marginRight: winW - 1120 + winScrLeft 1684 }); 1685 } else { 1686 $pagetop.css({ 1687 marginRight: 0 1688 }); 1689 } 1690 } else { 1691 $pagetop.css({ 1692 marginRight: 0 1693 }); 1694 } 1695 } 1696 1697 1698 } else { 1699 if ($pagetop.hasClass(showClass)) { 1700 $pagetop.removeClass(showClass); 1701 $pagetop.stop(); 1702 $pagetop.animate({ 1703 opacity: 0 1704 }, 300, function () { 1705 $pagetop.css({ 1706 display: 'none' 1707 }); 1708 }); 1709 } 1710 1711 } 1712 1713 }; 1714 1715 init(); 1716 return that; 1717}; 1718 1719/*------------------------------------------------------- 1720 ã©ã³ãã åå¾ 1721-------------------------------------------------------*/ 1722function getRandom(nMin, nMax) { 1723 var nRandomInt = Math.floor(Math.random() * (nMax - nMin + 1)) + nMin; 1724 return nRandomInt; 1725} 1726 1727 1728/*------------------------------------------------------- 1729 ã¦ãã¼ã¯ããã¹ãåå¾ 1730-------------------------------------------------------*/ 1731function getUniqueStr(myStrong){ 1732 var strong = 1000; 1733 if (myStrong) { 1734 strong = myStrong; 1735 } 1736 return new Date().getTime().toString(16) + Math.floor(strong*Math.random()).toString(16); 1737} 1738 1739function spFlag() { 1740 let flag = false; 1741 if ($('#responseFlagSp').is(':visible')) { 1742 flag = true; 1743 } 1744 1745 return flag; 1746} 1747 1748 1749 1750 1751 1752// $(function () { 1753// setTimeout(function () { 1754// var loc = location.href; 1755// if (loc.indexOf('https://www.koito.co.jp/dev_english/') > 0) { 1756 // $('a').each(function () { 1757 // var href = $(this).attr('href'); 1758 // href = href.replace('/english', '/dev_english'); 1759 // $(this).attr('href', href); 1760 // }); 1761 1762 // $('img').each(function () { 1763 // var src = $(this).attr('src'); 1764 // console.log(src); 1765 // src = src.replace('/english', '/dev_english'); 1766 // $(this).attr('src', src); 1767 // }); 1768// } 1769// },1000);
1770// });
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.