diff --git a/dist/min/tiny-slider.helper.ie8.js b/dist/min/tiny-slider.helper.ie8.js index 7462bbc3..e3a829c3 100644 --- a/dist/min/tiny-slider.helper.ie8.js +++ b/dist/min/tiny-slider.helper.ie8.js @@ -1,2 +1,2 @@ -Array.isArray||(Array.isArray=function(t){return"[object Array]"==Object.prototype.toString.call(t)}),Array.prototype.forEach||(Array.prototype.forEach=function(t,e){for(var n=this.length>>>0,r=0;r=e)return-1;for(n<0&&(n+=e);n=0;--n)if(t=e[n],1===t.nodeType)return t;return null}})}(),function(){"use strict";"previousElementSibling"in document.documentElement||Object.defineProperty(Element.prototype,"previousElementSibling",{get:function(){for(var t=this.previousSibling;t&&1!==t.nodeType;)t=t.previousSibling;return t}})}(),function(){"use strict";"nextElementSibling"in document.documentElement||Object.defineProperty(Element.prototype,"nextElementSibling",{get:function(){for(var t=this.nextSibling;t&&1!==t.nodeType;)t=t.nextSibling;return t}})}(),function(){"use strict";window.getComputedStyle||(window.getComputedStyle=function(t){if(!t)return null;var e=t.currentStyle,n=t.getBoundingClientRect(),r=document.createElement("div"),o=r.style;for(var i in e)o[i]=e[i];return o.cssFloat=o.styleFloat,"auto"===o.width&&(o.width=n.right-n.left+"px"),"auto"===o.height&&(o.height=n.bottom-n.top+"px"),o})}(); +Array.isArray||(Array.isArray=function(t){return"[object Array]"==Object.prototype.toString.call(t)}),Array.prototype.forEach||(Array.prototype.forEach=function(t,e){for(var n=this.length>>>0,r=0;r>>0;if("function"!=typeof t)throw new TypeError;for(var n=new Array(e),r=arguments[1],o=0;o=e)return-1;for(n<0&&(n+=e);n=0;--n)if(t=e[n],1===t.nodeType)return t;return null}})}(),function(){"use strict";"previousElementSibling"in document.documentElement||Object.defineProperty(Element.prototype,"previousElementSibling",{get:function(){for(var t=this.previousSibling;t&&1!==t.nodeType;)t=t.previousSibling;return t}})}(),function(){"use strict";"nextElementSibling"in document.documentElement||Object.defineProperty(Element.prototype,"nextElementSibling",{get:function(){for(var t=this.nextSibling;t&&1!==t.nodeType;)t=t.nextSibling;return t}})}(),function(){"use strict";window.getComputedStyle||(window.getComputedStyle=function(t){if(!t)return null;var e=t.currentStyle,n=t.getBoundingClientRect(),r=document.createElement("div"),o=r.style;for(var i in e)o[i]=e[i];return o.cssFloat=o.styleFloat,"auto"===o.width&&(o.width=n.right-n.left+"px"),"auto"===o.height&&(o.height=n.bottom-n.top+"px"),o})}(); //# sourceMappingURL=../sourcemaps/tiny-slider.helper.ie8.js.map diff --git a/dist/min/tiny-slider.js b/dist/min/tiny-slider.js index 5044a763..e7b3443c 100644 --- a/dist/min/tiny-slider.js +++ b/dist/min/tiny-slider.js @@ -1,2 +1,2 @@ -var tns=function(){function e(){for(var e,t,n,i=arguments[0]||{},a=1,r=arguments.length;a=0?JSON.parse(e):e}function n(e,t){return localStorage.setItem(e,t),t}function i(){return void 0===window.tnsId?window.tnsId=1:window.tnsId++,"tns"+window.tnsId}function a(e){var t=document.createElement("style");return e&&t.setAttribute("media",e),document.querySelector("head").appendChild(t),t.sheet?t.sheet:t.styleSheet}function r(e,t){return Math.atan2(e,t)*(180/Math.PI)}function o(e,t){return Math.abs(90-Math.abs(e))>=90-t?"horizontal":Math.abs(90-Math.abs(e))<=t&&"vertical"}function s(e,t){return e.hasAttribute(t)}function l(e,t){return e.getAttribute(t)}function c(e){return void 0!==e.item}function u(e,t){if(e=c(e)||e instanceof Array?e:[e],"[object Object]"===Object.prototype.toString.call(t))for(var n=e.length;n--;)for(var i in t)e[n].setAttribute(i,t[i])}function d(e,t){e=c(e)||e instanceof Array?e:[e],t=t instanceof Array?t:[t];for(var n=t.length,i=e.length;i--;)for(var a=n;a--;)e[i].removeAttribute(t[a])}function f(e){var t=e.cloneNode(!0);e.parentNode.insertBefore(t,e),e.remove(),e=null}function h(e){s(e,"hidden")||u(e,{hidden:""})}function v(e){s(e,"hidden")&&d(e,"hidden")}function p(e){return"boolean"==typeof e.complete?e.complete:"number"==typeof e.naturalWidth?0!==e.naturalWidth:void 0}function m(e){for(var t=document.createElement("fakeelement"),n=(e.length,0);n0?setTimeout(s,l):o()}var l=Math.min(r,10),c=a.indexOf("%")>=0?"%":"px",a=a.replace(c,""),u=Number(e.style[t].replace(n,"").replace(i,"").replace(c,"")),d=(a-u)/r*l;setTimeout(s,l)}Object.keys||(Object.keys=function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t}),function(){"use strict";"remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)})}(),function(){"use strict";var e,t,n,i=window,a=document,r=Object,o="length",s="item contains add remove toggle toString toLocaleString".split(" "),l=s[2],c=s[3],u=s[4],d="prototype",f="defineProperty"in r||"__defineGetter__"in r[d]||null,h=function(e,t,n,i){r.defineProperty?r.defineProperty(e,t,{configurable:!1===f||!!i,get:n}):e.__defineGetter__(t,n)},v=function(e,t){var n=this,i=[],a={},d=0,f=0,v=function(){if(d>=f)for(;f>>0,e[t]=i.join(" "),v())},n[c]=function(){p.apply(n,r=arguments);for(var r,s={},l=0,c=[];l>>0,e[t]=i.join(" "),v()},n[u]=function(e,t){return p.apply(n,[e]),void 0!==t?t?(n[l](e),!0):(n[c](e),!1):a[e]?(n[c](e),!1):(n[l](e),!0)},function(e,t){if(t)for(var n=0;n<7;++n)t(e,s[n],{enumerable:!1})}(n,r.defineProperty),n},p=function(e,t,n){h(e[d],t,function(){var e,i=this,r="__defineGetter__defineProperty"+t;if(i[r])return e;if(i[r]=!0,!1===f){for(var s,l=p.mirror=p.mirror||a.createElement("div"),c=l.childNodes,u=c[o],d=0;de[o]&&(t=d[l],n=d[c],d[l]=function(){for(var e=0,n=arguments;e=0&&Ze.forEach(function(t){Je[t][e]&&(n=!0)}),n}function c(e,n){n=n?n:Qe;var i;if("items"===e&&c("fixedWidth"))i=Math.floor(n/c("fixedWidth"));else if("slideBy"!==e||Re)if("edgePadding"!==e||Re)if("autoHeight"!==e||Re&&"outer"!==lt){if(i=t[e],Ze&&$e.indexOf(e)>=0)for(var a=0,r=Ze.length;a=o))break;e in Je[o]&&(i=Je[o][e])}"items"===e&&(i=Math.max(1,Math.min(Ye,i))),"slideBy"===e&&"page"===i&&(i=ot)}else i=!0;else i=!1;else i=ot;return i}function m(e){return A?A+"("+100*e+"% / "+Tt+")":100*e/Tt+"%"}function y(e,t,n){var i="";if(e){var a=e;t&&(a+=t),i=n?"margin: 0px "+(Qe%(n+t)+t)/2+"px":qe?"margin: 0 "+e+"px 0 "+a+"px;":"padding: "+a+"px 0 "+e+"px 0;"}else if(t&&!n){var r=qe?"right":"bottom";i="margin-"+r+": -"+t+"px;"}return i}function w(e,t,n){n=Math.min(Ye,n);return e?(e+Number(t))*Tt+"px":A?A+"("+100*Tt+"% / "+n+")":100*Tt/n+"%"}function D(e,t,n){n=Math.min(Ye,n);var i=gutterStr="";if(qe){if(i="width:",e)i+=e+Number(t)+"px";else{var a=Re?Tt:Math.min(Ye,n);i+=A?A+"(100% / "+a+")":100/a+"%"}i+=Gt+";"}if(t!==!1){var r=qe?"padding-":"margin-",o=qe?"right":"bottom";gutterStr=r+o+": "+t+"px;"}return i+gutterStr}function L(e){clearTimeout(at),at=setTimeout(function(){Qe!==Fe.clientWidth&&(N(),"outer"===lt&&Wt.emit("outerResized",Ae(e)))},100)}function N(){var e=et,n=Nt,i=ot;if(Qe=Fe.clientWidth,_e=Ue.clientWidth,Ze&&(et=S()),e!==et){var a=et>0?Je[Ze[et-1]]:t,r=ft,o=mt,s=dt,l=ut,u=ct,d=jt;if(jt=Ye<=ot,ot=a.items||c("items"),ft=!jt&&(a.arrowKeys||c("arrowKeys")),st=c("slideBy"),ht=a.speed||c("speed"),mt=c("autoHeight"),dt=a.fixedWidth||c("fixedWidth"),ut=a.edgePadding||c("edgePadding"),ct=a.gutter||c("gutter"),jt!==d&&jt&&(Nt=Re?0:xt),ft!==r&&(ft?g(M,Ft):b(M,Ft)),dt!==s&&te(),mt!==o&&(mt||(Ue.style.height="")),Xt){var f=en,p=tn;en=!jt&&(a.controls||c("controls")),tn=a.controlsText||c("controlsText"),en!==f&&(en?v(nn):h(nn)),tn!==p&&($t.innerHTML=tn[0],Zt.innerHTML=tn[1])}if(Kt){var m=rn;rn=!jt&&(a.nav||c("nav")),rn!==m&&(rn?(v(on),Oe()):h(on))}if(Qt){var x=Nn;Nn=!jt&&(a.touch||c("touch")),Nn!==x&&Re&&(Nn?g(Ve,Ut):b(Ve,Ut))}if(Jt){var T=kn;kn=!jt&&(a.mouseDrag||c("mouseDrag")),kn!==T&&Re&&(kn?g(Ve,Vt):b(Ve,Vt))}if(Yt){var L=hn,N=yn,k=En,O=mn;if(jt?hn=yn=En=!1:(hn=a.autoplay||c("autoplay"),hn?(yn=a.autoplayHoverPause||c("autoplayHoverPause"),En=a.autoplayResetOnVisibility||c("autoplayResetOnVisibility")):yn=En=!1),mn=a.autoplayText||c("autoplayText"),vn=a.autoplayTimeout||c("autoplayTimeout"),hn!==L&&(hn?(v(gn),bn||fe()):(h(gn),bn&&he())),yn!==N&&(yn?g(Ve,_t):b(Ve,_t)),En!==k&&(En?g(M,qt):b(M,qt)),mn!==O){var A=hn?1:0,P=gn.innerHTML,I=P.length-O[A].length;P.substring(I)===O[A]&&(gn.innerHTML=P.substring(0,I)+mn[A])}}Pn(),W||(ut===l&&ct===u||(Ue.style.cssText=y(ut,ct,dt)),dt===s&&ct===u&&ot===i||(Re&&qe&&(Ve.style.width=w(dt,ct,ot)),(qe||ct!==u)&&(str=D(dt,ct,ot),yt.removeRule(C(yt)-1),E(yt,"#"+Bt+" .tns-item",str,C(yt)))),dt||ie(0)),ot!==i&&(Ot=Tt-ot-Mt,F(),Q(),$(),Oe(),J(),Nt!==n&&(Wt.emit("indexChanged",Ae()),ie(0)),navigator.msMaxTouchPoints&&Y())}else c("fixedWidth")&&(ot=c("items"));qe||(K(),Me(),te()),dt&&ut&&(Ue.style.cssText=y(ut,ct,dt)),U()}function S(){return et=0,Ze.forEach(function(e,t){Qe>=e&&(et=t+tt)}),et}function _(){bn&&(he(),xn=!0)}function q(){!bn&&xn&&(fe(),xn=!1)}function F(){if(gt){var e=Nt,t=Nt+ot;for(ut&&(e-=1,t+=1);e=Nt&&e0)for(var n=0;n0&&xe(an[n(s-1)]);break;case O.UP:case O.HOME:s>0&&xe(an[n(0)]);break;case O.RIGHT:case O.PAGEDOWN:s0?Math.floor(n):Math.ceil(n),Nt+=n}else{var i=-(wn+Ln);if(i<=0)Nt=kt;else if(i>=it[it.length-1])Nt=Ot;else{var a=0;do{a++,Nt=Ln<0?a+1:a}while(a=it[a+1])}}0===e.type.indexOf("touch")?Wt.emit("touchEnd",Ae(e)):Wt.emit("dragEnd",Ae(e)),ae()}if(An){An=!1;var r=Ce(e);we(r)&&g(r,{click:function e(t){De(t),b(r,{click:e})}})}}function Me(){Ue.style.height=it[Nt+ot]-it[Nt]+"px"}function ke(){sn=[];for(var e=!pt&&ut?Nt-1:Nt,t=e%Ye%ot;tYe&&(t=Ye-ot),sn.push(t),t+=ot;(pt&&sn.length*ot0)&&sn.unshift(0)}function Oe(){rn&&!t.navContainer&&(ke(),sn!==ln&&(ln.length>0&&ln.forEach(function(e){u(an[e],{hidden:""})}),sn.length>0&&sn.forEach(function(e){d(an[e],"hidden")}),ln=sn))}function Ae(e){return{container:Ve,slideItems:Ke,navContainer:on,navItems:an,controlsContainer:nn,prevButton:$t,nextButton:Zt,items:ot,slideBy:st,cloneCount:xt,slideCount:Ye,slideCountNew:Tt,index:Nt,indexCached:St,navCurrent:un,navCurrentCached:dn,visibleNavIndexes:sn,visibleNavIndexesCached:ln,event:e||{}}}if(t=e({container:M.querySelector(".slider"),mode:"carousel",axis:"horizontal",items:1,gutter:0,edgePadding:0,fixedWidth:!1,slideBy:1,controls:!0,controlsText:["prev","next"],controlsContainer:!1,nav:!0,navContainer:!1,arrowKeys:!1,speed:300,autoplay:!1,autoplayTimeout:5e3,autoplayDirection:"forward",autoplayText:["start","stop"],autoplayHoverPause:!1,autoplayButton:!1,autoplayResetOnVisibility:!0,loop:!0,rewind:!1,autoHeight:!1,responsive:!1,lazyload:!1,touch:!0,mouseDrag:!1,nested:!1,onInit:!1},t||{}),["container","controlsContainer","navContainer","autoplayButton"].forEach(function(e){"string"==typeof t[e]&&(t[e]=M.querySelector(t[e]))}),t.container&&t.container.nodeName&&!(t.container.children.length<2)){if(t.responsive){var Pe={},We=t.responsive;for(var Ie in We){var He=We[Ie];Pe[Ie]="number"==typeof He?{items:He}:He}t.responsive=Pe,Pe=null}var Re="carousel"===t.mode;if(!Re){t.axis="horizontal",t.rewind=!1,t.loop=!0;var ze="tns-fadeIn",Be="tns-fadeOut",je=!1,Ge=t.animateNormal||"tns-normal";j&&G&&(ze=t.animateIn||ze,Be=t.animateOut||Be,je=t.animateDelay||je)}var _e,qe="horizontal"===t.axis,Fe=M.createElement("div"),Ue=M.createElement("div"),Ve=t.container,Xe=Ve.parentNode,Ke=Ve.children,Ye=Ke.length,Qe=Xe.clientWidth,Je=t.responsive,$e=[],Ze=!1,et=0,tt=0;if(Je){Ze=Object.keys(Je).sort(function(e,t){return e-t}),Ze.indexOf(0)<0&&(tt=1),Ze.forEach(function(e){$e=$e.concat(Object.keys(Je[e]))});var nt=[];$e.forEach(function(e){nt.indexOf(e)<0&&nt.push(e)}),$e=nt,et=S()}var it,at,rt,ot=c("items"),st="page"===c("slideBy")?ot:c("slideBy"),lt=t.nested,ct=c("gutter"),ut=c("edgePadding"),dt=c("fixedWidth"),ft=c("arrowKeys"),ht=c("speed"),vt=t.rewind,pt=!vt&&t.loop,mt=c("autoHeight"),yt=a(),gt=t.lazyload,bt=[],xt=pt?2*Ye:n("edgePadding")?1:0,Tt=Re?Ye+2*xt:Ye+xt,Et=!(!dt||pt||ut),Ct=!Re||!pt,wt=qe?"left":"top",Dt="",Lt="",Nt=Re?xt:0,St=Nt,Mt=!pt&&n("edgePadding")?1:0,kt=Mt,Ot=Tt-ot-Mt,At=!1,Pt=t.onInit,Wt=new x,It=Ve.id,Ht=Ve.className,Rt=Ke[0].id,zt=Ke[0].className,Bt=Ve.id||i(),jt=Ye<=ot,Gt="inner"===lt?" !important":"",_t={mouseover:_,mouseout:q},qt={visibilitychange:ye},Ft={keydown:ge},Ut={touchstart:Le,touchmove:Ne,touchend:Se,touchcancel:Se},Vt={mousedown:Le,mousemove:Ne,mouseup:Se,mouseleave:Se},Xt=n("controls"),Kt=n("nav"),Yt=n("autoplay"),Qt=n("touch"),Jt=n("mouseDrag");if(Xt)var $t,Zt,en=c("controls"),tn=c("controlsText"),nn=t.controlsContainer;if(Kt)var an,rn=c("nav"),on=t.navContainer,sn=[],ln=sn,cn=-1,un=0,dn=0;if(Yt)var fn,hn=c("autoplay"),vn=c("autoplayTimeout"),pn="forward"===t.autoplayDirection?1:-1,mn=c("autoplayText"),yn=c("autoplayHoverPause"),gn=t.autoplayButton,bn=!1,xn=!1,Tn=[""," animation"],En=c("autoplayResetOnVisibility"),Cn=!1;if(Qt)var wn,Dn,Ln,Nn=c("touch"),Sn=null,Mn=null;if(Jt)var kn=c("mouseDrag"),On=!1,An=!1;jt&&(en=rn=Nn=kn=ft=hn=yn=En=!1),I&&(wt=I,Dt="translate",Dt+=qe?"X(":"Y(",Lt=")"),function(){Fe.appendChild(Ue),Xe.insertBefore(Fe,Ve),Ue.appendChild(Ve),_e=Ue.clientWidth;var e="tns-outer",i="tns-inner",a=" tns-slider tns-"+t.mode;if(Re&&(qe&&(n("edgePadding")||n("gutter")&&!t.fixedWidth)?e+=" tns-ovh":i+=" tns-ovh"),Fe.className=e,Ue.className=i,Ue.id=Bt+"-iw",mt&&(Ue.className+=" tns-ah",Ue.style[H]=ht/1e3+"s"),""===Ve.id&&(Ve.id=Bt),a+=P?" tns-subpixel":" tns-no-subpixel",a+=A?" tns-calc":" tns-no-calc",Re&&(a+=" tns-"+t.axis),Ve.className+=a,Re&&j){var r={};r[j]=re,g(Ve,r)}e=i=a=null;for(var o=0;o0&&yt.insertRule("@media (min-width: "+e/16+"em) {"+n+"}",yt.cssRules.length)}),Re&&te(),navigator.msMaxTouchPoints&&(Fe.classList.add("ms-touch"),g(Fe,{scroll:Ee}),Y()),Kt){if(on)u(on,{"aria-label":"Carousel Pagination"}),an=on.children,[].forEach.call(an,function(e,t){u(e,{"data-nav":t,tabindex:"-1","aria-selected":"false","aria-controls":Bt+"-item"+t})});else{for(var I="",T=0;T