diff --git a/.babelrc b/.babelrc index c5210c4..5e26514 100644 --- a/.babelrc +++ b/.babelrc @@ -4,5 +4,6 @@ ], "plugins": [ "add-module-exports" - ] + ], + "sourceMaps": true } diff --git a/.gitignore b/.gitignore index 00ab270..d90d22d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ components build node_modules +tmp .settings .project diff --git a/Gruntfile.js b/Gruntfile.js index c1674ba..0755bd9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -63,6 +63,9 @@ module.exports = function(grunt) { minify: { src: "dist/chronoman.js", dest: "dist/chronoman.min.js" + }, + options: { + sourceMap: true } }, diff --git a/README.md b/README.md index 926acf3..2934d68 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ timer.stop(); [![NPM version](https://badge.fury.io/js/chronoman.png)](http://badge.fury.io/js/chronoman) [![Build Status](https://secure.travis-ci.org/gamtiq/chronoman.png?branch=master)](http://travis-ci.org/gamtiq/chronoman) -[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/) +[![Built with Grunt](https://gruntjs.com/cdn/builtwith.png)](http://gruntjs.com/) ## Installation diff --git a/dist/chronoman.common.js b/dist/chronoman.common.js index 7b74925..1d61c0c 100644 --- a/dist/chronoman.common.js +++ b/dist/chronoman.common.js @@ -671,7 +671,7 @@ Timer.prototype.onExecute = null; * * * @return {Object} @@ -745,3 +745,4 @@ Timer.prototype.toString = function () { exports.default = Timer; module.exports = exports.default; +//# sourceMappingURL=chronoman.common.js.map diff --git a/dist/chronoman.common.js.map b/dist/chronoman.common.js.map new file mode 100644 index 0000000..82f87c6 --- /dev/null +++ b/dist/chronoman.common.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../chronoman.js"],"names":["Array","isArray","value","Object","prototype","toString","call","Timer","initValue","that","_onTimeoutEnd","_timeoutId","execute","setProperties","_period","getPeriod","setPeriod","period","getPeriodValue","execQty","getExecutionQty","length","_recurrent","isRecurrent","setRecurrent","bRecurrent","_repeatQty","getRepeatQty","setRepeatQty","nQty","_repeatTest","getRepeatTest","setRepeatTest","test","_data","getData","setData","data","_executionQty","_setTimeout","nTimeout","setTimeout","_clearTimeout","clearTimeout","_active","isActive","setActive","bActive","start","property","propType","stop","_action","getAction","setAction","action","_passToAction","isPassToAction","setPassToAction","bPass","propMap","recurrent","repeatQty","repeatTest","active","passToAction","onExecute","bPassToAction","dispose","join"],"mappings":";;;;;;;;AAAA;;;;;;AAOA,IAAI,CAAEA,MAAMC,OAAZ,EAAqB;AACjBD,UAAMC,OAAN,GAAgB,UAASC,KAAT,EAAgB;AAC5B,eAAOC,OAAOC,SAAP,CAAiBC,QAAjB,CAA0BC,IAA1B,CAA+BJ,KAA/B,MAA0C,gBAAjD;AACH,KAFD;AAGH;;AAED;;;;;;AAMA;;;;;;AAMA;;;;;;;;AAQA;;;;;;AAOA;;;;;;;;;AASA,IAAIK,QAAQ,SAASA,KAAT,CAAeC,SAAf,EAA0B;;AAElC,QAAIC,OAAO,IAAX;;AAEA;;;;;;;;;AASA,SAAKC,aAAL,GAAqB,YAAW;AAC5BD,aAAKE,UAAL,GAAkB,IAAlB;AACAF,aAAKG,OAAL;AACH,KAHD;;AAKA,QAAIJ,aAAa,QAAOA,SAAP,yCAAOA,SAAP,OAAqB,QAAtC,EAAgD;AAC5C,aAAKK,aAAL,CAAmBL,SAAnB;AACH;AACJ,CArBD;;AAwBA;;;;;;;;;;;;;;;;;;;;;AAqBAD,MAAMH,SAAN,CAAgBU,OAAhB,GAA0B,IAA1B;;AAEA;;;;;;;;AAQAP,MAAMH,SAAN,CAAgBW,SAAhB,GAA4B,YAAW;AACnC,WAAO,KAAKD,OAAZ;AACH,CAFD;;AAIA;;;;;;;;;;AAUAP,MAAMH,SAAN,CAAgBY,SAAhB,GAA4B,UAASC,MAAT,EAAiB;AACzC,SAAKH,OAAL,GAAeG,MAAf;AACA,WAAO,IAAP;AACH,CAHD;;AAKA;;;;;;;;;;AAUAV,MAAMH,SAAN,CAAg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B;AACH,KARD,MASK,IAAI8B,WAAW,CAAE,KAAKpC,UAAtB,EAAkC;AACnC,aAAKiC,OAAL,GAAe,KAAf;AACH;AACD,WAAO,IAAP;AACH,CAxCD;;AA0CA;;;;;AAKArC,MAAMH,SAAN,CAAgBgE,OAAhB,GAA0B,YAAW;AACjC;;AACA,SAAK1B,aAAL;AACA,SAAKU,OAAL,GACI,KAAKlB,KAAL,GACA,KAAKpB,OAAL,GACA,KAAKgB,WAAL,GACA,KAAKoC,SAAL,GACI,IALR;AAMH,CATD;;AAWA;;;;;AAKA3D,MAAMH,SAAN,CAAgBC,QAAhB,GAA2B,YAAW;AAClC;;AACA,QAAIY,SAAS,KAAKF,SAAL,EAAb;AACA,WAAO,CACC,SADD,EAEC,WAFD,EAEc,KAAK8B,QAAL,EAFd,EAGC,aAHD,EAGgB,OAAO5B,MAAP,KAAkB,UAAlB,GAA+B,UAA/B,GAA4CA,MAH5D,EAIC,gBAJD,EAImB,KAAKM,WAAL,EAJnB,EAKC,iBALD,EAKoB,KAAKI,YAAL,EALpB,EAMC,kBAND,EAMsB,KAAKI,aAAL,KAAuB,WAAvB,GAAqC,IAN3D,EAOC,qBAPD,EAOwB,KAAK0B,cAAL,EAPxB,EAQC,aARD,EAQiB,KAAKJ,SAAL,KAAmB,WAAnB,GAAiC,IARlD,EASC,oBATD,EASuB,KAAKjC,eAAL,EATvB,EAUC,WAVD,EAUc,KAAKe,OAAL,EAVd,EAWGkC,IAXH,CAWQ,EAXR,CAAP;AAYH,CAfD;;AAiBA;;kBAEe9D,K","file":"chronoman.common.js","sourcesContent":["/**\n * @module chronoman\n * \n * @author Denis Sikuler\n */\n\n\nif (! Array.isArray) {\n Array.isArray = function(value) {\n return Object.prototype.toString.call(value) === \"[object Array]\";\n };\n}\n\n/**\n * @callback module:chronoman~GetPeriodValue\n * @param {module:chronoman~Timer} [timer]\n * @return {Integer | Integer[]}\n */\n\n/**\n * Value determining time period in milliseconds that is used to schedule related action execution.\n *\n * @typedef {Integer | Integer[] | module:chronoman~GetPeriodValue} module:chronoman~PeriodValue\n */\n\n/**\n * Object describing action that should be executed after time period is elapsed.\n *\n * @typedef {Object} module:chronoman~ActionObject\n * @property {Function} execute\n * Function that should be executed.\n */\n\n/**\n * Action that should be executed after time period is elapsed.\n *\n * @typedef {Function | module:chronoman~ActionObject} module:chronoman~Action\n */\n\n\n/**\n * Utility class to simplify use of timers created by setTimeout.\n * \n * @param {Object} [initValue]\n * Specifies initial property values. Keys are property names, their values are values of corresponding properties.\n * See {@link module:chronoman~Timer#setProperties setProperties} for details.\n * @constructor\n * @see {@link module:chronoman~Timer#setProperties setProperties}\n */\nvar Timer = function Timer(initValue) {\n \n var that = this;\n \n /**\n * Handle timeout's end.\n *\n * @instance\n * @method\n * @protected\n * @see {@link module:chronoman~Timer#_timeoutId _timeoutId}\n * @see {@link module:chronoman~Timer#execute execute}\n */\n this._onTimeoutEnd = function() {\n that._timeoutId = null;\n that.execute();\n };\n\n if (initValue && typeof initValue === \"object\") {\n this.setProperties(initValue);\n }\n};\n\n\n/**\n * Time period in milliseconds, array of periods or function that returns period or array of periods.\n * A related action will be executed when the period is elapsed.\n *
\n * When array of periods is set the used period is selected in the following way:\n * first array item (with index 0) specifies period before first action's execution,\n * second array item (with index 1) specifies period before second action's execution,\n * and so on.\n * When quantity of action executions is more than array's length\n * the last item of array is used as period for subsequent executions.\n *
\n * When function is set its returned value is used to determine next period.\n * The timer instance to which the function is associated will be passed as function's parameter.\n * When function returns an array of periods the array is used to select period before next execution\n * according to rules described above.\n *\n * @protected\n * @type {module:chronoman~PeriodValue}\n * @see {@link module:chronoman~Timer#execute execute}\n * @see {@link module:chronoman~Timer#setActive setActive}\n */\nTimer.prototype._period = null;\n\n/**\n * Return value determining time period that is used to schedule related action execution.\n *\n * @return {module:chronoman~PeriodValue}\n * Value determining time period.\n * @method\n * @see {@link module:chronoman~Timer#_period _period}\n */\nTimer.prototype.getPeriod = function() {\n return this._period;\n};\n\n/**\n * Set value determining time period that is used to schedule related action execution.\n *\n * @param {module:chronoman~PeriodValue} period\n * Value determining time period.\n * @return {Object}\n * Reference to this object.\n * @method\n * @see {@link module:chronoman~Timer#_period _period}\n */\nTimer.prototype.setPeriod = function(period) {\n this._period = period;\n return this;\n};\n\n/**\n * Return time period that will be used to schedule related action execution.\n *\n * @return {Integer}\n * Time period in milliseconds.\n * @method\n * @see {@link module:chronoman~Timer#_period _period}\n * @see {@link module:chronoman~Timer#getPeriod getPeriod}\n * @see {@link module:chronoman~Timer#getExecutionQty getExecutionQty}\n */\nTimer.prototype.getPeriodValue = function() {\n var execQty;\n var period = this.getPeriod();\n if (typeof period === \"function\") {\n period = period(this);\n }\n if (Array.isArray(period)) {\n execQty = this.getExecutionQty();\n period = period[ execQty < period.length ? execQty : period.length - 1 ];\n }\n return period;\n};\n\n/**\n * Indicates whether related action should be executed repeatedly.\n * \n * @protected\n * @type {Boolean}\n * @see {@link module:chronoman~Timer#execute execute}\n * @see {@link module:chronoman~Timer#setActive setActive}\n */\nTimer.prototype._recurrent = false;\n\n/**\n * Test whether related action should be executed repeatedly.\n *\n * @return {Boolean}\n * true, if related action should be executed repeatedly, otherwise false.\n * @method\n * @see {@link module:chronoman~Timer#_recurrent _recurrent}\n */\nTimer.prototype.isRecurrent = function() {\n return this._recurrent;\n};\n\n/**\n * Set or cancel repeating of related action execution.\n *\n * @param {Boolean} bRecurrent\n * true, if action should be executed repeatedly, false, if action repeating should be off.\n * @return {Object}\n * Reference to this object.\n * @method\n * @see {@link module:chronoman~Timer#_recurrent _recurrent}\n */\nTimer.prototype.setRecurrent = function(bRecurrent) {\n this._recurrent = bRecurrent;\n return this;\n};\n\n/**\n * Specifies how many times related action should be repeated after first execution.\n *\n * @protected\n * @type {Integer}\n * @see {@link module:chronoman~Timer#execute execute}\n * @see {@link module:chronoman~Timer#setActive setActive}\n */\nTimer.prototype._repeatQty = 0;\n\n/**\n * Return the value that indicates how many times related action should be repeated after first execution.\n *\n * @return {Integer}\n * Value that indicates how many times related action should be repeated after first execution.\n * @method\n * @see {@link module:chronoman~Timer#_repeatQty _repeatQty}\n */\nTimer.prototype.getRepeatQty = function() {\n return this._repeatQty;\n};\n\n/**\n * Set how many times related action should be repeated after first execution.\n *\n * @param {Integer} nQty\n * Value that indicates how many times related action should be repeated after first execution.\n * @return {Object}\n * Reference to this object.\n * @method\n * @see {@link module:chronoman~Timer#_repeatQty _repeatQty}\n */\nTimer.prototype.setRepeatQty = function(nQty) {\n this._repeatQty = nQty;\n return this;\n};\n\n/**\n * Specifies function that should be called after action execution to determine\n * whether execution should be repeated.\n * If the function returns a true value or non-negative number it means that execution will be repeated.\n * When the function returns non-negative number this number will be used\n * as time period in milliseconds to schedule next action execution.\n *
\n * The timer instance to which the test is associated will be passed as function's parameter.\n *\n * @protected\n * @type {Function}\n * @see {@link module:chronoman~Timer#execute execute}\n * @see {@link module:chronoman~Timer#setActive setActive}\n */\nTimer.prototype._repeatTest = null;\n\n/**\n * Return the function that is used to determine whether action execution should be repeated.\n *\n * @return {Function}\n * Function that is used to determine whether action execution should be repeated.\n * @method\n * @see {@link module:chronoman~Timer#_repeatTest _repeatTest}\n */\nTimer.prototype.getRepeatTest = function() {\n return this._repeatTest;\n};\n\n/**\n * Set the function that should be used to determine whether action execution should be repeated.\n *\n * @param {Function} test\n * Function that should be used to determine whether action execution should be repeated.\n * @return {Object}\n * Reference to this object.\n * @method\n * @see {@link module:chronoman~Timer#_repeatTest _repeatTest}\n */\nTimer.prototype.setRepeatTest = function(test) {\n this._repeatTest = test;\n return this;\n};\n\n/**\n * Auxiliary data associated with the timer instance.\n *\n * @protected\n * @type {*}\n */\nTimer.prototype._data = null;\n\n/**\n * Return auxiliary data associated with the timer instance.\n *\n * @return {*}\n * Auxiliary data associated with the timer instance.\n * @method\n * @see {@link module:chronoman~Timer#_data _data}\n */\nTimer.prototype.getData = function() {\n return this._data;\n};\n\n/**\n * Set auxiliary data associated with the timer instance.\n *\n * @param {*} data\n * Auxiliary data associated with the timer instance.\n * @return {Object}\n * Reference to this object.\n * @method\n * @see {@link module:chronoman~Timer#_data _data}\n */\nTimer.prototype.setData = function(data) {\n this._data = data;\n return this;\n};\n\n/**\n * Specifies how many times action was executed.\n *\n * @protected\n * @type {Integer}\n * @see {@link module:chronoman~Timer#execute execute}\n * @see {@link module:chronoman~Timer#setActive setActive}\n */\nTimer.prototype._executionQty = 0;\n\n/**\n * Return the value that indicates how many times action was executed.\n *\n * @return {Integer}\n * Value that indicates how many times action was executed.\n * @method\n * @see {@link module:chronoman~Timer#_executionQty _executionQty}\n */\nTimer.prototype.getExecutionQty = function() {\n return this._executionQty;\n};\n\n/**\n * Timer id.\n * \n * @protected\n * @type {Integer}\n * @see {@link module:chronoman~Timer#_clearTimeout _clearTimeout}\n * @see {@link module:chronoman~Timer#_setTimeout _setTimeout}\n */\nTimer.prototype._timeoutId = null;\n\n/**\n * Schedule related action execution.\n *\n * @param {Integer} [nTimeout]\n * Time period in milliseconds that is used to schedule action execution.\n * By default the current value of {@link module:chronoman~Timer#getPeriod period} property is used\n * to determine time period.\n * @return {Object}\n * Reference to this object.\n * @method\n * @protected\n * @see {@link module:chronoman~Timer#_clearTimeout _clearTimeout}\n * @see {@link module:chronoman~Timer#_onTimeoutEnd _onTimeoutEnd}\n * @see {@link module:chronoman~Timer#_timeoutId _timeoutId}\n * @see {@link module:chronoman~Timer#execute execute}\n * @see {@link module:chronoman~Timer#getPeriodValue getPeriodValue}\n */\nTimer.prototype._setTimeout = function(nTimeout) {\n \"use strict\";\n var period;\n if (typeof nTimeout === \"number\") {\n period = nTimeout;\n }\n else {\n period = this.getPeriodValue();\n }\n if (typeof period === \"number\") {\n this._timeoutId = setTimeout(this._onTimeoutEnd, period);\n }\n return this;\n};\n\n/**\n * Cancel execution of scheduled action.\n *\n * @return {Object}\n * Reference to this object.\n * @method\n * @protected\n * @see {@link module:chronoman~Timer#_setTimeout _setTimeout}\n * @see {@link module:chronoman~Timer#_timeoutId _timeoutId}\n */\nTimer.prototype._clearTimeout = function() {\n \"use strict\";\n if (this._timeoutId) {\n clearTimeout(this._timeoutId);\n this._timeoutId = null;\n }\n return this;\n};\n\n/**\n * Indicates whether timer is in use.\n * \n * @protected\n * @type {Boolean}\n * @see {@link module:chronoman~Timer#execute execute}\n */\nTimer.prototype._active = false;\n\n/**\n * Test whether timer is in use.\n *\n * @return {Boolean}\n * true, if timer is in use, otherwise false.\n * @method\n * @see {@link module:chronoman~Timer#_active _active}\n */\nTimer.prototype.isActive = function() {\n return this._active;\n};\n\n/**\n * Set or cancel timer usage.\n * Depending of this schedules related action execution or cancels action execution.\n *
\n * Consecutive calling with bActive = true leads to related action execution delaying.\n *\n * @param {Boolean} bActive\n * true to schedule related action execution, false to cancel action execution.\n * @return {Object}\n * Reference to this object.\n * @method\n * @see {@link module:chronoman~Timer#_active _active}\n * @see {@link module:chronoman~Timer#_executionQty _executionQty}\n * @see {@link module:chronoman~Timer#execute execute}\n */\nTimer.prototype.setActive = function(bActive) {\n \"use strict\";\n if (bActive && ! this._active) {\n this._executionQty = 0;\n }\n this._active = bActive;\n // Consecutive calling with bActive = true leads to action execution delaying\n this._clearTimeout();\n if (bActive) {\n this._setTimeout();\n }\n return this;\n};\n\n/**\n * Start timer usage (make it active).\n *\n * @param {module:chronoman~PeriodValue | Object} [property]\n * Time period in milliseconds that is used to schedule related action execution\n * (new value for {@link module:chronoman~Timer#setPeriod period} property)\n * or object that specifies new values for timer properties (see {@link module:chronoman~Timer#setProperties setProperties}).\n * The current value of {@link module:chronoman~Timer#getPeriod period} property is used by default.\n * @return {Object}\n * Reference to this object.\n * @method\n * @see {@link module:chronoman~Timer#setActive setActive}\n * @see {@link module:chronoman~Timer#setPeriod setPeriod}\n * @see {@link module:chronoman~Timer#setProperties setProperties}\n * @see {@link module:chronoman~Timer#stop stop}\n */\nTimer.prototype.start = function(property) {\n \"use strict\";\n var propType = typeof property;\n if (propType === \"number\" || propType === \"function\" || Array.isArray(property)) {\n this.setPeriod(property);\n }\n else if (property && propType === \"object\") {\n this.setProperties(property);\n }\n return this.setActive(true);\n};\n\n/**\n * Stop timer usage (make it inactive).\n *\n * @return {Object}\n * Reference to this object.\n * @method\n * @see {@link module:chronoman~Timer#setActive setActive}\n * @see {@link module:chronoman~Timer#start start}\n */\nTimer.prototype.stop = function() {\n return this.setActive(false);\n};\n\n/**\n * Related action that should be executed after time period is elapsed.\n *
\n * Can be a function or an object having execute method.\n *
\n * The timer instance to which the action is associated will be passed as function's/method's parameter\n * if {@link module:chronoman~Timer#setPassToAction passToAction} property is set to true.\n *\n * @protected\n * @type {module:chronoman~Action}\n * @see {@link module:chronoman~Timer#execute execute}\n */\nTimer.prototype._action = null;\n\n/**\n * Return value that represents action.\n *\n * @return {module:chronoman~Action}\n * Function that represents action.\n * @method\n * @see {@link module:chronoman~Timer#_action _action}\n */\nTimer.prototype.getAction = function() {\n return this._action;\n};\n\n/**\n * Set value which represents action that should be executed after time period is elapsed.\n *\n * @param {module:chronoman~Action} action\n * Value that represents action.\n * @return {Object}\n * Reference to this object.\n * @method\n * @see {@link module:chronoman~Timer#_action _action}\n */\nTimer.prototype.setAction = function(action) {\n this._action = action;\n return this;\n};\n\n/**\n * Indicates whether the timer instance (this) should be passed into action function when the function is called.\n * \n * @protected\n * @type {Boolean}\n * @see {@link module:chronoman~Timer#execute execute}\n */\nTimer.prototype._passToAction = false;\n\n/**\n * Test whether the timer instance should be passed into action function when the function is called.\n *\n * @return {Boolean}\n * true, if the timer instance should be passed, otherwise false.\n * @method\n * @see {@link module:chronoman~Timer#_passToAction _passToAction}\n */\nTimer.prototype.isPassToAction = function() {\n return this._passToAction;\n};\n\n/**\n * Set or cancel passing of timer instance into action function.\n *\n * @param {Boolean} bPass\n * true, if the timer instance should be passed into action function, \n * false, if the instance should not be passed.\n * @return {Object}\n * Reference to this object.\n * @method\n * @see {@link module:chronoman~Timer#_passToAction _passToAction}\n */\nTimer.prototype.setPassToAction = function(bPass) {\n this._passToAction = bPass;\n return this;\n};\n\n/**\n * Set timer properties.\n *\n * @param {Object} propMap\n * Specifies property values. Keys are property names, their values are values of corresponding properties.\n * The following keys (properties) can be specified:\n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n * \n *
NameTypeDescription
actionFunctionRelated action that should be executed after time period is elapsed.
activeBooleanWhether timer usage should be immediately started.
dataAnyAuxiliary data associated with the timer instance.
passToActionBooleanWhether the timer instance should be passed into action function when the function is called.
periodmodule:chronoman~PeriodValueValue determining time period in milliseconds that is used to schedule related action execution.
recurrentBooleanWhether related action should be executed repeatedly.
repeatQtyIntegerHow many times related action should be repeated after first execution.
repeatTestFunctionFunction that should be used to determine whether action execution should be repeated.
\n * @return {Object}\n * Reference to this object.\n * @method\n * @see {@link module:chronoman~Timer#setAction setAction}\n * @see {@link module:chronoman~Timer#setActive setActive}\n * @see {@link module:chronoman~Timer#setData setData}\n * @see {@link module:chronoman~Timer#setPassToAction setPassToAction}\n * @see {@link module:chronoman~Timer#setPeriod setPeriod}\n * @see {@link module:chronoman~Timer#setRecurrent setRecurrent}\n * @see {@link module:chronoman~Timer#setRepeatQty setRepeatQty}\n * @see {@link module:chronoman~Timer#setRepeatTest setRepeatTest}\n */\nTimer.prototype.setProperties = function(propMap) {\n if (propMap && typeof propMap === \"object\") {\n if (\"action\" in propMap) {\n this.setAction(propMap.action);\n }\n if (\"period\" in propMap) {\n this.setPeriod(propMap.period);\n }\n if (\"recurrent\" in propMap) {\n this.setRecurrent(propMap.recurrent);\n }\n if (\"repeatQty\" in propMap) {\n this.setRepeatQty(propMap.repeatQty);\n }\n if (\"repeatTest\" in propMap) {\n this.setRepeatTest(propMap.repeatTest);\n }\n if (\"active\" in propMap) {\n this.setActive(propMap.active);\n }\n if (\"passToAction\" in propMap) {\n this.setPassToAction(propMap.passToAction);\n }\n if (\"data\" in propMap) {\n this.setData(propMap.data);\n }\n }\n return this;\n};\n\n/**\n * Function that should be executed after time period is elapsed.\n *
\n * The timer instance to which the function is associated will be passed as function's parameter\n * if {@link module:chronoman~Timer#setPassToAction passToAction} property is set to true.\n *\n * @type {Function}\n * @see {@link module:chronoman~Timer#execute execute}\n */\nTimer.prototype.onExecute = null;\n\n/**\n * Execute related action (function).\n *
\n * The timer instance to which the action is associated will be passed as function's parameter\n * if {@link module:chronoman~Timer#setPassToAction passToAction} property is set to true.\n *
\n * Action's next execution will be scheduled when one of the following conditions is true:\n * \n *\n * @return {Object}\n * Reference to this object.\n * @method\n * @see {@link module:chronoman~Timer#_active _active}\n * @see {@link module:chronoman~Timer#_executionQty _executionQty}\n * @see {@link module:chronoman~Timer#getAction getAction}\n * @see {@link module:chronoman~Timer#getRepeatQty getRepeatQty}\n * @see {@link module:chronoman~Timer#getRepeatTest getRepeatTest}\n * @see {@link module:chronoman~Timer#isActive isActive}\n * @see {@link module:chronoman~Timer#isPassToAction isPassToAction}\n * @see {@link module:chronoman~Timer#isRecurrent isRecurrent}\n * @see {@link module:chronoman~Timer#onExecute onExecute}\n */\nTimer.prototype.execute = function() {\n \"use strict\";\n /*jshint expr:true, laxbreak:true*/\n var action = this.getAction(),\n bPassToAction = this.isPassToAction(),\n repeatTest = this.getRepeatTest(),\n bActive, period;\n this._clearTimeout();\n if (action) {\n if (typeof action === \"function\") {\n bPassToAction\n ? action(this)\n : action();\n }\n else if (typeof action.execute === \"function\") {\n bPassToAction\n ? action.execute(this)\n : action.execute();\n }\n }\n if (typeof this.onExecute === \"function\") {\n bPassToAction\n ? this.onExecute(this)\n : this.onExecute();\n }\n this._executionQty++;\n bActive = this.isActive();\n if (bActive\n && (this.isRecurrent()\n || this.getRepeatQty() >= this._executionQty\n || (repeatTest\n && ( (period = repeatTest(this)) || period === 0 )\n && (typeof period !== \"number\" || period >= 0))\n ) ) {\n this._setTimeout(period);\n }\n else if (bActive && ! this._timeoutId) {\n this._active = false;\n }\n return this;\n};\n\n/**\n * Free resources that are allocated for object.\n *\n * @method\n */\nTimer.prototype.dispose = function() {\n \"use strict\";\n this._clearTimeout();\n this._action =\n this._data =\n this._period =\n this._repeatTest =\n this.onExecute =\n null;\n};\n\n/**\n * Convert object into string.\n *\n * @method\n */\nTimer.prototype.toString = function() {\n \"use strict\";\n var period = this.getPeriod();\n return [\n \"Timer: \",\n \"active - \", this.isActive(),\n \", period - \", typeof period === \"function\" ? \"function\" : period,\n \", recurrent - \", this.isRecurrent(),\n \", repeat qty - \", this.getRepeatQty(),\n \", repeat test - \", (this.getRepeatTest() ? \"specified\" : \"no\"),\n \", pass to action - \", this.isPassToAction(),\n \", action - \", (this.getAction() ? \"specified\" : \"no\"),\n \", execution qty - \", this.getExecutionQty(),\n \", data - \", this.getData()\n ].join(\"\");\n};\n\n// Exports\n\nexport default Timer;\n"]} \ No newline at end of file diff --git a/dist/chronoman.js b/dist/chronoman.js index 8860123..b26be64 100644 --- a/dist/chronoman.js +++ b/dist/chronoman.js @@ -686,7 +686,7 @@ Timer.prototype.onExecute = null; * * * @return {Object} @@ -760,6 +760,7 @@ Timer.prototype.toString = function () { exports.default = Timer; module.exports = exports.default; +//# sourceMappingURL=chronoman.common.js.map return Timer; })); diff --git a/dist/chronoman.min.js b/dist/chronoman.min.js index f4353e3..462085e 100644 --- a/dist/chronoman.min.js +++ b/dist/chronoman.min.js @@ -1 +1,2 @@ -!function(e,t){if(void 0===e&&void 0!==window&&(e=window),"object"==typeof module&&module.exports)module.exports=t(require,exports,module);else if("function"==typeof define&&define.amd)define(["require","exports","module"],t);else{var i=e,o={exports:i};e.Chronoman=t(function(t){return e[t]},i,o)}}(this,function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)});var r=function(t){var e=this;this._onTimeoutEnd=function(){e._timeoutId=null,e.execute()},t&&"object"===(void 0===t?"undefined":o(t))&&this.setProperties(t)};return r.prototype._period=null,r.prototype.getPeriod=function(){return this._period},r.prototype.setPeriod=function(t){return this._period=t,this},r.prototype.getPeriodValue=function(){var t,e=this.getPeriod();return"function"==typeof e&&(e=e(this)),Array.isArray(e)&&(e=e[(t=this.getExecutionQty())=this._executionQty||r&&((e=r(this))||0===e)&&("number"!=typeof e||0<=e))?this._setTimeout(e):t&&!this._timeoutId&&(this._active=!1),this},r.prototype.dispose=function(){this._clearTimeout(),this._action=this._data=this._period=this._repeatTest=this.onExecute=null},r.prototype.toString=function(){var t=this.getPeriod();return["Timer: ","active - ",this.isActive(),", period - ","function"==typeof t?"function":t,", recurrent - ",this.isRecurrent(),", repeat qty - ",this.getRepeatQty(),", repeat test - ",this.getRepeatTest()?"specified":"no",", pass to action - ",this.isPassToAction(),", action - ",this.getAction()?"specified":"no",", execution qty - ",this.getExecutionQty(),", data - ",this.getData()].join("")},e.default=r,i.exports=e.default,r}); \ No newline at end of file +!function(e,t){if(void 0===e&&void 0!==window&&(e=window),"object"==typeof module&&module.exports)module.exports=t(require,exports,module);else if("function"==typeof define&&define.amd)define(["require","exports","module"],t);else{var i={exports:e};e.Chronoman=t(function(t){return e[t]},e,i)}}(this,function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)});function r(t){var e=this;this._onTimeoutEnd=function(){e._timeoutId=null,e.execute()},t&&"object"===(void 0===t?"undefined":o(t))&&this.setProperties(t)}return r.prototype._period=null,r.prototype.getPeriod=function(){return this._period},r.prototype.setPeriod=function(t){return this._period=t,this},r.prototype.getPeriodValue=function(){var t,e=this.getPeriod();return"function"==typeof e&&(e=e(this)),Array.isArray(e)&&(e=e[(t=this.getExecutionQty())=this._executionQty||r&&((e=r(this))||0===e)&&("number"!=typeof e||0<=e))?this._setTimeout(e):t&&!this._timeoutId&&(this._active=!1),this},r.prototype.dispose=function(){this._clearTimeout(),this._action=this._data=this._period=this._repeatTest=this.onExecute=null},r.prototype.toString=function(){var t=this.getPeriod();return["Timer: ","active - ",this.isActive(),", period - ","function"==typeof t?"function":t,", recurrent - ",this.isRecurrent(),", repeat qty - ",this.getRepeatQty(),", repeat test - ",this.getRepeatTest()?"specified":"no",", pass to action - ",this.isPassToAction(),", action - ",this.getAction()?"specified":"no",", execution qty - ",this.getExecutionQty(),", data - ",this.getData()].join("")},e.default=r,i.exports=e.default,r}); +//# sourceMappingURL=chronoman.min.js.map \ No newline at end of file diff --git a/dist/chronoman.min.js.map b/dist/chronoman.min.js.map new file mode 100644 index 0000000..359346d --- /dev/null +++ b/dist/chronoman.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["chronoman.js"],"names":["root","factory","undefined","window","module","exports","require","define","amd","mod","id","this","Object","defineProperty","value","_typeof","Symbol","iterator","obj","constructor","prototype","Array","isArray","toString","call","Timer","initValue","that","_onTimeoutEnd","_timeoutId","execute","setProperties","_period","getPeriod","setPeriod","period","getPeriodValue","execQty","getExecutionQty","length","_recurrent","isRecurrent","setRecurrent","bRecurrent","_repeatQty","getRepeatQty","setRepeatQty","nQty","_repeatTest","getRepeatTest","setRepeatTest","test","_data","getData","setData","data","_executionQty","_setTimeout","nTimeout","setTimeout","_clearTimeout","clearTimeout","_active","isActive","setActive","bActive","start","property","propType","stop","_action","getAction","setAction","action","_passToAction","isPassToAction","setPassToAction","bPass","propMap","recurrent","repeatQty","repeatTest","active","passToAction","onExecute","bPassToAction","dispose","join","default"],"mappings":"CAAC,SAASA,EAAMC,GAEZ,QADaC,IAATF,QAAiCE,IAAXC,SAAsBH,EAAOG,QACjC,iBAAXC,QA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AlBAtC,KAAKiD,gBACDa,IACsB,mBAAXA,EACPY,EAAgBZ,EAAO9D,MAAQ8D,IACE,mBAAnBA,EAAO3C,UACrBuD,EAAgBZ,EAAO3C,QAAQnB,MAAQ8D,EAAO3C,YAGxB,mBAAnBnB,KAAKyE,YACZC,EAAgB1E,KAAKyE,UAAUzE,MAAQA,KAAKyE,aAEhDzE,KAAK6C,iBACLS,EAAUtD,KAAKoD,cACCpD,KAAK8B,eAAiB9B,KAAKkC,gBAAkBlC,KAAK6C,eAAiByB,KAAgB9C,EAAS8C,EAAWtE,QAAqB,IAAXwB,KAAoC,iBAAXA,GAAiC,GAAVA,IAC7KxB,KAAK8C,YAAYtB,GACV8B,IAAYtD,KAAKkB,aACxBlB,KAAKmD,SAAU,GAEZnD,MAQXc,EAAML,UAAUkE,QAAU,WAGtB3E,KAAKiD,gBACLjD,KAAK2D,QAAU3D,KAAKyC,MAAQzC,KAAKqB,QAAUrB,KAAKqC,YAAcrC,KAAKyE,UAAY,MAQnF3D,EAAML,UAAUG,SAAW,WAGvB,IAAIY,EAASxB,KAAKsB,YAClB,MAAO,CAAC,UAAW,YAAatB,KAAKoD,WAAY,cAAiC,mBAAX5B,EAAwB,WAAaA,EAAQ,iBAAkBxB,KAAK8B,cAAe,kBAAmB9B,KAAKkC,eAAgB,mBAAoBlC,KAAKsC,gBAAkB,YAAc,KAAM,sBAAuBtC,KAAKgE,iBAAkB,cAAehE,KAAK4D,YAAc,YAAc,KAAM,qBAAsB5D,KAAK2B,kBAAmB,YAAa3B,KAAK0C,WAAWkC,KAAK,KAKzblF,EAAQmF,QAAU/D,EAClBrB,EAAOC,QAAUA,EAAQmF,QAGlB/D","file":"chronoman.min.js"} \ No newline at end of file diff --git a/doc/chronoman.js.html b/doc/chronoman.js.html index 2440cc2..11d74cb 100644 --- a/doc/chronoman.js.html +++ b/doc/chronoman.js.html @@ -513,7 +513,7 @@

Source: chronoman.js

* * @param {module:chronoman~PeriodValue | Object} [property] * Time period in milliseconds that is used to schedule related action execution - * (new value for {@link module:chronoman~Timer#setPeriod period} property) + * new value for {@link module:chronoman~Timer#setPeriod period} property * or object that specifies new values for timer properties (see {@link module:chronoman~Timer#setProperties setProperties}). * The current value of {@link module:chronoman~Timer#getPeriod period} property is used by default. * @return {Object} @@ -885,9 +885,9 @@ - Documentation generated by JSDoc 3.5.5 + Documentation generated by JSDoc 3.6.3 - on 2019-12-26T01:06:09+03:00 + on 2019-12-29T01:03:46+03:00 using the DocStrap template. diff --git a/doc/classes.list.html b/doc/classes.list.html index ef82293..a995024 100644 --- a/doc/classes.list.html +++ b/doc/classes.list.html @@ -204,9 +204,9 @@ - Documentation generated by JSDoc 3.5.5 + Documentation generated by JSDoc 3.6.3 - on 2019-12-26T01:06:09+03:00 + on 2019-12-29T01:03:46+03:00 using the DocStrap template. diff --git a/doc/index.html b/doc/index.html index da6008f..46eb5a7 100644 --- a/doc/index.html +++ b/doc/index.html @@ -106,7 +106,7 @@ ... timer.stop();

NPM version Build Status -Built with Grunt

+Built with Grunt

Installation

Node

npm install chronoman

JSPM

jspm install chronoman

Bower

bower install chronoman

AMD, <script>

Use dist/chronoman.js or dist/chronoman.min.js (minified version).

Usage

ECMAScript 6/2015

import Timer from "chronoman";

Node, JSPM

var Timer = require("chronoman");

JSPM

System.import("chronoman").then(function(Timer) {
     ...
@@ -207,9 +207,9 @@ 
 	
 
 
-	Documentation generated by JSDoc 3.5.5
+	Documentation generated by JSDoc 3.6.3
 	
-		on 2019-12-26T01:06:09+03:00
+		on 2019-12-29T01:03:46+03:00
 	
 	using the DocStrap template.
 
diff --git a/doc/module-chronoman-Timer.html b/doc/module-chronoman-Timer.html
index 096e1cc..2465eec 100644
--- a/doc/module-chronoman-Timer.html
+++ b/doc/module-chronoman-Timer.html
@@ -4776,8 +4776,8 @@ 
Parameters:

Time period in milliseconds that is used to schedule related action execution - (new value for period property) - or object that specifies new values for timer properties (see setProperties). + new value for period property + or object that specifies new values for timer properties (see setProperties). The current value of period property is used by default.

@@ -5150,9 +5150,9 @@ - Documentation generated by JSDoc 3.5.5 + Documentation generated by JSDoc 3.6.3 - on 2019-12-26T01:06:09+03:00 + on 2019-12-29T01:03:46+03:00 using the DocStrap template. diff --git a/doc/module-chronoman.html b/doc/module-chronoman.html index 14c9aa9..ce3826e 100644 --- a/doc/module-chronoman.html +++ b/doc/module-chronoman.html @@ -698,9 +698,9 @@ - Documentation generated by JSDoc 3.5.5 + Documentation generated by JSDoc 3.6.3 - on 2019-12-26T01:06:09+03:00 + on 2019-12-29T01:03:46+03:00 using the DocStrap template. diff --git a/doc/modules.list.html b/doc/modules.list.html index a11e5dc..05072c9 100644 --- a/doc/modules.list.html +++ b/doc/modules.list.html @@ -204,9 +204,9 @@ - Documentation generated by JSDoc 3.5.5 + Documentation generated by JSDoc 3.6.3 - on 2019-12-26T01:06:09+03:00 + on 2019-12-29T01:03:46+03:00 using the DocStrap template. diff --git a/doc/quicksearch.html b/doc/quicksearch.html index e483c35..6e39790 100644 --- a/doc/quicksearch.html +++ b/doc/quicksearch.html @@ -7,7 +7,7 @@