From 721f7aff1de8cc8a1d325c72b2e5a1a4d9057794 Mon Sep 17 00:00:00 2001 From: Karen Date: Wed, 17 May 2017 12:42:53 +0600 Subject: [PATCH] goNextTimeout and onStepRender --- classes/Step.js | 2 +- classes/StepSystem.js | 21 +++++++++++++++++---- example/dist/app.js | 26 +++++++++++++++++++++----- example/dist/app.js.map | 2 +- 4 files changed, 40 insertions(+), 11 deletions(-) diff --git a/classes/Step.js b/classes/Step.js index 36f1aa9..7150203 100644 --- a/classes/Step.js +++ b/classes/Step.js @@ -7,7 +7,7 @@ export class Step { this.template = params.template || '' this.ignore_progress = params.ignore_progress || false this.from = null - this._data = {} + this._data = params.data || {} params.interceptors = params.interceptors || {} this.interceptors = { beforeRender: params.interceptors.beforeRender || this.methods.beforeRender || function () { diff --git a/classes/StepSystem.js b/classes/StepSystem.js index ca48c48..0d4d88b 100644 --- a/classes/StepSystem.js +++ b/classes/StepSystem.js @@ -1,6 +1,6 @@ /** * StepSystem v1.0.0 - * Last update: 15.05.2017 + * Last update: 17.05.2017 * * Dependencies: jQuery * @@ -11,15 +11,18 @@ export class StepSystem { /** * @param {jQuery element} container */ - constructor (container) { + constructor (params) { this._steps = {} this._current_step = null - this._container = container + this._container = params.container || $('.step-system') + this._step_container = params.step_class || '.step' + this._next_timeout = null this.steps_past = [] this.progress = 0 this.commonHandlers = function () {} this.onFinish = function () {} this.onProgress = function () {} + this.onStepRender = function () {} } /** @@ -59,7 +62,9 @@ export class StepSystem { if (_br.onError) _br.onError() return this } - this.container.find('.step').html(step.template || this._container.find(`#${step.name}`).html()) + this.container.find(this._step_container).html(step.template || this._container.find(`#${step.name}`).html()) + this.container.find(this._step_container).attr('data-name', step.name) + this.onStepRender(step) if (step.methods.onRender) { step.methods.onRender() } @@ -80,6 +85,14 @@ export class StepSystem { this.onProgress(this.progress) } + goNextTimeout (timeout = 300) { + const $this = this + clearTimeout(this._next_timeout) + this._next_timeout = setTimeout(function () { + $this.goNext() + }, timeout) + } + goNext () { let curr_step = this.current_step || {} let next_step = curr_step.next || null diff --git a/example/dist/app.js b/example/dist/app.js index ca0bbd3..8909073 100644 --- a/example/dist/app.js +++ b/example/dist/app.js @@ -20,7 +20,7 @@ var Step = exports.Step = function () { this.template = params.template || ''; this.ignore_progress = params.ignore_progress || false; this.from = null; - this._data = {}; + this._data = params.data || {}; params.interceptors = params.interceptors || {}; this.interceptors = { beforeRender: params.interceptors.beforeRender || this.methods.beforeRender || function () { @@ -76,7 +76,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons /** * StepSystem v1.0.0 - * Last update: 15.05.2017 + * Last update: 17.05.2017 * * Dependencies: jQuery * @@ -87,17 +87,20 @@ var StepSystem = exports.StepSystem = function () { /** * @param {jQuery element} container */ - function StepSystem(container) { + function StepSystem(params) { _classCallCheck(this, StepSystem); this._steps = {}; this._current_step = null; - this._container = container; + this._container = params.container || $('.step-system'); + this._step_container = params.step_class || '.step'; + this._next_timeout = null; this.steps_past = []; this.progress = 0; this.commonHandlers = function () {}; this.onFinish = function () {}; this.onProgress = function () {}; + this.onStepRender = function () {}; } /** @@ -132,7 +135,9 @@ var StepSystem = exports.StepSystem = function () { if (_br.onError) _br.onError(); return this; } - this.container.find('.step').html(step.template || this._container.find('#' + step.name).html()); + this.container.find(this._step_container).html(step.template || this._container.find('#' + step.name).html()); + this.container.find(this._step_container).attr('data-name', step.name); + this.onStepRender(step); if (step.methods.onRender) { step.methods.onRender(); } @@ -153,6 +158,17 @@ var StepSystem = exports.StepSystem = function () { this.progress = this.steps_past.length * 100 / (this.steps_past.length + future_steps); this.onProgress(this.progress); } + }, { + key: 'goNextTimeout', + value: function goNextTimeout() { + var timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 300; + + var $this = this; + clearTimeout(this._next_timeout); + this._next_timeout = setTimeout(function () { + $this.goNext(); + }, timeout); + } }, { key: 'goNext', value: function goNext() { diff --git a/example/dist/app.js.map b/example/dist/app.js.map index 83138b5..a5487a4 100644 --- a/example/dist/app.js.map +++ b/example/dist/app.js.map @@ -1 +1 @@ -{"version":3,"sources":["node_modules/browserify/node_modules/browser-pack/_prelude.js","classes/Step.js","classes/StepSystem.js","example/app.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;ICAa,I,WAAA,I;AACX,gBAAa,MAAb,EAAqB;AAAA;;AACnB,SAAK,MAAL,GAAc,OAAO,MAAP,IAAiB,IAA/B;AACA,SAAK,IAAL,GAAY,OAAO,IAAnB;AACA,SAAK,IAAL,GAAY,OAAO,IAAnB;AACA,SAAK,OAAL,GAAe,OAAO,OAAP,IAAkB,EAAjC;AACA,SAAK,QAAL,GAAgB,OAAO,QAAP,IAAmB,EAAnC;AACA,SAAK,eAAL,GAAuB,OAAO,eAAP,IAA0B,KAAjD;AACA,SAAK,IAAL,GAAY,IAAZ;AACA,SAAK,KAAL,GAAa,EAAb;AACA,WAAO,YAAP,GAAsB,OAAO,YAAP,IAAuB,EAA7C;AACA,SAAK,YAAL,GAAoB;AAClB,oBAAc,OAAO,YAAP,CAAoB,YAApB,IAAoC,KAAK,OAAL,CAAa,YAAjD,IAAiE,YAAY;AACzF,eAAO,EAAC,QAAQ,IAAT,EAAP;AACD,OAHiB;AAIlB,kBAAY,OAAO,YAAP,CAAoB,UAApB,IAAkC,KAAK,OAAL,CAAa,UAA/C,IAA6D,YAAY;AACnF,eAAO,EAAC,QAAQ,IAAT,EAAP;AACD,OANiB;AAOlB,kBAAY,OAAO,YAAP,CAAoB,UAApB,IAAkC,KAAK,OAAL,CAAa,UAA/C,IAA6D,YAAY;AACnF,eAAO,EAAC,QAAQ,IAAT,EAAP;AACD;AATiB,KAApB;AAWD;;AAED;;;;;wBACc;AAAE,aAAO,KAAK,MAAL,CAAY,MAAnB;AAA2B;;;wBAC7B;AAAE,aAAO,KAAK,MAAL,CAAY,MAAnB;AAA2B;;;wBAC3B;AAAE,aAAO,KAAK,MAAL,CAAY,QAAnB;AAA6B;;;wBAEnC;AACV,aAAO,KAAK,KAAZ;AACD;;;;;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AFO,GAAT,CAvDT;;AAyEA,MAAI,QAAJ,GAAe,YAAM;AACnB,YAAQ,GAAR,CAAY,IAAI,WAAJ,EAAZ;AACD,GAFD;;AAIA,MAAI,UAAJ,GAAiB,UAAC,QAAD,EAAc;AAC7B,QAAI,SAAJ,CAAc,IAAd,CAAmB,WAAnB,EAAgC,IAAhC,CAAqC,KAAK,KAAL,CAAW,QAAX,IAAuB,GAA5D;AACD,GAFD;;AAIA,MAAI,IAAJ,CAAS,UAAT;AAED,CAvFD,EAuFG,OAAO,GAvFV","file":"app.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o {\n console.log('handlers init')\n })\n \n /**\n * FIRST STEP\n */\n .addStep(new Step({\n name: 'first-step',\n next: 'second-step',\n methods: {\n beforeRender: () => {\n console.log('first-step beforeRender')\n return { status: true }\n },\n beforeNext: () => {\n console.log('first-step beforeNext', this)\n app.current_step.data.lol = 'lol'\n return { status: true }\n },\n onRender: () => {\n app.container.find('.step').css({'color': 'green'})\n }\n }\n }))\n\n /**\n * SECOND STEP\n */\n .addStep(new Step({\n name: 'second-step',\n next: 'third-step',\n methods: {\n beforeRender: () => {\n console.log('second-step beforeRender')\n return { status: true }\n },\n beforeNext: () => {\n console.log('second-step beforeNext')\n app.current_step.data.azaza = 'azaza'\n return { status: true }\n },\n onRender: () => {\n app.container.find('.step').css({'color': 'red'})\n }\n }\n }))\n\n /**\n * THIRD STEP\n */\n .addStep(new Step({\n name: 'third-step',\n methods: {\n beforeRender: () => {\n console.log('third-step beforeRender')\n return { status: true }\n },\n beforeNext: () => {\n console.log('third-step beforeNext')\n app.current_step.data.kek = 'kek'\n return { status: true }\n },\n onRender: () => {\n app.container.find('.step').css({'color': 'blue'})\n }\n }\n }))\n\n app.onFinish = () => {\n console.log(app.collectData())\n }\n\n app.onProgress = (progress) => {\n app.container.find('.progress').html(Math.floor(progress) + '%')\n }\n\n app.init(first_step)\n\n})(window.app)\n"],"preExistingComment":"//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJjbGFzc2VzL1N0ZXAuanMiLCJjbGFzc2VzL1N0ZXBTeXN0ZW0uanMiLCJleGFtcGxlL2FwcC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7SUNBYSxJLFdBQUEsSTtBQUNYLGdCQUFhLE1BQWIsRUFBcUI7QUFBQTs7QUFDbkIsU0FBSyxNQUFMLEdBQWMsT0FBTyxNQUFQLElBQWlCLElBQS9CO0FBQ0EsU0FBSyxJQUFMLEdBQVksT0FBTyxJQUFuQjtBQUNBLFNBQUssSUFBTCxHQUFZLE9BQU8sSUFBbkI7QUFDQSxTQUFLLE9BQUwsR0FBZSxPQUFPLE9BQVAsSUFBa0IsRUFBakM7QUFDQSxTQUFLLFFBQUwsR0FBZ0IsT0FBTyxRQUFQLElBQW1CLEVBQW5DO0FBQ0EsU0FBSyxlQUFMLEdBQXVCLE9BQU8sZUFBUCxJQUEwQixLQUFqRDtBQUNBLFNBQUssSUFBTCxHQUFZLElBQVo7QUFDQSxTQUFLLEtBQUwsR0FBYSxFQUFiO0FBQ0EsV0FBTyxZQUFQLEdBQXNCLE9BQU8sWUFBUCxJQUF1QixFQUE3QztBQUNBLFNBQUssWUFBTCxHQUFvQjtBQUNsQixvQkFBYyxPQUFPLFlBQVAsQ0FBb0IsWUFBcEIsSUFBb0Ms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gICAgIH1cbiAgICB9XG4gIH0pKVxuXG4gIC8qKlxuICAgKiBUSElSRCBTVEVQXG4gICAqL1xuICAuYWRkU3RlcChuZXcgU3RlcCh7XG4gICAgbmFtZTogJ3RoaXJkLXN0ZXAnLFxuICAgIG1ldGhvZHM6IHtcbiAgICAgIGJlZm9yZVJlbmRlcjogKCkgPT4ge1xuICAgICAgICBjb25zb2xlLmxvZygndGhpcmQtc3RlcCBiZWZvcmVSZW5kZXInKVxuICAgICAgICByZXR1cm4geyBzdGF0dXM6IHRydWUgfVxuICAgICAgfSxcbiAgICAgIGJlZm9yZU5leHQ6ICgpID0+IHtcbiAgICAgICAgY29uc29sZS5sb2coJ3RoaXJkLXN0ZXAgYmVmb3JlTmV4dCcpXG4gICAgICAgIGFwcC5jdXJyZW50X3N0ZXAuZGF0YS5rZWsgPSAna2VrJ1xuICAgICAgICByZXR1cm4geyBzdGF0dXM6IHRydWUgfVxuICAgICAgfSxcbiAgICAgIG9uUmVuZGVyOiAoKSA9PiB7XG4gICAgICAgIGFwcC5jb250YWluZXIuZmluZCgnLnN0ZXAnKS5jc3Moeydjb2xvcic6ICdibHVlJ30pXG4gICAgICB9XG4gICAgfVxuICB9KSlcblxuICBhcHAub25GaW5pc2ggPSAoKSA9PiB7XG4gICAgY29uc29sZS5sb2coYXBwLmNvbGxlY3REYXRhKCkpXG4gIH1cblxuICBhcHAub25Qcm9ncmVzcyA9IChwcm9ncmVzcykgPT4ge1xuICAgIGFwcC5jb250YWluZXIuZmluZCgnLnByb2dyZXNzJykuaHRtbChNYXRoLmZsb29yKHByb2dyZXNzKSArICclJylcbiAgfVxuXG4gIGFwcC5pbml0KGZpcnN0X3N0ZXApXG5cbn0pKHdpbmRvdy5hcHApXG4iXX0="} \ No newline at end of file +{"version":3,"sources":["node_modules/browserify/node_modules/browser-pack/_prelude.js","classes/Step.js","classes/StepSystem.js","example/app.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;ICAa,I,WAAA,I;AACX,gBAAa,M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,EAAE,QAAQ,IAAV,EAAP;AACD,OAJM;AAKP,kBAAY,sBAAM;AAChB,gBAAQ,GAAR,CAAY,uBAAZ;AACA,YAAI,YAAJ,CAAiB,IAAjB,CAAsB,GAAtB,GAA4B,KAA5B;AACA,eAAO,EAAE,QAAQ,IAAV,EAAP;AACD,OATM;AAUP,gBAAU,oBAAM;AACd,YAAI,SAAJ,CAAc,IAAd,CAAmB,OAAnB,EAA4B,GAA5B,CAAgC,EAAC,SAAS,MAAV,EAAhC;AACD;AAZM;AAFO,GAAT,CAvDT;;AAyEA,MAAI,QAAJ,GAAe,YAAM;AACnB,YAAQ,GAAR,CAAY,IAAI,WAAJ,EAAZ;AACD,GAFD;;AAIA,MAAI,UAAJ,GAAiB,UAAC,QAAD,EAAc;AAC7B,QAAI,SAAJ,CAAc,IAAd,CAAmB,WAAnB,EAAgC,IAAhC,CAAqC,KAAK,KAAL,CAAW,QAAX,IAAuB,GAA5D;AACD,GAFD;;AAIA,MAAI,IAAJ,CAAS,UAAT;AAED,CAvFD,EAuFG,OAAO,GAvFV","file":"app.js","sourcesContent":["(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o {\n console.log('handlers init')\n })\n \n /**\n * FIRST STEP\n */\n .addStep(new Step({\n name: 'first-step',\n next: 'second-step',\n methods: {\n beforeRender: () => {\n console.log('first-step beforeRender')\n return { status: true }\n },\n beforeNext: () => {\n console.log('first-step beforeNext', this)\n app.current_step.data.lol = 'lol'\n return { status: true }\n },\n onRender: () => {\n app.container.find('.step').css({'color': 'green'})\n }\n }\n }))\n\n /**\n * SECOND STEP\n */\n .addStep(new Step({\n name: 'second-step',\n next: 'third-step',\n methods: {\n beforeRender: () => {\n console.log('second-step beforeRender')\n return { status: true }\n },\n beforeNext: () => {\n console.log('second-step beforeNext')\n app.current_step.data.azaza = 'azaza'\n return { status: true }\n },\n onRender: () => {\n app.container.find('.step').css({'color': 'red'})\n }\n }\n }))\n\n /**\n * THIRD STEP\n */\n .addStep(new Step({\n name: 'third-step',\n methods: {\n beforeRender: () => {\n console.log('third-step beforeRender')\n return { status: true }\n },\n beforeNext: () => {\n console.log('third-step beforeNext')\n app.current_step.data.kek = 'kek'\n return { status: true }\n },\n onRender: () => {\n app.container.find('.step').css({'color': 'blue'})\n }\n }\n }))\n\n app.onFinish = () => {\n console.log(app.collectData())\n }\n\n app.onProgress = (progress) => {\n app.container.find('.progress').html(Math.floor(progress) + '%')\n }\n\n app.init(first_step)\n\n})(window.app)\n"],"preExistingComment":"//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyaWZ5L25vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJjbGFzc2VzL1N0ZXAuanMiLCJjbGFzc2VzL1N0ZXBTeXN0ZW0uanMiLCJleGFtcGxlL2FwcC5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7Ozs7Ozs7SUNBYSxJLFdBQUEsSTtBQUNYLGdCQUFhLE1BQWIsRUFBcUI7QUFBQTs7QUFDbkIsU0FBSyxNQUFMLEdBQWMsT0FBTyxNQUFQLElBQWlCLElBQS9CO0FBQ0EsU0FBSyxJQUFMLEdBQVksT0FBTyxJQUFuQjtBQUNBLFNBQUssSUFBTCxHQUFZLE9BQU8sSUFBbkI7QUFDQSxTQUFLLE9BQUwsR0FBZSxPQUFPLE9BQVAsSUFBa0IsRUFBakM7QUFDQSxTQUFLLFFBQUwsR0FBZ0IsT0FBTyxRQUFQLElBQW1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