diff --git a/dist/easytimer.js b/dist/easytimer.js index adcde78..070ffa0 100644 --- a/dist/easytimer.js +++ b/dist/easytimer.js @@ -1,7 +1,7 @@ /** * easytimer.js - * Generated: 2018-03-23 - * Version: 2.2.0 + * Generated: 2018-03-26 + * Version: 2.2.1 */ (function (global, factory) { diff --git a/dist/easytimer.min.js b/dist/easytimer.min.js index 9ebcd79..98dff17 100644 --- a/dist/easytimer.min.js +++ b/dist/easytimer.min.js @@ -1,7 +1,7 @@ /** * easytimer.js - * Generated: 2018-03-23 - * Version: 2.2.0 + * Generated: 2018-03-26 + * Version: 2.2.1 */ !function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):n.Timer=t()}(this,function(){"use strict";function n(n,t,e){var o=void 0,i="";if(n.length>t)return n;for(o=0;o=0?S(o,w[t]):w[t]-S(o,w[t])}(o,X(t,b[o])),e[o]!==i}function B(){F(),function(){for(var t in n)n.hasOwnProperty(t)&&"number"==typeof n[t]&&(n[t]=0);for(var o in e)e.hasOwnProperty(o)&&"number"==typeof e[o]&&(e[o]=0)}()}function F(){clearInterval(j),j=void 0,L=!1,U=!1}function G(t){var i;tn()?(I=H(),M=Y(x.target)):function(t){var i;V="string"==typeof(t=t||{}).precision?t.precision:l,D="function"==typeof t.callback?t.callback:function(){},q=!0===t.countdown,A=!0===q?-1:1,"object"===o(t.startValues)&&(i=t.startValues,P=W(i),n.secondTenths=P[d],n.seconds=P[c],n.minutes=P[f],n.hours=P[a],n.days=P[v],e=Z(P,e)),I=H(),K(),"object"===o(t.target)?M=Y(t.target):q&&(t.target={seconds:0},M=Y(t.target)),k={precision:V,callback:D,countdown:"object"===(void 0===t?"undefined":o(t))&&!0===t.countdown,target:M,startValues:P},x=t}(t),i=b[V],Q(N(Date.now()))||(j=setInterval(J,i),L=!0,U=!1)}function H(){return N(Date.now())-e.secondTenths*b[h]*A}function J(){var n=N(Date.now());!function(n){n[h]&&_("secondTenthsUpdated",z),n[l]&&_("secondsUpdated",z),n[p]&&_("minutesUpdated",z),n[m]&&_("hoursUpdated",z),n[y]&&_("daysUpdated",z)}(K()),D(z.detail.timer),Q(n)&&($(),_("targetAchieved",z))}function K(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:N(Date.now()),t=A>0?n-I:I-n,e={};return e[h]=R(t,h),e[l]=function(n){return R(n,l)}(t),e[p]=function(n){return R(n,p)}(t),e[m]=function(n){return R(n,m)}(t),e[y]=function(n){return R(n,y)}(t),e}function N(n){return Math.floor(n/b[V])*b[V]}function Q(n){return M instanceof Array&&n>=O}function W(n){var t,e,h,l,p,m=void 0;if("object"===(void 0===n?"undefined":o(n)))if(n instanceof Array){if(5!==n.length)throw new Error("Array size not valid");m=n}else m=[n.secondTenths||0,n.seconds||0,n.minutes||0,n.hours||0,n.days||0];return t=m[d],e=m[c]+X(t,i),h=m[f]+X(e,r),l=m[a]+X(h,s),p=m[v]+X(l,u),m[d]=t%i,m[c]=e%r,m[f]=h%s,m[a]=l%u,m[v]=p,m}function X(n,t){var e=n/t;return e<0?Math.ceil(e):Math.floor(e)}function Y(n){if(n){var t=Z(M=W(n));return O=I+t.secondTenths*b[h]*A,M}}function Z(n,t){var e=t||{};return e.days=n[v],e.hours=e.days*u+n[a],e.minutes=e.hours*s+n[f],e.seconds=e.minutes*r+n[c],e.secondTenths=e.seconds*i+n[[d]],e}function $(){B(),_("stopped",z)}function _(n,t){E()?C.dispatchEvent(new CustomEvent(n,t)):T()&&C.emit(n,t)}function nn(){return L}function tn(){return U}void 0!==this&&(this.start=function(n){nn()||(G(n),_("started",z))},this.pause=function(){F(),U=!0,_("paused",z)},this.stop=$,this.reset=function(){B(),G(x),_("reset",z)},this.isRunning=nn,this.isPaused=tn,this.getTimeValues=function(){return n},this.getTotalTimeValues=function(){return e},this.getConfig=function(){return k},this.addEventListener=function(n,t){E()?C.addEventListener(n,t):T()&&C.on(n,t)},this.removeEventListener=function(n,t){E()?C.removeEventListener(n,t):T()&&C.removeListener(n,t)})}}); diff --git a/package-lock.json b/package-lock.json index f6ee59e..3870cad 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "easytimer.js", - "version": "2.2.0", + "version": "2.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 2dcd0e8..434830b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "easytimer.js", - "version": "2.2.0", + "version": "2.2.1", "description": "Timer/Chronometer/Countdown compatible with AMD and NodeJS", "main": "dist/easytimer.js", "repository": {