1/*jslint browser: true*/ 2/*global $, jQuery, alert*/ 3jQuery.noConflict(); 4 5(function ($) { 6 'use strict'; 7 8 var conf = { 9 /** 10 * åæè¨å® 11 */ 12 13 /* ã¹ã ã¼ã¹ã¹ã¯ãã¼ã«ã«é¢ããè¨å® */ 14 smooth_scroll: { 15 // TOPã«æ»ããã¿ã³ã®è¡¨ç¤ºã表示ããã¹ã¯ãã¼ã«é 16 top: 100 17 }, 18 /* ãã¬ã¼ã¯ãã¤ã³ãã«é¢ããè¨å® */ 19 brakepoint: { 20 // ã¬ã¹ãã³ã·ãæã®ãã¬ã¼ã¯ãã¤ã³ãï¼ãã®å¤ä½ä»¥ä¸ã®ç»é¢å¹ ã§PC表示ã«ãªãã¾ãï¼ 21 medium: 768 22 }, 23 lp_header: { 24 // LPã®å ¨ç»é¢è¡¨ç¤ºã®æå¤§å¤ï¼ãã以ä¸ã®é«ãã«ããªãã¨ããå¶éå¤ï¼ 25 max_height: 1500 26 }, 27 /* ã¹ã©ã¤ãã¼ã«é¢ããè¨å® */ 28 slider: { 29 // ã¹ã©ã¤ãã¼ç»åã®åæ¢æé 30 time: 5000, 31 // ãã©ã¦ã¶ã®ã¿ãç§»åãªã©ããæ»ã£ã¦ããéã®ã¹ã©ã¤ãã¼åå§åéå§æé 32 weight: 1000 33 }, 34 /* SNSã«ã¦ã³ãæ°ã«é¢ããè¨å® */ 35 sns: { 36 // ã«ã¦ã³ãã®åæå¤ 37 count: 0 38 } 39 }, 40 41 /* 42 * 以ä¸ã¯æ¬ã¹ã¯ãªããå ã§ä½¿ç¨ãã夿°ç¾¤ã«ãªãã¾ãã 43 */ 44 45 /* SPã¡ãã¥ã¼å±éå¤å®ç¨å¤æ° */ 46 sp_menu_lock = false, 47 scroll_top, 48 49 /* ã¹ã¯ãã¼ã«å¦çç¨ã®ããã¯å¤æ° */ 50 scroll_lock = false, 51 52 /* ã¦ã£ã³ãã¦ã¹ã¯ãã¼ã«æã®å¦çç¨ã®å¤æ° */ 53 topBtn, 54 footerPanel, 55 panelDiff, 56 keniContainer, 57 58 /* ã¢ã³ã«ã¼ãªã³ã¯ç¨ã®å¤æ° */ 59 anchor = localStorage.getItem('anchor'), 60 61 /* SPã®ã°ãã¼ãã«ã¡ãã¥ã¼ç¨å¦çã®å¤æ° */ 62 menu, 63 body, 64 menuBtn, 65 clickSpace, 66 menuWidth, 67 68 /* PCã®ã°ãã¼ãã«ã¡ãã¥ã¼ç¨å¦çã®å¤æ° */ 69 hoverIn, 70 hoverOut, 71 72 /* ã¹ã¯ãã¼ã«ã§ãããã¼ã¨ããã¿ã¼ããã«ãåºå®ç¨ã®å¤æ° */ 73 hdrTop, 74 75 /* ç®æ¬¡ã®ééç¨ã®å¤æ° */ 76 tocList, 77 78 /* SNSãã¿ã³ã®è¨ç½®ã¨ã«ã¦ã³ãæ°ã®åå¾ã®å¤æ° */ 79 pageurl, 80 pagetitle, 81 82 /* ã¹ã©ã¤ãã¼ç¨ã®å¤æ° */ 83 start, 84 $pager = $('.keni-slider-pager'), 85 $slidesWrap = $('.keni-slider_outer'), 86 $nav = $('.keni-slider-nav'), 87 $slides = $('.keni-slider'), 88 $slideImg = $slides.find('img'), 89 current = 0, 90 number = $slideImg.length, 91 windowWidth = $(window).outerWidth(), 92 slider_lock = false, 93 isPc = false; 94 95 96 /** 97 * ç»åã«ãã¦ã¹ã«ã¼ã½ã«ãä¹ã£ãéã«ãèªåçã«ç»åã®ç½®ãæãããã¾ãã 98 * ç»åã®èªåç½®ãæããããã«ã¯ãç»åãã¡ã¤ã«ã®æ«å°¾ã«ã_offãã_onããä»ããã¦ãã ããã 99 * ä¾ï¼ 100 * ã»image_off.jpg 101 * ã»image_on.jpg 102 */ 103
104 /* ãã¼ã¸èªã¿è¾¼ã¿æã«å¯¾è±¡ã¨ãªãè¦ç´ ã«ã¯ã©ã¹ãæ¯ãå¦ç */ 105 $('img,input').each(function () { 106 var src = $(this).attr('src'); 107 if (src) { 108 if (src.match(/_off\./) || src.match(/_on\./)) { 109 $(this).addClass('fn-over-img'); 110 } 111 } 112 }); 113 114 /* 対象ã¨ãªãè¦ç´ ã«ãã¦ã¹ã«ã¼ã½ã«ãä¹ã£ãéã«ç»åãå·®ãæ¿ããå¦ç */ 115 $('.fn-over-img').hover(function () { 116 var src = $(this).attr('src'); 117 if (src.match(/_off\./)) { 118 $(this).attr('src', src.replace('_off.', '_on.')); 119 } 120 if (src.match(/_on\./)) { 121 $(this).attr('src', src.replace('_on.', '_off.')); 122 } 123 }); 124 125 126 /** 127 * ã¦ã£ã³ãã¦ã¹ã¯ãã¼ã«æã®å¦ç 128 * ã¹ã¯ãã¼ã«éã«å¿ãã¦ããã¼ã¸ä¸é¨ã®ãä¸ã¸æ»ãããã¿ã³ãããã«ç¸å½ãããã¿ã³é¡ã®è¡¨ç¤ºé表示ãã³ã³ããã¼ã«ãã¾ãã 129 * a. PC 130 * â ãã¼ã¸ä¸é¨ã«ãä¸ã¸æ»ãããã¿ã³ã表示ãã¾ã 131 * b. ã¹ãã¼ããã©ã³ 132 * â ãã¼ã¸ä¸é¨ã«ãä¸ã¸æ»ãããããåãåããããªã©å°ç·ãã¿ã³é¡ã表示ãã¾ã 133 */ 134 135 topBtn = $('.page-top'); 136 footerPanel = $('.keni-footer-panel_wrap'); 137 panelDiff = $('.keni-footer-panel_wrap').outerHeight(); 138 keniContainer = $('.keni-container'); 139 140 topBtn.hide(); 141 footerPanel.addClass('fn-footer-panel'); 142 143 // ããã¿èªåééæ 144 if (0 < lso) { 145 footerPanel.addClass('is-active'); 146 } 147 148 $(window).scroll(function () { 149 150 if (window.innerWidth < conf.brakepoint.medium && $('.utility-menu').length > 0) { 151 152 topBtn.fadeOut(); 153 154 if (!keniContainer.hasClass('fn-keni-container') && 0 !== lso) { 155 keniContainer.addClass('fn-keni-container'); 156 keniContainer.css('padding-bottom', panelDiff + 'px'); 157 } 158 // ãããåºå®æ 159 if (0 < lso) { } else { 160 if ($(this).scrollTop() > conf.smooth_scroll.top) { 161 if (!footerPanel.hasClass('is-active') && scroll_lock === false) { 162 footerPanel.addClass('is-active'); 163 } 164 } else { 165 if (footerPanel.hasClass('is-active') && scroll_lock === false) { 166 footerPanel.removeClass('is-active'); 167 } 168 } 169 } 170 171 } else { 172 173 if (keniContainer.hasClass('fn-keni-container')) { 174 keniContainer.removeClass('fn-keni-container'); 175 keniContainer.css('padding-bottom', '0'); 176 } 177 178 if ($(this).scrollTop() > conf.smooth_scroll.top) { 179 topBtn.fadeIn(); 180 } else { 181 topBtn.fadeOut(); 182 } 183 } 184 }); 185 186 187 /** 188 * link ref="canonical"ã«æå®ããããhref ãåå¾ãã 189 * link ã¿ã°ã® ref = canonical ã«æå®ããããhref 190 * è¦ã¤ãããªãã£ãå ´åãnull 191 * @return href | null 192 */ 193 function getCanonicalUrl() { 194 195 var links = document.getElementsByTagName("link"); 196 for (var i = 0; i < links.length; i++) { 197 if (links[i].rel) { 198 if (links[i].rel.toLowerCase() == "canonical") { 199 return links[i].href; 200 } 201 } 202 } 203 204 return null; 205 } 206 207 /** 208 * ã¢ã³ã«ã¼ãªã³ã¯ãã¯ãªãã¯ããéã®å¦ç 209 * ã¹ã ã¼ãºã¹ã¯ãã¼ã«ã«ã¯2éãã®åããå²ãå½ã¦ããã¦ãã¾ã 210 * 1. ãã¼ã¸å ç§»å 211 * â 該å½ããIDã®è¦ç´ ã¾ã§ã¹ã ã¼ãºã¹ã¯ãã¼ã«ãã¾ã 212 * 2. ä»ãã¼ã¸ã¸ã®ã¢ã³ã«ã¼ãªã³ã¯ 213 * â ãã¼ã¸é·ç§»å¾ã«è©²å½ããIDã®è¦ç´ ã¾ã§ã¹ã ã¼ãºã¹ã¯ãã¼ã«ãã¾ã 214 */ 215 // --- 216 function hideFooterPanel() { 217 if (footerPanel.hasClass('is-active')) { 218 footerPanel.removeClass('is-active'); 219 } 220 } 221 222 // --- 223 224 /* ã¢ã³ã«ã¼ã¸ã®ã¹ã¯ãã¼ã«ï¼1ããã³2ã§å ±éå©ç¨ï¼ */ 225 function scrollToAnchor(s) { 226 var target = (s === "#" || s === "" ? 'html' : s), 227 228 offsetTop, 229 fltHdrHeight = $('.keni-header_wrap').height(); 230 231 offsetTop = $(target).offset().top; 232 233 234 if (0 >= lso && offsetTop <= conf.smooth_scroll.top) { 235 hideFooterPanel(); 236 } 237 238 var keniHeaderCont = 0; 239 240 let imgHeight = 0; 241 // if ($(".site-title img").length > 0) { 242 // imgHeight = $(".site-title img").height(); 243 // } 244 245 if (window.innerWidth < conf.brakepoint.medium) { 246 $('html,body').animate({ 247 scrollTop: offsetTop - fltHdrHeight + keniHeaderCont - imgHeight 248 }, 'slow', 'swing', function () { 249 scroll_lock = false; 250 }); 251 } else { 252 $('html,body').animate({ 253 scrollTop: offsetTop 254 }, 'slow', 'swing', function () { 255 scroll_lock = false; 256 }); 257 } 258 return false; 259 } 260 261 /* 1. ãã¼ã¸å ç§»åã§ã¹ã¯ãã¼ã«ããå¦ç */ 262 $('a').on('click', function () { 263 let href = $(this).attr('href'); 264 let page_transition_flg = isPageTransition(this); 265 if (page_transition_flg === true) { 266 // å¤é¨ãªã³ã¯ã¾ãã¯åä¸ãã¡ã¤ã³ã®å¥ãã¼ã¸ 267 return true; 268 } else { 269 scroll_lock = true; 270 sp_menu_lock = false; 271 $('.keni-gnav_inner').hide(); 272 $('#click-space').css('height', '0'); 273 $('.keni-gnav_btn_icon-close').addClass('keni-gnav_btn_icon-open').removeClass('keni-gnav_btn_icon-close'); 274 // ãããåºå®æ 275 if (0 === shf) { 276 $('.keni-header_wrap').addClass('fixed'); 277 } 278 $(body).css('overflow', 'scroll'); 279 if (href.indexOf('#') >= 0) { 280 href = href.substr(href.indexOf('#')); 281 } 282 return scrollToAnchor(href); 283 } 284 }); 285 286 /** 287 * isPageTransition 288 * ã¯ãªãã¯ããaè¦ç´ ã®href屿§ããã¼ã¸é·ç§»ãããå¤å® 289 * @param this_a_obj 290 * @return true | false 291 */ 292 function isPageTransition(this_a_obj) { 293 let this_location = location.origin + location.pathname; 294 // ã¯ã¨ãªãããå ´åã¯ã¯ã¨ãªã追å 295 if (location.href.indexOf('?') >= 0) { 296 this_location = this_location + location.search; 297 } 298 if (this_location.toLowerCase() !== this_a_obj['href'].split('#')[0].toLowerCase()) { 299 return true; 300 } else { 301 return false; 302 } 303 } 304 305 /* ãã¼ã¸èªã¿è¾¼ã¿æã«ãåçã«è¦ç´ ã®é«ããå¤ããLPãããã¼ããªã
305å ´åã§ãanchorã«å¤ãããå ´åã¢ã³ã«ã¼ã¸ã¹ã¯ãã¼ã«ãã */ 306 if (!$('.keni-lp .keni-header_wrap').length && anchor) { 307 scrollToAnchor(anchor); 308 anchor = null; 309 localStorage.removeItem('anchor'); 310 } 311 312 313 /** 314 * SPã®ã°ãã¼ãã«ã¡ãã¥ã¼ç¨å¦ç 315 */ 316 317 menu = $('.keni-gnav_inner'); 318 body = $(document.body); 319 menuBtn = $('.keni-gnav_btn'); 320 clickSpace = $('#click-space'); 321 menuWidth = menu.outerWidth(); 322 323 $(window).resize(function () { 324 var menuWidth = menu.outerWidth(); 325 }); 326 327 if ($('.keni-gnav').hasClass('keni-gnav-scrolling-touch')) { 328 $('.keni-gnav_inner').css({ 329 '-webkit-overflow-scrolling': 'touch', 330 'overflow-scrolling': 'touch' 331 }); 332 } 333 334 menuBtn.on('click', function () { 335 336 if ($(this).find('span').hasClass('keni-gnav_btn_icon-open')) { 337 sp_menu_lock = true; 338 scroll_top = $(window).scrollTop(); 339 menu.slideDown(); 340 $(this).find('.keni-gnav_btn_icon-open').addClass('keni-gnav_btn_icon-close'); 341 $(this).find('.keni-gnav_btn_icon-open').removeClass('keni-gnav_btn_icon-open'); 342 clickSpace.css({ 343 'width': '100%', 344 'height': '100%' 345 }); 346 $(body).css('overflow', 'hidden'); 347 $('.keni-gnav_inner').css({ 348 'bottom': '0' 349 }); 350 } else { 351 menu.slideUp('fast'); 352 $(this).find('.keni-gnav_btn_icon-close').addClass('keni-gnav_btn_icon-open'); 353 $(this).find('.keni-gnav_btn_icon-close').removeClass('keni-gnav_btn_icon-close'); 354 clickSpace.css({ 355 'width': 0, 356 'height': 0 357 }); 358 $('.keni-container').css({ 359 'position': 'static' 360 }); 361 $(body).css('overflow', 'scroll'); 362 $('.keni-gnav_inner').css({ 363 'bottom': '0' 364 }); 365 $(window).scrollTop(scroll_top); 366 sp_menu_lock = false; 367 scroll_top = 0; 368 } 369 }); 370 371 clickSpace.on('click', function () { 372 menu.slideUp('fast'); 373 menuBtn.find('.keni-gnav_btn_icon-close').addClass('keni-gnav_btn_icon-open'); 374 menuBtn.find('.keni-gnav_btn_icon-close').removeClass('keni-gnav_btn_icon-close'); 375 clickSpace.css({ 376 'width': 0, 377 'height': 0 378 }); 379 $('.keni-container').css({ 380 'position': 'static' 381 }); 382 $('.keni-gnav_inner').css({ 383 'bottom': '0' 384 }); 385 $(window).scrollTop(scroll_top); 386 $(body).css('overflow', 'scroll'); 387 sp_menu_lock = false; 388 scroll_top = 0; 389 }); 390 391 $('.keni-gnav li').has('ul').append('<span class="keni-gnav-child_btn"></span>'); 392 $('.keni-gnav li').has('ul').addClass('keni-gnav-child_btn_icon-open').addClass('fn-gnav-toggle-children'); 393 394 $(document).on('click', '.keni-gnav-child_btn', function () { 395 if ($(this).parent('li').hasClass('keni-gnav-child_btn_icon-open')) { 396 $(this).parent('li').addClass('keni-gnav-child_btn_icon-close'); 397 $(this).parent('li').removeClass('keni-gnav-child_btn_icon-open'); 398 $(this).siblings('li').slideDown(); 399 } else { 400 $(this).parent('li').addClass('keni-gnav-child_btn_icon-open'); 401 $(this).parent('li').removeClass('keni-gnav-child_btn_icon-close'); 402 $(this).siblings('li').slideUp(); 403 } 404 }); 405 406 $(document).on('click', '.btn_share', function () { 407 $(".keni-footer-panel_sns").slideToggle('fast'); 408 }); 409 410 411 /** 412 * PCã®ã°ãã¼ãã«ã¡ãã¥ã¼ç¨å¦ç 413 */ 414 415 hoverIn = function () { 416 $(this).addClass('keni-gnav-child_btn_icon-close'); 417 $(this).removeClass('keni-gnav-child_btn_icon-open'); 418 }; 419 hoverOut = function () { 420 $(this).addClass('keni-gnav-child_btn_icon-open'); 421 $(this).removeClass('keni-gnav-child_btn_icon-close'); 422 }; 423 424 function desktopNav() { 425 if (window.innerWidth > conf.brakepoint.medium) { 426 $('.keni-gnav li').has('ul').hover(hoverIn, hoverOut); 427 } else { 428 $('.keni-gnav li').has('ul').off('mouseenter mouseleave'); 429 } 430 } 431 432 desktopNav(); 433 $(window).resize(function () { 434 desktopNav(); 435 }); 436 437 438 /** 439 * ã¹ã¯ãã¼ã«ã§ãããã¼ã¨ããã¿ã¼ããã«ãåºå® 440 */ 441 442 hdrTop = $('.keni-header_wrap').offset().top; 443 444 function resetPanel() { 445 // ããã«åè¨å® 446 $('.keni-header_wrap').removeClass('fixed'); 447 $('.keni-container').css('padding-top', 0); 448 $('.keni-header_col1 .keni-header_cont').show('fast'); 449 $('.keni-gnav_btn').removeClass('fixed'); 450 $('.keni-footer-panel_wrap').removeClass('fixed-bottom'); 451 $('.keni-container').css('padding-bottom', 0); 452 } 453 454 $(window).on('scroll resize', function () { 455 456 // SPã¡ãã¥ã¼ãéå±éæã«ã®ã¿æ¬åä½ãè¡ãã¾ã 457 if (sp_menu_lock === false) { 458 459 var hdr = $('.keni-header_wrap'), 460 ftrPanel = $('.keni-footer-panel_wrap'), 461 gnavBtn = $('.keni-gnav_btn'), 462 hdrHeight = $('.keni-header_wrap').outerHeight(), 463 ftrPanelHeight = $('.keni-footer-panel_outer').height(); 464 465 if (window.innerWidth < conf.brakepoint.medium) { 466 if ($(window).scrollTop() > hdrTop) { 467 // ãããåºå®æ 468 if (0 === shf) { 469 hdr.addClass('fixed'); 470 $('.keni-container').css('padding-top', hdrHeight); 471 $('.keni-header_col1 .keni-header_cont').hide('fast'); 472 gnavBtn.addClass('fixed'); 473 ftrPanel.addClass('fixed-bottom'); 474 } 475 $('.keni-container').css('padding-bottom', ftrPanelHeight); 476 } else { 477 // ãããåºå®ãããã¿åºå®ï¼éããã¾ã¾ï¼æ 478 if (0 !== lso || 0 === shf) { 479 resetPanel(); 480 } 481 } 482 } else { 483 // ãããåºå®ãããã¿åºå®ï¼éããã¾ã¾ï¼æ 484 if (0 !== lso || 0 === shf) { 485 resetPanel(); 486 } 487 } 488 } 489 }); 490 491 492 /** 493 * ãã¼ãã¸ã¥ã¢ã«ãç»é¢ã®é«ããã£ã±ãã«ãããå ´åã®å¦ç 494 */ 495 496 function lpHeader() { 497 498 var winHeight = $(window).height(),
499 lpHdrHeight = ($('.keni-lp .keni-header_wrap').length) ? $('.keni-lp .keni-header_wrap').height() : 0, 500 lpGnavHeight = ($('.keni-lp .keni-gnav_wrap').length) ? $('.keni-lp .keni-gnav_wrap').height() : 0; 501 502 if (window.innerWidth < conf.brakepoint.medium) { 503 $('.keni-lp .keni-mv_outer').css({ 504 height: (winHeight - lpHdrHeight) + 'px', 505 maxHeight: conf.lp_header.max_height + 'px' 506 }); 507 } else { 508 $('.keni-lp .keni-mv_outer').css({ 509 height: (winHeight - lpHdrHeight - lpGnavHeight) + 'px', 510 maxHeight: conf.lp_header.max_height + 'px' 511 }); 512 } 513 /* è¦ç´ ã®é«ãã»ããå¾ãanchorã«å¤ãããå ´åã¢ã³ã«ã¼ã¸ã¹ã¯ãã¼ã«ãã */ 514 if (anchor) { 515 scrollToAnchor(anchor); 516 anchor = null; 517 localStorage.removeItem('anchor'); 518 } 519 } 520 521 lpHeader(); 522 $(window).resize(function () { 523 lpHeader(); 524 }); 525 526 527 /** 528 * ã¢ã³ã¼ãã£ãªã³ 529 */ 530 531 $('.accordion-list_cont').hide(); 532 $('.accordion-list_btn').css('cursor', 'pointer'); 533 $('.accordion-list_btn').on('click', function () { 534 $(this).next('.accordion-list_cont').slideToggle(); 535 $(this).toggleClass('accordion-list_btn_open'); 536 }); 537 538 539 /** 540 * ã¿ãã¡ãã¥ã¼ 541 */ 542 $('.tab-conts > li').not('.tab-conts li:first-child').hide(); 543 $('.tab-box > .tab-menu > li').on('click', function () { 544 if ($(this).hasClass('tab-menu_select')) { 545 return false; 546 } else { 547 var tabbox = $('.tab-box'), 548 thisTabBox = $(this).closest('.tab-box'), 549 thisTabIndex = $(this).parent().children('li').index(this), 550 thisLength = $(this).closest('.tab-box').index('.tab-box'), 551 tabContsList = tabbox.eq(thisLength).find('.tab-conts > li'); 552 tabContsList.hide(); 553 tabContsList.eq(thisTabIndex).show().addClass('tab-menu_select'); 554 tabbox.eq(thisLength).find('.tab-menu > li').removeClass('tab-menu_select'); 555 $(this).addClass('tab-menu_select'); 556 } 557 }); 558 559 /** 560 * ç®æ¬¡ã®éé 561 */ 562 563 tocList = $('.toc-area_list'); 564 $('.toc-area_btn').on('click', function () { 565 if ($(this).hasClass('toc-area_btn_close')) { 566 $(this).addClass('toc-area_btn_open'); 567 $(this).removeClass('toc-area_btn_close'); 568 tocList.slideUp('fast'); 569 } else { 570 $(this).addClass('toc-area_btn_close'); 571 $(this).removeClass('toc-area_btn_open'); 572 tocList.slideDown(); 573 } 574 }); 575 576 577 /** 578 * SNSãã¿ã³ã®è¨ç½®ã¨ã«ã¦ã³ãæ°ã®åå¾ 579 * åæç¶æ ã§ã¯ãç¾å¨è¡¨ç¤ºããã¦ãããã¼ã¸ã®ã«ã¦ã³ãæ°ãåå¾ãã¾ãã 580 * ãªããã¿ã°ã«data-url屿§ãæå®ãããã¨ã§ç¹å®ã®URLã«ã¤ãã¦ã®ã«ã¦ã³ãæ°ãåå¾ãããã¨ãã§ãã¾ãã 581 * ãã®éãtwitterãã¯ã¦ã¶ã«ã¤ãã¦ã¯ãã¿ã°ã«data-title屿§ã«ã¿ã¤ãã«ãæå®ãã¦ããå¿ è¦ãããã¾ãã 582 * ä¾ï¼ 583 * <div class="sns-btn_fb" data-url="http://example.com/" data-title="EXAMPLE"></div> 584 */ 585 586 pageurl = getCanonicalUrl() || window.location.href; 587 pagetitle = encodeURIComponent(document.title); 588 589 if (false != sns_cnt) { 590 /* X */ 591 $('.sns-btn_x').each(function () { 592 var $count_html, 593 target_url = $(this).data('url') || pageurl, 594 target_title = $(this).data('title') || pagetitle, 595 count = null; 596 $(this).append('<a target="_blank" href="https://x.com/intent/post?url=' + target_url + '&text=' + target_title + '"><i class="fa-brands fa-x-twitter" aria-hidden="true"></i><span></span></a>'); 597 }); 598 /* twitter */ 599 $('.sns-btn_tw').each(function () { 600 var $count_html, 601 target_url = $(this).data('url') || pageurl, 602 target_title = $(this).data('title') || pagetitle; 603 if (typeof twitter_via_text !== "undefined" && twitter_via_text != "") { 604 target_title = target_title + " " + encodeURIComponent(twitter_via_text); 605 } 606 607 target_url = encodeURI(target_url); 608 609 $(this).append('<a target="_blank" href="https://twitter.com/intent/tweet?url=' + target_url + '&text=' + target_title + '"><i class="fab fa-twitter" aria-hidden="true"></i><span>Tweet</span></a>'); 610 }); 611 612 /* facebook */ 613 $('.sns-btn_fb').each(function () { 614 var $count_html, 615 target_url = $(this).attr('data-url') || pageurl, 616 count = null; 617 var enc_target_url = encodeURI(target_url); 618 $(this).append('<a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=' + enc_target_url + '"><i class="fab fa-facebook" aria-hidden="true"></i><span class="count_fb"></span></a>'); 619 $count_html = $(this).find('.count_fb'); 620 var cache_flg = '1'; 621 if (!($('.entry').size())) { 622 cache_flg = '0'; 623 } 624 $.ajax({
625 url: ajaxurl, 626 type: 'post', 627 data: { 628 id: target_url, 629 'action': 'keni_sns_fb', 630 'cache': cache_flg 631 } 632 }) 633 .done(function (data, textStatus, jqXHR) { 634 $count_html.html(data); 635 }).fail(function (a) { 636 console.log(a); 637 $count_html.html(conf.sns.count); 638 }); 639 }); 640 641 /* ã¯ã¦ã */ 642 $('.sns-btn_hatena').each(function () { 643 var $count_html, 644 target_url = $(this).data('url') || pageurl, 645 target_title = $(this).data('title') || pagetitle, 646 count = null; 647 648 $(this).append('<a target="_blank" href="http://b.hatena.ne.jp/add?mode=confirm&url=' + target_url + '&title=' + target_title + '"><i class="f-hatena" aria-hidden="true"></i><span class="count_hatena"></span></a>'); 649 $count_html = $(this).find('.count_hatena'); 650 651 $.ajax({ 652 url: 'https://b.hatena.ne.jp/entry.count', 653 type: 'get', 654 dataType: 'jsonp', 655 data: { 656 url: target_url 657 } 658 }) 659 .done(function (data, textStatus, jqXHR) { 660 count = (typeof (data) === 'undefined' || !data) ? conf.sns.count : Number(data); 661 $count_html.html(count); 662 }) 663 .fail(function () { 664 $count_html.html(conf.sns.count); 665 }); 666 }); 667 } else { 668 /* x */ 669 $('.sns-btn_x').each(function () { 670 var target_url = $(this).data('url') || pageurl, 671 target_title = $(this).data('title') || pagetitle; 672 $(this).append('<a target="_blank" href="https://x.com/intent/post?url=' + target_url + '&text=' + target_title + '"><i class="fa-brands fa-x-twitter" aria-hidden="true"></i><span></span></a>'); 673 }); 674 /* twitter */ 675 $('.sns-btn_tw').each(function () { 676 var target_url = $(this).data('url') || pageurl, 677 target_title = $(this).data('title') || pagetitle; 678 if (typeof twitter_via_text !== "undefined" && twitter_via_text != "") { 679 target_title = target_title + " " + encodeURIComponent(twitter_via_text); 680 } 681 target_url = encodeURI(target_url); 682 683 $(this).append('<a target="_blank" href="https://twitter.com/intent/twwet?url=' + target_url + '&text=' + target_title + '"><i class="fab fa-twitter" aria-hidden="true"></i><span>Tweet</span></a>'); 684 }); 685 686 /* facebook */ 687 $('.sns-btn_fb').each(function () { 688 var target_url = $(this).attr('data-url') || pageurl; 689 var enc_target_url = encodeURI(target_url); 690 $(this).append('<a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=' + enc_target_url + '"><i class="fab fa-facebook" aria-hidden="true"></i></span></a>'); 691 }); 692 693 /* ã¯ã¦ã */ 694 $('.sns-btn_hatena').each(function () { 695 var target_url = $(this).data('url') || pageurl, 696 target_title = $(this).data('title') || pagetitle; 697 698 $(this).append('<a target="_blank" href="http://b.hatena.ne.jp/add?mode=confirm&url=' + target_url + '&title=' + target_title + '"><i class="f-hatena" aria-hidden="true"></i></span></a>'); 699 }); 700 } 701 /* Line */ 702 $('.sns-btn_line').each(function () { 703 var $count_html, 704 target_url = $(this).data('url') || pageurl; 705 706 $(this).append('<a href="http://line.me/R/msg/text/?' + target_url + '\"><i class="fab fa-line"></i><span>LINE</span></a>'); 707 708 }); 709 710 /* Pocket */ 711 $('.sns-btn_pocket').each(function () { 712 var $count_html, 713 target_url = $(this).data('url') || pageurl, 714 target_title = $(this).data('title') || pagetitle; 715 716 $(this).append('<a href="http://getpocket.com/edit?url=' + target_url + '&title=' + target_title + '\" onclick="window.open(this.href, \'PCwindow\', \'width=550, height=350, menubar=no, toolbar=no, scrollbars=yes\'); return false;"><i class="fab fa-get-pocket" aria-hidden="true"></i><span>Pocket</span></a>'); 717 }); 718 719 /** 720 * ã¹ã©ã¤ãã¼ç¨ã®å¦ç 721 * ã¹ã©ã¤ãã¼ã¯ã表示ãããç»åã追å ããã¨èªåçã«ãã®æ°ãå¢ãã¾ãã 722 */ 723 724 function setImgVisible($elems, visiblity) { 725 $elems.each(function (i) { 726 $(this).css("display", visiblity); 727 }); 728 } 729 730 function findSlideImg() { 731 var pcImgs = [], 732 spImgs = [], 733 returnImgs; 734 735 isPc = windowWidth >= 768 ? true : false; 736 737 $slides.find('img').each(function (i) { 738 var $this = $(this); 739 if ($this.hasClass('show-pc')) { 740 pcImgs.push($this); 741 } else if ($this.hasClass('show-sp')) { 742 spImgs.push($this); 743 } else { 744 pcImgs.push($this); 745 spImgs.push($this); 746 } 747 }); 748 749 if (isPc) { 750 setImgVisible($(spImgs), "none"); 751 setImgVisible($(pcImgs), "block"); 752 } else { 753 setImgVisible($(pcImgs), "none"); 754 setImgVisible($(spImgs), "block"); 755 } 756 757 returnImgs = isPc ? $(pcImgs) : returnImgs = $(spImgs); 758 759 return returnImgs; 760 } 761 762 function navUpdate() { 763 $nav.find('a').removeClass('keni-slider-nav_active'); 764 $nav.find('a').eq(current).addClass('keni-slider-nav_active'); 765 } 766 767 function slider(index) { 768 if (index < 0) { 769 index = number - 1; 770 } 771 if (index > number - 1) { 772 index = 0; 773 } 774 $slides.animate({ 775 left: -100 * index + '%' 776 }); 777 current = index; 778 navUpdate(); 779 } 780 781 function timerStop() { 782 clearInterval(start); 783 } 784 785 function timerStart() { 786 timerStop(); 787 var pauseTime = conf.slider.time; 788 if (typeof slider_pause_time !== "undefined" && slider_pause_time > 0) { 789 pauseTime = slider_pause_time; 790 } 791 start = setInterval(function () { 792 slider(current + 1); 793 }, pauseTime); 794 } 795 796 function sliderCreator() { 797 798 if (!slider_lock) { 799 800 timerStop(); 801 802 slider_lock = true; 803 804 $(".keni-slider-pager, .keni-slider-nav").remove(); 805 806 $('.keni-slider_outer').append('<ul class="keni-slider-pager"><li><a href="#" class="keni-slider-pager_prev"></a></li><li><a href="#" class="keni-slider-pager_next"></a></li></ul><div class="keni-slider-nav"></div>'); 807 808 $pager = $('.keni-slider-pager'); 809 $slidesWrap = $('.keni-slider_outer'); 810 $nav = $('.keni-slider-nav'); 811 $slides = $('.keni-slider');
812 $slideImg = $(findSlideImg()); 813 current = 0; 814 number = $slideImg.length; 815 windowWidth = $(window).outerWidth(); 816 817 $slideImg.each(function (i) { 818 if ($(this).height() > ($slidesWrap.height() * 2)) { 819 $(this).css({ 820 'top': '-50%' 821 }); 822 } 823 $(this).css({ 824 left: 100 * i + '%' 825 }); 826 $nav.append('<a href="#"></a>'); 827 }); 828 829 $pager.find('a').on('click', function (event) { 830 timerStop(); 831 event.preventDefault(); 832 if ($(this).hasClass('keni-slider-pager_prev')) { 833 slider(current - 1); 834 } else { 835 slider(current + 1); 836 } 837 timerStart(); 838 }); 839 840 $nav.find('a').on('click', function (event) { 841 timerStop(); 842 event.preventDefault(); 843 var navIndex = $(this).index(); 844 navUpdate(); 845 slider(navIndex); 846 timerStart(); 847 }); 848 849 slider(current); 850 851 timerStart(); 852 853 $slideImg.on({ 854 mouseover: timerStop, 855 mouseout: timerStart 856 }); 857 858 } 859 860 } 861 862 /* setIntervalç¹æã®åé¡ãè§£æ¶ããããã«ããã®ã¦ã£ã³ãã¦ãããã©ã¼ã«ã¹ãã¯ããããsetintervalãã¯ãªã¢ãå度å®è¡ããå¦ç */ 863 $(window).bind('focus', function () { 864 timerStop(); 865 timerStart(); 866 }); 867 868 $(window).resize(function () { 869 var width = $(window).outerWidth(); 870 if ((width >= 768 && !isPc) || (width < 768 && isPc)) { 871 slider_lock = false; 872 sliderCreator(); 873 } 874 }); 875 876 sliderCreator(); 877 878 /** 879 * target="_blank"ã«rel="noopener"ã追å ããå¦ç 880 * rel屿§ã'nofollow'ã®å ´åã¯ä»ä¸ããªã 881 */ 882 $('a[target="_blank"]').each(function () { 883 let getAttr = $(this).attr('rel'); 884 if (typeof getAttr != 'undefined') { 885 if (getAttr.match(/nofollow/)) { 886 return; 887 } else { 888 $(this).attr('rel', 'noopener'); 889 } 890 } else { 891 $(this).attr('rel', 'noopener'); 892 } 893 }); 894 const headElm = document.getElementsByTagName('head'); 895 let fontAwesomeStr = document.createElement('link'); 896 fontAwesomeStr.rel = 'stylesheet'; 897 fontAwesomeStr.href = 'https://use.fontawesome.com/releases/v6.6.0/css/all.css'; 898 headElm.item(0).appendChild(fontAwesomeStr); 899}(jQuery));
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.