[FIX] Various tour fixes and imps

bzr revid: ddm@openerp.com-20131126112246-tuj0wvruy2668fyi
This commit is contained in:
ddm 2013-11-26 12:22:46 +01:00
parent 6fc69e33d4
commit cbef8ac39b
8 changed files with 47 additions and 194 deletions

View File

@ -1,50 +0,0 @@
(function () {
'use strict';
var website = openerp.website;
website.EditorBar.include({
start: function () {
this.registerTour(new website.AppTour(this));
return this._super();
},
});
website.AppTour = website.Tour.extend({
id: 'app-tutorial',
name: "Install an application",
init: function (editor) {
var self = this;
self.steps = [
{
stepId: 'welcome-install-app',
orphan: true,
backdrop: true,
title: "Install an App",
content: "You can intall some apps to manage your website content.",
template: self.popover({ next: "Start Tutorial", end: "Skip It" }),
},
{
stepId: 'customize',
element: '#customize-menu-button',
placement: 'left',
title: "Install an app",
content: "Add new apps by customizing your website.",
triggers: function () {
editor.on('rte:customize_menu_ready', self, self.moveToNextStep);
},
},
{
stepId: 'install-app',
element: '#customize-menu li:last a',
placement: 'left',
orphan: true,
title: "Install an app",
content: "Click 'Install Apps' to select and install the application you would like to manage from your website.",
},
];
return this._super();
},
});
}());

View File

@ -86,7 +86,7 @@
title: "Add Another Block",
content: "Let's add another building block to your page.",
triggers: function () {
$('button[data-action=snippet]').on('click', function () {
$('button[data-action=snippet]').one('click', function () {
self.moveToNextStep();
});
}
@ -140,9 +140,13 @@
stepId: 'show-mobile',
element: 'a[data-action=show-mobile-preview]',
placement: 'bottom',
reflex: true,
title: "Test Your Mobile Version",
content: "Let's check how your homepage looks like on mobile devices.",
triggers: function () {
$(document).one('shown.bs.modal', function () {
self.moveToNextStep();
});
}
},
{
stepId: 'show-mobile-close',
@ -165,7 +169,7 @@
return this._super();
},
resume: function () {
return (this.isCurrentStep('show-tutorials')) && !this.tour.ended();
return this.isCurrentStep('part-2') && this._super();
},
});

View File

@ -73,9 +73,12 @@
window.location.replace(newUrl);
}
},
ended: function () {
return this.tourStorage.getItem(this.id+'_end') === "yes";
},
resume: function () {
// Override if necessary
return this.currentStepIndex() === 0;
return !this.ended();
},
trigger: function (url) {
// Override if necessary

View File

@ -1,106 +0,0 @@
(function () {
'use strict';
var website = openerp.website;
website.EditorBar.include({
start: function () {
this.registerTour(new website.PageTour(this));
return this._super();
},
});
website.PageTour = website.Tour.extend({
id: 'page-tutorial',
name: "Add a page",
init: function (editor) {
var self = this;
self.steps = [
{
stepId: 'welcome-menu-editor',
orphan: true,
backdrop: true,
title: "Menu editor",
content: "We will show how to edit your website's menu.",
template: self.popover({ next: "Start Tutorial", end: "Skip It" }),
},
{
stepId: 'content-menu',
element: '#content-menu-button',
placement: 'left',
reflex: true,
title: "Edit the content",
content: "Click here to edit the menu.",
},
{
stepId: 'edit-entry',
element: 'a[data-action=edit-structure]',
placement: 'left',
title: "Edit menu",
content: "Click here to create a new menu entry and manage options.",
triggers: function () {
$(document).one('shown.bs.modal', function () {
$('.modal-header:first button.close').one('click', function () {
self.stop();
});
self.moveToNextStep();
});
},
},
{
stepId: 'add-menu-entry',
element: 'a.js_add_menu',
placement: 'left',
title: "Add menu entry",
content: "Click here to create a new menu entry.",
triggers: function () {
$(document).one('shown.bs.modal', function () {
$('.modal-header:last button.close').one('click', function () {
self.stop();
});
self.moveToNextStep();
});
},
},
{
stepId: 'enter-entry-name',
element: '#link-text',
placement: 'left',
title: "Choose a label",
content: "This label will appear in the top menu and will be visible by all your audience.\nGive a meaningful name to help your visitors. For instance, 'Photos Gallery'.",
template: self.popover({ next: "Continue" }),
},
{
stepId: 'enter-page-name',
element: '.modal .select2-container',
placement: 'left',
title: "Link your menu to a 'gallery' page",
content: "This page does not exist. Create it by filling the name here. For instance, 'gallery'.",
template: self.popover({ next: "Continue" }),
},
{
stepId: 'save-page',
element: '.modal-footer:last button.btn-primary',
placement: 'right',
title: "Save the page",
content: "Save your new page.",
triggers: function () {
$(document).one('hidden.bs.modal', function () {
self.moveToNextStep();
});
},
},
{
stepId: 'save-menu',
element: '.modal-footer button.btn-primary',
placement: 'right',
reflex: true,
title: "Save the menu",
content: "Save the menu to edit the Gallery content directly from the interface.",
},
];
return this._super();
},
});
}());

View File

@ -102,8 +102,6 @@
<script type="text/javascript" src="/website/static/src/js/website.seo.js"></script>
<script type="text/javascript" src="/website/static/src/js/website.tour.js"></script>
<script type="text/javascript" src="/website/static/src/js/website.tour.banner.js"></script>
<script type="text/javascript" src="/website/static/src/js/website.tour.page.js"></script>
<script type="text/javascript" src="/website/static/src/js/website.tour.app.js"></script>
<script t-if="not translatable" type="text/javascript" src="/website/static/src/js/website.snippets.editor.js"></script>
<script t-if="not translatable" type="text/javascript" src="/website/static/src/js/website.ace.js"></script>
<script t-if="translatable" type="text/javascript" src="/website/static/src/js/website.translator.js"></script>

View File

@ -156,14 +156,6 @@
title: "Delete the Title",
content: "From this toolbar you can move, duplicate or delete the selected zone. Click on the cross to delete the title.",
},
{
stepId: 'publish-post',
element: 'button.js_publish_btn',
placement: 'right',
reflex: true,
title: "Publish Your Post",
content: "Your blog post is not yet published. You can update this draft version and publish it once you are ready.",
},
{
stepId: 'save-changes',
element: 'button[data-action=save]',
@ -172,22 +164,30 @@
title: "Save Your Blog",
content: "Click the <em>Save</em> button to record changes on the page.",
},
{
stepId: 'publish-post',
element: 'button.js_publish_btn',
placement: 'right',
reflex: true,
title: "Publish Your Post",
content: "Your blog post is not yet published. You can update this draft version and publish it once you are ready.",
},
{
stepId: 'end-tutorial',
orphan: true,
backdrop: true,
title: "Thanks!",
content: "This tutorial is finished. To discover more features, improve the content of this page and try the <em>Promote</em> button in the top right menu.",
template: self.popover({ next: "Close Tutorial" }),
template: self.popover({ end: "Close Tutorial" }),
},
];
return this._super();
},
resume: function () {
return this.isCurrentStep('post-page') && !this.tour.ended();
return (this.isCurrentStep('post-page') || this.isCurrentStep('publish-post')) && this._super();
},
trigger: function () {
return (this.resume() && this.testUrl(/^\/blog\/[0-9]+\/\?enable_editor=1/)) || this._super();
return (this.resume() && this.testUrl(/^\/blog\/[0-9]+\//)) || this._super();
},
});

