[FIX] Avoid reserved keywords as method names
[odoo/odoo.git] / addons / website_sale / static / src / js / website.tour.shop.js
1 (function () {
2     'use strict';
3
4     var website = openerp.website;
5
6     website.EditorBar.include({
7         start: function () {
8             this.registerTour(new website.EditorShopTour(this));
9             return this._super();
10         },
11     });
12
13     website.EditorShopTour = website.Tour.extend({
14         id: 'shop-tutorial',
15         name: "Create a product",
16         startPath: '/shop',
17         init: function (editor) {
18             var self = this;
19             self.steps = [
20                 {
21                     stepId: 'welcome-shop',
22                     orphan: true,
23                     backdrop: true,
24                     title: "Welcome to your shop",
25                     content: "You successfully installed the e-commerce. This guide will help you to create your product and promote your sales.",
26                     template: self.popover({ next: "Start Tutorial", end: "Skip It" }),
27                 },
28                 {
29                     stepId: 'content-menu',
30                     element: '#content-menu-button',
31                     placement: 'left',
32                     reflex: true,
33                     title: "Create your first product",
34                     content: "Click here to add a new product.",
35                 },
36                 {
37                     stepId: 'edit-entry',
38                     element: '#create-new-product',
39                     placement: 'left',
40                     title: "Create a new product",
41                     content: "Select 'New Product' to create it and manage its properties to boost your sales.",
42                     onShow: function () {
43                         $(document).one('shown.bs.modal', function () {
44                             $('.modal button.btn-primary').click(function () {
45                                 self.movetoStep('product-page');
46                             });
47                             self.movetoStep('enter-name');
48                         });
49                     },
50                 },
51                 {
52                     stepId: 'enter-name',
53                     element: '.modal input[type=text]',
54                     placement: 'right',
55                     title: "Choose name",
56                     content: "Enter a name for your new product.",
57
58                 },
59                 {
60                     stepId: 'product-page',
61                     orphan: true,
62                     backdrop: true,
63                     title: "New product created",
64                     content: "This page contains all the information related to the new product.",
65                     template: self.popover({ next: "OK" }),
66                 },
67                 {
68                     stepId: 'edit-price',
69                     element: '.product_price',
70                     placement: 'left',
71                     title: "Change the public price",
72                     content: "Edit the sale price of this product by clicking on the amount. The price is the sale price used in all sale order when selling this product.",
73                     template: self.popover({ next: "OK" }),
74                 },
75                 {
76                     stepId: 'add-block',
77                     element: 'button[data-action=snippet]',
78                     placement: 'bottom',
79                     reflex: true,
80                     title: "Describe the product for your audience",
81                     content: "Insert blocks like text-image, or gallery to fully describe the product and make your visitors want to buy this product.",
82                 },
83             ];
84             return this._super();
85         },
86         resume: function () {
87             return this.isCurrentStep('product-page') && !this.tour.ended();
88         },
89         trigger: function (url) {
90             return (this.resume() && this.testUrl(/^\/shop\/product\/[0-9]+\/\?enable_editor=1/)) || this._super();
91         },
92     });
93
94 }());