PageSourceSearch

https://www.aeon.info/wp-content/themes/aeon_corp/_assets/_common/js/common.js

js aeon.info collected 2026-09-24 08:39:48 UTC 32,564 bytes, 1,136 lines download raw bytes

1var aeonComponent = aeonComponent || {};
2
3(function(window, $, undefined) {
4  $.extend($.expr[':'], {
5    _focusable: function(element, hasTabindex) {
6      var map,
7        mapName,
8        img,
9        focusableIfVisible,
10        fieldset,
11        nodeName = element.nodeName.toLowerCase();
12
13      var visible = function(element) {
14        var visibility = element.css('visibility');
15        while (visibility === 'inherit') {
16          element = element.parent();
17          visibility = element.css('visibility');
18        }
19        return visibility !== 'hidden';
20      };
21
22      if ('area' === nodeName) {
23        map = element.parentNode;
24        mapName = map.name;
25        if (!element.href || !mapName || map.nodeName.toLowerCase() !== 'map') {
26          return false;
27        }
28        img = $("img[usemap='#" + mapName + "']");
29        return img.length > 0 && img.is(':visible');
30      }
31
32      if (/^(input|select|textarea|button|object)$/.test(nodeName)) {
33        focusableIfVisible = !element.disabled;
34
35        if (focusableIfVisible) {
36          // Form controls within a disabled fieldset are disabled.
37          // However, controls within the fieldset's legend do not get disabled.
38          // Since controls generally aren't placed inside legends, we skip
39          // this portion of the check.
40          fieldset = $(element).closest('fieldset')[0];
41          if (fieldset) {
42            focusableIfVisible = !fieldset.disabled;
43          }
44        }
45      } else if ('a' === nodeName) {
46        focusableIfVisible = element.href || hasTabindex;
47      } else {
48        focusableIfVisible = hasTabindex;
49      }
50
51      return (
52        focusableIfVisible && $(element).is(':visible') && visible($(element))
53      );
54    }
55  });
56})(this, jQuery);
57
58// init
59(function(window, $, undefined) {
60  'use strict';
61  aeonComponent = aeonComponent || {};
62  var initList = [];
63  var readyList = [];
64
65  aeonComponent.init = {
66    initSet: function(func) {
67      if (func && {}.toString.call(func) === '[object Function]') {
68        initList.push(func);
69      }
70    },
71    readySet: function(func) {
72      if (func && {}.toString.call(func) === '[object Function]') {
73        readyList.push(func);
74      }
75    },
76    initRun: function() {
77      for (var i = 0; i < initList.length; i++) {
78        if (initList[i]) {
79          initList[i]();
80        }
81      }
82    },
83    readyRun: function() {
84      for (var i = 0; i < initList.length; i++) {
85        if (readyList[i]) {
86          readyList[i]();
87        }
88      }
89    }
90  };
91})(this, jQuery);
92
93// component id
94(function(window, $, undefined) {
95  'use strict';
96  aeonComponent = aeonComponent || {};
97  var getUniqueStr = function() {
98    return (
99      new Date().getTime().toString(16) +
100      Math.floor(1000 * Math.random()).toString(16)
101    );
102  };
103  aeonComponent.getComponentId = function(name) {
104    return 'componentid_' + name + '-' + getUniqueStr();
105  };
106})(this, jQuery);
107
108// ua
109(function(window, $, undefined) {
110  'use strict';
111
112  aeonComponent = aeonComponent || {};
113  aeonComponent.ua = {};
114
115  var ua = aeonComponent.ua;
116  ua.name = window.navigator.userAgent.toLowerCase();
117
118  ua.isIE = ua.name.indexOf('msie') >= 0 || ua.name.indexOf('trident') >= 0;
119  ua.isiPhone = ua.name.indexOf('iphone') >= 0;
120  ua.isiPod = ua.name.indexOf('ipod') >= 0;
121  ua.isiPad = ua.name.indexOf('ipad') >= 0;
122  ua.isiOS = ua.isiPhone || ua.isiPod || ua.isiPad;
123  ua.isAndroid = ua.name.indexOf('android') >= 0;
124  ua.isTablet = ua.isiPad || (ua.isAndroid && ua.name.indexOf('mobile') == -1);
125  ua.isMobile =
126    ua.isiPhone || (ua.isAndroid && ua.name.indexOf('mobile') != -1);
127
128  if (ua.isIE) {
129    ua.verArray = /(msie|rv:?)\s?([0-9]{1,})([\.0-9]{1,})/.exec(ua.name);
130    if (ua.verArray) ua.ver = parseInt(ua.verArray[2], 10);
131  }
132  if (ua.isiOS) {
133    ua.verArray = /(os)\s([0-9]{1,})([\_0-9]{1,})/.exec(ua.name);
134    if (ua.verArray) ua.ver = parseInt(ua.verArray[2], 10);
135  }
136  if (ua.isAndroid) {
137    ua.verArray = /(android)\s([0-9]{1,})([\.0-9]{1,})/.exec(ua.name);
138    if (ua.verArray) ua.ver = parseInt(ua.verArray[2], 10);
139  }
140
141  aeonComponent.init.initSet(function() {
142    if (ua.isIE) {
143      $('html').addClass('ie isIE' + ua.ver);
144    }
145    if (ua.isiPhone) {
146      $('html').addClass('iPhone');
147    }
148    if (ua.isiPod) {
149      $('html').addClass('iPod');
150    }
151    if (ua.isiPad) {
152      $('html').addClass('iPad');
153    }
154    if (ua.isiOS) {
155      //$('html').addClass('iOS iOS_' + ua.ver);
156      $('html').addClass('iOS');
157    }
158    if (ua.isAndroid) {
159      //$('html').addClass('android android_' + ua.ver);
160      $('html').addClass('android');
161    }
162    if (ua.isTablet) {
163      $('html').addClass('isTablet');
164    } else if (ua.isMobile) {
165      $('html').addClass('isMobileDevice');
166    } else {
167      $('html').addClass('isOtherDevice');
168    }
169  });
170})(this, jQuery);
171
172//resize
173(function(window, $, undefined) {
174  'use strict';
175
176  aeonComponent = aeonComponent || {};
177
178  var setList = {};
179
180  aeonComponent.resize = {};
181  aeonComponent.resize.sizeCheck = function() {
182    var size;
183    if (window.matchMedia) {
184      if (window.matchMedia('(min-width:768px)').matches) {
185        return 'L';
186      } else {
187        return 'M';
188      }
189    } else {
190      if ($(window).width() >= 768) {
191        // PC
192        return 'L';
193      } else {
194        return 'M';
195      }
196    }
197  };
198
199  aeonComponent.resize.setResizeFunc = function(size, id, func) {
200    if (!setList[size]) {
201      setList[size] = [];
202    }
203    if (id && (func && {}.toString.call(func) === '[object Function]')) {
204      setList[size].push({
205        id: id,
206        func: func
207      });
208    }
209  };
210
211  aeonComponent.resize.deleteResizeFunc = function(size, id) {
212    if (setList[size]) {
213      for (var i = 0; i < setList[size].length; i++) {
214        if (setList[size][i].id === id) {
215          setList[size].splice(i, 1);
216          break;
217        }
218      }
219    }
220  };
221
222  aeonComponent.resize.setResizeFunc('l', 'gnav', function() {
223    $('#global-header')
224      .removeClass('is-open')
225      .removeClass('is-open-before');
226    $('html').removeClass('is-gnavOpen');
227    $('.js-gnav_item')
228      .removeClass('is-active')
229      .removeClass('is-active-before');
230  });
231
232  aeonComponent.resize.changeSize = function() {
233    if (aeonComponent.resize.sizeCheck() == 'M') {
234      if (setList['m']) {
235        for (var i = 0; i < setList['m'].length; i++) {
236          setList['m'][i].func();
237        }
238      }
239    } else {
240      if (setList['l']) {
241        for (var i = 0; i < setList['l'].length; i++) {
242          setList['l'][i].func();
243        }
244      }
245    }
246  };
247
248  aeonComponent.init.initSet(aeonComponent.resize.changeSize);
249  aeonComponent.init.initSet(function() {
250    if (window.matchMedia) {
251      window
252        .matchMedia('(max-width:768px)')
253        .addListener(function(mediaQueryList) {
254          aeonComponent.resize.changeSize();
255        });
256    } else {
257      var winSize = aeonComponent.resize.sizeCheck();
258      $(window).on('resize', function() {
259        var _winSize = sizeCheck();
260        if (winSize !== _winSize) {
261          winSize = _winSize;
262          aeonComponent.resize.changeSize();
263        }
264      });
265    }
266  });
267})(this, jQuery);
268
269// gnav
270(function(window, $, undefined) {
271  'use strict';
272  
273  $(function() {
274    var $gnav = $('.js-gnav');
275    
276    $gnav.find('.js-gnav_item').each(function(itemIndex) {
277      $(this).find('.js-gnav_button').attr({
278        'role': 'button',
279        'aria-expanded': 'false',
280        'aria-controls': 'gnav_contents_' + itemIndex
281      });
282      $(this).find('.js-gnav_contents').attr({
283        'id': 'gnav_contents_' + itemIndex,
284        'aria-hidden': 'true'
285      });
286    });
287  });
288  
289  $(document).on('mouseenter focusin', '.js-gnav_item', function(e) {
290    if (
291      aeonComponent.resize.sizeCheck() === 'M' ||
292      (aeonComponent.resize.sizeCheck() === 'L' &&
293        $('html').hasClass('isTablet'))
294    )
295      return;
296
297    var $this = $(this);
298    clearTimeout($this.data('mouseOutTimer'));
299    
300    var timer = setTimeout(function() {
301      $('.js-gnav').find('.js-gnav_button').attr({
302        'aria-expanded': 'false'
303      });
304      $('.js-gnav').find('.js-gnav_contents').attr({
305        'aria-hidden': 'true'
306      });
307      $this.find('.js-gnav_button').attr({
308        'aria-expanded': 'true'
309      });
310      $this.find('.js-gnav_contents').attr({
311        'aria-hidden': 'false'
312      });
313      
314      $('.js-gnav').find('.js-gnav_contents').removeClass('is-active');
315      $this.addClass('is-active');
316    }, 250);
317    
318    $(this).data('mouseInTimer', timer);
319  });
320
321  $(document).on('mouseleave focusout', '.js-gnav_item', function(e) {
322    if (
323      aeonComponent.resize.sizeCheck() === 'M' ||
324      (aeonComponent.resize.sizeCheck() === 'L' &&
325        $('html').hasClass('isTablet'))
326    )
327      return;
328
329    var $this = $(this);
330    clearTimeout($this.data('mouseInTimer'));
331    
332    var timer = setTimeout(function() {
333      $this.find('.js-gnav_button').attr({
334        'aria-expanded': 'false'
335      });
336      $this.find('.js-gnav_contents').attr({
337        'aria-hidden': 'true'
338      });
339      $this.removeClass('is-active');
340    }, 250);
341    $(this).data('mouseOutTimer', timer);
342  });
343
344  $(document).on('click', '.js-gnav_button', function(e) {
345    var $this = $(this);
346    var $gnavItem = $this.closest('.js-gnav_item');
347    if (aeonComponent.resize.sizeCheck() !== 'L') {
348      // sp
349      e.preventDefault();
350      if ($gnavItem.hasClass('is-active')) {
351        $gnavItem.removeClass('is-active-before');
352        $gnavItem
353          .find('.js-gnav_contents')
354          .slideUp(500, 'easeOutQuart', function() {
355            $gnavItem.removeClass('is-active');
356            $(this).css({
357              display: ''
358            });
359            $gnavItem.find('.js-gnav_button').attr({
360              'aria-expanded': 'false'
361            });
362            $gnavItem.find('.js-gnav_contents').attr({
363              'aria-hidden': 'true'
364            });
365          });
366      } else {
367        $gnavItem.addClass('is-active-before');
368        $gnavItem
369          .find('.js-gnav_contents')
370          .slideDown(500, 'easeOutQuart', function() {
371            $gnavItem.addClass('is-active');
372            $(this).css({
373              display: ''
374            });
375            $gnavItem.find('.js-gnav_button').attr({
376              'aria-expanded': 'true'
377            });
378            $gnavItem.find('.js-gnav_contents').attr({
379              'aria-hidden': 'false'
380            });
381          });
382      }
383    } else if (
384      aeonComponent.resize.sizeCheck() === 'L' &&
385      $('html').hasClass('isTablet')
386    ) {
387      // tab
388      e.preventDefault();
389      if ($gnavItem.hasClass('is-active')) {
390        $gnavItem
391          .removeClass('is-active')
392          .removeClass('is-active-before');
393        $gnavItem.find('.js-gnav_button').attr({
394          'aria-expanded': 'false'
395        });
396        $gnavItem.find('.js-gnav_contents').attr({
397          'aria-hidden': 'true'
398        });
399        $(document).off('.gnav');
400      } else {
401        $gnavItem
402          .addClass('is-active')
403          .addClass('is-active-before');
404          
405        $('.js-gnav').find('.js-gnav_button').attr({
406          'aria-expanded': 'false'
407        });
408        $('.js-gnav').find('.js-gnav_contents').attr({
409          'aria-hidden': 'true'
410        });
411        $gnavItem.find('.js-gnav_button').attr({
412          'aria-expanded': 'true'
413        });
414        $gnavItem.find('.js-gnav_contents').attr({
415          'aria-hidden': 'false'
416        });
417        $(document).on('click.gnav touchend.gnav', function(e) {
418          if (!$.contains($gnavItem[0], e.target)) {
419            $gnavItem.removeClass('is-active').removeClass('is-active-before');
420            $().off(e);
421          }
422        });
423      }
424    } else {
425      // pc
426    }
427  });
428
429
430
431  // sp gnav
432  function gnavClose() {
433    $('#global-header').removeClass('is-open');
434    setTimeout(function() {
435      $('#global-header').removeClass('is-open-before');
436      $('html').removeClass('is-gnavOpen');
437      $('.js-gnav').find('.js-gnav_item')
438        .removeClass('is-active')
439        .removeClass('is-active-before');
440      $('.js-gnav').find('.js-gnav_button').attr({
441        'aria-expanded': 'false'
442      });
443      $('.js-gnav').find('.js-gnav_contents').attr({
444        'aria-hidden': 'true'
445      });
446      $('.js-gnav_btn').attr({
447        'aria-expanded': 'false'
448      });
449    }, 600);
450  }
451  function gnavOpen() {
452    $('#global-header').addClass('is-open-before');
453    $('html').addClass('is-gnavOpen');
454    setTimeout(function() {
455      $('#global-header').addClass('is-open');
456      $('.js-gnav_btn').attr({
457        'aria-expanded': 'true'
458      });
459    }, 10);
460  }
461  $(document).on('click', '.js-gnav_btn', function(e) {
462    e.preventDefault();
463    if ($('#global-header').hasClass('is-open')) {
464      gnavClose();
465    } else {
466      gnavOpen();
467    }
468  });
469
470  $(document).on('click', '.js-gnav_overlay', function(e) {
471    e.preventDefault();
472    gnavClose();
473  });
474  $(document).on('click', '.js-gnav_btnclose', function(e) {
475    e.preventDefault();
476    gnavClose();
477  });
478})(this, jQuery);
479
480// other
481(function(window, $, undefined) {
482  $(function() {
483    // anchor link
484    $(document).on('click', '.js-aclink[href^="#"]', function(e) {
485      e.preventDefault();
486      var speed = 800;
487      var href = $(this).attr('href');
488      var target = $(href == '#' || href == '' ? 'html' : href);
489      if (target[0]) {
490        var position = target.offset().top;
491        $('html, body').animate({ scrollTop: position }, speed, 'easeOutCubic');
492      }
493    });
494
495    // tel link
496    if (aeonComponent.ua.isMobile) {
497      $('.tel-link').each(function() {
498        var str = $(this).text();
499        $(this).html(
500          $('<a>')
501            .attr('href', 'tel:' + str.replace(/-/g, ''))
502            .append(str + '</a>')
503        );
504      });
505    }
506
507    var pagetop = $('.pagetop');
508    $(window).scroll(function() {
509      if ($(this).scrollTop() > 100) {
510        pagetop.fadeIn();
511        pagetop.addClass('is-fixed');
512      } else {
513        pagetop.fadeOut();
514        pagetop.removeClass('is-fixed');
515      }
516    });
517    pagetop.click(function() {
518      $('body, html').animate({ scrollTop: 0 }, 500);
519      return false;
520    });
521  });
522})(this, jQuery);
523
524$(function() {
525  var $parent = $('.js-anim-parent'),
526    $child = $parent.children();
527  $single = $('.js-anim');
528
529  $parent.each(function() {
530    $(this)
531      .find($child)
532      .each(function(i) {
533        eachInView($(this), i, 150, 'parent');
534      });
535  });
536  eachInView($single, 1, 0);
537
538  function eachInView($point, i, $delaySpeed) {
539    $point.on('inview', function(event, isInView, visiblePartX, visiblePartY) {
540      if (isInView) {
541        // if (visiblePartY == 'top') {
542        // 順に表示されるよう調整
543        $(this)
544          .delay(i * $delaySpeed)
545          .queue(function() {
546            var $target = $(this);
547            $target
548              .stop()
549              .addClass('is-animated')
550              .dequeue();
551            if ($delaySpeed != 0) {
552              setTimeout(function() {
553                $target.find('.js-anim-delay').removeClass('js-anim-delay');
554              }, 1500);
555            }
556          });
557        // }
558      }
559    });
560  }
561
562  ////////////// コンポーネント系で追加
563
564  //リンクに画像が含まれていたらclass付与(微妙)
565  var linkImg = $('#wrap-container a').find('img');
566  if ($(linkImg)) {
567    $(linkImg)
568      .parents('a')
569      .addClass('noticon');
570  } else {
571  }
572});
573
574// toggle
575(function(window, $, undefined) {
576  'use strict';
577  aeonComponent = aeonComponent || {};
578  aeonComponent.toggle = {
579    ready: function() {
580      $('.js-toggle').each(function() {
581        if ($(this).hasClass('component-initialized')) return;
582
583        var target = $(this).attr('aria-controls');
584
585        if ($('#' + target)[0]) {
586          if ($(this).attr('aria-expanded') === 'true') {
587            $('#' + target).attr('aria-hidden', 'false');
588          } else {
589            $('#' + target).attr('aria-hidden', 'true');
590          }
591
592          if (
593            $(this).attr('data-toggle-sp') &&
594            $(this).attr('data-toggle-sp') === 'true'
595          ) {
596            if (aeonComponent.resize.sizeCheck() === 'L') {
597              $(this).attr('aria-expanded', 'true');
598              $('#' + target).attr('aria-hidden', 'false');
599            }
600          }
601        }
602
603        var uniqueId = aeonComponent.getComponentId('toggle');
604        $(this).addClass(uniqueId);
605        $(this).addClass('component-initialized');
606        aeonComponent.toggle.items.push({
607          id: uniqueId
608        });
609      });
610    },
611    items: []
612  };
613
614  aeonComponent.resize.setResizeFunc('l', 'toggle', function() {
615    $('.js-toggle').each(function() {
616      var target = $(this).attr('aria-controls');
617      if ($('#' + target)[0]) {
618        if (
619          $(this).attr('data-toggle-sp') &&
620          $(this).attr('data-toggle-sp') === 'true'
621        ) {
622          $(this).attr('aria-expanded', 'true');
623          $('#' + target).attr('aria-hidden', 'false');
624        }
625      }
626    });
627  });
628  aeonComponent.resize.setResizeFunc('m', 'toggle', function() {});
629
630  aeonComponent.init.initSet(function() {
631    $(document).on('click', '.js-toggle', function(e) {
632      e.preventDefault();
633      var target = $(this).attr('aria-controls');
634      if (
635        $(this).attr('data-toggle-sp') &&
636        $(this).attr('data-toggle-sp') === 'true'
637      ) {
638        if (aeonComponent.resize.sizeCheck() !== 'M') return;
639      }
640      if ($('#' + target)[0]) {
641        if ($(this).attr('aria-expanded') === 'true') {
642          $(this).attr('aria-expanded', 'false');
643          $('#' + target).attr('aria-hidden', 'true');
644        } else {
645          $(this).attr('aria-expanded', 'true');
646          $('#' + target).attr('aria-hidden', 'false');
647
648          if ($(this).attr('data-focus') === 'true') {
649            $('#' + target).find(':_focusable').eq(0).focus();
650          }
651        }
652      }
653    });
654  });
655  aeonComponent.init.readySet(aeonComponent.toggle.ready);
656})(this, jQuery);
657
658// slider
659(function(window, $, undefined) {
660  'use strict';
661
662  aeonComponent = aeonComponent || {};
663  aeonComponent.slider = {
664    ready: function() {
665      $('.js-slider').each(function(index) {
666        if ($(this).hasClass('component-initialized')) return;
667        
668        var $box = $(this).closest('.cp-slider_container');
669        var config = {
670          arrows: true,
671          dots: true,
672          infinite: true,
673          autoplay: true,
674          autoplaySpeed: 5000
675        };
676        var afterConfig = new Function(
677          'return ' + $(this).attr('data-slider-config')
678        )();
679        var setConfig = $.extend({}, config, afterConfig);
680
681        if ($(this).find('.slider-box').length >= 2) {
682          $box.append('<div class="slick-controls-area p-sus-slick-controls"></div>');
683          
684          $box.find('.slick-controls-area').append('<div class="slick-controls_wrap">\
685            <button class="slick-stop slick-control"><span class="invisible">stop</span></button>\
686            <button class="slick-play slick-control"><span class="invisible">play</span></button>\
687          </div>');
688          
689          if (setConfig.autoplay) {
690            $box.find('.slick-controls-area').find('.slick-stop').addClass('is-active');
691          } else {
692            $box.find('.slick-controls-area').find('.slick-play').addClass('is-active');
693          }
694          
695          if (setConfig.dots) {
696            $box.find('.slick-controls-area').append('<div class="slick-dots_wrap"></div>');
697            setConfig.appendDots = $box.find('.slick-dots_wrap');
698          }
699        }
700
701        var slider = $(this)
702          .find('.slider_list')
703          .slick(setConfig);
704          
705        $box.find('.slick-stop').on('click', function(e) {
706          e.preventDefault();
707          $(this).removeClass('is-active');
708          $box.find('.slick-play').addClass('is-active');
709          slider.slick('slickPause');
710        });
711        $box.find('.slick-play').on('click', function(e) {
712          e.preventDefault();
713          $(this).removeClass('is-active');
714          $box.find('.slick-stop').addClass('is-active');
715          slider.slick('slickPlay');
716        });
717        
718        var uniqueId = aeonComponent.getComponentId('slider');
719        $(this).addClass(uniqueId);
720        $(this).addClass('component-initialized');
721        aeonComponent.slider.items.push({
722          slider: slider,
723          id: uniqueId
724        });
725      });
726    },
727    items: []
728  };
729
730  aeonComponent.init.readySet(aeonComponent.slider.ready);
731})(this, jQuery);
732
733// select filter
734(function(window, $, undefined) {
735  'use strict';
736
737  var filterChange = function() {
738    var $wrap = $(this).closest('.js-filter');
739    var value = $wrap.find('.js-filter-select').val();
740
741    if (value === 'all') {
742      $wrap.find('.js-filter-content').attr('aria-hidden', 'false');
743    } else {
744      $wrap.find('.js-filter-content').attr('aria-hidden', 'true');
745      $wrap
746        .find('.js-filter-content[data-year="' + value + '"]')
747        .attr('aria-hidden', 'false');
748    }
749  };
750
751  aeonComponent = aeonComponent || {};
752  aeonComponent.selectFilter = {
753    ready: function() {
754      $('.js-filter').each(function(index) {
755        if ($(this).hasClass('component-initialized')) return;
756        filterChange.call(this);
757
758        var uniqueId = aeonComponent.getComponentId('selectFilter');
759        $(this).addClass(uniqueId);
760        $(this).addClass('component-initialized');
761        aeonComponent.selectFilter.items.push({
762          id: uniqueId
763        });
764      });
765    },
766    items: []
767  };
768
769  aeonComponent.init.initSet(function() {
770    $(document).on('click', '.js-filter-submit', function(e) {
771      e.preventDefault();
772      filterChange.call(this);
773    });
774  });
775  aeonComponent.init.readySet(aeonComponent.selectFilter.ready);
776})(this, jQuery);
777
778(function(window, $, undefined) {
779  aeonComponent.init.initRun();
780
781  $(function() {
782    aeonComponent.init.readyRun();
783  });
784})(this, jQuery);
785
786// tab
787(function(window, $, undefined) {
788  'use strict';
789  aeonComponent = aeonComponent || {};
790  
791  var keys = {
792    end: 35,
793    home: 36,
794    left: 37,
795    up: 38,
796    right: 39,
797    down: 40,
798    delete: 46
799  };
800
801  var direction = {
802    37: -1,
803    38: -1,
804    39: 1,
805    40: 1
806  };
807  
808  aeonComponent.tab = {
809    ready: function() {
810      $('.js-tabs').each(function() {
811        if ($(this).hasClass('component-initialized')) return;
812      
813        var $tabwrap = $(this);
814        var $tablist = $(this).find('[role="tablist"]');
815        var $tabs = $(this).find('[role="tab"]');
816        var $panels = $(this).find('[role="tabpanel"]');
817        var focused;
818        var setFocus;
819        var delay = 150;
820      
821        $tabs.each(function(index) {
822          this.index = index;
823        });
824      
825        var determineOrientation = function(e) {
826          var key = e.keyCode;
827          var proceed = false;
828      
829          if (
830            key === keys.left ||
831            key === keys.right ||
832            key === keys.up ||
833            key === keys.down
834          ) {
835            e.preventDefault();
836            proceed = true;
837          }
838      
839          if (proceed) {
840            switchTabOnArrowPress(e);
841          }
842        };
843      
844        var switchTabOnArrowPress = function(e) {
845          var pressed = e.keyCode;
846      
847          $tabs.on('focus', focusEventHandler);
848      
849          if (direction[pressed]) {
850            var target = e.target;
851            if (target.index !== undefined) {
852              if ($tabs.eq(target.index + direction[pressed])[0]) {
853                $tabs.eq(target.index + direction[pressed]).focus();
854              } else if (pressed === keys.left || pressed === keys.up) {
855                focusLastTab();
856              } else if (pressed === keys.right || pressed == keys.down) {
857                focusFirstTab();
858              }
859            }
860          }
861        };
862      
863        var deactivateTabs = function() {
864          $tabs.attr('tabindex', '-1');
865          $tabs.attr('aria-selected', 'false');
866          $tabs.off('focus', focusEventHandler);
867          $panels.attr('aria-hidden', 'true');
868        };
869      
870        var activateTab = function($tab, setFocus) {
871          setFocus = setFocus || true;
872          deactivateTabs();
873      
874          $tab.removeAttr('tabindex');
875          $tab.attr('aria-selected', 'true');
876          $tabwrap
877            .find('#' + $tab.attr('aria-controls'))
878            .attr('aria-hidden', 'false');
879      
880          if (setFocus) {
881            $tab.focus();
882          }
883          
884          if (aeonComponent.resize.sizeCheck() === 'M') {
885            $tabwrap.find('.js-tabs-sp-toggle').trigger('click');
886          }
887        };
888        
889        var focusedTab = function($tab) {
890          $tabs.attr('tabindex', '-1');
891          $tabs.off('focus', focusEventHandler);
892          $tab.removeAttr('tabindex');
893          $tab.focus();
894        };
895      
896        var focusFirstTab = function() {
897          $tabs.eq(0).focus();
898        };
899        var focusLastTab = function() {
900          $tabs.eq($tabs.length - 1).focus();
901        };
902      
903        var focusEventHandler = function(e) {
904          var target = e.target;
905          setTimeout(checkTabFocus, delay, target);
906        };
907      
908        var checkTabFocus = function(target) {
909          focused = document.activeElement;
910          if (target === focused) {
911            if (aeonComponent.resize.sizeCheck() === 'M') {
912              focusedTab($(target));
913            } else {
914              activateTab($(target), false);
915            }
916          }
917        };
918      
919        $tabs.on('click', function(e) {
920          e.preventDefault();
921          activateTab($(this), false);
922        });
923      
924        $tabs.on('keydown', function(e) {
925          var key = e.keyCode;
926          switch (key) {
927            case keys.end:
928              e.preventDefault();
929              activateTab($tabs.eq($tabs.length - 1));
930              break;
931            case keys.home:
932              e.preventDefault();
933              activateTab($tabs.eq(0));
934              break;
935            case keys.up:
936            case keys.down:
937              determineOrientation(e);
938              break;
939          }
940        });
941      
942        $tabs.on('keyup', function(e) {
943          var key = e.keyCode;
944          switch (key) {
945            case keys.left:
946            case keys.right:
947              determineOrientation(e);
948              break;
949          }
950        });
951        
952        var uniqueId = aeonComponent.getComponentId('tab');
953        $(this).addClass(uniqueId);
954        $(this).addClass('component-initialized');
955        aeonComponent.tab.items.push({
956          id: uniqueId
957        });
958      });
959    },
960    items: []
961  };
962
963  aeonComponent.init.readySet(aeonComponent.tab.ready);
964})(this, jQuery);
965
966
967
968
969// filter tab
970(function(window, $, undefined) {
971  'use strict';
972  aeonComponent = aeonComponent || {};
973  
974  var keys = {
975    end: 35,
976    home: 36,
977    left: 37,
978    up: 38,
979    right: 39,
980    down: 40,
981    delete: 46
982  };
983
984  var direction = {
985    37: -1,
986    38: -1,
987    39: 1,
988    40: 1
989  };
990  
991  aeonComponent.filterTab = {
992    ready: function() {
993      $('.js-filter-tab').each(function(tabIndex) {
994        if ($(this).hasClass('is-initialized')) return;
995      
996        var $tabwrap = $(this);
997        var $tablist = $(this).find('.js-filter-tab_btns');
998        var $tabs = $(this).find('.js-filter-tab_btn');
999        var $items = $(this).find('.js-filter-tab_item');
1000        var focused;
1001        var delay = 150;
1002
1003        $tabs.each(function(index) {
1004          this.index = index;
1005        });
1006      
1007        var determineOrientation = function(e) {
1008          var key = e.keyCode;
1009          var proceed = false;
1010      
1011          if (
1012            key === keys.left ||
1013            key === keys.right ||
1014            key === keys.up ||
1015            key === keys.down
1016          ) {
1017            e.preventDefault();
1018            proceed = true;
1019          }
1020      
1021          if (proceed) {
1022            switchTabOnArrowPress(e);
1023          }
1024        };
1025      
1026        var switchTabOnArrowPress = function(e) {
1027          var pressed = e.keyCode;
1028      
1029          $tabs.on('focus.focus-filter-tab', focusEventHandler);
1030      
1031          if (direction[pressed]) {
1032            var target = e.target;
1033            if (target.index !== undefined) {
1034              if ($tabs.eq(target.index + direction[pressed])[0]) {
1035                $tabs.eq(target.index + direction[pressed]).focus();
1036              } else if (pressed === keys.left || pressed === keys.up) {
1037                focusLastTab();
1038              } else if (pressed === keys.right || pressed == keys.down) {
1039                focusFirstTab();
1040              }
1041            }
1042          }
1043        };
1044      
1045        var deactivateTabs = function() {
1046          $tabs.attr('aria-selected', 'false');
1047          $tabs.attr('tabindex', '-1');
1048          $tabs.off('.focus-filter-tab', focusEventHandler);
1049        };
1050      
1051        var activateTab = function($tab, setFocus) {
1052          setFocus = setFocus || true;
1053          deactivateTabs();
1054      
1055          $tab.attr('aria-selected', 'true');
1056          $tab.removeAttr('tabindex');
1057
1058          if (setFocus) {
1059            $tab.focus();
1060          }
1061
1062          filterChange($tab.attr('data-filter'));
1063        };
1064
1065        var filterChange = function(filter) {
1066          if (filter === 'all') {
1067            $items.css({display: ''});
1068            $tabwrap.removeClass('is-filter');
1069          } else {
1070            $tabwrap.addClass('is-filter');
1071            $items.hide();
1072            $items.filter('[data-filter="' + filter + '"]').show();
1073          }
1074        };
1075      
1076        var focusFirstTab = function() {
1077          $tabs.eq(0).focus();
1078        };
1079        var focusLastTab = function() {
1080          $tabs.eq($tabs.length - 1).focus();
1081        };
1082      
1083        var focusEventHandler = function(e) {
1084          var target = e.target;
1085          setTimeout(checkTabFocus, delay, target);
1086        };
1087      
1088        var checkTabFocus = function(target) {
1089          focused = document.activeElement;
1090          if (target === focused) {
1091            activateTab($(target), false);
1092          }
1093        };
1094      
1095        $tabs.on('click', function(e) {
1096          e.preventDefault();
1097          activateTab($(this), false);
1098        });
1099      
1100        $tabs.on('keydown', function(e) {
1101          var key = e.keyCode;
1102          switch (key) {
1103            case keys.end:
1104              e.preventDefault();
1105              activateTab($tabs.eq($tabs.length - 1));
1106              break;
1107            case keys.home:
1108              e.preventDefault();
1109              activateTab($tabs.eq(0));
1110              break;
1111            case keys.up:
1112            case keys.down:
1113              determineOrientation(e);
1114              break;
1115          }
1116        });
1117      
1118        $tabs.on('keyup', function(e) {
1119          var key = e.keyCode;
1120          switch (key) {
1121            case keys.left:
1122            case keys.right:
1123              determineOrientation(e);
1124              break;
1125          }
1126        });
1127        
1128        $(this).addClass('is-initialized');
1129
1130        $tabs.filter('[aria-selected="true"]').trigger('click').blur();
1131      });
1132    }
1133  };
1134
1135  aeonComponent.init.readySet(aeonComponent.filterTab.ready);
1136})(this, 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.