[IMP] CMS tour initial version

bzr revid: ddm@openerp.com-20131009092338-67jxb87k3h8z2kj8
This commit is contained in:
ddm
2013-10-09 11:23:38 +02:00
parent 47e324e620
commit b96d3a9df3
2 changed files with 17 additions and 7 deletions
+16 -6
View File
@@ -194,11 +194,20 @@
},
});
function refererPath () {
var anchor = document.createElement('a');
anchor.href = document.referrer;
return anchor.pathname;
}
website.UrlParser = openerp.Class.extend({
init: function (url) {
var a = document.createElement('a');
a.href = url;
this.href = a.href;
this.host = a.host;
this.protocol = a.protocol;
this.port = a.port;
this.hostname = a.hostname;
this.pathname = a.pathname;
this.origin = a.origin;
this.search = a.search;
},
});
website.EditorBar.include({
start: function () {
@@ -214,7 +223,8 @@
})
menu.append($menuItem);
});
if (refererPath() === '/web' || website.tutorials.basic.startOfPart2()) {
var url = new website.UrlParser(window.location.href);
if (url.search === '?tutorial=true' || website.tutorials.basic.startOfPart2()) {
website.tutorials.basic.start();
}
return this._super();
+1 -1
View File
@@ -36,7 +36,7 @@
<record id="action_website" model="ir.actions.act_url">
<field name="name">Website</field>
<field name="url">/</field>
<field name="url">/?tutorial=true</field>
<field name="target">self</field>
</record>
<record id="menu_website" model="ir.ui.menu">