1(function($){ 2// ãã¼ã«ã«ã¹ãã¬ã¼ã¸å¤æå¦ç 3var globalModel; 4var localStorage = $.GSTORAGE.switchStorage(); 5 6//翻訳 7var trans_domain = 'honyaku.j-server.com'; 8var target_host = location.host; 9var transFlg = false; 10if ( target_host.indexOf( trans_domain ) > -1 ) { 11 transFlg = true; 12} 13if(location.hostname.includes(trans_domain)){ 14 $('body').addClass('transer_on'); 15} 16 17// Header handle 18// ============================================================================ 19function headerHandler(resetToLayoutDefaultCallback){ 20 const wrapper = $('#tmp_wrapper'); 21 const body = $('body') 22 const header = $('#tmp_wrap_header'); 23 const language = { 24 menu: '#tmp_sma_lang', 25 wrap: '#tmp_hnavi_s .lang_list_inner', 26 inner: '#tmp_hnavi_s .lang_list_inner .lang_list', 27 closeBtn: '#tmp_hnavi_s .lang_wrap .close_btn', 28 loadmoreBtn: '#tmp_hnavi_s .lang_wrap .load_more', 29 minHeight: 560 30 } 31 const classes = { 32 fixed: 'fixed_header', 33 fullLayout: 'full_header', 34 noAnimate: 'no_animate_header' 35 } 36 const activeNaviSelector = '#tmp_hnavi_s ul > li > a.active'; 37 const hnaviSearch = '#tmp_hnavi_search > a'; 38 const paddingRightTargetSelector = '#tmp_header, #tmp_wrap_main, #tmp_footer, #tmp_emergency,#tmp_read_contents > #tmp_main' 39 let backUpScroll = 0; 40 // Handle fixed layout 41 $(window).on('scroll load resize', function(){ 42 const _scrollT = $(window).scrollTop(); 43 header.css({ 'left': -$(window).scrollLeft(), 'width': 'auto' }); 44 handlePaddingTopWrapper(); 45 if (_scrollT > header.outerHeight()) { 46 switchToFixedLayout() 47 } else { 48 leaveFixedLayout() 49 } 50 setTimeout(handlePaddingTopWrapper,150) 51 }); 52 53 function handlePaddingTopWrapper(){ 54 wrapper.css({'padding-top': header.find('#tmp_gnavi').outerHeight() + header.find('#tmp_header').outerHeight()}) 55 } 56 57 function switchToFixedLayout(){
58 if (wrapper.hasClass(classes.fixed)) return; 59 wrapper.addClass(classes.fixed) 60 header.css({ 61 paddingBottom: 0 62 }); 63 } 64 65 function leaveFixedLayout(){ 66 if ($(window).scrollTop() > header.outerHeight()) return; 67 if (wrapper.hasClass(classes.fixed)) { 68 wrapper.removeClass(classes.fixed); 69 } 70 if (!body.hasClass(classes.fullLayout)){ 71 header.css({ 72 paddingBottom: header.find('#tmp_gnavi').outerHeight() 73 }); 74 } 75 } 76 77 // Handle full height resize layout 78 $(window).on('resize', function(){ 79 handleMaxHeightFullLayout() 80 setTimeout(() => { 81 checkAndSwitchToFullLayout() 82 calculateLanguageMaxHeight() 83 },150) 84 }) 85 86 // Handle language height 87 $(window).on('resize load', calculateLanguageMaxHeight) 88 $(language.menu).on('click', '.load_more', function(){ 89 checkAndSwitchToFullLayout() 90 }) 91 $(hnaviSearch).off('click.hnaviSeacrh').on('click.hnaviSeacrh', function(){ 92 checkAndSwitchToFullLayout(); 93 }) 94 95 function handleMaxHeightFullLayout(){ 96 const _activeNavi = $(activeNaviSelector).next(); 97 const _targetNaviHeight = _activeNavi.find('.lang_wrap').length ? _activeNavi.find('.lang_wrap') : _activeNavi
98 if (body.hasClass(classes.fullLayout)){ 99 _targetNaviHeight.css('max-height', window.innerHeight - _activeNavi.position().top) 100 }else{ 101 _targetNaviHeight.css('max-height', '') 102 } 103 } 104 105 function checkAndSwitchToFullLayout(){ 106 if (checkFullLayout()){ 107 if (!body.hasClass(classes.fullLayout)){ 108 backUpScroll = window.scrollY 109 body.addClass(classes.fullLayout) 110 } 111 let _barWidth = getScrollbarWidth() 112 if (_barWidth <= 0) _barWidth = '' 113 handleMaxHeightFullLayout() 114 $(paddingRightTargetSelector).css('padding-right', _barWidth); 115 if ($('#tmp_sma_search').hasClass('wrap_sma_sch active') && $('#tmp_sma_search').outerHeight() >= $('#tmp_sma_search').children().outerHeight()){ 116 $('#tmp_sma_search').css('padding-right', _barWidth); 117 } 118 }else{ 119 switchToDefaulLayout() 120 } 121 if ($(activeNaviSelector).next().find('.lang_wrap').length){ 122 calculateLanguageMaxHeight() 123 } 124 } 125 126 function switchToDefaulLayout(){ 127 if (body.hasClass(classes.fullLayout)) { 128 body.removeClass(classes.fullLayout) 129 window.scrollTo(window.scrollX, backUpScroll) 130 } 131 $(paddingRightTargetSelector).css('padding-right','') 132 $('#tmp_sma_search').css('padding-right', ''); 133 if (typeof resetToLayoutDefaultCallback === 'function') resetToLayoutDefaultCallback() 134 leaveFixedLayout() 135 } 136 137 function checkFullLayout(){ 138 const _activeNavi = $(activeNaviSelector).next() 139 if (_activeNavi.attr('id') === 'tmp_sma_lang' && globalModel === 'pc') return false; 140 if (_activeNavi.attr('id') === 'tmp_sma_search' && globalModel === 'pc') return true 141 const _old = _activeNavi.css('max-height') 142 let _activeNaviHeight = _activeNavi.outerHeight() 143 if (!_activeNavi.position()) return; 144 if (_old){ 145 _activeNavi.css('max-height','') 146 _activeNaviHeight = _activeNavi.outerHeight() 147 _activeNavi.css('max-height', _old) 148 } 149 return _activeNavi.position().top + _activeNaviHeight > window.innerHeight 150 } 151 152 function resetMaxHeight(){ 153 $('#tmp_sma_lang .lang_wrap,#tmp_hnavi_search .wrap_sma_sch').css('max-height', '') 154 } 155 156 function calculateLanguageMaxHeight(){ 157 const _inner = $(language.inner) 158 const _innerOuterHeight = (globalModel === 'sp') ? _inner.outerHeight() : Math.min(language.minHeight, _inner.outerHeight()) 159 const _closeBtnHeight = $(language.closeBtn).outerHeight() + $(language.loadmoreBtn).outerHeight() 160 const _menuTop = $(language.menu).position().top 161 if (_menuTop + _innerOuterHeight + _closeBtnHeight > window.innerHeight){ 162 $(language.wrap).css('max-height', window.innerHeight - _menuTop - _closeBtnHeight) 163 }else{ 164 $(language.wrap).css('max-height', '') 165 } 166 } 167 168 function getScrollbarWidth() { 169 var outer = document.createElement('div'); 170 outer.style.visibility = 'hidden'; 171 outer.style.overflow = 'scroll'; 172 outer.style.msOverflowStyle = 'scrollbar'; 173 document.body.appendChild(outer); 174 var inner = document.createElement('div'); 175 outer.appendChild(inner); 176 var scrollbarWidth = (outer.offsetWidth - inner.offsetWidth); 177 outer.parentNode.removeChild(outer); 178 179 return scrollbarWidth; 180 } 181 return { 182 checkAndSwitchToFullLayout: checkAndSwitchToFullLayout, 183 switchToDefaulLayout: switchToDefaulLayout, 184 resetMaxHeight: resetMaxHeight, 185 switchToFixedLayout: switchToFixedLayout, 186 disableAnimation: function(){
187 wrapper.addClass(classes.noAnimate) 188 }, 189 enableAnimation: function(){ 190 wrapper.removeClass(classes.noAnimate) 191 } 192 } 193} 194const header_handler = headerHandler(); 195 196// gnaviSplide 197var active_index = 0; 198var gnaviSplideObj 199if($('#tmp_gnavi_splide .splide__list').find('.active_this').length){ 200 var active_index = $('#tmp_gnavi_splide .splide__list').find('.active_this').parent().index(); 201} 202var gnaviSplide = new $.GFUNC.splideLayout({ 203 parentSplide: '#tmp_gnavi_splide', 204 itemSplide: '.splide__slide', 205 useStopControl: false, 206 excludeMode: 'pc', 207 splideSettings: { 208 type: 'slide', 209 perPage: 1, 210 perMove: 1, 211 gap: 0, 212 start: active_index, 213 rewind: false, 214 pagination: false, 215 autoplay: false, 216 autoWidth: true, 217 omitEnd: true, 218 }, 219 breakpointsModel: { 220 sp: 640, 221 }, 222 onEventSplide: function(splide) { 223 gnaviSplideObj = splide 224 splide.on('mounted', function() { 225 var touchStartX = 0, 226 touchUpX = 0, 227 preventMovement = 5, 228 detect_click = true; 229 function touch_handle(upX, startX, pM) { 230 if ((upX - startX) > pM || (upX - startX) < -pM) { 231 detect_click = false; 232 } else { 233 detect_click = true; 234 } 235 } 236 $(splide.Components.Elements.slides).each(function() { 237 var selfItem = $(this); 238 selfItem.on({ 239 'touchstart.touchSlide': function(event) { 240 touchStartX = event.originalEvent.changedTouches[0].pageX; 241 }, 242 'touchend.touchSlide': function(event) { 243 touchUpX = event.originalEvent.changedTouches[0].pageX; 244 touch_handle(touchUpX, touchStartX, preventMovement); 245 if(detect_click) window.location.href = selfItem.find('a').attr('href'); 246 }, 247 }); 248 }); 249 }); 250 splide.on('move mounted', function() { 251 var end = splide.Components.Controller.getEnd(); 252 var idx = splide.Components.Controller.getIndex(); 253 if(idx === 0) { 254 $(splide.Components.Arrows.arrows.prev).attr('tabindex', -1); 255 $(splide.Components.Arrows.arrows.prev).parent().addClass('disabled'); 256 $(splide.Components.Arrows.arrows.next).attr('tabindex', 0); 257 $(splide.Components.Arrows.arrows.next).parent().removeClass('disabled'); 258 }else if(end === idx) { 259 $(splide.Components.Arrows.arrows.prev).attr('tabindex', 0); 260 $(splide.Components.Arrows.arrows.prev).parent().removeClass('disabled'); 261 $(splide.Components.Arrows.arrows.next).attr('tabindex', -1); 262 $(splide.Components.Arrows.arrows.next).parent().addClass('disabled'); 263 }else { 264 $(splide.Components.Arrows.arrows.prev).attr('tabindex', 0); 265 $(splide.Components.Arrows.arrows.next).attr('tabindex', 0); 266 $(splide.Components.Arrows.arrows.prev).parent().removeClass('disabled'); 267 $(splide.Components.Arrows.arrows.next).parent().removeClass('disabled'); 268 } 269 }); 270 var timeout; 271 splide.on('mounted resized move', function() { 272 var _splides = $(splide.Components.Elements.slides); 273 if(timeout) clearTimeout(timeout); 274 timeout = setTimeout(function() { 275 _splides.each(function() { 276 var _self = $(this); 277 _self.attr('tabindex', '-1'); 278 _self.find('a').removeAttr('tabindex') 279 }) 280 }); 281 _splides.find('a').each(function() { 282 var _self = $(this); 283 _self.off('keyup.setTranslate') 284 _self.on('keyup.setTranslate', function(e) { 285 var _idx = _splides.find('a').index(_self); 286 var _pos = splide.Components.Move.toPosition(_idx, true); 287 splide.Components.Move.translate(_pos); 288 }) 289 }) 290 }) 291 } 292}); 293 294// notice - ward 295function updateProgressSplide(splide) { 296 var parent = splide.root; 297 var controlDiv = $(parent).find('.splide__controls'); 298 if(!controlDiv.find('.splide__progress').length) controlDiv.append('<div class="splide__progress"><p class="progress_current"><span class="hidden_txt">表示ä¸ã®ã¹ã©ã¤ã</span><span class="num_txt">1</span></p><p class="progress_total"><span class="hidden_txt">ã¹ã©ã¤ãã®ææ°</span><span class="num_txt">'+$(parent).find('.splide__slide').length+'</span></p></div>') 299 var end = splide.Components.Controller.getEnd() + 1; 300 var rate = splide.index + 1; 301 controlDiv.find('.splide__progress .progress_current .num_txt').text(rate); 302 controlDiv.find('.splide__progress .progress_total .num_txt').text(end); 303} 304var optionsNoticeSlide = { 305 parentSplide: '#tmp_notice_carousel', 306 itemSplide: '.splide__slide', 307 useStopControl: true, 308 splideSettings: { 309 gap: 25, 310 drag: true, 311 perPage: 1, 312 padding: 0,
313 type: 'loop', 314 arrows: true, 315 autoplay: false, 316 pagination: false, 317 breakpoints: { 318 640: { 319 gap: 20, 320 perPage: 1, 321 } 322 } 323 }, 324 locationArrows:{ 325 prev: { 326 insertTarget: '#tmp_notice_carousel .splide__controls', 327 insertMethod: 'prepend' 328 }, 329 next: { 330 insertTarget: '#tmp_notice_carousel .splide__controls', 331 insertMethod: 'prepend' 332 } 333 }, 334 onEventSplide: function(splide){ 335 splide.on('mounted resized move', function() { 336 updateProgressSplide(splide); 337 }); 338 } 339} 340 341// koho splide 342var kohoRelatedCarousel = new $.GFUNC.splideLayout({ 343 parentSplide: '#tmp_koho_related_splide.splide', 344 itemSplide: '.splide__slide', 345 useStopControl: true, 346 excludeMode: 'pc', 347 splideSettings: { 348 gap: 18, 349 drag: true, 350 perPage: 1, 351 padding: {left: 10, right: 55}, 352 type: 'loop', 353 arrows: true, 354 autoplay: false, 355 pagination: false, 356 autoWidth: true, 357 breakpoints: { 358 640: { 359 gap: 19, 360 perPage: 1, 361 } 362 } 363 }, 364 locationArrows:{ 365 prev: { 366 insertTarget: '#tmp_koho_related_splide .splide__controls', 367 insertMethod: 'prepend' 368 }, 369 next: { 370 insertTarget: '#tmp_koho_related_splide .splide__controls', 371 insertMethod: 'append' 372 } 373 }, 374 onEventSplide: function(splide){ 375 splide.on('mounted resized move', function() { 376 updateProgressSplide(splide); 377 }); 378 } 379}); 380var kohoRecommededCarousel = new $.GFUNC.splideLayout({ 381 parentSplide: '#tmp_recommended_movie_splide.splide', 382 itemSplide: '.splide__slide', 383 useStopControl: true, 384 splideSettings: { 385 gap: 37, 386 drag: true, 387 perPage: 1, 388 padding: 10, 389 type: 'loop', 390 arrows: true, 391 autoplay: false, 392 pagination: false, 393 autoWidth: true, 394 breakpoints: { 395 640: { 396 gap: 18, 397 perPage: 1, 398 padding: {left: 10, right: 54}, 399 } 400 } 401 }, 402 locationArrows:{ 403 prev: { 404 pc: { 405 insertTarget: '#tmp_recommended_movie_splide .splide__controls', 406 insertMethod: 'prepend' 407 }, 408 sp: { 409 insertTarget: '#tmp_recommended_movie_splide .splide__controls', 410 insertMethod: 'prepend' 411 } 412 }, 413 next: { 414 pc: { 415 insertTarget: '#tmp_recommended_movie_splide .splide__controls', 416 insertMethod: 'prepend' 417 }, 418 sp: { 419 insertTarget: '#tmp_recommended_movie_splide .splide__controls', 420 insertMethod: 'append' 421 } 422 } 423 }, 424 onEventSplide: function(splide){ 425 splide.on('mounted resized move', function() { 426 updateProgressSplide(splide); 427 }); 428 splide.on('resize resized', function() { 429 var _idx = splide.Components.Controller.getIndex(); 430 var _trf = splide.Components.Move.toPosition(_idx); 431 $('#tmp_recommended_movie_splide .splide__list').css('transition','') 432 splide.Components.Move.translate(_trf); 433 }); 434 } 435}); 436var noticeCarousel = new $.GFUNC.splideLayout(optionsNoticeSlide); 437var knowWardCarousel = new $.GFUNC.splideLayout({ 438 parentSplide: '#tmp_know_ward_splide', 439 itemSplide: '.splide__slide', 440 useStopControl: true, 441 splideSettings: { 442 gap: 25, 443 drag: true, 444 perPage: 5, 445 padding: 0, 446 type: 'loop', 447 arrows: true, 448 autoplay: false, 449 pagination: false, 450 breakpoints: { 451 640: { 452 gap: 20, 453 perPage: 1, 454 // padding: '17.57%' 455 } 456 } 457 }, 458 centerArrows: { 459 targetReference: '.model_sp #tmp_know_ward_splide .ward_slide img', 460 selectorCss: 'CHILD' 461 }, 462 locationArrows:{ 463 prev: { 464 insertTarget: '#tmp_know_ward_splide .splide__controls', 465 insertMethod: 'prepend' 466 }, 467 next: { 468 insertTarget: '#tmp_know_ward_splide .splide__controls', 469 insertMethod: 'prepend' 470 } 471 }, 472 onEventSplide: function(splide){ 473 splide.on('mounted resized move', function() { 474 updateProgressSplide(splide); 475 }); 476 } 477}); 478 479// general splide 480var generalSplide = new $.GFUNC.splideLayout({ 481 parentSplide: '#tmp_general_visual .splide', 482 itemSplide: '.splide__slide', 483 useStopControl: true, 484 splideSettings: { 485 gap: 0, 486 drag: true, 487 perPage: 1, 488 padding: '20%', 489 focus: 'center', 490 type: 'loop', 491 arrows: true, 492 autoplay: false, 493 pagination: false, 494 breakpoints: { 495 1100: { 496 gap: 10, 497 padding: '15%', 498 }, 499 900: { 500 gap: 10, 501 padding: '10%', 502 }, 503 640: { 504 gap: 10, 505 padding: 0, 506 perPage: 1, 507 } 508 } 509 }, 510 locationArrows:{ 511 prev: { 512 pc:{ 513 insertTarget: '#tmp_general_visual .splide__controls', 514 insertMethod: 'prepend' 515 }, 516 sp: { 517 insertTarget: '#tmp_general_visual .splide', 518 insertMethod: 'prepend' 519 } 520 }, 521 next: { 522 pc:{ 523 insertTarget: '#tmp_general_visual .splide__controls', 524 insertMethod: 'prepend' 525 }, 526 sp: { 527 insertTarget: '#tmp_general_visual .splide', 528 insertMethod: 'prepend' 529 } 530 } 531 }, 532 onEventSplide: function(splide){ 533 splide.on('mounted resized move', function() { 534 updateProgressSplide(splide); 535 }); 536 } 537}); 538 539// event-top splide 540var eventTopRelatedSplide = new $.GFUNC.splideLayout({ 541 parentSplide: '#tmp_event_search_related_bnr .splide', 542 itemSplide: '.splide__slide', 543 useStopControl: true, 544 splideSettings: { 545 gap: 0, 546 drag: false, 547 perPage: 50, 548 padding: 0,
549 type: 'loop', 550 arrows: false, 551 autoplay: false, 552 pagination: false, 553 breakpoints: { 554 640: { 555 type: 'loop', 556 drag: true, 557 perPage: 1, 558 gap: 0, 559 padding: 0, 560 arrows: true, 561 pagination: false, 562 } 563 } 564 }, 565 locationArrows:{ 566 prev: { 567 pc:{ 568 insertTarget: '#tmp_event_search_related_bnr .splide__controls', 569 insertMethod: 'prepend' 570 }, 571 sp: { 572 insertTarget: '#tmp_event_search_related_bnr .splide', 573 insertMethod: 'prepend' 574 } 575 }, 576 next: { 577 pc:{ 578 insertTarget: '#tmp_event_search_related_bnr .splide__controls', 579 insertMethod: 'prepend' 580 }, 581 sp: { 582 insertTarget: '#tmp_event_search_related_bnr .splide', 583 insertMethod: 'prepend' 584 } 585 } 586 }, 587 onEventSplide: function(splide){ 588 splide.on('mounted resized move', function() { 589 updateProgressSplide(splide); 590 }); 591 } 592}); 593 594 595$.GFUNC.changeColor({ 596 switchClass: 'switch', 597}); 598// ç®æ¬¡ 599$.GFUNC.tableOfContents({ 600 wrapper : '#tmp_anchor', 601 ttl : '#tmp_anchor .anchor_ttl p', 602 area : '#tmp_anchor .anchor_cnt', 603 extract : '#tmp_contents h2', 604 position : '#tmp_contents h1', 605 type : 'ul', 606 num: 2 607}); 608$.GFUNC.tableOfContents({ 609 wrapper : '#tmp_koho_free #tmp_anchor', 610 ttl : '#tmp_anchor .anchor_ttl p', 611 area : '#tmp_anchor .anchor_cnt', 612 extract : '#tmp_contents h2', 613 position : '#tmp_cate_ttl', 614 type : 'ul', 615 num: 2 616}); 617 618// ãç¥ããä¸è¦§çµã込㿠619var seachCategory = $.GFUNC.seachCategory({ 620 parent: '#tmp_contents', 621 selectTarget: '#tmp_seach_cate', 622 listTarget: '.information_tbl', 623 listItem: 'tr', 624 cateClass: 'info_label', 625 showNoCateSelect: false, 626}); 627seachCategory.init(); 628 629function handleScrollAnchorOnLoad() { 630 var uri = new $.GFUNC.uriObj(); 631 if(uri.fragment.length > 0){ 632 $.GFUNC.anchorScrollOnLoad({ 633 target: '#'+uri.fragment, 634 optionFixed: ['#tmp_wrap_header'], 635 speed: 300, 636 }) 637 } 638} 639handleScrollAnchorOnLoad(); 640 641// ============================================================================ 642// ãã¬ã¤ã¯ãã¤ã³ããã¨ã®å¦ç 643$.GMAIN = function(model){ 644 globalModel = model; 645 $.GFUNC.elemMove($.GSET.MOVE_ELEM,model); //è¦ç´ ç§»å 646 if($('#tmp_event_cal_7w').length){ 647 $.GFUNC.spExTableFunc({ 648 spExTable : $('#tmp_contents .event_cal_7w').not('table .event_cal_7w') 649 }); //ã¹ã¯ãã¼ã«ãã¼ãã« 650 } 651 if(!$('body').hasClass('custom_genre_list')){ 652 $.GFUNC.spExTableFunc(); //ã¹ã¯ãã¼ã«ãã¼ãã« 653 } else{ 654 $.GFUNC.spExTableFunc({ 655 contentWidth : 875, 656 spExTable : $('#tmp_contents .datatable').not('table .datatable') 657 }); //ã¹ã¯ãã¼ã«ãã¼ãã« 658 } 659 660 // gnaviSplide 661 if (gnaviSplide.active) gnaviSplide.resize(model); 662 if (noticeCarousel.active) noticeCarousel.resize(model); 663 if (knowWardCarousel.active) knowWardCarousel.resize(model); 664 if (generalSplide.active) generalSplide.resize(model); 665 if (eventTopRelatedSplide.active) eventTopRelatedSplide.resize(model); 666 if (kohoRelatedCarousel.active) kohoRelatedCarousel.resize(model); 667 if (kohoRecommededCarousel.active) kohoRecommededCarousel.resize(model); 668 669 //handle active gnavi slide 670 activeGnavi(); 671 // menu accordion shisetsu 672 $.GFUNC.accordionMenuFlex({ 673 mm: model, 674 proc: 'pc,sp', 675 acSwitch: '.shisetsu_cate_ttl', 676 acCnt: '.shisetsu_cate_cnt', 677 area: '#tmp_facilities_btn .shisetsu_cnavi_wrap', 678 activeClass: 'ac_active', 679 autoAppendCloseBtn: false, 680 column: { 681 pc: 4, 682 sp: 2 683 } 684 }) 685 686 $.GFUNC.searchPlaceholder({ 687 set: [{ 688 area:'#tmp_search_gomi , #tmp_event_calendar_search_txt', 689 backgroundProperty: '', 690 focusBackgroundProperty: '#ffffff', 691 placeholderTxt: "ãã¼ã¯ã¼ããå ¥åãã¦ãã ãã", 692 placeholderIndent: 10 693 }] 694 }); 695 696}; 697 698//ããã¬ã¤ã¯ãã¤ã³ããã¨ã®å¦ç end 699//ã============================================================================ 700//ãç»é¢ãã¼ãæã«ä¸åº¦ã®ã¿å¦ç 701 702 $.GFUNC.modelChange(); //PC/ã¹ããåãæ¿ã 703 $.GFUNC.MATCHMEDIA(); //ãã¬ã¤ã¯ãã¤ã³ãã®å¦ç 704 $.GFUNC.flexHeight(); //ããã¯ã¹ã®é«ãåãã 705 $.GFUNC.eventRecruitChange(); //ã¤ãã³ãåéä¸åãæ¿ã 706 707 $('#tmp_event_wrapper .event_date .time').each(function() { 708 if ($(this).text() === 'åå¾0æ') { 709 $(this).text('æ£å'); 710 } 711 }); 712 713 // ããªã¢ããªã¼æ½è¨ èªã¿ä¸ãå¯¾å¿ 714 $('#tmp_shisetsu_wrapper .barrier_free_cnt li').each(function() { 715 var barrieFreeText = $(this).text(); 716 if (barrieFreeText) { 717 var ariaLabel = $(this).text().trim(); 718 $(this).attr('aria-label', ariaLabel); 719 } 720 }); 721 722 //ã¹ããã¡ãã¥ã¼è¨å® 723 $.GFUNC.spMenu({ 724 menuBtn: [{ 725 slideEffect: true, 726 oBtn: '#tmp_hnavi_language > a', //ã¡ãã¥ã¼ãã¿ã³ 727 target: '#tmp_sma_lang', //å±éããã¡ãã¥ã¼ 728 changeText: true, 729 oTxt: 'Language',
730 cTxt: 'éãã', 731 customClass: 'lang_menu', 732 clickOverlay: false, 733 setOverflow: false, 734 isCloseFocusOut: true, 735 beforeCloseCallback: header_handler.switchToDefaulLayout, 736 openCallback: header_handler.checkAndSwitchToFullLayout, 737 closeCallback: header_handler.resetMaxHeight 738 },{ 739 slideEffect: true, 740 oBtn: '#tmp_hnavi_setting > a', //ã¡ãã¥ã¼ãã¿ã³ 741 target: '#tmp_sma_setting', //å±éããã¡ãã¥ã¼ 742 changeText: true, 743 oTxt: 'é²è¦§ãµãã¼ã', 744 cTxt: 'éãã', 745 customClass: 'setting_menu', 746 clickOverlay: false, 747 setOverflow: false, 748 isCloseFocusOut: true, 749 },{ 750 slideEffect: true, 751 oBtn: '#tmp_hnavi_search > a', //ã¡ãã¥ã¼ãã¿ã³ 752 target: '#tmp_sma_search', //å±éããã¡ãã¥ã¼ 753 changeText: true, 754 oTxt: 'æ¤ç´¢ã»ã¡ãã¥ã¼', 755 cTxt: 'éãã', 756 customClass: 'sch_menu', 757 parentWrap: '#tmp_header #tmp_hnavi_search', 758 additionParentWrap: $('#tmp_sma_search'), 759 clickOverlay: true, 760 setOverflow: false, 761 isCloseFocusOut: true, 762 beforeOpenCallback: function(){ 763 header_handler.disableAnimation() 764 header_handler.switchToFixedLayout() 765 }, 766 beforeCloseCallback: header_handler.switchToDefaulLayout, 767 openCallback: header_handler.checkAndSwitchToFullLayout, 768 closeCallback: function(){ 769 header_handler.resetMaxHeight() 770 header_handler.enableAnimation() 771 } 772 }], 773 closeBtn: '.close_btn a', //éãããã¿ã³ 774 addClass: 'spmenu_open', //bodyã«ä»ä¸ããã¯ã©ã¹(ä¸è¦ã®å ´å空ã«ãã) 775 activeClass : 'active', 776 }); 777 //multilingualObj 778 $.GFUNC.multilingualObj(); 779 // Trigger click setting 780 $('#tmp_sma_setting .setting_furigana > a, #tmp_sma_setting .setting_speaker > a').off('click.clickSetting').on('click.clickSetting', function(e) { 781 triggerCloseMenu('#tmp_hnavi_setting > a'); 782 }) 783 // Handle trigger close menu 784 function triggerCloseMenu(selector){ 785 if($(selector).hasClass('active')){ 786 $(selector)[0].click() 787 } 788 } 789 790 $.GFUNC.textSize(); 791 $.GFUNC.changeStyle(); //æåãµã¤ãºã»è²åã夿´ 792 $.GFUNC.activeLink(); //ã¢ã¯ãã£ããªã³ã¯ 793 $.GFUNC.smoothScroll({ //ã¢ã³ã«ã¼ã«ããã¹ã¯ãã¼ã«ã¢ãã¡ã¼ã·ã§ã³ 794 set: [{ 795 pageTop: $('.ptop'), //ãã¼ã¸ãããã¸æ»ãï¼åä¸ï¼ 796 anchor: [], 797 }], 798 speed: 250, 799 optionFixed: ["#tmp_wrap_header"], 800 }); 801 $.GFUNC.wideHref({ 802 set: [{ 803 area: '#tmp_special_alert .support_box .support_item_inner' 804 },{ 805 area: '.sec_convenient .convent_item_inner' 806 },{ 807 area: '.sec_know .ward_carousel .ward_slide' 808 },{ 809 area: '.event_pickup .pickup_slide' 810 },{ 811 area: '#tmp_contents .other_item', 812 hoverClass: 'ac_active' 813 },{ 814 area: '#tmp_contents .garbage_link', 815 hoverClass: 'ac_active' 816 },{ 817 area: '#tmp_shisetsu_top .search_cate_menu .link_bnr , #tmp_shisetsu_top .search_cate_menu_tnavi .tnavi_item' 818 },{ 819 area: '.general_icon_col4 .item_box , .general_img_col4 .item_box' 820 },{ 821 area: '#tmp_event_search_related_bnr .bnr_box' 822 },{ 823 area: '#tmp_article_sns .section_sns .sns_item' 824 },{ 825 area: '#tmp_recommended_movie .recommended_item' 826 },{ 827 area: '#tmp_information_area .information_item' 828 },{ 829 area: '#tmp_koho_related_splide .related_item' 830 }] 831 }); 832 833 // 第äºé層以ä¸ã¤ã³ããã¯ã¹ã®æ¦è¦æåé¤å¦ç 834 $('#tmp_idx_details .idx_details_list > li').each(function(){ 835 var txt = $(this).find('.detail_txt').text(); 836 if(txt.length <= 1){ 837 $(this).find('.detail_txt').remove(); 838 } 839 }); 840 841 //ãã£ã¨è¦ã 842 // var readMore = new $.GFUNC.readMore({ 843 // set: [{ 844 // parent: '#tmp_idx_menu .wrap_idx_menu .idx_menu_cnt', 845 // child: 'ul.idx_menu_list li', 846 // target: '.switch_read_more', 847 // hideBtn: false, 848 // startItem: 5, 849 // showFull: true, 850 // scrollWhenLoad: false, 851 // btnCloseHTML: '<div class="switch_read_more"><p><a href="javascript:void(0)">ãã£ã¨è¦ã</a></p></div>' 852 // }] 853 // }); 854 // readMore.init(); 855 $.GFUNC.printBtnObj({ //å°å·ãã¿ã³ 856 set: [{ 857 area: '#tmp_print', 858 txt: 'å°å·', 859 }] 860 }); 861 862 // handle active gnavi slide 863 function activeGnavi(){ 864 var _activeThis = $('#tmp_gnavi_splide .splide__list .active_this') 865 if (!gnaviSplideObj || globalModel !== 'sp' || !_activeThis.length) return; 866 var _activeParent = _activeThis.parent('.splide__slide') 867 var index = getIndexFromLabel(_activeParent.attr('aria-label')) 868 gnaviSplideObj.Components.Move.jump(index) 869 gnaviSplideObj.Components.Controller.go(index) 870 if (!_activeParent.hasClass('active')) _activeParent.addClass('active') 871 function getIndexFromLabel(label){ 872 var _arr = label.split(' ') 873 if (!_arr[0]) return 0; 874 return Number(_arr[0]) - 1 875 } 876 } 877 activeGnavi() 878 879 // Handle hide map_js_off section 880 $('#map_search_js_off').css('display','none') 881 // Ajax Emergency 882 function handleEmergencyAjax() { 883 var _parent = $('#tmp_emergency'); 884 var emergencyArray = [ 885 ['/emergency_info.xml', 'åºããã®ç·æ¥ã®ãç¥ãã'], 886 ['/emergency_jishin.xml', 'å°éæ å ±'], 887 ['/emergency_kisho.xml', 'æ°è±¡æ å ±'], 888 ['/emergency_netchusho.xml', 'ç±ä¸çæ å ±'], 889 ['/important_info.xml', 'éè¦ãªãç¥ãã'], 890 ]; 891 var _urlNotice = '/important_info.xml'; 892 var _htmlEmeCnt = '<div class="emergency_row" id="%idCustom%">' + 893 '<div class="container">' + 894 '<div class="emergency_inner">' + 895 '<div class="emergency_ttl"><p>%title%</p></div>' + 896 '<div class="emergency_cnt">%listCnt%</div>' + 897 '</div>' + 898 '</div>' + 899 '</div>'; 900 var _htmlBuffer = ''; 901 _parent.empty(); 902 903 // éåæãªã¯ã¨ã¹ã 904 var promises = []; 905 for (var i = 0; i < emergencyArray.length; i++) { 906 (function(index) { 907 var _urlXml = emergencyArray[index][0]; 908 var _ttlXml = emergencyArray[index][1]; 909 910 promises.push($.ajax({
911 type: 'GET', 912 url: _urlXml, 913 dataType: 'xml', 914 success: function(data) { 915 if (data) { 916 var _dom = $(data); 917 var _item = _dom.find('item'); 918 if (!_item.length) return; 919 920 var _list = '<ul>'; 921 var _count = 0; 922 _item.each(function() { 923 if (_count >= 5) return false; 924 var _self = $(this); 925 var _url = _self.find('link').text(); 926 var _ttl = _self.find('title').text(); 927 if (_ttl && _url) { 928 _list += `<li><a href="${_url}">${_ttl}</a></li>`; 929 _count++; 930 } 931 }); 932 _list += '</ul>'; 933 934 var _divInsert = _htmlEmeCnt 935 .replace(/%idCustom%/, _urlXml === _urlNotice ? 'tmp_emergency_notice' : '') 936 .replace(/%title%/, _ttlXml) 937 .replace(/%listCnt%/, _list); 938 _htmlBuffer += _divInsert; // ãããã¡ã«è¿½å 939 } 940 }, 941 error: function() { 942 console.error('Error loading data from: ' + _urlXml); 943 } 944 })); 945 })(i); 946 } 947 948 // ãªã¯ã¨ã¹ããå®äºå¾ã«DOMæä½ãå®è¡ 949 $.when.apply($, promises).done(function() { 950 _parent.append(_htmlBuffer); 951 }); 952 } 953 if($('body.format_free #tmp_emergency').length) handleEmergencyAjax(); 954 955 // Ajax Common Top 956 function loadAjaxCommonTop() { 957 var _listObjTop = '.sec_convenient, #tmp_search_keyword'; 958 var _listObjFree = _listObjTop+', .sec_notice .notice_info_cnt, .sec_know .know_intro_banner'; 959 if($('.format_top').length) { 960 insertContentCommon($(_listObjTop)); 961 }else { 962 var _tagTop = $('#tmp_hlogo a'); 963 var _urlTop = _tagTop.attr('href'); 964 var topAjax = new $.GFUNC.readHtml({ 965 url: _urlTop 966 }); 967 topAjax.init(); 968 topAjax.load('body', function(dom) { 969 if(!dom.length) return; 970 if(!$(dom).hasClass('top_judge')) { 971 topAjax = new $.GFUNC.readHtml({ 972 url: _urlTop.replace(/.html/g, '2.html') 973 }); 974 topAjax.init(); 975 topAjax.on('error', handleAjaxError); 976 } 977 // Load dom 978 topAjax.load(_listObjFree, function($dom){ 979 if (!$dom.length) handleAjaxError(); 980 else insertContentCommon($dom) 981 }) 982 }, true); 983 topAjax.on('error', handleAjaxError); 984 }; 985 function insertContentCommon($listDom) { 986 var _learnParent = $('#tmp_learn'); 987 if(_learnParent) _learnParent.empty(); 988 $listDom.each(function() { 989 var _self = $(this); 990 if(_self.is('.sec_convenient')) { // Cate menu 991 $('#tmp_sma_search .article_search_category').after(_self.clone(true)); 992 $('#tmp_sma_search .sec_convenient .sec_title').replaceWith(function() {return '<p class="sec_title">' + $(this).text() + '</p>'}) 993 }else if(_self.is('#tmp_search_keyword')) { // Keyword menu 994 $('#tmp_sma_search .article_search_key .sma_search_row').after(_self); 995 }else { // Content free 996 var _divCol = '<div class="learn_col2"><div class="sec_subtitle"><p>%title%</p></div>%content%</div>'; 997 var _html = _self.prop('outerHTML'); 998 var _content = _divCol.replace(/%content%/, _html); 999 if(_self.is('.notice_info_cnt')) { 1000 _content = _content.replace(/%title%/, 'æ³¨ç®æ å ±'); 1001 _learnParent.prepend(_content); 1002 // Reinit config slide 1003 noticeCarousel = new $.GFUNC.splideLayout(optionsNoticeSlide); 1004 if(noticeCarousel.active) noticeCarousel.resize(globalModel) 1005 }else if(_self.is('.know_intro_banner')) { 1006 _content = _content.replace(/%title%/, 'æä¸¦åºãç¥ã'); 1007 _learnParent.append(_content); 1008 } 1009 } 1010 }) 1011 } 1012 function handleAjaxError() { 1013 $('#tmp_learn').remove(); 1014 } 1015 } 1016 loadAjaxCommonTop() 1017 //======================================== 1018 // Ajax garbage separation top 1019 //======================================== 1020 // if($('body.format_free .box_separation_top').length) loadAjaxSeparationTop(); 1021 function loadAjaxSeparationTop() { 1022 var wrapGarbageEl = '#tmp_not_find'; 1023 var boxAppendEl = '.box_separation_top'; 1024 var separationTop = $('.link_hidden .garbage_separation_top a'); 1025 var separationTopUrl = separationTop.attr('href'); 1026 var garbageTopAjax = new $.GFUNC.readHtml({ 1027 url: separationTopUrl 1028 }); 1029 garbageTopAjax.init(); 1030 garbageTopAjax.load(wrapGarbageEl, function(dom){ 1031 if (!dom.length) $(boxAppendEl).remove(); 1032 else $(boxAppendEl).empty().append($(dom)); 1033 }); 1034 garbageTopAjax.on('error',function(){ 1035 $(boxAppendEl).remove(); 1036 }) 1037 } 1038 //======================================== 1039 // Start Garbage Gomi Search 1040 //======================================== 1041 // XML url 1042 var gomiUrlXML = $('.link_hidden .garbage_xml_url').find('a').attr('href') 1043 // Handle Search Collection 1044 if ($('#tmp_gomisearch_date').length){ 1045 gomi_date_search() 1046 } 1047 function gomi_date_search(){ 1048 var gomiUrlCSV = $('#tmp_shushubi_csv').find('a').attr('href'), 1049 shiftJISUrl = $('#tmp_shushubi_shiftjis').find('a').attr('href'), 1050 _e = new $.GFUNC.customEvent(), 1051 count = 0, 1052 data = [], 1053 dataSyllabary = [], 1054 dataTownName = [], 1055 dataGomi = [], 1056 dataGomiFirst = [], 1057 dataGomiSecond = [], 1058 collect = { 1059 selectElements: $('.placeholders'), 1060 syllabary: $('#tmp_gomisearch_select_syllabary'), 1061 townName: $('#tmp_gomisearch_select_townname'), 1062 placeholder: '鏿ãã¦ãã ãã', 1063 }, 1064 result = { 1065 wrap: $('#tmp_gomisearch_date_result'), 1066 inner: $('#tmp_gomisearch_date_result .date_result_inner') 1067 }; 1068 _e.on('init', load_data_from_CSV); 1069 _e.on('database_inited', init_first_select); 1070 _e.on('first_select_inited', init_second_select); 1071 _e.on('second_select_inited', init_event); 1072 _e.on('first_select_inited', searchInited); 1073 $(window).on('load', searchInited) 1074 _e.trigger('init'); 1075
1076 // first handle 1077 result.wrap.hide(); 1078 collect.selectElements.on('change',function(){ 1079 var _self = $(this); 1080 if(_self.val() === "鏿ãã¦ãã ãã" || _self.val() === '') _self.addClass("active"); 1081 else _self.removeClass("active") 1082 }) 1083 collect.selectElements.trigger("change"); 1084 1085 function searchInited(){ 1086 count++ 1087 if (count !== 2) return 1088 collect.syllabary.trigger('change') 1089 } 1090 1091 function load_data_from_CSV(){ 1092 var garbage_csv = new $.GFUNC.readCSV({ 1093 url : gomiUrlCSV, 1094 sjisUrl: shiftJISUrl 1095 }); 1096 garbage_csv.on('success', function (res) { 1097 if(!res && !res.data && !res.data.length) return; 1098 var _data = res.data; 1099 for (var i = 1; i < _data.length; i++){ 1100 data[i] += _data[i]; 1101 dataSyllabary.push(_data[i][0]); 1102 dataGomi.push({ 1103 syllabary: _data[i][0], 1104 townName: _data[i][1], 1105 kanen: _data[i][2], 1106 hunenSodai: _data[i][3], 1107 bin_kan_pura: _data[i][4], 1108 koshi_pet: _data[i][5], 1109 pdf_txt: _data[i][6], 1110 pdf_url: _data[i][7], 1111 }); 1112 } 1113 _e.trigger('database_inited'); 1114 }); 1115 garbage_csv.on('error', function () { 1116 collect.syllabary.prop('disabled',true).addClass('disabled'); 1117 collect.townName.prop('disabled',true).addClass('disabled'); 1118 }); 1119 garbage_csv.init(); 1120 } 1121 function init_first_select() { 1122 collect.syllabary.html(''); 1123 collect.syllabary.append('<option value="">' + collect.placeholder + '</option>'); 1124 1125 collect.townName.parent().css('opacity','0.7');
1126 collect.townName.prop('disabled','disabled').addClass('disabled'); 1127 1128 var syllabarySelectOptions = Array.from(new Set(dataSyllabary)); 1129 for (var i = 0; i < syllabarySelectOptions.length; i++){ 1130 collect.syllabary.append('<option value="'+ i +'">' + syllabarySelectOptions[i] + '</option>'); 1131 } 1132 _e.trigger('first_select_inited'); 1133 } 1134 function init_second_select(){ 1135 collect.syllabary.on('change',function(){ 1136 result.wrap.stop().slideUp().css('height','auto'); 1137 dataTownName.length = 0; 1138 dataGomiFirst.length = 0; 1139 dataGomiSecond.length = 0; 1140 1141 collect.townName.html(''); 1142 collect.townName.append('<option value="">' + collect.placeholder + '</option>'); 1143 1144 if (collect.syllabary.val() !== ''){ 1145 collect.townName.prop('disabled',false).removeClass('disabled'); 1146 collect.townName.parent().css('opacity',''); 1147 1148 var syllabarySelected = collect.syllabary.val(); 1149 var syllabarySelectedLabel = collect.syllabary.find('option[value='+ syllabarySelected +']').text(); 1150 for (var i = 0; i < dataGomi.length; i++){ 1151 if(dataGomi[i].syllabary === syllabarySelectedLabel){ 1152 dataTownName.push(dataGomi[i].townName); 1153 dataGomiFirst.push(dataGomi[i]); 1154 } 1155 } 1156 var townNameSelectOptions = Array.from(new Set(dataTownName)) 1157 for (var i = 0; i < townNameSelectOptions.length; i++){ 1158 collect.townName.append('<option value="'+ i +'">' + townNameSelectOptions[i] + '</option>'); 1159 } 1160 _e.trigger('second_select_inited'); 1161 }else{ 1162 collect.townName.prop('disabled',true).addClass('disabled'); 1163 collect.townName.parent().css('opacity','0.7'); 1164 } 1165 }) 1166 } 1167 function init_event(){ 1168 collect.townName.on('change',function(){ 1169 if(!(collect.syllabary.val() == '')){ 1170 var townNameSelected = collect.townName.val(); 1171 var townNameSelectedLabel = collect.townName.find('option[value="'+ townNameSelected +'"]').text(); 1172 for (var i = 0; i < dataGomiFirst.length; i++){ 1173 if(dataGomiFirst[i].townName === townNameSelectedLabel){ 1174 dataGomiSecond.push(dataGomiFirst[i]); 1175 } 1176 } 1177 var renderItem; 1178 for (var idx = dataGomiSecond.length - 1 ;idx >= 0; idx--) { 1179 if (dataGomiSecond[idx].townName == townNameSelectedLabel) { 1180 renderItem = dataGomiSecond[idx]; 1181 break; 1182 } 1183 } 1184 render(renderItem) 1185 } 1186 }) 1187 } 1188 function render(renderItem){ 1189 if (!renderItem){ 1190 result.wrap.stop().slideUp().css('height','auto'); 1191 return; 1192 } 1193 var switchShimizuHtml = '', 1194 shimizuTtlHtml = '', 1195 shimizuPfdHtml = ''; 1196 if(renderItem){ 1197 var kanenTxt = renderItem.kanen !== undefined ? renderItem.kanen : '' 1198 var koshi_petTxt = renderItem.koshi_pet !== undefined ? renderItem.koshi_pet : '' 1199 var hunenSodaiTxt = renderItem.hunenSodai !== undefined ? renderItem.hunenSodai : '' 1200 var binTxt = renderItem.bin_kan_pura !== undefined ? renderItem.bin_kan_pura : '' 1201 switchShimizuHtml = 1202 '<tr>' + 1203 '<td>' + 1204 '<div class="gomisearch_date_item">' + 1205 '<p class="label_txt">å¯çãã¿</p>' + 1206 '<p class="value_txt">'+kanenTxt+'</p>' + 1207 '</div>' + 1208 '</td>' + 1209 '<td>' + 1210 '<div class="gomisearch_date_item">' + 1211 '<p class="label_txt">å¤ç´ã»ãããããã«</p>' + 1212 '<p class="value_txt">'+koshi_petTxt+'</p>' + 1213 '</div>' + 1214 '</td>' + 1215 '</tr>' + 1216 '<tr>' + 1217 '<td>' + 1218 '<div class="gomisearch_date_item">' + 1219 '<p class="label_txt">ä¸çãã¿</p>' + 1220 '<p class="value_txt">'+hunenSodaiTxt+'</p>' + 1221 '</div>' + 1222 '</td>' + 1223 '<td>' + 1224 '<div class="gomisearch_date_item">' + 1225 '<p class="label_txt">ã³ãã»ããã»ãã©</p>' + 1226 '<p class="value_txt">'+binTxt+'</p>' + 1227 '</div>' + 1228 '</td>' + 1229 '</tr>' 1230 shimizuTtlHtml = 1231 '<div class="date_result_ttl">' + 1232 '<p>'+renderItem.townName+'</p>' + 1233 '</div>' 1234 if (renderItem.pdf_txt !== undefined && renderItem.pdf_url !== undefined){ 1235 shimizuPfdHtml = 1236 '<ul class="asagaya_list">' + 1237 '<li><a href="'+renderItem.pdf_url+'">'+renderItem.pdf_txt+'</a></li>' + 1238 '</ul>' 1239 } 1240 result.inner.html( 1241 shimizuTtlHtml + 1242 '<table><tbody> '+ 1243 switchShimizuHtml + 1244 '</tbody> '+ 1245 '</table> '+ 1246 shimizuPfdHtml 1247 ); 1248 result.wrap.css('height','auto').slideDown(); 1249 } 1250 } 1251 } 1252 // Handle Search Separation 1253 if ($('#tmp_gomisearch_form').length){ 1254 gomi_key_search() 1255 } 1256 function gomi_key_search() { 1257 var _e = new $.GFUNC.customEvent(), 1258 data = [], 1259 keyword_search, 1260 gomi_search, 1261 box_search = $('#tmp_gomisearch_form'), 1262 input = { 1263 keyword: $('#tmp_search_gomi'), 1264 submit: $('#tmp_gomi_btn') 1265 }, 1266 resultWrap = $('#tmp_gomisearch_date_result'); 1267 resultInner = $('#tmp_gomisearch_date_result .date_result_inner'), 1268 count = 0; 1269 if (box_search.length){ 1270 resultWrap.hide(); 1271 _e.on('init',load_data_from_XML); 1272 _e.on('database_inited',init_filter); 1273 _e.on('filter_inited',init_search_form); 1274 _e.on('filter_inited',init_autocomplete); 1275 _e.on('filter_inited', searchInited); 1276 $(window).on('load', searchInited) 1277 _e.on('render',render_result); 1278 _e.trigger('init'); 1279 } 1280 1281 function searchInited(){
1282 count++ 1283 if (count !== 2) return 1284 $('#tmp_gomi_btn').click() 1285 } 1286 // Load data 1287 function load_data_from_XML() { 1288 $.ajax({ 1289 dataType: 'xml', 1290 url: gomiUrlXML, 1291 success: function(res) { 1292 if(!res) return; 1293 $(res).find('page').each(function(){ 1294 var _self = $(this); 1295 data.push({ 1296 'page_title': _self.find('page_title').text(), 1297 'file_path': _self.find('file_path').text(), 1298 'ruby_title': _self.find('ruby_title').text() 1299 }); 1300 }) 1301 data = data.sort(function(a, b){ 1302 return a['ruby_title'].localeCompare(b['ruby_title'], 'jp'); 1303 }); 1304 _e.trigger('database_inited'); 1305 }, 1306 error: function(){ 1307 resultWrap.remove(); 1308 } 1309 }); 1310 } 1311 function init_filter() { 1312 keyword_search = new $.GFUNC.partialSearch({ 1313 field: 'page_title', 1314 }); 1315 gomi_search = new $.GFUNC.searchAndFilter({ 1316 filters: [keyword_search], 1317 data: data 1318 }); 1319 if (gomi_search.active) { 1320 gomi_search.on('render',function(e){ 1321 _e.trigger('render',e); 1322 }); 1323 gomi_search.init(); 1324 _e.trigger('filter_inited'); 1325 } 1326 } 1327 function init_search_form() { 1328 input.submit.on('click', handle_search_submit); 1329 input.keyword.on('keypress',function(e){ 1330 if (e.which == 13 && !autocomplete.dom.hasClass('focus')){ 1331 handle_search_submit(); 1332 autocomplete.dom.removeClass('active'); 1333 } 1334 }) 1335 } 1336 function handle_search_submit(){ 1337 if (input.keyword.val().trim()) { 1338 keyword_search.setFilter(input.keyword.val()); 1339 gomi_search.render(); 1340 resultWrap.show(); 1341 } else{ 1342 keyword_search.setFilter(''); 1343 gomi_search.render(); 1344 resultWrap.hide(); 1345 } 1346 } 1347 function init_autocomplete(){ 1348 autocomplete = new $.GFUNC.autoComplete({ 1349 data: data, 1350 field : 'page_title', 1351 input: input.keyword, 1352 target: input.keyword.parent() 1353 }); 1354 if (autocomplete.active){ 1355 autocomplete.init(); 1356 } 1357 } 1358 function render_result(e) { 1359 resultInner.html(''); 1360 if(!input.keyword.val().trim()) return; 1361 if(e.data.length > 0) { 1362 var resultListHtml = '<ul class="gomi_result_list">'; 1363 var resultDataSorted = e.data.sort(function(a, b){ 1364 return a['ruby_title'].localeCompare(b['ruby_title'], 'jp'); 1365 }) 1366 for (var i = 0; i < resultDataSorted.length; i++){ 1367 resultListHtml += '<li class="garbage_sch_item">'; 1368 resultListHtml += '<span class="garbage_sch_name"><a href="'+resultDataSorted[i].file_path+'">'+resultDataSorted[i].page_title+'</a></span>'; 1369 resultListHtml += '</li>'; 1370 } 1371 resultListHtml += '</ul>'; 1372 resultInner.append(resultListHtml); 1373 } 1374 resultInner.prepend('<div class="date_result_ttl"><p>ã' + input.keyword.val() + 'ãã®æ¤ç´¢çµæã'+ e.data.length +'ä»¶</p></div>'); 1375 } 1376 } 1377 // Handle Separation Menu 1378 if($('#tmp_garbage_separation_item').length) { 1379 ajaxSeparationMenu(); 1380 } 1381 function ajaxSeparationMenu() { 1382 var wrapIndexList = $('#tmp_garbage_separation_item'); 1383 var data = []; 1384 var initialArray = ({ 1385 'a' : "ã", 1386 'i' : "ã", 1387 'u': 'ã', 1388 'e': 'ã', 1389 'o': 'ã', 1390 'ka': 'ã,ã', 1391 'ki': 'ã,ã', 1392 'ku': 'ã,ã', 1393 'ke': 'ã,ã', 1394 'ko': 'ã,ã', 1395 'sa': 'ã,ã', 1396 'shi': 'ã,ã', 1397 'su': 'ã,ã', 1398 'se': 'ã,ã', 1399 'so': 'ã,ã', 1400 'ta': 'ã,ã ', 1401 'chi': 'ã¡,ã¢', 1402 'tsu': 'ã¤,ã¥', 1403 'te': 'ã¦,ã§', 1404 'to': 'ã¨,ã©', 1405 'na': 'ãª', 1406 'ni': 'ã«', 1407 'nu': 'ã¬', 1408 'ne': 'ã', 1409 'no': 'ã®', 1410 'ha': 'ã¯,ã°,ã±', 1411 'hi': 'ã²,ã³,ã´', 1412 'fu': 'ãµ,ã¶,ã·', 1413 'he': 'ã¸,ã¹,ãº', 1414 'ho': 'ã»,ã¼,ã½', 1415 'ma': 'ã¾', 1416 'mi': 'ã¿', 1417 'mu': 'ã', 1418 'me': 'ã', 1419 'mo': 'ã', 1420 'ya': 'ã', 1421 'yu': 'ã', 1422 'yo': 'ã', 1423 'ra': 'ã', 1424 'ri': 'ã', 1425 'ru': 'ã', 1426 're': 'ã', 1427 'ro': 'ã', 1428 'wa': 'ã', 1429 'wo': 'ã', 1430 'n': 'ã' 1431 }); 1432 wrapIndexList.html(''); 1433 var indexInitial = wrapIndexList.attr('data-initial_idx'); 1434 var correctInitial = initialArray[indexInitial]; 1435 var correctInitialArr = correctInitial ? correctInitial.split(',') : []; 1436 var htmlAppend = '<p class="nocnt">ç¾å¨æ å ±ã¯ããã¾ããã</p>'; 1437 $.ajax({
1438 dataType: 'xml', 1439 url: gomiUrlXML, 1440 success: function(res) { 1441 if(!res) wrapIndexList.append(htmlAppend); 1442 else { 1443 $(res).find('page').each(function(){ 1444 var _self = $(this); 1445 var _rubyTxt = _self.find('ruby_title').text(); 1446 var _firstLetter = _rubyTxt ? _rubyTxt.trim().substring(0,1) : ''; 1447 if(correctInitialArr.indexOf(_firstLetter) !== -1) { 1448 data.push({ 1449 'page_title': _self.find('page_title').text(), 1450 'file_path': _self.find('file_path').text(), 1451 'ruby_title': _rubyTxt, 1452 'disposal_link_title': _self.find('disposal_link_title').text(), 1453 'disposal_link_url': _self.find('disposal_link_url').text() 1454 }); 1455 } 1456 }); 1457 data.sort(function (a, b) { 1458 return $(a).attr('ruby_title').localeCompare($(b).attr('ruby_title'), 'jp'); 1459 }); 1460 addHtml(data); 1461 } 1462 }, 1463 error: function(){ 1464 wrapIndexList.append(htmlAppend); 1465 } 1466 }); 1467 function addHtml($data){ 1468 if ($data.length){ 1469 htmlAppend = '<ul>' 1470 for(var i=0; i< $data.length; i++){ 1471 var elm = $data[i]; 1472 htmlAppend += '<li>'; 1473 htmlAppend += '<div class="sch_separation_inner">'; 1474 htmlAppend += '<p class="sch_separation_name"><a href="'+elm.file_path+'">'+elm.page_title+'</a></p>'; 1475 htmlAppend += '<p class="sch_separation_category"><a href="'+elm.disposal_link_url+'">'+elm.disposal_link_title+'</a></p>'; 1476 htmlAppend += '</div>'; 1477 htmlAppend += '</li>'; 1478 } 1479 htmlAppend += '</ul>'; 1480 } 1481 wrapIndexList.append(htmlAppend); 1482 } 1483 } 1484 //======================================== 1485 // End Garbage Gomi Search 1486 //======================================== 1487 1488 1489//ãç»é¢ãã¼ãæã«ä¸åº¦ã®ã¿å¦ç end 1490//ã============================================================================ 1491//ãç»é¢ãªãµã¤ãºãã¨ã®å¦ç 1492var tx = false; 1493$(window).on('resize', function(){if (tx !== false) {clearTimeout(tx);} tx = setTimeout(function() { 1494}, 150);}); 1495// ç»é¢ãªãµã¤ãºãã¨ã®å¦ç end 1496// ============================================================================ 1497})(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.