1/** 2 * å ¨ãã¶ã¤ã³ãµã¤ãå ±éJS 3 * @author nagai 4 * @version 1.0 5 */ 6$(function(){ 7 8 //ã¹ã ã¼ãºã¹ã¯ãã¼ã« 9 $("a[href*='#'].scroll").smoothScroll(); 10 11 //ãã¡ã¤ã«ãªã³ã¯ã¯å¥çªè¡¨ç¤º 12 //$("a[href*='.*']").fileBlank('*') ã»ã¬ã¯ã¿ã§æ¡å¼µåæå® fileBlankã®å¼æ°ã«ã¯ã©ã¹æå®; 13 $("a[href*='.pdf']").fileBlank('pdf'); 14 $("a[href*='.doc']").fileBlank('word'); 15 $("a[href*='.xls']").fileBlank('excel'); 16 17 // ãã¡ã¤ã«ãªã³ã¯ã®ã¯ãªãã¯ã¤ãã³ãè¨æ¸¬ 18 $('.file-link-item a').on('click',function(){ 19 var targetUrl = $(this).attr('href'); 20 var targetLabel = $(this).text(); 21 // gaæªå®ç¾©ã®å ´åã¯å®è¡ããªã 22 if(typeof ga == 'function'){ 23 ga('send', 'event', targetUrl, 'download', targetLabel); 24 } 25 // gtagæªå®ç¾©ã®å ´åã¯å®è¡ããªã(GA4) 26 if(typeof gtag == 'function'){ 27 gtag('event', 'sv_file_link_click', { 28 'event_category': 'file_download_category', 29 'event_label': targetLabel + 'ï¼' + targetUrl, 30 'value': 1 31 }); 32 } 33 }); 34 35 //ãã¼ã«ãªã¼ãã¼ç»å 36 $("img[src*='_off.']").rollOver({off:'_off.',on:'_on.'}); 37 38 39 // //XPã®IE7ã¨ä»ã®OSã«ã¡ã¤ãªãªã®ãã©ã³ãæå® 40 // $.fn.fontMeiryo(); 41 42 //tableã®align屿§åé¤ 43 $.fn.tableDeleteAlign(); 44 45 // // å¥ãã¡ã¤ã³ã¯å¥çªè¡¨ç¤º 46 // $('a[href*=http]').linkBlank({url:['/www.xxxx.xxxx.xxxx.jp' ,'/xxxx.xxxx.xxxx.jp' ,'^http://www00.dev.smartcms.smart-lgov.jp']}); 47 48 // å ã®ãã¼ã¸ã«æ»ããªãã¡ã©ã¼ãèªåã§ã¤ãã 49 $("a[href*=inquiryId]").each(function() { 50 var a = $(this); 51 var url = a.attr("href"); 52 var locaUrl = location.pathname; 53 a.attr("href", url.replace(/(Init\.do\?inquiryId=[0-9]+)/, '$1&ref=www.xxxx.xxxx.xxxx.jp' + locaUrl) ); 54 }); 55 56 57 var location_href = location.href; 58 var now_site_domain; 59 60 if(location_href.indexOf('http://') != -1 || location_href.indexOf('https://') != -1){ 61 var replace_site_domain = site_domain + '/'; 62 var now_site_domain = replace_site_domain.replace( /http:/g , "" ).replace( /https:/g , "" ); 63 }else{ 64 now_site_domain = ''; 65 } 66 67 //æåãµã¤ãºå¤æ´ï¼æ¨æº or 大ããããï¼HTMLå´ã¯ä»¥ä¸ã®ããã«è¨å® 68 if ($('.scsize').length) { 69 $.fn.styleCatcherUpNormal({btnCls: "scsize",cssID: "scsize",prAry: ['size_default.css', 'size_up.css', 'size_up2.css', 'size_up3.css'],cssPath: now_site_domain + 'theme/base/css/',def: 0}); 70 } 71 //æåãµã¤ãºï¼å°ãä¸ã大ï¼HTMLå´ã¯ä»¥ä¸ã®ããã«è¨å® 72 //$.fn.styleCatcher({btnCls: "scSize",cssID: "scSize",cssTag: '<link href="/material/template/css/size_small.css" rel="stylesheet" type="text/css" id="scSize" />',def: 0}); 73 74 //èæ¯è²å¤æ´ï¼ç½ãé»ãéï¼HTMLå´ã¯ä»¥ä¸ã®ããã«è¨å® 75 if ($('.sccolor').length) { 76 $.fn.styleCatcher({btnCls: "sccolor",cssID: "sccolor", cssPath: now_site_domain + 'theme/base/css/',def: 2}); 77 } 78 79 80 81 82 // ãããã¼ããã®ããããã¡ã㥠83 if (typeof $.fn.dropMenu != 'undefined') { 84 $("#header-nav").dropMenu(); 85 } 86 87 // æåãµã¤ãºå¤æ´ç£è¦ 88 $.fn.fontSizeChange({func:function(){ 89 //$("#header-nav .list2").eqGroupHeight(3); 90 $("#wrapper").show(); 91 92 $('#header-logo').css('top', $('#header-nav .in .list').height()); 93 }}); 94 95 96 //ã¢ã¼ãã«ï¼æ¤ç´¢ï¼ 97 $('.menu-btn-search').lightbox({ 98 modalBg:$('.modal-search-bg'), 99 modal:$('.modal-search'), 100 close:$('.modal-menu-close'), 101 scrollID:'sWrapper', 102 lightSpot:$('.menu-btn-search') 103 }); 104 105 106 //ã¢ã¼ãã«ï¼ã¡ãã¥ã¼ï¼ 107 $('.menu-btn-menu').lightbox({ 108 modalBg:$('.modal-menu-bg'), 109 modal:$('.modal-menu'), 110 close:$('.modal-menu-close'), 111 scrollID:'sWrapper', 112 lightSpot:$('.menu-btn-menu') 113 }); 114 115 $('.modal-menu .box').svAccordion({ 116 classHead:'.title', 117 classBody:'.list', 118 classToggle:'on' 119 }); 120 121 // ã¢ã³ã¼ãã£ãªã³(ãããã質åç¨) 122 $('.faq-block').svAccordion({ 123 classHead:'.title', 124 classBody:'.childs', 125 classToggle:'on' 126 }); 127 128 //ã¢ã³ã¼ãã£ãªã³ï¼åéå¥ã§æ¢ãï¼ 129 $('.joho-tab #tab-6 .in2').svAccordion({ 130 classHead:'.title',
131 classBody:'.links', 132 classToggle:'on' 133 }); 134 135 //ã¹ãããã¬ãã¥ã¼ã«å¯¾å¿ 136 $('.no-escape').each(function(){ 137 $(this).html($(this).text()); 138 }); 139 140 141 // ----------------------------------------------------- 142 // wysiwygã®ä¸ã«tableãããã°ãwrapperã¯ã©ã¹ãä»ä¸ãã 143 // ï¼100%ãè¶ ããã¨ãã«wrapperå ã§ã¹ã¯ãã¼ã«ãããããï¼ 144 // ----------------------------------------------------- 145 if ($('.wysiwyg table').length){ 146 $('.wysiwyg table').wrap('<div class="table-wrapper"></div>'); 147 } 148 149 150/** 151 IE8,9ã§XMLHttpRequestã®ä»£ããã«XDomainRequestã使ã 152 ãã®ã»ã¯ã·ã§ã³ã¯æ¶ããªãã§ãã ããã 153 */ 154if ( window.XDomainRequest ) { 155 jQuery.ajaxTransport(function( s ) { 156 if ( s.crossDomain && s.async ) { 157 if ( s.timeout ) { 158 s.xdrTimeout = s.timeout; 159 delete s.timeout; 160 } 161 var xdr; 162 return { 163 send: function( _, complete ) { 164 function callback( status, statusText, responses, responseHeaders ) { 165 xdr.onload = xdr.onerror = xdr.ontimeout = xdr.onprogress = jQuery.noop; 166 xdr = undefined; 167 complete( status, statusText, responses, responseHeaders ); 168 } 169 xdr = new XDomainRequest(); 170 xdr.open( s.type, s.url ); 171 xdr.onload = function() { 172 callback( 200, "OK", { text: xdr.responseText }, "Content-Type: " + xdr.contentType ); 173 }; 174 xdr.onerror = function() { 175 callback( 404, "Not Found" ); 176 }; 177 xdr.onprogress = function() {}; 178 if ( s.xdrTimeout ) { 179 xdr.ontimeout = function() { 180 callback( 0, "timeout" ); 181 }; 182 xdr.timeout = s.xdrTimeout; 183 } 184 xdr.send( ( s.hasContent && s.data ) || null ); 185 }, 186 abort: function() { 187 if ( xdr ) { 188 xdr.onerror = jQuery.noop(); 189 xdr.abort(); 190 } 191 } 192 }; 193 } 194 }); 195} 196 197 //PCã»ã¹ããåãæ¿ãï¼ã¬ã¹ãã³ã·ãï¼ 198 if( typeof MutualSwitching !== 'undefined') { 199 MutualSwitching.config.setPathSettings({ 200 "/": { 201 "pc_width": 1024, 202 "sp_width": 720, 203 "layout_type": 0 204 } 205 }); 206 MutualSwitching.run.ready(); 207 } 208 209 var isMobile = { 210 phone : false, 211 phoneCheck : function(){ 212 this.phone = $($('.visible-phone')[0]).is(':visible'); 213 return this.phone; 214 }, 215 check : function(){ 216 this.phoneCheck(); 217 }, 218 init : function(){ 219 if ($('.visible-phone').length <= 0) $('body').append($('<div class="visible-phone"></div>')); 220 this.check(); 221 $(window).resize(function(){ 222 isMobile.check(); 223 }); 224 } 225 }; 226 227 $(window).on('load resize orientationchange',function(){ 228 isMobile.init(); 229 if(isMobile.phone){ 230 $('#header #google_translate_element').prependTo('#sp-header .g-translate-box'); 231 } else { 232 $('#sp-header .g-translate-box #google_translate_element').prependTo('#header .g-translate-box'); 233 } 234 235 }); 236 237 // ãããã¼ãã hover focus å¯¾å¿ 238 $('#header-nav > .in > .list > li').hover(function() { 239 addActiveNav($(this).find('> a')); 240 }, function() { 241 removeActiveNav(); 242 }); 243 $('a').focusin(function() { 244 if ($(this).closest('#header-nav').length > 0) { 245 addActiveNav($(this).closest('li:not(.pageEntity)').find('> a')); 246 } else { 247 removeActiveNav(); 248 } 249 }); 250 251 function addActiveNav($a) { 252 removeActiveNav(); 253 $a.addClass('active'); 254 } 255 function removeActiveNav() { 256 $('#header-nav > .in > .list > li > a').removeClass('active'); 257 } 258 259 260 /** 261 * SmartAlert 262 * @param ... 263 * @return ... Returns {@ code} 264*/ 265$.fn.smartAlertListView = function(config){ 266 267 // åæå¤ 268 config = $.extend({ 269 rssPath: site_domain + '/cgi-bin/smart_alert.php/1', 270 historyPath: site_domain + '/cgi-bin/smart_alert.php/1/list',
271 historyClass: '.more', 272 ulClass: '.list', 273 textClass: '.text', 274 dateClass: '.date', 275 limit: 3, 276 dateformat: 'YYYYå¹´MMæDDæ¥(WW) hhæmmåssç§', 277 noDataView: 1, 278 },config); 279 280 // ãã©ã¡ã¼ã¿ã¼ã®ã¨ã©ã¼å¤å® 281 var errorMsg = ''; 282 for(key in config) { 283 var value = config[key]; 284 // 空æåã®å¤å® 285 if(value === '') { 286 errorMsg += 'ã¨ã©ã¼ï¼' + key + 'ã«ç©ºæåãå ¥ã£ã¦ãã¾ã\n'; 287 } else { 288 // æ°å¤ãã©ããã®å¤å® 289 if(key === 'limit' || key === 'noDataView') { 290 if($.type(value) !== 'number'){ 291 errorMsg += 'ã¨ã©ã¼ï¼' + key + 'ã«æååãå ¥ã£ã¦ãã¾ã\n'; 292 } 293 // æååãã©ããã®å¤å® 294 } else { 295 if($.type(value) !== 'string') { 296 errorMsg += 'ã¨ã©ã¼ï¼' + key + 'ã«æ°å¤ãå ¥ã£ã¦ãã¾ã\n'; 297 } 298 } 299 } 300 } 301 // ã¨ã©ã¼ããã°å®è¡ããªã 302 if(errorMsg) { 303 console.error(errorMsg); 304 // ã¨ã©ã¼ãªããã°å®è¡ 305 } else { 306 $.ajax({
307 url:config.rssPath, 308 timeout: 10000, 309 dataType: 'json', 310 context:this, 311 success:function(json){ 312 var itemList = json.data; //xmlé åã夿°ã«æ ¼ç´ 313 var $parentBox = this; //表示ã¨ãªã¢ã鏿 314 var $smartAlertUlBox = $parentBox.find(config.ulClass); //ulã¿ã°ã鏿 315 var $li = $smartAlertUlBox.find('li:first'); //liã¿ã°ã鏿 316 var litags = ''; 317 // -------------------------------------------- 318 //ã¢ã©ã¼ããããã° 319 if(itemList.length){ 320 //ä¸è¦§ãã¼ã¸ã¸ã®ãªã³ã¯å è¨å® 321 $($parentBox).find(config.historyClass + ' a').attr('href', config.historyPath); 322 //xmlãã¼ã¿ãã¾ãã 323 $(itemList).each(function(idx){ 324 if(idx >= config.limit){ 325 return false; 326 } 327 //ã¢ã©ã¼ãå 容ã®ä½æ 328 var smartAlertTitle = this.title; 329 var smartAlertLink = this.link; 330 //ã¢ã©ã¼ãæ¥ä»ã®ä½æ 331 var date = new Date(this.pubDate); 332 var weekday = ['æ¥', 'æ', 'ç«', 'æ°´', 'æ¨', 'é', 'å']; 333 var dateText = config.dateformat; 334 dateText = dateText.replace(/YYYY/, date.getFullYear()); 335 dateText = dateText.replace(/MM/, ('0' + (date.getMonth() + 1)).slice(-2)); 336 dateText = dateText.replace(/DD/, ('0' + date.getDate()).slice(-2)); 337 dateText = dateText.replace(/WW/, weekday[date.getDay()]); 338 dateText = dateText.replace(/hh/, ('0' + date.getHours()).slice(-2)); 339 dateText = dateText.replace(/mm/, ('0' + date.getMinutes()).slice(-2)); 340 dateText = dateText.replace(/ss/, ('0' + date.getSeconds()).slice(-2)); 341 dateText = dateText.replace(/M/, date.getMonth() + 1); 342 dateText = dateText.replace(/D/, date.getDate()); 343 dateText = dateText.replace(/h/, date.getHours()); 344 dateText = dateText.replace(/m/, date.getMinutes()); 345 dateText = dateText.replace(/s/, date.getSeconds()); 346 //ãªã³ã¯ã®æ¿å ¥ 347 if($li.find('a').length) { 348 $li.find('a').attr('href', smartAlertLink); 349 } 350 //ã¢ã©ã¼ãå å®¹ã®æ¿å ¥ 351 if($li.find(config.textClass).length) { 352 $li.find(config.textClass).text(smartAlertTitle); 353 } 354 //ã¢ã©ã¼ãæ¥ä»ã®æ¿å ¥ 355 if($li.find(config.dateClass).length) { 356 $li.find(config.dateClass).text(dateText); 357 } 358 litags += $li.prop('outerHTML'); 359 }); 360 //追å 361 $smartAlertUlBox.html(litags); 362 // ã¨ãªã¢ã®è¡¨ç¤º 363 $parentBox.css('display', 'block'); 364 365 // -------------------------------------------- 366 //ã¢ã©ã¼ãããªããã° 367 // -------------------------------------------- 368 } else { 369 if(config.noDataView) { 370 $parentBox.css('display', 'block'); 371 $li = config.noDataClass ? $(config.noDataClass) : '<li>ãã¼ã¿ãããã¾ãã</li>'; 372 $smartAlertUlBox.html($li); 373 $parentBox.find(config.historyClass).remove(); //ä¸è¦§ãã¼ã¸ã¸ã®ãã¿ã³ãåé¤ 374 } else { 375 $parentBox.remove(); //ã¨ãªã¢ãã¨åé¤ 376 } 377 } 378 } 379 }); 380 } 381 return this; 382}; 383 384 385});
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.