1$(function (){ 2 document.createElement("picture"); 3 4 function menuFixed() { 5 $('.menu-box-empty').height(headerCont.outerHeight()) 6 7 var offset = header.offset().top + header.height(); 8 9 if($(window).scrollTop() > offset) { 10 headerCont.addClass('scroll'); 11 $('.menu-box-empty').show() 12 } else { 13 headerCont.removeClass('scroll'); 14 $('.menu-box-empty').hide() 15 } 16 17 } 18 19 if ($('.nav-wrap').length > 0) { 20 21 /* nav fixed */ 22 var wW = $(window).width(); 23 var header = $(".nav-wrap"); 24 var headerCont = header.children('.bootsnav') 25 var navHeight = 120; 26 27 if (wW >991) { 28 $(window).scroll(function () { 29 menuFixed() 30 }); 31 32 $(window).scroll() 33 } 34 } 35 36 37 // pc端æç´¢ 38 $('.search-trigger').on('click', function(e){ 39 if(!$('.search-box').hasClass('x-show')){ 40 e.stopPropagation(); 41 $('.search-box').addClass('x-show'); 42 } 43 }); 44 45 $('.search-box').on('click', function(e){ 46 e.stopPropagation(); 47 }); 48 49 $(document).on('click', function(){ 50 if($('.search-box').hasClass('x-show')){ 51 $('.search-box').removeClass('x-show'); 52 } 53 }); 54 55 56 /*è¿åé¡¶é¨*/ 57 $(".toTop").bind("click", function() { 58 $("body,html").animate({ scrollTop: 0 }, 300) 59 }) 60 61 $('.public-tab-groups .title-groups a').hover(function (){ 62 var index = $(this).index(); 63 $(this).addClass('active').siblings().removeClass('active') 64 $(this).parent('.title-groups').siblings('.title-more').children('a').eq(index).css('display','block').siblings('a').css('display','none'); 65 $(this).parents('.tabs-title').siblings('.tabs-cont').children('div').eq(index).show().siblings('div').hide(); 66 }) 67}); 68 69/*Bootsnav*/ 70(function ($) { 71 "use strict"; 72 73 var bootsnav = { 74 initialize: function() { 75 this.event(); 76 this.hoverDropdown(); 77 this.navbarSticky(); 78 this.navbarScrollspy(); 79 }, 80 event : function(){ 81 82 // ------------------------------------------------------------------------------ // 83 // Variable 84 // ------------------------------------------------------------------------------ // 85 var getNav = $("nav.navbar.bootsnav"); 86 87 // ------------------------------------------------------------------------------ // 88 // Navbar Sticky 89 // ------------------------------------------------------------------------------ // 90 var navSticky = getNav.hasClass("navbar-sticky"); 91 if( navSticky ){ 92 // Wraped navigation 93 getNav.wrap("<div class='wrap-sticky'></div>"); 94 } 95 96 // ------------------------------------------------------------------------------ // 97 // Navbar Center 98 // ------------------------------------------------------------------------------ // 99 if( getNav.hasClass("brand-center")){ 100 var postsArr = new Array(), 101 index = $("nav.brand-center"), 102 $postsList = index.find('ul.navbar-nav'); 103 104 index.prepend("<span class='storage-name' style='display:none;'></span>"); 105 106 //Create array of all posts in lists 107 index.find('ul.navbar-nav > li').each(function(){ 108 if( $(this).hasClass("active") ){ 109 var getElement = $("a", this).eq(0).text(); 110 $(".storage-name").html(getElement); 111 } 112 postsArr.push($(this).html()); 113 }); 114 115 //Split the array at this point. The original array is altered. 116 var firstList = postsArr.splice(0, Math.round(postsArr.length / 2)), 117 secondList = postsArr, 118 ListHTML = ''; 119 120 var createHTML = function(list){ 121 ListHTML = ''; 122 for (var i = 0; i < list.length; i++) { 123 ListHTML += '<li>' + list[i] + '</li>' 124 } 125 } 126 127 //Generate HTML for first list 128 createHTML(firstList); 129 $postsList.html(ListHTML); 130 index.find("ul.nav").first().addClass("navbar-left"); 131 132 //Generate HTML for second list 133 createHTML(secondList); 134 //Create new list after original one 135 $postsList.after('<ul class="nav navbar-nav"></ul>').next().html(ListHTML); 136 index.find("ul.nav").last().addClass("navbar-right"); 137 138 //Wrap navigation menu 139 index.find("ul.nav.navbar-left").wrap("<div class='col-half left'></div>"); 140 index.find("ul.nav.navbar-right").wrap("<div class='col-half right'></div>"); 141 142 //Selection Class 143 index.find('ul.navbar-nav > li').each(function(){ 144 var dropDown = $("ul.dropdown-menu", this), 145 megaMenu = $("ul.megamenu-content", this); 146 dropDown.closest("li").addClass("dropdown"); 147 megaMenu.closest("li").addClass("megamenu-fw"); 148 }); 149 150 var getName = $(".storage-name").html(); 151 if( !getName == "" ){ 152 $( "ul.navbar-nav > li:contains('" + getName + "')" ).addClass("active"); 153 } 154 } 155 156 157 // ------------------------------------------------------------------------------ // 158 // Navbar Sidebar 159 // ------------------------------------------------------------------------------ // 160 if( getNav.hasClass("navbar-sidebar")){ 161 // Add Class to body 162 $("body").addClass("wrap-nav-sidebar"); 163 getNav.wrapInner("<div class='scroller'></div>"); 164 }else{ 165 $(".bootsnav").addClass("on"); 166 } 167 168 // ------------------------------------------------------------------------------ // 169 // Menu Center 170 // ------------------------------------------------------------------------------ // 171 if( getNav.find("ul.nav").hasClass("navbar-center")){ 172 getNav.addClass("menu-center"); 173 } 174 175 // ------------------------------------------------------------------------------ // 176 // Navbar Full 177 // ------------------------------------------------------------------------------ // 178 if( getNav.hasClass("navbar-full")){ 179 // Add Class to body 180 $("nav.navbar.bootsnav").find("ul.nav").wrap("<div class='wrap-full-menu'></div>"); 181 $(".wrap-full-menu").wrap("<div class='nav-full'></div>"); 182 $("ul.nav.navbar-nav").prepend("<li class='close-full-menu'><a href='#'><i class='fa fa-times'></i></a></li>"); 183 }else if( getNav.hasClass("navbar-mobile")){ 184 getNav.removeClass("no-full"); 185 }else{ 186 getNav.addClass("no-full"); 187 } 188 189 // ------------------------------------------------------------------------------ // 190 // Navbar Mobile 191 // ------------------------------------------------------------------------------ // 192 if( getNav.hasClass("navbar-mobile")){ 193 // Add Class to body 194 $('.navbar-collapse').on('shown.bs.collapse', function() { 195 $("body").addClass("side-right"); 196 }); 197 $('.navbar-collapse').on('hide.bs.collapse', function() { 198 $("body").removeClass("side-right"); 199 }); 200 201 $(window).on("resize", function(){ 202 $("body").removeClass("side-right"); 203 }); 204 } 205 206 // ------------------------------------------------------------------------------ // 207 // Navbar Fixed 208 // ------------------------------------------------------------------------------ // 209 if( getNav.hasClass("no-background")){ 210 $(window).on("scroll", function(){ 211 var scrollTop = $(window).scrollTop(); 212 if(scrollTop >34){ 213 $(".navbar-fixed").removeClass("no-background"); 214 }else { 215 $(".navbar-fixed").addClass("no-background"); 216 } 217 }); 218 } 219 220 // ------------------------------------------------------------------------------ // 221 // Navbar Fixed 222 // ------------------------------------------------------------------------------ // 223 if( getNav.hasClass("navbar-transparent")){ 224 $(window).on("scroll", function(){ 225 var scrollTop = $(window).scrollTop(); 226 if(scrollTop >34){ 227 $(".navbar-fixed").removeClass("navbar-transparent"); 228 }else { 229 $(".navbar-fixed").addClass("navbar-transparent"); 230 } 231 }); 232 } 233 234 // ------------------------------------------------------------------------------ // 235 // Button Cart 236 // ------------------------------------------------------------------------------ // 237 $(".btn-cart").on("click", function(e){
238 e.stopPropagation(); 239 }); 240 241 // ------------------------------------------------------------------------------ // 242 // Toggle Search 243 // ------------------------------------------------------------------------------ // 244 $("nav.navbar.bootsnav .attr-nav").each(function(){ 245 $("li.search > a", this).on("click", function(e){ 246 e.preventDefault(); 247 $(".top-search").slideToggle(); 248 }); 249 }); 250 $(".input-group-addon.close-search").on("click", function(){ 251 $(".top-search").slideUp(); 252 }); 253 254 // ------------------------------------------------------------------------------ // 255 // Toggle Side Menu 256 // ------------------------------------------------------------------------------ // 257 $("nav.navbar.bootsnav .attr-nav").each(function(){ 258 $("li.side-menu > a", this).on("click", function(e){ 259 e.preventDefault(); 260 $("nav.navbar.bootsnav > .side").toggleClass("on"); 261 $("body").toggleClass("on-side"); 262 }); 263 }); 264 $(".side .close-side").on("click", function(e){ 265 e.preventDefault(); 266 $("nav.navbar.bootsnav > .side").removeClass("on"); 267 $("body").removeClass("on-side"); 268 }); 269 270 271 272 // ------------------------------------------------------------------------------ // 273 // Wrapper 274 // ------------------------------------------------------------------------------ // 275 $("body").wrapInner( "<div class='wrapper'></div>"); 276 }, 277 278 279 // ------------------------------------------------------------------------------ // 280 // Change dropdown to hover on dekstop 281 // ------------------------------------------------------------------------------ // 282 hoverDropdown : function(){ 283 var getNav = $("nav.navbar.bootsnav"), 284 getWindow = $(window).width(), 285 getHeight = $(window).height(), 286 getIn = getNav.find("ul.nav").data("in"), 287 getOut = getNav.find("ul.nav").data("out"); 288 289 if( getWindow < 991 ){ 290 291 // Height of scroll navigation sidebar 292 $(".scroller").css("height", "auto"); 293 294 // Disable mouseenter event 295 $("nav.navbar.bootsnav ul.nav").find("li.dropdown").off("mouseenter"); 296 $("nav.navbar.bootsnav ul.nav").find("li.dropdown").off("mouseleave"); 297 $("nav.navbar.bootsnav ul.nav").find(".title").off("mouseenter"); 298 $("nav.navbar.bootsnav ul.nav").off("mouseleave"); 299 $(".navbar-collapse").removeClass("animated"); 300 301 // Enable click event 302 $("nav.navbar.bootsnav ul.nav").each(function(){ 303 $(".dropdown-menu", this).addClass("animated"); 304 $(".dropdown-menu", this).removeClass(getOut); 305 306 // Dropdown Fade Toggle 307 $("a.dropdown-toggle", this).off('click'); 308 $("a.dropdown-toggle", this).on('click', function (e) { 309 e.stopPropagation(); 310 $(this).closest("li.dropdown").find(".dropdown-menu").first().stop().fadeToggle().toggleClass(getIn); 311 $(this).closest("li.dropdown").first().toggleClass("on"); 312 // æ°æ·»å å¯¼èªæ¶èµ· 313 $(this).closest("li.dropdown").first().siblings('li').find(".dropdown-menu").stop().hide().removeClass(getOut);; 314 $(this).closest("li.dropdown").first().stop().fadeIn().addClass(getIn); 315 $(this).closest("li.dropdown").first().siblings('li').removeClass('on') 316 return false; 317 }); 318 319 // Hidden dropdown action 320 $('li.dropdown', this).each(function () { 321 $(this).find(".dropdown-menu").stop().fadeOut(); 322 $(this).on('hidden.bs.dropdown', function () { 323 $(this).find(".dropdown-menu").stop().fadeOut(); 324 }); 325 return false; 326 }); 327 328 // Megamenu style 329 $(".megamenu-fw", this).each(function(){ 330 $(".col-menu", this).each(function(){ 331 $(".content", this).addClass("animated"); 332 $(".content", this).stop().fadeOut(); 333 $(".title", this).off("click"); 334 $(".title", this).on("click", function(){ 335 $(this).closest(".col-menu").find(".content").stop().fadeToggle().addClass(getIn); 336 $(this).closest(".col-menu").toggleClass("on"); 337 return false; 338 }); 339 340 $(".content", this).on("click", function(e){
341 e.stopPropagation(); 342 }); 343 }); 344 }); 345 }); 346 347 // Hidden dropdown 348 var cleanOpen = function(){ 349 $('li.dropdown', this).removeClass("on"); 350 $(".dropdown-menu", this).stop().fadeOut(); 351 $(".dropdown-menu", this).removeClass(getIn); 352 $(".col-menu", this).removeClass("on"); 353 $(".col-menu .content", this).stop().fadeOut(); 354 $(".col-menu .content", this).removeClass(getIn); 355 } 356 357 // Hidden om mouse leave 358 $("nav.navbar.bootsnav").on("mouseleave", function(){ 359 cleanOpen(); 360 }); 361 362 // Enable click atribute navigation 363 $("nav.navbar.bootsnav .attr-nav").each(function(){ 364 $(".dropdown-menu", this).removeClass("animated"); 365 $("li.dropdown", this).off("mouseenter"); 366 $("li.dropdown", this).off("mouseleave"); 367 $("a.dropdown-toggle", this).off('click'); 368 $("a.dropdown-toggle", this).on('click', function (e) { 369 e.stopPropagation(); 370 $(this).closest("li.dropdown").find(".dropdown-menu").first().stop().fadeToggle(); 371 $(".navbar-toggle").each(function(){ 372 $(".fa", this).removeClass("fa-times"); 373 $(".fa", this).addClass("fa-bars"); 374 $(".navbar-collapse").removeClass("in"); 375 $(".navbar-collapse").removeClass("on"); 376 }); 377 }); 378 379 $(this).on("mouseleave", function(){ 380 $(".dropdown-menu", this).stop().fadeOut(); 381 $("li.dropdown", this).removeClass("on"); 382 return false; 383 }); 384 }); 385 386 // Toggle Bars 387 $(".navbar-toggle").each(function(){ 388 $(this).off("click"); 389 $(this).on("click", function(){ 390 $(".fa", this).toggleClass("fa-bars"); 391 $(".fa", this).toggleClass("fa-times"); 392 cleanOpen(); 393 }); 394 }); 395 396 }else if( getWindow > 991 ){ 397 // Height of scroll navigation sidebar 398 $(".scroller").css("height", getHeight + "px"); 399 400 // Navbar Sidebar 401 if( getNav.hasClass("navbar-sidebar")){ 402 // Hover effect Sidebar Menu 403 $("nav.navbar.bootsnav ul.nav").each(function(){ 404 $("a.dropdown-toggle", this).off('click'); 405 $("a.dropdown-toggle", this).on('click', function (e) { 406 e.stopPropagation(); 407 }); 408 409 $(".dropdown-menu", this).addClass("animated"); 410 $("li.dropdown", this).on("mouseenter", function(){ 411 $(".dropdown-menu", this).eq(0).removeClass(getOut); 412 $(".dropdown-menu", this).eq(0).stop().fadeIn().addClass(getIn); 413 $(this).addClass("on"); 414 return false; 415 }); 416 417 $(".col-menu").each(function(){ 418 $(".content", this).addClass("animated"); 419 $(".title", this).on("mouseenter", function(){ 420 $(this).closest(".col-menu").find(".content").stop().fadeIn().addClass(getIn); 421 $(this).closest(".col-menu").addClass("on"); 422 return false; 423 }); 424 }); 425 426 $(this).on("mouseleave", function(){ 427 $(".dropdown-menu", this).stop().removeClass(getIn); 428 $(".dropdown-menu", this).stop().addClass(getOut).fadeOut(); 429 $(".col-menu", this).find(".content").stop().fadeOut().removeClass(getIn); 430 $(".col-menu", this).removeClass("on"); 431 $("li.dropdown", this).removeClass("on"); 432 return false; 433 }); 434 }); 435 }else{ 436 // Hover effect Default Menu 437 $("nav.navbar.bootsnav ul.nav").each(function(){ 438 $("a.dropdown-toggle", this).off('click'); 439 $("a.dropdown-toggle", this).on('click', function (e) { 440 e.stopPropagation(); 441 }); 442 443 $(".megamenu-fw", this).each(function(){ 444 $(".title", this).off("click"); 445 //$("a.dropdown-toggle", this).off("click"); 446 $(".content").removeClass("animated"); 447 }); 448 449 $(".dropdown-menu", this).addClass("animated"); 450 $("li.dropdown", this).on("mouseenter", function(){ 451 $(".dropdown-menu", this).eq(0).removeClass(getOut); 452 $(".dropdown-menu", this).eq(0).stop().fadeIn().addClass(getIn); 453 $(this).addClass("on"); 454 return false; 455 }); 456 457 $("li.dropdown", this).on("mouseleave", function(){ 458 $(".dropdown-menu", this).eq(0).removeClass(getIn); 459 $(".dropdown-menu", this).eq(0).stop().fadeOut().addClass(getOut); 460 $(this).removeClass("on"); 461 }); 462 463 $(this).on("mouseleave", function(){ 464 $(".dropdown-menu", this).removeClass(getIn); 465 $(".dropdown-menu", this).eq(0).stop().fadeOut().addClass(getOut); 466 $("li.dropdown", this).removeClass("on"); 467 return false; 468 }); 469 }); 470 } 471 472 // ------------------------------------------------------------------------------ // 473 // Hover effect Atribute Navigation 474 // ------------------------------------------------------------------------------ // 475 $("nav.navbar.bootsnav .attr-nav").each(function(){ 476 $("a.dropdown-toggle", this).off('click'); 477 $("a.dropdown-toggle", this).on('click', function (e) { 478 e.stopPropagation(); 479 }); 480 481 $(".dropdown-menu", this).addClass("animated"); 482 $("li.dropdown", this).on("mouseenter", function(){ 483 $(".dropdown-menu", this).eq(0).removeClass(getOut); 484 $(".dropdown-menu", this).eq(0).stop().fadeIn().addClass(getIn); 485 $(this).addClass("on"); 486 return false; 487 }); 488 489 $("li.dropdown", this).on("mouseleave", function(){ 490 $(".dropdown-menu", this).eq(0).removeClass(getIn); 491 $(".dropdown-menu", this).eq(0).stop().fadeOut().addClass(getOut); 492 $(this).removeClass("on"); 493 }); 494 495 $(this).on("mouseleave", function(){ 496 $(".dropdown-menu", this).removeClass(getIn); 497 $(".dropdown-menu", this).eq(0).stop().fadeOut().addClass(getOut); 498 $("li.dropdown", this).removeClass("on"); 499 return false; 500 }); 501 }); 502 } 503 504 // ------------------------------------------------------------------------------ // 505 // Menu Fullscreen 506 // ------------------------------------------------------------------------------ // 507 if( getNav.hasClass("navbar-full")){ 508 var windowHeight = $(window).height(), 509 windowWidth = $(window).width(); 510 511 $(".nav-full").css("height", windowHeight + "px"); 512 $(".wrap-full-menu").css("height", windowHeight + "px"); 513 $(".wrap-full-menu").css("width", windowWidth + "px"); 514 515 $(".navbar-collapse").addClass("animated"); 516 $(".navbar-toggle").each(function(){ 517 var getId = $(this).data("target"); 518 $(this).off("click"); 519 $(this).on("click", function(e){
520 e.preventDefault(); 521 $(getId).removeClass(getOut); 522 $(getId).addClass("in"); 523 $(getId).addClass(getIn); 524 return false; 525 }); 526 527 $("li.close-full-menu").on("click", function(e){ 528 e.preventDefault(); 529 $(getId).addClass(getOut); 530 setTimeout(function(){ 531 $(getId).removeClass("in"); 532 $(getId).removeClass(getIn); 533 }, 500); 534 return false; 535 }); 536 }); 537 } 538 }, 539 540 // ------------------------------------------------------------------------------ // 541 // Navbar Sticky 542 // ------------------------------------------------------------------------------ // 543 navbarSticky : function(){ 544 var getNav = $("nav.navbar.bootsnav"), 545 navSticky = getNav.hasClass("navbar-sticky"); 546 547 if( navSticky ){ 548 549 // Set Height Navigation 550 var getHeight = getNav.height(); 551 $(".wrap-sticky").height(getHeight); 552
553 // Windown on scroll 554 var getOffset = $(".wrap-sticky").offset().top; 555 $(window).on("scroll", function(){ 556 var scrollTop = $(window).scrollTop(); 557 if(scrollTop > getOffset){ 558 getNav.addClass("sticked"); 559 }else { 560 getNav.removeClass("sticked"); 561 } 562 }); 563 } 564 }, 565 566 // ------------------------------------------------------------------------------ // 567 // Navbar Scrollspy 568 // ------------------------------------------------------------------------------ // 569 navbarScrollspy : function(){ 570 var navScrollSpy = $(".navbar-scrollspy"), 571 $body = $('body'), 572 getNav = $('nav.navbar.bootsnav'), 573 offset = getNav.outerHeight(); 574 575 if( navScrollSpy.length ){ 576 $body.scrollspy({target: '.navbar', offset: offset }); 577 578 // Animation Scrollspy 579 $('.scroll').on('click', function(event) { 580 event.preventDefault(); 581 582 // Active link 583 $('.scroll').removeClass("active"); 584 $(this).addClass("active"); 585 586 // Remove navbar collapse 587 $(".navbar-collapse").removeClass("in"); 588 589 // Toggle Bars 590 $(".navbar-toggle").each(function(){ 591 $(".fa", this).removeClass("fa-times"); 592 $(".fa", this).addClass("fa-bars"); 593 }); 594 595 // Scroll 596 var scrollTop = $(window).scrollTop(), 597 $anchor = $(this).find('a'), 598 $section = $($anchor.attr('href')).offset().top, 599 $window = $(window).width(), 600 $minusDesktop = getNav.data("minus-value-desktop"), 601 $minusMobile = getNav.data("minus-value-mobile"), 602 $speed = getNav.data("speed"); 603 604 if( $window > 992 ){ 605 var $position = $section - $minusDesktop; 606 }else{ 607 var $position = $section - $minusMobile; 608 } 609 610 $('html, body').stop().animate({ 611 scrollTop: $position 612 }, $speed); 613 }); 614 615 // Activate Navigation 616 var fixSpy = function() { 617 var data = $body.data('bs.scrollspy'); 618 if (data) { 619 offset = getNav.outerHeight(); 620 data.options.offset = offset; 621 $body.data('bs.scrollspy', data); 622 $body.scrollspy('refresh'); 623 } 624 } 625 626 // Activate Navigation on resize 627 var resizeTimer; 628 $(window).on('resize', function() { 629 clearTimeout(resizeTimer); 630 var resizeTimer = setTimeout(fixSpy, 200); 631 }); 632 } 633 } 634 }; 635 636 // Initialize 637 $(document).ready(function(){ 638 bootsnav.initialize(); 639 }); 640 641 // Reset on resize 642 $(window).on("resize", function(){ 643 bootsnav.hoverDropdown(); 644 setTimeout(function(){
645 bootsnav.navbarSticky(); 646 }, 500); 647 648 // Toggle Bars 649 $(".navbar-toggle").each(function(){ 650 $(".fa", this).removeClass("fa-times"); 651 $(".fa", this).addClass("fa-bars"); 652 $(this).removeClass("fixed"); 653 }); 654 $(".navbar-collapse").removeClass("in"); 655 $(".navbar-collapse").removeClass("on"); 656 $(".navbar-collapse").removeClass("bounceIn"); 657 }); 658 659}(jQuery)); 660 661/*-------------------------------å享---------------------------------*/ 662!function(a){"use strict";function u(r,t,e,n){var o=a(e,t);o.addData(r),o.make(),n=n||0;var i=o.getModuleCount(),h=o.getModuleCount()+2*n;this.text=r,this.level=t,this.version=e,this.moduleCount=h,this.isDark=function(r,t){return t-=n,!((r-=n)<0||i<=r||t<0||i<=t)&&o.isDark(r,t)},this.addBlank=function(a,u,f,c){var s=this.isDark,l=1/h;this.isDark=function(r,t){var e=t*l,n=r*l,o=e+l,i=n+l;return s(r,t)&&(o<a||f<e||i<u||c<n)}}}function g(r,t,e,n,o){e=Math.max(1,e||1),n=Math.min(40,n||40);for(var i=e;i<=n;i+=1)try{return new u(r,t,i,o)}catch(r){}}function i(r,t,e){d(e.background).is("img")?t.drawImage(e.background,0,0,e.size,e.size):e.background&&(t.fillStyle=e.background,t.fillRect(e.left,e.top,e.size,e.size));var n=e.mode;1===n||2===n?function(r,t,e){var n=e.size,o="bold "+e.mSize*n+"px "+e.fontname,i=d("<canvas/>")[0].getContext("2d");i.font=o;var a=i.measureText(e.label).width,u=e.mSize,f=a/n,c=(1-f)*e.mPosX,s=(1-u)*e.mPosY,l=c+f,h=s+u;1===e.mode?r.addBlank(0,s-.01,n,h+.01):r.addBlank(c-.01,s-.01,.01+l,h+.01),t.fillStyle=e.fontcolor,t.font=o,t.fillText(e.label,c*n,s*n+.75*e.mSize*n)}(r,t,e):3!==n&&4!==n||function(r,t,e){var n=e.size,o=e.image.naturalWidth||1,i=e.image.naturalHeight||1,a=e.mSize,u=a*o/i,f=(1-u)*e.mPosX,c=(1-a)*e.mPosY,s=f+u,l=c+a;3===e.mode?r.addBlank(0,c-.01,n,l+.01):r.addBlank(f-.01,c-.01,.01+s,l+.01),t.drawImage(e.image,f*n,c*n,u*n,a*n)}(r,t,e)}function c(r,t,e,n,o,i,a,u){r.isDark(a,u)&&t.rect(n,o,i,i)}function s(r,t,e,n,o,i,a,u){var f=r.isDark,c=n+i,s=o+i,l=e.radius*i,h=a-1,g=a+1,d=u-1,v=u+1,p=f(a,u),w=f(h,d),m=f(h,u),y=f(h,v),k=f(a,v),T=f(g,v),b=f(g,u),C=f(g,d),B=f(a,d);p?function(r,t,e,n,o,i,a,u,f,c){a?r.moveTo(t+i,e):r.moveTo(t,e),u?(r.lineTo(n-i,e),r.arcTo(n,e,n,o,i)):r.lineTo(n,e),f?(r.lineTo(n,o-i),r.arcTo(n,o,t,o,i)):r.lineTo(n,o),c?(r.lineTo(t+i,o),r.arcTo(t,o,t,e,i)):r.lineTo(t,o),a?(r.lineTo(t,e+i),r.arcTo(t,e,n,e,i)):r.lineTo(t,e)}(t,n,o,c,s,l,!m&&!B,!m&&!k,!b&&!k,!b&&!B):function(r,t,e,n,o,i,a,u,f,c){a&&(r.moveTo(t+i,e),r.lineTo(t,e),r.lineTo(t,e+i),r.arcTo(t,e,t+i,e,i)),u&&(r.moveTo(n-i,e),r.lineTo(n,e),r.lineTo(n,e+i),r.arcTo(n,e,n-i,e,i)),f&&(r.moveTo(n-i,o),r.lineTo(n,o),r.lineTo(n,o-i),r.arcTo(n,o,n-i,o,i)),c&&(r.moveTo(t+i,o),r.lineTo(t,o),r.lineTo(t,o-i),r.arcTo(t,o,t+i,o,i))}(t,n,o,c,s,l,m&&B&&w,m&&k&&y,b&&k&&T,b&&B&&C)}function e(r,t){var e=g(t.text,t.ecLevel,t.minVersion,t.maxVersion,t.quiet);if(!e)return null;var n=d(r).data("qrcode",e),o=n[0].getContext("2d");return i(e,o,t),function(r,t,e){var n,o,i=r.moduleCount,a=e.size/i,u=c;for(l&&0<e.radius&&e.radius<=.5&&(u=s),t.beginPath(),n=0;n<i;n+=1)for(o=0;o<i;o+=1){u(r,t,e,e.left+o*a,e.top+n*a,a,n,o)}if(d(e.fill).is("img")){t.strokeStyle="rgba(0,0,0,0.5)",t.lineWidth=2,t.stroke();var f=t.globalCompositeOperation;t.globalCompositeOperation="destination-out",t.fill(),t.globalCompositeOperation=f,t.clip(),t.drawImage(e.fill,0,0,e.size,e.size),t.restore()}else t.fillStyle=e.fill,t.fill()}(e,o,t),n}function t(r){return e(d("<canvas/>").attr("width",r.size).attr("height",r.size),r)}function n(r){return o&&"canvas"===r.render?t(r):o&&"image"===r.render?function(r){return d("<img/>").attr("src",t(r)[0].toDataURL("image/png"))}(r):function(r){var t=g(r.text,r.ecLevel,r.minVersion,r.maxVersion,r.quiet);if(!t)return null;var e,n,o=r.size,i=r.background,a=Math.floor,u=t.moduleCount,f=a(o/u),c=a(.5*(o-f*u)),s={position:"relative",left:0,top:0,padding:0,margin:0,width:o,height:o},l={position:"absolute",padding:0,margin:0,width:f,height:f,"background-color":r.fill},h=d("<div/>").data("qrcode",t).css(s);for(i&&h.css("background-color",i),e=0;e<u;e+=1)for(n=0;n<u;n+=1)t.isDark(e,n)&&d("<div/>
662").css(l).css({left:c+n*f,top:c+e*f}).appendTo(h);return h}(r)}var r,d=jQuery,o=(r=document.createElement("canvas"),Boolean(r.getContext&&r.getContext("2d"))),l="[object Opera]"!==Object.prototype.toString.call(window.opera),f={render:"canvas",minVersion:1,maxVersion:40,ecLevel:"L",left:0,top:0,size:200,fill:"#000",background:null,text:"no text",radius:0,quiet:0,mode:0,mSize:.1,mPosX:.5,mPosY:.5,label:"no label",fontname:"sans",fontcolor:"#000",image:null};d.fn.qrcode=function(r){var t=d.extend({},f,r);return this.each(function(){"canvas"===this.nodeName.toLowerCase()?e(this,t):d(this).append(n(t))})}}(function(){var r,t=function(){function w(n,o){if(void 0===n.length)throw new Error(n.length+"/"+o);var t=function(){for(var r=0;r<n.length&&0==n[r];)r+=1;for(var t=new Array(n.length-r+o),e=0;e<n.length-r;e+=1)t[e]=n[e+r];return t}(),i={getAt:function(r){return t[r]},getLength:function(){return t.length},multiply:function(r){for(var t=new Array(i.getLength()+r.getLength()-1),e=0;e<i.getLength();e+=1)for(var n=0;n<r.getLength();n+=1)t[e+n]^=b.gexp(b.glog(i.getAt(e))+b.glog(r.getAt(n)));return w(t,0)},mod:function(r){if(i.getLength()-r.getLength()<0)return i;for(var t=b.glog(i.getAt(0))-b.glog(r.getAt(0)),e=new Array(i.getLength()),n=0;n<i.getLength();n+=1)e[n]=i.getAt(n);for(n=0;n<r.getLength();n+=1)e[n]^=b.gexp(b.glog(r.getAt(n))+t);return w(e,0).mod(r)}};return i}function o(r,t){function o(r,t){s=function(r){for(var t=new Array(r),e=0;e<r;e+=1){t[e]=new Array(r);for(var n=0;n<r;n+=1)t[e][n]=null}return t}(l=4*u+17),i(0,0),i(l-7,0),i(0,l-7),h(),c(),d(r,t),7<=u&&g(r),null==e&&(e=p(u,a,n)),v(e,t)}var u=r,a=m[t],s=null,l=0,e=null,n=new Array,f={},i=function(r,t){for(var e=-1;e<=7;e+=1)if(!(r+e<=-1||l<=r+e))for(var n=-1;n<=7;n+=1)t+n<=-1||l<=t+n||(s[r+e][t+n]=0<=e&&e<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==e||6==e)||2<=e&&e<=4&&2<=n&&n<=4)},c=function(){for(var r=8;r<l-8;r+=1)null==s[r][6]&&(s[r][6]=r%2==0);for(var t=8;t<l-8;t+=1)null==s[6][t]&&(s[6][t]=t%2==0)},h=function(){for(var r=T.getPatternPosition(u),t=0;t<r.length;t+=1)for(var e=0;e<r.length;e+=1){var n=r[t],o=r[e];if(null==s[n][o])for(var i=-2;i<=2;i+=1)for(var a=-2;a<=2;a+=1)s[n+i][o+a]=-2==i||2==i||-2==a||2==a||0==i&&0==a}},g=function(r){for(var t=T.getBCHTypeNumber(u),e=0;e<18;e+=1){var n=!r&&1==(t>>e&1);s[Math.floor(e/3)][e%3+l-8-3]=n}for(e=0;e<18;e+=1){n=!r&&1==(t>>e&1);s[e%3+l-8-3][Math.floor(e/3)]=n}},d=function(r,t){for(var e=a<<3|t,n=T.getBCHTypeInfo(e),o=0;o<15;o+=1){var i=!r&&1==(n>>o&1);o<6?s[o][8]=i:o<8?s[o+1][8]=i:s[l-15+o][8]=i}for(o=0;o<15;o+=1){i=!r&&1==(n>>o&1);o<8?s[8][l-o-1]=i:o<9?s[8][15-o-1+1]=i:s[8][15-o-1]=i}s[l-8][8]=!r},v=function(r,t){for(var e=-1,n=l-1,o=7,i=0,a=T.getMaskFunction(t),u=l-1;0<u;u-=2)for(6==u&&(u-=1);;){for(var f=0;f<2;f+=1)if(null==s[n][u-f]){var c=!1;i<r.length&&(c=1==(r[i]>>>o&1)),a(n,u-f)&&(c=!c),s[n][u-f]=c,-1==(o-=1)&&(i+=1,o=7)}if((n+=e)<0||l<=n){n-=e,e=-e;break}}},p=function(r,t,e){for(var n=C.getRSBlocks(r,t),o=B(),i=0;i<e.length;i+=1){var a=e[i];o.put(a.getMode(),4),o.put(a.getLength(),T.getLengthInBits(a.getMode(),r)),a.write(o)}var u=0;for(i=0;i<n.length;i+=1)u+=n[i].dataCount;if(o.getLengthInBits()>8*u)throw new Error("code length overflow. ("+o.getLengthInBits()+">"+8*u+")");for(o.getLengthInBits()+4<=8*u&&o.put(0,4);o.getLengthInBits()%8!=0;)o.putBit(!1);for(;!(o.getLengthInBits()>=8*u)&&(o.put(236,8),!(o.getLengthInBits()>=8*u));)o.put(17,8);return function(r,t){for(var e=0,n=0,o=0,i=new Array(t.length),a=new Array(t.length),u=0;u<t.length;u+=1){var f=t[u].dataCount,c=t[u].totalCount-f;n=Math.max(n,f),o=Math.max(o,c),i[u]=new Array(f);for(var s=0;s<i[u].length;s+=1)i[u][s]=255&r.getBuffer()[s+e];e+=f;var l=T.getErrorCorrectPolynomial(c),h=w(i[u],l.getLength()-1).mod(l);a[u]=new Array(l.getLength()-1);for(s=0;s<a[u].length;s+=1){var g=s+h.getLength()-a[u].length;a[u][s]=0<=g?h.getAt(g):0}}var d=0;for(s=0;s<t.length;s+=1)d+=t[s].totalCount;var v=new Array(d),p=0;for(s=0;s<n;s+=1)for(u=0;u<t.length;u+=1)s<i[u].length&&(v[p]=i[u][s],p+=1);for(s=0;s<o;s+=1)for(u=0;u<t.length;u+=1)s<a[u].length&&(v[p]=a[u][s],p+=1);return v}(o,n)};return f.addData=function(r){var t=L(r);n.push(t),e=null},f.isDark=function(r,t){if(r<0||l<=r||t<0||l<=t)throw new Error(r+","+t);return s[r][t]},f.getModuleCount=function(){return l},f.make=function(){o(!1,function(){for(var r=0,t=0,e=0;e<8;e+=1){o(!0,e);var n=T.getLostPoint(f);(0==e||n<r)&&(r=n,t=e)}return t}())},f.createTableTag=function(r,t){r=r||2;var e="";e+='<table style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: "+(t=void 0===t?4*r:t)+"px;",e+='">',e+="<tbody>";for(var n=0;n<f.getModuleCount();n+=1){e+="<tr>";for(var o=0;o<f.getModuleCount();o+=1)e+='<td style="',e+=" border-width: 0px; border-style: none;",e+=" border-collapse: collapse;",e+=" padding: 0px; margin: 0px;",e+=" width: "+r+"px;",e+=" height: "+r+"px;",e+=" background-color: ",e+=f.isDark(n,o)?"#000000":"#ffffff",e+=";",e+='"/>';e+="</tr>"}return(e+="</tbody>")+"</table>"},f.createImgTag=function(o,r){o=o||2,r=void 0===r?4*o:r;var t=f.getModuleCount()*o+2*r,i=r,a=t-r;return A(t,t,function(r,t){if(i<=r&&r<a&&i<=t&&t<a){var e=Math.floor((r-i)/o),n=Math.floor((t-i)/o);return f.isDark(n,e)?0:1}return 1})},f}o.stringToBytes=function(r){for(var t=new Array,e=0;e<r.length;e+=1){var n=r.charCodeAt(e);t.push(255&n)}return t},o.createStringToBytes=function(u,f){var i=function(){function r(){var r=t.read();if(-1==r)throw new Error;return r}for(var t=S(u),e=0,n={};;){var o=t.read();if(-1==o)break;var i=r(),a=r()<<8|r();n[String.fromCharCode(o<<8|i)]=a,e+=1}if(e!=f)throw new Error(e+" != "+f);return n}(),a="?".charCodeAt(0);return function(r){for(var t=new Array,e=0;e<r.length;e+=1){var n=r.charCodeAt(e);if(n<128)t.push(n);else{var o=i[r.charAt(e)];"number"==typeof o?(255&o)==o?t.push(o):(t.push(o>>>
6628),t.push(255&o)):t.push(a)}}return t}};function g(){var e=new Array,o={writeByte:function(r){e.push(255&r)},writeShort:function(r){o.writeByte(r),o.writeByte(r>>>8)},writeBytes:function(r,t,e){t=t||0,e=e||r.length;for(var n=0;n<e;n+=1)o.writeByte(r[n+t])},writeString:function(r){for(var t=0;t<r.length;t+=1)o.writeByte(r.charCodeAt(t))},toByteArray:function(){return e},toString:function(){var r="";r+="[";for(var t=0;t<e.length;t+=1)0<t&&(r+=","),r+=e[t];return r+"]"}};return o}function h(r,t){var n=r,o=t,l=new Array(r*t),e={setPixel:function(r,t,e){l[t*n+r]=e},write:function(r){r.writeString("GIF87a"),r.writeShort(n),r.writeShort(o),r.writeByte(128),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(0),r.writeByte(255),r.writeByte(255),r.writeByte(255),r.writeString(","),r.writeShort(0),r.writeShort(0),r.writeShort(n),r.writeShort(o),r.writeByte(0);var t=i(2);r.writeByte(2);for(var e=0;255<t.length-e;)r.writeByte(255),r.writeBytes(t,e,255),e+=255;r.writeByte(t.length-e),r.writeBytes(t,e,t.length-e),r.writeByte(0),r.writeString(";")}},i=function(r){for(var t=1<<r,e=1+(1<<r),n=r+1,o=h(),i=0;i<t;i+=1)o.add(String.fromCharCode(i));o.add(String.fromCharCode(t)),o.add(String.fromCharCode(e));var a=g(),u=function(r){var e=r,n=0,o=0,t={write:function(r,t){if(r>>>t!=0)throw new Error("length over");for(;8<=n+t;)e.writeByte(255&(r<<n|o)),t-=8-n,r>>>=8-n,n=o=0;o|=r<<n,n+=t},flush:function(){0<n&&e.writeByte(o)}};return t}(a);u.write(t,n);var f=0,c=String.fromCharCode(l[f]);for(f+=1;f<l.length;){var s=String.fromCharCode(l[f]);f+=1,o.contains(c+s)?c+=s:(u.write(o.indexOf(c),n),o.size()<4095&&(o.size()==1<<n&&(n+=1),o.add(c+s)),c=s)}return u.write(o.indexOf(c),n),u.write(e,n),u.flush(),a.toByteArray()},h=function(){var t={},e=0,n={add:function(r){if(n.contains(r))throw new Error("dup key:"+r);t[r]=e,e+=1},size:function(){return e},indexOf:function(r){return t[r]},contains:function(r){return void 0!==t[r]}};return n};return e}var d,r,t,e,n=1,i=2,a=4,u=8,m={L:1,M:0,Q:3,H:2},f=0,c=1,s=2,l=3,v=4,p=5,y=6,k=7,T=(t=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],(e={}).getBCHTypeInfo=function(r){for(var t=r<<10;0<=x(t)-x(1335);)t^=1335<<x(t)-x(1335);return 21522^(r<<10|t)},e.getBCHTypeNumber=function(r){for(var t=r<<12;0<=x(t)-x(7973);)t^=7973<<x(t)-x(7973);return r<<12|t},e.getPatternPosition=function(r){return t[r-1]},e.getMaskFunction=function(r){switch(r){case f:return function(r,t){return(r+t)%2==0};case c:return function(r,t){return r%2==0};case s:return function(r,t){return t%3==0};case l:return function(r,t){return(r+t)%3==0};case v:return function(r,t){return(Math.floor(r/2)+Math.floor(t/3))%2==0};case p:return function(r,t){return r*t%2+r*t%3==0};case y:return function(r,t){return(r*t%2+r*t%3)%2==0};case k:return function(r,t){return(r*t%3+(r+t)%2)%2==0};default:throw new Error("bad maskPattern:"+r)}},e.getErrorCorrectPolynomial=function(r){for(var t=w([1],0),e=0;e<r;e+=1)t=t.multiply(w([1,b.gexp(e)],0));return t},e.getLengthInBits=function(r,t){if(1<=t&&t<10)switch(r){case n:return 10;case i:return 9;case a:case u:return 8;default:throw new Error("mode:"+r)}else if(t<27)switch(r){case n:return 12;case i:return 11;case a:return 16;case u:return 10;default:throw new Error("mode:"+r)}else{if(!(t<41))throw new Error("type:"+t);switch(r){case n:return 14;case i:return 13;case a:return 16;case u:return 12;default:throw new Error("mode:"+r)}}},e.getLostPoint=function(r){for(var t=r.getModuleCount(),e=0,n=0;n<t;n+=1)for(var o=0;o<t;o+=1){for(var i=0,a=r.isDark(n,o),u=-1;u<=1;u+=1)if(!(n+u<0||t<=n+u))for(var f=-1;f<=1;f+=1)o+f<0||t<=o+f||0==u&&0==f||a!=r.isDark(n+u,o+f)||(i+=1);5<i&&(e+=3+i-5)}for(n=0;n<t-1;n+=1)for(o=0;o<t-1;o+=1){var c=0;r.isDark(n,o)&&(c+=1),r.isDark(n+1,o)&&(c+=1),r.isDark(n,o+1)&&(c+=1),r.isDark(n+1,o+1)&&(c+=1),0!=c&&4!=c||(e+=3)}for(n=0;n<t;n+=1)for(o=0;o<t-6;o+=1)r.isDark(n,o)&&!r.isDark(n,o+1)&&r.isDark(n,o+2)&&r.isDark(n,o+3)&&r.isDark(n,o+4)&&!r.isDark(n,o+5)&&r.isDark(n,o+6)&&(e+=40);for(o=0;o<t;o+=1)for(n=0;n<t-6;n+=1)r.isDark(n,o)&&!r.isDark(n+1,o)&&r.isDark(n+2,o)&&r.isDark(n+3,o)&&r.isDark(n+4,o)&&!r.isDark(n+5,o)&&r.isDark(n+6,o)&&(e+=40);var s=0;for(o=0;o<t;o+=1)for(n=0;n<t;n+=1)r.isDark(n,o)&&(s+=1);return e+Math.abs(100*s/t/t-50)/5*10},e),b=function(){for(var t=new Array(256),e=new Array(256),r=0;r<8;r+=1)t[r]=1<<r;for(r=8;r<256;r+=1)t[r]=t[r-4]^t[r-5]^t[r-6]^t[r-8];for(r=0;r<255;r+=1)e[t[r]]=r;var n={glog:function(r){if(r<1)throw new Error("glog("+r+")");return e[r]},gexp:function(r){for(;r<0;)r+=255;for(;256<=r;)r-=255;return t[r]}};return n}(),C=(d=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37
662],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],(r={}).getRSBlocks=function(r,t){var e,n,o=function(r,t){switch(t){case m.L:return d[4*(r-1)+0];case m.M:return d[4*(r-1)+1];case m.Q:return d[4*(r-1)+2];case m.H:return d[4*(r-1)+3];default:return}}(r,t);if(void 0===o)throw new Error("bad rs block @ typeNumber:"+r+"/errorCorrectLevel:"+t);for(var i=o.length/3,a=new Array,u=0;u<i;u+=1)for(var f=o[3*u+0],c=o[3*u+1],s=o[3*u+2],l=0;l<f;l+=1)a.push((e=s,n=void 0,(n={}).totalCount=c,n.dataCount=e,n));return a},r),B=function(){var e=new Array,n=0,o={getBuffer:function(){return e},getAt:function(r){var t=Math.floor(r/8);return 1==(e[t]>>>7-r%8&1)},put:function(r,t){for(var e=0;e<t;e+=1)o.putBit(1==(r>>>t-e-1&1))},getLengthInBits:function(){return n},putBit:function(r){var t=Math.floor(n/8);e.length<=t&&e.push(0),r&&(e[t]|=128>>>n%8),n+=1}};return o},L=function(r){var t=a,e=o.stringToBytes(r),n={getMode:function(){return t},getLength:function(r){return e.length},write:function(r){for(var t=0;t<e.length;t+=1)r.put(e[t],8)}};return n},S=function(r){var e=r,n=0,o=0,i=0,t={read:function(){for(;i<8;){if(n>=e.length){if(0==i)return-1;throw new Error("unexpected end of file./"+i)}var r=e.charAt(n);if(n+=1,"="==r)return i=0,-1;r.match(/^\s$/)||(o=o<<6|a(r.charCodeAt(0)),i+=6)}var t=o>>>i-8&255;return i-=8,t}},a=function(r){if(65<=r&&r<=90)return r-65;if(97<=r&&r<=122)return r-97+26;if(48<=r&&r<=57)return r-48+52;if(43==r)return 62;if(47==r)return 63;throw new Error("c:"+r)};return t},A=function(r,t,e,n){for(var o=h(r,t),i=0;i<t;i+=1)for(var a=0;a<r;a+=1)o.setPixel(a,i,e(a,i));var u=g();o.write(u);for(var f=function(){function e(r){a+=String.fromCharCode(t(63&r))}var n=0,o=0,i=0,a="",r={},t=function(r){if(r<0);else{if(r<26)return 65+r;if(r<52)return r-26+97;if(r<62)return r-52+48;if(62==r)return 43;
662if(63==r)return 47}throw new Error("n:"+r)};return r.writeByte=function(r){for(n=n<<8|255&r,o+=8,i+=1;6<=o;)e(n>>>o-6),o-=6},r.flush=function(){if(0<o&&(e(n<<6-o),o=n=0),i%3!=0)for(var r=3-i%3,t=0;t<r;t+=1)a+="="},r.toString=function(){return a},r}(),c=u.toByteArray(),s=0;s<c.length;s+=1)f.writeByte(c[s]);f.flush();var l="";return l+="<img",l+=' src="',l+="data:image/gif;base64,",l+=f,l+='"',l+=' width="',l+=r,l+='"',l+=' height="',l+=t,l+='"',n&&(l+=' alt="',l+=n,l+='"'),l+"/>"};function x(r){for(var t=0;0!=r;)t+=1,r>>>=1;return t}return o}();return r=function(){return t},"function"==typeof define&&define.amd?define([],r):"object"==typeof exports&&(module.exports=r()),t.stringToBytes=function(r){return function(r){for(var t=[],e=0;e<r.length;e++){var n=r.charCodeAt(e);n<128?t.push(n):n<2048?t.push(192|n>>6,128|63&n):n<55296||57344<=n?t.push(224|n>>12,128|n>>6&63,128|63&n):(e++,n=65536+((1023&n)<<10|1023&r.charCodeAt(e)),t.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|63&n))}return t}(r)},t}()),function(f){f.fn.share=function(r){var t=f(document.head),e={url:location.href,site_url:location.origin,source:t.find("[name=site], [name=Site]").attr("content")||document.title,title:t.find("[name=title], [name=Title]").attr("content")||document.title,description:t.find("[name=description], [name=Description]").attr("content")||"",image:f("img:first").prop("src")||"",imageSelector:void 0,weiboKey:"",wechatQrcodeTitle:"微信æ«ä¸æ«ï¼å享",wechatQrcodeHelper:"<p>微信éç¹âåç°â</p><p>æ«ä¸æ«åäº«è³æååã</p>",wechatQrcodeSize:100,mobileSites:[],sites:["weibo","qq","wechat","tencent","douban","qzone","linkedin","diandian","facebook","twitter","google"],disabled:[],initialized:!1},n=f.extend({},e,r),a={qzone:"http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url={{URL}}&title={{TITLE}}&desc={{DESCRIPTION}}&summary={{SUMMARY}}&site={{SOURCE}}&pics={{IMAGE}}",qq:"http://connect.qq.com/widget/shareqq/index.html?url={{URL}}&title={{TITLE}}&source={{SOURCE}}&desc={{DESCRIPTION}}&pics={{IMAGE}}",tencent:"http://share.v.t.qq.com/index.php?c=share&a=index&title={{TITLE}}&url={{URL}}&pic={{IMAGE}}",weibo:"https://service.weibo.com/share/share.php?url={{URL}}&title={{TITLE}}&pic={{IMAGE}}&appkey={{WEIBOKEY}}",wechat:"javascript:;",douban:"http://shuo.douban.com/!service/share?href={{URL}}&name={{TITLE}}&text={{DESCRIPTION}}&image={{IMAGE}}&starid=0&aid=0&style=11",diandian:"http://www.diandian.com/share?lo={{URL}}&ti={{TITLE}}&type=link",linkedin:"http://www.linkedin.com/shareArticle?mini=true&ro=true&title={{TITLE}}&url={{URL}}&summary={{SUMMARY}}&source={{SOURCE}}&armin=armin",facebook:"https://www.facebook.com/sharer/sharer.php?u={{URL}}&title={{TITLE}}&description={{DESCRIPTION}}&caption={{SUBHEAD}}&link={{URL}}&picture={{IMAGE}}",twitter:"https://twitter.com/intent/tweet?text={{TITLE}}&url={{URL}}&via={{SITE_URL}}",google:"https://plus.google.com/share?url={{URL}}"},u={qzone:"QQ空é´",qq:"QQ",tencent:"è ¾è®¯å¾®å",weibo:"å¾®å",wechat:"微信",douban:"è±ç£",diandian:"ç¹ç¹",linkedin:"LinkedIn",facebook:"Facebook",twitter:"Twitter",google:"Google"};this.each(function(){if(f(this).data("initialized"))return!0;var r=f.extend({},n,f(this).data());r.imageSelector&&(r.image=f(r.imageSelector).map(function(){return f(this).prop("src")}).get().join("||"));var t=f(this).addClass("share-component social-share");!function(o,i){var r=function(r){0===r.mobileSites.length&&r.sites.length&&(r.mobileSites=r.sites);var n=(f(window).width()<=768?r.mobileSites:r.sites.length?r.sites:[]).slice(0),t=r.disabled;"string"==typeof n&&(n=n.split(/\s*,\s*/));"string"==typeof t&&(t=t.split(/\s*,\s*/));/MicroMessenger/i.test(navigator.userAgent)&&t.push("wechat");return t.length&&f.each(t,function(r,t){var e=f.inArray(t,n);-1!==e&&n.splice(e,1)}),n}(i);if("prepend"==i.mode&&r.reverse(),!r.length)return;f.each(r,function(r,t){var e=function(r,t){var e=a[r];for(var n in t.summary=t.description,t)if(t.hasOwnProperty(n)){var o=r+n.replace(/^[a-z]/,function(r){return r.toUpperCase()}),i=encodeURIComponent(void 0===t[o]?t[n]:t[o]);e=e.replace(new RegExp("{{"+n.toUpperCase()+"}}","g"),i)}return e}(t,i),n=i.initialized?o.find(".icon-"+t):f('<a class="social-share-icon icon-'+t+'"></a>');if(!n.length)return!0;n.prop("aria-label","åäº«å° "+u[t]),n.prop("href",e),"wechat"===t?n.prop("tabindex",-1):n.prop("target","_blank"),i.initialized||("prepend"==i.mode?o.prepend(n):o.append(n))})}(t,r),function(r,t){var e=r.find("a.icon-wechat");if(!e.length)return;e.append('<div class="wechat-qrcode"><h4>'+t.wechatQrcodeTitle+'</h4><div class="qrcode"></div><div class="help">'+t.wechatQrcodeHelper+"</div></div>"),e.find(".qrcode").qrcode({render:"image",size:t.wechatQrcodeSize,text:t.url}),e.offset().top<100&&e.find(".wechat-qrcode").addClass("bottom")}(t,r),f(this).data("initialized",!0)})},f(function(){f(".share-component,.social-share").share()})}(jQuery); 663 664/*ååºå¼å¾çå¡«å å·¥å ·picturefill*/�
vendor: 11,621 bytes, lines 664-665
664 665!function(a){var b=navigator.userAgent;a.HTMLPictureElement&&/ecko/.test(b)&&b.match(/rv\:(\d+)/)&&RegExp.$1<45&&addEventListener("resize",function(){var b,c=document.createElement("source"),d=function(a){var b,d,e=a.parentNode;"PICTURE"===e.nodeName.toUpperCase()?(b=c.cloneNode(),e.insertBefore(b,e.firstElementChild),setTimeout(function(){e.removeChild(b)})):(!a._pfLastSize||a.offsetWidth>a._pfLastSize)&&(a._pfLastSize=a.offsetWidth,d=a.sizes,a.sizes+=",100vw",setTimeout(function(){a.sizes=d}))},e=function(){var a,b=document.querySelectorAll("picture > img, img[srcset][sizes]");for(a=0;a<b.length;a++)d(b[a])},f=function(){clearTimeout(b),b=setTimeout(e,99)},g=a.matchMedia&&matchMedia("(orientation: landscape)"),h=function(){f(),g&&g.addListener&&g.addListener(f)};return c.srcset="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",/^[c|i]|d$/.test(document.readyState||"")?h():document.addEventListener("DOMContentLoaded",h),f}())}(window),function(a,b,c){"use strict";function d(a){return" "===a||" "===a||"\n"===a||"\f"===a||"\r"===a}function e(b,c){var d=new a.Image;return d.onerror=function(){A[b]=!1,ba()},d.onload=function(){A[b]=1===d.width,ba()},d.src=c,"pending"}function f(){M=!1,P=a.devicePixelRatio,N={},O={},s.DPR=P||1,Q.width=Math.max(a.innerWidth||0,z.clientWidth),Q.height=Math.max(a.innerHeight||0,z.clientHeight),Q.vw=Q.width/100,Q.vh=Q.height/100,r=[Q.height,Q.width,P].join("-"),Q.em=s.getEmValue(),Q.rem=Q.em}function g(a,b,c,d){var e,f,g,h;return"saveData"===B.algorithm?a>2.7?h=c+1:(f=b-c,e=Math.pow(a-.6,1.5),g=f*e,d&&(g+=.1*e),h=a+g):h=c>1?Math.sqrt(a*b):a,h>c}function h(a){var b,c=s.getSet(a),d=!1;"pending"!==c&&(d=r,c&&(b=s.setRes(c),s.applySetCandidate(b,a))),a[s.ns].evaled=d}function i(a,b){return a.res-b.res}function j(a,b,c){var d;return!c&&b&&(c=a[s.ns].sets,c=c&&c[c.length-1]),d=k(b,c),d&&(b=s.makeUrl(b),a[s.ns].curSrc=b,a[s.ns].curCan=d,d.res||aa(d,d.set.sizes)),d}function k(a,b){var c,d,e;if(a&&b)for(e=s.parseSet(b),a=s.makeUrl(a),c=0;c<e.length;c++)if(a===s.makeUrl(e[c].url)){d=e[c];break}return d}function l(a,b){var c,d,e,f,g=a.getElementsByTagName("source");for(c=0,d=g.length;d>c;c++)e=g[c],e[s.ns]=!0,f=e.getAttribute("srcset"),f&&b.push({srcset:f,media:e.getAttribute("media"),type:e.getAttribute("type"),sizes:e.getAttribute("sizes")})}function m(a,b){function c(b){var c,d=b.exec(a.substring(m));return d?(c=d[0],m+=c.length,c):void 0}function e(){var a,c,d,e,f,i,j,k,l,m=!1,o={};for(e=0;e<h.length;e++)f=h[e],i=f[f.length-1],j=f.substring(0,f.length-1),k=parseInt(j,10),l=parseFloat(j),X.test(j)&&"w"===i?((a||c)&&(m=!0),0===k?m=!0:a=k):Y.test(j)&&"x"===i?((a||c||d)&&(m=!0),0>l?m=!0:c=l):X.test(j)&&"h"===i?((d||c)&&(m=!0),0===k?m=!0:d=k):m=!0;m||(o.url=g,a&&(o.w=a),c&&(o.d=c),d&&(o.h=d),d||c||a||(o.d=1),1===o.d&&(b.has1x=!0),o.set=b,n.push(o))}function f(){for(c(T),i="",j="in descriptor";;){if(k=a.charAt(m),"in descriptor"===j)if(d(k))i&&(h.push(i),i="",j="after descriptor");else{if(","===k)return m+=1,i&&h.push(i),void e();if("("===k)i+=k,j="in parens";else{if(""===k)return i&&h.push(i),void e();i+=k}}else if("in parens"===j)if(")"===k)i+=k,j="in descriptor";else{if(""===k)return h.push(i),void e();i+=k}else if("after descriptor"===j)if(d(k));else{if(""===k)return void e();j="in descriptor",m-=1}m+=1}}for(var g,h,i,j,k,l=a.length,m=0,n=[];;){if(c(U),m>=l)return n;g=c(V),h=[],","===g.slice(-1)?(g=g.replace(W,""),e()):f()}}function n(a){function b(a){function b(){f&&(g.push(f),f="")}function c(){g[0]&&(h.push(g),g=[])}for(var e,f="",g=[],h=[],i=0,j=0,k=!1;;){if(e=a.charAt(j),""===e)return b(),c(),h;if(k){if("*"===e&&"/"===a[j+1]){k=!1,j+=2,b();continue}j+=1}else{if(d(e)){if(a.charAt(j-1)&&d(a.charAt(j-1))||!f){j+=1;continue}if(0===i){b(),j+=1;continue}e=" "}else if("("===e)i+=1;else if(")"===e)i-=1;else{if(","===e){b(),c(),j+=1;continue}if("/"===e&&"*"===a.charAt(j+1)){k=!0,j+=2;continue}}f+=e,j+=1}}}function c(a){return k.test(a)&&parseFloat(a)>=0?!0:l.test(a)?!0:"0"===a||"-0"===a||"+0"===a?!0:!1}var e,f,g,h,i,j,k=/^(?:[+-]?[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?(?:ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmin|vmax|vw)$/i,l=/^calc\((?:[0-9a-z \.\+\-\*\/\(\)]+)\)$/i;for(f=b(a),g=f.length,e=0;g>e;e++)if(h=f[e],i=h[h.length-1],c(i)){if(j=i,h.pop(),0===h.length)return j;if(h=h.join(" "),s.matchesMedia(h))return j}return"100vw"}b.createElement("picture");var o,p,q,r,s={},t=!1,u=function(){},v=b.createElement("img"),w=v.getAttribute,x=v.setAttribute,y=v.removeAttribute,z=b.documentElement,A={},B={algorithm:""},C="data-pfsrc",D=C+"set",E=navigator.userAgent,F=/rident/.test(E)||/ecko/.test(E)&&E.match(/rv\:(\d+)/)&&RegExp.$1>35,G="currentSrc",H=/\s+\+?\d+(e\d+)?w/,I=/(\([^)]+\))?\s*(.+)/,J=a.picturefillCFG,K="position:absolute;left:0;visibility:hidden;display:block;padding:0;border:none;font-size:1em;width:1em;overflow:hidden;clip:rect(0px, 0px, 0px, 0px)",L="font-size:100%!important;",M=!0,N={},O={},P=a.devicePixelRatio,Q={px:1,"in":96},R=b.createElement("a"),S=!1,T=/^[ \t\n\r\u000c]+/,U=/^[, \t\n\r\u000c]+/,V=/^[^ \t\n\r\u000c]+/,W=/[,]+$/,X=/^\d+$/,Y=/^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/,Z=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d||!1):a.attachEvent&&a.attachEvent("on"+b,c)},$=function(a){var b={};return function(c){return c in b||(b[c]=a(c)),b[c]}},_=function(){var a=/^([\d\.]+)(em|vw|px)$/,b=function(){for(var a=arguments,b=0,c=a[0];++b in a;)c=c.replace(a[b],a[++b]);return c},c=$(function(a){return"return "+b((a||"").toLowerCase(),/\band\b/g,"&&",/,/g,"||",/min-([a-z-\s]+):/g,"e.$1>=",/max-([a-z-\s]+):/g,"e.$1<=",/calc([^)]+)/g,"($1)",/(\d+[\.]*[\d]*)([a-z]+)/g,"($1 * e.$2)",/^(?!(e.[a-z]|[0-9\.&=|><\+\-\*\(\)\/])).*/gi,"")+";"});return function(b,d){var e;if(!(b in N))if(N[b]=!1,d&&(e=b.match(a)))N[b]=e[1]*Q[e[2]];else try{N[b]=new Function("e",c(b))(Q)}catch(f){}return N[b]}}(),aa=function(a,b){return a.w?(a.cWidth=s.calcListLength(b||"100vw"),a.res=a.w/a.cWidth):a.res=a.d,a},ba=function(a){if(t){var c,d,e,f=a||{};if(f.elements&&1===f.elements.nodeType&&("IMG"===f.elements.nodeName.toUpperCase()?f.elements=[f.elements]:(f.context=f.elements,f.elements=null)),c=f.elements||s.qsa(f.context||b,f.reevaluate||f.reselect?s.sel:s.selShort),e=c.length){for(s.setupRun(f),S=!0,d=0;e>d;d++)s.fillImg(c[d],f);s.teardownRun(f)}}};o=a.console&&console.warn?function(a){console.warn(a)}:u,G in v||(G="src"),A["image/jpeg"]=!0,A["image/gif"]=!0,A["image/png"]=!0,A["image/svg+xml"]=b.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1"),s.ns=("pf"+(new Date).getTime()).substr(0,9),s.supSrcset="srcset"in v,s.supSizes="sizes"in v,s.supPicture=!!a.HTMLPictureElement,s.supSrcset&&s.supPicture&&!s.supSizes&&!function(a){v.srcset="data:,a",a.src="data:,a",s.supSrcset=v.complete===a.complete,s.supPicture=s.supSrcset&&s.supPicture}(b.createElement("img")),s.supSrcset&&!s.supSizes?!function(){var a="data:image/gif;base64,R0lGODlhAgABAPAAAP///wAAACH5BAAAAAAALAAAAAACAAEAAAICBAoAOw==",c="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",d=b.createElement("img"),e=function(){var a=d.width;2===a&&(s.supSizes=!0),q=s.supSrcset&&!s.supSizes,t=!0,setTimeout(ba)};d.onload=e,d.onerror=e,d.setAttribute("sizes","9px"),d.srcset=c+" 1w,"+a+" 9w",d.src=c}():t=!0,s.selShort="picture>img,img[srcset]",s.sel=s.selShort,s.cfg=B,s.DPR=P||1,s.u=Q,s.types=A,s.setSize=u,s.makeUrl=$(function(a){return R.href=a,R.href}),s.qsa=function(a,b){return"querySelector"in a?a.querySelectorAll(b):[]},s.matchesMedia=function(){return a.matchMedia&&(matchMedia("(min-width: 0.1em)")||{}).matches?s.matchesMedia=function(a){return!a||matchMedia(a).matches}:s.matchesMedia=s.mMQ,s.matchesMedia.apply(this,arguments)},s.mMQ=function(a){return a?_(a):!0},s.calcLength=function(a){var b=_(a,!0)||!1;return 0>b&&(b=!1),b},s.supportsType=function(a){return a?A[a]:!0},s.parseSize=$(function(a){var b=(a||"").match(I);return{media:b&&b[1],length:b&&b[2]}}),s.parseSet=function(a){return a.cands||(a.cands=m(a.srcset,a)),a.cands},s.getEmValue=function(){var a;if(!p&&(a=b.body)){var c=b.createElement("div"),d=z.style.cssText,e=a.style.cssText;c.style.cssText=K,z.style.cssText=L,a.style.cssText=L,a.appendChild(c),p=c.offsetWidth,a.removeChild(c),p=parseFloat(p,10),z.style.cssText=d,a.style.cssText=e}return p||16},s.calcListLength=function(a){if(!(a in O)||B.uT){var b=s.calcLength(n(a));O[a]=b?b:Q.width}return O[a]},s.setRes=function(a){var b;if(a){b=s.parseSet(a);for(var c=0,d=b.length;d>c;c++)aa(b[c],a.sizes)}return b},s.setRes.res=aa,s.applySetCandidate=function(a,b){if(a.length){var c,d,e,f,h,k,l,m,n,o=b[s.ns],p=s.DPR;if(k=o.curSrc||b[G],l=o.curCan||j(b,k,a[0].set),l&&l.set===a[0].set&&(n=F&&!b.complete&&l.res-.1>p,n||(l.cached=!0,l.res>=p&&(h=l))),!h)for(a.sort(i),f=a.length,h=a[f-1],d=0;f>d;d++)if(c=a[d],c.res>=p){e=d-1,h=a[e]&&(n||k!==s.makeUrl(c.url))&&g(a[e].res,c.res,p,a[e].cached)?a[e]:c;break}h&&(m=s.makeUrl(h.url),o.curSrc=m,o.curCan=h,m!==k&&s.setSrc(b,h),s.setSize(b))}},s.setSrc=function(a,b){var c;a.src=b.url,"image/svg+xml"===b.set.type&&(c=a.style.width,a.style.width=a.offsetWidth+1+"px",a.offsetWidth+1&&(a.style.width=c))},s.getSet=function(a){var b,c,d,e=!1,f=a[s.ns].sets;for(b=0;b<f.length&&!e;b++)if(c=f[b],c.srcset&&s.matchesMedia(c.media)&&(d=s.supportsType(c.type))){"pending"===d&&(c=d),e=c;break}return e},s.parseSets=function(a,b,d){var e,f,g,h,i=b&&"PICTURE"===b.nodeName.toUpperCase(),j=a[s.ns];(j.src===c||d.src)&&(j.src=w.call(a,"src"),j.src?x.call(a,C,j.src):y.call(a,C)),(j.srcset===c||d.srcset||!s.supSrcset||a.srcset)&&(e=w.call(a,"srcset"),j.srcset=e,h=!0),j.sets=[],i&&(j.pic=!0,l(b,j.sets)),j.srcset?(f={srcset:j.srcset,sizes:w.call(a,"sizes")},j.sets.push(f),g=(q||j.src)&&H.test(j.srcset||""),g||!j.src||k(j.src,f)||f.has1x||(f.srcset+=", "+j.src,f.cands.push({url:j.src,d:1,set:f}))):j.src&&j.sets.push({srcset:j.src,sizes:null}),j.curCan=null,j.curSrc=c,j.supported=!(i||f&&!s.supSrcset||g&&!s.supSizes),h&&s.supSrcset&&!j.supported&&(e?(x.call(a,D,e),a.srcset=""):y.call(a,D)),j.supported&&!j.srcset&&(!j.src&&a.src||a.src!==s.makeUrl(j.src))&&(null===j.src?a.removeAttribute("src"):a.src=j.src),j.parsed=!0},s.fillImg=function(a,b){var c,d=b.reselect||b.reevaluate;a[s.ns]||(a[s.ns]={}),c=a[s.ns],(d||c.evaled!==r)&&((!c.parsed||b.reevaluate)&&s.parseSets(a,a.parentNode,b),c.supported?c.evaled=r:h(a))},s.setupRun=function(){(!S||M||P!==a.devicePixelRatio)&&f()},s.supPicture?(ba=u,s.fillImg=u):!function(){var c,d=a.attachEvent?/d$|^c/:/d$|^c|^i/,e=function(){var a=b.readyState||"";f=setTimeout(e,"loading"===a?200:999),b.body&&(s.fillImgs(),c=c||d.test(a),c&&clearTimeout(f))},f=setTimeout(e,b.body?9:99),g=function(a,b){var c,d,e=function(){var f=new Date-d;b>f?c=setTimeout(e,b-f):(c=null,a())};return function(){d=new Date,c||(c=setTimeout(e,b))}},h=z.clientHeight,i=function(){M=Math.max(a.innerWidth||0,z.clientWidth)!==Q.width||z.clientHeight!==h,h=z.clientHeight,M&&s.fillImgs()};Z(a,"resize",g(i,99)),Z(b,"readystatechange",e)}(),s.picturefill=ba,s.fillImgs=ba,s.teardownRun=u,ba._=s,a.picturefillCFG={pf:s,push:function(a){var b=a.shift();"function"==typeof s[b]?s[b].apply(s,a):(B[b]=a[0],S&&s.fillImgs({reselect:!0}))}};for(;J&&J.length;)a.picturefillCFG.push(J.shift());a.picturefill=ba,"object"==typeof module&&"object"==typeof module.exports?module.exports=ba:"function"==typeof define&&define.amd&&define("picturefill",function(){return ba}),s.supPicture||(A["image/webp"]=e("image/webp","data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA=="))}(window,document);
665 666 667/* 668 * ui-selectç¾åæä»¶ 669 * åºäºjQuery 670*/ 671; + function($) { 672 "use strict"; 673 // é»è®¤å®ä¾åé ç½® 674 var defaults = { 675 width: null, //selectç宽度ï¼é»è®¤ä¸ºnullå°èªå¨è·åselectçå®½åº¦ï¼ 676 wrapClass: '', //å è½½å¨æå¤å±.ui-select-wrapæclassï¼å¨èªå®ä¹æ ·å¼æ¶æç¨å¤ï¼ 677 dataKey: 'ui-select', //å®ä¾åå对象åå¨selectçdataé®å¼ï¼æ¹ä¾¿åç»éè¿data('ui-select')ååºï¼ 678 onChange: null, //select弿¹åæ¶çåè°ï¼ 679 onClick: null //selectå ç´ ç¹å»æ¶çåè°ï¼diabledæ¶ä¸åçã 680 }; 681 /** 682 * ui-selectæä»¶ 683 */ 684 $.fn.ui_select = function(options) { 685 var _this = $(this), 686 _num = _this.length; 687 688 // å½è¦å®ä¾çå¯¹è±¡åªæä¸ä¸ªæ¶ï¼ç´æ¥å®ä¾åè¿åå¯¹è±¡ï¼ 689 if (_num === 1) { 690 return new UI_select(_this, options); 691 }; 692 // å½è¦å®ä¾ç对象æå¤ä¸ªæ¶ï¼å¾ªç¯å®ä¾åï¼ä¸è¿åå¯¹è±¡ï¼ 693 if (_num > 1) { 694 _this.each(function(index, el) { 695 new UI_select($(el), options); 696 }) 697 } 698 // å½å ç´ ä¸ªæ°ä¸º0æ¶ï¼ä¸æ§è¡å®ä¾åã 699 }; 700 701 /** 702 * UI_select对象 703 * @param {[jQuery]} el [jQueryéæ©åçå¯¹è±¡ï¼æ¤å¤ä¼ å ¥ç为å个å ç´ ] 704 * @param {[object]} opt [设置çåæ°] 705 */ 706 function UI_select(el, opt) { 707 this.el = el; 708 this.items = this.el.find('option'); 709 this._opt = $.extend({}, defaults, opt); 710 this._doc = $(document); 711 this._win = $(window); 712 return this._init(); 713 } 714 715 // UI_select åå龿©å±ã 716 UI_select.prototype = { 717 // 夿æ¯å¦ä¸ºIE (6-11); 718 _isIE: !!window.ActiveXObject || "ActiveXObject" in window, 719 720 // initåå§å; 721 _init: function() { 722 var _data = this.el.data(this._opt.dataKey); 723 // 妿已ç»å®ä¾åäºï¼åç´æ¥è¿å 724 if (_data) 725 return _data; 726 else 727 this.el.data(this._opt.dataKey, this); 728 this._setHtml(); // ç»å»ºå ç´ 729 this._bindEvent(); // ç»å®äºä»¶ 730 }, 731 732 // ç»å»ºå¹¶è·åç¸å ³çdomå ç´ ; 733 _setHtml: function() { 734 this.el.addClass('ui-select'); 735 var _isHide = (this.el.css('display') == 'none'); 736 if (_isHide) { 737 this.el.show().css('visibility', 'hidden'); 738 } 739 //var _w = this._opt.width ? this._opt.width - 17 : this.el.outerWidth() - 17; 740 var _w = '100%'; 741 this.el.wrap('<div tabindex="0" class="ui-select-wrap ' + this._opt.wrapClass + '"></div>') 742 .after('<div class="ui-select-input"></div><i class="ui-select-arrow"></i><ul class="ui-select-list"></ul>'); 743 this._wrap = this.el.parent('.ui-select-wrap').css('width', _w); 744 this._input = this.el.next('.ui-select-input'); 745 this._list = this._wrap.children('.ui-select-list'); 746 this.el.prop('disabled') ? this.disable() : null; 747 if (_isHide) { 748 this.el.add(this._wrap).hide(); 749 this.el.css('visibility', null); 750 } 751 var _ohtml = ''; 752 this.el.find('option').each(function(index, el) { 753 var _this = $(el), 754 _text = _this.text(), 755 _value = _this.prop('value'), 756 _selected = _this.prop('selected') ? 'selected' : '', 757 _disabled = _this.prop('disabled') ? ' disabled' : ''; 758 _ohtml += '<li title="' + _text + '" data-value="' + _value + '" class="' + _selected + _disabled + '">' + _text + '</li> '; 759 }); 760 this._list.html(_ohtml); 761 this._items = this._list.children('li'); 762 this.val(this.el.val()); 763 764 var _txt = this._list.children('li.selected').text(); 765 this._input.text(_txt).attr('title', _txt); 766 }, 767 768 // ç»å®äºä»¶ï¼ 769 _bindEvent: function() { 770 var _this = this; 771 // 模æåçselectç¹å»äºä»¶ï¼ 772 _this._wrap.on({ 773 // ç¹å»äºä»¶ 774 'click': function(e) { 775 // å表å ç´ ç¹å»äºä»¶ï¼ 776 if (_this._disabled) 777 return; 778 if (e.target.tagName == 'LI') { 779 var _self = $(e.target), 780 _val = _self.attr('data-value'); 781 if (_self.hasClass('disabled')) 782 return _this._isIE ? e.stopPropagation() : null; 783 _this.val(_val); 784 _this._triggerClick(_val, _this.items.eq(_self.index())); 785 } 786 787 // IEä¸ç¹å»selectæ¶å ¶ä»selectæ æ³æ¶èµ·çbug 788 if (_this._isIE) { 789 e.stopPropagation(); 790 _this._allWrap = _this._allWrap || $('.ui-select-wrap'); 791 _this._allWrap.not(_this._wrap).removeClass('focus'); 792 _this._doc.one('click', function() { 793 _this._allWrap.removeClass('focus'); 794 }); 795 } 796 _this._wrap.toggleClass('focus'); 797 _this._setListCss(); 798 }, 799 // 失å»ç¦ç¹äºä»¶ 800 'blur': function(e) { 801 _this._wrap.removeClass('focus'); 802 }, 803 // é®çäºä»¶ 804 'keydown': function(e) { 805 var code = e.keyCode; 806 if (code == 40 || code == 38) { 807 var _els = code == 40 ? _this._list.find('li.selected').nextAll('li') : _this._list.find('li.selected').prevAll('li'); 808 var _val = _els.not('.disabled').eq(0).attr('data-value'); 809 if (_val !== undefined) { 810 _this.val(_val); 811 } 812 return false; 813 } 814 } 815 }); 816 return _this; 817 }, 818 819 // æ ¹æ®selectæå¤çä½ç½®è®¾ç½®ä¸æå表æ¾ç¤ºæ¹åup / down 820 _setListCss: function() { 821 var _toWinTop = this._wrap.offset().top - this._win.scrollTop(); 822 var _toWinBottom = this._win.height() - _toWinTop - this._wrap.outerHeight(); 823 var _listH = this._list.outerHeight(); 824 if (_listH > _toWinBottom && _toWinTop > _toWinBottom) { 825 this._wrap.addClass('up'); 826 if (_listH > _toWinTop) 827 this._list.css('maxHeight', _toWinTop - 1 + 'px'); 828 else 829 this._list.removeAttr('style'); 830 } else if (_listH > _toWinBottom && _toWinTop < _toWinBottom) { 831 this._wrap.removeClass('up'); 832 this._list.css('maxHeight', _toWinBottom - 1 + 'px'); 833 } else { 834 this._list.removeAttr('style'); 835 this._wrap.removeClass('up'); 836 } 837 }, 838 839 // change 触åï¼valueï¼å¼ ï¼itemï¼éä¸çoptionï¼ 840 _triggerChange: function(value, item) { 841 this.el.change(); 842 this.onChange(value, item); 843 if (typeof this._opt.onChange == 'function') 844 this._opt.onChange.call(this, value, item); 845 }, 846 847 // click 触åï¼valueï¼å¼ ï¼itemï¼éä¸çoptionï¼ 848 _triggerClick: function(value, item) { 849 this.onClick(value, item); 850 if (typeof this._opt.onClick == 'function') 851 this._opt.onClick.call(this, value, item); 852 }, 853 854 // è·åæè®¾ç½®å¼ï¼ 855 val: function(value) { 856 var _val = this.el.val(); 857 if (value === undefined) 858 return _val; 859 this.el.val(value); 860 var _selectedLi = this._list.children('li[data-value="' + value + '"]'); 861 _selectedLi.addClass('selected').siblings('li').removeClass('selected'); 862 this._input.html(_selectedLi.text()).attr('title', _selectedLi.text()); 863 if (_val != value) { 864 return this._triggerChange(value, this.items.eq(_selectedLi.index())); 865 } 866 }, 867 868 // 弿¹åäºä»¶ï¼ 869 onChange: function(value, item) {}, 870 871 // ç¹å»äºä»¶ï¼ 872 onClick: function(value, item) {}, 873 874 // ç¦ç¨selectï¼ 875 disable: function() { 876 this._disabled = true; 877 this.el.prop('disabled', true); 878 this._wrap.addClass('disabled').removeAttr('tabindex'); 879 return this; 880 }, 881 882 // å¯ç¨selectï¼ 883 enable: function() { 884 this._disabled = false; 885 this.el.prop('disabled', false); 886 this._wrap.removeClass('disabled').attr('tabindex', '0'); 887 return this; 888 }, 889 890 // éè 891 hide: function() { 892 this._wrap.hide(); 893 return this; 894 }, 895 896 // æ¾ç¤º 897 show: function() { 898 this._wrap.show(); 899 return this; 900 }, 901 902 // æ¾ç¤º æ éè 903 toggle: function() { 904 this._wrap.toggle(); 905 return this; 906 }, 907 908 // visible 909 visible: function(visible) { 910 visible = !visible ? 'hidden' : 'visible'; 911 this._wrap.css('visibility', visible); 912 return this; 913 } 914 915 }; 916}(jQuery); 917 918/* 919 920/* 921 _ _ _ _ 922 ___| (_) ___| | __ (_)___ 923/ __| | |/ __| |/ / | / __| 924\__ \ | | (__| < _ | \__ \ 925|___/_|_|\___|_|\_(_)/ |___/ 926 |__/ 927 928 Version: 1.9.0 929 Author: Ken Wheeler 930 Website: http://kenwheeler.github.io 931 Docs: http://kenwheeler.github.io/slick 932 Repo: http://github.com/kenwheeler/slick 933 Issues: http://github.com/kenwheeler/slick/issues 934 935 */ 936/* global window, document, define, jQuery, setInterval, clearInterval */ 937;(function(factory) { 938 'use strict'; 939 if (typeof define === 'function' && define.amd) { 940 define(['jquery'], factory); 941 } else if (typeof exports !== 'undefined') { 942 module.exports = factory(require('jquery')); 943 } else { 944 factory(jQuery); 945 } 946 947 if(!Array.prototype.indexOf){ 948 Array.prototype.indexOf = function(val){ 949 var value = this; 950 for(var i =0; i < value.length; i++){ 951 if(value[i] == val) return i; 952 } 953 return -1; 954 }; 955 } 956}(function($) { 957 'use strict'; 958 var Slick = window.Slick || {}; 959 960 Slick = (function() { 961 962 var instanceUid = 0; 963 964 function Slick(element, settings) { 965 966 var _ = this, dataSettings; 967 968 _.defaults = { 969 accessibility: true, 970 adaptiveHeight: false, 971 appendArrows: $(element), 972 appendDots: $(element), 973 arrows: true, 974 asNavFor: null, 975 prevArrow: '<div class="slick-prev" aria-label="Previous"></div>', 976 nextArrow: '<div class="slick-next" aria-label="Next"></div>', 977// prevArrow: '<button class="slick-prev" aria-label="Previous" type="button">Previous</button>', 978// nextArrow: '<button class="slick-next" aria-label="Next" type="button">Next</button>', 979 autoplay: false, 980 autoplaySpeed: 3000, 981 centerMode: false, 982 centerPadding: '50px', 983 cssEase: 'ease', 984 customPaging: function(slider, i) { 985 return ''; 986// return $('<button type="button" />').text(i + 1); 987 }, 988 dots: false, 989 dotsClass: 'slick-dots', 990 draggable: true, 991 easing: 'linear', 992 edgeFriction: 0.35, 993 fade: false, 994 focusOnSelect: false, 995 focusOnChange: false, 996 infinite: true, 997 initialSlide: 0, 998 lazyLoad: 'ondemand', 999 mobileFirst: false, 1000 pauseOnHover: true, 1001 pauseOnFocus: true, 1002 pauseOnDotsHover: false, 1003 respondTo: 'window', 1004 responsive: null, 1005 rows: 1, 1006 rtl: false, 1007 slide: '', 1008 slidesPerRow: 1, 1009 slidesToShow: 1, 1010 slidesToScroll: 1, 1011 speed: 500, 1012 swipe: true, 1013 swipeToSlide: false, 1014 touchMove: true, 1015 touchThreshold: 5, 1016 useCSS: true, 1017 useTransform: true, 1018 variableWidth: false, 1019 vertical: false, 1020 verticalSwiping: false, 1021 waitForAnimate: true, 1022 zIndex: 2 1023 }; 1024 1025 _.initials = { 1026 animating: false, 1027 dragging: false, 1028 autoPlayTimer: null, 1029 currentDirection: 0, 1030 currentLeft: null, 1031 currentSlide: 0, 1032 direction: 1, 1033 $dots: null, 1034 listWidth: null, 1035 listHeight: null, 1036 loadIndex: 0, 1037 $nextArrow: null, 1038 $prevArrow: null, 1039 scrolling: false, 1040 slideCount: null, 1041 slideWidth: null, 1042 $slideTrack: null, 1043 $slides: null, 1044 sliding: false, 1045 slideOffset: 0, 1046 swipeLeft: null, 1047 swiping: false, 1048 $list: null, 1049 touchObject: {}, 1050 transformsEnabled: false,
vendor: 25,133 bytes, lines 1051-1835
1051 unslicked: false 1052 }; 1053 1054 $.extend(_, _.initials); 1055 1056 _.activeBreakpoint = null; 1057 _.animType = null; 1058 _.animProp = null; 1059 _.breakpoints = []; 1060 _.breakpointSettings = []; 1061 _.cssTransitions = false; 1062 _.focussed = false; 1063 _.interrupted = false; 1064 _.hidden = 'hidden'; 1065 _.paused = true; 1066 _.positionProp = null; 1067 _.respondTo = null; 1068 _.rowCount = 1; 1069 _.shouldClick = true; 1070 _.$slider = $(element); 1071 _.$slidesCache = null; 1072 _.transformType = null; 1073 _.transitionType = null; 1074 _.visibilityChange = 'visibilitychange'; 1075 _.windowWidth = 0; 1076 _.windowTimer = null; 1077 1078 dataSettings = $(element).data('slick') || {}; 1079 1080 _.options = $.extend({}, _.defaults, settings, dataSettings); 1081 1082 _.currentSlide = _.options.initialSlide; 1083 1084 _.originalSettings = _.options; 1085 1086 if (typeof document.mozHidden !== 'undefined') { 1087 _.hidden = 'mozHidden'; 1088 _.visibilityChange = 'mozvisibilitychange'; 1089 } else if (typeof document.webkitHidden !== 'undefined') { 1090 _.hidden = 'webkitHidden'; 1091 _.visibilityChange = 'webkitvisibilitychange'; 1092 } 1093 1094 _.autoPlay = $.proxy(_.autoPlay, _); 1095 _.autoPlayClear = $.proxy(_.autoPlayClear, _); 1096 _.autoPlayIterator = $.proxy(_.autoPlayIterator, _); 1097 _.changeSlide = $.proxy(_.changeSlide, _); 1098 _.clickHandler = $.proxy(_.clickHandler, _); 1099 _.selectHandler = $.proxy(_.selectHandler, _); 1100 _.setPosition = $.proxy(_.setPosition, _); 1101 _.swipeHandler = $.proxy(_.swipeHandler, _); 1102 _.dragHandler = $.proxy(_.dragHandler, _); 1103 _.keyHandler = $.proxy(_.keyHandler, _); 1104 1105 _.instanceUid = instanceUid++; 1106 1107 // A simple way to check for HTML strings 1108 // Strict HTML recognition (must start with <) 1109 // Extracted from jQuery v1.11 source 1110 _.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/; 1111 1112 1113 _.registerBreakpoints(); 1114 _.init(true); 1115 1116 } 1117 1118 return Slick; 1119 1120 }()); 1121 1122 Slick.prototype.activateADA = function() { 1123 var _ = this; 1124 1125 _.$slideTrack.find('.slick-active').attr({ 1126 'aria-hidden': 'false' 1127 }).find('a, input, button, select').attr({ 1128 'tabindex': '0' 1129 }); 1130 1131 }; 1132 1133 Slick.prototype.addSlide = Slick.prototype.slickAdd = function(markup, index, addBefore) { 1134 1135 var _ = this; 1136 1137 if (typeof(index) === 'boolean') { 1138 addBefore = index; 1139 index = null; 1140 } else if (index < 0 || (index >= _.slideCount)) { 1141 return false; 1142 } 1143 1144 _.unload(); 1145 1146 if (typeof(index) === 'number') { 1147 if (index === 0 && _.$slides.length === 0) { 1148 $(markup).appendTo(_.$slideTrack); 1149 } else if (addBefore) { 1150 $(markup).insertBefore(_.$slides.eq(index)); 1151 } else { 1152 $(markup).insertAfter(_.$slides.eq(index)); 1153 } 1154 } else { 1155 if (addBefore === true) { 1156 $(markup).prependTo(_.$slideTrack); 1157 } else { 1158 $(markup).appendTo(_.$slideTrack); 1159 } 1160 } 1161 1162 _.$slides = _.$slideTrack.children(this.options.slide); 1163 1164 _.$slideTrack.children(this.options.slide).detach(); 1165 1166 _.$slideTrack.append(_.$slides); 1167 1168 _.$slides.each(function(index, element) { 1169 $(element).attr('data-slick-index', index); 1170 }); 1171 1172 _.$slidesCache = _.$slides; 1173 1174 _.reinit(); 1175 1176 }; 1177 1178 Slick.prototype.animateHeight = function() { 1179 var _ = this; 1180 if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) { 1181 var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true); 1182 _.$list.animate({ 1183 height: targetHeight 1184 }, _.options.speed); 1185 } 1186 }; 1187 1188 Slick.prototype.animateSlide = function(targetLeft, callback) { 1189 1190 var animProps = {}, 1191 _ = this; 1192 1193 _.animateHeight(); 1194 1195 if (_.options.rtl === true && _.options.vertical === false) { 1196 targetLeft = -targetLeft; 1197 } 1198 if (_.transformsEnabled === false) { 1199 if (_.options.vertical === false) { 1200 _.$slideTrack.animate({ 1201 left: targetLeft 1202 }, _.options.speed, _.options.easing, callback); 1203 } else { 1204 _.$slideTrack.animate({ 1205 top: targetLeft 1206 }, _.options.speed, _.options.easing, callback); 1207 } 1208 1209 } else { 1210 1211 if (_.cssTransitions === false) { 1212 if (_.options.rtl === true) { 1213 _.currentLeft = -(_.currentLeft); 1214 } 1215 $({ 1216 animStart: _.currentLeft 1217 }).animate({ 1218 animStart: targetLeft 1219 }, { 1220 duration: _.options.speed, 1221 easing: _.options.easing, 1222 step: function(now) { 1223 now = Math.ceil(now); 1224 if (_.options.vertical === false) { 1225 animProps[_.animType] = 'translate(' + 1226 now + 'px, 0px)'; 1227 _.$slideTrack.css(animProps); 1228 } else { 1229 animProps[_.animType] = 'translate(0px,' + 1230 now + 'px)'; 1231 _.$slideTrack.css(animProps); 1232 } 1233 }, 1234 complete: function() { 1235 if (callback) { 1236 callback.call(); 1237 } 1238 } 1239 }); 1240 1241 } else { 1242 1243 _.applyTransition(); 1244 targetLeft = Math.ceil(targetLeft); 1245 1246 if (_.options.vertical === false) { 1247 animProps[_.animType] = 'translate3d(' + targetLeft + 'px, 0px, 0px)'; 1248 } else { 1249 animProps[_.animType] = 'translate3d(0px,' + targetLeft + 'px, 0px)'; 1250 } 1251 _.$slideTrack.css(animProps); 1252 1253 if (callback) { 1254 setTimeout(function() { 1255 1256 _.disableTransition(); 1257 1258 callback.call(); 1259 }, _.options.speed); 1260 } 1261 1262 } 1263 1264 } 1265 1266 }; 1267 1268 Slick.prototype.getNavTarget = function() { 1269 1270 var _ = this, 1271 asNavFor = _.options.asNavFor; 1272 1273 if ( asNavFor && asNavFor !== null ) { 1274 asNavFor = $(asNavFor).not(_.$slider); 1275 } 1276 1277 return asNavFor; 1278 1279 }; 1280 1281 Slick.prototype.asNavFor = function(index) { 1282 1283 var _ = this, 1284 asNavFor = _.getNavTarget(); 1285 1286 if ( asNavFor !== null && typeof asNavFor === 'object' ) { 1287 asNavFor.each(function() { 1288 var target = $(this).slick('getSlick'); 1289 if(!target.unslicked) { 1290 target.slideHandler(index, true); 1291 } 1292 }); 1293 } 1294 1295 }; 1296 1297 Slick.prototype.applyTransition = function(slide) { 1298 1299 var _ = this, 1300 transition = {}; 1301 1302 if (_.options.fade === false) { 1303 transition[_.transitionType] = _.transformType + ' ' + _.options.speed + 'ms ' + _.options.cssEase; 1304 } else { 1305 transition[_.transitionType] = 'opacity ' + _.options.speed + 'ms ' + _.options.cssEase; 1306 } 1307 1308 if (_.options.fade === false) { 1309 _.$slideTrack.css(transition); 1310 } else { 1311 _.$slides.eq(slide).css(transition); 1312 } 1313 1314 }; 1315 1316 Slick.prototype.autoPlay = function() { 1317 1318 var _ = this; 1319 1320 _.autoPlayClear(); 1321 1322 if ( _.slideCount > _.options.slidesToShow ) { 1323 _.autoPlayTimer = setInterval( _.autoPlayIterator, _.options.autoplaySpeed ); 1324 } 1325 1326 }; 1327 1328 Slick.prototype.autoPlayClear = function() { 1329 1330 var _ = this; 1331 1332 if (_.autoPlayTimer) { 1333 clearInterval(_.autoPlayTimer); 1334 } 1335 1336 }; 1337 1338 Slick.prototype.autoPlayIterator = function() { 1339 1340 var _ = this, 1341 slideTo = _.currentSlide + _.options.slidesToScroll; 1342 1343 if ( !_.paused && !_.interrupted && !_.focussed ) { 1344 1345 if ( _.options.infinite === false ) { 1346 1347 if ( _.direction === 1 && ( _.currentSlide + 1 ) === ( _.slideCount - 1 )) { 1348 _.direction = 0; 1349 } 1350 1351 else if ( _.direction === 0 ) { 1352 1353 slideTo = _.currentSlide - _.options.slidesToScroll; 1354 1355 if ( _.currentSlide - 1 === 0 ) { 1356 _.direction = 1; 1357 } 1358 1359 } 1360 1361 } 1362 1363 _.slideHandler( slideTo ); 1364 1365 } 1366 1367 }; 1368 1369 Slick.prototype.buildArrows = function() { 1370 1371 var _ = this; 1372 1373 if (_.options.arrows === true ) { 1374 1375 _.$prevArrow = $(_.options.prevArrow).addClass('slick-arrow'); 1376 _.$nextArrow = $(_.options.nextArrow).addClass('slick-arrow'); 1377 1378 if( _.slideCount > _.options.slidesToShow ) { 1379 1380 _.$prevArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex'); 1381 _.$nextArrow.removeClass('slick-hidden').removeAttr('aria-hidden tabindex'); 1382 1383 if (_.htmlExpr.test(_.options.prevArrow)) { 1384 _.$prevArrow.prependTo(_.options.appendArrows); 1385 } 1386 1387 if (_.htmlExpr.test(_.options.nextArrow)) { 1388 _.$nextArrow.appendTo(_.options.appendArrows); 1389 } 1390 1391 if (_.options.infinite !== true) { 1392 _.$prevArrow 1393 .addClass('slick-disabled') 1394 .attr('aria-disabled', 'true'); 1395 } 1396 1397 } else { 1398 1399 _.$prevArrow.add( _.$nextArrow ) 1400 1401 .addClass('slick-hidden') 1402 .attr({ 1403 'aria-disabled': 'true', 1404 'tabindex': '-1' 1405 }); 1406 1407 } 1408 1409 } 1410 1411 }; 1412 1413 Slick.prototype.buildDots = function() { 1414 1415 var _ = this, 1416 i, dot; 1417 1418 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 1419 1420 _.$slider.addClass('slick-dotted'); 1421 1422 dot = $('<ul />').addClass(_.options.dotsClass); 1423 1424 for (i = 0; i <= _.getDotCount(); i += 1) { 1425 dot.append($('<li />').addClass(_.options.dotsClass.slice(0, -1)).append(_.options.customPaging.call(this, _, i))); 1426 } 1427 1428 _.$dots = dot.appendTo(_.options.appendDots); 1429 1430 _.$dots.find('li').first().addClass('slick-active'); 1431 1432 } 1433 1434 }; 1435 1436 Slick.prototype.buildOut = function() { 1437 1438 var _ = this; 1439 1440 _.$slides = 1441 _.$slider 1442 .children( _.options.slide + ':not(.slick-cloned)') 1443 .addClass('slick-slide'); 1444 1445 _.slideCount = _.$slides.length; 1446 1447 _.$slides.each(function(index, element) { 1448 $(element) 1449 .attr('data-slick-index', index) 1450 .data('originalStyling', $(element).attr('style') || ''); 1451 }); 1452 1453 _.$slider.addClass('slick-slider'); 1454 1455 _.$slideTrack = (_.slideCount === 0) ? 1456 $('<div class="slick-track"/>').appendTo(_.$slider) : 1457 _.$slides.wrapAll('<div class="slick-track"/>').parent(); 1458 1459 _.$list = _.$slideTrack.wrap( 1460 '<div class="slick-list"/>').parent(); 1461 _.$slideTrack.css('opacity', 0); 1462 1463 if (_.options.centerMode === true || _.options.swipeToSlide === true) { 1464 _.options.slidesToScroll = 1; 1465 } 1466 1467 $('img[data-lazy]', _.$slider).not('[src]').addClass('slick-loading'); 1468 1469 _.setupInfinite(); 1470 1471 _.buildArrows(); 1472 1473 _.buildDots(); 1474 1475 _.updateDots(); 1476 1477 1478 _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0); 1479 1480 if (_.options.draggable === true) { 1481 _.$list.addClass('draggable'); 1482 } 1483 1484 }; 1485 1486 Slick.prototype.buildRows = function() { 1487 1488 var _ = this, a, b, c, newSlides, numOfSlides, originalSlides, slidesPerSection, cls; 1489 1490 newSlides = document.createDocumentFragment(); 1491 originalSlides = _.$slider.children(); 1492 1493 if(_.options.rows > 0) { 1494 1495 slidesPerSection = _.options.slidesPerRow * _.options.rows; 1496 numOfSlides = Math.ceil( 1497 originalSlides.length / slidesPerSection 1498 ); 1499 1500 for(a = 0; a < numOfSlides; a++){ 1501 var slide = document.createElement('div'); 1502 for(b = 0; b < _.options.rows; b++) { 1503 var row = document.createElement('div'); 1504 for(c = 0; c < _.options.slidesPerRow; c++) { 1505 var target = (a * slidesPerSection + ((b * _.options.slidesPerRow) + c)); 1506 if (originalSlides.get(target)) { 1507 row.appendChild(originalSlides.get(target)); 1508 } 1509 } 1510 slide.appendChild(row); 1511 } 1512 newSlides.appendChild(slide); 1513 } 1514 1515 _.$slider.empty().append(newSlides); 1516 _.$slider.children().children().children() 1517 .css({ 1518 'width':(100 / _.options.slidesPerRow) + '%', 1519 'display': 'inline-block', 1520 'vertical-align': 'middle' 1521 }); 1522 1523 } 1524 1525 }; 1526 1527 Slick.prototype.checkResponsive = function(initial, forceUpdate) { 1528 1529 var _ = this, 1530 breakpoint, targetBreakpoint, respondToWidth, triggerBreakpoint = false; 1531 var sliderWidth = _.$slider.width(); 1532 var windowWidth = window.innerWidth || $(window).width(); 1533 1534 if (_.respondTo === 'window') { 1535 respondToWidth = windowWidth; 1536 } else if (_.respondTo === 'slider') { 1537 respondToWidth = sliderWidth; 1538 } else if (_.respondTo === 'min') { 1539 respondToWidth = Math.min(windowWidth, sliderWidth); 1540 } 1541 1542 if ( _.options.responsive && 1543 _.options.responsive.length && 1544 _.options.responsive !== null) { 1545 1546 targetBreakpoint = null; 1547 1548 for (breakpoint in _.breakpoints) { 1549 if (_.breakpoints.hasOwnProperty(breakpoint)) { 1550 if (_.originalSettings.mobileFirst === false) { 1551 if (respondToWidth < _.breakpoints[breakpoint]) { 1552 targetBreakpoint = _.breakpoints[breakpoint]; 1553 } 1554 } else { 1555 if (respondToWidth > _.breakpoints[breakpoint]) { 1556 targetBreakpoint = _.breakpoints[breakpoint]; 1557 } 1558 } 1559 } 1560 } 1561 1562 if (targetBreakpoint !== null) { 1563 if (_.activeBreakpoint !== null) { 1564 if (targetBreakpoint !== _.activeBreakpoint || forceUpdate) { 1565 _.activeBreakpoint = 1566 targetBreakpoint; 1567 if (_.breakpointSettings[targetBreakpoint] === 'unslick') { 1568 _.unslick(targetBreakpoint); 1569 } else { 1570 _.options = $.extend({}, _.originalSettings, 1571 _.breakpointSettings[ 1572 targetBreakpoint]); 1573 if (initial === true) { 1574 _.currentSlide = _.options.initialSlide; 1575 } 1576 _.refresh(initial); 1577 } 1578 triggerBreakpoint = targetBreakpoint; 1579 } 1580 } else { 1581 _.activeBreakpoint = targetBreakpoint; 1582 if (_.breakpointSettings[targetBreakpoint] === 'unslick') { 1583 _.unslick(targetBreakpoint); 1584 } else { 1585 _.options = $.extend({}, _.originalSettings, 1586 _.breakpointSettings[ 1587 targetBreakpoint]); 1588 if (initial === true) { 1589 _.currentSlide = _.options.initialSlide; 1590 } 1591 _.refresh(initial); 1592 } 1593 triggerBreakpoint = targetBreakpoint; 1594 } 1595 } else { 1596 if (_.activeBreakpoint !== null) { 1597 _.activeBreakpoint = null; 1598 _.options = _.originalSettings; 1599 if (initial === true) { 1600 _.currentSlide = _.options.initialSlide; 1601 } 1602 _.refresh(initial); 1603 triggerBreakpoint = targetBreakpoint; 1604 } 1605 } 1606 1607 // only trigger breakpoints during an actual break. not on initialize. 1608 if( !initial && triggerBreakpoint !== false ) { 1609 _.$slider.trigger('breakpoint', [_, triggerBreakpoint]); 1610 } 1611 } 1612 1613 }; 1614 1615 Slick.prototype.changeSlide = function(event, dontAnimate) { 1616 1617 var _ = this, 1618 $target = $(event.currentTarget), 1619 indexOffset, slideOffset, unevenOffset; 1620 1621 // If target is a link, prevent default action. 1622 if($target.is('a')) { 1623 event.preventDefault(); 1624 } 1625 1626 // If target is not the <li> element (ie: a child), find the <li>. 1627 if(!$target.is('li')) { 1628 $target = $target.closest('li'); 1629 } 1630 1631 unevenOffset = (_.slideCount % _.options.slidesToScroll !== 0); 1632 indexOffset = unevenOffset ? 0 : (_.slideCount - _.currentSlide) % _.options.slidesToScroll; 1633 1634 switch (event.data.message) { 1635 1636 case 'previous': 1637 slideOffset = indexOffset === 0 ? _.options.slidesToScroll : _.options.slidesToShow - indexOffset; 1638 if (_.slideCount > _.options.slidesToShow) { 1639 _.slideHandler(_.currentSlide - slideOffset, false, dontAnimate); 1640 } 1641 break; 1642 1643 case 'next': 1644 slideOffset = indexOffset === 0 ? _.options.slidesToScroll : indexOffset; 1645 if (_.slideCount > _.options.slidesToShow) { 1646 _.slideHandler(_.currentSlide + slideOffset, false, dontAnimate); 1647 } 1648 break; 1649 1650 case 'index': 1651 var index = event.data.index === 0 ? 0 : 1652 event.data.index || $target.index() * _.options.slidesToScroll; 1653 1654 _.slideHandler(_.checkNavigable(index), false, dontAnimate); 1655 $target.children().trigger('focus'); 1656 break; 1657 1658 default: 1659 return; 1660 } 1661 1662 }; 1663 1664 Slick.prototype.checkNavigable = function(index) { 1665 1666 var _ = this, 1667 navigables, prevNavigable; 1668 1669 navigables = _.getNavigableIndexes(); 1670 prevNavigable = 0; 1671 if (index > navigables[navigables.length - 1]) { 1672 index = navigables[navigables.length - 1]; 1673 } else { 1674 for (var n in navigables) { 1675 if (index < navigables[n]) { 1676 index = prevNavigable; 1677 break; 1678 } 1679 prevNavigable = navigables[n]; 1680 } 1681 } 1682 1683 return index; 1684 }; 1685 1686 Slick.prototype.cleanUpEvents = function() { 1687 1688 var _ = this; 1689 1690 if (_.options.dots && _.$dots !== null) { 1691 1692 $('li', _.$dots) 1693 .off('click.slick', _.changeSlide) 1694 .off('mouseenter.slick', $.proxy(_.interrupt, _, true)) 1695 .off('mouseleave.slick', $.proxy(_.interrupt, _, false)); 1696 1697 if (_.options.accessibility === true) { 1698 _.$dots.off('keydown.slick', _.keyHandler); 1699 } 1700 } 1701 1702 _.$slider.off('focus.slick blur.slick'); 1703 1704 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 1705 _.$prevArrow && _.$prevArrow.off('click.slick', _.changeSlide); 1706 _.$nextArrow && _.$nextArrow.off('click.slick', _.changeSlide); 1707 1708 if (_.options.accessibility === true) { 1709 _.$prevArrow && _.$prevArrow.off('keydown.slick', _.keyHandler); 1710 _.$nextArrow && _.$nextArrow.off('keydown.slick', _.keyHandler); 1711 } 1712 } 1713 1714 _.$list.off('touchstart.slick mousedown.slick', _.swipeHandler); 1715 _.$list.off('touchmove.slick mousemove.slick', _.swipeHandler); 1716 _.$list.off('touchend.slick mouseup.slick', _.swipeHandler); 1717 _.$list.off('touchcancel.slick mouseleave.slick', _.swipeHandler); 1718 1719 _.$list.off('click.slick', _.clickHandler); 1720 1721 $(document).off(_.visibilityChange, _.visibility); 1722 1723 _.cleanUpSlideEvents(); 1724 1725 if (_.options.accessibility === true) { 1726 _.$list.off('keydown.slick', _.keyHandler); 1727 } 1728 1729 if (_.options.focusOnSelect === true) { 1730 $(_.$slideTrack).children().off('click.slick', _.selectHandler); 1731 } 1732 1733 $(window).off('orientationchange.slick.slick-' + _.instanceUid, _.orientationChange); 1734 1735 $(window).off('resize.slick.slick-' + _.instanceUid, _.resize); 1736 1737 $('[draggable!=true]', _.$slideTrack).off('dragstart', _.preventDefault); 1738 1739 $(window).off('load.slick.slick-' + _.instanceUid, _.setPosition); 1740 1741 }; 1742 1743 Slick.prototype.cleanUpSlideEvents = function() { 1744 1745 var _ = this; 1746 1747 _.$list.off('mouseenter.slick', $.proxy(_.interrupt, _, true)); 1748 _.$list.off('mouseleave.slick', $.proxy(_.interrupt, _, false)); 1749 1750 }; 1751 1752 Slick.prototype.cleanUpRows = function() { 1753 1754 var _ = this, originalSlides; 1755 1756 if(_.options.rows > 0) { 1757 originalSlides = _.$slides.children().children(); 1758 originalSlides.removeAttr('style'); 1759 _.$slider.empty().append(originalSlides); 1760 } 1761 1762 }; 1763 1764 Slick.prototype.clickHandler = function(event) { 1765 1766 var _ = this; 1767 1768 if (_.shouldClick === false) { 1769 event.stopImmediatePropagation(); 1770 event.stopPropagation(); 1771 event.preventDefault(); 1772 } 1773 1774 }; 1775 1776 Slick.prototype.destroy = function(refresh) { 1777 1778 var _ = this; 1779 1780 _.autoPlayClear(); 1781 1782 _.touchObject = {}; 1783 1784 _.cleanUpEvents(); 1785 1786 $('.slick-cloned', _.$slider).detach(); 1787 1788 if (_.$dots) { 1789 _.$dots.remove(); 1790 } 1791 1792 if ( _.$prevArrow && _.$prevArrow.length ) { 1793 1794 _.$prevArrow 1795 .removeClass('slick-disabled slick-arrow slick-hidden') 1796 .removeAttr('aria-hidden aria-disabled tabindex') 1797 .css('display',''); 1798 1799 if ( _.htmlExpr.test( _.options.prevArrow )) { 1800 _.$prevArrow.remove(); 1801 } 1802 } 1803 1804 if ( _.$nextArrow && _.$nextArrow.length ) { 1805 1806 _.$nextArrow 1807 .removeClass('slick-disabled slick-arrow slick-hidden') 1808 .removeAttr('aria-hidden aria-disabled tabindex') 1809 .css('display',''); 1810 1811 if ( _.htmlExpr.test( _.options.nextArrow )) { 1812 _.$nextArrow.remove(); 1813 } 1814 } 1815 1816 1817 if (_.$slides) { 1818 1819 _.$slides 1820 .removeClass('slick-slide slick-active slick-center slick-visible slick-current') 1821 .removeAttr('aria-hidden') 1822 .removeAttr('data-slick-index') 1823 .each(function(){ 1824 $(this).attr('style', $(this).data('originalStyling')); 1825 }); 1826 1827 _.$slideTrack.children(this.options.slide).detach(); 1828 1829 _.$slideTrack.detach(); 1830 1831 _.$list.detach(); 1832 1833 _.$slider.append(_.$slides); 1834 } 1835
1836 _.cleanUpRows(); 1837 1838 _.$slider.removeClass('slick-slider'); 1839 _.$slider.removeClass('slick-initialized'); 1840 _.$slider.removeClass('slick-dotted'); 1841 1842 _.unslicked = true; 1843 1844 if(!refresh) { 1845 _.$slider.trigger('destroy', [_]); 1846 } 1847 1848 }; 1849 1850 Slick.prototype.disableTransition = function(slide) { 1851 1852 var _ = this, 1853 transition = {}; 1854 1855 transition[_.transitionType] = ''; 1856 1857 if (_.options.fade === false) { 1858 _.$slideTrack.css(transition); 1859 } else { 1860 _.$slides.eq(slide).css(transition); 1861 } 1862 1863 }; 1864 1865 Slick.prototype.fadeSlide = function(slideIndex, callback) { 1866 1867 var _ = this; 1868 1869 if (_.cssTransitions === false) { 1870 1871 _.$slides.eq(slideIndex).css({ 1872 zIndex: _.options.zIndex 1873 }); 1874 1875 _.$slides.eq(slideIndex).animate({ 1876 opacity: 1 1877 }, _.options.speed, _.options.easing, callback); 1878 1879 } else { 1880 1881 _.applyTransition(slideIndex); 1882 1883 _.$slides.eq(slideIndex).css({ 1884 opacity: 1, 1885 zIndex: _.options.zIndex 1886 }); 1887 1888 if (callback) { 1889 setTimeout(function() { 1890 1891 _.disableTransition(slideIndex); 1892 1893 callback.call(); 1894 }, _.options.speed); 1895 } 1896 1897 } 1898 1899 }; 1900 1901 Slick.prototype.fadeSlideOut = function(slideIndex) { 1902 1903 var _ = this; 1904 1905 if (_.cssTransitions === false) { 1906 1907 _.$slides.eq(slideIndex).animate({ 1908 opacity: 0, 1909 zIndex: _.options.zIndex - 2 1910 }, _.options.speed, _.options.easing); 1911 1912 } else { 1913 1914 _.applyTransition(slideIndex); 1915 1916 _.$slides.eq(slideIndex).css({ 1917 opacity: 0, 1918 zIndex: _.options.zIndex - 2 1919 }); 1920 1921 } 1922 1923 }; 1924 1925 Slick.prototype.filterSlides = Slick.prototype.slickFilter = function(filter) { 1926 1927 var _ = this; 1928 1929 if (filter !== null) { 1930 1931 _.$slidesCache = _.$slides; 1932 1933 _.unload(); 1934 1935 _.$slideTrack.children(this.options.slide).detach(); 1936 1937 _.$slidesCache.filter(filter).appendTo(_.$slideTrack); 1938 1939 _.reinit(); 1940 1941 } 1942 1943 }; 1944 1945 Slick.prototype.focusHandler = function() { 1946 1947 var _ = this; 1948 1949 // If any child element receives focus within the slider we need to pause the autoplay 1950 _.$slider 1951 .off('focus.slick blur.slick') 1952 .on( 1953 'focus.slick', 1954 '*', 1955 function(event) { 1956 var $sf = $(this); 1957 1958 setTimeout(function() { 1959 if( _.options.pauseOnFocus ) { 1960 if ($sf.is(':focus')) { 1961 _.focussed = true; 1962 _.autoPlay(); 1963 } 1964 } 1965 }, 0); 1966 } 1967 ).on( 1968 'blur.slick', 1969 '*', 1970 function(event) { 1971 var $sf = $(this); 1972 1973 // When a blur occurs on any elements within the slider we become unfocused 1974 if( _.options.pauseOnFocus ) { 1975 _.focussed = false; 1976 _.autoPlay(); 1977 } 1978 } 1979 ); 1980 }; 1981 1982 Slick.prototype.getCurrent = Slick.prototype.slickCurrentSlide = function() { 1983 1984 var _ = this; 1985 return _.currentSlide; 1986 1987 }; 1988 1989 Slick.prototype.getDotCount = function() { 1990 1991 var _ = this; 1992 1993 var breakPoint = 0; 1994 var counter = 0; 1995 var pagerQty = 0; 1996 1997 if (_.options.infinite === true) { 1998 if (_.slideCount <= _.options.slidesToShow) { 1999 ++pagerQty; 2000 } else { 2001 while (breakPoint < _.slideCount) { 2002 ++pagerQty; 2003 breakPoint = counter + _.options.slidesToScroll; 2004 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 2005 } 2006 } 2007 } else if (_.options.centerMode === true) { 2008 pagerQty = _.slideCount; 2009 } else if(!_.options.asNavFor) {
vendor: 3,515 bytes, lines 2010-2088
2010 pagerQty = 1 + Math.ceil((_.slideCount - _.options.slidesToShow) / _.options.slidesToScroll); 2011 }else { 2012 while (breakPoint < _.slideCount) { 2013 ++pagerQty; 2014 breakPoint = counter + _.options.slidesToScroll; 2015 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 2016 } 2017 } 2018 2019 return pagerQty - 1; 2020 2021 }; 2022 2023 Slick.prototype.getLeft = function(slideIndex) { 2024 2025 var _ = this, 2026 targetLeft, 2027 verticalHeight, 2028 verticalOffset = 0, 2029 targetSlide, 2030 coef; 2031 2032 _.slideOffset = 0; 2033 verticalHeight = _.$slides.first().outerHeight(true); 2034 2035 if (_.options.infinite === true) { 2036 if (_.slideCount > _.options.slidesToShow) { 2037 _.slideOffset = (_.slideWidth * _.options.slidesToShow) * -1; 2038 coef = -1 2039 2040 if (_.options.vertical === true && _.options.centerMode === true) { 2041 if (_.options.slidesToShow === 2) { 2042 coef = -1.5; 2043 } else if (_.options.slidesToShow === 1) { 2044 coef = -2 2045 } 2046 } 2047 verticalOffset = (verticalHeight * _.options.slidesToShow) * coef; 2048 } 2049 if (_.slideCount % _.options.slidesToScroll !== 0) { 2050 if (slideIndex + _.options.slidesToScroll > _.slideCount && _.slideCount > _.options.slidesToShow) { 2051 if (slideIndex > _.slideCount) { 2052 _.slideOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * _.slideWidth) * -1; 2053 verticalOffset = ((_.options.slidesToShow - (slideIndex - _.slideCount)) * verticalHeight) * -1; 2054 } else { 2055 _.slideOffset = ((_.slideCount % _.options.slidesToScroll) * _.slideWidth) * -1; 2056 verticalOffset = ((_.slideCount % _.options.slidesToScroll) * verticalHeight) * -1; 2057 } 2058 } 2059 } 2060 } else { 2061 if (slideIndex + _.options.slidesToShow > _.slideCount) { 2062 _.slideOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * _.slideWidth; 2063 verticalOffset = ((slideIndex + _.options.slidesToShow) - _.slideCount) * verticalHeight; 2064 } 2065 } 2066 2067 if (_.slideCount <= _.options.slidesToShow) { 2068 _.slideOffset = 0; 2069 verticalOffset = 0; 2070 } 2071 2072 if (_.options.centerMode === true && _.slideCount <= _.options.slidesToShow) { 2073 _.slideOffset = ((_.slideWidth * Math.floor(_.options.slidesToShow)) / 2) - ((_.slideWidth * _.slideCount) / 2); 2074 } else if (_.options.centerMode === true && _.options.infinite === true) { 2075 _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2) - _.slideWidth; 2076 } else if (_.options.centerMode === true) { 2077 _.slideOffset = 0; 2078 _.slideOffset += _.slideWidth * Math.floor(_.options.slidesToShow / 2); 2079 } 2080 2081 if (_.options.vertical === false) { 2082 targetLeft = ((slideIndex * _.slideWidth) * -1) + _.slideOffset; 2083 } else { 2084 targetLeft = ((slideIndex * verticalHeight) * -1) + verticalOffset; 2085 } 2086 2087 if (_.options.variableWidth === true) { 2088
2089 if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) { 2090 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex); 2091 } else { 2092 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow); 2093 } 2094 2095 if (_.options.rtl === true) { 2096 if (targetSlide[0]) { 2097 targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1; 2098 } else { 2099 targetLeft = 0; 2100 } 2101 } else { 2102 targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0; 2103 } 2104 2105 if (_.options.centerMode === true) { 2106 if (_.slideCount <= _.options.slidesToShow || _.options.infinite === false) { 2107 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex); 2108 } else { 2109 targetSlide = _.$slideTrack.children('.slick-slide').eq(slideIndex + _.options.slidesToShow + 1); 2110 } 2111 2112 if (_.options.rtl === true) { 2113 if (targetSlide[0]) { 2114 targetLeft = (_.$slideTrack.width() - targetSlide[0].offsetLeft - targetSlide.width()) * -1; 2115 } else { 2116 targetLeft = 0; 2117 } 2118 } else { 2119 targetLeft = targetSlide[0] ? targetSlide[0].offsetLeft * -1 : 0; 2120 } 2121 2122 targetLeft += (_.$list.width() - targetSlide.outerWidth()) / 2; 2123 } 2124 } 2125 2126 return targetLeft; 2127 2128 }; 2129 2130 Slick.prototype.getOption = Slick.prototype.slickGetOption = function(option) { 2131 2132 var _ = this; 2133 2134 return _.options[option]; 2135 2136 }; 2137 2138 Slick.prototype.getNavigableIndexes = function() { 2139 2140 var _ = this, 2141 breakPoint = 0, 2142 counter = 0, 2143 indexes = [], 2144 max; 2145 2146 if (_.options.infinite === false) { 2147 max = _.slideCount; 2148 } else { 2149 breakPoint = _.options.slidesToScroll * -1; 2150 counter = _.options.slidesToScroll * -1; 2151 max = _.slideCount * 2; 2152 } 2153 2154 while (breakPoint < max) { 2155 indexes.push(breakPoint); 2156 breakPoint = counter + _.options.slidesToScroll; 2157 counter += _.options.slidesToScroll <= _.options.slidesToShow ? _.options.slidesToScroll : _.options.slidesToShow; 2158 } 2159 2160 return indexes; 2161 2162 }; 2163 2164 Slick.prototype.getSlick = function() { 2165 2166 return this; 2167 2168 }; 2169 2170 Slick.prototype.getSlideCount = function() { 2171 2172 var _ = this, 2173 slidesTraversed, swipedSlide, swipeTarget, centerOffset; 2174 2175 centerOffset = _.options.centerMode === true ? Math.floor(_.$list.width() / 2) : 0; 2176 swipeTarget = (_.swipeLeft * -1) + centerOffset; 2177 2178 if (_.options.swipeToSlide === true) { 2179 2180 _.$slideTrack.find('.slick-slide').each(function(index, slide) { 2181 2182 var slideOuterWidth, slideOffset, slideRightBoundary; 2183 slideOuterWidth = $(slide).outerWidth(); 2184 slideOffset = slide.offsetLeft; 2185 if (_.options.centerMode !== true) { 2186 slideOffset += (slideOuterWidth / 2); 2187 } 2188 2189 slideRightBoundary = slideOffset + (slideOuterWidth); 2190 2191 if (swipeTarget < slideRightBoundary) { 2192 swipedSlide = slide; 2193 return false; 2194 } 2195 }); 2196 2197 slidesTraversed = Math.abs($(swipedSlide).attr('data-slick-index') - _.currentSlide) || 1; 2198 2199 return slidesTraversed; 2200 2201 } else { 2202 return _.options.slidesToScroll; 2203 } 2204 2205 }; 2206 2207 Slick.prototype.goTo = Slick.prototype.slickGoTo = function(slide, dontAnimate) { 2208 2209 var _ = this; 2210 2211 _.changeSlide({ 2212 data: { 2213 message: 'index', 2214 index: parseInt(slide) 2215 } 2216 }, dontAnimate); 2217 2218 }; 2219 2220 Slick.prototype.init = function(creation) { 2221 2222 var _ = this; 2223 2224 if (!$(_.$slider).hasClass('slick-initialized')) { 2225 2226 $(_.$slider).addClass('slick-initialized'); 2227 2228 _.buildRows(); 2229 _.buildOut(); 2230 _.setProps(); 2231 _.startLoad(); 2232 _.loadSlider(); 2233 _.initializeEvents(); 2234 _.updateArrows(); 2235 _.updateDots(); 2236 _.checkResponsive(true); 2237 _.focusHandler(); 2238 2239 } 2240 2241 if (creation) { 2242 _.$slider.trigger('init', [_]); 2243 } 2244 2245 if (_.options.accessibility === true) { 2246 _.initADA(); 2247 } 2248 2249 if ( _.options.autoplay ) { 2250 2251 _.paused = false; 2252 _.autoPlay(); 2253 2254 } 2255 2256 }; 2257 2258 Slick.prototype.initADA = function() { 2259 var _ = this, 2260 numDotGroups = Math.ceil(_.slideCount / _.options.slidesToShow),
2261// tabControlIndexes = _.getNavigableIndexes().filter(function(val) { 2262// return (val >= 0) && (val < _.slideCount); 2263// }); 2264 2265 tabControlIndexes = function(){ 2266 var arr = []; 2267 2268 for(var i=0; i<_.getNavigableIndexes().length; i++){ 2269 if((_.getNavigableIndexes()[i] >= 0) && (_.getNavigableIndexes()[i] < _.slideCount)){ 2270 arr.push(_.getNavigableIndexes()[i]); 2271 } 2272 } 2273 return arr; 2274 }(); 2275 2276 _.$slides.add(_.$slideTrack.find('.slick-cloned')).attr({ 2277 'aria-hidden': 'true', 2278 'tabindex': '-1' 2279 }).find('a, input, button, select').attr({ 2280 'tabindex': '-1' 2281 }); 2282 2283 if (_.$dots !== null) { 2284 _.$slides.not(_.$slideTrack.find('.slick-cloned')).each(function(i) { 2285 var slideControlIndex = tabControlIndexes.indexOf(i); 2286 2287 $(this).attr({ 2288 'role': 'tabpanel', 2289 'id': 'slick-slide' + _.instanceUid + i, 2290 'tabindex': -1 2291 }); 2292 2293 if (slideControlIndex !== -1) { 2294 var ariaButtonControl = 'slick-slide-control' + _.instanceUid + slideControlIndex 2295 if ($('#' + ariaButtonControl).length) { 2296 $(this).attr({ 2297 'aria-describedby': ariaButtonControl 2298 }); 2299 } 2300 } 2301 }); 2302 2303 _.$dots.attr('role', 'tablist').find('li').each(function(i) { 2304 var mappedSlideIndex = tabControlIndexes[i]; 2305 2306 $(this).attr({ 2307 'role': 'presentation' 2308 }); 2309 2310 $(this).find('button').first().attr({ 2311 'role': 'tab', 2312 'id': 'slick-slide-control' + _.instanceUid + i, 2313 'aria-controls': 'slick-slide' + _.instanceUid + mappedSlideIndex, 2314 'aria-label': (i + 1) + ' of ' + numDotGroups, 2315 'aria-selected': null, 2316 'tabindex': '-1' 2317 }); 2318 2319 }).eq(_.currentSlide).find('button').attr({ 2320 'aria-selected': 'true', 2321 'tabindex': '0' 2322 }).end(); 2323 } 2324 2325 for (var i=_.currentSlide, max=i+_.options.slidesToShow; i < max; i++) { 2326 if (_.options.focusOnChange) { 2327 _.$slides.eq(i).attr({'tabindex': '0'}); 2328 } else { 2329 _.$slides.eq(i).removeAttr('tabindex'); 2330 } 2331 } 2332 2333 _.activateADA(); 2334 2335 }; 2336 2337 Slick.prototype.initArrowEvents = function() { 2338 2339 var _ = this; 2340 2341 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 2342 _.$prevArrow 2343 .off('click.slick') 2344 .on('click.slick', { 2345 message: 'previous' 2346 }, _.changeSlide); 2347 _.$nextArrow 2348 .off('click.slick') 2349 .on('click.slick', { 2350 message: 'next' 2351 }, _.changeSlide); 2352 2353 if (_.options.accessibility === true) { 2354 _.$prevArrow.on('keydown.slick', _.keyHandler); 2355 _.$nextArrow.on('keydown.slick', _.keyHandler); 2356 } 2357 } 2358 2359 }; 2360 2361 Slick.prototype.initDotEvents = function() { 2362 2363 var _ = this; 2364 2365 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 2366 $('li', _.$dots).on('click.slick', { 2367 message: 'index' 2368 }, _.changeSlide); 2369 2370 if (_.options.accessibility === true) { 2371 _.$dots.on('keydown.slick', _.keyHandler); 2372 } 2373 } 2374 2375 if (_.options.dots === true && _.options.pauseOnDotsHover === true && _.slideCount > _.options.slidesToShow) { 2376 2377 $('li', _.$dots) 2378 .on('mouseenter.slick', $.proxy(_.interrupt, _, true))
vendor: 47,365 bytes, lines 2379-3981
2379 .on('mouseleave.slick', $.proxy(_.interrupt, _, false)); 2380 2381 } 2382 2383 }; 2384 2385 Slick.prototype.initSlideEvents = function() { 2386 2387 var _ = this; 2388 2389 if ( _.options.pauseOnHover ) { 2390 2391 _.$list.on('mouseenter.slick', $.proxy(_.interrupt, _, true)); 2392 _.$list.on('mouseleave.slick', $.proxy(_.interrupt, _, false)); 2393 2394 } 2395 2396 }; 2397 2398 Slick.prototype.initializeEvents = function() { 2399 2400 var _ = this; 2401 2402 _.initArrowEvents(); 2403 2404 _.initDotEvents(); 2405 _.initSlideEvents(); 2406 2407 _.$list.on('touchstart.slick mousedown.slick', { 2408 action: 'start' 2409 }, _.swipeHandler); 2410 _.$list.on('touchmove.slick mousemove.slick', { 2411 action: 'move' 2412 }, _.swipeHandler); 2413 _.$list.on('touchend.slick mouseup.slick', { 2414 action: 'end' 2415 }, _.swipeHandler); 2416 _.$list.on('touchcancel.slick mouseleave.slick', { 2417 action: 'end' 2418 }, _.swipeHandler); 2419 2420 _.$list.on('click.slick', _.clickHandler); 2421 2422 $(document).on(_.visibilityChange, $.proxy(_.visibility, _)); 2423 2424 if (_.options.accessibility === true) { 2425 _.$list.on('keydown.slick', _.keyHandler); 2426 } 2427 2428 if (_.options.focusOnSelect === true) { 2429 $(_.$slideTrack).children().on('click.slick', _.selectHandler); 2430 } 2431 2432 $(window).on('orientationchange.slick.slick-' + _.instanceUid, $.proxy(_.orientationChange, _)); 2433 2434 $(window).on('resize.slick.slick-' + _.instanceUid, $.proxy(_.resize, _)); 2435 2436 $('[draggable!=true]', _.$slideTrack).on('dragstart', _.preventDefault); 2437 2438 $(window).on('load.slick.slick-' + _.instanceUid, _.setPosition); 2439 $(_.setPosition); 2440 2441 }; 2442 2443 Slick.prototype.initUI = function() { 2444 2445 var _ = this; 2446 2447 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 2448 2449 _.$prevArrow.show(); 2450 _.$nextArrow.show(); 2451 2452 } 2453 2454 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 2455 2456 _.$dots.show(); 2457 2458 } 2459 2460 }; 2461 2462 Slick.prototype.keyHandler = function(event) { 2463 2464 var _ = this; 2465 //Dont slide if the cursor is inside the form fields and arrow keys are pressed 2466 if(!event.target.tagName.match('TEXTAREA|INPUT|SELECT')) { 2467 if (event.keyCode === 37 && _.options.accessibility === true) { 2468 _.changeSlide({ 2469 data: { 2470 message: _.options.rtl === true ? 'next' : 'previous' 2471 } 2472 }); 2473 } else if (event.keyCode === 39 && _.options.accessibility === true) { 2474 _.changeSlide({ 2475 data: { 2476 message: _.options.rtl === true ? 'previous' : 'next' 2477 } 2478 }); 2479 } 2480 } 2481 2482 }; 2483 2484 Slick.prototype.lazyLoad = function() { 2485 2486 var _ = this, 2487 loadRange, cloneRange, rangeStart, rangeEnd; 2488 2489 function loadImages(imagesScope) { 2490 2491 $('img[data-lazy]', imagesScope).each(function() { 2492 2493 var image = $(this), 2494 imageSource = $(this).attr('data-lazy'), 2495 imageSrcSet = $(this).attr('data-srcset'), 2496 imageSizes = $(this).attr('data-sizes') || _.$slider.attr('data-sizes'), 2497 imageToLoad = document.createElement('img'); 2498 2499 imageToLoad.onload = function() { 2500 2501 image 2502 .animate({ opacity: 0 }, 100, function() { 2503 2504 if (imageSrcSet) { 2505 image 2506 .attr('srcset', imageSrcSet ); 2507 2508 if (imageSizes) { 2509 image 2510 .attr('sizes', imageSizes ); 2511 } 2512 } 2513 2514 image 2515 .attr('src', imageSource) 2516 .animate({ opacity: 1 }, 200, function() { 2517 image 2518 .removeAttr('data-lazy data-srcset data-sizes') 2519 .removeClass('slick-loading'); 2520 }); 2521 _.$slider.trigger('lazyLoaded', [_, image, imageSource]); 2522 }); 2523 2524 }; 2525 2526 imageToLoad.onerror = function() { 2527 2528 image 2529 .removeAttr( 'data-lazy' ) 2530 .removeClass( 'slick-loading' ) 2531 .addClass( 'slick-lazyload-error' ); 2532 2533 _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]); 2534 2535 }; 2536 2537 imageToLoad.src = imageSource; 2538 2539 }); 2540 2541 } 2542 2543 if (_.options.centerMode === true) { 2544 if (_.options.infinite === true) { 2545 rangeStart = _.currentSlide + (_.options.slidesToShow / 2 + 1); 2546 rangeEnd = rangeStart + _.options.slidesToShow + 2; 2547 } else { 2548 rangeStart = Math.max(0, _.currentSlide - (_.options.slidesToShow / 2 + 1)); 2549 rangeEnd = 2 + (_.options.slidesToShow / 2 + 1) + _.currentSlide; 2550 } 2551 } else { 2552 rangeStart = _.options.infinite ? _.options.slidesToShow + _.currentSlide : _.currentSlide; 2553 rangeEnd = Math.ceil(rangeStart + _.options.slidesToShow); 2554 if (_.options.fade === true) { 2555 if (rangeStart > 0) rangeStart--; 2556 if (rangeEnd <= _.slideCount) rangeEnd++; 2557 } 2558 } 2559 2560 loadRange = _.$slider.find('.slick-slide').slice(rangeStart, rangeEnd); 2561 2562 if (_.options.lazyLoad === 'anticipated') { 2563 var prevSlide = rangeStart - 1, 2564 nextSlide = rangeEnd, 2565 $slides = _.$slider.find('.slick-slide'); 2566 2567 for (var i = 0; i < _.options.slidesToScroll; i++) { 2568 if (prevSlide < 0) prevSlide = _.slideCount - 1; 2569 loadRange = loadRange.add($slides.eq(prevSlide)); 2570 loadRange = loadRange.add($slides.eq(nextSlide)); 2571 prevSlide--; 2572 nextSlide++; 2573 } 2574 } 2575 2576 loadImages(loadRange); 2577 2578 if (_.slideCount <= _.options.slidesToShow) { 2579 cloneRange = _.$slider.find('.slick-slide'); 2580 loadImages(cloneRange); 2581 } else 2582 if (_.currentSlide >= _.slideCount - _.options.slidesToShow) { 2583 cloneRange = _.$slider.find('.slick-cloned').slice(0, _.options.slidesToShow); 2584 loadImages(cloneRange); 2585 } else if (_.currentSlide === 0) { 2586 cloneRange = _.$slider.find('.slick-cloned').slice(_.options.slidesToShow * -1); 2587 loadImages(cloneRange); 2588 } 2589 2590 }; 2591 2592 Slick.prototype.loadSlider = function() { 2593 2594 var _ = this; 2595 2596 _.setPosition(); 2597 2598 _.$slideTrack.css({ 2599 opacity: 1 2600 }); 2601 2602 _.$slider.removeClass('slick-loading'); 2603 2604 _.initUI(); 2605 2606 if (_.options.lazyLoad === 'progressive') { 2607 _.progressiveLazyLoad(); 2608 } 2609 2610 }; 2611 2612 Slick.prototype.next = Slick.prototype.slickNext = function() { 2613 2614 var _ = this; 2615 2616 _.changeSlide({ 2617 data: { 2618 message: 'next' 2619 } 2620 }); 2621 2622 }; 2623 2624 Slick.prototype.orientationChange = function() { 2625 2626 var _ = this; 2627 2628 _.checkResponsive(); 2629 _.setPosition(); 2630 2631 }; 2632 2633 Slick.prototype.pause = Slick.prototype.slickPause = function() { 2634 2635 var _ = this; 2636 2637 _.autoPlayClear(); 2638 _.paused = true; 2639 2640 }; 2641 2642 Slick.prototype.play = Slick.prototype.slickPlay = function() { 2643 2644 var _ = this; 2645 2646 _.autoPlay(); 2647 _.options.autoplay = true; 2648 _.paused = false; 2649 _.focussed = false; 2650 _.interrupted = false; 2651 2652 }; 2653 2654 Slick.prototype.postSlide = function(index) { 2655 2656 var _ = this; 2657 2658 if( !_.unslicked ) { 2659 2660 _.$slider.trigger('afterChange', [_, index]); 2661 2662 _.animating = false; 2663 2664 if (_.slideCount > _.options.slidesToShow) { 2665 _.setPosition(); 2666 } 2667 2668 _.swipeLeft = null; 2669 2670 if ( _.options.autoplay ) { 2671 _.autoPlay(); 2672 } 2673 2674 if (_.options.accessibility === true) { 2675 _.initADA(); 2676 2677 if (_.options.focusOnChange) { 2678 var $currentSlide = $(_.$slides.get(_.currentSlide)); 2679 $currentSlide.attr('tabindex', 0).focus(); 2680 } 2681 } 2682 2683 } 2684 2685 }; 2686 2687 Slick.prototype.prev = Slick.prototype.slickPrev = function() { 2688 2689 var _ = this; 2690 2691 _.changeSlide({ 2692 data: { 2693 message: 'previous' 2694 } 2695 }); 2696 2697 }; 2698 2699 Slick.prototype.preventDefault = function(event) { 2700 2701 event.preventDefault(); 2702 2703 }; 2704 2705 Slick.prototype.progressiveLazyLoad = function( tryCount ) { 2706 2707 tryCount = tryCount || 1; 2708 2709 var _ = this, 2710 $imgsToLoad = $( 'img[data-lazy]', _.$slider ), 2711 image, 2712 imageSource, 2713 imageSrcSet, 2714 imageSizes, 2715 imageToLoad; 2716 2717 if ( $imgsToLoad.length ) { 2718 2719 image = $imgsToLoad.first(); 2720 imageSource = image.attr('data-lazy'); 2721 imageSrcSet = image.attr('data-srcset'); 2722 imageSizes = image.attr('data-sizes') || _.$slider.attr('data-sizes'); 2723 imageToLoad = document.createElement('img'); 2724 2725 imageToLoad.onload = function() { 2726 2727 if (imageSrcSet) { 2728 image 2729 .attr('srcset', imageSrcSet ); 2730 2731 if (imageSizes) { 2732 image 2733 .attr('sizes', imageSizes ); 2734 } 2735 } 2736 2737 image 2738 .attr( 'src', imageSource ) 2739 .removeAttr('data-lazy data-srcset data-sizes') 2740 .removeClass('slick-loading'); 2741 2742 if ( _.options.adaptiveHeight === true ) { 2743 _.setPosition(); 2744 } 2745 2746 _.$slider.trigger('lazyLoaded', [ _, image, imageSource ]); 2747 _.progressiveLazyLoad(); 2748 2749 }; 2750 2751 imageToLoad.onerror = function() { 2752 2753 if ( tryCount < 3 ) { 2754 2755 /** 2756 * try to load the image 3 times, 2757 * leave a slight delay so we don't get 2758 * servers blocking the request. 2759 */ 2760 setTimeout( function() { 2761 _.progressiveLazyLoad( tryCount + 1 ); 2762 }, 500 ); 2763 2764 } else { 2765 2766 image 2767 .removeAttr( 'data-lazy' ) 2768 .removeClass( 'slick-loading' ) 2769 .addClass( 'slick-lazyload-error' ); 2770 2771 _.$slider.trigger('lazyLoadError', [ _, image, imageSource ]); 2772 2773 _.progressiveLazyLoad(); 2774 2775 } 2776 2777 }; 2778 2779 imageToLoad.src = imageSource; 2780 2781 } else { 2782 2783 _.$slider.trigger('allImagesLoaded', [ _ ]); 2784 2785 } 2786 2787 }; 2788 2789 Slick.prototype.refresh = function( initializing ) { 2790 2791 var _ = this, currentSlide, lastVisibleIndex; 2792 2793 lastVisibleIndex = _.slideCount - _.options.slidesToShow; 2794 2795 // in non-infinite sliders, we don't want to go past the 2796 // last visible index. 2797 if( !_.options.infinite && ( _.currentSlide > lastVisibleIndex )) { 2798 _.currentSlide = lastVisibleIndex; 2799 } 2800 2801 // if less slides than to show, go to start. 2802 if ( _.slideCount <= _.options.slidesToShow ) { 2803 _.currentSlide = 0; 2804 2805 } 2806 2807 currentSlide = _.currentSlide; 2808 2809 _.destroy(true); 2810 2811 $.extend(_, _.initials, { currentSlide: currentSlide }); 2812 2813 _.init(); 2814 2815 if( !initializing ) { 2816 2817 _.changeSlide({ 2818 data: { 2819 message: 'index', 2820 index: currentSlide 2821 } 2822 }, false); 2823 2824 } 2825 2826 }; 2827 2828 Slick.prototype.registerBreakpoints = function() { 2829 2830 var _ = this, breakpoint, currentBreakpoint, l, 2831 responsiveSettings = _.options.responsive || null; 2832 2833 if ( $.type(responsiveSettings) === 'array' && responsiveSettings.length ) { 2834 2835 _.respondTo = _.options.respondTo || 'window'; 2836 2837 for ( breakpoint in responsiveSettings ) { 2838 2839 l = _.breakpoints.length-1; 2840 2841 if (responsiveSettings.hasOwnProperty(breakpoint)) { 2842 currentBreakpoint = responsiveSettings[breakpoint].breakpoint; 2843 2844 // loop through the breakpoints and cut out any existing 2845 // ones with the same breakpoint number, we don't want dupes. 2846 while( l >= 0 ) { 2847 if( _.breakpoints[l] && _.breakpoints[l] === currentBreakpoint ) { 2848 _.breakpoints.splice(l,1); 2849 } 2850 l--; 2851 } 2852 2853 _.breakpoints.push(currentBreakpoint); 2854 _.breakpointSettings[currentBreakpoint] = responsiveSettings[breakpoint].settings; 2855 2856 } 2857 2858 } 2859 2860 _.breakpoints.sort(function(a, b) { 2861 return ( _.options.mobileFirst ) ? a-b : b-a; 2862 }); 2863 2864 } 2865 2866 }; 2867 2868 Slick.prototype.reinit = function() { 2869 2870 var _ = this; 2871 2872 _.$slides = 2873 _.$slideTrack 2874 .children(_.options.slide) 2875 .addClass('slick-slide'); 2876 2877 _.slideCount = _.$slides.length; 2878 2879 if (_.currentSlide >= _.slideCount && _.currentSlide !== 0) { 2880 _.currentSlide = _.currentSlide - _.options.slidesToScroll; 2881 } 2882 2883 if (_.slideCount <= _.options.slidesToShow) { 2884 _.currentSlide = 0; 2885 } 2886 2887 _.registerBreakpoints(); 2888 2889 _.setProps(); 2890 _.setupInfinite(); 2891 _.buildArrows(); 2892 _.updateArrows(); 2893 _.initArrowEvents(); 2894 _.buildDots(); 2895 _.updateDots(); 2896 _.initDotEvents(); 2897 _.cleanUpSlideEvents(); 2898 _.initSlideEvents(); 2899 2900 _.checkResponsive(false, true); 2901 2902 if (_.options.focusOnSelect === true) { 2903 $(_.$slideTrack).children().on('click.slick', _.selectHandler); 2904 } 2905 2906 _.setSlideClasses(typeof _.currentSlide === 'number' ? _.currentSlide : 0); 2907 2908 _.setPosition(); 2909 _.focusHandler(); 2910 2911 _.paused = !_.options.autoplay; 2912 _.autoPlay(); 2913 2914 _.$slider.trigger('reInit', [_]); 2915 2916 }; 2917 2918 Slick.prototype.resize = function() { 2919 2920 var _ = this; 2921 2922 if ($(window).width() !== _.windowWidth) { 2923 clearTimeout(_.windowDelay); 2924 _.windowDelay = window.setTimeout(function() { 2925 _.windowWidth = $(window).width(); 2926 _.checkResponsive(); 2927 if( !_.unslicked ) { _.setPosition(); } 2928 }, 50); 2929 } 2930 }; 2931 2932 Slick.prototype.removeSlide = Slick.prototype.slickRemove = function(index, removeBefore, removeAll) { 2933 2934 var _ = this; 2935 2936 if (typeof(index) === 'boolean') { 2937 removeBefore = index; 2938 index = removeBefore === true ? 0 : _.slideCount - 1; 2939 } else { 2940 index = removeBefore === true ? --index : index; 2941 } 2942 2943 if (_.slideCount < 1 || index < 0 || index > _.slideCount - 1) { 2944 return false; 2945 } 2946 2947 _.unload(); 2948 2949 if (removeAll === true) { 2950 _.$slideTrack.children().remove(); 2951 } else { 2952 _.$slideTrack.children(this.options.slide).eq(index).remove(); 2953 } 2954 2955 _.$slides = _.$slideTrack.children(this.options.slide); 2956 2957 _.$slideTrack.children(this.options.slide).detach(); 2958 2959 _.$slideTrack.append(_.$slides); 2960 2961 _.$slidesCache = _.$slides; 2962 2963 _.reinit(); 2964 2965 }; 2966 2967 Slick.prototype.setCSS = function(position) { 2968 2969 var _ = this, 2970 positionProps = {}, 2971 x, y; 2972 2973 if (_.options.rtl === true) { 2974 position = -position; 2975 } 2976 x = _.positionProp == 'left' ? Math.ceil(position) + 'px' : '0px'; 2977 y = _.positionProp == 'top' ? Math.ceil(position) + 'px' : '0px'; 2978 2979 positionProps[_.positionProp] = position; 2980 2981 if (_.transformsEnabled === false) { 2982 _.$slideTrack.css(positionProps); 2983 } else { 2984 positionProps = {}; 2985 if (_.cssTransitions === false) { 2986 positionProps[_.animType] = 'translate(' + x + ', ' + y + ')'; 2987 _.$slideTrack.css(positionProps); 2988 } else { 2989 positionProps[_.animType] = 'translate3d(' + x + ', ' + y + ', 0px)'; 2990 _.$slideTrack.css(positionProps); 2991 } 2992 } 2993 2994 }; 2995 2996 Slick.prototype.setDimensions = function() { 2997 2998 var _ = this; 2999 3000 if (_.options.vertical === false) { 3001 if (_.options.centerMode === true) { 3002 _.$list.css({ 3003 padding: ('0px ' + _.options.centerPadding) 3004 }); 3005 } 3006 } else { 3007 _.$list.height(_.$slides.first().outerHeight(true) * _.options.slidesToShow); 3008 if (_.options.centerMode === true) { 3009 _.$list.css({ 3010 padding: (_.options.centerPadding + ' 0px') 3011 }); 3012 } 3013 } 3014 3015 _.listWidth = _.$list.width(); 3016 _.listHeight = _.$list.height(); 3017 3018 3019 if (_.options.vertical === false && _.options.variableWidth === false) { 3020 _.slideWidth = Math.ceil(_.listWidth / _.options.slidesToShow); 3021 _.$slideTrack.width(Math.ceil((_.slideWidth * _.$slideTrack.children('.slick-slide').length))); 3022 3023 } else if (_.options.variableWidth === true) { 3024 _.$slideTrack.width(5000 * _.slideCount); 3025 } else { 3026 _.slideWidth = Math.ceil(_.listWidth); 3027 _.$slideTrack.height(Math.ceil((_.$slides.first().outerHeight(true) * _.$slideTrack.children('.slick-slide').length))); 3028 } 3029 3030 var offset = _.$slides.first().outerWidth(true) - _.$slides.first().width(); 3031 if (_.options.variableWidth === false) _.$slideTrack.children('.slick-slide').width(_.slideWidth - offset); 3032 3033 }; 3034 3035 Slick.prototype.setFade = function() { 3036 3037 var _ = this, 3038 targetLeft; 3039 3040 _.$slides.each(function(index, element) { 3041 targetLeft = (_.slideWidth * index) * -1; 3042 if (_.options.rtl === true) { 3043 $(element).css({ 3044 position: 'relative', 3045 right: targetLeft, 3046 top: 0, 3047 zIndex: _.options.zIndex - 2, 3048 opacity: 0 3049 }); 3050 } else { 3051 $(element).css({ 3052 position: 'relative', 3053 left: targetLeft, 3054 top: 0, 3055 zIndex: _.options.zIndex - 2, 3056 opacity: 0 3057 }); 3058 } 3059 }); 3060 3061 _.$slides.eq(_.currentSlide).css({ 3062 zIndex: _.options.zIndex - 1, 3063 opacity: 1 3064 }); 3065 3066 }; 3067 3068 Slick.prototype.setHeight = function() { 3069 3070 var _ = this; 3071 3072 if (_.options.slidesToShow === 1 && _.options.adaptiveHeight === true && _.options.vertical === false) { 3073 var targetHeight = _.$slides.eq(_.currentSlide).outerHeight(true); 3074 _.$list.css('height', targetHeight); 3075 } 3076 3077 }; 3078 3079 Slick.prototype.setOption = 3080 Slick.prototype.slickSetOption = function() { 3081 3082 /** 3083 * accepts arguments in format of: 3084 * 3085 * - for changing a single option's value: 3086 * .slick("setOption", option, value, refresh ) 3087 * 3088 * - for changing a set of responsive options: 3089 * .slick("setOption", 'responsive', [{}, ...], refresh ) 3090 * 3091 * - for updating multiple values at once (not responsive) 3092 * .slick("setOption", { 'option': value, ... }, refresh ) 3093 */ 3094 3095 var _ = this, l, item, option, value, refresh = false, type; 3096 3097 if( $.type( arguments[0] ) === 'object' ) { 3098 3099 option = arguments[0]; 3100 refresh = arguments[1]; 3101 type = 'multiple'; 3102 3103 } else if ( $.type( arguments[0] ) === 'string' ) { 3104 3105 option = arguments[0]; 3106 value = arguments[1]; 3107 refresh = arguments[2]; 3108 3109 if ( arguments[0] === 'responsive' && $.type( arguments[1] ) === 'array' ) { 3110 3111 type = 'responsive'; 3112 3113 } else if ( typeof arguments[1] !== 'undefined' ) { 3114 3115 type = 'single'; 3116 3117 } 3118 3119 } 3120 3121 if ( type === 'single' ) { 3122 3123 _.options[option] = value; 3124 3125 3126 } else if ( type === 'multiple' ) { 3127 3128 $.each( option , function( opt, val ) { 3129 3130 _.options[opt] = val; 3131 3132 }); 3133 3134 3135 } else if ( type === 'responsive' ) { 3136 3137 for ( item in value ) { 3138 3139 if( $.type( _.options.responsive ) !== 'array' ) { 3140 3141 _.options.responsive = [ value[item] ]; 3142 3143 } else { 3144 3145 l = _.options.responsive.length-1; 3146 3147 // loop through the responsive object and splice out duplicates. 3148 while( l >= 0 ) { 3149 3150 if( _.options.responsive[l].breakpoint === value[item].breakpoint ) { 3151 3152 _.options.responsive.splice(l,1); 3153 3154 } 3155 3156 l--; 3157 3158 } 3159 3160 _.options.responsive.push( value[item] ); 3161 3162 } 3163 3164 } 3165 3166 } 3167 3168 if ( refresh ) { 3169 3170 _.unload(); 3171 _.reinit(); 3172 3173 } 3174 3175 }; 3176 3177 Slick.prototype.setPosition = function() { 3178 3179 var _ = this; 3180 3181 _.setDimensions(); 3182 3183 _.setHeight(); 3184 3185 if (_.options.fade === false) { 3186 _.setCSS(_.getLeft(_.currentSlide)); 3187 } else { 3188 _.setFade(); 3189 } 3190 3191 _.$slider.trigger('setPosition', [_]); 3192 3193 }; 3194 3195 Slick.prototype.setProps = function() { 3196 3197 var _ = this, 3198 bodyStyle = document.body.style; 3199 3200 _.positionProp = _.options.vertical === true ? 'top' : 'left'; 3201 3202 if (_.positionProp === 'top') { 3203 _.$slider.addClass('slick-vertical'); 3204 } else { 3205 _.$slider.removeClass('slick-vertical'); 3206 } 3207 3208 if (bodyStyle.WebkitTransition !== undefined || 3209 bodyStyle.MozTransition !== undefined || 3210 bodyStyle.msTransition !== undefined) { 3211 if (_.options.useCSS === true) { 3212 _.cssTransitions = true; 3213 } 3214 } 3215 3216 if ( _.options.fade ) { 3217 if ( typeof _.options.zIndex === 'number' ) { 3218 if( _.options.zIndex < 3 ) { 3219 _.options.zIndex = 3; 3220 } 3221 } else { 3222 _.options.zIndex = _.defaults.zIndex; 3223 } 3224 } 3225 3226 if (bodyStyle.OTransform !== undefined) { 3227 _.animType = 'OTransform'; 3228 _.transformType = '-o-transform'; 3229 _.transitionType = 'OTransition'; 3230 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false; 3231 } 3232 if (bodyStyle.MozTransform !== undefined) { 3233 _.animType = 'MozTransform'; 3234 _.transformType = '-moz-transform'; 3235 _.transitionType = 'MozTransition'; 3236 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.MozPerspective === undefined) _.animType = false; 3237 } 3238 if (bodyStyle.webkitTransform !== undefined) { 3239 _.animType = 'webkitTransform'; 3240 _.transformType = '-webkit-transform'; 3241 _.transitionType = 'webkitTransition'; 3242 if (bodyStyle.perspectiveProperty === undefined && bodyStyle.webkitPerspective === undefined) _.animType = false; 3243 } 3244 if (bodyStyle.msTransform !== undefined) { 3245 _.animType = 'msTransform'; 3246 _.transformType = '-ms-transform'; 3247 _.transitionType = 'msTransition'; 3248 if (bodyStyle.msTransform === undefined) _.animType = false; 3249 } 3250 if (bodyStyle.transform !== undefined && _.animType !== false) { 3251 _.animType = 'transform'; 3252 _.transformType = 'transform'; 3253 _.transitionType = 'transition'; 3254 } 3255 _.transformsEnabled = _.options.useTransform && (_.animType !== null && _.animType !== false); 3256 }; 3257 3258 3259 Slick.prototype.setSlideClasses = function(index) { 3260 3261 var _ = this, 3262 centerOffset, allSlides, indexOffset, remainder; 3263 3264 allSlides = _.$slider 3265 .find('.slick-slide') 3266 .removeClass('slick-active slick-center slick-current') 3267 .attr('aria-hidden', 'true'); 3268 3269 _.$slides 3270 .eq(index) 3271 .addClass('slick-current'); 3272 3273 if (_.options.centerMode === true) { 3274 3275 var evenCoef = _.options.slidesToShow % 2 === 0 ? 1 : 0; 3276 3277 centerOffset = Math.floor(_.options.slidesToShow / 2); 3278 3279 if (_.options.infinite === true) { 3280 3281 if (index >= centerOffset && index <= (_.slideCount - 1) - centerOffset) { 3282 _.$slides 3283 .slice(index - centerOffset + evenCoef, index + centerOffset + 1) 3284 .addClass('slick-active') 3285 .attr('aria-hidden', 'false'); 3286 3287 } else { 3288 3289 indexOffset = _.options.slidesToShow + index; 3290 allSlides 3291 .slice(indexOffset - centerOffset + 1 + evenCoef, indexOffset + centerOffset + 2) 3292 .addClass('slick-active') 3293 .attr('aria-hidden', 'false'); 3294 3295 } 3296 3297 if (index === 0) { 3298 3299 allSlides 3300 .eq(allSlides.length - 1 - _.options.slidesToShow) 3301 .addClass('slick-center'); 3302 3303 } else if (index === _.slideCount - 1) { 3304 3305 allSlides 3306 .eq(_.options.slidesToShow) 3307 .addClass('slick-center'); 3308 3309 } 3310 3311 } 3312 3313 _.$slides 3314 .eq(index) 3315 .addClass('slick-center'); 3316 3317 } else { 3318 3319 if (index >= 0 && index <= (_.slideCount - _.options.slidesToShow)) { 3320 3321 _.$slides 3322 .slice(index, index + _.options.slidesToShow) 3323 .addClass('slick-active') 3324 .attr('aria-hidden', 'false'); 3325 3326 } else if (allSlides.length <= _.options.slidesToShow) { 3327 3328 allSlides 3329 .addClass('slick-active') 3330 .attr('aria-hidden', 'false'); 3331 3332 } else { 3333 3334 remainder = _.slideCount % _.options.slidesToShow; 3335 indexOffset = _.options.infinite === true ? _.options.slidesToShow + index : index; 3336 3337 if (_.options.slidesToShow == _.options.slidesToScroll && (_.slideCount - index) < _.options.slidesToShow) { 3338 3339 allSlides 3340 .slice(indexOffset - (_.options.slidesToShow - remainder), indexOffset + remainder) 3341 .addClass('slick-active') 3342 .attr('aria-hidden', 'false'); 3343 3344 } else { 3345 3346 allSlides 3347 .slice(indexOffset, indexOffset + _.options.slidesToShow) 3348 .addClass('slick-active') 3349 .attr('aria-hidden', 'false'); 3350 3351 } 3352 3353 } 3354 3355 } 3356 3357 if (_.options.lazyLoad === 'ondemand' || _.options.lazyLoad === 'anticipated') { 3358 _.lazyLoad(); 3359 } 3360 }; 3361 3362 Slick.prototype.setupInfinite = function() { 3363 3364 var _ = this, 3365 i, slideIndex, infiniteCount; 3366 3367 if (_.options.fade === true) { 3368 _.options.centerMode = false; 3369 } 3370 3371 if (_.options.infinite === true && _.options.fade === false) { 3372 3373 slideIndex = null; 3374 3375 if (_.slideCount > _.options.slidesToShow) { 3376 3377 if (_.options.centerMode === true) { 3378 infiniteCount = _.options.slidesToShow + 1; 3379 } else { 3380 infiniteCount = _.options.slidesToShow; 3381 } 3382 3383 for (i = _.slideCount; i > (_.slideCount - 3384 infiniteCount); i -= 1) { 3385 slideIndex = i - 1; 3386 $(_.$slides[slideIndex]).clone(true).attr('id', '') 3387 .attr('data-slick-index', slideIndex - _.slideCount) 3388 .prependTo(_.$slideTrack).addClass('slick-cloned'); 3389 } 3390 for (i = 0; i < infiniteCount + _.slideCount; i += 1) { 3391 slideIndex = i; 3392 $(_.$slides[slideIndex]).clone(true).attr('id', '') 3393 .attr('data-slick-index', slideIndex + _.slideCount) 3394 .appendTo(_.$slideTrack).addClass('slick-cloned'); 3395 } 3396 _.$slideTrack.find('.slick-cloned').find('[id]').each(function() { 3397 $(this).attr('id', ''); 3398 }); 3399 3400 } 3401 3402 } 3403 3404 }; 3405 3406 Slick.prototype.interrupt = function( toggle ) { 3407 3408 var _ = this; 3409 3410 if( !toggle ) { 3411 _.autoPlay(); 3412 } 3413 _.interrupted = toggle; 3414 3415 }; 3416 3417 Slick.prototype.selectHandler = function(event) { 3418 3419 var _ = this; 3420 3421 var targetElement = 3422 $(event.target).is('.slick-slide') ? 3423 $(event.target) : 3424 $(event.target).parents('.slick-slide'); 3425 3426 var index = parseInt(targetElement.attr('data-slick-index')); 3427 3428 if (!index) index = 0; 3429 3430 if (_.slideCount <= _.options.slidesToShow) { 3431 3432 _.slideHandler(index, false, true); 3433 return; 3434 3435 } 3436 3437 _.slideHandler(index); 3438 3439 }; 3440 3441 Slick.prototype.slideHandler = function(index, sync, dontAnimate) { 3442 3443 var targetSlide, animSlide, oldSlide, slideLeft, targetLeft = null, 3444 _ = this, navTarget; 3445 3446 sync = sync || false; 3447 3448 if (_.animating === true && _.options.waitForAnimate === true) { 3449 return; 3450 } 3451 3452 if (_.options.fade === true && _.currentSlide === index) { 3453 return; 3454 } 3455 3456 if (sync === false) { 3457 _.asNavFor(index); 3458 } 3459 3460 targetSlide = index; 3461 targetLeft = _.getLeft(targetSlide); 3462 slideLeft = _.getLeft(_.currentSlide); 3463 3464 _.currentLeft = _.swipeLeft === null ? slideLeft : _.swipeLeft; 3465 3466 if (_.options.infinite === false && _.options.centerMode === false && (index < 0 || index > _.getDotCount() * _.options.slidesToScroll)) { 3467 if (_.options.fade === false) { 3468 targetSlide = _.currentSlide; 3469 if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { 3470 _.animateSlide(slideLeft, function() { 3471 _.postSlide(targetSlide); 3472 }); 3473 } else { 3474 _.postSlide(targetSlide); 3475 } 3476 } 3477 return; 3478 } else if (_.options.infinite === false && _.options.centerMode === true && (index < 0 || index > (_.slideCount - _.options.slidesToScroll))) { 3479 if (_.options.fade === false) { 3480 targetSlide = _.currentSlide; 3481 if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { 3482 _.animateSlide(slideLeft, function() { 3483 _.postSlide(targetSlide); 3484 }); 3485 } else { 3486 _.postSlide(targetSlide); 3487 } 3488 } 3489 return; 3490 } 3491 3492 if ( _.options.autoplay ) { 3493 clearInterval(_.autoPlayTimer); 3494 } 3495 3496 if (targetSlide < 0) { 3497 if (_.slideCount % _.options.slidesToScroll !== 0) { 3498 animSlide = _.slideCount - (_.slideCount % _.options.slidesToScroll); 3499 } else { 3500 animSlide = _.slideCount + targetSlide; 3501 } 3502 } else if (targetSlide >= _.slideCount) { 3503 if (_.slideCount % _.options.slidesToScroll !== 0) { 3504 animSlide = 0; 3505 } else { 3506 animSlide = targetSlide - _.slideCount; 3507 } 3508 } else { 3509 animSlide = targetSlide; 3510 } 3511 3512 _.animating = true; 3513 3514 _.$slider.trigger('beforeChange', [_, _.currentSlide, animSlide]); 3515 3516 oldSlide = _.currentSlide; 3517 _.currentSlide = animSlide; 3518 3519 _.setSlideClasses(_.currentSlide); 3520 3521 if ( _.options.asNavFor ) { 3522 3523 navTarget = _.getNavTarget(); 3524 navTarget = navTarget.slick('getSlick'); 3525 3526 if ( navTarget.slideCount <= navTarget.options.slidesToShow ) { 3527 navTarget.setSlideClasses(_.currentSlide); 3528 } 3529 3530 } 3531 3532 _.updateDots(); 3533 _.updateArrows(); 3534 3535 if (_.options.fade === true) { 3536 if (dontAnimate !== true) { 3537 3538 _.fadeSlideOut(oldSlide); 3539 3540 _.fadeSlide(animSlide, function() { 3541 _.postSlide(animSlide); 3542 }); 3543 3544 } else { 3545 _.postSlide(animSlide); 3546 } 3547 _.animateHeight(); 3548 return; 3549 } 3550 3551 if (dontAnimate !== true && _.slideCount > _.options.slidesToShow) { 3552 _.animateSlide(targetLeft, function() { 3553 _.postSlide(animSlide); 3554 }); 3555 } else { 3556 _.postSlide(animSlide); 3557 } 3558 3559 }; 3560 3561 Slick.prototype.startLoad = function() { 3562 3563 var _ = this; 3564 3565 if (_.options.arrows === true && _.slideCount > _.options.slidesToShow) { 3566 3567 _.$prevArrow.hide(); 3568 _.$nextArrow.hide(); 3569 3570 } 3571 3572 if (_.options.dots === true && _.slideCount > _.options.slidesToShow) { 3573 3574 _.$dots.hide(); 3575 3576 } 3577 3578 _.$slider.addClass('slick-loading'); 3579 3580 }; 3581 3582 Slick.prototype.swipeDirection = function() { 3583 3584 var xDist, yDist, r, swipeAngle, _ = this; 3585 3586 xDist = _.touchObject.startX - _.touchObject.curX; 3587 yDist = _.touchObject.startY - _.touchObject.curY; 3588 r = Math.atan2(yDist, xDist); 3589 3590 swipeAngle = Math.round(r * 180 / Math.PI); 3591 if (swipeAngle < 0) { 3592 swipeAngle = 360 - Math.abs(swipeAngle); 3593 } 3594 3595 if ((swipeAngle <= 45) && (swipeAngle >= 0)) { 3596 return (_.options.rtl === false ? 'left' : 'right'); 3597 } 3598 if ((swipeAngle <= 360) && (swipeAngle >= 315)) { 3599 return (_.options.rtl === false ? 'left' : 'right'); 3600 } 3601 if ((swipeAngle >= 135) && (swipeAngle <= 225)) { 3602 return (_.options.rtl === false ? 'right' : 'left'); 3603 } 3604 if (_.options.verticalSwiping === true) { 3605 if ((swipeAngle >= 35) && (swipeAngle <= 135)) { 3606 return 'down'; 3607 } else { 3608 return 'up'; 3609 } 3610 } 3611 3612 return 'vertical'; 3613 3614 }; 3615 3616 Slick.prototype.swipeEnd = function(event) { 3617 3618 var _ = this, 3619 slideCount, 3620 direction; 3621 3622 _.dragging = false; 3623 _.swiping = false; 3624 3625 if (_.scrolling) { 3626 _.scrolling = false; 3627 return false; 3628 } 3629 3630 _.interrupted = false; 3631 _.shouldClick = ( _.touchObject.swipeLength > 10 ) ? false : true; 3632 3633 if ( _.touchObject.curX === undefined ) { 3634 return false; 3635 } 3636 3637 if ( _.touchObject.edgeHit === true ) { 3638 _.$slider.trigger('edge', [_, _.swipeDirection() ]); 3639 } 3640 3641 if ( _.touchObject.swipeLength >= _.touchObject.minSwipe ) { 3642 3643 direction = _.swipeDirection(); 3644 3645 switch ( direction ) { 3646 3647 case 'left': 3648 case 'down': 3649 3650 slideCount = 3651 _.options.swipeToSlide ? 3652 _.checkNavigable( _.currentSlide + _.getSlideCount() ) : 3653 _.currentSlide + _.getSlideCount(); 3654 3655 _.currentDirection = 0; 3656 3657 break; 3658 3659 case 'right': 3660 case 'up': 3661 3662 slideCount = 3663 _.options.swipeToSlide ? 3664 _.checkNavigable( _.currentSlide - _.getSlideCount() ) : 3665 _.currentSlide - _.getSlideCount(); 3666 3667 _.currentDirection = 1; 3668 3669 break; 3670 3671 default: 3672 3673 3674 } 3675 3676 if( direction != 'vertical' ) { 3677 3678 _.slideHandler( slideCount ); 3679 _.touchObject = {}; 3680 _.$slider.trigger('swipe', [_, direction ]); 3681 3682 } 3683 3684 } else { 3685 3686 if ( _.touchObject.startX !== _.touchObject.curX ) { 3687 3688 _.slideHandler( _.currentSlide ); 3689 _.touchObject = {}; 3690 3691 } 3692 3693 } 3694 3695 }; 3696 3697 Slick.prototype.swipeHandler = function(event) { 3698 3699 var _ = this; 3700 3701 if ((_.options.swipe === false) || ('ontouchend' in document && _.options.swipe === false)) { 3702 return; 3703 } else if (_.options.draggable === false && event.type.indexOf('mouse') !== -1) { 3704 return; 3705 } 3706 3707 _.touchObject.fingerCount = event.originalEvent && event.originalEvent.touches !== undefined ? 3708 event.originalEvent.touches.length : 1; 3709 3710 _.touchObject.minSwipe = _.listWidth / _.options 3711 .touchThreshold; 3712 3713 if (_.options.verticalSwiping === true) { 3714 _.touchObject.minSwipe = _.listHeight / _.options 3715 .touchThreshold; 3716 } 3717 3718 switch (event.data.action) { 3719 3720 case 'start': 3721 _.swipeStart(event); 3722 break; 3723 3724 case 'move': 3725 _.swipeMove(event); 3726 break; 3727 3728 case 'end': 3729 _.swipeEnd(event); 3730 break; 3731 3732 } 3733 3734 }; 3735 3736 Slick.prototype.swipeMove = function(event) { 3737 3738 var _ = this, 3739 edgeWasHit = false, 3740 curLeft, swipeDirection, swipeLength, positionOffset, touches, verticalSwipeLength; 3741 3742 touches = event.originalEvent !== undefined ? event.originalEvent.touches : null; 3743 3744 if (!_.dragging || _.scrolling || touches && touches.length !== 1) { 3745 return false; 3746 } 3747 3748 curLeft = _.getLeft(_.currentSlide); 3749 3750 _.touchObject.curX = touches !== undefined ? touches[0].pageX : event.clientX; 3751 _.touchObject.curY = touches !== undefined ? touches[0].pageY : event.clientY; 3752 3753 _.touchObject.swipeLength = Math.round(Math.sqrt( 3754 Math.pow(_.touchObject.curX - _.touchObject.startX, 2))); 3755 3756 verticalSwipeLength = Math.round(Math.sqrt( 3757 Math.pow(_.touchObject.curY - _.touchObject.startY, 2))); 3758 3759 if (!_.options.verticalSwiping && !_.swiping && verticalSwipeLength > 4) { 3760 _.scrolling = true; 3761 return false; 3762 } 3763 3764 if (_.options.verticalSwiping === true) { 3765 _.touchObject.swipeLength = verticalSwipeLength; 3766 } 3767 3768 swipeDirection = _.swipeDirection(); 3769 3770 if (event.originalEvent !== undefined && _.touchObject.swipeLength > 4) { 3771 _.swiping = true; 3772 event.preventDefault(); 3773 } 3774 3775 positionOffset = (_.options.rtl === false ? 1 : -1) * (_.touchObject.curX > _.touchObject.startX ? 1 : -1); 3776 if (_.options.verticalSwiping === true) { 3777 positionOffset = _.touchObject.curY > _.touchObject.startY ? 1 : -1; 3778 } 3779 3780 3781 swipeLength = _.touchObject.swipeLength; 3782 3783 _.touchObject.edgeHit = false; 3784 3785 if (_.options.infinite === false) { 3786 if ((_.currentSlide === 0 && swipeDirection === 'right') || (_.currentSlide >= _.getDotCount() && swipeDirection === 'left')) { 3787 swipeLength = _.touchObject.swipeLength * _.options.edgeFriction; 3788 _.touchObject.edgeHit = true; 3789 } 3790 } 3791 3792 if (_.options.vertical === false) { 3793 _.swipeLeft = curLeft + swipeLength * positionOffset; 3794 } else { 3795 _.swipeLeft = curLeft + (swipeLength * (_.$list.height() / _.listWidth)) * positionOffset; 3796 } 3797 if (_.options.verticalSwiping === true) { 3798 _.swipeLeft = curLeft + swipeLength * positionOffset; 3799 } 3800 3801 if (_.options.fade === true || _.options.touchMove === false) { 3802 return false; 3803 } 3804 3805 if (_.animating === true) { 3806 _.swipeLeft = null; 3807 return false; 3808 } 3809 3810 _.setCSS(_.swipeLeft); 3811 3812 }; 3813 3814 Slick.prototype.swipeStart = function(event) { 3815 3816 var _ = this, 3817 touches; 3818 3819 _.interrupted = true; 3820 3821 if (_.touchObject.fingerCount !== 1 || _.slideCount <= _.options.slidesToShow) { 3822 _.touchObject = {}; 3823 return false; 3824 } 3825 3826 if (event.originalEvent !== undefined && event.originalEvent.touches !== undefined) { 3827 touches = event.originalEvent.touches[0]; 3828 } 3829 3830 _.touchObject.startX = _.touchObject.curX = touches !== undefined ? touches.pageX : event.clientX; 3831 _.touchObject.startY = _.touchObject.curY = touches !== undefined ? touches.pageY : event.clientY; 3832 3833 _.dragging = true; 3834 3835 }; 3836 3837 Slick.prototype.unfilterSlides = Slick.prototype.slickUnfilter = function() { 3838 3839 var _ = this; 3840 3841 if (_.$slidesCache !== null) { 3842 3843 _.unload(); 3844 3845 _.$slideTrack.children(this.options.slide).detach(); 3846 3847 _.$slidesCache.appendTo(_.$slideTrack); 3848 3849 _.reinit(); 3850 3851 } 3852 3853 }; 3854 3855 Slick.prototype.unload = function() { 3856 3857 var _ = this; 3858 3859 $('.slick-cloned', _.$slider).remove(); 3860 3861 if (_.$dots) { 3862 _.$dots.remove(); 3863 } 3864 3865 if (_.$prevArrow && _.htmlExpr.test(_.options.prevArrow)) { 3866 _.$prevArrow.remove(); 3867 } 3868 3869 if (_.$nextArrow && _.htmlExpr.test(_.options.nextArrow)) { 3870 _.$nextArrow.remove(); 3871 } 3872 3873 _.$slides 3874 .removeClass('slick-slide slick-active slick-visible slick-current') 3875 .attr('aria-hidden', 'true') 3876 .css('width', ''); 3877 3878 }; 3879 3880 Slick.prototype.unslick = function(fromBreakpoint) { 3881 3882 var _ = this; 3883 _.$slider.trigger('unslick', [_, fromBreakpoint]); 3884 _.destroy(); 3885 3886 }; 3887 3888 Slick.prototype.updateArrows = function() { 3889 3890 var _ = this, 3891 centerOffset; 3892 3893 centerOffset = Math.floor(_.options.slidesToShow / 2); 3894 3895 if ( _.options.arrows === true && 3896 _.slideCount > _.options.slidesToShow && 3897 !_.options.infinite ) { 3898 3899 _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 3900 _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 3901 3902 if (_.currentSlide === 0) { 3903 3904 _.$prevArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); 3905 _.$nextArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 3906 3907 } else if (_.currentSlide >= _.slideCount - _.options.slidesToShow && _.options.centerMode === false) { 3908 3909 _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); 3910 _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 3911 3912 } else if (_.currentSlide >= _.slideCount - 1 && _.options.centerMode === true) { 3913 3914 _.$nextArrow.addClass('slick-disabled').attr('aria-disabled', 'true'); 3915 _.$prevArrow.removeClass('slick-disabled').attr('aria-disabled', 'false'); 3916 3917 } 3918 3919 } 3920 3921 }; 3922 3923 Slick.prototype.updateDots = function() { 3924 3925 var _ = this; 3926 3927 if (_.$dots !== null) { 3928 3929 _.$dots 3930 .find('li') 3931 .removeClass('slick-active') 3932 .end(); 3933 3934 _.$dots 3935 .find('li') 3936 .eq(Math.floor(_.currentSlide / _.options.slidesToScroll)) 3937 .addClass('slick-active'); 3938 3939 } 3940 3941 }; 3942 3943 Slick.prototype.visibility = function() { 3944 3945 var _ = this; 3946 3947 if ( _.options.autoplay ) { 3948 3949 if ( document[_.hidden] ) { 3950 3951 _.interrupted = true; 3952 3953 } else { 3954 3955 _.interrupted = false; 3956 3957 } 3958 3959 } 3960 3961 }; 3962 3963 $.fn.slick = function() { 3964 var _ = this, 3965 opt = arguments[0], 3966 args = Array.prototype.slice.call(arguments, 1), 3967 l = _.length, 3968 i, 3969 ret; 3970 for (i = 0; i < l; i++) { 3971 if (typeof opt == 'object' || typeof opt == 'undefined') 3972 _[i].slick = new Slick(_[i], opt); 3973 else 3974 ret = _[i].slick[opt].apply(_[i].slick, args); 3975 if (typeof ret != 'undefined') return ret; 3976 } 3977 return _; 3978 }; 3979 3980})); 3981
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.