From 2853a60afeedd7828afc616b2a14bea76e6c031a Mon Sep 17 00:00:00 2001 From: ddm Date: Fri, 15 Nov 2013 17:40:26 +0100 Subject: [PATCH] [IMP] Install app tour v1 bzr revid: ddm@openerp.com-20131115164026-6i284uve1i2yh3f7 --- .../static/src/js/website.tour.install-app.js | 64 +++++++++++++++++++ addons/website/views/website_templates.xml | 1 + 2 files changed, 65 insertions(+) create mode 100644 addons/website/static/src/js/website.tour.install-app.js diff --git a/addons/website/static/src/js/website.tour.install-app.js b/addons/website/static/src/js/website.tour.install-app.js new file mode 100644 index 00000000000..98946314368 --- /dev/null +++ b/addons/website/static/src/js/website.tour.install-app.js @@ -0,0 +1,64 @@ +(function () { + 'use strict'; + + var website = openerp.website; + + var render = website.tour.render; + + website.InstallAppTour = website.EditorTour.extend({ + id: 'install_app', + name: "Instal a new App", + init: function (editor) { + var self = this; + var $body = $(document.body); + 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: render('website.tour_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.", + template: render('website.tour_popover'), + onShow: function () { + editor.on('rte:customize_menu_ready', editor, function() { + self.movetoStep('install-app'); + }); + }, + }, + { + 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.", + template: render('website.tour_popover'), + }, + ]; + return this._super(); + }, + }); + + website.EditorBar.include({ + start: function () { + var menu = $('#help-menu'); + var installAppTour = new website.InstallAppTour(this); + var $menuItem = $($.parseHTML('
  • '+installAppTour.name+'
  • ')); + $menuItem.click(function () { + installAppTour.reset(); + installAppTour.start(); + }); + menu.append($menuItem); + return this._super(); + }, + }); + +}()); diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index 40c0a11a932..96963686b0c 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -100,6 +100,7 @@ +