View File

@ -99,14 +99,6 @@
self.onSnippetDraggedAdvance('text-block');
},
},
{
stepId: 'publish-post',
element: 'button.js_publish_btn',
placement: 'right',
reflex: true,
title: "Publish your event",
content: "Click to publish your event.",
},
{
stepId: 'save-changes',
element: 'button[data-action=save]',
@ -115,14 +107,22 @@
title: "Save your modifications",
content: "Once you click on save, your event is updated.",
},
{
stepId: 'publish-post',
element: 'button.js_publish_btn',
placement: 'right',
reflex: true,
title: "Publish your event",
content: "Click to publish your event.",
},
];
return this._super();
},
resume: function () {
return this.isCurrentStep('event-page') && !this.tour.ended();
return (this.isCurrentStep('event-page') || this.isCurrentStep('publish-post')) && this._super();
},
trigger: function () {
return (this.resume() && this.testUrl(/^\/event\/register\/[0-9]+/)) || this._super();
return (this.resume() && this.testUrl(/^\/event\/[0-9]+\/register/)) || this._super();
},
});

View File

@ -101,12 +101,16 @@
title: "Upload image",
content: "Click on 'Upload an image from your computer' to pick an image describing your product.",
template: self.popover({ next: "OK" }),
triggers: function () {
$(document).on('hide.bs.modal', function () {
self.moveToStep('add-block');
});
}
},
{
stepId: 'save-image',
element: 'button.save',
placement: 'right',
reflex: true,
title: "Save the image",
content: "Click 'Save Changes' to add the image to the product decsription.",
},
@ -132,14 +136,6 @@
self.onSnippetDraggedAdvance('big-picture');
},
},
{
stepId: 'publish-post',
element: 'button.js_publish_btn',
placement: 'right',
reflex: true,
title: "Publish your product",
content: "Click to publish your product so your customers can see it.",
},
{
stepId: 'save-changes',
element: 'button[data-action=save]',
@ -148,14 +144,22 @@
title: "Save your modifications",
content: "Once you click on save, your product is updated.",
},
{
stepId: 'publish-product',
element: 'button.js_publish_btn',
placement: 'right',
reflex: true,
title: "Publish your product",
content: "Click to publish your product so your customers can see it.",
},
];
return this._super();
},
resume: function () {
return this.isCurrentStep('product-page') && !this.tour.ended();
return (this.isCurrentStep('product-page') || this.isCurrentStep('publish-product')) && this._super();
},
trigger: function (url) {
return (this.resume() && this.testUrl(/^\/shop\/product\/[0-9]+\/\?enable_editor=1/)) || this._super();
return (this.resume() && this.testUrl(/^\/shop\/product\/[0-9]+\//)) || this._super();
},
});