From 77c60a94beb4dce16513099a8348fe72f1b91007 Mon Sep 17 00:00:00 2001 From: ddm Date: Thu, 21 Nov 2013 12:23:12 +0100 Subject: [PATCH] [IMP] Tour: method names bzr revid: ddm@openerp.com-20131121112312-2n8kd2tja6upji3i --- addons/website/static/src/js/website.tour.banner.js | 2 +- addons/website/static/src/js/website.tour.js | 8 ++++---- addons/website_blog/static/src/js/website.tour.blog.js | 6 +++--- addons/website_event/static/src/js/website.tour.event.js | 6 +++--- addons/website_sale/static/src/js/website.tour.shop.js | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/addons/website/static/src/js/website.tour.banner.js b/addons/website/static/src/js/website.tour.banner.js index 881e0cc08f0..f9b1fe1cac4 100644 --- a/addons/website/static/src/js/website.tour.banner.js +++ b/addons/website/static/src/js/website.tour.banner.js @@ -127,7 +127,7 @@ ]; return this._super(); }, - continueTour: function () { + continue: function () { return (this.isCurrentStep('part-2') || this.isCurrentStep('show-tutorials')) && !this.tour.ended(); }, }); diff --git a/addons/website/static/src/js/website.tour.js b/addons/website/static/src/js/website.tour.js index 9e41f9d0745..64f973428c5 100644 --- a/addons/website/static/src/js/website.tour.js +++ b/addons/website/static/src/js/website.tour.js @@ -27,7 +27,7 @@ $('.popover.tour').remove(); }, start: function () { - if (this.continueTour() || ((this.currentStepIndex() === 0) && !this.tour.ended())) { + if (this.continue() || ((this.currentStepIndex() === 0) && !this.tour.ended())) { this.tour.start(); } }, @@ -68,11 +68,11 @@ window.location.replace(newUrl); } }, - continueTour: function () { + continue: function () { // Override if necessary return this.currentStepIndex() === 0; }, - isTriggerUrl: function (url) { + trigger: function (url) { // Override if necessary url = url || new website.UrlParser(window.location.href); var urlTrigger = this.id + "=true"; @@ -120,7 +120,7 @@ tour.start(); }); menu.append($menuItem); - if (tour.isTriggerUrl()) { + if (tour.trigger()) { tour.start(); } }); diff --git a/addons/website_blog/static/src/js/website.tour.blog.js b/addons/website_blog/static/src/js/website.tour.blog.js index 19a56aa351f..8ce3fb03025 100644 --- a/addons/website_blog/static/src/js/website.tour.blog.js +++ b/addons/website_blog/static/src/js/website.tour.blog.js @@ -107,11 +107,11 @@ ]; return this._super(); }, - continueTour: function () { + continue: function () { return this.isCurrentStep('post-page') && !this.tour.ended(); }, - isTriggerUrl: function () { - return (this.continueTour() && this.testUrl(/^\/blog\/[0-9]+\/\?enable_editor=1/)) || this._super(); + trigger: function () { + return (this.continue() && this.testUrl(/^\/blog\/[0-9]+\/\?enable_editor=1/)) || this._super(); }, }); diff --git a/addons/website_event/static/src/js/website.tour.event.js b/addons/website_event/static/src/js/website.tour.event.js index 2f81eb43733..941a8c6c5f6 100644 --- a/addons/website_event/static/src/js/website.tour.event.js +++ b/addons/website_event/static/src/js/website.tour.event.js @@ -74,11 +74,11 @@ ]; return this._super(); }, - continueTour: function () { + continue: function () { return this.isCurrentStep('event-page') && !this.tour.ended(); }, - isTriggerUrl: function () { - return (this.continueTour() && this.testUrl(/^\/event\/[0-9]+\/\?enable_editor=1/)) || this._super(); + trigger: function () { + return (this.continue() && this.testUrl(/^\/event\/[0-9]+\/\?enable_editor=1/)) || this._super(); }, }); diff --git a/addons/website_sale/static/src/js/website.tour.shop.js b/addons/website_sale/static/src/js/website.tour.shop.js index 841e8a87a5c..42f0645a015 100644 --- a/addons/website_sale/static/src/js/website.tour.shop.js +++ b/addons/website_sale/static/src/js/website.tour.shop.js @@ -83,11 +83,11 @@ ]; return this._super(); }, - continueTour: function () { + continue: function () { return this.isCurrentStep('product-page') && !this.tour.ended(); }, - isTriggerUrl: function (url) { - return (this.continueTour() && this.testUrl(/^\/shop\/product\/[0-9]+\/\?enable_editor=1/)) || this._super(); + trigger: function (url) { + return (this.continue() && this.testUrl(/^\/shop\/product\/[0-9]+\/\?enable_editor=1/)) || this._super(); }, });