1/** 2 * å ¨ãã¶ã¤ã³ãµã¤ãå ±éJS 3 * @author nagai 4 * @version 1.0 5 */ 6$(function(){ 7 8 /** 9 * ããã¹ãã¿ã 10 * â»classHideã¯è¨å®ãã¦ãã ãããtabsã¨pagesã¯ä¸ã¤ã ãåå¨ããmodãæå®ãã¦ãã ããï¼idæå®ãæé©ï¼ 11 * $.fn.textTab({defaultSelect:0,cookie:'topTab',tabs:$("#topTab .titleList li"),pages:$("#topTab .box")}); 12 * 13 * @param object è¨å® 14 */ 15 $.fn.textTab = function(config) { 16 var targetJ = this; 17 18 config = $.extend({ 19 tabs: null, 20 pages: null, 21 defaultSelect: 0, 22 cookie: 'tab', 23 classHover: 'hover', 24 classHide: 'hide' 25 }, config); 26 27 if (config.tabs == null || config.pages == null) { 28 return; 29 } 30 31 var ClassTab = function() {} 32 ClassTab.prototype = { 33 rollOver: function(select) { 34 config.tabs.unbind("mouseenter").unbind("mouseleave"); //img.unbind('hover');ã§ã¯ã§ããªã 35 config.tabs.removeClass(config.classHover); 36 config.tabs.each(function(idx) { 37 var tabJ = $(this); 38 39 if (select == idx) { 40 tabJ.addClass(config.classHover); 41 } else { 42 tabJ.hover(function() { 43 tabJ.addClass(config.classHover); 44 }, function() { 45 tabJ.removeClass(config.classHover); 46 }); 47 } 48 }); 49 }, 50 showpage: function(select) { 51 52 config.pages.each(function(idx) { 53 if (idx == select) { 54 $(this).removeClass(config.classHide); 55 } else { 56 $(this).addClass(config.classHide); 57 } 58 }); 59 }, 60 init: function() { 61 var cls = this; 62 63 config.pages.each(function(idx) { 64 if (idx == config.defaultSelect) { 65 $(this).removeClass(config.classHide); 66 } else { 67 $(this).addClass(config.classHide); 68 } 69 }); 70 71 config.tabs.click(function() { 72 var idx = config.tabs.index(this); 73 cls.rollOver(idx); 74 cls.showpage(idx); 75 // ã¢ã¯ã»ã·ãã«å¯¾å¿ 76 ariaTab(config.tabs, config.pages, idx); 77 //鏿ãããã¿ãã®çªå·ãã¯ããã¼ã«ä¿å 78 $.cookie(config.cookie, idx, {path: '/', expires: 30 }); 79 return false; 80 }); 81 82 config.tabs.keydown(function(e) { 83 var type = 'keydown'; 84 var $prev = $(this).prev('[role="tab"]'); 85 var $next = $(this).next('[role="tab"]'); 86 var $target; 87 switch (e.keyCode) { 88 case 37:ã//å·¦ç¢å°ï¼âï¼ 89 $target = $prev; 90 break; 91 case 39:ã//å³ç¢å°ï¼âï¼ 92 $target = $next; 93 break; 94 default: 95 $target = false; 96 break; 97 } 98 if ($target.length) { 99 var idx = config.tabs.index($target); 100 cls.rollOver(idx); 101 cls.showpage(idx); 102 // ã¢ã¯ã»ã·ãã«å¯¾å¿ 103 ariaTab(config.tabs, config.pages, idx, type); 104 //鏿ãããã¿ãã®çªå·ãã¯ããã¼ã«ä¿å 105 $.cookie(config.cookie, idx, {path: '/', expires: 30 }); 106 return false; 107 } 108 }); 109 110 cls.rollOver(config.defaultSelect); 111 // ã¢ã¯ã»ã·ãã«å¯¾å¿ 112 ariaTab(config.tabs, config.pages, config.defaultSelect); 113 } 114 }; 115 116 // åå鏿ã¿ã復å 117 if ($.cookie(config.cookie)) { 118 config.defaultSelect = $.cookie(config.cookie); 119 } 120 // ã¿ã使 121 var tab = new ClassTab(); 122 tab.init(); 123 124 }; 125 126 // 翻訳ãã«ãã¦ã³ 127 $('.js-btn-lang-select').on('click', function() { 128 var lang = $(this).parent().find('select[name=translate]').val(); 129 window.location.href = lang; 130 }); 131 132 //ã¹ã ã¼ãºã¹ã¯ãã¼ã« 133 $("a[href*='#'].scroll").smoothScroll(); 134 135 //ãã¡ã¤ã«ãªã³ã¯ã¯å¥çªè¡¨ç¤º 136 //$("a[href*='.*']").fileBlank('*') ã»ã¬ã¯ã¿ã§æ¡å¼µåæå® fileBlankã®å¼æ°ã«ã¯ã©ã¹æå®; 137 $("a[href*='.pdf']").fileBlank('pdf'); 138 $("a[href*='.doc']").fileBlank('word'); 139 $("a[href*='.xls']").fileBlank('excel'); 140 141 // ãã¡ã¤ã«ãªã³ã¯ã®ã¯ãªãã¯ã¤ãã³ãè¨æ¸¬ 142 $('.file-link-item a').on('click',function(){ 143 var targetUrl = $(this).attr('href'); 144 var targetLabel = $(this).text(); 145 // gaæªå®ç¾©ã®å ´åã¯å®è¡ããªã 146 if(typeof ga == 'function'){ 147 ga('send', 'event', targetUrl, 'download', targetLabel); 148 } 149 // gtagæªå®ç¾©ã®å ´åã¯å®è¡ããªã(GA4) 150 if(typeof gtag == 'function'){ 151 gtag('event', 'sv_file_link_click', { 152 'event_category': 'file_download_category', 153 'event_label': targetLabel + 'ï¼' + targetUrl, 154 'value': 1 155 }); 156 } 157 }); 158 159 //ãã¼ã«ãªã¼ãã¼ç»å 160 $("img[src*='_off.']").rollOver({off:'_off.',on:'_on.'}); 161 162 //tableã®align屿§åé¤ 163 $.fn.tableDeleteAlign(); 164 165 //classåã§å¥çªè¡¨ç¤º 166 //$('.JSblank').jsBlank(); 167 168 //classåã§å¥çªè¡¨ç¤ºï¼å¤é¨ãªã³ã¯ããã¹ããªãï¼ 169 //$('.JSblank2').jsBlank2(); 170 171 //éæåº¦ãã¼ã«ãªã¼ãã¼ç»å 172 //$("img.JSroll").rollOver2(); 173 174 175 176 var location_href = location.href; 177 var now_site_domein; 178 179 if(location_href.indexOf('http://') != -1 || location_href.indexOf('https://') != -1){ 180 var replace_site_domain = site_domain + '/'; 181 var now_site_domein = replace_site_domain.replace( /http:/g , "" ).replace( /https:/g , "" ); 182 }else{ 183 now_site_domein = ''; 184 } 185 186 //ã¹ãã¼ããã©ã³ã¸ã®ãªã³ã¯ 187 //$.fn.smartphoneLink({smphDir:'m', img:'<img src="/material/template/img_pc_top/smartphone.gif" width="960" height="114" alt="ã¹ãã¼ããã©ã³å°ç¨ãµã¤ãã¸" />'}); 188 189 // å ã®ãã¼ã¸ã«æ»ããªãã¡ã©ã¼ãèªåã§ã¤ãã 190 // $("a[href*=inquiryId]").each(function() { 191 // var a = $(this); 192 // var url = a.attr("href"); 193 // var locaUrl = location.pathname; 194 // a.attr("href", url.replace(/(Init\.do\?inquiryId=[0-9]+)/, '$1&ref=www.city.iki.nagasaki.jp' + locaUrl) ); 195 // }); 196 197 198 // ãããã¼ããã®ããããã¡ã㥠199 // if (typeof $.fn.megaDropMenu != 'undefined') { 200 // $('#headerNav').megaDropMenu({ 201 // fadeTime:300 202 // }); 203 // } 204 // ãããã¼ããã®ããããã¡ã㥠205 if (typeof $.fn.dropMenu != 'undefined') { 206 $("#header-nav-in").dropMenu(); 207 } 208 209 //æåãµã¤ãºå¤æ´ 210 if ($('.scsize').length) { 211 $.fn.fontSizeSwitch(); 212 } 213 214 //èæ¯è²å¤æ´ 215 if ($('.sccolor').length) { 216 $.fn.bgColorSwitch(); 217 } 218 219 // ãããã¼ããã®ããããã¡ã㥠220 if (typeof $.fn.dropMenu != 'undefined') { 221 $("#header-nav").dropMenu(); 222 } 223 224 225 // æåãµã¤ãºå¤æ´ç£è¦ 226 $.fn.fontSizeChange({func:function(){ 227 //$("#header-nav .list2").eqGroupHeight(3); 228 $("#wrapper").show(); 229 }}); 230 231 232 //ã¢ã¼ãã«ï¼æ¤ç´¢ï¼ 233 $('.menu-btn-search').lightbox({ 234 modalBg:$('.modal-search-bg'), 235 modal:$('.modal-search'), 236 close:$('.modal-menu-close'), 237 scrollID:'sWrapper', 238 lightSpot:$('.menu-btn-search') 239 }); 240 241 242 //ã¢ã¼ãã«ï¼ã¡ãã¥ã¼ï¼ 243 $('.menu-btn-menu').lightbox({ 244 modalBg:$('.modal-menu-bg'), 245 modal:$('.modal-menu, .modal-menu-close'), 246 close:$('.modal-menu-close'), 247 scrollID:'sWrapper', 248 lightSpot:$('.menu-btn-menu, .modal-menu-close') 249 }); 250 251 // $('.modal-menu .box').accordion({ 252 // classHead:'.title',
253 // classBody:'.list', 254 // classToggle:'on' 255 // }); 256 257 // ã¹ããã¡ãã¥ã¼å ã®ã¢ã³ã¼ãã£ãªã³ 258 $('.sp-nav .box button').on('click', function() { 259 $(this).parent('.title').parent('li').find('.bloc').slideToggle(); 260 var btn_name = $(this).find('span').text(); 261 if($(this).attr('class') === 'mynus') { 262 $(this).attr('class', 'plus'); 263 $(this).find('span').text(btn_name.replace('éãã', 'éã')); 264 $(this).attr('aria-selected', false); 265 $(this).attr('aria-expanded', false); 266 $(this).parent('.title').parent('li').find('.bloc').attr('aria-hidden', true); 267 } else { 268 $(this).attr('class', 'mynus'); 269 $(this).find('span').text(btn_name.replace('éã', 'éãã')); 270 $(this).attr('aria-selected', true); 271 $(this).attr('aria-expanded', true); 272 $(this).parent('.title').parent('li').find('.bloc').attr('aria-hidden', false); 273 } 274 }); 275 276 // ã¢ã³ã¼ãã£ãªã³(ãããã質åç¨) 277 $('.faq-block').accordion({ 278 classHead:'.title', 279 classBody:'.childs', 280 classToggle:'on' 281 }); 282 283 284 //ã¢ã³ã¼ãã£ãªã³ï¼åéå¥ã§æ¢ãï¼ 285 $('.joho-tab #tab-6 .in2').accordion({ 286 classHead:'.title', 287 classBody:'.links', 288 classToggle:'on' 289 }); 290 291 //ã¹ãããã¬ãã¥ã¼ã«å¯¾å¿ 292 $('.no-escape').each(function(){ 293 $(this).html($(this).text()); 294 }); 295 296 // ----------------------------------------------------- 297 // wysiwygã®ä¸ã«tableãããã°ãwrapperã¯ã©ã¹ãä»ä¸ãã 298 // ï¼100%ãè¶ ããã¨ãã«wrapperå ã§ã¹ã¯ãã¼ã«ãããããï¼ 299 // ----------------------------------------------------- 300 if ($('.wysiwyg table').length){ 301 $('.wysiwyg table').wrap('<div class="table-wrapper"></div>'); 302 } 303 304 305 /** 306 IE8,9ã§XMLHttpRequestã®ä»£ããã«XDomainRequestã使ã 307 ãã®ã»ã¯ã·ã§ã³ã¯æ¶ããªãã§ãã ããã 308 */ 309 if ( window.XDomainRequest ) { 310 jQuery.ajaxTransport(function( s ) { 311 if ( s.crossDomain && s.async ) { 312 if ( s.timeout ) { 313 s.xdrTimeout = s.timeout; 314 delete s.timeout; 315 } 316 var xdr; 317 return { 318 send: function( _, complete ) { 319 function callback( status, statusText, responses, responseHeaders ) { 320 xdr.onload = xdr.onerror = xdr.ontimeout = xdr.onprogress = jQuery.noop; 321 xdr = undefined; 322 complete( status, statusText, responses, responseHeaders ); 323 } 324 xdr = new XDomainRequest(); 325 xdr.open( s.type, s.url ); 326 xdr.onload = function() { 327 callback( 200, "OK", { text: xdr.responseText }, "Content-Type: " + xdr.contentType ); 328 }; 329 xdr.onerror = function() { 330 callback( 404, "Not Found" ); 331 }; 332 xdr.onprogress = function() {}; 333 if ( s.xdrTimeout ) { 334 xdr.ontimeout = function() { 335 callback( 0, "timeout" ); 336 }; 337 xdr.timeout = s.xdrTimeout; 338 } 339 xdr.send( ( s.hasContent && s.data ) || null ); 340 }, 341 abort: function() { 342 if ( xdr ) { 343 xdr.onerror = jQuery.noop(); 344 xdr.abort(); 345 } 346 } 347 }; 348 } 349 }); 350 } 351 352 //PCã»ã¹ããåãæ¿ãï¼ã¬ã¹ãã³ã·ãï¼ 353 if( typeof MutualSwitching !== 'undefined') { 354 MutualSwitching.config.setPathSettings({ 355 "/": { 356 "pc_width": 1400, 357 "sp_width": 750, 358 "layout_type": 0 359 } 360 }); 361 MutualSwitching.run.ready(); 362 } 363 364 //Page Id search 365 $(function(){ 366 $('.page-number-search').each(function(){ 367 var $this = $(this); 368 369 $(window).load(function() { 370 $this.find('.number-search-submit').click(function() { 371 getPageURL(); 372 }); 373 $this.find('.number-search-input').keypress(function(ev) { 374 if ((ev.which && ev.which === 13) || (ev.keyCode && ev.keyCode === 13)) {//Enterãã¼ç¡å¹ 375 getPageURL(); 376 } else { 377 return true; 378 } 379 }); 380 }); 381 382 function getPageURL() { 383 var errorFlag = false; 384 var inputText = $this.find('.number-search-input').val(); // æ¤ç´¢ããIDåå¾ 385 var errorMessage = ''; 386 //ã¨ã©ã¼ãã§ã㯠387 //æ°å¤ãã§ã㯠388 if(inputText.match(/[^0-9]+/)) { 389 errorFlag = true; 390 errorMessage = 'IDçªå·ã¯åè§æ°åã§å ¥åãã¦ãã ããã'; 391 } else if(inputText == '') { 392 errorFlag = true; 393 errorMessage = 'IDçªå·ãå ¥åãã¦ãã ããã'; 394 } 395 396 if(errorFlag) { 397 //ã¨ã©ã¼ã¡ãã»ã¼ã¸è¡¨ç¤º 398 $('.error-message').remove(); 399 $this.find('.number-search-container').append('<p class="error-message">' + errorMessage + '</p>'); 400 } else { 401 /*æ¤ç´¢IDåå¾*/ 402 $.ajax({
403 type: 'get', 404 url: '//' + cms_api_domain + '/v1/page/get_page_contents.json', 405 data: { 406 app_version: cms_app_version, 407 app_id: cms_app_id, 408 token: cms_api_token, 409 page_no: inputText 410 }, 411 dataType : 'json', 412 success: function(data) { 413 if(data.success && data.data) 414 location.href = data.data.page_path;//ç»é¢é·ç§» 415 else { 416 //ã¨ã©ã¼ã¡ãã»ã¼ã¸è¡¨ç¤º 417 $('.error-message').remove(); 418 $this.find('.number-search-container').append('<p class="error-message">該å½ã®ãã¼ã¸ã¯ãããã¾ãã</p>'); 419 } 420 }, 421 error: function(data) { 422 //ã¨ã©ã¼ã¡ãã»ã¼ã¸è¡¨ç¤º 423 $('.error-message').remove(); 424 $this.find('.number-search-container').append('<p class="error-message">ãã¼ã¸ãåå¾ã§ãã¾ããã§ããã</p>'); 425 } 426 }); 427 } 428 } 429 430 }); 431 }); 432 433 // ãã¼ã¸ããããã¿ã³ 434 $(function() { 435 var topBtn = $('#pagetop'); 436 topBtn.hide(); 437 438 //ã¹ã¯ãã¼ã«ã450ã«éããããã¿ã³è¡¨ç¤º 439 $(window).scroll(function () { 440 if ($(this).scrollTop() > 450) { 441 topBtn.fadeIn(); 442 } else { 443 topBtn.fadeOut(); 444 } 445 }); 446 //ããã¿ã¼æåã§ãã¿ã³ãæ¢ãã 447 $(window).scroll(function () { 448 var height = $(document).height(); //ããã¥ã¡ã³ãã®é«ã 449 var position = $(window).height() + $(window).scrollTop(); //ãã¼ã¸ãããããç¾å¨å°ã¾ã§ã®é«ã 450 var footer = $("footer").height(); //ããã¿ã¼ã®é«ã 451 if ( height - position < footer ) { 452 topBtn.css({ 453 position : "absolute", 454 }); 455 } else { 456 topBtn.css({ 457 position : "fixed", 458 top: "auto" 459 }); 460 } 461 }); 462 }); 463 464 465});
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.