1/*=========================================== 2base.js 3Last Update 2018-04-11 4 5* functions 6 -UserAgent SmartPhone 7 -UserAgent Judgment 8 -SmartPhone Judgment 9 -AutoHeight settings 10 -resetAutoHeight 11 -Window Resize Event 12* Code to carry out after an HTML road ---------------- $(function(){}); 13* Code to carry out after an HTML and Images road ----- jQuery.event.add(window, "load", function(){}); 14* Plugins 15 -Original Methods --------(function($){})(jQuery); 16===========================================*/ 17 18/*===================================== 19functions 20=====================================*/ 21 22/* for Debug */ 23if (!console) console = {log: function(){}}; 24 25// UserAgent Judgment 26var $UA = $UA || {}; 27;(function($, undefined) { 28 $UA.SP = (navigator.userAgent.indexOf('iPhone') > 0 && navigator.userAgent.indexOf('iPad') == -1) || navigator.userAgent.indexOf('iPod') > 0 || navigator.userAgent.indexOf('Android') > 0; 29 $UA.name = window.navigator.userAgent.toLowerCase(); 30 $UA.isIE = ($UA.name.indexOf('msie') >= 0 || $UA.name.indexOf('trident') >= 0); 31 $UA.isiPhone = $UA.name.indexOf('iphone') >= 0; 32 $UA.isiPod = $UA.name.indexOf('ipod') >= 0; 33 $UA.isiPad = $UA.name.indexOf('ipad') >= 0; 34 $UA.isiOS = ($UA.isiPhone || $UA.isiPod || $UA.isiPad); 35 $UA.isAndroid = $UA.name.indexOf('android') >= 0; 36 $UA.isTablet = ($UA.isiPad || ($UA.isAndroid && $UA.name.indexOf('mobile') < 0)); 37 38 if ($UA.isIE) { 39 $UA.verArray = /(msie|rv:?)\s?([0-9]{1,})([\.0-9]{1,})/.exec($UA.name); 40 if ($UA.verArray) { 41 $UA.ver = parseInt($UA.verArray[2], 10); 42 } 43 } 44 if ($UA.isiOS) { 45 $UA.verArray = /(os)\s([0-9]{1,})([\_0-9]{1,})/.exec($UA.name); 46 if ($UA.verArray) { 47 $UA.ver = parseInt($UA.verArray[2], 10); 48 } 49 } 50 if ($UA.isAndroid) { 51 $UA.verArray = /(android)\s([0-9]{1,})([\.0-9]{1,})/.exec($UA.name); 52 if ($UA.verArray) { 53 $UA.ver = parseInt($UA.verArray[2], 10); 54 } 55 } 56}(jQuery)); 57 58 59 60$(function(){ 61 62 // GlobalNavi 63 //-------------------------------- 64 if($('#siteFunctions').length){ 65 $('#wrapper').before('<div id="gnavOverlay"></div>'); 66 var $gnav = $('#globalNav'), 67 $gnavul = $("ul",$gnav), 68 $glink = $("ul>li>a",$gnav), 69 $ovly = $('#gnavOverlay'), 70 $drawer = $('#drawer'), 71 $search = $('#searchSet'), 72 $funcbtn = $('#funcBtns'), 73 $openS = $('#searchOpen'), 74 $openR = $('#regionOpen'), 75 $reglang = $('#regionLang'), 76 $subnav = {}, 77 $regions = {}, 78 $gtog = {}, 79 $location = document.location.pathname.split('/'), 80 _current = 'current', 81 _off = 'off', 82 _search = '', 83 ovlyout = function(){ 84 $ovly.fadeOut(200); 85 }, 86 ovlyin = function(){ 87 $ovly.fadeIn(300); 88 }, 89 closeFuncs = function(){ 90 if($gnav.length){ 91 $glink.removeClass(_off); 92 $glink.removeClass(_current); 93 $subnav.slideUp(200); 94 } 95 $search.slideUp(200); 96 $regions.slideUp(200); 97 }; 98 99 // search 100 //--------------------------------------- 101 _search += 102 '<div class="mf_finder_container">'+ 103 '<mf-search-box '+ 104 'submit-text="" '+ 105 'ajax-url="https://finder.api.mf.marsflag.com/api/v1/finder_service/documents/da33c4eb/search" '+ 106 'serp-url="/search_result.html" '+ 107 'enable-pagelog' + 108 'sort-text-csv="ãããé ,æ¥æé " '+
109 'imgsize-text-csv="ãµã ãã¤ã« ãªã,ãµã ãã¤ã« å°,ãµã ãã¤ã« ä¸,ãµã ãã¤ã« 大" '+ 110 'imgsize-default="3"'+ 111 '></mf-search-box>'+ 112 '</div>'; 113 $search.append(_search); 114 115 var search_css = document.createElement('link'), 116 search_script = document.createElement('script'); 117 search_css.href = 'https://ce.mf.marsflag.com/latest/css/mf-search.css'; 118 search_css.rel = 'stylesheet'; 119 search_css.type = 'text/css'; 120 search_css.media = 'all'; 121 search_css.charset = 'UTF-8'; 122 document.head.appendChild(search_css); 123 124 if($('body').attr('id') != 'mf_Result'){ 125 var G = GALFSRAM = window.GALFSRAM || {} 126 G.mfx = G.mfx || {} 127 G.mfx.router_mode = 'history' 128 search_script.src = 'https://ce.mf.marsflag.com/latest/js/mf-search.js'; 129 search_script.charset='UTF-8'; 130 document.body.appendChild(search_script); 131 132 } 133 134 135 // load region_lang 136 //--------------------------------------- 137 if($reglang.length){ 138 $reglang.load('/shared/js/region_lang.html',function(){ 139 $regions = $reglang.find('#selectRegion'); 140 var arrlocation = document.location.pathname.split('/'), 141 startpath = 1,//for Production 142 // startpath = 2,//for test 143 path = '', 144 $langs = $('.langSelect'), 145 mylang = $langs.find('a.active').attr('data-lang'), 146 defaultlang = $langs.find('a').eq(0).attr('data-lang'); 147 148 for(var i=startpath; i<arrlocation.length; i++){ 149 path+= '/'+ arrlocation[i]; 150 } 151 if(mylang != defaultlang){ 152 path = path.substr(3); 153 } 154 155 // mirror language contents 156 if($langs.hasClass('mirror')){ 157 var $langlink = $langs.find('a'); 158 $langlink.each(function(){ 159 var datalang = $(this).data('lang'); 160 161 if(datalang === defaultlang){ 162 datalang = path;//for Production 163 // datalang = '/' + arrlocation[1] + path; //for test 164 }else if(datalang === mylang){ 165 datalang = ''; 166 } 167 else{ 168 datalang = '/' + datalang + path;//for Production 169 // datalang = '/' + arrlocation[1]+ '/' + datalang + path; //for test 170 } 171 $(this).attr('href',datalang); 172 }); 173 } 174 }); 175 }//END if[region_lang] 176 177 178 if($gnav.length){ 179 /* gnavTrigger */ 180 $funcbtn.append('<li id="gnavTrigger"><span></span></li>'); 181 $gtog = $('#gnavTrigger'); 182 $gtog.on('click',function(){ 183 if($ovly.hasClass(_current)){ 184 $gnav.slideDown(300); 185 $drawer.removeClass(_current); 186 $ovly.removeClass(_current); 187 }else if(!$ovly.is(':hidden')){ 188 $gnav.slideDown(300); 189 $drawer.removeClass(_current); 190 $ovly.removeClass(_current); 191 }else{ 192 $gnav.slideToggle(300); 193 $drawer.removeClass(_current); 194 $ovly.removeClass(_current); 195 if(!$drawer.hasClass(_current)){ 196 $drawer.addClass(_current); 197 $ovly.addClass(_current); 198 } 199 } 200 }); 201 202 var $checkgnav = ''; 203 $glink.each(function(){ 204 $checkgnav += $(this).html(); 205 }); 206 207 if ( $checkgnav.indexOf('<br>') != -1) { 208 $('body').addClass('gnavMultipleLines'); 209 } 210 // console.log($checkgnav); 211 212 // add subGnav 213 //--------------------------------------- 214 $.ajax({
215 type: 'GET', 216 url: '/shared/js/gNavi.html', 217 dataType: 'html' 218 }) 219 .done(function(data){ 220 $gnav.append(data); 221 $subnav = $('.subGnav',$gnav); 222 $subnav.each(function(i){ 223 $('.parentNav>li',$gnav).eq(i).append($(this)); 224 if($(this).children().length == 0){ 225 $(this).parent().addClass('noList'); 226 }else{ 227 // $(this).append('<p class="close"></p>'); 228 } 229 }); 230 /* Clone gnav */ 231 var $gclone = $gnav.clone(true); 232 $gclone.attr('id','gNavSP'); 233 $search.after($gclone); 234 }); 235 236 //toggle menu (sp) 237 //-------------------------------- 238 $('<a class="menuToggle"></a>').insertAfter($glink); 239 $glink.next('a').on('click',function(){ 240 if(!$(this).hasClass('open')){ 241 $(this).addClass('open') 242 .next().slideDown(200); 243 }else{ 244 $(this).removeClass('open') 245 .next().slideUp(100); 246 } 247 }); 248 249 // current nav (sp) 250 //-------------------------------- 251 if($gnav.is($("[class^='active']"))){ 252 var $t = $('ul.parentNav>li',$gnav), 253 $c = parseInt($gnav.attr('class').slice(6,7))-1; 254 $t.eq($c).addClass('lowerOpen'); 255 $t.eq($c).children('a.menuToggle').addClass('open'); 256 } 257 258 // dropdown subGnav 259 //-------------------------------- 260 // gnav click event 261 if(!$gnavul.is('#noSubGnav')){ 262 $glink.on('click', function(e){ 263 var $p = $(this).parent(), 264 sub = $(this).parent().children('div'); 265 266 if(parseInt($(window).width())>767 && !$p.is('.noList')){ 267 e.preventDefault(); 268 $p.siblings().children().removeClass(_current).addClass(_off); 269 $(this).removeClass(_off).addClass(_current); 270 271 // subGnav open/close 272 if ($(sub).is(':hidden')) { 273 e.stopPropagation(); 274 $('div.subGnav:visible',$gnav).hide(); 275 $(sub).slideDown('fast'); 276 $(this).addClass(_current); 277 ovlyin(); 278 $search.slideUp(200); 279 $regions.slideUp(200); 280 }else{ 281 $(sub).slideUp(200); 282 $p.siblings().children().removeClass(_off); 283 $(this).removeClass(_current); 284 ovlyout(); 285 } 286 $(this).attr('href','javascript:;'); 287 } 288 }); 289 } 290 }else{ 291 $drawer.addClass('noGnav'); 292 $ovly.addClass('noGnav'); 293 }//END if[#globalNav] 294 295 $ovly.on('click',function(){ 296 $('.subGnav',$gnav).slideUp(200); 297 closeFuncs(); 298 ovlyout(); 299 }); 300 301 $openS.on('click',function(){ 302 if ($search.is(':hidden')) { 303 closeFuncs(); 304 $search.slideDown(200); 305 ovlyin(); 306 $('input[type="text"]',$search).focus(); 307 }else{ 308 $search.slideUp(200); 309 ovlyout(); 310 } 311 }); 312 313 $openR.on('click',function(){ 314 if ($regions.is(':hidden')) { 315 closeFuncs(); 316 $regions.slideDown(200); 317 ovlyin(); 318 }else{ 319 $regions.slideUp(200); 320 ovlyout(); 321 } 322 }); 323 324 var gnavAttachScrollEvent = function(){ 325 var scTop = 90; 326 $(window).on('scroll.o', $.debounce(50, function(){ 327 if ($(window).scrollTop() > scTop && $(window).width()>767) { 328 $gnav.slideUp(200); 329 if(!$ovly.is(':hidden')){ 330 closeFuncs(); 331 ovlyout(); 332 } 333 $drawer.addClass(_current); 334 $ovly.addClass(_current); 335 }else{ 336 $drawer.removeClass(_current); 337 $ovly.removeClass(_current); 338 $gnav.slideDown(300); 339 } 340 })); 341 }; 342 gnavAttachScrollEvent(); 343 344 // drawer menu 345 //-------------------------------- 346 (function(){ 347 var $ver = lowerAndroid(2.3), 348 $sitefunc = $('#siteFunctions'), 349 $Drawer = $('#drawer'), 350 scroll = 0; 351 352 if(!($UA.isIE && $UA.ver <= 8)){/* not IE8 following */ 353 //$('#siteFunctions').mmenu({/* Drawer menu */ 354 // position:"right" 355 //}); 356 $('#spMenuBtn a').on('click',function(){ 357 var $bodyHeight = window.innerHeight - 62; 358 $Drawer.height($bodyHeight); 359 $('#siteFunctions').css({'transform': 'translate3d(0, 0, 0)'}); 360 $(this).toggleClass('active'); 361 if($sitefunc.is(':hidden')){ 362 scroll = $(window).scrollTop(); 363 $sitefunc.slideDown(200,function(){ 364 $('html').css({'overflow-y':'hidden'}); 365 if($UA.isiPhone === true) { 366 setTimeout(function() { 367 $bodyHeight = window.innerHeight - 62; 368 $Drawer.height($bodyHeight); 369 }, 500); 370 $('html,body').css({'-webkit-overflow-scrolling': 'touch','overflow': 'auto','height': '100%'});
371 $('#selectRegion').find('a').focus().blur(); 372 $('#drawer').scrollTop(0); 373 $('#logo,#contents,footer').on('touchmove.nscrll',function(e){ 374 e.preventDefault(); 375 }); 376 } 377 }); 378 }else{ 379 $('html,body').css({'-webkit-overflow-scrolling': 'none','height': 'auto'}).scrollTop(scroll); 380 $sitefunc.slideUp(200,function(){ 381 $('html').css({'overflow-y':'auto'}); 382 if($UA.isiPhone === true) { 383 $('#wrapper').css({'position':'static'}); 384 $('#logo,#contents,footer').off('.nscrll'); 385 } 386 }); 387 } 388 }); 389 } 390 391 })(); 392 393 }// END if[#siteFunctions] 394}); 395 396 397 398var TORAY = TORAY || {}; 399;(function($, undefined) { 400 TORAY.winW = $(window).width(); 401 TORAY.resizeW = ''; 402 403 TORAY.util = { 404 hashCtrl: function(){ 405 var h = location.hash; 406 if($(h).length > 0 /*&& h.indexOf('#js-modalPopup') == -1*/){ 407 $(window).load(function() { 408 var target = $(h), position = 0; 409 if (target.length >= 1) { 410 position = Number(target.offset().top) || position; 411 $('html, body').animate({ 412 scrollTop : position - 110 413 }, 500, 'easeOutExpo'); 414 } 415 }); 416 } 417 $('a[href^="#"]').filter(function(){ 418 return $(this).parent().attr('id') != 'pagetop' && 419 !$(this).parent().parent().parent().hasClass('tabNav') && 420 !$(this).parent().parent().is('#chukiNav') && // for IR 421 !$(this).parent().parent().is('#skipLink') && 422 $(this).attr('href').indexOf('#modalWin') == -1 && 423 !$(this).hasClass('boxer'); 424 }).on('click.o', function() { 425 var target = $($(this).attr("href")), 426 position = 0; 427 if (target.length >= 1) { 428 position = Number(target.offset().top) || position; 429 $('html, body').animate({ 430 scrollTop : position - 110 431 }, 500, 'easeOutExpo'); 432 } 433 return; 434 }); 435 } 436 }; 437 438 TORAY.copyright = function(){ 439 var $copy = $('#copyright'), 440 tDate = new Date(), 441 tYear = "Copyright © "+tDate.getFullYear()+" Toray Coatex Co., Ltd."; 442 $copy.html(tYear); 443 }; 444 445 TORAY.pagetop = (function() { 446 if(!'debounce' in $) return; 447 var elm = '', 448 scTop = 90, 449 settings = function(){ 450 bindElement(); 451 if(elm.length > 0){ 452 setDefault(); 453 attachUIEvent(); 454 attachScrollEvent(); 455 } 456 }, 457 setDefault = function (){ 458 elm.children('a').attr('href','javascript:;'); 459 elm.css({ 460 '-webkit-transition': 'all 500ms cubic-bezier(.21,.66,.54,.94)', 461 '-moz-transition': 'all 500ms cubic-bezier(.21,.66,.54,.94)', 462 '-o-transition': 'all 500ms cubic-bezier(.21,.66,.54,.94)', 463 'transition': 'all 500ms cubic-bezier(.21,.66,.54,.94)', 464 '-webkit-transform': 'translateY(200px)', 465 'transform': 'translateY(200px)', 466 'display': 'block' 467 }); 468 }, 469 attachUIEvent = function(){ 470 elm.on('click.o touchend.o', 'a', function(){ 471 elm.css({'-webkit-transform': 'translateY(0px)','transform': 'translateY(0px)'}); 472 $('html, body').stop().animate({ 473 scrollTop : 0 474 }, 500, 'easeOutExpo'); 475 return; 476 }); 477 }, 478 attachScrollEvent = function(){ 479 $(window).on('scroll.o', $.debounce(110, function(){ 480 if ($(window).scrollTop() > scTop) { 481 elm.css({'-webkit-transform': 'translateY(0px)','transform': 'translateY(0px)'}); 482 } else { 483 elm.css({'-webkit-transform': 'translateY(200px)','transform': 'translateY(200px)'}); 484 } 485 })); 486 }, 487 bindElement = function(){ 488 elm = $('#pagetop'); 489 }; 490 return { 491 init:function(){ 492 settings(); 493 } 494 }; 495 }()); 496 497 $(function() { 498 TORAY.pagetop.init(); 499 TORAY.util.hashCtrl(); 500 TORAY.copyright(); 501 }); 502}(jQuery)); 503 504 505 506 507 508// SmartPhone Judgment 509//-------------------------------- 510function lowerAndroid(n) { 511 var bo = false; 512 var ua = navigator.userAgent.toLowerCase(); 513 var version = ua.substr(ua.indexOf('android')+8, 3); 514 if(ua.indexOf("android")) if(parseFloat(version) <= n) bo = true; 515 return bo; 516} 517 518// AutoHeight settings 519//-------------------------------- 520function runAutoHeight(){ 521 if($('body').attr('class')!= 'ie7' || 'ie8'){ 522 $('.chapterKV').removeAttr('style'); 523 $('#kvSlider.indexKV .bxslider div').css({'height':''}); 524 $('#kvProducts').removeAttr('style'); 525 } 526} 527 528// resetAutoHeight 529//-------------------------------- 530function resetAutoHeight(){ 531 var $winW = $(window).width(); 532 if($('body').attr('class')!= 'ie7' || 'ie8'){ 533 $('.chapterKV').css({'height':$winW});
534 $('#kvSlider.indexKV .bxslider div').css({'height':$winW}); 535 $('#kvProducts').css({'padding-top':$winW}); 536 } 537 538} 539 540// window close 541//-------------------------------- 542function clsWin(){ 543 window.opener = window; 544 var win = window.open(location.href,"_self"); 545 win.close(); 546} 547 548// Window Resize Event 549//-------------------------------- 550(function(){ 551 var $timer = false; 552 $(window).resize(function() { 553 if ($timer !== false) { 554 clearTimeout($timer); 555 } 556 $timer = setTimeout(function(){ 557 TORAY.resizeW = $(window).width(); 558 if(parseInt($(window).width())<768){ 559 resetAutoHeight(); 560 }else{ 561 resetAutoHeight(); 562 runAutoHeight(); 563 } 564 }, 200); 565 }); 566})(); 567 568 569/*===================================== 570Code to carry out after an HTML road 571=====================================*/ 572$(function(){ 573 574 //match height 575 $('.insideLinksWid li').matchHeight(); 576 $('ul[class*="fluid"]:not(.fluid) li').matchHeight(); 577 $('.row [class*="inner-col"]').matchHeight(); 578 $('.row [class*="img-cap"]').matchHeight(); 579 $('.linksWrap li').matchHeight(); 580 $('.inductionNav .inductionBox').matchHeight();//techhology 581 $('.inductionNav h2').matchHeight();//techhology 582 $('.filterColumn .columnBox').matchHeight();//techhology 583 $('.siblingsNav li span').matchHeight();//techhology 584 $('[class*="imgColumn"] li').matchHeight();//Older version of the grid system 585 586 // for Tablet 587 //-------------------------------- 588 if ($UA.isTablet) { 589 $("meta[name='viewport']").attr('content',''); 590 $('html').addClass('tablet'); 591 } 592 593 /* KV height adjust */ 594 if(parseInt(TORAY.winW)<768){ 595 var $winW = TORAY.winW; 596 if($('.chapterKV').length){ 597 $('.chapterKV').css({'height':$winW}); 598 } 599 } 600 601 // contactCover 602 //-------------------------------- 603 $(".contactCover").click(function(e){ 604 e.preventDefault(); 605 _this = $(this); 606 if(_this.attr("target") == "_blank"){ 607 window.open(_this.attr("href") + "?" + location.href.replace(/\?.*/,""), "contactwin"); 608 } else { 609 location.href = _this.attr("href") + "?" + location.href.replace(/\?.*/, ""); 610 } 611 }); 612 613 614 // tabSection 615 //-------------------------------- 616 if($('.tabSection').length){ 617 $('.tabSection').each(function(){ 618 if(!$(".tabBtns li a",this).length){ 619 var $h = $(".tabBtns li",this); 620 var $e = $(".tabElement",this); 621 $h.eq(0).addClass('active'); 622 $e.addClass('none'); 623 $e.eq(0).removeClass('none'); 624 $e.eq(0).addClass('block'); 625 626 $h.click(function() { 627 var num = $h.index(this); 628 $e.addClass('none'); 629 $e.removeClass('block'); 630 $e.eq(num).removeClass('none'); 631 $h.removeClass('active'); 632 $(this).addClass('active'); 633 }); 634 } 635 }); 636 } 637 638 // sidebar 639 //-------------------------------- 640 if($('#sidebar').length){ 641 $('#sidebar dl dd ul:first-child').spSidebar(); 642 } 643 644 // Accordion 645 //-------------------------------- 646 $('.accoTab').each(function(){ 647 $(this).easyResponsiveTabs({ 648 type: 'default', //Types: default, vertical, accordion 649 width: 'auto', //auto or any width like 600px 650 fit: true // 100% fit in a container 651 }); 652 }); 653 654 $('.verticalTab').each(function(){ 655 $(this).easyResponsiveTabs({ 656 type: 'vertical', 657 width: 'auto', 658 fit: true 659 }); 660 }); 661 662 // products photo 663 //-------------------------------- 664 if($('.productDetail').length){ 665 var click_flg = false, 666 $pd = $('.productDetail'), 667 $photo = $("#proPhoto"), 668 $media = $('#mediaWrap',$pd); 669 $("#proThumb a").on('click',function(e){ 670 if(click_flg == false) { 671 click_flg = true; 672 if($(this).hasClass('media')){ 673 e.preventDefault(); 674 var $target = $(this).attr('data-label'); 675 $photo.children().eq(0).before($($target).clone()); 676 // $($target).addClass('current'); 677 }else{ 678 $photo.children().eq(0).before("<img src='"+$(this).attr("href")+"' alt=''>"); 679 } 680 $photo.children().eq(1).stop(true, false).fadeOut("fast",function(){ 681 $(this).remove(); 682 click_flg = false; 683 }); 684 return false; 685 }else{ 686 return false; 687 } 688 });
689 } 690 691 // products photo 692 //-------------------------------- 693 $.fn.slideFadeToggle = function(speed, easing, callback) { 694 return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback); 695 }; 696 697 // Accordion 698 //-------------------------------- 699 if($('.accWrap').length){ 700 var locationSearch = window.location.search.substr(1); 701 if( locationSearch !== '' && locationSearch.indexOf('bTabOpen=') !== -1 ){ 702 var tabNo = locationSearch.replace ('bTabOpen=',''); 703 $('.accWrap .accHead').filter(':eq('+tabNo+')').trigger('click'); 704 $('.accWrap .accHead').filter(':eq('+tabNo+')').addClass('accordion-open').removeClass('accordion-close'); 705 } 706 } 707 708 709 // iframe height 710 //-------------------------------- 711 if(parseInt($(window).width())<768 && $('.iframePress').length){ 712 $('.iframePress').attr('scrolling','yes'); 713 } 714 715 if($('.iframePress').length){ 716 var obj = $('.iframePress'); 717 obj.on('load',function(){ 718 $(window).scrollTop(0); 719 }); 720 } 721 722 723 // inductionNav [for /technology] 724 //-------------------------------- 725 if($(".inductionNav").length){ 726 $(".inductionNav").each(function() { 727 $(this).children().eq(0).addClass('firstChild'); 728 }); 729 } 730 731});// END 732 733 734/*===================================== 735Code to carry out after an HTML and Images road 736=====================================*/ 737jQuery.event.add(window, "load", function(){ 738 739 //autoHeight 740 //-------------------------------- 741 if(!$UA.SP && $(window).width()>=768){ 742 resetAutoHeight(); 743 runAutoHeight(); 744 } 745 746});//END 747 748 749/*===================================== 750Plugins 751=====================================*/ 752(function($) { 753 $.extend({ 754 /****** tab ******/ 755 tab : function(){ 756 var obj = $.extend({ 757 trigger : $(".tabNav a"), 758 targets : $(".linksWrap"), 759 currentClass : "on", 760 dontScrollClass : "dontScroll" 761 },obj || {}); 762 763 obj 764 .trigger 765 .addClass(obj.dontScrollClass) 766 .click(function(){ 767 768 var target = $(this).attr("href"); 769 $(this) 770 .parent() 771 .addClass(obj.currentClass) 772 .siblings() 773 .removeClass(obj.currentClass); 774 775 $(target).show().siblings().hide(); 776 return false; 777 778 }) 779 .focus(function(){ 780 $(this).blur(); 781 }); 782 783 var locationSearch = window.location.search.substr(1); 784 if( locationSearch !== '' && locationSearch.indexOf('bTabOpen=') !== -1 ){ 785 var tabNo = locationSearch.replace ('bTabOpen=',''); 786 obj.trigger.filter(':eq('+tabNo+')').trigger('click'); 787 } 788 } 789 }); 790 791 $.fn.extend({ 792 /****** sidebar ******/ 793 spSidebar : function(){ 794 var $li = $('li.spAppear',this); 795 $li.clone(true) 796 .addClass('appear') 797 .removeClass('spAppear') 798 .appendTo(this); 799 }, 800 /****** Accordion ******/ 801 easyResponsiveTabs: function (options) { 802 //Set the default values, use comma to separate the settings, example: 803 var defaults = { 804 type: 'default', //default, vertical, accordion; 805 width: 'auto', 806 fit: true 807 }; 808 //Variables 809 var options = $.extend(defaults, options); 810 var opt = options, jtype = opt.type, jfit = opt.fit, jwidth = opt.width, vtabs = 'vertical', accord = 'accordion'; 811 //Main function 812 this.each(function () { 813 var $respTabs = $(this); 814 $respTabs.find('ul.accoTab-list li').addClass('resp-tab-item'); 815 $respTabs.css({ 816 'display': 'block', 817 'width': jwidth 818 }); 819 $respTabs.find('.accoTab-container > div').addClass('resp-tab-content'); 820 jtab_options(); 821 //Properties Function 822 function jtab_options() { 823 if (jtype == vtabs) { 824 $respTabs.addClass('resp-vtabs'); 825 } 826 if (jfit == true) { 827 $respTabs.css({ width: '100%', margin: '0px' }); 828 } 829 if (jtype == accord) { 830 $respTabs.addClass('resp-easy-accordion'); 831 $respTabs.find('.accoTab-list').css('display', 'none'); 832 } 833 } 834 //Assigning the h2 markup 835 var $tabItemh2; 836 $respTabs.find('.resp-tab-content').before("<h2 class='resp-accordion' role='tab'><span class='resp-arrow'></span></h2>"); 837 var itemCount = 0; 838 $respTabs.find('.resp-accordion').each(function () { 839 $tabItemh2 = $(this); 840 var innertext = $respTabs.find('.resp-tab-item:eq(' + itemCount + ')').text(); 841 $respTabs.find('.resp-accordion:eq(' + itemCount + ')').append(innertext); 842 $tabItemh2.attr('aria-controls', 'tab_item-' + (item
842Count)); 843 itemCount++; 844 }); 845 //Assigning the 'aria-controls' to Tab items 846 var count = 0, 847 $tabContent; 848 $respTabs.find('.resp-tab-item').each(function () { 849 $tabItem = $(this); 850 $tabItem.attr('aria-controls', 'tab_item-' + (count)); 851 $tabItem.attr('role', 'tab'); 852 //First active tab 853 $respTabs.find('.resp-tab-item').first().addClass('resp-tab-active'); 854 $respTabs.find('.resp-accordion').first().addClass('resp-tab-active'); 855 $respTabs.find('.resp-tab-content').first().addClass('resp-tab-content-active').attr('style', 'display:block'); 856 //Assigning the 'aria-labelledby' attr to tab-content 857 var tabcount = 0; 858 $respTabs.find('.resp-tab-content').each(function () { 859 $tabContent = $(this); 860 $tabContent.attr('aria-labelledby', 'tab_item-' + (tabcount)); 861 tabcount++; 862 }); 863 count++; 864 }); 865 //Tab Click action function 866 $respTabs.find("[role=tab]").each(function () { 867 var $currentTab = $(this); 868 $currentTab.click(function () { 869 var $tabAria = $currentTab.attr('aria-controls'); 870 if ($currentTab.hasClass('resp-accordion') && $currentTab.hasClass('resp-tab-active')) { 871 $respTabs.find('.resp-tab-content-active').slideUp('', function () { $(this).addClass('resp-accordion-closed'); }); 872 $currentTab.removeClass('resp-tab-active'); 873 return false; 874 } 875 if (!$currentTab.hasClass('resp-tab-active') && $currentTab.hasClass('resp-accordion')) { 876 $respTabs.find('.resp-tab-active').removeClass('resp-tab-active'); 877 $respTabs.find('.resp-tab-content-active').slideUp().removeClass('resp-tab-content-active resp-accordion-closed'); 878 $respTabs.find("[aria-controls=" + $tabAria + "]").addClass('resp-tab-active'); 879 $respTabs.find('.resp-tab-content[aria-labelledby = ' + $tabAria + ']').slideDown().addClass('resp-tab-content-active'); 880 } else { 881 $respTabs.find('.resp-tab-active').removeClass('resp-tab-active'); 882 $respTabs.find('.resp-tab-content-active').removeAttr('style').removeClass('resp-tab-content-active').removeClass('resp-accordion-closed'); 883 $respTabs.find("[aria-controls=" + $tabAria + "]").addClass('resp-tab-active'); 884 $respTabs.find('.resp-tab-content[aria-labelledby = ' + $tabAria + ']').addClass('resp-tab-content-active').attr('style', 'display:block'); 885 } 886 }); 887 //Window resize function 888 $(window).resize(function () { 889 $respTabs.find('.resp-accordion-closed').removeAttr('style'); 890 }); 891 }); 892 }); 893} 894 }); 895})(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.