PageSourceSearch

https://www.daimaru.co.jp/shinsaibashi/js_new/specialInfo.js?20260924181056

js daimaru.co.jp collected 2026-09-24 18:01:15 UTC 4,646 bytes, 147 lines download raw bytes

1/**
2 * specialInfo.js
3 *
4 * @execution
5 * @module
6 * @requires
7 * - jquery.js
8 * - common.js
9 */
10
11/**
12 * @execution
13 */
14$(function(){
15  'use strict';
16  // onReady
17  $.topSpecialInfo();
18});
19
20/**
21 * @module
22 */
23(function($){
24  'use strict';
25  /**
26   * @method topSpecialInfo
27   * - トップページ_緊急のお知らせJSON連携
28   */
29  $.topSpecialInfo = function(config){
30    // options
31    const c = $.extend({
32      factorElement: '.js-top-specialInfo',
33      outputElement: '.js-top-specialInfo__output',
34      moreElement: '.js-top-specialInfo__more',
35      moreTriggerElement: '.js-top-specialInfo__more__trigger',
36      slideSpeed: 200
37    }, config);
38    // vars
39    const $elm = $(c.factorElement);
40    const output = c.outputElement;
41    const more = c.moreElement;
42    const moreTrigger = c.moreTriggerElement;
43    const activeName = 'is-active';
44    const speed = c.slideSpeed;
45    // exit
46    if($elm.length === 0){ return false; }
47    // setting
48    if(specialinfo_list) {
49      if(specialinfo_list.specialinfo) {
50        const json = specialinfo_list.specialinfo;
51        // F01:配列取得
52        if(json.length !== 0) {
53          // F01-1:配列が空ではない
54          // F02:HTMLの出力
55          let HTML = '<ul class="newsBox">';
56          for (let i = 0; i < json.length; i++) {
57            // vars
58            const detail_flg = json[i].detail_flg;
59            const detail_url = json[i].detail_url;
60            const bold = json[i].bold;
61            const enlarge = json[i].enlarge;
62            const emergency_red = json[i].emergency_red;
63            const entry_title = json[i].entry_title;
64            const file_size = json[i].file_size;
65            HTML += '<li>';
66            // detail_flg
67            if(detail_flg !== '詳細なし') {
68              let blank = '';
69              if(detail_flg === '外部リンク' || detail_flg === 'PDF') {
70                blank = ' target="_blank" rel="noopener"';
71              }
72              HTML += '<a href="' + detail_url + '"' + blank + '>';
73            }
74            // bold、enlarge、emergency_red
75            if(bold === '1' || enlarge === '1' || emergency_red === '1') {
76              let boldClass = '';
77              let enlargeClass = '';
78              let emergency_redClass = '';
79              // bold
80              if(bold === '1') {
81                boldClass = ' strong04';
82              }
83              // enlarge
84              if(enlarge === '1') {
85                enlargeClass = ' strong05';
86              }
87              // emergency_red
88              if(emergency_red === '1') {
89                emergency_redClass = ' strong03';
90              }
91              HTML += '<span class="' + boldClass + enlargeClass + emergency_redClass + '">';
92            }
93            // entry_title
94            HTML += entry_title;
95            // file_size
96            if(file_size) {
97              HTML += '[' + file_size + ']<img src=\"/common_new/img/com_pdf_ic01.png\" alt=\"PDF\" width=\"12\" height=\"12\" class=\"icon\" />';
98            }
99            // bold、enlarge、emergency_red
100            if(bold === '1' || enlarge === '1' || emergency_red === '1') {
101              HTML += '</span>';
102            }
103            // detail_flg
104            if(detail_flg !== '詳細なし') {
105              HTML += '</a>';
106            }
107            HTML += '</li>';
108          }
109          HTML += '</ul>';
110          // output
111          $elm.find(output).append(HTML);
112          // F03:件数判別
113          if($elm.find(output + ' li').length > 5){
114            // F03-1:記事が6件以上
115            $(more).show();
116            $elm.find(output + ' li:gt(' + 4 + ')').hide();
117          } else {
118            // F03-2:記事が5件以下
119            $(more).hide();
120          }
121        } else {
122          // F01-2:配列が空
123          $elm.hide();
124        }
125      } else {
126        $elm.hide();
127      }
128    } else {
129      $elm.hide();
130    }
131    // 「MORE」ボタン
132    // F01:クリックイベント
133    $(moreTrigger).on('click', function(){
134      const self = $(this);
135      // F02:active判定
136      if(self.hasClass(activeName)) {
137        // F02-1:閉じる処理
138        $elm.find(output + ' li:gt(' + 4 + ')').stop(true, true).fadeOut(speed);
139        self.removeClass(activeName).text('MORE');
140      } else {
141        // F02-2:開く処理
142        $elm.find(output + ' li').stop(true, true).fadeIn(speed);
143        self.addClass(activeName).text('CLOSE');
144      }
145    });
146  };
147})(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.