self-timer
Advanced tools
Comparing version 1.5.1 to 1.5.2
# self-timer.js Change log | ||
## version 1.5.1 [ 2017/06/12 ] | ||
## version 1.5.2 [ 2017/06/12 ] | ||
fixed `is.Mobile` method | ||
@@ -5,0 +5,0 @@ |
@@ -287,3 +287,3 @@ !function(e){function n(){}function t(e,n){return function(){e.apply(n,arguments)}}function o(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],s(e,this)}function i(e,n){for(;3===e._state;)e=e._value;return 0===e._state?void e._deferreds.push(n):(e._handled=!0,void o._immediateFn(function(){var t=1===e._state?n.onFulfilled:n.onRejected;if(null===t)return void(1===e._state?r:u)(n.promise,e._value);var o;try{o=t(e._value)}catch(i){return void u(n.promise,i)}r(n.promise,o)}))}function r(e,n){try{if(n===e)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var i=n.then;if(n instanceof o)return e._state=3,e._value=n,void f(e);if("function"==typeof i)return void s(t(i,n),e)}e._state=1,e._value=n,f(e)}catch(r){u(e,r)}}function u(e,n){e._state=2,e._value=n,f(e)}function f(e){2===e._state&&0===e._deferreds.length&&o._immediateFn(function(){e._handled||o._unhandledRejectionFn(e._value)});for(var n=0,t=e._deferreds.length;n<t;n++)i(e,e._deferreds[n]);e._deferreds=null}function c(e,n,t){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof n?n:null,this.promise=t}function s(e,n){var t=!1;try{e(function(e){t||(t=!0,r(n,e))},function(e){t||(t=!0,u(n,e))})}catch(o){if(t)return;t=!0,u(n,o)}}var a=setTimeout;o.prototype["catch"]=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var o=new this.constructor(n);return i(this,new c(e,t,o)),o},o.all=function(e){var n=Array.prototype.slice.call(e);return new o(function(e,t){function o(r,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var f=u.then;if("function"==typeof f)return void f.call(u,function(e){o(r,e)},t)}n[r]=u,0===--i&&e(n)}catch(c){t(c)}}if(0===n.length)return e([]);for(var i=n.length,r=0;r<n.length;r++)o(r,n[r])})},o.resolve=function(e){return e&&"object"==typeof e&&e.constructor===o?e:new o(function(n){n(e)})},o.reject=function(e){return new o(function(n,t){t(e)})},o.race=function(e){return new o(function(n,t){for(var o=0,i=e.length;o<i;o++)e[o].then(n,t)})},o._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){a(e,0)},o._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},o._setImmediateFn=function(e){o._immediateFn=e},o._setUnhandledRejectionFn=function(e){o._unhandledRejectionFn=e},"undefined"!=typeof module&&module.exports?module.exports=o:e.Promise||(e.Promise=o)}(this); | ||
return { | ||
version: "1.5.0", | ||
version: "1.5.2", | ||
method: { | ||
@@ -1085,3 +1085,3 @@ on: [ | ||
var agetnt = navigator.userAgent; | ||
var agent = navigator.userAgent; | ||
@@ -1088,0 +1088,0 @@ var mobile = ["Windows Phone", "iPad", "iPhone", "iPod", "Android"]; |
@@ -1,1 +0,1 @@ | ||
!function(e){function t(){}function r(e,t){return function(){e.apply(t,arguments)}}function n(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(e,this)}function o(e,t){for(;3===e._state;)e=e._value;return 0===e._state?void e._deferreds.push(t):(e._handled=!0,void n._immediateFn(function(){var r=1===e._state?t.onFulfilled:t.onRejected;if(null===r)return void(1===e._state?i:a)(t.promise,e._value);var n;try{n=r(e._value)}catch(e){return void a(t.promise,e)}i(t.promise,n)}))}function i(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var o=t.then;if(t instanceof n)return e._state=3,e._value=t,void u(e);if("function"==typeof o)return void c(r(o,t),e)}e._state=1,e._value=t,u(e)}catch(t){a(e,t)}}function a(e,t){e._state=2,e._value=t,u(e)}function u(e){2===e._state&&0===e._deferreds.length&&n._immediateFn(function(){e._handled||n._unhandledRejectionFn(e._value)});for(var t=0,r=e._deferreds.length;t<r;t++)o(e,e._deferreds[t]);e._deferreds=null}function s(e,t,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=r}function c(e,t){var r=!1;try{e(function(e){r||(r=!0,i(t,e))},function(e){r||(r=!0,a(t,e))})}catch(e){if(r)return;r=!0,a(t,e)}}var f=setTimeout;n.prototype.catch=function(e){return this.then(null,e)},n.prototype.then=function(e,r){var n=new this.constructor(t);return o(this,new s(e,r,n)),n},n.all=function(e){var t=Array.prototype.slice.call(e);return new n(function(e,r){function n(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,function(e){n(i,e)},r)}t[i]=a,0===--o&&e(t)}catch(e){r(e)}}if(0===t.length)return e([]);for(var o=t.length,i=0;i<t.length;i++)n(i,t[i])})},n.resolve=function(e){return e&&"object"==typeof e&&e.constructor===n?e:new n(function(t){t(e)})},n.reject=function(e){return new n(function(t,r){r(e)})},n.race=function(e){return new n(function(t,r){for(var n=0,o=e.length;n<o;n++)e[n].then(t,r)})},n._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){f(e,0)},n._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},n._setImmediateFn=function(e){n._immediateFn=e},n._setUnhandledRejectionFn=function(e){n._unhandledRejectionFn=e},"undefined"!=typeof module&&module.exports?module.exports=n:e.Promise||(e.Promise=n)}(this),function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():e.SelfTimer=t()}(this,function(){"use strict";function e(e){if("undefined"==typeof e)this.D=new Date;else{if(e instanceof Date==!1)return void console.error("'date' must be Date type.");this.D=e}}return e.prototype.helpers=function(){var e=this.D,t=(this.D.getDay(),function(e){return"function"==typeof e||void 0==e}),r=function(e,t){for(var r=e.length;r--;)if(e[r]===t)return!0;return!1},n=function(e,t){var r=!1;return e.indexOf(t)>=0&&(r=!0),r},o=function(e){return e.map(function(e){return e.replace(/Sun/g,0)}).map(function(e){return e.replace(/Mon/g,1)}).map(function(e){return e.replace(/Tue/g,2)}).map(function(e){return e.replace(/Wed/g,3)}).map(function(e){return e.replace(/Thu/g,4)}).map(function(e){return e.replace(/Fri/g,5)}).map(function(e){return e.replace(/Sat/g,6)}).map(function(e){return parseInt(e)})},i=function(e){var t=e.split(/:|\s/),r=new Date;return"pm"==t.pop().toLowerCase()&&(t[0]=+t[0]+12),r.setHours(+t.shift()),r.setMinutes(+t.shift()),r},a=function(e,t){1==arguments.length&&(t=e,e=0);for(var r=[],n=0;n<t;n++)r.push(e-n);return r},u=function(e,t,r){return r<t.setDate(t.getDate()+1)&&r>e},s=function(){var t=e.getMonth()+1,r=e.getDate();return t.length<2&&(t="0"+t),r.length<2&&(r="0"+r),[t,r].join("-")},c=function(e){var t;switch(e){case"s":case"sec":case"second":case"seconds":t=1e3;break;case"m":case"min":case"minute":case"minutes":t=6e4;break;default:t=!1}return t},f=function(){return"undefined"===navigator.userLanguage?navigator.userLanguage.toLowerCase():navigator.language.toLowerCase()},d=function(e){return e.map(function(e){return e.toLowerCase()})},h={__checkIsValid:t,__contains:r,__str_includes:n,__dayOfTheWeekStringToNumber:o,__timeObject:i,__range:a,__dateCompare:u,__dateString:s,__typeToMilliseconds:c,__detectLang:f,__arrayToLower:d};return h},e.prototype.messages=function(e){return{day:"Error: A day should be less than 31",month:"Error: month should be untll 12",date:"Error: date format shoud be MM-DD",year:"Error: date format shoud be 20YY",monthBetween:"Error: start of month should be less than end of month",startHour:"Error: start hour should be less than 23",endHour:"Error: end hour should be until 23",hourFormat:"Error: hours should be numberic",isNotValidHour:"Error: hour should be until 23",startDay:"Error: start day should be less than 30",endDay:"Error: end day should be untill 31",time:"Error: invalid time format. time should be [hh:mm AM or PM]",isNotArray:"Error: first argument shold be Array",dateGrater:"start date should not be grater than end-of -date",dateSameDay:"start and end date are should not be same date ",timeFormat:"Error: time of type formats",numFormat:"Error: num should be numberic",taskFormat:"Error: "+e+" should be object or function",notExist:"Error: "+e+" not exist",shouldBeFunction:"Error: "+e+" is shold be function",onlyBrowser:"Error: "+e+" is just supported web-browser"}},e.prototype.formats=function(){return{date:/^(1[0-2]|[1-9])-([1-9]|[12]\d|3[0-1])$/,year:/^[2][0][1-9]{2}$/,annual:/^[2]{1}[0]{1}[1-3]{1}[0-9]{1}-[01]{1}[0-9]{1}-[0-3]{1}[0-9]{1}$/,time:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/}},e.prototype.info=function(){return{version:"1.5.0",method:{on:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Weekdays","Weekend","Selects","Annual","DatesBetween","DatesContain"],at:["Between","Unless","Hour","HoursBetween","HourSelects"],in:["Day","Days","DaysBetween","Month","MonthSelects","Year"],is:["True","False","Language","Lang","LanguageSelects","LangSelects","LanguageExcepts","LangExcepts","Mobile"],timer:["After"]}}},e.prototype.on=function(e){var t=e,r=this.D,n=this.D.getDay(),o=this.messages(),i=this.helpers(),a=this.formats(),u=function(){return new Promise(function(e,r){return 0===n?e(!0):t===!0&&r(!1)})},s=function(){return new Promise(function(e,r){return 1===n?e(!0):t===!0&&r(!1)})},c=function(){return new Promise(function(e,r){return 2===n?e(!0):t===!0&&r(!1)})},f=function(){return new Promise(function(e,r){return 3===n?e(!0):t===!0&&r(!1)})},d=function(){return new Promise(function(e,r){return 4===n?e(!0):t===!0&&r(!1)})},h=function(){return new Promise(function(e,r){return 5===n?e(!0):t===!0&&r(!1)})},l=function(){return new Promise(function(e,r){return 6===n?e(!0):t===!0&&r(!1)})},m=function(e){return new Promise(function(r,a){try{if(!Array.isArray(e))throw o.isNotArray;var u=i.__dayOfTheWeekStringToNumber(e);return i.__contains(u,n)?r(!0):t===!0&&a(!1)}catch(e){return void console.error(e)}})},y=function(){return new Promise(function(e,r){var o=[1,2,3,4,5];return i.__contains(o,n)?e(!0):t===!0&&r(!1)})},w=function(){return new Promise(function(e,r){var o=[0,6];return i.__contains(o,n)?e(!0):t===!0&&r(!1)})},_=function(e){return new Promise(function(r,n){try{if(!e.match(a.date))throw o.date;return e==i.__dateString()?r(!0):t===!0&&n(!1)}catch(e){return void console.error(e)}})},p=function(e,n){return new Promise(function(a,u){var s=new Date(e),c=new Date(n);try{if(s>c)throw o.dateGrater;if(s==c)throw o.dateSameDay;return i.__dateCompare(s,c,r)?a(!0):t===!0&&u(!1)}catch(e){return void console.error(e)}})},g=function(e){return new Promise(function(n,a){try{if(!Array.isArray(e))throw o.isNotArray;return i.__contains(e,r.toISOString().slice(0,10))?n(!0):t===!0&&a(!1)}catch(e){return void console.error(e)}})},v={Sunday:u,Monday:s,Tuesday:c,Wednesday:f,Thursday:d,Friday:h,Saturday:l,Selects:m,Weekdays:y,Weekend:w,Annual:_,DatesBetween:p,DatesContain:g};return v},e.prototype.at=function(e){var t=e,r=this.D,n=(this.D.getDay(),this.D.getHours()),o=this.messages(),i=this.helpers(),a=this.formats(),u=function(e,n){return new Promise(function(u,s){try{if(!e.match(a.time))throw o.time+"at start";if(!n.match(a.time))throw o.time+" at end";var c=r<i.__timeObject(n)&&r>i.__timeObject(e);return c?u(!0):t===!0&&s(!1)}catch(e){return void console.error(e)}})},s=function(e,n){return new Promise(function(u,s){try{if(!e.match(a.time))throw o.time+"at start";if(!n.match(a.time))throw o.time+" at end";var c=r<i.__timeObject(n)&&r>i.__timeObject(e);return c?t===!0&&s(!1):u(!0)}catch(e){return void console.error(e)}})},c=function(e){return new Promise(function(r,i){var a=parseInt(e);try{if(a>23)throw o.startHour;return a===n?r(!0):t===!0&&i(!1)}catch(e){return void console.error(e)}})},f=function(e,r){return new Promise(function(a,u){var s=parseInt(e),c=parseInt(r);try{if(s>23)throw o.startHour;if(c>23)throw o.endHour;var f=i.__range(c,c-s);return f.push(e),i.__contains(f,n)?a(!0):t===!0&&u(!1)}catch(e){return void console.error(e)}})},d=function(e,r){return new Promise(function(r,a){try{if(!Array.isArray(e))throw o.isNotArray;if(1!=!e.some(isNaN))throw o.hourFormat;var u=e.map(function(e){return parseInt(e)});return u.map(function(e){if(e>23)throw o.isNotValidHour}),i.__contains(u,n)?r(!0):t===!0&&a(!1)}catch(e){return void console.error(e)}})},h={Between:u,Unless:s,Hour:c,HoursBetween:f,HourSelects:d};return h},e.prototype.in=function(e){var t=e,r=this.messages(),n=this.helpers(),o=this.formats(),i=(this.D,this.D.getDate()),a=this.D.getMonth()+1,u=this.D.getFullYear(),s=function(e){return new Promise(function(r,n){try{if(parseInt(e)>31)throw __msg.day;return e==i?r(!0):t===!0&&n(!1)}catch(e){return void console.error(e)}})},c=function(e){return new Promise(function(o,a){try{if(!Array.isArray(e))throw r.isNotArray;var u=e.map(function(e){return parseInt(e)});return n.__contains(u,i)?o(!0):t===!0&&a(!1)}catch(e){return void console.error(e)}})},f=function(e,o){return new Promise(function(a,u){try{var s=parseInt(e),c=parseInt(o);if(s>30)throw r.startDay;if(c>31)throw r.endDay;var f=n.__range(c,c-s);return f.push(e),n.__contains(f,i)?a(!0):t===!0&&u(!1)}catch(e){return void console.error(e)}})},d=function(e){return new Promise(function(n,o){try{if(parseInt(e)>12)throw r.month;var i=e<10?"0"+e:e;return i==a?n(!0):t===!0&&o(!1)}catch(e){return void console.error(e)}})},h=function(e){return new Promise(function(o,i){try{if(!Array.isArray(e))throw r.isNotArray;return n.__contains(e,a)?o(!0):t===!0&&i(!1)}catch(e){return void console.error(e)}})},l=function(e){return new Promise(function(n,i){try{if(!e.toString().match(o.year))throw r.year;return e==u?n(!0):t===!0&&i(!1)}catch(e){return void console.error(e)}})},m={Day:s,Days:c,DaysBetween:f,Month:d,MonthSelects:h,Year:l};return m},e.prototype.is=function(e){var t=e,r=this.helpers(),n=this.messages(),o=function(e){return new Promise(function(r,n){return e?r(!0):t===!0&&n(!1)})},i=function(e){return new Promise(function(r,n){return e?t===!0&&n(!1):r(!0)})},a=function(e){return new Promise(function(n,o){try{if("undefined"==typeof window)throw this.messages("Language").onlyBrowser;return e.toLowerCase()==r.__detectLang()?n(!0):t===!0&&o(!1)}catch(e){return void console.error(e)}})},u=function(e){return new Promise(function(n,o){try{if("undefined"==typeof window)throw this.messages("Language").onlyBrowser;var i=r.__detectLang();return e.toLowerCase()==i.slice(0,2)?n(!0):t===!0&&o(!1)}catch(e){return void console.error(e)}})},s=function(e){return new Promise(function(o,i){try{if("undefined"==typeof window)throw this.messages("LanguageSelects").onlyBrowser;if(!Array.isArray(e))throw n.isNotArray;return r.__contains(r.__arrayToLower(e),r.__detectLang())?o(!0):t===!0&&i(!1)}catch(e){return void console.error(e)}})},c=function(e){return new Promise(function(o,i){try{if("undefined"==typeof window)throw this.messages("LangSelects").onlyBrowser;if(!Array.isArray(e))throw n.isNotArray;var a=r.__detectLang();return r.__contains(r.__arrayToLower(e),a.slice(0,2))?o(!0):t===!0&&i(!1)}catch(e){return void console.error(e)}})},f=function(e){return new Promise(function(o,i){try{if("undefined"==typeof window)throw this.messages("LanguageExcepts").onlyBrowser;if(!Array.isArray(e))throw n.isNotArray;return r.__contains(r.__arrayToLower(e),r.__detectLang())?t===!0&&i(!1):o(!0)}catch(e){return void console.error(e)}})},d=function(e){return new Promise(function(o,i){try{if("undefined"==typeof window)throw this.messages("LangExcepts").onlyBrowser;if(!Array.isArray(e))throw n.isNotArray;var a=r.__detectLang();return r.__contains(r.__arrayToLower(e),a.slice(0,2))?t===!0&&i(!1):o(!0)}catch(e){return void console.error(e)}})},h=function(){return new Promise(function(e,n){if("undefined"==typeof window)throw this.messages("Mobile").onlyBrowser;for(var o=(navigator.userAgent,["Windows Phone","iPad","iPhone","iPod","Android"]),i=[],a=0;a<o.length;a++)i.push(r.__str_includes(agent,o[a]));return i.indexOf(!0)!=-1?e(!0):t===!0&&n(!1)})},l={True:o,False:i,Language:a,Lang:u,LanguageSelects:s,LangSelects:c,LanguageExcepts:f,LangExcepts:d,Mobile:h};return l},e.prototype.timer=function(){var e=this.messages(),t=this.helpers(),r=function(r,n,o){return new Promise(function(i){var a=t.__typeToMilliseconds(r),u=typeof o;try{if(!a)throw e.timeFormat;if(isNaN(n))throw e.numFormat;if(0===n||"0"===n)throw e.numFormat;if(!t.__contains(["object","function","undefined"],u))throw this.messages("type").taskFormat;if("object"===u){if(!("before"in o))throw this.messages("key:before").notExist;if("function"!=typeof o.before)throw this.messages("before").shouldBeFunction;return o.before(),setTimeout(function(){return i(!0)},n*a)}return setTimeout(function(){return i(!0)},n*a)}catch(e){return void console.error(e)}})},n={After:r};return n},e}); | ||
!function(e){function t(){}function r(e,t){return function(){e.apply(t,arguments)}}function n(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],c(e,this)}function o(e,t){for(;3===e._state;)e=e._value;return 0===e._state?void e._deferreds.push(t):(e._handled=!0,void n._immediateFn(function(){var r=1===e._state?t.onFulfilled:t.onRejected;if(null===r)return void(1===e._state?i:a)(t.promise,e._value);var n;try{n=r(e._value)}catch(e){return void a(t.promise,e)}i(t.promise,n)}))}function i(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var o=t.then;if(t instanceof n)return e._state=3,e._value=t,void u(e);if("function"==typeof o)return void c(r(o,t),e)}e._state=1,e._value=t,u(e)}catch(t){a(e,t)}}function a(e,t){e._state=2,e._value=t,u(e)}function u(e){2===e._state&&0===e._deferreds.length&&n._immediateFn(function(){e._handled||n._unhandledRejectionFn(e._value)});for(var t=0,r=e._deferreds.length;t<r;t++)o(e,e._deferreds[t]);e._deferreds=null}function s(e,t,r){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=r}function c(e,t){var r=!1;try{e(function(e){r||(r=!0,i(t,e))},function(e){r||(r=!0,a(t,e))})}catch(e){if(r)return;r=!0,a(t,e)}}var f=setTimeout;n.prototype.catch=function(e){return this.then(null,e)},n.prototype.then=function(e,r){var n=new this.constructor(t);return o(this,new s(e,r,n)),n},n.all=function(e){var t=Array.prototype.slice.call(e);return new n(function(e,r){function n(i,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var u=a.then;if("function"==typeof u)return void u.call(a,function(e){n(i,e)},r)}t[i]=a,0===--o&&e(t)}catch(e){r(e)}}if(0===t.length)return e([]);for(var o=t.length,i=0;i<t.length;i++)n(i,t[i])})},n.resolve=function(e){return e&&"object"==typeof e&&e.constructor===n?e:new n(function(t){t(e)})},n.reject=function(e){return new n(function(t,r){r(e)})},n.race=function(e){return new n(function(t,r){for(var n=0,o=e.length;n<o;n++)e[n].then(t,r)})},n._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){f(e,0)},n._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},n._setImmediateFn=function(e){n._immediateFn=e},n._setUnhandledRejectionFn=function(e){n._unhandledRejectionFn=e},"undefined"!=typeof module&&module.exports?module.exports=n:e.Promise||(e.Promise=n)}(this),function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():e.SelfTimer=t()}(this,function(){"use strict";function e(e){if("undefined"==typeof e)this.D=new Date;else{if(e instanceof Date==!1)return void console.error("'date' must be Date type.");this.D=e}}return e.prototype.helpers=function(){var e=this.D,t=(this.D.getDay(),function(e){return"function"==typeof e||void 0==e}),r=function(e,t){for(var r=e.length;r--;)if(e[r]===t)return!0;return!1},n=function(e,t){var r=!1;return e.indexOf(t)>=0&&(r=!0),r},o=function(e){return e.map(function(e){return e.replace(/Sun/g,0)}).map(function(e){return e.replace(/Mon/g,1)}).map(function(e){return e.replace(/Tue/g,2)}).map(function(e){return e.replace(/Wed/g,3)}).map(function(e){return e.replace(/Thu/g,4)}).map(function(e){return e.replace(/Fri/g,5)}).map(function(e){return e.replace(/Sat/g,6)}).map(function(e){return parseInt(e)})},i=function(e){var t=e.split(/:|\s/),r=new Date;return"pm"==t.pop().toLowerCase()&&(t[0]=+t[0]+12),r.setHours(+t.shift()),r.setMinutes(+t.shift()),r},a=function(e,t){1==arguments.length&&(t=e,e=0);for(var r=[],n=0;n<t;n++)r.push(e-n);return r},u=function(e,t,r){return r<t.setDate(t.getDate()+1)&&r>e},s=function(){var t=e.getMonth()+1,r=e.getDate();return t.length<2&&(t="0"+t),r.length<2&&(r="0"+r),[t,r].join("-")},c=function(e){var t;switch(e){case"s":case"sec":case"second":case"seconds":t=1e3;break;case"m":case"min":case"minute":case"minutes":t=6e4;break;default:t=!1}return t},f=function(){return"undefined"===navigator.userLanguage?navigator.userLanguage.toLowerCase():navigator.language.toLowerCase()},d=function(e){return e.map(function(e){return e.toLowerCase()})},h={__checkIsValid:t,__contains:r,__str_includes:n,__dayOfTheWeekStringToNumber:o,__timeObject:i,__range:a,__dateCompare:u,__dateString:s,__typeToMilliseconds:c,__detectLang:f,__arrayToLower:d};return h},e.prototype.messages=function(e){return{day:"Error: A day should be less than 31",month:"Error: month should be untll 12",date:"Error: date format shoud be MM-DD",year:"Error: date format shoud be 20YY",monthBetween:"Error: start of month should be less than end of month",startHour:"Error: start hour should be less than 23",endHour:"Error: end hour should be until 23",hourFormat:"Error: hours should be numberic",isNotValidHour:"Error: hour should be until 23",startDay:"Error: start day should be less than 30",endDay:"Error: end day should be untill 31",time:"Error: invalid time format. time should be [hh:mm AM or PM]",isNotArray:"Error: first argument shold be Array",dateGrater:"start date should not be grater than end-of -date",dateSameDay:"start and end date are should not be same date ",timeFormat:"Error: time of type formats",numFormat:"Error: num should be numberic",taskFormat:"Error: "+e+" should be object or function",notExist:"Error: "+e+" not exist",shouldBeFunction:"Error: "+e+" is shold be function",onlyBrowser:"Error: "+e+" is just supported web-browser"}},e.prototype.formats=function(){return{date:/^(1[0-2]|[1-9])-([1-9]|[12]\d|3[0-1])$/,year:/^[2][0][1-9]{2}$/,annual:/^[2]{1}[0]{1}[1-3]{1}[0-9]{1}-[01]{1}[0-9]{1}-[0-3]{1}[0-9]{1}$/,time:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/}},e.prototype.info=function(){return{version:"1.5.2",method:{on:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Weekdays","Weekend","Selects","Annual","DatesBetween","DatesContain"],at:["Between","Unless","Hour","HoursBetween","HourSelects"],in:["Day","Days","DaysBetween","Month","MonthSelects","Year"],is:["True","False","Language","Lang","LanguageSelects","LangSelects","LanguageExcepts","LangExcepts","Mobile"],timer:["After"]}}},e.prototype.on=function(e){var t=e,r=this.D,n=this.D.getDay(),o=this.messages(),i=this.helpers(),a=this.formats(),u=function(){return new Promise(function(e,r){return 0===n?e(!0):t===!0&&r(!1)})},s=function(){return new Promise(function(e,r){return 1===n?e(!0):t===!0&&r(!1)})},c=function(){return new Promise(function(e,r){return 2===n?e(!0):t===!0&&r(!1)})},f=function(){return new Promise(function(e,r){return 3===n?e(!0):t===!0&&r(!1)})},d=function(){return new Promise(function(e,r){return 4===n?e(!0):t===!0&&r(!1)})},h=function(){return new Promise(function(e,r){return 5===n?e(!0):t===!0&&r(!1)})},l=function(){return new Promise(function(e,r){return 6===n?e(!0):t===!0&&r(!1)})},m=function(e){return new Promise(function(r,a){try{if(!Array.isArray(e))throw o.isNotArray;var u=i.__dayOfTheWeekStringToNumber(e);return i.__contains(u,n)?r(!0):t===!0&&a(!1)}catch(e){return void console.error(e)}})},y=function(){return new Promise(function(e,r){var o=[1,2,3,4,5];return i.__contains(o,n)?e(!0):t===!0&&r(!1)})},w=function(){return new Promise(function(e,r){var o=[0,6];return i.__contains(o,n)?e(!0):t===!0&&r(!1)})},_=function(e){return new Promise(function(r,n){try{if(!e.match(a.date))throw o.date;return e==i.__dateString()?r(!0):t===!0&&n(!1)}catch(e){return void console.error(e)}})},p=function(e,n){return new Promise(function(a,u){var s=new Date(e),c=new Date(n);try{if(s>c)throw o.dateGrater;if(s==c)throw o.dateSameDay;return i.__dateCompare(s,c,r)?a(!0):t===!0&&u(!1)}catch(e){return void console.error(e)}})},g=function(e){return new Promise(function(n,a){try{if(!Array.isArray(e))throw o.isNotArray;return i.__contains(e,r.toISOString().slice(0,10))?n(!0):t===!0&&a(!1)}catch(e){return void console.error(e)}})},v={Sunday:u,Monday:s,Tuesday:c,Wednesday:f,Thursday:d,Friday:h,Saturday:l,Selects:m,Weekdays:y,Weekend:w,Annual:_,DatesBetween:p,DatesContain:g};return v},e.prototype.at=function(e){var t=e,r=this.D,n=(this.D.getDay(),this.D.getHours()),o=this.messages(),i=this.helpers(),a=this.formats(),u=function(e,n){return new Promise(function(u,s){try{if(!e.match(a.time))throw o.time+"at start";if(!n.match(a.time))throw o.time+" at end";var c=r<i.__timeObject(n)&&r>i.__timeObject(e);return c?u(!0):t===!0&&s(!1)}catch(e){return void console.error(e)}})},s=function(e,n){return new Promise(function(u,s){try{if(!e.match(a.time))throw o.time+"at start";if(!n.match(a.time))throw o.time+" at end";var c=r<i.__timeObject(n)&&r>i.__timeObject(e);return c?t===!0&&s(!1):u(!0)}catch(e){return void console.error(e)}})},c=function(e){return new Promise(function(r,i){var a=parseInt(e);try{if(a>23)throw o.startHour;return a===n?r(!0):t===!0&&i(!1)}catch(e){return void console.error(e)}})},f=function(e,r){return new Promise(function(a,u){var s=parseInt(e),c=parseInt(r);try{if(s>23)throw o.startHour;if(c>23)throw o.endHour;var f=i.__range(c,c-s);return f.push(e),i.__contains(f,n)?a(!0):t===!0&&u(!1)}catch(e){return void console.error(e)}})},d=function(e,r){return new Promise(function(r,a){try{if(!Array.isArray(e))throw o.isNotArray;if(1!=!e.some(isNaN))throw o.hourFormat;var u=e.map(function(e){return parseInt(e)});return u.map(function(e){if(e>23)throw o.isNotValidHour}),i.__contains(u,n)?r(!0):t===!0&&a(!1)}catch(e){return void console.error(e)}})},h={Between:u,Unless:s,Hour:c,HoursBetween:f,HourSelects:d};return h},e.prototype.in=function(e){var t=e,r=this.messages(),n=this.helpers(),o=this.formats(),i=(this.D,this.D.getDate()),a=this.D.getMonth()+1,u=this.D.getFullYear(),s=function(e){return new Promise(function(r,n){try{if(parseInt(e)>31)throw __msg.day;return e==i?r(!0):t===!0&&n(!1)}catch(e){return void console.error(e)}})},c=function(e){return new Promise(function(o,a){try{if(!Array.isArray(e))throw r.isNotArray;var u=e.map(function(e){return parseInt(e)});return n.__contains(u,i)?o(!0):t===!0&&a(!1)}catch(e){return void console.error(e)}})},f=function(e,o){return new Promise(function(a,u){try{var s=parseInt(e),c=parseInt(o);if(s>30)throw r.startDay;if(c>31)throw r.endDay;var f=n.__range(c,c-s);return f.push(e),n.__contains(f,i)?a(!0):t===!0&&u(!1)}catch(e){return void console.error(e)}})},d=function(e){return new Promise(function(n,o){try{if(parseInt(e)>12)throw r.month;var i=e<10?"0"+e:e;return i==a?n(!0):t===!0&&o(!1)}catch(e){return void console.error(e)}})},h=function(e){return new Promise(function(o,i){try{if(!Array.isArray(e))throw r.isNotArray;return n.__contains(e,a)?o(!0):t===!0&&i(!1)}catch(e){return void console.error(e)}})},l=function(e){return new Promise(function(n,i){try{if(!e.toString().match(o.year))throw r.year;return e==u?n(!0):t===!0&&i(!1)}catch(e){return void console.error(e)}})},m={Day:s,Days:c,DaysBetween:f,Month:d,MonthSelects:h,Year:l};return m},e.prototype.is=function(e){var t=e,r=this.helpers(),n=this.messages(),o=function(e){return new Promise(function(r,n){return e?r(!0):t===!0&&n(!1)})},i=function(e){return new Promise(function(r,n){return e?t===!0&&n(!1):r(!0)})},a=function(e){return new Promise(function(n,o){try{if("undefined"==typeof window)throw this.messages("Language").onlyBrowser;return e.toLowerCase()==r.__detectLang()?n(!0):t===!0&&o(!1)}catch(e){return void console.error(e)}})},u=function(e){return new Promise(function(n,o){try{if("undefined"==typeof window)throw this.messages("Language").onlyBrowser;var i=r.__detectLang();return e.toLowerCase()==i.slice(0,2)?n(!0):t===!0&&o(!1)}catch(e){return void console.error(e)}})},s=function(e){return new Promise(function(o,i){try{if("undefined"==typeof window)throw this.messages("LanguageSelects").onlyBrowser;if(!Array.isArray(e))throw n.isNotArray;return r.__contains(r.__arrayToLower(e),r.__detectLang())?o(!0):t===!0&&i(!1)}catch(e){return void console.error(e)}})},c=function(e){return new Promise(function(o,i){try{if("undefined"==typeof window)throw this.messages("LangSelects").onlyBrowser;if(!Array.isArray(e))throw n.isNotArray;var a=r.__detectLang();return r.__contains(r.__arrayToLower(e),a.slice(0,2))?o(!0):t===!0&&i(!1)}catch(e){return void console.error(e)}})},f=function(e){return new Promise(function(o,i){try{if("undefined"==typeof window)throw this.messages("LanguageExcepts").onlyBrowser;if(!Array.isArray(e))throw n.isNotArray;return r.__contains(r.__arrayToLower(e),r.__detectLang())?t===!0&&i(!1):o(!0)}catch(e){return void console.error(e)}})},d=function(e){return new Promise(function(o,i){try{if("undefined"==typeof window)throw this.messages("LangExcepts").onlyBrowser;if(!Array.isArray(e))throw n.isNotArray;var a=r.__detectLang();return r.__contains(r.__arrayToLower(e),a.slice(0,2))?t===!0&&i(!1):o(!0)}catch(e){return void console.error(e)}})},h=function(){return new Promise(function(e,n){if("undefined"==typeof window)throw this.messages("Mobile").onlyBrowser;for(var o=navigator.userAgent,i=["Windows Phone","iPad","iPhone","iPod","Android"],a=[],u=0;u<i.length;u++)a.push(r.__str_includes(o,i[u]));return a.indexOf(!0)!=-1?e(!0):t===!0&&n(!1)})},l={True:o,False:i,Language:a,Lang:u,LanguageSelects:s,LangSelects:c,LanguageExcepts:f,LangExcepts:d,Mobile:h};return l},e.prototype.timer=function(){var e=this.messages(),t=this.helpers(),r=function(r,n,o){return new Promise(function(i){var a=t.__typeToMilliseconds(r),u=typeof o;try{if(!a)throw e.timeFormat;if(isNaN(n))throw e.numFormat;if(0===n||"0"===n)throw e.numFormat;if(!t.__contains(["object","function","undefined"],u))throw this.messages("type").taskFormat;if("object"===u){if(!("before"in o))throw this.messages("key:before").notExist;if("function"!=typeof o.before)throw this.messages("before").shouldBeFunction;return o.before(),setTimeout(function(){return i(!0)},n*a)}return setTimeout(function(){return i(!0)},n*a)}catch(e){return void console.error(e)}})},n={After:r};return n},e}); |
@@ -286,3 +286,3 @@ ;(function(root, factory) { | ||
return { | ||
version: "1.5.0", | ||
version: "1.5.2", | ||
method: { | ||
@@ -1084,3 +1084,3 @@ on: [ | ||
var agetnt = navigator.userAgent; | ||
var agent = navigator.userAgent; | ||
@@ -1087,0 +1087,0 @@ var mobile = ["Windows Phone", "iPad", "iPhone", "iPod", "Android"]; |
@@ -1,1 +0,1 @@ | ||
!function(r,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():r.SelfTimer=e()}(this,function(){"use strict";function r(r){if("undefined"==typeof r)this.D=new Date;else{if(r instanceof Date==!1)return void console.error("'date' must be Date type.");this.D=r}}return r.prototype.helpers=function(){var r=this.D,e=(this.D.getDay(),function(r){return"function"==typeof r||void 0==r}),t=function(r,e){for(var t=r.length;t--;)if(r[t]===e)return!0;return!1},n=function(r,e){var t=!1;return r.indexOf(e)>=0&&(t=!0),t},o=function(r){return r.map(function(r){return r.replace(/Sun/g,0)}).map(function(r){return r.replace(/Mon/g,1)}).map(function(r){return r.replace(/Tue/g,2)}).map(function(r){return r.replace(/Wed/g,3)}).map(function(r){return r.replace(/Thu/g,4)}).map(function(r){return r.replace(/Fri/g,5)}).map(function(r){return r.replace(/Sat/g,6)}).map(function(r){return parseInt(r)})},i=function(r){var e=r.split(/:|\s/),t=new Date;return"pm"==e.pop().toLowerCase()&&(e[0]=+e[0]+12),t.setHours(+e.shift()),t.setMinutes(+e.shift()),t},a=function(r,e){1==arguments.length&&(e=r,r=0);for(var t=[],n=0;n<e;n++)t.push(r-n);return t},s=function(r,e,t){return t<e.setDate(e.getDate()+1)&&t>r},u=function(){var e=r.getMonth()+1,t=r.getDate();return e.length<2&&(e="0"+e),t.length<2&&(t="0"+t),[e,t].join("-")},c=function(r){var e;switch(r){case"s":case"sec":case"second":case"seconds":e=1e3;break;case"m":case"min":case"minute":case"minutes":e=6e4;break;default:e=!1}return e},f=function(){return"undefined"===navigator.userLanguage?navigator.userLanguage.toLowerCase():navigator.language.toLowerCase()},h=function(r){return r.map(function(r){return r.toLowerCase()})},d={__checkIsValid:e,__contains:t,__str_includes:n,__dayOfTheWeekStringToNumber:o,__timeObject:i,__range:a,__dateCompare:s,__dateString:u,__typeToMilliseconds:c,__detectLang:f,__arrayToLower:h};return d},r.prototype.messages=function(r){return{day:"Error: A day should be less than 31",month:"Error: month should be untll 12",date:"Error: date format shoud be MM-DD",year:"Error: date format shoud be 20YY",monthBetween:"Error: start of month should be less than end of month",startHour:"Error: start hour should be less than 23",endHour:"Error: end hour should be until 23",hourFormat:"Error: hours should be numberic",isNotValidHour:"Error: hour should be until 23",startDay:"Error: start day should be less than 30",endDay:"Error: end day should be untill 31",time:"Error: invalid time format. time should be [hh:mm AM or PM]",isNotArray:"Error: first argument shold be Array",dateGrater:"start date should not be grater than end-of -date",dateSameDay:"start and end date are should not be same date ",timeFormat:"Error: time of type formats",numFormat:"Error: num should be numberic",taskFormat:"Error: "+r+" should be object or function",notExist:"Error: "+r+" not exist",shouldBeFunction:"Error: "+r+" is shold be function",onlyBrowser:"Error: "+r+" is just supported web-browser"}},r.prototype.formats=function(){return{date:/^(1[0-2]|[1-9])-([1-9]|[12]\d|3[0-1])$/,year:/^[2][0][1-9]{2}$/,annual:/^[2]{1}[0]{1}[1-3]{1}[0-9]{1}-[01]{1}[0-9]{1}-[0-3]{1}[0-9]{1}$/,time:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/}},r.prototype.info=function(){return{version:"1.5.0",method:{on:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Weekdays","Weekend","Selects","Annual","DatesBetween","DatesContain"],at:["Between","Unless","Hour","HoursBetween","HourSelects"],in:["Day","Days","DaysBetween","Month","MonthSelects","Year"],is:["True","False","Language","Lang","LanguageSelects","LangSelects","LanguageExcepts","LangExcepts","Mobile"],timer:["After"]}}},r.prototype.on=function(r){var e=r,t=this.D,n=this.D.getDay(),o=this.messages(),i=this.helpers(),a=this.formats(),s=function(){return new Promise(function(r,t){return 0===n?r(!0):e===!0&&t(!1)})},u=function(){return new Promise(function(r,t){return 1===n?r(!0):e===!0&&t(!1)})},c=function(){return new Promise(function(r,t){return 2===n?r(!0):e===!0&&t(!1)})},f=function(){return new Promise(function(r,t){return 3===n?r(!0):e===!0&&t(!1)})},h=function(){return new Promise(function(r,t){return 4===n?r(!0):e===!0&&t(!1)})},d=function(){return new Promise(function(r,t){return 5===n?r(!0):e===!0&&t(!1)})},m=function(){return new Promise(function(r,t){return 6===n?r(!0):e===!0&&t(!1)})},y=function(r){return new Promise(function(t,a){try{if(!Array.isArray(r))throw o.isNotArray;var s=i.__dayOfTheWeekStringToNumber(r);return i.__contains(s,n)?t(!0):e===!0&&a(!1)}catch(r){return void console.error(r)}})},w=function(){return new Promise(function(r,t){var o=[1,2,3,4,5];return i.__contains(o,n)?r(!0):e===!0&&t(!1)})},l=function(){return new Promise(function(r,t){var o=[0,6];return i.__contains(o,n)?r(!0):e===!0&&t(!1)})},g=function(r){return new Promise(function(t,n){try{if(!r.match(a.date))throw o.date;return r==i.__dateString()?t(!0):e===!0&&n(!1)}catch(r){return void console.error(r)}})},_=function(r,n){return new Promise(function(a,s){var u=new Date(r),c=new Date(n);try{if(u>c)throw o.dateGrater;if(u==c)throw o.dateSameDay;return i.__dateCompare(u,c,t)?a(!0):e===!0&&s(!1)}catch(r){return void console.error(r)}})},p=function(r){return new Promise(function(n,a){try{if(!Array.isArray(r))throw o.isNotArray;return i.__contains(r,t.toISOString().slice(0,10))?n(!0):e===!0&&a(!1)}catch(r){return void console.error(r)}})},v={Sunday:s,Monday:u,Tuesday:c,Wednesday:f,Thursday:h,Friday:d,Saturday:m,Selects:y,Weekdays:w,Weekend:l,Annual:g,DatesBetween:_,DatesContain:p};return v},r.prototype.at=function(r){var e=r,t=this.D,n=(this.D.getDay(),this.D.getHours()),o=this.messages(),i=this.helpers(),a=this.formats(),s=function(r,n){return new Promise(function(s,u){try{if(!r.match(a.time))throw o.time+"at start";if(!n.match(a.time))throw o.time+" at end";var c=t<i.__timeObject(n)&&t>i.__timeObject(r);return c?s(!0):e===!0&&u(!1)}catch(r){return void console.error(r)}})},u=function(r,n){return new Promise(function(s,u){try{if(!r.match(a.time))throw o.time+"at start";if(!n.match(a.time))throw o.time+" at end";var c=t<i.__timeObject(n)&&t>i.__timeObject(r);return c?e===!0&&u(!1):s(!0)}catch(r){return void console.error(r)}})},c=function(r){return new Promise(function(t,i){var a=parseInt(r);try{if(a>23)throw o.startHour;return a===n?t(!0):e===!0&&i(!1)}catch(r){return void console.error(r)}})},f=function(r,t){return new Promise(function(a,s){var u=parseInt(r),c=parseInt(t);try{if(u>23)throw o.startHour;if(c>23)throw o.endHour;var f=i.__range(c,c-u);return f.push(r),i.__contains(f,n)?a(!0):e===!0&&s(!1)}catch(r){return void console.error(r)}})},h=function(r,t){return new Promise(function(t,a){try{if(!Array.isArray(r))throw o.isNotArray;if(1!=!r.some(isNaN))throw o.hourFormat;var s=r.map(function(r){return parseInt(r)});return s.map(function(r){if(r>23)throw o.isNotValidHour}),i.__contains(s,n)?t(!0):e===!0&&a(!1)}catch(r){return void console.error(r)}})},d={Between:s,Unless:u,Hour:c,HoursBetween:f,HourSelects:h};return d},r.prototype.in=function(r){var e=r,t=this.messages(),n=this.helpers(),o=this.formats(),i=(this.D,this.D.getDate()),a=this.D.getMonth()+1,s=this.D.getFullYear(),u=function(r){return new Promise(function(t,n){try{if(parseInt(r)>31)throw __msg.day;return r==i?t(!0):e===!0&&n(!1)}catch(r){return void console.error(r)}})},c=function(r){return new Promise(function(o,a){try{if(!Array.isArray(r))throw t.isNotArray;var s=r.map(function(r){return parseInt(r)});return n.__contains(s,i)?o(!0):e===!0&&a(!1)}catch(r){return void console.error(r)}})},f=function(r,o){return new Promise(function(a,s){try{var u=parseInt(r),c=parseInt(o);if(u>30)throw t.startDay;if(c>31)throw t.endDay;var f=n.__range(c,c-u);return f.push(r),n.__contains(f,i)?a(!0):e===!0&&s(!1)}catch(r){return void console.error(r)}})},h=function(r){return new Promise(function(n,o){try{if(parseInt(r)>12)throw t.month;var i=r<10?"0"+r:r;return i==a?n(!0):e===!0&&o(!1)}catch(r){return void console.error(r)}})},d=function(r){return new Promise(function(o,i){try{if(!Array.isArray(r))throw t.isNotArray;return n.__contains(r,a)?o(!0):e===!0&&i(!1)}catch(r){return void console.error(r)}})},m=function(r){return new Promise(function(n,i){try{if(!r.toString().match(o.year))throw t.year;return r==s?n(!0):e===!0&&i(!1)}catch(r){return void console.error(r)}})},y={Day:u,Days:c,DaysBetween:f,Month:h,MonthSelects:d,Year:m};return y},r.prototype.is=function(r){var e=r,t=this.helpers(),n=this.messages(),o=function(r){return new Promise(function(t,n){return r?t(!0):e===!0&&n(!1)})},i=function(r){return new Promise(function(t,n){return r?e===!0&&n(!1):t(!0)})},a=function(r){return new Promise(function(n,o){try{if("undefined"==typeof window)throw this.messages("Language").onlyBrowser;return r.toLowerCase()==t.__detectLang()?n(!0):e===!0&&o(!1)}catch(r){return void console.error(r)}})},s=function(r){return new Promise(function(n,o){try{if("undefined"==typeof window)throw this.messages("Language").onlyBrowser;var i=t.__detectLang();return r.toLowerCase()==i.slice(0,2)?n(!0):e===!0&&o(!1)}catch(r){return void console.error(r)}})},u=function(r){return new Promise(function(o,i){try{if("undefined"==typeof window)throw this.messages("LanguageSelects").onlyBrowser;if(!Array.isArray(r))throw n.isNotArray;return t.__contains(t.__arrayToLower(r),t.__detectLang())?o(!0):e===!0&&i(!1)}catch(r){return void console.error(r)}})},c=function(r){return new Promise(function(o,i){try{if("undefined"==typeof window)throw this.messages("LangSelects").onlyBrowser;if(!Array.isArray(r))throw n.isNotArray;var a=t.__detectLang();return t.__contains(t.__arrayToLower(r),a.slice(0,2))?o(!0):e===!0&&i(!1)}catch(r){return void console.error(r)}})},f=function(r){return new Promise(function(o,i){try{if("undefined"==typeof window)throw this.messages("LanguageExcepts").onlyBrowser;if(!Array.isArray(r))throw n.isNotArray;return t.__contains(t.__arrayToLower(r),t.__detectLang())?e===!0&&i(!1):o(!0)}catch(r){return void console.error(r)}})},h=function(r){return new Promise(function(o,i){try{if("undefined"==typeof window)throw this.messages("LangExcepts").onlyBrowser;if(!Array.isArray(r))throw n.isNotArray;var a=t.__detectLang();return t.__contains(t.__arrayToLower(r),a.slice(0,2))?e===!0&&i(!1):o(!0)}catch(r){return void console.error(r)}})},d=function(){return new Promise(function(r,n){if("undefined"==typeof window)throw this.messages("Mobile").onlyBrowser;for(var o=(navigator.userAgent,["Windows Phone","iPad","iPhone","iPod","Android"]),i=[],a=0;a<o.length;a++)i.push(t.__str_includes(agent,o[a]));return i.indexOf(!0)!=-1?r(!0):e===!0&&n(!1)})},m={True:o,False:i,Language:a,Lang:s,LanguageSelects:u,LangSelects:c,LanguageExcepts:f,LangExcepts:h,Mobile:d};return m},r.prototype.timer=function(){var r=this.messages(),e=this.helpers(),t=function(t,n,o){return new Promise(function(i){var a=e.__typeToMilliseconds(t),s=typeof o;try{if(!a)throw r.timeFormat;if(isNaN(n))throw r.numFormat;if(0===n||"0"===n)throw r.numFormat;if(!e.__contains(["object","function","undefined"],s))throw this.messages("type").taskFormat;if("object"===s){if(!("before"in o))throw this.messages("key:before").notExist;if("function"!=typeof o.before)throw this.messages("before").shouldBeFunction;return o.before(),setTimeout(function(){return i(!0)},n*a)}return setTimeout(function(){return i(!0)},n*a)}catch(r){return void console.error(r)}})},n={After:t};return n},r}); | ||
!function(r,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():r.SelfTimer=e()}(this,function(){"use strict";function r(r){if("undefined"==typeof r)this.D=new Date;else{if(r instanceof Date==!1)return void console.error("'date' must be Date type.");this.D=r}}return r.prototype.helpers=function(){var r=this.D,e=(this.D.getDay(),function(r){return"function"==typeof r||void 0==r}),t=function(r,e){for(var t=r.length;t--;)if(r[t]===e)return!0;return!1},n=function(r,e){var t=!1;return r.indexOf(e)>=0&&(t=!0),t},o=function(r){return r.map(function(r){return r.replace(/Sun/g,0)}).map(function(r){return r.replace(/Mon/g,1)}).map(function(r){return r.replace(/Tue/g,2)}).map(function(r){return r.replace(/Wed/g,3)}).map(function(r){return r.replace(/Thu/g,4)}).map(function(r){return r.replace(/Fri/g,5)}).map(function(r){return r.replace(/Sat/g,6)}).map(function(r){return parseInt(r)})},i=function(r){var e=r.split(/:|\s/),t=new Date;return"pm"==e.pop().toLowerCase()&&(e[0]=+e[0]+12),t.setHours(+e.shift()),t.setMinutes(+e.shift()),t},a=function(r,e){1==arguments.length&&(e=r,r=0);for(var t=[],n=0;n<e;n++)t.push(r-n);return t},s=function(r,e,t){return t<e.setDate(e.getDate()+1)&&t>r},u=function(){var e=r.getMonth()+1,t=r.getDate();return e.length<2&&(e="0"+e),t.length<2&&(t="0"+t),[e,t].join("-")},c=function(r){var e;switch(r){case"s":case"sec":case"second":case"seconds":e=1e3;break;case"m":case"min":case"minute":case"minutes":e=6e4;break;default:e=!1}return e},f=function(){return"undefined"===navigator.userLanguage?navigator.userLanguage.toLowerCase():navigator.language.toLowerCase()},h=function(r){return r.map(function(r){return r.toLowerCase()})},d={__checkIsValid:e,__contains:t,__str_includes:n,__dayOfTheWeekStringToNumber:o,__timeObject:i,__range:a,__dateCompare:s,__dateString:u,__typeToMilliseconds:c,__detectLang:f,__arrayToLower:h};return d},r.prototype.messages=function(r){return{day:"Error: A day should be less than 31",month:"Error: month should be untll 12",date:"Error: date format shoud be MM-DD",year:"Error: date format shoud be 20YY",monthBetween:"Error: start of month should be less than end of month",startHour:"Error: start hour should be less than 23",endHour:"Error: end hour should be until 23",hourFormat:"Error: hours should be numberic",isNotValidHour:"Error: hour should be until 23",startDay:"Error: start day should be less than 30",endDay:"Error: end day should be untill 31",time:"Error: invalid time format. time should be [hh:mm AM or PM]",isNotArray:"Error: first argument shold be Array",dateGrater:"start date should not be grater than end-of -date",dateSameDay:"start and end date are should not be same date ",timeFormat:"Error: time of type formats",numFormat:"Error: num should be numberic",taskFormat:"Error: "+r+" should be object or function",notExist:"Error: "+r+" not exist",shouldBeFunction:"Error: "+r+" is shold be function",onlyBrowser:"Error: "+r+" is just supported web-browser"}},r.prototype.formats=function(){return{date:/^(1[0-2]|[1-9])-([1-9]|[12]\d|3[0-1])$/,year:/^[2][0][1-9]{2}$/,annual:/^[2]{1}[0]{1}[1-3]{1}[0-9]{1}-[01]{1}[0-9]{1}-[0-3]{1}[0-9]{1}$/,time:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/}},r.prototype.info=function(){return{version:"1.5.2",method:{on:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Weekdays","Weekend","Selects","Annual","DatesBetween","DatesContain"],at:["Between","Unless","Hour","HoursBetween","HourSelects"],in:["Day","Days","DaysBetween","Month","MonthSelects","Year"],is:["True","False","Language","Lang","LanguageSelects","LangSelects","LanguageExcepts","LangExcepts","Mobile"],timer:["After"]}}},r.prototype.on=function(r){var e=r,t=this.D,n=this.D.getDay(),o=this.messages(),i=this.helpers(),a=this.formats(),s=function(){return new Promise(function(r,t){return 0===n?r(!0):e===!0&&t(!1)})},u=function(){return new Promise(function(r,t){return 1===n?r(!0):e===!0&&t(!1)})},c=function(){return new Promise(function(r,t){return 2===n?r(!0):e===!0&&t(!1)})},f=function(){return new Promise(function(r,t){return 3===n?r(!0):e===!0&&t(!1)})},h=function(){return new Promise(function(r,t){return 4===n?r(!0):e===!0&&t(!1)})},d=function(){return new Promise(function(r,t){return 5===n?r(!0):e===!0&&t(!1)})},m=function(){return new Promise(function(r,t){return 6===n?r(!0):e===!0&&t(!1)})},y=function(r){return new Promise(function(t,a){try{if(!Array.isArray(r))throw o.isNotArray;var s=i.__dayOfTheWeekStringToNumber(r);return i.__contains(s,n)?t(!0):e===!0&&a(!1)}catch(r){return void console.error(r)}})},w=function(){return new Promise(function(r,t){var o=[1,2,3,4,5];return i.__contains(o,n)?r(!0):e===!0&&t(!1)})},l=function(){return new Promise(function(r,t){var o=[0,6];return i.__contains(o,n)?r(!0):e===!0&&t(!1)})},g=function(r){return new Promise(function(t,n){try{if(!r.match(a.date))throw o.date;return r==i.__dateString()?t(!0):e===!0&&n(!1)}catch(r){return void console.error(r)}})},_=function(r,n){return new Promise(function(a,s){var u=new Date(r),c=new Date(n);try{if(u>c)throw o.dateGrater;if(u==c)throw o.dateSameDay;return i.__dateCompare(u,c,t)?a(!0):e===!0&&s(!1)}catch(r){return void console.error(r)}})},p=function(r){return new Promise(function(n,a){try{if(!Array.isArray(r))throw o.isNotArray;return i.__contains(r,t.toISOString().slice(0,10))?n(!0):e===!0&&a(!1)}catch(r){return void console.error(r)}})},v={Sunday:s,Monday:u,Tuesday:c,Wednesday:f,Thursday:h,Friday:d,Saturday:m,Selects:y,Weekdays:w,Weekend:l,Annual:g,DatesBetween:_,DatesContain:p};return v},r.prototype.at=function(r){var e=r,t=this.D,n=(this.D.getDay(),this.D.getHours()),o=this.messages(),i=this.helpers(),a=this.formats(),s=function(r,n){return new Promise(function(s,u){try{if(!r.match(a.time))throw o.time+"at start";if(!n.match(a.time))throw o.time+" at end";var c=t<i.__timeObject(n)&&t>i.__timeObject(r);return c?s(!0):e===!0&&u(!1)}catch(r){return void console.error(r)}})},u=function(r,n){return new Promise(function(s,u){try{if(!r.match(a.time))throw o.time+"at start";if(!n.match(a.time))throw o.time+" at end";var c=t<i.__timeObject(n)&&t>i.__timeObject(r);return c?e===!0&&u(!1):s(!0)}catch(r){return void console.error(r)}})},c=function(r){return new Promise(function(t,i){var a=parseInt(r);try{if(a>23)throw o.startHour;return a===n?t(!0):e===!0&&i(!1)}catch(r){return void console.error(r)}})},f=function(r,t){return new Promise(function(a,s){var u=parseInt(r),c=parseInt(t);try{if(u>23)throw o.startHour;if(c>23)throw o.endHour;var f=i.__range(c,c-u);return f.push(r),i.__contains(f,n)?a(!0):e===!0&&s(!1)}catch(r){return void console.error(r)}})},h=function(r,t){return new Promise(function(t,a){try{if(!Array.isArray(r))throw o.isNotArray;if(1!=!r.some(isNaN))throw o.hourFormat;var s=r.map(function(r){return parseInt(r)});return s.map(function(r){if(r>23)throw o.isNotValidHour}),i.__contains(s,n)?t(!0):e===!0&&a(!1)}catch(r){return void console.error(r)}})},d={Between:s,Unless:u,Hour:c,HoursBetween:f,HourSelects:h};return d},r.prototype.in=function(r){var e=r,t=this.messages(),n=this.helpers(),o=this.formats(),i=(this.D,this.D.getDate()),a=this.D.getMonth()+1,s=this.D.getFullYear(),u=function(r){return new Promise(function(t,n){try{if(parseInt(r)>31)throw __msg.day;return r==i?t(!0):e===!0&&n(!1)}catch(r){return void console.error(r)}})},c=function(r){return new Promise(function(o,a){try{if(!Array.isArray(r))throw t.isNotArray;var s=r.map(function(r){return parseInt(r)});return n.__contains(s,i)?o(!0):e===!0&&a(!1)}catch(r){return void console.error(r)}})},f=function(r,o){return new Promise(function(a,s){try{var u=parseInt(r),c=parseInt(o);if(u>30)throw t.startDay;if(c>31)throw t.endDay;var f=n.__range(c,c-u);return f.push(r),n.__contains(f,i)?a(!0):e===!0&&s(!1)}catch(r){return void console.error(r)}})},h=function(r){return new Promise(function(n,o){try{if(parseInt(r)>12)throw t.month;var i=r<10?"0"+r:r;return i==a?n(!0):e===!0&&o(!1)}catch(r){return void console.error(r)}})},d=function(r){return new Promise(function(o,i){try{if(!Array.isArray(r))throw t.isNotArray;return n.__contains(r,a)?o(!0):e===!0&&i(!1)}catch(r){return void console.error(r)}})},m=function(r){return new Promise(function(n,i){try{if(!r.toString().match(o.year))throw t.year;return r==s?n(!0):e===!0&&i(!1)}catch(r){return void console.error(r)}})},y={Day:u,Days:c,DaysBetween:f,Month:h,MonthSelects:d,Year:m};return y},r.prototype.is=function(r){var e=r,t=this.helpers(),n=this.messages(),o=function(r){return new Promise(function(t,n){return r?t(!0):e===!0&&n(!1)})},i=function(r){return new Promise(function(t,n){return r?e===!0&&n(!1):t(!0)})},a=function(r){return new Promise(function(n,o){try{if("undefined"==typeof window)throw this.messages("Language").onlyBrowser;return r.toLowerCase()==t.__detectLang()?n(!0):e===!0&&o(!1)}catch(r){return void console.error(r)}})},s=function(r){return new Promise(function(n,o){try{if("undefined"==typeof window)throw this.messages("Language").onlyBrowser;var i=t.__detectLang();return r.toLowerCase()==i.slice(0,2)?n(!0):e===!0&&o(!1)}catch(r){return void console.error(r)}})},u=function(r){return new Promise(function(o,i){try{if("undefined"==typeof window)throw this.messages("LanguageSelects").onlyBrowser;if(!Array.isArray(r))throw n.isNotArray;return t.__contains(t.__arrayToLower(r),t.__detectLang())?o(!0):e===!0&&i(!1)}catch(r){return void console.error(r)}})},c=function(r){return new Promise(function(o,i){try{if("undefined"==typeof window)throw this.messages("LangSelects").onlyBrowser;if(!Array.isArray(r))throw n.isNotArray;var a=t.__detectLang();return t.__contains(t.__arrayToLower(r),a.slice(0,2))?o(!0):e===!0&&i(!1)}catch(r){return void console.error(r)}})},f=function(r){return new Promise(function(o,i){try{if("undefined"==typeof window)throw this.messages("LanguageExcepts").onlyBrowser;if(!Array.isArray(r))throw n.isNotArray;return t.__contains(t.__arrayToLower(r),t.__detectLang())?e===!0&&i(!1):o(!0)}catch(r){return void console.error(r)}})},h=function(r){return new Promise(function(o,i){try{if("undefined"==typeof window)throw this.messages("LangExcepts").onlyBrowser;if(!Array.isArray(r))throw n.isNotArray;var a=t.__detectLang();return t.__contains(t.__arrayToLower(r),a.slice(0,2))?e===!0&&i(!1):o(!0)}catch(r){return void console.error(r)}})},d=function(){return new Promise(function(r,n){if("undefined"==typeof window)throw this.messages("Mobile").onlyBrowser;for(var o=navigator.userAgent,i=["Windows Phone","iPad","iPhone","iPod","Android"],a=[],s=0;s<i.length;s++)a.push(t.__str_includes(o,i[s]));return a.indexOf(!0)!=-1?r(!0):e===!0&&n(!1)})},m={True:o,False:i,Language:a,Lang:s,LanguageSelects:u,LangSelects:c,LanguageExcepts:f,LangExcepts:h,Mobile:d};return m},r.prototype.timer=function(){var r=this.messages(),e=this.helpers(),t=function(t,n,o){return new Promise(function(i){var a=e.__typeToMilliseconds(t),s=typeof o;try{if(!a)throw r.timeFormat;if(isNaN(n))throw r.numFormat;if(0===n||"0"===n)throw r.numFormat;if(!e.__contains(["object","function","undefined"],s))throw this.messages("type").taskFormat;if("object"===s){if(!("before"in o))throw this.messages("key:before").notExist;if("function"!=typeof o.before)throw this.messages("before").shouldBeFunction;return o.before(),setTimeout(function(){return i(!0)},n*a)}return setTimeout(function(){return i(!0)},n*a)}catch(r){return void console.error(r)}})},n={After:t};return n},r}); |
@@ -286,3 +286,3 @@ ;(function(root, factory) { | ||
return { | ||
version: "1.5.0", | ||
version: "1.5.2", | ||
method: { | ||
@@ -1076,3 +1076,3 @@ on: [ | ||
var agetnt = navigator.userAgent; | ||
var agent = navigator.userAgent; | ||
@@ -1079,0 +1079,0 @@ var mobile = ["Windows Phone", "iPad", "iPhone", "iPod", "Android"]; |
@@ -1,1 +0,1 @@ | ||
!function(t,r){"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?module.exports=r():t.SelfTimer=r()}(this,function(){"use strict";function t(t){if("undefined"==typeof t)this.D=new Date;else{if(t instanceof Date==!1)return void console.error("'date' must be Date type.");this.D=t}}return t.prototype.helpers=function(){var t=this.D,r=(this.D.getDay(),function(t){return"function"==typeof t||void 0==t}),e=function(t,r){for(var e=t.length;e--;)if(t[e]===r)return!0;return!1},n=function(t,r){var e=!1;return t.indexOf(r)>=0&&(e=!0),e},o=function(t){return t.map(function(t){return t.replace(/Sun/g,0)}).map(function(t){return t.replace(/Mon/g,1)}).map(function(t){return t.replace(/Tue/g,2)}).map(function(t){return t.replace(/Wed/g,3)}).map(function(t){return t.replace(/Thu/g,4)}).map(function(t){return t.replace(/Fri/g,5)}).map(function(t){return t.replace(/Sat/g,6)}).map(function(t){return parseInt(t)})},i=function(t){var r=t.split(/:|\s/),e=new Date;return"pm"==r.pop().toLowerCase()&&(r[0]=+r[0]+12),e.setHours(+r.shift()),e.setMinutes(+r.shift()),e},a=function(t,r){1==arguments.length&&(r=t,t=0);for(var e=[],n=0;n<r;n++)e.push(t-n);return e},s=function(t,r,e){return e<r.setDate(r.getDate()+1)&&e>t},u=function(){var r=t.getMonth()+1,e=t.getDate();return r.length<2&&(r="0"+r),e.length<2&&(e="0"+e),[r,e].join("-")},c=function(t){var r;switch(t){case"s":case"sec":case"second":case"seconds":r=1e3;break;case"m":case"min":case"minute":case"minutes":r=6e4;break;default:r=!1}return r},f=function(){return"undefined"===navigator.userLanguage?navigator.userLanguage.toLowerCase():navigator.language.toLowerCase()},h=function(t){return t.map(function(t){return t.toLowerCase()})},d={__checkIsValid:r,__contains:e,__str_includes:n,__dayOfTheWeekStringToNumber:o,__timeObject:i,__range:a,__dateCompare:s,__dateString:u,__typeToMilliseconds:c,__detectLang:f,__arrayToLower:h};return d},t.prototype.messages=function(t){return{day:"Error: A day should be less than 31",month:"Error: month should be untll 12",date:"Error: date format shoud be MM-DD",year:"Error: date format shoud be 20YY",monthBetween:"Error: start of month should be less than end of month",startHour:"Error: start hour should be less than 23",endHour:"Error: end hour should be until 23",hourFormat:"Error: hours should be numberic",isNotValidHour:"Error: hour should be until 23",startDay:"Error: start day should be less than 30",endDay:"Error: end day should be untill 31",time:"Error: invalid time format. time should be [hh:mm AM or PM]",isNotArray:"Error: first argument shold be Array",dateGrater:"start date should not be grater than end-of -date",dateSameDay:"start and end date are should not be same date ",timeFormat:"Error: time of type formats",numFormat:"Error: num should be numberic",taskFormat:"Error: "+t+" should be object or function",notExist:"Error: "+t+" not exist",shouldBeFunction:"Error: "+t+" is shold be function",onlyBrowser:"Error: "+t+" is just supported web-browser"}},t.prototype.formats=function(){return{date:/^(1[0-2]|[1-9])-([1-9]|[12]\d|3[0-1])$/,year:/^[2][0][1-9]{2}$/,annual:/^[2]{1}[0]{1}[1-3]{1}[0-9]{1}-[01]{1}[0-9]{1}-[0-3]{1}[0-9]{1}$/,time:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/}},t.prototype.info=function(){return{version:"1.5.0",method:{on:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Weekdays","Weekend","Selects","Annual","DatesBetween","DatesContain"],at:["Between","Unless","Hour","HoursBetween","HourSelects"],in:["Day","Days","DaysBetween","Month","MonthSelects","Year"],is:["True","False","Language","Lang","LanguageSelects","LangSelects","LanguageExcepts","LangExcepts","Mobile"],timer:["After"]}}},t.prototype.on=function(){var t=this.D,r=this.D.getDay(),e=this.messages(),n=this.helpers(),o=this.formats(),i=function(t){if(n.__checkIsValid(t)&&0===r)return void 0===t||t()},a=function(t){if(n.__checkIsValid(t)&&1===r)return void 0===t||t()},s=function(t){if(n.__checkIsValid(t)&&2===r)return void 0==t||t()},u=function(t){if(n.__checkIsValid(t)&&3===r)return void 0===t||t()},c=function(t){if(n.__checkIsValid(t)&&4===r)return void 0===t||t()},f=function(t){if(n.__checkIsValid(t)&&5===r)return void 0===t||t()},h=function(t){if(n.__checkIsValid(t)&&6===r)return void 0===t||t()},d=function(t,o){if(n.__checkIsValid(o))try{if(!Array.isArray(t))throw e.isNotArray;var i=n.__dayOfTheWeekStringToNumber(t);if(n.__contains(i,r))return void 0===o||o()}catch(t){return void console.error(t)}},_=function(t){if(n.__checkIsValid(t)){var e=[1,2,3,4,5];if(n.__contains(e,r))return void 0===t||t()}},l=function(t){if(n.__checkIsValid(t)){var e=[0,6];if(n.__contains(e,r))return void 0===t||t()}},y=function(t,r){if(n.__checkIsValid(r))try{if(!t.match(o.date))throw e.date;if(t==n.__dateString())return void 0===r||r()}catch(t){return void console.error(t)}},m=function(r,o,i){if(n.__checkIsValid(i)){var a=new Date(r),s=new Date(o);try{if(a>s)throw e.dateGrater;if(a==s)throw e.dateSameDay;if(n.__dateCompare(a,s,t))return void 0===i||i()}catch(t){return void console.error(t)}}},g=function(r,o){if(n.__checkIsValid(o))try{if(!Array.isArray(r))throw e.isNotArray;if(n.__contains(r,t.toISOString().slice(0,10)))return void 0===o||o()}catch(t){return void console.error(t)}},v={Sunday:i,Monday:a,Tuesday:s,Wednesday:u,Thursday:c,Friday:f,Saturday:h,Selects:d,Weekdays:_,Weekend:l,Annual:y,DatesBetween:m,DatesContain:g};return v},t.prototype.at=function(){var t=this.D,r=(this.D.getDay(),this.D.getHours()),e=this.messages(),n=this.helpers(),o=this.formats(),i=function(r,i,a){if(n.__checkIsValid(a))try{if(!r.match(o.time))throw e.time+"at start";if(!i.match(o.time))throw e.time+" at end";var s=t<n.__timeObject(i)&&t>n.__timeObject(r);if(s)return void 0===a||a()}catch(t){return void console.error(t)}},a=function(r,i,a){if(n.__checkIsValid(a))try{if(!r.match(o.time))throw e.time+"at start";if(!i.match(o.time))throw e.time+" at end";var s=t<n.__timeObject(i)&&t>n.__timeObject(r);if(!s)return void 0===a||a()}catch(t){return void console.error(t)}},s=function(t,o){if(n.__checkIsValid(o)){var i=parseInt(t);try{if(i>23)throw e.startHour;if(i===r)return void 0===o||o()}catch(t){return void console.error(t)}}},u=function(t,o,i){if(n.__checkIsValid(i)){var a=parseInt(t),s=parseInt(o);try{if(a>23)throw e.startHour;if(s>23)throw e.endHour;var u=n.__range(s,s-a);if(u.push(t),n.__contains(u,r))return void 0===i||i()}catch(t){return void console.error(t)}}},c=function(t,o){if(n.__checkIsValid(o))try{if(!Array.isArray(t))throw e.isNotArray;if(1!=!t.some(isNaN))throw e.hourFormat;var i=t.map(function(t){return parseInt(t)});if(i.map(function(t){if(t>23)throw e.isNotValidHour}),n.__contains(i,r))return void 0===o||o()}catch(t){return void console.error(t)}},f={Between:i,Unless:a,Hour:s,HoursBetween:u,HourSelects:c};return f},t.prototype.in=function(t){var r=t,e=this.messages(),n=this.helpers(),o=this.formats(),i=(this.D,this.D.getDate()),a=this.D.getMonth()+1,s=this.D.getFullYear(),u=function(t,e){if(0!=this._Chain&&n.__checkIsValid(e))try{if(parseInt(t)>31)throw __msg.day;return t==i?void 0!==e?e():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},c=function(t,o){if(0!=this._Chain&&n.__checkIsValid(o))try{if(!Array.isArray(t))throw e.isNotArray;var a=t.map(function(t){return parseInt(t)});return n.__contains(a,i)?void 0!==o?o():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},f=function(t,o,a){if(0!=this._Chain&&n.__checkIsValid(a))try{var s=parseInt(t),u=parseInt(o);if(s>30)throw e.startDay;if(u>31)throw e.endDay;var c=n.__range(u,u-s);return c.push(t),n.__contains(c,i)?void 0!==a?a():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},h=function(t,o){if(0!=this._Chain&&n.__checkIsValid(o))try{if(parseInt(t)>12)throw e.month;var i=t<10?"0"+t:t;return i==a?void 0!==o?o():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},d=function(t,o){if(0!=this._Chain&&n.__checkIsValid(o)){if(!Array.isArray(t))throw e.isNotArray;return n.__contains(t,a)?void 0!==o?o():1!=r||this:(this._Chain=!1,1==r&&this)}},_=function(t,i){if(0!=this._Chain&&n.__checkIsValid(i))try{if(!t.toString().match(o.year))throw e.year;return t==s?void 0!==i?i():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},l={Day:u,Days:c,DaysBetween:f,Month:h,MonthSelects:d,Year:_};return l},t.prototype.is=function(){var t=this.helpers(),r=this.messages(),e=function(t,r){if(t)return void 0===r||r()},n=function(t,r){if(!t)return void 0===r||r()},o=function(r,e){try{if("undefined"==typeof window)throw this.messages("Language").onlyBrowser;if(r.toLowerCase()==t.__detectLang())return void 0===e||e()}catch(t){return void console.error(t)}},i=function(r,e){try{if("undefined"==typeof window)throw this.messages("Lang").onlyBrowser;var n=t.__detectLang();if(r.toLowerCase()==n.slice(0,2))return void 0===e||e()}catch(t){return void console.error(t)}},a=function(e,n){try{if("undefined"==typeof window)throw this.messages("LanguageSelects").onlyBrowser;if(!Array.isArray(e))throw r.isNotArray;if(t.__contains(t.__arrayToLower(e),t.__detectLang()))return void 0===n||n()}catch(t){return void console.error(t)}},s=function(e,n){try{if("undefined"==typeof window)throw this.messages("LangSelects").onlyBrowser;if(!Array.isArray(e))throw r.isNotArray;var o=t.__detectLang();if(t.__contains(t.__arrayToLower(e),o.slice(0,2)))return void 0===n||n()}catch(t){return void console.error(t)}},u=function(e,n){try{if("undefined"==typeof window)throw this.messages("LanguageExcepts").onlyBrowser;if(!Array.isArray(e))throw r.isNotArray;if(!t.__contains(t.__arrayToLower(e),t.__detectLang()))return void 0===n||n()}catch(t){return void console.error(t)}},c=function(e,n){try{if("undefined"==typeof window)throw this.messages("LangExcepts").onlyBrowser;if(!Array.isArray(e))throw r.isNotArray;var o=t.__detectLang();if(!t.__contains(t.__arrayToLower(e),o.slice(0,2)))return void 0===n||n()}catch(t){return void console.error(t)}},f=function(r){try{if("undefined"==typeof window)throw this.messages("Mobile").onlyBrowser;for(var e=(navigator.userAgent,["Windows Phone","iPad","iPhone","iPod","Android"]),n=[],o=0;o<e.length;o++)n.push(t.__str_includes(agent,e[o]));if(n.indexOf(!0)!=-1)return void 0===r||r()}catch(t){return void console.error(t)}},h={True:e,False:n,Language:o,Lang:i,LanguageSelects:a,LangSelects:s,LanguageExcepts:u,LangExcepts:c,Mobile:f};return h},t.prototype.timer=function(){var t=this.messages(),r=this.helpers(),e=function(e,n,o){var i=r.__typeToMilliseconds(e),a=typeof o;try{if(!i)throw t.timeFormat;if(isNaN(n))throw t.numFormat;if(0===n||"0"===n)throw t.numFormat;if(!r.__contains(["object","function"],a))throw this.messages("type").taskFormat;if("object"===a){if(!("before"in o))throw this.messages("key:before").notExist;if(!("after"in o))throw this.messages("key:after").notExist;if("function"!=typeof o.before)throw this.messages("before").shouldBeFunction;if("function"!=typeof o.after)throw this.messages("after").shouldBeFunction;return o.before(),setTimeout(function(){return o.after()},n*i)}if("function"===a)return setTimeout(function(){return o()},n*i)}catch(t){return void console.error(t)}},n=function(e,n,o){var i=r.__typeToMilliseconds(e),a=typeof o;try{if(!i)throw t.timeFormat;if(isNaN(n))throw t.numFormat;if(0===n||"0"===n)throw t.numFormat;if(!r.__contains(["object","function"],a))throw this.messages("type").taskFormat;if("object"===a){if(!("before"in o))throw this.messages("key:before").notExist;if(!("after"in o))throw this.messages("key:after").notExist;if("function"!=typeof o.before)throw this.messages("before").shouldBeFunction;if("function"!=typeof o.after)throw this.messages("after").shouldBeFunction;return o.before(),setInterval(function(){return o.after()},n*i)}if("function"===a)return setInterval(function(){return o()},n*i)}catch(t){return void console.error(t)}},o={After:e,Every:n};return o},t}); | ||
!function(t,r){"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?module.exports=r():t.SelfTimer=r()}(this,function(){"use strict";function t(t){if("undefined"==typeof t)this.D=new Date;else{if(t instanceof Date==!1)return void console.error("'date' must be Date type.");this.D=t}}return t.prototype.helpers=function(){var t=this.D,r=(this.D.getDay(),function(t){return"function"==typeof t||void 0==t}),e=function(t,r){for(var e=t.length;e--;)if(t[e]===r)return!0;return!1},n=function(t,r){var e=!1;return t.indexOf(r)>=0&&(e=!0),e},o=function(t){return t.map(function(t){return t.replace(/Sun/g,0)}).map(function(t){return t.replace(/Mon/g,1)}).map(function(t){return t.replace(/Tue/g,2)}).map(function(t){return t.replace(/Wed/g,3)}).map(function(t){return t.replace(/Thu/g,4)}).map(function(t){return t.replace(/Fri/g,5)}).map(function(t){return t.replace(/Sat/g,6)}).map(function(t){return parseInt(t)})},i=function(t){var r=t.split(/:|\s/),e=new Date;return"pm"==r.pop().toLowerCase()&&(r[0]=+r[0]+12),e.setHours(+r.shift()),e.setMinutes(+r.shift()),e},a=function(t,r){1==arguments.length&&(r=t,t=0);for(var e=[],n=0;n<r;n++)e.push(t-n);return e},s=function(t,r,e){return e<r.setDate(r.getDate()+1)&&e>t},u=function(){var r=t.getMonth()+1,e=t.getDate();return r.length<2&&(r="0"+r),e.length<2&&(e="0"+e),[r,e].join("-")},c=function(t){var r;switch(t){case"s":case"sec":case"second":case"seconds":r=1e3;break;case"m":case"min":case"minute":case"minutes":r=6e4;break;default:r=!1}return r},f=function(){return"undefined"===navigator.userLanguage?navigator.userLanguage.toLowerCase():navigator.language.toLowerCase()},h=function(t){return t.map(function(t){return t.toLowerCase()})},d={__checkIsValid:r,__contains:e,__str_includes:n,__dayOfTheWeekStringToNumber:o,__timeObject:i,__range:a,__dateCompare:s,__dateString:u,__typeToMilliseconds:c,__detectLang:f,__arrayToLower:h};return d},t.prototype.messages=function(t){return{day:"Error: A day should be less than 31",month:"Error: month should be untll 12",date:"Error: date format shoud be MM-DD",year:"Error: date format shoud be 20YY",monthBetween:"Error: start of month should be less than end of month",startHour:"Error: start hour should be less than 23",endHour:"Error: end hour should be until 23",hourFormat:"Error: hours should be numberic",isNotValidHour:"Error: hour should be until 23",startDay:"Error: start day should be less than 30",endDay:"Error: end day should be untill 31",time:"Error: invalid time format. time should be [hh:mm AM or PM]",isNotArray:"Error: first argument shold be Array",dateGrater:"start date should not be grater than end-of -date",dateSameDay:"start and end date are should not be same date ",timeFormat:"Error: time of type formats",numFormat:"Error: num should be numberic",taskFormat:"Error: "+t+" should be object or function",notExist:"Error: "+t+" not exist",shouldBeFunction:"Error: "+t+" is shold be function",onlyBrowser:"Error: "+t+" is just supported web-browser"}},t.prototype.formats=function(){return{date:/^(1[0-2]|[1-9])-([1-9]|[12]\d|3[0-1])$/,year:/^[2][0][1-9]{2}$/,annual:/^[2]{1}[0]{1}[1-3]{1}[0-9]{1}-[01]{1}[0-9]{1}-[0-3]{1}[0-9]{1}$/,time:/^(0?[1-9]|1[012])(:[0-5]\d) [APap][mM]$/}},t.prototype.info=function(){return{version:"1.5.2",method:{on:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Weekdays","Weekend","Selects","Annual","DatesBetween","DatesContain"],at:["Between","Unless","Hour","HoursBetween","HourSelects"],in:["Day","Days","DaysBetween","Month","MonthSelects","Year"],is:["True","False","Language","Lang","LanguageSelects","LangSelects","LanguageExcepts","LangExcepts","Mobile"],timer:["After"]}}},t.prototype.on=function(){var t=this.D,r=this.D.getDay(),e=this.messages(),n=this.helpers(),o=this.formats(),i=function(t){if(n.__checkIsValid(t)&&0===r)return void 0===t||t()},a=function(t){if(n.__checkIsValid(t)&&1===r)return void 0===t||t()},s=function(t){if(n.__checkIsValid(t)&&2===r)return void 0==t||t()},u=function(t){if(n.__checkIsValid(t)&&3===r)return void 0===t||t()},c=function(t){if(n.__checkIsValid(t)&&4===r)return void 0===t||t()},f=function(t){if(n.__checkIsValid(t)&&5===r)return void 0===t||t()},h=function(t){if(n.__checkIsValid(t)&&6===r)return void 0===t||t()},d=function(t,o){if(n.__checkIsValid(o))try{if(!Array.isArray(t))throw e.isNotArray;var i=n.__dayOfTheWeekStringToNumber(t);if(n.__contains(i,r))return void 0===o||o()}catch(t){return void console.error(t)}},_=function(t){if(n.__checkIsValid(t)){var e=[1,2,3,4,5];if(n.__contains(e,r))return void 0===t||t()}},l=function(t){if(n.__checkIsValid(t)){var e=[0,6];if(n.__contains(e,r))return void 0===t||t()}},y=function(t,r){if(n.__checkIsValid(r))try{if(!t.match(o.date))throw e.date;if(t==n.__dateString())return void 0===r||r()}catch(t){return void console.error(t)}},m=function(r,o,i){if(n.__checkIsValid(i)){var a=new Date(r),s=new Date(o);try{if(a>s)throw e.dateGrater;if(a==s)throw e.dateSameDay;if(n.__dateCompare(a,s,t))return void 0===i||i()}catch(t){return void console.error(t)}}},g=function(r,o){if(n.__checkIsValid(o))try{if(!Array.isArray(r))throw e.isNotArray;if(n.__contains(r,t.toISOString().slice(0,10)))return void 0===o||o()}catch(t){return void console.error(t)}},v={Sunday:i,Monday:a,Tuesday:s,Wednesday:u,Thursday:c,Friday:f,Saturday:h,Selects:d,Weekdays:_,Weekend:l,Annual:y,DatesBetween:m,DatesContain:g};return v},t.prototype.at=function(){var t=this.D,r=(this.D.getDay(),this.D.getHours()),e=this.messages(),n=this.helpers(),o=this.formats(),i=function(r,i,a){if(n.__checkIsValid(a))try{if(!r.match(o.time))throw e.time+"at start";if(!i.match(o.time))throw e.time+" at end";var s=t<n.__timeObject(i)&&t>n.__timeObject(r);if(s)return void 0===a||a()}catch(t){return void console.error(t)}},a=function(r,i,a){if(n.__checkIsValid(a))try{if(!r.match(o.time))throw e.time+"at start";if(!i.match(o.time))throw e.time+" at end";var s=t<n.__timeObject(i)&&t>n.__timeObject(r);if(!s)return void 0===a||a()}catch(t){return void console.error(t)}},s=function(t,o){if(n.__checkIsValid(o)){var i=parseInt(t);try{if(i>23)throw e.startHour;if(i===r)return void 0===o||o()}catch(t){return void console.error(t)}}},u=function(t,o,i){if(n.__checkIsValid(i)){var a=parseInt(t),s=parseInt(o);try{if(a>23)throw e.startHour;if(s>23)throw e.endHour;var u=n.__range(s,s-a);if(u.push(t),n.__contains(u,r))return void 0===i||i()}catch(t){return void console.error(t)}}},c=function(t,o){if(n.__checkIsValid(o))try{if(!Array.isArray(t))throw e.isNotArray;if(1!=!t.some(isNaN))throw e.hourFormat;var i=t.map(function(t){return parseInt(t)});if(i.map(function(t){if(t>23)throw e.isNotValidHour}),n.__contains(i,r))return void 0===o||o()}catch(t){return void console.error(t)}},f={Between:i,Unless:a,Hour:s,HoursBetween:u,HourSelects:c};return f},t.prototype.in=function(t){var r=t,e=this.messages(),n=this.helpers(),o=this.formats(),i=(this.D,this.D.getDate()),a=this.D.getMonth()+1,s=this.D.getFullYear(),u=function(t,e){if(0!=this._Chain&&n.__checkIsValid(e))try{if(parseInt(t)>31)throw __msg.day;return t==i?void 0!==e?e():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},c=function(t,o){if(0!=this._Chain&&n.__checkIsValid(o))try{if(!Array.isArray(t))throw e.isNotArray;var a=t.map(function(t){return parseInt(t)});return n.__contains(a,i)?void 0!==o?o():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},f=function(t,o,a){if(0!=this._Chain&&n.__checkIsValid(a))try{var s=parseInt(t),u=parseInt(o);if(s>30)throw e.startDay;if(u>31)throw e.endDay;var c=n.__range(u,u-s);return c.push(t),n.__contains(c,i)?void 0!==a?a():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},h=function(t,o){if(0!=this._Chain&&n.__checkIsValid(o))try{if(parseInt(t)>12)throw e.month;var i=t<10?"0"+t:t;return i==a?void 0!==o?o():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},d=function(t,o){if(0!=this._Chain&&n.__checkIsValid(o)){if(!Array.isArray(t))throw e.isNotArray;return n.__contains(t,a)?void 0!==o?o():1!=r||this:(this._Chain=!1,1==r&&this)}},_=function(t,i){if(0!=this._Chain&&n.__checkIsValid(i))try{if(!t.toString().match(o.year))throw e.year;return t==s?void 0!==i?i():1!=r||this:(this._Chain=!1,1==r&&this)}catch(t){return void console.error(t)}},l={Day:u,Days:c,DaysBetween:f,Month:h,MonthSelects:d,Year:_};return l},t.prototype.is=function(){var t=this.helpers(),r=this.messages(),e=function(t,r){if(t)return void 0===r||r()},n=function(t,r){if(!t)return void 0===r||r()},o=function(r,e){try{if("undefined"==typeof window)throw this.messages("Language").onlyBrowser;if(r.toLowerCase()==t.__detectLang())return void 0===e||e()}catch(t){return void console.error(t)}},i=function(r,e){try{if("undefined"==typeof window)throw this.messages("Lang").onlyBrowser;var n=t.__detectLang();if(r.toLowerCase()==n.slice(0,2))return void 0===e||e()}catch(t){return void console.error(t)}},a=function(e,n){try{if("undefined"==typeof window)throw this.messages("LanguageSelects").onlyBrowser;if(!Array.isArray(e))throw r.isNotArray;if(t.__contains(t.__arrayToLower(e),t.__detectLang()))return void 0===n||n()}catch(t){return void console.error(t)}},s=function(e,n){try{if("undefined"==typeof window)throw this.messages("LangSelects").onlyBrowser;if(!Array.isArray(e))throw r.isNotArray;var o=t.__detectLang();if(t.__contains(t.__arrayToLower(e),o.slice(0,2)))return void 0===n||n()}catch(t){return void console.error(t)}},u=function(e,n){try{if("undefined"==typeof window)throw this.messages("LanguageExcepts").onlyBrowser;if(!Array.isArray(e))throw r.isNotArray;if(!t.__contains(t.__arrayToLower(e),t.__detectLang()))return void 0===n||n()}catch(t){return void console.error(t)}},c=function(e,n){try{if("undefined"==typeof window)throw this.messages("LangExcepts").onlyBrowser;if(!Array.isArray(e))throw r.isNotArray;var o=t.__detectLang();if(!t.__contains(t.__arrayToLower(e),o.slice(0,2)))return void 0===n||n()}catch(t){return void console.error(t)}},f=function(r){try{if("undefined"==typeof window)throw this.messages("Mobile").onlyBrowser;for(var e=navigator.userAgent,n=["Windows Phone","iPad","iPhone","iPod","Android"],o=[],i=0;i<n.length;i++)o.push(t.__str_includes(e,n[i]));if(o.indexOf(!0)!=-1)return void 0===r||r()}catch(t){return void console.error(t)}},h={True:e,False:n,Language:o,Lang:i,LanguageSelects:a,LangSelects:s,LanguageExcepts:u,LangExcepts:c,Mobile:f};return h},t.prototype.timer=function(){var t=this.messages(),r=this.helpers(),e=function(e,n,o){var i=r.__typeToMilliseconds(e),a=typeof o;try{if(!i)throw t.timeFormat;if(isNaN(n))throw t.numFormat;if(0===n||"0"===n)throw t.numFormat;if(!r.__contains(["object","function"],a))throw this.messages("type").taskFormat;if("object"===a){if(!("before"in o))throw this.messages("key:before").notExist;if(!("after"in o))throw this.messages("key:after").notExist;if("function"!=typeof o.before)throw this.messages("before").shouldBeFunction;if("function"!=typeof o.after)throw this.messages("after").shouldBeFunction;return o.before(),setTimeout(function(){return o.after()},n*i)}if("function"===a)return setTimeout(function(){return o()},n*i)}catch(t){return void console.error(t)}},n=function(e,n,o){var i=r.__typeToMilliseconds(e),a=typeof o;try{if(!i)throw t.timeFormat;if(isNaN(n))throw t.numFormat;if(0===n||"0"===n)throw t.numFormat;if(!r.__contains(["object","function"],a))throw this.messages("type").taskFormat;if("object"===a){if(!("before"in o))throw this.messages("key:before").notExist;if(!("after"in o))throw this.messages("key:after").notExist;if("function"!=typeof o.before)throw this.messages("before").shouldBeFunction;if("function"!=typeof o.after)throw this.messages("after").shouldBeFunction;return o.before(),setInterval(function(){return o.after()},n*i)}if("function"===a)return setInterval(function(){return o()},n*i)}catch(t){return void console.error(t)}},o={After:e,Every:n};return o},t}); |
{ | ||
"name": "self-timer", | ||
"version": "1.5.1", | ||
"version": "1.5.2", | ||
"description": "light-weight callback runner.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/selftimer.min.js", |
@@ -286,3 +286,3 @@ ;(function(root, factory) { | ||
return { | ||
version: "1.5.0", | ||
version: "1.5.2", | ||
method: { | ||
@@ -1076,3 +1076,3 @@ on: [ | ||
var agetnt = navigator.userAgent; | ||
var agent = navigator.userAgent; | ||
@@ -1079,0 +1079,0 @@ var mobile = ["Windows Phone", "iPad", "iPhone", "iPod", "Android"]; |
@@ -277,3 +277,3 @@ "use strict"; | ||
return { | ||
version: "1.5.0", | ||
version: "1.5.2", | ||
method: { | ||
@@ -1067,3 +1067,3 @@ on: [ | ||
var agetnt = navigator.userAgent; | ||
var agent = navigator.userAgent; | ||
@@ -1070,0 +1070,0 @@ var mobile = ["Windows Phone", "iPad", "iPhone", "iPod", "Android"]; |
@@ -286,3 +286,3 @@ ;(function(root, factory) { | ||
return { | ||
version: "1.5.0", | ||
version: "1.5.2", | ||
method: { | ||
@@ -1084,3 +1084,3 @@ on: [ | ||
var agetnt = navigator.userAgent; | ||
var agent = navigator.userAgent; | ||
@@ -1087,0 +1087,0 @@ var mobile = ["Windows Phone", "iPad", "iPhone", "iPod", "Android"]; |
@@ -287,3 +287,3 @@ !function(e){function n(){}function t(e,n){return function(){e.apply(n,arguments)}}function o(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],s(e,this)}function i(e,n){for(;3===e._state;)e=e._value;return 0===e._state?void e._deferreds.push(n):(e._handled=!0,void o._immediateFn(function(){var t=1===e._state?n.onFulfilled:n.onRejected;if(null===t)return void(1===e._state?r:u)(n.promise,e._value);var o;try{o=t(e._value)}catch(i){return void u(n.promise,i)}r(n.promise,o)}))}function r(e,n){try{if(n===e)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var i=n.then;if(n instanceof o)return e._state=3,e._value=n,void f(e);if("function"==typeof i)return void s(t(i,n),e)}e._state=1,e._value=n,f(e)}catch(r){u(e,r)}}function u(e,n){e._state=2,e._value=n,f(e)}function f(e){2===e._state&&0===e._deferreds.length&&o._immediateFn(function(){e._handled||o._unhandledRejectionFn(e._value)});for(var n=0,t=e._deferreds.length;n<t;n++)i(e,e._deferreds[n]);e._deferreds=null}function c(e,n,t){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof n?n:null,this.promise=t}function s(e,n){var t=!1;try{e(function(e){t||(t=!0,r(n,e))},function(e){t||(t=!0,u(n,e))})}catch(o){if(t)return;t=!0,u(n,o)}}var a=setTimeout;o.prototype["catch"]=function(e){return this.then(null,e)},o.prototype.then=function(e,t){var o=new this.constructor(n);return i(this,new c(e,t,o)),o},o.all=function(e){var n=Array.prototype.slice.call(e);return new o(function(e,t){function o(r,u){try{if(u&&("object"==typeof u||"function"==typeof u)){var f=u.then;if("function"==typeof f)return void f.call(u,function(e){o(r,e)},t)}n[r]=u,0===--i&&e(n)}catch(c){t(c)}}if(0===n.length)return e([]);for(var i=n.length,r=0;r<n.length;r++)o(r,n[r])})},o.resolve=function(e){return e&&"object"==typeof e&&e.constructor===o?e:new o(function(n){n(e)})},o.reject=function(e){return new o(function(n,t){t(e)})},o.race=function(e){return new o(function(n,t){for(var o=0,i=e.length;o<i;o++)e[o].then(n,t)})},o._immediateFn="function"==typeof setImmediate&&function(e){setImmediate(e)}||function(e){a(e,0)},o._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console&&console.warn("Possible Unhandled Promise Rejection:",e)},o._setImmediateFn=function(e){o._immediateFn=e},o._setUnhandledRejectionFn=function(e){o._unhandledRejectionFn=e},"undefined"!=typeof module&&module.exports?module.exports=o:e.Promise||(e.Promise=o)}(this); | ||
return { | ||
version: "1.5.0", | ||
version: "1.5.2", | ||
method: { | ||
@@ -1085,3 +1085,3 @@ on: [ | ||
var agetnt = navigator.userAgent; | ||
var agent = navigator.userAgent; | ||
@@ -1088,0 +1088,0 @@ var mobile = ["Windows Phone", "iPad", "iPhone", "iPod", "Android"]; |
@@ -277,3 +277,3 @@ "use strict"; | ||
return { | ||
version: "1.5.0", | ||
version: "1.5.2", | ||
method: { | ||
@@ -1075,3 +1075,3 @@ on: [ | ||
var agetnt = navigator.userAgent; | ||
var agent = navigator.userAgent; | ||
@@ -1078,0 +1078,0 @@ var mobile = ["Windows Phone", "iPad", "iPhone", "iPod", "Android"]; |
@@ -7,3 +7,3 @@ /** | ||
return { | ||
version: "1.5.1", | ||
version: "1.5.2", | ||
method: { | ||
@@ -10,0 +10,0 @@ on: [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1019833