PageSourceSearch

https://www.ibuki.tokyo-jinzai.or.jp/Portals/0/js/common.js

js tokyo-jinzai.or.jp collected 2026-10-05 07:33:45 UTC 11,533 bytes, 304 lines download raw bytes

1(function ($) {
2  'use strict';
3  $(function () {
4    /*=============================================
5        global
6    =============================================*/
7    var $body = $('body'),
8      mode = 'pc',
9      view = 'pc',
10      animSpd = 300;
11
12    /*=============================================
13        mode / view
14    =============================================*/
15    // mode
16    if ($body.hasClass('spMode')) {
17      mode = 'sp';
18    } else if ($body.hasClass('tbMode')) {
19      mode = 'sp';
20    }
21    if (mode === 'sp') { } else { }
22
23    // view
24    if ($body.hasClass('spView')) {
25      view = 'sp';
26    }
27    if (view === 'sp') {
28      $('#gNav .tokenMenu .toggleSwitch').append('<span></span>');
29      burgerMotion();
30      $body.spTel({
31        target: '.spTel'
32      });
33    } else {
34      toTopMotion();
35      $('#gNav').append('<span tabindex="0" class="focusedEnd"></span>');
36      $('#gNav .focusedEnd').focusin(function () {
37        $('.tokenMenu li').removeClass('focused');
38        $('.tokenMenu ul').removeClass('focused');
39      });
40      $('.tokenMenu > ul > li > ul > li > a').focusin(function () {
41        $('.tokenMenu > ul > li > ul > li').removeClass('focused');
42        $('.tokenMenu > ul > li > ul > li > ul').removeClass('focused');
43        $('.tokenMenu > ul > li > ul > li > ul > li > ul').removeClass('focused');
44        $(this).next('ul').addClass('focused');
45        $(this).parent('li').addClass('focused');
46      });
47      $('.tokenMenu > ul > li > ul > li > ul > li > a').focusin(function () {
48        $('.tokenMenu > ul > li > ul > li > ul > li > ul').removeClass('focused');
49        $(this).next('ul').addClass('focused');
50      });
51    }
52
53    /*=============================================
54        global function
55    =============================================*/
56    initialize();
57    colorChangeMotion();
58    tableControlMotion();
59    fontsizeChangeMotion();
60    infoAcc();
61    if ($('.randomList')[0]) {
62      shuffleContent($('.randomList'));
63    }
64    /*=============================================
65        megaMenu
66    =============================================*/
67    function megaMenuMotion() {
68      $('#gNav .tokenMenu > ul > li').megaMenu({
69        mode: view,
70        triggerMode: 'hover',
71        pullDown: false,
72        item: '.tokenMenu > ul > li > ul > li > ul > li',
73        overlayPosi: '#skin > header',
74        closeBtn: false,
75        closeTag: '<p><span>close</span></p>',
76        speed: 300,
77        delay: 0,
78        loadDelay: 0,
79        scrollHide: false,
80        existJudg: false
81      });
82    }
83
84    /*=============================================
85        burgerMenu
86    =============================================*/
87    function burgerMotion() {
88      $('#header .headTop,#header .headBottom').wrapAll('<div class="headWrap"></div>');
89      $('#header .headWrap').burgerMenu({
90        toggleSetPosi: '#header .headMiddle > .inner > .left',
91        toggleHTML: '<p><span></span></p>',
92        toggleClass: 'active',
93        close: true,
94        closeSetPosi: '#header .headWrap',
95        closeHTML: '<p><span>閉じる</span></p>',
96        overlay: true,
97        overlaySetPosi: '#skin',
98        navInit: false,
99        speed: 300,
100        moveType: 'default'
101      });
102    }
103
104    /*=============================================
105        toTop
106    =============================================*/
107    function toTopMotion() {
108      $('.pagetop').toTop({
109        showStart: 100,
110        showStyle: { 'position': 'fixed' },
111        fix: true,
112        fixPosi: 'footer',
113        addNum: 0,
114        fixStyle: { 'position': 'absolute' }
115      });
116    }
117
118    /*=============================================
119        matchHeight
120    =============================================*/
121    if ($('.matchHeight')[0]) {
122      $('.matchHeight > *').matchHeight();
123    }
124
125    /*=============================================
126        fontSizeControl
127    =============================================*/
128    function fontsizeChangeMotion() {
129      if ($('#fontSizer')[0]) {
130        $('#fontSizer').fontsizeChange({
131          defaultSize: 0,
132          target: 'body',
133          activeClass: 'active',
134          defaultClass: 'defaultFont',
135          cookieExpires: 30,
136          onAfter: function () { }
137        });
138      }
139    }
140
141    /*=============================================
142        SmoothScroll
143    =============================================*/
144    $('a[href*="#"]:not([href="#"]):not(.noSmooth):not([href*="TabModule"])').smoothScroll({
145      speed: animSpd,
146      fix: false,
147      fixItem: '#header'
148    });
149
150    /*=============================================
151      scroll table
152    =============================================*/
153    function tableControlMotion() {
154      var target = '.scrollTable',
155        wrap = 'scrollWrap',
156        activeClass = 'active';
157      if ($(target)[0]) {
158        $(target).each(function () {
159          var $this = $(this);
160          if (!$this.closest('.' + wrap)[0]) {
161            $this.attr('tabindex', '0');
162            $this.wrap('<div class="' + wrap + '"></div>');
163          }
164          if ($this.find('tr').innerWidth() > window.innerWidth) {
165            $this.closest('.' + wrap).removeClass(activeClass);
166          }
167        });
168      }
169    }
170
171    /*=============================================
172      colorControl
173    =============================================*/
174    function colorChangeMotion() {
175      if ($('.headUtility .colorChange')[0]) {
176        if ($.cookie('bgColor')) {
177          var cookie = $.cookie('bgColor');
178          $('body').addClass($.cookie('bgColor'));
179          $('.colorChange > li.' + cookie).addClass('active');
180        } else {
181          $('body').addClass('colorW');
182          $('.colorChange > li.colorW').addClass('active');
183          $.cookie('bgColor', 'colorW', { path: '/', expires: 1 });
184        }
185        $('.colorChange > li').on('click', function () {
186          colorChangeExe(this);
187        }).keypress(function (event) {
188          if (event.which == 13) {
189            colorChangeExe(this);
190          }
191        });
192      }
193
194      function colorChangeExe(target) {
195        if (!$(target).hasClass('active')) {
196          var color = $(target).attr('class');
197          $('.colorChange > li').removeClass('active');
198          $('body').removeClass('colorW colorB colorY colorBK');
199          $('body').addClass(color);
200          $('.colorChange > li.' + color).addClass('active');
201          $.cookie('bgColor', color, { path: '/', expires: 1 });
202        }
203      }
204    }
205
206    /*=============================================
207      accordion
208    =============================================*/
209    function infoAcc() {
210      if ($('.acc-btn')[0] && pluginExists('infoAccordion')) {
211        var opt_triggerMode = 'mouseenter';
212        if (view == 'sp') {
213          opt_triggerMode = 'click';
214        }
215        $('.acc-btn').infoAccordion({
216          triggerMode: opt_triggerMode,
217          item: '.acc-item',
218          openSpeed: animSpd * 1.5,
219          delaySpeed: animSpd,
220          interlocking: true
221        });
222      }
223    }
224
225    /*=============================================
226        pluginExists
227    =============================================*/
228    function pluginExists(pluginName) {
229      return $.fn[pluginName] ? true : false;
230    }
231
232    /*=============================================
233        Initialize
234    =============================================*/
235    function initialize() {
236      $('a[href="#"]').on('click', function (e) {
237        e.preventDefault();
238      });
239    }
240
241    /*=============================================
242        shuffleContent
243    =============================================*/
244    function shuffleContent(container) {
245      var content = container.find("> *");
246      var total = content.length;
247      content.each(function () {
248        content.eq(Math.floor(Math.random() * total)).prependTo(container);
249      });
250    }
251    // file icons
252    $('.mainArea a').each(function (index, el) {
253      var $this = $(this);
254      var href = $this.attr('href');
255      var htmlExternal = '<img class="fileIcon" src="/Portals/0/images/common/ico_external.png" alt="外部リンクを別窓で表示します。">';
256      var htmlPdf = '<img class="fileIcon" src="/Portals/0/images/common/ico_file_pdf.png" alt="PDFファイルを別窓で表示します。">';
257      var htmlWord = '<img class="fileIcon" src="/Portals/0/images/common/ico_file_word.png" alt="Wordファイルをダウンロードします。">';
258      var htmlExcel = '<img class="fileIcon" src="/Portals/0/images/common/ico_f
258ile_excel.png" alt="Excelファイルをダウンロードします。">';
259      var htmlZip = '<img class="fileIcon" src="/Portals/0/images/common/ico_file_zip.png" alt="Zipファイルをダウンロードします。">';
260      if (!$this.hasClass('noIcon') && href && !$this.children('img.fileIcon')[0]) {
261        if ($this.hasClass('externalLink')) {
262          $this.addClass('setFileIcon').append(htmlExternal);
263        } else if (href.match(/\.(pdf)$/i)) {
264          $this.addClass('setFileIcon').append(htmlPdf);
265        } else if (href.match(/\.(doc)$/i) || href.match(/\.(docx)$/i)) {
266          $this.addClass('setFileIcon').append(htmlWord);
267        } else if (href.match(/\.(xls)$/i) || href.match(/\.(xlsx)$/i)) {
268          $this.addClass('setFileIcon').append(htmlExcel);
269        } else if (href.match(/\.(zip)$/i)) {
270          $this.addClass('setFileIcon').append(htmlZip);
271        }
272      }
273    });
274    // tel icons
275    if ($('.mainArea .telphone')[0]) {
276      $('.telphone').prepend('<img class="telIcon" src="/Portals/0/images/kizuna/service/consultation/ico_tel.png" alt="電話番号">');
277    }
278    // free icons
279    if ($('.mainArea .dedicatedDial')[0]) {
280      $('.dedicatedDial').prepend('<img class="freeIcon" src="/Portals/0/images/kizuna/service/consultation/ico_freedial.png" alt="フリーダイヤル">');
281    }
282    // gnav sitemap
283    $('.tokenMenu a, .icmdtp-sitemapItem a').each(function () {
284      var $this = $(this);
285      var htmlExternal = '<img class="fileIcon" src="/Portals/0/images/common/ico_external.png" alt="外部リンクを別窓で表示します。">';
286      if ($this.attr('target') == '_blank') {
287        $this.addClass('setFileIcon').append(htmlExternal);
288      }
289    });
290
291    /*=============================================
292    add gtag
293    =============================================*/
294    function addGtag_func(tabId, prop, val) {
295      var $this = $('.tokenMenu').find(`li.Tab${tabId}`).children('a')
296      $this.attr(prop, val);
297    }
298
299    addGtag_func(1226, 'onclick', `gtag('event','click',{'event_category': 'link','event_label':'105001_ベネフィット・ステーショントップ'});`);
300    addGtag_func(1227, 'onclick', `gtag('event','click',{'event_category': 'link','event_label':'105002_ベネフィット・ステーション会員特別企画'});`);
301    addGtag_func(1224, 'onclick', `gtag('event','click',{'event_category': 'bannar','event_label':'110001_第一本庁舎職員食堂混雑情報'});`);
302    addGtag_func(1225, 'onclick', `gtag('event','click',{'event_category': 'bannar','event_label':'110002_第二本庁舎職員食堂混雑情報'});`);
303  });
304})(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.