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.