1'use strict'; 2;(function ($, window, document, undefined){ 3var drag, state, e; 4drag={ 5start: 0, 6startX: 0, 7startY: 0, 8current: 0, 9currentX: 0, 10currentY: 0, 11offsetX: 0, 12offsetY: 0, 13distance: null, 14startTime: 0, 15endTime: 0, 16updatedX: 0, 17targetEl: null 18}; 19state={ 20isTouch: false, 21isScrolling: false, 22isSwiping: false, 23direction: false, 24inMotion: false 25}; 26e={ 27_onDragStart: null, 28_onDragMove: null, 29_onDragEnd: null, 30_transitionEnd: null, 31_resizer: null, 32_responsiveCall: null, 33_goToLoop: null, 34_checkVisibile: null 35}; 36function Owl(element, options){ 37this.settings=null; 38this.options=$.extend({}, Owl.Defaults, options); 39this.$element=$(element); 40this.drag=$.extend({}, drag); 41this.state=$.extend({}, state); 42this.e=$.extend({}, e); 43this._plugins={}; 44this._supress={}; 45this._current=null; 46this._speed=null; 47this._coordinates=[]; 48this._breakpoint=null; 49this._width=null; 50this._items=[]; 51this._clones=[]; 52this._mergers=[]; 53this._invalidated={}; 54this._pipe=[]; 55$.each(Owl.Plugins, $.proxy(function (key, plugin){ 56this._plugins[key[0].toLowerCase() + key.slice(1)]=new plugin(this); 57}, this)); 58$.each(Owl.Pipe, $.proxy(function (priority, worker){ 59this._pipe.push({ 60'filter': worker.filter, 61'run': $.proxy(worker.run, this) 62}); 63}, this)); 64this.setup(); 65this.initialize(); 66} 67Owl.Defaults={ 68items: 3, 69loop: false, 70center: false, 71mouseDrag: true, 72touchDrag: true, 73pullDrag: true, 74freeDrag: false, 75margin: 0, 76stagePadding: 0, 77merge: false, 78mergeFit: true, 79autoWidth: false, 80startPosition: 0, 81rtl: false, 82smartSpeed: 250, 83fluidSpeed: false, 84dragEndSpeed: false, 85responsive: {}, 86responsiveRefreshRate: 200, 87responsiveBaseElement: window, 88responsiveClass: false, 89fallbackEasing: 'swing', 90info: false, 91nestedItemSelector: false, 92itemElement: 'div', 93stageElement: 'div', 94themeClass: 'stm_owl-theme', 95baseClass: 'owl-carousel',
96itemClass: 'owl-item', 97centerClass: 'center', 98activeClass: 'active' 99}; 100Owl.Width={ 101Default: 'default', 102Inner: 'inner', 103Outer: 'outer' 104}; 105Owl.Plugins={}; 106Owl.Pipe=[{ 107filter: ['width', 'items', 'settings'], 108run: function run(cache){ 109cache.current=this._items&&this._items[this.relative(this._current)]; 110}}, { 111filter: ['items', 'settings'], 112run: function run(){ 113var cached=this._clones, 114clones=this.$stage.children('.cloned'); 115if(clones.length!==cached.length||!this.settings.loop&&cached.length > 0){ 116this.$stage.children('.cloned').remove(); 117this._clones=[]; 118}} 119}, { 120filter: ['items', 'settings'], 121run: function run(){ 122var i, 123n, 124clones=this._clones, 125items=this._items, 126delta=this.settings.loop ? clones.length - Math.max(this.settings.items * 2, 4):0; 127for (i=0, n=Math.abs(delta / 2); i < n; i++){ 128if(delta > 0){ 129this.$stage.children().eq(items.length + clones.length - 1).remove(); 130clones.pop(); 131this.$stage.children().eq(0).remove(); 132clones.pop(); 133}else{ 134clones.push(clones.length / 2); 135this.$stage.append(items[clones[clones.length - 1]].clone().addClass('cloned')); 136clones.push(items.length - 1 - (clones.length - 1) / 2); 137this.$stage.prepend(items[clones[clones.length - 1]].clone().addClass('cloned')); 138}} 139}}, { 140filter: ['width', 'items', 'settings'], 141run: function run(){ 142var rtl=this.settings.rtl ? 1:-1, 143width=(this.width() / this.settings.items).toFixed(3), 144coordinate=0, 145merge, 146i, 147n; 148this._coordinates=[]; 149for (i=0, n=this._clones.length + this._items.length; i < n; i++){ 150merge=this._mergers[this.relative(i)]; 151merge=this.settings.mergeFit&&Math.min(merge, this.settings.items)||merge; 152coordinate +=(this.settings.autoWidth ? this._items[this.relative(i)].width() + this.settings.margin:width * merge) * rtl; 153this._coordinates.push(coordinate); 154}} 155}, { 156filter: ['width', 'items', 'settings'], 157run: function run(){ 158var i, 159n, 160width=(this.width() / this.settings.items).toFixed(3), 161css={ 162'width': Math.abs(this._coordinates[this._coordinates.length - 1]) + this.settings.stagePadding * 2, 163'padding-left': this.settings.stagePadding||'', 164'padding-right': this.settings.stagePadding||'' 165}; 166this.$stage.css(css); 167css={ 'width': this.settings.autoWidth ? 'auto':width - this.settings.margin }; 168css[this.settings.rtl ? 'margin-left':'margin-right']=this.settings.margin; 169if(!this.settings.autoWidth&&$.grep(this._mergers, function (v){ 170return v > 1; 171}).length > 0){ 172for (i=0, n=this._coordinates.length; i < n; i++){ 173css.width=Math.abs(this._coordinates[i]) - Math.abs(this._coordinates[i - 1]||0) - this.settings.margin; 174this.$stage.children().eq(i).css(css); 175}}else{ 176this.$stage.children().css(css); 177}} 178}, { 179filter: ['width', 'items', 'settings'], 180run: function run(cache){ 181cache.current&&this.reset(this.$stage.children().index(cache.current)); 182}}, { 183filter: ['position'], 184run: function run(){ 185this.animate(this.coordinates(this._current)); 186}}, { 187filter: ['width', 'position', 'items', 'settings'], 188run: function run(){ 189var rtl=this.settings.rtl ? 1:-1, 190padding=this.settings.stagePadding * 2, 191begin=this.coordinates(this.current()) + padding, 192end=begin + this.width() * rtl, 193inner, 194outer, 195matches=[], 196i, 197n; 198for (i=0, n=this._coordinates.length; i < n; i++){ 199inner=this._coordinates[i - 1]||0; 200outer=Math.abs(this._coordinates[i]) + padding * rtl; 201if(this.op(inner, '<=', begin)&&this.op(inner, '>', end)||this.op(outer, '<', begin)&&this.op(outer, '>', end)){ 202matches.push(i); 203}} 204this.$stage.children('.' + this.settings.activeClass).removeClass(this.settings.activeClass); 205this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass(this.settings.activeClass); 206if(this.settings.center){ 207this.$stage.children('.' + this.settings.centerClass).removeClass(this.settings.centerClass); 208this.$stage.children().eq(this.current()).addClass(this.settings.centerClass); 209}} 210}]; 211Owl.prototype.initialize=function (){ 212this.trigger('initialize'); 213this.$element.addClass(this.settings.baseClass).addClass(this.settings.themeClass).toggleClass('owl-rtl', this.settings.rtl); 214this.browserSupport(); 215if(this.settings.autoWidth&&this.state.imagesLoaded!==true){ 216var imgs, nestedSelector, width; 217imgs=this.$element.find('img'); 218nestedSelector=this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector:undefined; 219width=this.$element.children(nestedSelector).width(); 220if(imgs.length&&width <=0){ 221this.preloadAutoWidthImages(imgs); 222return false;
223}} 224this.$element.addClass('owl-loading'); 225this.$stage=$('<' + this.settings.stageElement + ' class="owl-stage"/>').wrap('<div class="owl-stage-outer">'); 226this.$element.append(this.$stage.parent()); 227this.replace(this.$element.children().not(this.$stage.parent())); 228this._width=this.$element.width(); 229this.refresh(); 230this.$element.removeClass('owl-loading').addClass('owl-loaded'); 231this.eventsCall(); 232this.internalEvents(); 233this.addTriggerableEvents(); 234this.trigger('initialized'); 235}; 236Owl.prototype.setup=function (){ 237var viewport=this.viewport(), 238overwrites=this.options.responsive, 239match=-1, 240settings=null; 241if(!overwrites){ 242settings=$.extend({}, this.options); 243}else{ 244$.each(overwrites, function (breakpoint){ 245if(breakpoint <=viewport&&breakpoint > match){ 246match=Number(breakpoint); 247}}); 248settings=$.extend({}, this.options, overwrites[match]); 249delete settings.responsive; 250if(settings.responsiveClass){ 251this.$element.attr('class', function (i, c){ 252return c.replace(/\b owl-responsive-\S+/g, ''); 253}).addClass('owl-responsive-' + match); 254}} 255if(this.settings===null||this._breakpoint!==match){ 256this.trigger('change', { property: { name: 'settings', value: settings }}); 257this._breakpoint=match; 258this.settings=settings; 259this.invalidate('settings'); 260this.trigger('changed', { property: { name: 'settings', value: this.settings }}); 261}}; 262Owl.prototype.optionsLogic=function (){ 263this.$element.toggleClass('owl-center', this.settings.center); 264if(this.settings.loop&&this._items.length < this.settings.items){ 265this.settings.loop=false; 266} 267if(this.settings.autoWidth){ 268this.settings.stagePadding=false; 269this.settings.merge=false; 270}}; 271Owl.prototype.prepare=function (item){ 272var event=this.trigger('prepare', { content: item }); 273if(!event.data){ 274event.data=$('<' + this.settings.itemElement + '/>').addClass(this.settings.itemClass).append(item); 275} 276this.trigger('prepared', { content: event.data }); 277return event.data; 278}; 279Owl.prototype.update=function (){ 280var i=0, 281n=this._pipe.length, 282filter=$.proxy(function (p){ 283return this[p]; 284}, this._invalidated), 285cache={}; 286while (i < n){ 287if(this._invalidated.all||$.grep(this._pipe[i].filter, filter).length > 0){ 288this._pipe[i].run(cache); 289} 290i++; 291} 292this._invalidated={};}; 293Owl.prototype.width=function (dimension){ 294dimension=dimension||Owl.Width.Default; 295switch (dimension){ 296case Owl.Width.Inner: 297case Owl.Width.Outer: 298return this._width; 299default: 300return this._width - this.settings.stagePadding * 2 + this.settings.margin; 301}}; 302Owl.prototype.refresh=function (){ 303if(this._items.length===0){ 304return false; 305} 306var start=new Date().getTime(); 307this.trigger('refresh'); 308this.setup(); 309this.optionsLogic(); 310this.$stage.addClass('owl-refresh'); 311this.update(); 312this.$stage.removeClass('owl-refresh'); 313this.state.orientation=window.orientation; 314this.watchVisibility(); 315this.trigger('refreshed'); 316}; 317Owl.prototype.eventsCall=function (){ 318this.e._onDragStart=$.proxy(function (e){ 319this.onDragStart(e); 320}, this); 321this.e._onDragMove=$.proxy(function (e){ 322this.onDragMove(e); 323}, this); 324this.e._onDragEnd=$.proxy(function (e){ 325this.onDragEnd(e); 326}, this); 327this.e._onResize=$.proxy(function (e){ 328this.onResize(e); 329}, this); 330this.e._transitionEnd=$.proxy(function (e){ 331this.transitionEnd(e); 332}, this); 333this.e._preventClick=$.proxy(function (e){ 334this.preventClick(e); 335}, this); 336}; 337Owl.prototype.onThrottledResize=function (){ 338window.clearTimeout(this.resizeTimer); 339this.resizeTimer=window.setTimeout(this.e._onResize, this.settings.responsiveRefreshRate); 340}; 341Owl.prototype.onResize=function (){ 342if(!this._items.length){ 343return false; 344} 345if(this._width===this.$element.width()){ 346return false; 347} 348if(this.trigger('resize').isDefaultPrevented()){ 349return false; 350} 351this._width=this.$element.width(); 352this.invalidate('width'); 353this.refresh(); 354this.trigger('resized'); 355}; 356Owl.prototype.eventsRouter=function (event){ 357var type=event.type; 358if(type==="mousedown"||type==="touchstart"){ 359this.onDragStart(event); 360}else if(type==="mousemove"||type==="touchmove"){ 361this.onDragMove(event); 362}else if(type==="mouseup"||type==="touchend"){ 363this.onDragEnd(event); 364}else if(type==="touchcancel"){ 365this.onDragEnd(event); 366}}; 367Owl.prototype.internalEvents=function (){ 368var isTouch=isTouchSupport(), 369isTouchIE=isTouchSupportIE(); 370if(this.settings.mouseDrag){ 371this.$stage.on('mousedown', $.proxy(function (event){ 372this.eventsRouter(event); 373}, this)); 374this.$stage.on('dragstart', function (){ 375return false;
376}); 377this.$stage.get(0).onselectstart=function (){ 378return false; 379};}else{ 380this.$element.addClass('owl-text-select-on'); 381} 382if(this.settings.touchDrag&&!isTouchIE){ 383this.$stage.on('touchstart touchcancel', $.proxy(function (event){ 384this.eventsRouter(event); 385}, this)); 386} 387if(this.transitionEndVendor){ 388this.on(this.$stage.get(0), this.transitionEndVendor, this.e._transitionEnd, false); 389} 390if(this.settings.responsive!==false){ 391this.on(window, 'resize', $.proxy(this.onThrottledResize, this)); 392}}; 393Owl.prototype.onDragStart=function (event){ 394var ev, isTouchEvent, pageX, pageY, animatedPos; 395ev=event.originalEvent||event||window.event; 396if(ev.which===3||this.state.isTouch){ 397return false; 398} 399if(ev.type==='mousedown'){ 400this.$stage.addClass('owl-grab'); 401} 402this.trigger('drag'); 403this.drag.startTime=new Date().getTime(); 404this.speed(0); 405this.state.isTouch=true; 406this.state.isScrolling=false; 407this.state.isSwiping=false; 408this.drag.distance=0; 409pageX=getTouches(ev).x; 410pageY=getTouches(ev).y; 411this.drag.offsetX=this.$stage.position().left; 412this.drag.offsetY=this.$stage.position().top; 413if(this.settings.rtl){ 414this.drag.offsetX=this.$stage.position().left + this.$stage.width() - this.width() + this.settings.margin; 415} 416if(this.state.inMotion&&this.support3d){ 417animatedPos=this.getTransformProperty(); 418this.drag.offsetX=animatedPos; 419this.animate(animatedPos); 420this.state.inMotion=true; 421}else if(this.state.inMotion&&!this.support3d){ 422this.state.inMotion=false; 423return false; 424} 425this.drag.startX=pageX - this.drag.offsetX; 426this.drag.startY=pageY - this.drag.offsetY; 427this.drag.start=pageX - this.drag.startX; 428this.drag.targetEl=ev.target||ev.srcElement; 429this.drag.updatedX=this.drag.start; 430if(this.drag.targetEl.tagName==="IMG"||this.drag.targetEl.tagName==="A"){ 431this.drag.targetEl.draggable=false; 432} 433$(document).on('mousemove.owl.dragEvents mouseup.owl.dragEvents touchmove.owl.dragEvents touchend.owl.dragEvents', $.proxy(function (event){ 434this.eventsRouter(event); 435}, this)); 436}; 437Owl.prototype.onDragMove=function (event){ 438var ev, isTouchEvent, pageX, pageY, minValue, maxValue, pull; 439if(!this.state.isTouch){ 440return; 441} 442if(this.state.isScrolling){ 443return; 444} 445ev=event.originalEvent||event||window.event; 446pageX=getTouches(ev).x; 447pageY=getTouches(ev).y; 448this.drag.currentX=pageX - this.drag.startX; 449this.drag.currentY=pageY - this.drag.startY; 450this.drag.distance=this.drag.currentX - this.drag.offsetX; 451if(this.drag.distance < 0){ 452this.state.direction=this.settings.rtl ? 'right':'left'; 453}else if(this.drag.distance > 0){ 454this.state.direction=this.settings.rtl ? 'left':'right'; 455} 456if(this.settings.loop){ 457if(this.op(this.drag.currentX, '>', this.coordinates(this.minimum()))&&this.state.direction==='right'){ 458this.drag.currentX -=(this.settings.center&&this.coordinates(0)) - this.coordinates(this._items.length); 459}else if(this.op(this.drag.currentX, '<', this.coordinates(this.maximum()))&&this.state.direction==='left'){ 460this.drag.currentX +=(this.settings.center&&this.coordinates(0)) - this.coordinates(this._items.length); 461}}else{ 462minValue=this.settings.rtl ? this.coordinates(this.maximum()):this.coordinates(this.minimum()); 463maxValue=this.settings.rtl ? this.coordinates(this.minimum()):this.coordinates(this.maximum()); 464pull=this.settings.pullDrag ? this.drag.distance / 5:0; 465this.drag.currentX=Math.max(Math.min(this.drag.currentX, minValue + pull), maxValue + pull); 466} 467if(this.drag.distance > 8||this.drag.distance < -8){ 468if(ev.preventDefault!==undefined){ 469ev.preventDefault(); 470}else{ 471ev.returnValue=false; 472} 473this.state.isSwiping=true; 474} 475this.drag.updatedX=this.drag.currentX; 476if((this.drag.currentY > 16||this.drag.currentY < -16)&&this.state.isSwiping===false){ 477this.state.isScrolling=true; 478this.drag.updatedX=this.drag.start; 479} 480this.animate(this.drag.updatedX); 481}; 482Owl.prototype.onDragEnd=function (event){ 483var compareTimes, distanceAbs, closest; 484if(!this.state.isTouch){ 485return; 486} 487if(event.type==='mouseup'){ 488this.$stage.removeClass('owl-grab'); 489} 490this.trigger('dragged'); 491this.drag.targetEl.removeAttribute("draggable"); 492this.state.isTouch=false; 493this.state.isScrolling=false; 494this.state.isSwiping=false; 495if(this.drag.distance===0&&this.state.inMotion!==true){ 496this.state.inMotion=false; 497return false;
498} 499this.drag.endTime=new Date().getTime(); 500compareTimes=this.drag.endTime - this.drag.startTime; 501distanceAbs=Math.abs(this.drag.distance); 502if(distanceAbs > 3||compareTimes > 300){ 503this.removeClick(this.drag.targetEl); 504} 505closest=this.closest(this.drag.updatedX); 506this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed); 507this.current(closest); 508this.invalidate('position'); 509this.update(); 510if(!this.settings.pullDrag&&this.drag.updatedX===this.coordinates(closest)){ 511this.transitionEnd(); 512} 513this.drag.distance=0; 514$(document).off('.owl.dragEvents'); 515}; 516Owl.prototype.removeClick=function (target){ 517this.drag.targetEl=target; 518$(target).on('click.preventClick', this.e._preventClick); 519window.setTimeout(function (){ 520$(target).off('click.preventClick'); 521}, 300); 522}; 523Owl.prototype.preventClick=function (ev){ 524if(ev.preventDefault){ 525ev.preventDefault(); 526}else{ 527ev.returnValue=false; 528} 529if(ev.stopPropagation){ 530ev.stopPropagation(); 531} 532$(ev.target).off('click.preventClick'); 533}; 534Owl.prototype.getTransformProperty=function (){ 535var transform, matrix3d; 536transform=window.getComputedStyle(this.$stage.get(0), null).getPropertyValue(this.vendorName + 'transform'); 537transform=transform.replace(/matrix(3d)?\(|\)/g, '').split(','); 538matrix3d=transform.length===16; 539return matrix3d!==true ? transform[4]:transform[12]; 540}; 541Owl.prototype.closest=function (coordinate){ 542var position=-1, 543pull=30, 544width=this.width(), 545coordinates=this.coordinates(); 546if(!this.settings.freeDrag){ 547$.each(coordinates, $.proxy(function (index, value){ 548if(coordinate > value - pull&&coordinate < value + pull){ 549position=index; 550}else if(this.op(coordinate, '<', value)&&this.op(coordinate, '>', coordinates[index + 1]||value - width)){ 551position=this.state.direction==='left' ? index + 1:index; 552} 553return position===-1; 554}, this)); 555} 556if(!this.settings.loop){ 557if(this.op(coordinate, '>', coordinates[this.minimum()])){ 558position=coordinate=this.minimum(); 559}else if(this.op(coordinate, '<', coordinates[this.maximum()])){ 560position=coordinate=this.maximum(); 561}} 562return position; 563}; 564Owl.prototype.animate=function (coordinate){ 565coordinate=parseInt(coordinate); 566this.trigger('translate'); 567this.state.inMotion=this.speed() > 0; 568if(this.support3d){ 569this.$stage.css({ 570transform: 'translate3d(' + coordinate + 'px' + ',0px, 0px)', 571transition: this.speed() / 1000 + 's' 572}); 573}else if(this.state.isTouch){ 574this.$stage.css({ 575left: coordinate + 'px' 576}); 577}else{ 578this.$stage.animate({ 579left: coordinate 580}, this.speed() / 1000, this.settings.fallbackEasing, $.proxy(function (){ 581if(this.state.inMotion){ 582this.transitionEnd(); 583}}, this)); 584}}; 585Owl.prototype.current=function (position){ 586if(position===undefined){ 587return this._current; 588} 589if(this._items.length===0){ 590return undefined; 591} 592position=this.normalize(position); 593if(this._current!==position){ 594var event=this.trigger('change', { property: { name: 'position', value: position }}); 595if(event.data!==undefined){ 596position=this.normalize(event.data); 597} 598this._current=position; 599this.invalidate('position'); 600this.trigger('changed', { property: { name: 'position', value: this._current }}); 601} 602return this._current; 603}; 604Owl.prototype.invalidate=function (part){ 605this._invalidated[part]=true; 606}; 607Owl.prototype.reset=function (position){ 608position=this.normalize(position); 609if(position===undefined){ 610return; 611} 612this._speed=0; 613this._current=position; 614this.suppress(['translate', 'translated']); 615this.animate(this.coordinates(position)); 616this.release(['translate', 'translated']); 617}; 618Owl.prototype.normalize=function (position, relative){ 619var n=relative ? this._items.length:this._items.length + this._clones.length; 620if(!$.isNumeric(position)||n < 1){ 621return undefined; 622} 623if(this._clones.length){ 624position=(position % n + n) % n; 625}else{ 626position=Math.max(this.minimum(relative), Math.min(this.maximum(relative), position)); 627} 628return position; 629}; 630Owl.prototype.relative=function (position){ 631position=this.normalize(position); 632position=position - this._clones.length / 2; 633return this.normalize(position, true); 634}; 635Owl.prototype.maximum=function (relative){ 636var maximum, 637width, 638i=0, 639coordinate, 640settings=this.settings; 641if(relative){ 642return this._items.length - 1; 643} 644if(!settings.loop&&settings.center){ 645maximum=this._items.length - 1; 646}else if(!settings.loop&&!settings.center){ 647maximum=this._items.length - settings.items; 648}else if(settings.loop||settings.center){ 649maximum=this._items.length + settings.items; 650}else if(settings.autoWidth||settings.merge){ 651revert=settings.rtl ? 1:-1; 652width=this.$stage.width() - this.$element.width(); 653while (coordinate=this.coordinates(i)){ 654if(coordinate * revert >=width){ 655break; 656} 657maximum=++i; 658}}else{ 659throw 'Can not detect maximum absolute position.'; 660} 661return maximum; 662}; 663Owl.prototype.minimum=function (relative){ 664if(relative){ 665return 0; 666} 667return this._clones.length / 2; 668}; 669Owl.prototype.items=function (position){ 670if(position===undefined){ 671return this._items.slice(); 672} 673position=this.normalize(position, true); 674return this._items[position]; 675}; 676Owl.prototype.mergers=function (position){ 677if(position===undefined){ 678return this._mergers.slice(); 679} 680position=this.normalize(position, true); 681return this._mergers[position]; 682}; 683Owl.prototype.clones=function (position){ 684var odd=this._clones.length / 2, 685even=odd + this._items.length, 686map=function map(index){ 687return index % 2===0 ? even + index / 2:odd - (index + 1) / 2; 688}; 689if(position===undefined){ 690return $.map(this._clones, function (v, i){ 691return map(i); 692}); 693} 694return $.map(this._clones, function (v, i){ 695return v===position ? map(i):null; 696}); 697}; 698Owl.prototype.speed=function (speed){
699if(speed!==undefined){ 700this._speed=speed; 701} 702return this._speed; 703}; 704Owl.prototype.coordinates=function (position){ 705var coordinate=null; 706if(position===undefined){ 707return $.map(this._coordinates, $.proxy(function (coordinate, index){ 708return this.coordinates(index); 709}, this)); 710} 711if(this.settings.center){ 712coordinate=this._coordinates[position]; 713coordinate +=(this.width() - coordinate + (this._coordinates[position - 1]||0)) / 2 * (this.settings.rtl ? -1:1); 714}else{ 715coordinate=this._coordinates[position - 1]||0; 716} 717return coordinate; 718}; 719Owl.prototype.duration=function (from, to, factor){ 720return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs(factor||this.settings.smartSpeed); 721}; 722Owl.prototype.to=function (position, speed){ 723if(this.settings.loop){ 724var distance=position - this.relative(this.current()), 725revert=this.current(), 726before=this.current(), 727after=this.current() + distance, 728direction=before - after < 0 ? true:false, 729items=this._clones.length + this._items.length; 730if(after < this.settings.items&&direction===false){ 731revert=before + this._items.length; 732this.reset(revert); 733}else if(after >=items - this.settings.items&&direction===true){ 734revert=before - this._items.length; 735this.reset(revert); 736} 737window.clearTimeout(this.e._goToLoop); 738this.e._goToLoop=window.setTimeout($.proxy(function (){ 739this.speed(this.duration(this.current(), revert + distance, speed)); 740this.current(revert + distance); 741this.update(); 742}, this), 30); 743}else{ 744this.speed(this.duration(this.current(), position, speed)); 745this.current(position); 746this.update(); 747}}; 748Owl.prototype.next=function (speed){ 749speed=speed||false; 750this.to(this.relative(this.current()) + 1, speed); 751}; 752Owl.prototype.prev=function (speed){ 753speed=speed||false; 754this.to(this.relative(this.current()) - 1, speed); 755}; 756Owl.prototype.transitionEnd=function (event){ 757if(event!==undefined){ 758event.stopPropagation(); 759if((event.target||event.srcElement||event.originalTarget)!==this.$stage.get(0)){ 760return false; 761}} 762this.state.inMotion=false; 763this.trigger('translated'); 764}; 765Owl.prototype.viewport=function (){ 766var width; 767if(this.options.responsiveBaseElement!==window){ 768width=$(this.options.responsiveBaseElement).width(); 769}else if(window.innerWidth){ 770width=window.innerWidth; 771}else if(document.documentElement&&document.documentElement.clientWidth){ 772width=document.documentElement.clientWidth; 773}else{ 774throw 'Can not detect viewport width.'; 775} 776return width; 777}; 778Owl.prototype.replace=function (content){ 779this.$stage.empty(); 780this._items=[]; 781if(content){ 782content=content instanceof jQuery ? content:$(content); 783} 784if(this.settings.nestedItemSelector){ 785content=content.find('.' + this.settings.nestedItemSelector); 786} 787content.filter(function (){ 788return this.nodeType===1; 789}).each($.proxy(function (index, item){ 790item=this.prepare(item); 791this.$stage.append(item); 792this._items.push(item); 793this._mergers.push(item.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1||1); 794}, this)); 795this.reset($.isNumeric(this.settings.startPosition) ? this.settings.startPosition:0); 796this.invalidate('items'); 797}; 798Owl.prototype.add=function (content, position){ 799content=this.prepare(content); 800position=position===undefined ? this._items.length:this.normalize(position, true); 801this.trigger('add', { content: content, position: position }); 802if(this._items.length===0||position===this._items.length){ 803this.$stage.append(content); 804this._items.push(content); 805this._mergers.push(content.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1||1); 806}else{ 807this._items[position].before(content); 808this._items.splice(position, 0, content); 809this._mergers.splice(position, 0, content.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1||1); 810} 811this.invalidate('items'); 812this.trigger('added', { content: content, position: position }); 813}; 814Owl.prototype.remove=function (position){ 815position=this.normalize(position, true); 816if(position===undefined){ 817return; 818} 819this.trigger('remove', { content: this._items[position], position: position }); 820this._items[position].remove(); 821this._items.splice(position, 1); 822this._mergers.splice(position, 1); 823this.invalidate('items'); 824this.trigger('removed', { content: null, position: position }); 825}; 826Owl.prototype.addTriggerableEvents=function (){ 827var handler=$.proxy(function (callback, event){ 828return $.proxy(function (e){ 829if(e.relatedTarget!==this){ 830this.suppress([event]); 831callback.apply(this, [].slice.call(arguments, 1)); 832this.release([event]); 833}}, this); 834}, this); 835$.each({ 836'next': this.next, 837'prev': this.prev, 838'to': this.to, 839'destroy': this.destroy, 840'refresh': this.refresh, 841'replace': this.replace, 842'add': this.add, 843'remove': this.remove 844}, $.proxy(function (event, callback){ 845this.$element.on(event + '.owl.carousel', handler(callback, event + '.owl.carousel')); 846}, this)); 847}; 848Owl.prototype.watchVisibility=function (){ 849if(!isElVisible(this.$element.get(0))){ 850this.$element.addClass('owl-hidden'); 851window.clearInterval(this.e._checkVisibile); 852this.e._checkVisibile=window.setInterval($.proxy(checkVisible, this), 500); 853} 854function isElVisible(el){ 855return el.offsetWidth > 0&&el.offsetHeight > 0; 856} 857function checkVisible(){ 858if(isElVisible(this.$element.get(0))){ 859this.$element.removeClass('owl-hidden'); 860this.refresh(); 861window.clearInterval(this.e._checkVisibile); 862}} 863}; 864Owl.prototype.preloadAutoWidthImages=function (imgs){ 865var loaded, that, $el, img; 866loaded=0; 867that=this; 868imgs.each(function (i, el){ 869$el=$(el); 870img=new Image(); 871img.onload=function (){ 872loaded++; 873$el.attr('src', img.src); 874$el.css('opacity', 1); 875if(loaded >=imgs.length){ 876that.state.imagesLoaded=true; 877that.initialize(); 878}}; 879img.src=$el.attr('src')||$el.attr('data-src')||$el.attr('data-src-retina'); 880}); 881}; 882Owl.prototype.destroy=function (){ 883if(this.$element.hasClass(this.settings.themeClass)){ 884this.$element.removeClass(this.settings.themeClass); 885} 886if(this.settings.responsive!==false){ 887$(window).off('resize.owl.carousel'); 888} 889if(this.transitionEndVendor){ 890this.off(this.$stage.get(0), this.transitionEndVendor, this.e._transitionEnd); 891} 892for (var i in this._plugins){ 893this._plugins[i].destroy(); 894} 895if(this.settings.mouseDrag||this.settings.touchDrag){ 896this.$stage.off('mousedown touchstart touchcancel'); 897$(document).off('.owl.dragEvents'); 898this.$stage.get(0).onselectstart=function (){}; 899this.$stage.off('dragstart', function (){ 900return false;
901}); 902} 903this.$element.off('.owl'); 904this.$stage.children('.cloned').remove(); 905this.e=null; 906this.$element.removeData('owlCarousel'); 907this.$stage.children().contents().unwrap(); 908this.$stage.children().unwrap(); 909this.$stage.unwrap(); 910}; 911Owl.prototype.op=function (a, o, b){ 912var rtl=this.settings.rtl; 913switch (o){ 914case '<': 915return rtl ? a > b:a < b; 916case '>': 917return rtl ? a < b:a > b; 918case '>=': 919return rtl ? a <=b:a >=b; 920case '<=': 921return rtl ? a >=b:a <=b; 922default: 923break; 924}}; 925Owl.prototype.on=function (element, event, listener, capture){ 926if(element.addEventListener){ 927element.addEventListener(event, listener, capture); 928}else if(element.attachEvent){ 929element.attachEvent('on' + event, listener); 930}}; 931Owl.prototype.off=function (element, event, listener, capture){ 932if(element.removeEventListener){ 933element.removeEventListener(event, listener, capture); 934}else if(element.detachEvent){ 935element.detachEvent('on' + event, listener); 936}}; 937Owl.prototype.trigger=function (name, data, namespace){ 938var status={ 939item: { count: this._items.length, index: this.current() }}, 940handler=$.camelCase($.grep(['on', name, namespace], function (v){ 941return v; 942}).join('-').toLowerCase()), 943event=$.Event([name, 'owl', namespace||'carousel'].join('.').toLowerCase(), $.extend({ relatedTarget: this }, status, data)); 944if(!this._supress[name]){ 945$.each(this._plugins, function (name, plugin){ 946if(plugin.onTrigger){ 947plugin.onTrigger(event); 948}}); 949this.$element.trigger(event); 950if(this.settings&&typeof this.settings[handler]==='function'){ 951this.settings[handler].apply(this, event); 952}} 953return event; 954}; 955Owl.prototype.suppress=function (events){ 956$.each(events, $.proxy(function (index, event){ 957this._supress[event]=true; 958}, this)); 959}; 960Owl.prototype.release=function (events){ 961$.each(events, $.proxy(function (index, event){ 962delete this._supress[event]; 963}, this)); 964}; 965Owl.prototype.browserSupport=function (){ 966this.support3d=isPerspective(); 967if(this.support3d){ 968this.transformVendor=isTransform(); 969var endVendors=['transitionend', 'webkitTransitionEnd', 'transitionend', 'oTransitionEnd']; 970this.transitionEndVendor=endVendors[isTransition()]; 971this.vendorName=this.transformVendor.replace(/Transform/i, ''); 972this.vendorName=this.vendorName!=='' ? '-' + this.vendorName.toLowerCase() + '-':''; 973} 974this.state.orientation=window.orientation; 975}; 976function getTouches(event){ 977if(event.touches!==undefined){ 978return { 979x: event.touches[0].pageX, 980y: event.touches[0].pageY 981};} 982if(event.touches===undefined){ 983if(event.pageX!==undefined){ 984return { 985x: event.pageX, 986y: event.pageY 987};} 988if(event.pageX===undefined){ 989return { 990x: event.clientX, 991y: event.clientY 992};}} 993} 994function isStyleSupported(array){ 995var p, 996s, 997fake=document.createElement('div'), 998list=array; 999for (p in list){ 1000s=list[p]; 1001if(typeof fake.style[s]!=='undefined'){ 1002fake=null; 1003return [s, p]; 1004}} 1005return [false]; 1006} 1007function isTransition(){ 1008return isStyleSupported(['transition', 'WebkitTransition', 'MozTransition', 'OTransition'])[1]; 1009} 1010function isTransform(){ 1011return isStyleSupported(['transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform'])[0]; 1012} 1013function isPerspective(){ 1014return isStyleSupported(['perspective', 'webkitPerspective', 'MozPerspective', 'OPerspective', 'MsPerspective'])[0]; 1015} 1016function isTouchSupport(){ 1017return 'ontouchstart' in window||!!navigator.msMaxTouchPoints; 1018} 1019function isTouchSupportIE(){ 1020return window.navigator.msPointerEnabled; 1021} 1022$.fn.owlCarousel=function (options){ 1023return this.each(function (){ 1024if(!$(this).data('owlCarousel')){ 1025$(this).data('owlCarousel', new Owl(this, options)); 1026}}); 1027}; 1028$.fn.owlCarousel.Constructor=Owl; 1029})(window.Zepto||window.jQuery, window, document); 1030;(function ($, window, document, undefined){ 1031var Lazy=function Lazy(carousel){ 1032this._core=carousel; 1033this._loaded=[]; 1034this._handlers={ 1035'initialized.owl.carousel change.owl.carousel': $.proxy(function (e){ 1036if(!e.namespace){ 1037return; 1038} 1039if(!this._core.settings||!this._core.settings.lazyLoad){ 1040return; 1041} 1042if(e.property&&e.property.name=='position'||e.type=='initialized'){ 1043var settings=this._core.settings, 1044n=settings.center&&Math.ceil(settings.items / 2)||settings.items, 1045i=settings.center&&n * -1||0, 1046position=(e.property&&e.property.value||this._core.current()) + i, 1047clones=this._core.clones().length, 1048load=$.proxy(function (i, v){ 1049this.load(v); 1050}, this); 1051while (i++ < n){ 1052this.load(clones / 2 + this._core.relative(position)); 1053clones&&$.each(this._core.clones(this._core.relative(position++)), load
1053); 1054}} 1055}, this) 1056}; 1057this._core.options=$.extend({}, Lazy.Defaults, this._core.options); 1058this._core.$element.on(this._handlers); 1059}; 1060Lazy.Defaults={ 1061lazyLoad: false 1062}; 1063Lazy.prototype.load=function (position){ 1064var $item=this._core.$stage.children().eq(position), 1065$elements=$item&&$item.find('.owl-lazy'); 1066if(!$elements||$.inArray($item.get(0), this._loaded) > -1){ 1067return; 1068} 1069$elements.each($.proxy(function (index, element){ 1070var $element=$(element), 1071image, 1072url=window.devicePixelRatio > 1&&$element.attr('data-src-retina')||$element.attr('data-src'); 1073this._core.trigger('load', { element: $element, url: url }, 'lazy'); 1074if($element.is('img')){ 1075$element.one('load.owl.lazy', $.proxy(function (){ 1076$element.css('opacity', 1); 1077this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); 1078}, this)).attr('src', url); 1079}else{ 1080image=new Image(); 1081image.onload=$.proxy(function (){ 1082$element.css({ 1083'background-image': 'url(' + url + ')', 1084'opacity': '1' 1085}); 1086this._core.trigger('loaded', { element: $element, url: url }, 'lazy'); 1087}, this); 1088image.src=url; 1089}}, this)); 1090this._loaded.push($item.get(0)); 1091}; 1092Lazy.prototype.destroy=function (){ 1093var handler, property; 1094for (handler in this.handlers){ 1095this._core.$element.off(handler, this.handlers[handler]); 1096} 1097for (property in Object.getOwnPropertyNames(this)){ 1098typeof this[property]!='function'&&(this[property]=null); 1099}}; 1100$.fn.owlCarousel.Constructor.Plugins.Lazy=Lazy; 1101})(window.Zepto||window.jQuery, window, document); 1102;(function ($, window, document, undefined){ 1103var AutoHeight=function AutoHeight(carousel){ 1104this._core=carousel; 1105this._handlers={ 1106'initialized.owl.carousel': $.proxy(function (){ 1107if(this._core.settings.autoHeight){ 1108this.update(); 1109}}, this), 1110'changed.owl.carousel': $.proxy(function (e){ 1111if(this._core.settings.autoHeight&&e.property.name=='position'){ 1112this.update(); 1113}}, this), 1114'loaded.owl.lazy': $.proxy(function (e){ 1115if(this._core.settings.autoHeight&&e.element.closest('.' + this._core.settings.itemClass)===this._core.$stage.children().eq(this._core.current())){ 1116this.update(); 1117}}, this) 1118}; 1119this._core.options=$.extend({}, AutoHeight.Defaults, this._core.options); 1120this._core.$element.on(this._handlers); 1121}; 1122AutoHeight.Defaults={ 1123autoHeight: false, 1124autoHeightClass: 'owl-height' 1125}; 1126AutoHeight.prototype.update=function (){ 1127this._core.$stage.parent().height(this._core.$stage.children().eq(this._core.current()).height()).addClass(this._core.settings.autoHeightClass); 1128}; 1129AutoHeight.prototype.destroy=function (){ 1130var handler, property; 1131for (handler in this._handlers){ 1132this._core.$element.off(handler, this._handlers[handler]); 1133} 1134for (property in Object.getOwnPropertyNames(this)){ 1135typeof this[property]!='function'&&(this[property]=null); 1136}}; 1137$.fn.owlCarousel.Constructor.Plugins.AutoHeight=AutoHeight; 1138})(window.Zepto||window.jQuery, window, document); 1139;(function ($, window, document, undefined){ 1140var Video=function Video(carousel){ 1141this._core=carousel; 1142this._videos={}; 1143this._playing=null; 1144this._fullscreen=false; 1145this._handlers={ 1146'resize.owl.carousel': $.proxy(function (e){ 1147if(this._core.settings.video&&!this.isInFullScreen()){ 1148e.preventDefault(); 1149}}, this), 1150'refresh.owl.carousel changed.owl.carousel': $.proxy(function (e){ 1151if(this._playing){ 1152this.stop(); 1153}}, this), 1154'prepared.owl.carousel': $.proxy(function (e){ 1155var $element=$(e.content).find('.owl-video'); 1156if($element.length){ 1157$element.css('display', 'none'); 1158this.fetch($element, $(e.content)); 1159}}, this) 1160}; 1161this._core.options=$.extend({}, Video.Defaults, this._core.options); 1162this._core.$element.on(this._handlers); 1163this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function (e){ 1164this.play(e); 1165}, this)); 1166}; 1167Video.Defaults={ 1168video: false, 1169videoHeight: false, 1170videoWidth: false 1171}; 1172Video.prototype.fetch=function (target, item){ 1173var type=target.attr('data-vimeo-id') ? 'vimeo':'youtube', 1174id=target.attr('data-vimeo-id')||target.attr('data-youtube-id'), 1175width=target.attr('data-width')||this._core.settings.videoWidth, 1176height=target.attr('data-height')||this._core.settings.videoHeight, 1177url=target.attr('href'); 1178if(url){ 1179id=url.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/); 1180if(id[3].indexOf('youtu') > -1){ 1181type='youtube'; 1182}else if(id[3].indexOf('vimeo') > -1){ 1183type='vimeo'; 1184}else{ 1185throw new Error('Video URL not supported.'); 1186} 1187id=id[6]; 1188}else{ 1189throw new Error('Missing video URL.'); 1190} 1191this._videos[url]={ 1192type: type, 1193id: id, 1194width: width, 1195height: height 1196}; 1197item.attr('data-video', url); 1198this.thumbnail(target, this._videos[url]); 1199}; 1200Video.prototype.thumbnail=function (target, video){ 1201var tnLink, 1202icon, 1203path, 1204dimensions=video.width&&video.height ? 'style="width:' + video.width + 'px;height:' + video.height + 'px;"':'', 1205customTn=target.find('img'), 1206srcType='src', 1207lazyClass='', 1208settings=this._core.settings, 1209create=function create(path){ 1210icon='<div class="owl-video-play-icon"></div>'; 1211if(settings.lazyLoad){ 1212tnLink='<div class="owl-video-tn ' + lazyClass + '" ' + srcType + '="' + path + '"></div>'; 1213}else{ 1214tnLink='<div class="owl-video-tn" style="opacity:1;background-image:url(' + path + ')"></div>'; 1215} 1216target.after(tnLink); 1217target.after(icon); 1218}; 1219target.wrap('<div class="owl-video-wrapper"' + dimensions + '></div>'); 1220if(this._core.settings.lazyLoad){ 1221srcType='data-src'; 1222lazyClass='owl-lazy'; 1223} 1224if(customTn.length){ 1225create(customTn.attr(srcType)); 1226customTn.remove(); 1227return false;
1228} 1229if(video.type==='youtube'){ 1230path="http://img.youtube.com/vi/" + video.id + "/hqdefault.jpg"; 1231create(path); 1232}else if(video.type==='vimeo'){ 1233$.ajax({ 1234type: 'GET', 1235url: 'http://vimeo.com/api/v2/video/' + video.id + '.json', 1236jsonp: 'callback', 1237dataType: 'jsonp', 1238success: function success(data){ 1239path=data[0].thumbnail_large; 1240create(path); 1241}}); 1242}}; 1243Video.prototype.stop=function (){ 1244this._core.trigger('stop', null, 'video'); 1245this._playing.find('.owl-video-frame').remove(); 1246this._playing.removeClass('owl-video-playing'); 1247this._playing=null; 1248}; 1249Video.prototype.play=function (ev){ 1250this._core.trigger('play', null, 'video'); 1251if(this._playing){ 1252this.stop(); 1253} 1254var target=$(ev.target||ev.srcElement), 1255item=target.closest('.' + this._core.settings.itemClass), 1256video=this._videos[item.attr('data-video')], 1257width=video.width||'100%', 1258height=video.height||this._core.$stage.height(), 1259html, 1260wrap; 1261if(video.type==='youtube'){ 1262html='<iframe width="' + width + '" height="' + height + '" src="http://www.youtube.com/embed/' + video.id + '?autoplay=1&v=' + video.id + '" frameborder="0" allowfullscreen></iframe>'; 1263}else if(video.type==='vimeo'){ 1264html='<iframe src="http://player.vimeo.com/video/' + video.id + '?autoplay=1" width="' + width + '" height="' + height + '" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>'; 1265} 1266item.addClass('owl-video-playing'); 1267this._playing=item; 1268wrap=$('<div style="height:' + height + 'px; width:' + width + 'px" class="owl-video-frame">' + html + '</div>'); 1269target.after(wrap); 1270}; 1271Video.prototype.isInFullScreen=function (){ 1272var element=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement; 1273if(element&&$(element).parent().hasClass('owl-video-frame')){ 1274this._core.speed(0); 1275this._fullscreen=true; 1276} 1277if(element&&this._fullscreen&&this._playing){ 1278return false; 1279} 1280if(this._fullscreen){ 1281this._fullscreen=false; 1282return false; 1283} 1284if(this._playing){ 1285if(this._core.state.orientation!==window.orientation){ 1286this._core.state.orientation=window.orientation; 1287return false; 1288}} 1289return true; 1290}; 1291Video.prototype.destroy=function (){ 1292var handler, property; 1293this._core.$element.off('click.owl.video'); 1294for (handler in this._handlers){ 1295this._core.$element.off(handler, this._handlers[handler]); 1296} 1297for (property in Object.getOwnPropertyNames(this)){ 1298typeof this[property]!='function'&&(this[property]=null); 1299}}; 1300$.fn.owlCarousel.Constructor.Plugins.Video=Video; 1301})(window.Zepto||window.jQuery, window, document); 1302;(function ($, window, document, undefined){ 1303var Animate=function Animate(scope){ 1304this.core=scope; 1305this.core.options=$.extend({}, Animate.Defaults, this.core.options); 1306this.swapping=true; 1307this.previous=undefined; 1308this.next=undefined; 1309this.handlers={ 1310'change.owl.carousel': $.proxy(function (e){ 1311if(e.property.name=='position'){ 1312this.previous=this.core.current(); 1313this.next=e.property.value; 1314}}, this), 1315'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function (e){ 1316this.swapping=e.type=='translated'; 1317}, this), 1318'translate.owl.carousel': $.proxy(function (e){ 1319if(this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)){ 1320this.swap(); 1321}}, this) 1322}; 1323this.core.$element.on(this.handlers); 1324}; 1325Animate.Defaults={ 1326animateOut: false, 1327animateIn: false 1328}; 1329Animate.prototype.swap=function (){ 1330if(this.core.settings.items!==1||!this.core.support3d){ 1331return; 1332} 1333this.core.speed(0); 1334var left, 1335clear=$.proxy(this.clear, this), 1336previous=this.core.$stage.children().eq(this.previous), 1337next=this.core.$stage.children().eq(this.next), 1338incoming=this.core.settings.animateIn, 1339outgoing=this.core.settings.animateOut; 1340if(this.core.current()===this.previous){ 1341return; 1342} 1343if(outgoing){ 1344left=this.core.coordinates(this.previous) - this.core.coordinates(this.next); 1345previous.css({ 'left': left + 'px' }).addClass('animated owl-animated-out').addClass(outgoing).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', clear); 1346} 1347if(incoming){ 1348next.addClass('animated owl-animated-in').addClass(incoming).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', clear); 1349}}; 1350Animate.prototype.clear=function (e){ 1351$(e.target).css({ 'left': '' }).removeClass('animated owl-animated-out owl-animated-in').removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut); 1352this.core.transitionEnd(); 1353}; 1354Animate.prototype.destroy=function (){ 1355var handler, property; 1356for (handler in this.handlers){ 1357this.core.$element.off(handler, this.handlers[handler]); 1358} 1359for (property in Object.getOwnPropertyNames(this)){ 1360typeof this[property]!='function'&&(this[property]=null); 1361}}; 1362$.fn.owlCarousel.Constructor.Plugins.Animate=Animate; 1363})(window.Zepto||window.jQuery, window, document); 1364;(function ($, window, document, undefined){ 1365var Autoplay=function Autoplay(scope){ 1366this.core=scope; 1367this.core.options=$.extend({}, Autoplay.Defaults, this.core.options); 1368this.handlers={ 1369'translated.owl.carousel refreshed.owl.carousel': $.proxy(function (){ 1370this.autoplay(); 1371}, this), 1372'play.owl.autoplay': $.proxy(function (e, t, s){ 1373this.play(t, s); 1374}, this), 1375'stop.owl.autoplay': $.proxy(function (){ 1376this.stop(); 1377}, this), 1378'mouseover.owl.autoplay': $.proxy(function (){ 1379if(this.core.settings.autoplayHoverPause){ 1380this.pause(); 1381}}, this), 1382'mouseleave.owl.autoplay': $.proxy(function (){ 1383if(this.core.settings.autoplayHoverPause){ 1384this.autoplay(); 1385}}, this) 1386}; 1387this.core.$element.on(this.handlers); 1388}; 1389Autoplay.Defaults={ 1390autoplay: false, 1391autoplayTimeout: 5000, 1392autoplayHoverPause: false, 1393autoplaySpeed: false 1394}; 1395Autoplay.prototype.autoplay=function (){ 1396if(this.core.settings.autoplay&&!this.core.state.videoPlay){ 1397window.clearInterval(this.interval); 1398this.interval=window.setInterval($.proxy(function (){ 1399this.play(); 1400}, this), this.core.settings.autoplayTimeout); 1401}else{ 1402window.clearInterval(this.interval); 1403}}; 1404Autoplay.prototype.play=function (timeout, speed){ 1405if(document.hidden===true){ 1406return; 1407} 1408if(this.core.state.isTouch||this.core.state.isScrolling||this.core.state.isSwiping||this.core.state.inMotion){ 1409return; 1410} 1411if(this.core.settings.autoplay===false){ 1412window.clearInterval(this.interval); 1413return; 1414} 1415this.core.next(this.core.settings.autoplaySpeed); 1416}; 1417Autoplay.prototype.stop=function (){ 1418window.clearInterval(this.interval); 1419}; 1420Autoplay.prototype.pause=function (){ 1421window.clearInterval(this.interval); 1422}; 1423Autoplay.prototype.destroy=function (){ 1424var handler, property; 1425window.clearInterval(this.interval); 1426for (handler in this.handlers){ 1427this.core.$element.off(handler, this.handlers[handler]); 1428} 1429for (property in Object.getOwnPropertyNames(this)){ 1430typeof this[property]!='function'&&(this[property]=null); 1431}}; 1432$.fn.owlCarousel.Constructor.Plugins.autoplay=Autoplay; 1433})(window.Zepto||window.jQuery, window, document); 1434;(function ($, window, document, undefined){ 1435'use strict'; 1436var Navigation=function Navigation(carousel){
1437this._core=carousel; 1438this._initialized=false; 1439this._pages=[]; 1440this._controls={}; 1441this._templates=[]; 1442this.$element=this._core.$element; 1443this._overrides={ 1444next: this._core.next, 1445prev: this._core.prev, 1446to: this._core.to 1447}; 1448this._handlers={ 1449'prepared.owl.carousel': $.proxy(function (e){ 1450if(this._core.settings.dotsData){ 1451this._templates.push($(e.content).find('[data-dot]').andSelf('[data-dot]').attr('data-dot')); 1452}}, this), 1453'add.owl.carousel': $.proxy(function (e){ 1454if(this._core.settings.dotsData){ 1455this._templates.splice(e.position, 0, $(e.content).find('[data-dot]').andSelf('[data-dot]').attr('data-dot')); 1456}}, this), 1457'remove.owl.carousel prepared.owl.carousel': $.proxy(function (e){ 1458if(this._core.settings.dotsData){ 1459this._templates.splice(e.position, 1); 1460}}, this), 1461'change.owl.carousel': $.proxy(function (e){ 1462if(e.property.name=='position'){ 1463if(!this._core.state.revert&&!this._core.settings.loop&&this._core.settings.navRewind){ 1464var current=this._core.current(), 1465maximum=this._core.maximum(), 1466minimum=this._core.minimum(); 1467e.data=e.property.value > maximum ? current >=maximum ? minimum:maximum:e.property.value < minimum ? maximum:e.property.value; 1468}} 1469}, this), 1470'changed.owl.carousel': $.proxy(function (e){ 1471if(e.property.name=='position'){ 1472this.draw(); 1473}}, this), 1474'refreshed.owl.carousel': $.proxy(function (){ 1475if(!this._initialized){ 1476this.initialize(); 1477this._initialized=true; 1478} 1479this._core.trigger('refresh', null, 'navigation'); 1480this.update(); 1481this.draw(); 1482this._core.trigger('refreshed', null, 'navigation'); 1483}, this) 1484}; 1485this._core.options=$.extend({}, Navigation.Defaults, this._core.options); 1486this.$element.on(this._handlers); 1487}; 1488Navigation.Defaults={ 1489nav: false, 1490navRewind: true, 1491navText: ['prev', 'next'], 1492navSpeed: false, 1493navElement: 'div', 1494navContainer: false, 1495navContainerClass: 'owl-nav', 1496navClass: ['owl-prev', 'owl-next'], 1497slideBy: 1, 1498dotClass: 'owl-dot', 1499dotsClass: 'owl-dots', 1500dots: true, 1501dotsEach: false, 1502dotData: false, 1503dotsSpeed: false, 1504dotsContainer: false, 1505controlsClass: 'owl-controls' 1506}; 1507Navigation.prototype.initialize=function (){ 1508var $container, 1509override, 1510options=this._core.settings; 1511if(!options.dotsData){ 1512this._templates=[$('<div>').addClass(options.dotClass).append($('<span>')).prop('outerHTML')]; 1513} 1514if(!options.navContainer||!options.dotsContainer){ 1515this._controls.$container=$('<div>').addClass(options.controlsClass).appendTo(this.$element); 1516} 1517this._controls.$indicators=options.dotsContainer ? $(options.dotsContainer):$('<div>').hide().addClass(options.dotsClass).appendTo(this._controls.$container); 1518this._controls.$indicators.on('click', 'div', $.proxy(function (e){ 1519var index=$(e.target).parent().is(this._controls.$indicators) ? $(e.target).index():$(e.target).parent().index(); 1520e.preventDefault(); 1521this.to(index, options.dotsSpeed); 1522}, this)); 1523$container=options.navContainer ? $(options.navContainer):$('<div>').addClass(options.navContainerClass).prependTo(this._controls.$container); 1524this._controls.$next=$('<' + options.navElement + '>'); 1525this._controls.$previous=this._controls.$next.clone(); 1526this._controls.$previous.addClass(options.navClass[0]).html(options.navText[0]).hide().prependTo($container).on('click', $.proxy(function (e){ 1527this.prev(options.navSpeed); 1528}, this)); 1529this._controls.$next.addClass(options.navClass[1]).html(options.navText[1]).hide().appendTo($container).on('click', $.proxy(function (e){ 1530this.next(options.navSpeed); 1531}, this)); 1532for (override in this._overrides){ 1533this._core[override]=$.proxy(this[override], this); 1534}}; 1535Navigation.prototype.destroy=function (){ 1536var handler, control, property, override; 1537for (handler in this._handlers){ 1538this.$element.off(handler, this._handlers[handler]); 1539} 1540for (control in this._controls){ 1541this._controls[control].remove(); 1542} 1543for (override in this.overides){ 1544this._core[override]=this._overrides[override]; 1545} 1546for (property in Object.getOwnPropertyNames(this)){ 1547typeof this[property]!='function'&&(this[property]=null); 1548}}; 1549Navigation.prototype.update=function (){ 1550var i, 1551j, 1552k, 1553options=this._core.settings, 1554lower=this._core.clones().length / 2, 1555upper=lower + this._core.items().length, 1556size=options.center||options.autoWidth||options.dotData ? 1:options.dotsEach||options.items; 1557if(options.slideBy!=='page'){ 1558options.slideBy=Math.min(options.slideBy, options.items); 1559}
1560if(options.dots||options.slideBy=='page'){ 1561this._pages=[]; 1562for (i=lower, j=0, k=0; i < upper; i++){ 1563if(j >=size||j===0){ 1564this._pages.push({ 1565start: i - lower, 1566end: i - lower + size - 1 1567}); 1568j=0, ++k; 1569} 1570j +=this._core.mergers(this._core.relative(i)); 1571}} 1572}; 1573Navigation.prototype.draw=function (){ 1574var difference, 1575i, 1576html='', 1577options=this._core.settings, 1578$items=this._core.$stage.children(), 1579index=this._core.relative(this._core.current()); 1580if(options.nav&&!options.loop&&!options.navRewind){ 1581this._controls.$previous.toggleClass('disabled', index <=0); 1582this._controls.$next.toggleClass('disabled', index >=this._core.maximum()); 1583} 1584this._controls.$previous.toggle(options.nav); 1585this._controls.$next.toggle(options.nav); 1586if(options.dots){ 1587difference=this._pages.length - this._controls.$indicators.children().length; 1588if(options.dotData&&difference!==0){ 1589for (i=0; i < this._controls.$indicators.children().length; i++){ 1590html +=this._templates[this._core.relative(i)]; 1591} 1592this._controls.$indicators.html(html); 1593}else if(difference > 0){ 1594html=new Array(difference + 1).join(this._templates[0]); 1595this._controls.$indicators.append(html); 1596}else if(difference < 0){ 1597this._controls.$indicators.children().slice(difference).remove(); 1598} 1599this._controls.$indicators.find('.active').removeClass('active'); 1600this._controls.$indicators.children().eq($.inArray(this.current(), this._pages)).addClass('active'); 1601} 1602this._controls.$indicators.toggle(options.dots); 1603}; 1604Navigation.prototype.onTrigger=function (event){ 1605var settings=this._core.settings; 1606event.page={ 1607index: $.inArray(this.current(), this._pages), 1608count: this._pages.length, 1609size: settings&&(settings.center||settings.autoWidth||settings.dotData ? 1:settings.dotsEach||settings.items) 1610};}; 1611Navigation.prototype.current=function (){ 1612var index=this._core.relative(this._core.current()); 1613return $.grep(this._pages, function (o){ 1614return o.start <=index&&o.end >=index; 1615}).pop(); 1616}; 1617Navigation.prototype.getPosition=function (successor){ 1618var position, 1619length, 1620options=this._core.settings; 1621if(options.slideBy=='page'){ 1622position=$.inArray(this.current(), this._pages); 1623length=this._pages.length; 1624successor ? ++position:--position; 1625position=this._pages[(position % length + length) % length].start; 1626}else{ 1627position=this._core.relative(this._core.current()); 1628length=this._core.items().length; 1629successor ? position +=options.slideBy:position -=options.slideBy; 1630} 1631return position; 1632}; 1633Navigation.prototype.next=function (speed){ 1634$.proxy(this._overrides.to, this._core)(this.getPosition(true), speed); 1635}; 1636Navigation.prototype.prev=function (speed){ 1637$.proxy(this._overrides.to, this._core)(this.getPosition(false), speed); 1638}; 1639Navigation.prototype.to=function (position, speed, standard){ 1640var length; 1641if(!standard){ 1642length=this._pages.length; 1643$.proxy(this._overrides.to, this._core)(this._pages[(position % length + length) % length].start, speed); 1644}else{ 1645$.proxy(this._overrides.to, this._core)(position, speed); 1646}}; 1647$.fn.owlCarousel.Constructor.Plugins.Navigation=Navigation; 1648})(window.Zepto||window.jQuery, window, document); 1649;(function ($, window, document, undefined){ 1650'use strict'; 1651var Hash=function Hash(carousel){ 1652this._core=carousel; 1653this._hashes={}; 1654this.$element=this._core.$element; 1655this._handlers={ 1656'initialized.owl.carousel': $.proxy(function (){ 1657if(this._core.settings.startPosition=='URLHash'){ 1658$(window).trigger('hashchange.owl.navigation'); 1659}}, this), 1660'prepared.owl.carousel': $.proxy(function (e){ 1661var hash=$(e.content).find('[data-hash]').andSelf('[data-hash]').attr('data-hash'); 1662this._hashes[hash]=e.content; 1663}, this) 1664}; 1665this._core.options=$.extend({}, Hash.Defaults, this._core.options); 1666this.$element.on(this._handlers); 1667$(window).on('hashchange.owl.navigation', $.proxy(function (){ 1668var hash=window.location.hash.substring(1), 1669items=this._core.$stage.children(), 1670position=this._hashes[hash]&&items.index(this._hashes[hash])||0; 1671if(!hash){ 1672return false; 1673} 1674this._core.to(position, false, true); 1675}, this)); 1676}; 1677Hash.Defaults={ 1678URLhashListener: false 1679}; 1680Hash.prototype.destroy=function (){ 1681var handler, property; 1682$(window).off('hashchange.owl.navigation'); 1683for (handler in this._handlers){ 1684this._core.$element.off(handler, this._handlers[handler]); 1685} 1686for (property in Object.getOwnPropertyNames(this)){ 1687typeof this[property]!='function'&&(this[property]=null); 1688}}; 1689$.fn.owlCarousel.Constructor.Plugins.Hash=Hash; 1690})(window.Zepto||window.jQuery, window, document);
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.