4 var website = openerp.website;
6 var render = website.tour.render;
8 website.EditorBannerTour = website.EditorTour.extend({
10 name: "Insert a banner",
11 startPath: '/page/website.homepage',
12 init: function (editor) {
14 var $body = $(document.body);
20 title: "Welcome to your website!",
21 content: "This tutorial will guide you to build your home page. We will start by adding a banner.",
22 template: render('website.tour_popover', { next: "Start Tutorial", end: "Skip It" }),
26 element: 'button[data-action=edit]',
28 title: "Edit this page",
29 content: "Every page of your website can be modified through the <i>Edit</i> button.",
30 template: render('website.tour_popover'),
32 editor.on('tour:editor_bar_loaded', editor, function () {
33 self.movetoStep('add-block');
39 element: 'button[data-action=snippet]',
41 title: "Insert building blocks",
42 content: "To add content in a page, you can insert building blocks.",
43 template: render('website.tour_popover'),
45 $('button[data-action=snippet]').click(function () {
46 self.movetoStep('drag-banner');
51 stepId: 'drag-banner',
52 element: '#website-top-navbar [data-snippet-id=carousel].ui-draggable',
54 title: "Drag & Drop a Banner",
55 content: "Drag the Banner block and drop it in your page.",
56 template: render('website.tour_popover'),
58 function beginDrag () {
59 $('.popover.tour').remove();
60 function goToNextStep () {
61 $('#oe_snippets').hide();
62 self.movetoStep('edit-title');
63 $body.off('mouseup', goToNextStep);
65 $body.off('mousedown', beginDrag);
66 $body.on('mouseup', goToNextStep);
69 $body.on('mousedown', beginDrag);
74 element: '#wrap [data-snippet-id=carousel]:first .carousel-caption',
76 title: "Customize banner's text",
77 content: "Click in the text and start editing it. Click continue once it's done.",
78 template: render('website.tour_popover', { next: "Continue" }),
80 var $banner = $("#wrap [data-snippet-id=carousel]:first");
87 stepId: 'customize-banner',
88 element: '.oe_overlay_options .oe_options',
90 title: "Customize the banner",
91 content: "You can customize characteristic of any blocks through the Customize menu. For instance, change the background of the banner.",
92 template: render('website.tour_popover', { next: "Continue" }),
94 $('.dropdown-menu [name=carousel-background]').click(function () {
95 self.movetoStep('save-changes');
100 stepId: 'save-changes',
101 element: 'button[data-action=save]',
104 title: "Save your modifications",
105 content: "Once you click on save, your website page is updated.",
106 template: render('website.tour_popover'),
107 onHide: function () {
108 self.saveStep('part-2');
114 title: "Congratulation!",
115 content: "Your homepage have been updated. Now, we suggest you to insert others building blocks like texts and images to structure your page.",
116 template: render('website.tour_popover', { next: "Continue" }),
119 stepId: 'show-tutorials',
120 element: '#help-menu-button',
123 title: "Help is always available",
124 content: "You can always click here if you want more helps or continue to build and get more tips about your website contents like page menu, ...",
125 template: render('website.tour_popover', { end: "Close" }),
128 return this._super();
130 startOfPart2: function () {
131 var currentStepIndex = this.currentStepIndex();
132 var secondPartIndex = this.indexOfStep('part-2');
133 var showTutorialsIndex = this.indexOfStep('show-tutorials');
134 return (currentStepIndex === secondPartIndex || currentStepIndex === showTutorialsIndex) && !this.tour.ended();
136 continueTour: function () {
137 return this.startOfPart2() || this._super();
141 website.EditorBar.include({
143 this.registerTour(new website.EditorBannerTour(this));
144 return this._super();