[IMP] removed JS function from banner tour
bzr revid: ddm@openerp.com-20131217130240-hdbgp90f47uori0h
This commit is contained in:
parent
4469b36f77
commit
5d97a99b1a
|
@ -11,145 +11,139 @@
|
||||||
});
|
});
|
||||||
|
|
||||||
website.BannerTour = website.Tour.extend({
|
website.BannerTour = website.Tour.extend({
|
||||||
id: 'banner',
|
id: 'banner',
|
||||||
name: "Insert a banner",
|
name: "Insert a banner",
|
||||||
startPath: '/page/website.homepage',
|
path: '/page/website.homepage',
|
||||||
init: function (editor) {
|
init: function (editor) {
|
||||||
var self = this;
|
var self = this;
|
||||||
self.steps = [
|
self.steps = [
|
||||||
{
|
{
|
||||||
stepId: 'welcome',
|
stepId: 'welcome',
|
||||||
title: "Welcome to your website!",
|
title: "Welcome to your website!",
|
||||||
content: "This tutorial will guide you to build your home page. We will start by adding a banner.",
|
content: "This tutorial will guide you to build your home page. We will start by adding a banner.",
|
||||||
template: self.popover({ next: "Start Tutorial", end: "Skip It" }),
|
template: self.popover({ next: "Start Tutorial", end: "Skip It" }),
|
||||||
backdrop: true,
|
backdrop: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
stepId: 'edit-page',
|
stepId: 'edit-page',
|
||||||
element: 'button[data-action=edit]',
|
element: 'button[data-action=edit]',
|
||||||
placement: 'bottom',
|
placement: 'bottom',
|
||||||
title: "Edit this page",
|
title: "Edit this page",
|
||||||
content: "Every page of your website can be modified through the <i>Edit</i> button.",
|
content: "Every page of your website can be modified through the <i>Edit</i> button.",
|
||||||
trigger: {
|
trigger: {
|
||||||
|
id: 'rte:ready',
|
||||||
|
type: 'openerp',
|
||||||
emitter: editor,
|
emitter: editor,
|
||||||
type: 'openerp',
|
|
||||||
id: 'rte:ready',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
stepId: 'add-banner',
|
stepId: 'add-banner',
|
||||||
element: 'button[data-action=snippet]',
|
element: 'button[data-action=snippet]',
|
||||||
placement: 'bottom',
|
placement: 'bottom',
|
||||||
title: "Insert building blocks",
|
title: "Insert building blocks",
|
||||||
content: "To add content in a page, you can insert building blocks.",
|
content: "To add content in a page, you can insert building blocks.",
|
||||||
trigger: 'click',
|
trigger: 'click',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
stepId: 'drag-banner',
|
stepId: 'drag-banner',
|
||||||
snippet: 'carousel',
|
snippet: 'carousel',
|
||||||
placement: 'bottom',
|
placement: 'bottom',
|
||||||
title: "Drag & Drop a Banner",
|
title: "Drag & Drop a Banner",
|
||||||
content: "Drag the Banner block and drop it in your page.",
|
content: "Drag the Banner block and drop it in your page.",
|
||||||
trigger: 'drag',
|
trigger: 'drag',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
stepId: 'edit-title',
|
stepId: 'edit-title',
|
||||||
element: '#wrap [data-snippet-id=carousel]:first .carousel-caption',
|
element: '#wrap [data-snippet-id=carousel]:first .carousel-caption',
|
||||||
placement: 'top',
|
placement: 'top',
|
||||||
title: "Customize banner's text",
|
title: "Customize banner's text",
|
||||||
content: "Click in the text and start editing it. Click continue once it's done.",
|
content: "Click in the text and start editing it. Click continue once it's done.",
|
||||||
template: self.popover({ next: "Continue" }),
|
template: self.popover({ next: "Continue" }),
|
||||||
onStart: function () {
|
|
||||||
var $banner = $("#wrap [data-snippet-id=carousel]:first");
|
|
||||||
if ($banner.length) {
|
|
||||||
$banner.click();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
stepId: 'customize-banner',
|
stepId: 'customize-banner',
|
||||||
element: '.oe_overlay_options .oe_options',
|
element: '.oe_overlay_options .oe_options',
|
||||||
placement: 'left',
|
placement: 'left',
|
||||||
title: "Customize the banner",
|
title: "Customize the banner",
|
||||||
content: "Customize any block through this menu. Try to change the background of the banner.",
|
content: "Customize any block through this menu. Try to change the background of the banner.",
|
||||||
template: self.popover({ next: "Continue" }),
|
template: self.popover({ next: "Continue" }),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
stepId: 'add-three-cols',
|
stepId: 'add-three-cols',
|
||||||
element: 'button[data-action=snippet]',
|
element: 'button[data-action=snippet]',
|
||||||
placement: 'bottom',
|
placement: 'bottom',
|
||||||
title: "Add Another Block",
|
title: "Add Another Block",
|
||||||
content: "Let's add another building block to your page.",
|
content: "Let's add another building block to your page.",
|
||||||
trigger: 'click',
|
trigger: 'click',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
stepId: 'drag-three-columns',
|
stepId: 'drag-three-columns',
|
||||||
snippet: 'three-columns',
|
snippet: 'three-columns',
|
||||||
placement: 'bottom',
|
placement: 'bottom',
|
||||||
title: "Drag & Drop a Block",
|
title: "Drag & Drop a Block",
|
||||||
content: "Drag the <em>'3 Columns'</em> block and drop it below the banner.",
|
content: "Drag the <em>'3 Columns'</em> block and drop it below the banner.",
|
||||||
trigger: 'drag',
|
trigger: 'drag',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
stepId: 'activate-text-block-title',
|
stepId: 'activate-text-block-title',
|
||||||
element: '#wrap [data-snippet-id=three-columns] .text-center[data-snippet-id=colmd]',
|
element: '#wrap [data-snippet-id=three-columns] .text-center[data-snippet-id=colmd]',
|
||||||
placement: 'top',
|
placement: 'top',
|
||||||
title: "Edit an Area",
|
title: "Edit an Area",
|
||||||
content: "Select any area of the page to modify it. Click on this subtitle.",
|
content: "Select any area of the page to modify it. Click on this subtitle.",
|
||||||
trigger: {
|
trigger: {
|
||||||
|
id: 'snippet-activated',
|
||||||
emitter: '#wrap [data-snippet-id=three-columns] .text-center[data-snippet-id=colmd]',
|
emitter: '#wrap [data-snippet-id=three-columns] .text-center[data-snippet-id=colmd]',
|
||||||
id: 'snippet-activated',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
stepId: 'remove-text-block-title',
|
stepId: 'remove-text-block-title',
|
||||||
element: '.oe_active .oe_snippet_remove',
|
element: '.oe_active .oe_snippet_remove',
|
||||||
placement: 'top',
|
placement: 'top',
|
||||||
title: "Delete the Title",
|
title: "Delete the Title",
|
||||||
content: "From this toolbar you can move, duplicate or delete the selected zone. Click on the trash can to delete the title.",
|
content: "From this toolbar you can move, duplicate or delete the selected zone. Click on the trash can to delete the title.",
|
||||||
trigger: 'click',
|
trigger: 'click',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
stepId: 'save-changes',
|
stepId: 'save-changes',
|
||||||
element: 'button[data-action=save]',
|
element: 'button[data-action=save]',
|
||||||
placement: 'right',
|
placement: 'right',
|
||||||
title: "Save your modifications",
|
title: "Save your modifications",
|
||||||
content: "Publish your page by clicking on the <em>'Save'</em> button.",
|
content: "Publish your page by clicking on the <em>'Save'</em> button.",
|
||||||
trigger: 'click',
|
trigger: 'click',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
stepId: 'part-2',
|
stepId: 'part-2',
|
||||||
title: "Congratulation!",
|
title: "Congratulation!",
|
||||||
content: "Your homepage has been updated.",
|
content: "Your homepage has been updated.",
|
||||||
template: self.popover({ next: "Continue" }),
|
template: self.popover({ next: "Continue" }),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
stepId: 'show-mobile',
|
stepId: 'show-mobile',
|
||||||
element: 'a[data-action=show-mobile-preview]',
|
element: 'a[data-action=show-mobile-preview]',
|
||||||
placement: 'bottom',
|
placement: 'bottom',
|
||||||
title: "Test Your Mobile Version",
|
title: "Test Your Mobile Version",
|
||||||
content: "Let's check how your homepage looks like on mobile devices.",
|
content: "Let's check how your homepage looks like on mobile devices.",
|
||||||
trigger: {
|
trigger: {
|
||||||
|
id: 'shown.bs.modal',
|
||||||
emitter: $(document),
|
emitter: $(document),
|
||||||
id: 'shown.bs.modal',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
stepId: 'show-mobile-close',
|
stepId: 'show-mobile-close',
|
||||||
element: 'button[data-dismiss=modal]',
|
element: 'button[data-dismiss=modal]',
|
||||||
placement: 'right',
|
placement: 'right',
|
||||||
title: "Close Mobile Preview",
|
title: "Close Mobile Preview",
|
||||||
content: "Scroll in the mobile preview to test the rendering. Once it's ok, close this dialog.",
|
content: "Scroll in the mobile preview to test the rendering. Once it's ok, close this dialog.",
|
||||||
trigger: 'click',
|
trigger: 'click',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
stepId: 'show-tutorials',
|
stepId: 'show-tutorials',
|
||||||
element: '#help-menu-button',
|
element: '#help-menu-button',
|
||||||
placement: 'left',
|
placement: 'left',
|
||||||
title: "More Tutorials",
|
title: "More Tutorials",
|
||||||
content: "Get more tutorials through this <em>'Help'</em> menu or click on the left <em>'Edit'</em> button to continue modifying this page.",
|
content: "Get more tutorials through this <em>'Help'</em> menu or click on the left <em>'Edit'</em> button to continue modifying this page.",
|
||||||
template: self.popover({ end: "Close Tutorial" }),
|
template: self.popover({ end: "Close Tutorial" }),
|
||||||
trigger: 'click',
|
trigger: 'click',
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
return this._super();
|
return this._super();
|
||||||
|
|
|
@ -139,7 +139,7 @@
|
||||||
},
|
},
|
||||||
redirect: function (url) {
|
redirect: function (url) {
|
||||||
url = url || new website.UrlParser(window.location.href);
|
url = url || new website.UrlParser(window.location.href);
|
||||||
var path = (this.startPath && url.pathname !== this.startPath) ? this.startPath : url.pathname;
|
var path = (this.path && url.pathname !== this.path) ? this.path : url.pathname;
|
||||||
var search = url.activateTutorial(this.id);
|
var search = url.activateTutorial(this.id);
|
||||||
var newUrl = path + search;
|
var newUrl = path + search;
|
||||||
window.location.replace(newUrl);
|
window.location.replace(newUrl);
|
||||||
|
@ -333,9 +333,9 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var url = new website.UrlParser(window.location.href);
|
var url = new website.UrlParser(window.location.href);
|
||||||
if (tour.startPath && url.pathname !== tour.startPath) {
|
if (tour.path && url.pathname !== tour.path) {
|
||||||
window.localStorage.setItem(testId, actionSteps[0].stepId);
|
window.localStorage.setItem(testId, actionSteps[0].stepId);
|
||||||
window.location.href = tour.startPath;
|
window.location.href = tour.path;
|
||||||
} else {
|
} else {
|
||||||
var lastStepId = window.localStorage.getItem(testId);
|
var lastStepId = window.localStorage.getItem(testId);
|
||||||
var currentStep = actionSteps.shift();
|
var currentStep = actionSteps.shift();
|
||||||
|
|
Loading…
Reference in New Issue