From 7c12d5d200141907e5f3b7492e958c3c8c83b6f5 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 3 Feb 2014 17:03:31 +0100 Subject: [IMP] clearer indication that images are being up/downloaded bzr revid: xmo@openerp.com-20140203160331-04h1erlunelb9kkn --- addons/website/static/src/js/website.editor.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index ab97ee2bcf9..43b2025e191 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -1265,7 +1265,7 @@ }), start: function () { - this.$('.modal-footer [disabled]').text("Uploading…"); + this.$('button.wait').text("Uploading…"); var $options = this.$('.image-style').children(); this.image_styles = $options.map(function () { return this.value; }).get(); @@ -1327,14 +1327,22 @@ this.set_image(url); }, preview_image: function () { - this.$el.removeClass('nosave'); + var loaded = function () { + this.$el.removeClass('nosave'); + }.bind(this); var image = this.$('input.url').val(); - if (!image) { return; } + if (!image) { loaded(); return; } - this.$('img.image-preview') + var $img = this.$('img.image-preview') .attr('src', image) .removeClass(this.image_styles.join(' ')) .addClass(this.$('select.image-style').val()); + + if ($img.prop('complete')) { + loaded(); + } else { + $img.load(loaded) + } }, browse_existing: function (e) { e.preventDefault(); -- cgit v1.2.3 From 18d9e91394addcebd252623492fba33d5fe6300f Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 4 Feb 2014 16:36:16 +0100 Subject: [IMP] make editor bar appear faster to avoid impression of slowness and reflow bzr revid: xmo@openerp.com-20140204153616-swho76l8v3s4p1dq --- addons/website/static/src/js/website.editor.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index 43b2025e191..dd8fd42727f 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -10,6 +10,9 @@ if (!is_smartphone) { website.ready().then(website.init_editor); + } else { + // remove padding of fake editor bar + document.body.style.padding = 0; } $(document).on('click', 'a.js_link2post', function (ev) { @@ -437,6 +440,10 @@ }); }, start: function() { + // remove placeholder editor bar + var fakebar = document.getElementById('website-top-navbar-placeholder'); + fakebar.parentNode.removeChild(fakebar); + var self = this; this.saving_mutex = new openerp.Mutex(); -- cgit v1.2.3 From 7d1f7ee10a6a71df6e031547a31dc24bd4494e24 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 4 Feb 2014 17:58:23 +0100 Subject: [IMP] handling of overly large images in website image upload bzr revid: xmo@openerp.com-20140204165823-q05aoq83q28b2hhg --- addons/website/static/src/js/website.editor.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index dd8fd42727f..edcff1bbc77 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -1305,13 +1305,16 @@ * Sets the provided image url as the dialog's value-to-save and * refreshes the preview element to use it. */ - set_image: function (url) { + set_image: function (url, error) { + this.$('input.url').val( + error ? '' : url); this.$('input.url').val(url); this.preview_image(); }, file_selection: function () { this.$el.addClass('nosave'); + this.$('form').removeClass('has-error').find('.help-block').empty(); this.$('button.filepicker').removeClass('btn-danger btn-success'); var self = this; @@ -1326,12 +1329,15 @@ }, file_selected: function(url, error) { var $button = this.$('button.filepicker'); - if (error) { + if (!error) { + $button.addClass('btn-success'); + } else { + url = null; + this.$('form').addClass('has-error') + .find('.help-block').text(error); $button.addClass('btn-danger'); - return; } - $button.addClass('btn-success'); - this.set_image(url); + this.set_image(url, error); }, preview_image: function () { var loaded = function () { @@ -1353,6 +1359,8 @@ }, browse_existing: function (e) { e.preventDefault(); + this.$('form').removeClass('has-error').find('.help-block').empty(); + this.$('button.filepicker').removeClass('btn-danger btn-success'); new website.editor.ExistingImageDialog(this).appendTo(document.body); }, }); -- cgit v1.2.3 From c68c5837aae1138a58f946d6a83cb1ce71e16fe9 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 5 Feb 2014 11:36:23 +0100 Subject: [FIX] avoid blowing up editor if run on non-updated editor_head template without a placeholder edition navbar bzr revid: xmo@openerp.com-20140205103623-bk038voq3f8zj9vm --- addons/website/static/src/js/website.editor.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index edcff1bbc77..e5ba5018316 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -442,7 +442,9 @@ start: function() { // remove placeholder editor bar var fakebar = document.getElementById('website-top-navbar-placeholder'); - fakebar.parentNode.removeChild(fakebar); + if (fakebar) { + fakebar.parentNode.removeChild(fakebar); + } var self = this; this.saving_mutex = new openerp.Mutex(); -- cgit v1.2.3 From d819d494f11d275cdd9ad2a7078ae93d4ef59dc1 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 6 Feb 2014 14:50:36 +0100 Subject: [IMP] website: add debugger template used to create nex tours/tests (display in customize menu in debug mode) bzr revid: chm@openerp.com-20140206135036-geq8fubtz39pxp20 --- addons/website/static/src/js/website.editor.js | 1 + 1 file changed, 1 insertion(+) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index e5ba5018316..e809619a923 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -414,6 +414,7 @@ openerp.jsonRpc('/website/customize_template_get', 'call', { 'xml_id': view_name }).then( function(result) { _.each(result, function (item) { + if (item.xml_id === "website.debugger" && !window.location.search.match(/[&?]debug(&|$)/)) return; if (item.header) { menu.append(''); } else { -- cgit v1.2.3 From 052bcacd5f80e68b3c6fbce31ccc56206eb480bb Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 6 Feb 2014 15:02:58 +0100 Subject: [FIX] website_sale template; snippet editor bzr revid: chm@openerp.com-20140206140258-l3hriceuksx0c061 --- addons/website/static/src/js/website.snippets.editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index 8a3e7a4421d..a702344a308 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -9,7 +9,7 @@ var self = this; $("[data-oe-model]").on('click', function (event) { var $this = $(event.srcElement); - var tag = $this[0].tagName.toLowerCase(); + var tag = $this[0] && $this[0].tagName.toLowerCase(); if (!(tag === 'a' || tag === "button") && !$this.parents("a, button").length) { self.$('[data-action="edit"]').parent().effect('bounce', {distance: 18, times: 5}, 250); } -- cgit v1.2.3 From 0677fda79ec8e57930762464a958eaf852b1441e Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 6 Feb 2014 15:06:43 +0100 Subject: [FIX] website tours: fix and translate bzr revid: chm@openerp.com-20140206140643-z3b2fu2v9uaozc1z --- .../website/static/src/js/website.tour.banner.js | 70 +++++++++++----------- 1 file changed, 35 insertions(+), 35 deletions(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.tour.banner.js b/addons/website/static/src/js/website.tour.banner.js index b079c4a670c..9fe0843f618 100644 --- a/addons/website/static/src/js/website.tour.banner.js +++ b/addons/website/static/src/js/website.tour.banner.js @@ -2,113 +2,113 @@ 'use strict'; var website = openerp.website; + var _t = openerp._t; website.EditorBar.include({ start: function () { - this.registerTour(new website.BannerTour(this)); + this.registerTour(new website.Tour.Banner(this)); return this._super(); }, }); - website.BannerTour = website.Tour.extend({ + website.Tour.Banner = website.Tour.extend({ id: 'banner', name: "Insert a banner", path: '/', - init: function (editor) { + init: function () { var self = this; self.steps = [ { - title: "Welcome to your website!", - 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" }), + title: _t("Welcome to your website!"), + content: _t("This tutorial will guide you to build your home page. We will start by adding a banner."), + template: self.popover({ next: _t("Start Tutorial"), end: _t("Skip It") }), backdrop: true, }, { waitNot: '.popover.tour', element: 'button[data-action=edit]', placement: 'bottom', - title: "Edit this page", - content: "Every page of your website can be modified through the Edit button.", + title: _t("Edit this page"), + content: _t("Every page of your website can be modified through the Edit button."), template: self.popover({ fixed: true }), }, { element: 'button[data-action=snippet]', placement: 'bottom', - title: "Insert building blocks", - content: "To add content in a page, you can insert building blocks.", + title: _t("Insert building blocks"), + content: _t("To add content in a page, you can insert building blocks."), template: self.popover({ fixed: true }), }, { snippet: 'carousel', placement: 'bottom', - title: "Drag & Drop a Banner", - content: "Drag the Banner block and drop it in your page.", + title: _t("Drag & Drop a Banner"), + content: _t("Drag the Banner block and drop it in your page."), template: self.popover({ fixed: true }), }, { waitFor: '.oe_overlay_options .oe_options:visible', element: '#wrap [data-snippet-id=carousel]:first .carousel-caption', - sampleText: 'My Title', placement: 'top', - title: "Customize banner's text", - content: "Click in the text and start editing it. Click continue once it's done.", - template: self.popover({ next: "Continue" }), + title: _t("Customize banner's text"), + content: _t("Click in the text and start editing it. Click continue once it's done."), + template: self.popover({ next: _t("Continue") }), }, { element: '.oe_overlay_options .oe_options', placement: 'left', - title: "Customize the banner", - content: "Customize any block through this menu. Try to change the background of the banner.", - template: self.popover({ next: "Continue" }), + title: _t("Customize the banner"), + content: _t("Customize any block through this menu. Try to change the background of the banner."), + template: self.popover({ next: _t("Continue") }), }, { waitNot: '.popover.tour', element: 'button[data-action=snippet]', placement: 'bottom', - title: "Add Another Block", - content: "Let's add another building block to your page.", + title: _t("Add Another Block"), + content: _t("Let's add another building block to your page."), template: self.popover({ fixed: true }), }, { snippet: 'three-columns', placement: 'bottom', - title: "Drag & Drop a Block", - content: "Drag the '3 Columns' block and drop it below the banner.", + title: _t("Drag & Drop a Block"), + content: _t("Drag the '3 Columns' block and drop it below the banner."), template: self.popover({ fixed: true }), }, { waitFor: '.oe_overlay_options .oe_options:visible', element: 'button[data-action=save]', placement: 'right', - title: "Save your modifications", - content: "Publish your page by clicking on the 'Save' button.", + title: _t("Save your modifications"), + content: _t("Publish your page by clicking on the 'Save' button."), template: self.popover({ fixed: true }), }, { waitFor: 'button[data-action=edit]:visible', - title: "Congratulation!", - content: "Your homepage has been updated.", - template: self.popover({ next: "Continue" }), + title: _t("Congratulation!"), + content: _t("Your homepage has been updated."), + template: self.popover({ next: _t("Continue") }), }, { waitNot: '.popover.tour', element: 'a[data-action=show-mobile-preview]', placement: 'bottom', - title: "Test Your Mobile Version", - content: "Let's check how your homepage looks like on mobile devices.", + title: _t("Test Your Mobile Version"), + content: _t("Let's check how your homepage looks like on mobile devices."), template: self.popover({ fixed: true }), }, { element: 'button[data-dismiss=modal]', placement: 'right', - title: "Close Mobile Preview", - content: "Scroll in the mobile preview to test the rendering. Once it's ok, close this dialog.", + title: _t("Close Mobile Preview"), + content: _t("Scroll in the mobile preview to test the rendering. Once it's ok, close this dialog."), }, { waitNot: '.modal', - title: "Congrats", - content: "Congratulation. This tour is finished.", - template: self.popover({ fixed: true, next: "Close Tutorial" }), + title: _t("Congrats"), + content: _t("Congratulation. This tour is finished."), + template: self.popover({ fixed: true, next: _t("Close Tutorial") }), }, ]; return this._super(); -- cgit v1.2.3 From e8964f896c4b23b0b8c1a5722f4576c5a7201bcc Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 6 Feb 2014 15:07:46 +0100 Subject: [FIX] website: tour, test and test_runner bzr revid: chm@openerp.com-20140206140746-jmeyx8q9qxv7sz1j --- addons/website/static/src/js/website.tests.js | 40 -------- addons/website/static/src/js/website.tour.js | 109 +++++++++++----------- addons/website/static/src/js/website.tour.test.js | 27 ++++++ 3 files changed, 84 insertions(+), 92 deletions(-) delete mode 100644 addons/website/static/src/js/website.tests.js create mode 100644 addons/website/static/src/js/website.tour.test.js (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.tests.js b/addons/website/static/src/js/website.tests.js deleted file mode 100644 index 977dc8e1848..00000000000 --- a/addons/website/static/src/js/website.tests.js +++ /dev/null @@ -1,40 +0,0 @@ -var tests = {}; -var droptest = function () { - var errors = []; - for (var snippet_id in tests) { - if (!tests[snippet_id]['activated'] || !tests[snippet_id]['dropped']){ - console.log("Can't dropped or activated snippet: " + snippet_id); - } - } - if (errors.length) { - console.log(tests); - throw new Error("Can't dropped or activated at least one snippet"); - } - $("#oe_snippets").off('snippet-activated snippet-dropped'); -}; -var droptesttime = setTimeout(droptest,0); - -$("#oe_snippets").off('snippet-activated snippet-dropped') - .on('snippet-activated', function (event, dom) { - tests[$(dom).data('src-snippet-id')]['activated'] = true; - clearTimeout(droptesttime); - droptesttime = setTimeout(droptest,0); - }) - .on('snippet-dropped', function (event, dom, src_snipped_id) { - tests[$(dom).data('src-snippet-id')]['dropped'] = true; - clearTimeout(droptesttime); - droptesttime = setTimeout(droptest,0); - }); -var $thumbnails = $('#oe_snippets div.oe_snippet[data-snippet-id] .oe_snippet_thumbnail'); -$thumbnails.each(function () { - var $thumbnail = $(this); - tests[$thumbnail.parent().data('snippet-id')] = {}; - var position = $thumbnail.position(); - $thumbnail.trigger( $.Event( "mousedown", { which: 1, pageX: position.left, pageY: position.top } ) ); - $thumbnail.trigger( $.Event( "mousemove", { which: 1, pageX: position.left+100, pageY: position.top+100 } ) ); - $first_drop = $(".oe_drop_zone").first(); - position = $first_drop.position(); - $first_drop.trigger( $.Event( "mouseup", { which: 1, pageX: position.left+20, pageY: position.top+20 } ) ); - clearTimeout(droptesttime); - droptesttime = setTimeout(droptest,0); -}); diff --git a/addons/website/static/src/js/website.tour.js b/addons/website/static/src/js/website.tour.js index 1db813e4cd4..4285656e39a 100644 --- a/addons/website/static/src/js/website.tour.js +++ b/addons/website/static/src/js/website.tour.js @@ -4,6 +4,7 @@ var website = openerp.website; website.add_template_file('/website/static/src/xml/website.tour.xml'); +if (website.EditorBar) website.EditorBar.include({ tours: [], start: function () { @@ -17,31 +18,11 @@ website.EditorBar.include({ }); menu.append($menuItem); }); - - this.waitRTEReady = false; - this.on('rte:called', this, function () {self.waitRTEReady = true; }); - this.on('rte:ready', this, function () {self.waitRTEReady = false;}); - - var res = this._super(); - website.Tour.waitReady.call(this, this.testRunning); - return res; + return this._super(); }, registerTour: function (tour) { website.Tour.add(tour); this.tours.push(tour); - }, - testRunning: function () { - if (this.waitRTEReady) { - this.on('rte:ready', this, function () { - website.Tour.each(function () { - this.running(); - }); - }); - } else { - website.Tour.each(function () { - this.running(); - }); - } } }); @@ -78,23 +59,12 @@ $.ajaxSetup({ } }); - website.Tour = openerp.Class.extend({ steps: [], defaultDelay: 50, //ms + defaultOverLaps: 5000, //ms localStorage: window.localStorage, - init: function (url) { - this.tour = new Tour({ - name: this.id, - storage: this.tourStorage, - keyboard: false, - template: this.popover(), - onHide: function () { - window.scrollTo(0, 0); - } - }); - this.registerSteps(); - }, + init: function () {}, run: function (automatic) { this.reset(); @@ -143,14 +113,11 @@ website.Tour = openerp.Class.extend({ }, _running: function () { var stepId = this.localStorage.getItem("tour-"+this.id+"-test"); - var automatic = !!this.localStorage.getItem("tour-"+this.id+"-test-automatic"); - + if (stepId != null) { - if (!this.check(this.step(stepId))) { - var step = this.next(stepId); - stepId = step ? step.stepId : stepId; - } - this.nextStep(stepId, automatic ? this.autoNextStep : null, automatic ? 5000 : null); + this.automatic = !!this.localStorage.getItem("tour-"+this.id+"-test-automatic"); + this.registerTour(); + this.nextStep(stepId, this.automatic ? this.autoNextStep : null, this.automatic ? this.defaultOverLaps : null); } }, @@ -187,6 +154,18 @@ website.Tour = openerp.Class.extend({ } }, + registerTour: function () { + this.tour = new Tour({ + name: this.id, + storage: this.tourStorage, + keyboard: false, + template: this.popover(), + onHide: function () { + window.scrollTo(0, 0); + } + }); + this.registerSteps(); + }, registerSteps: function () { for (var index=0, len=this.steps.length; index Date: Thu, 6 Feb 2014 15:52:36 +0100 Subject: [FIX] tour and translate title bzr revid: chm@openerp.com-20140206145236-vwdq74yyz21qvyzu --- addons/website/static/src/js/website.editor.newpage.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.editor.newpage.js b/addons/website/static/src/js/website.editor.newpage.js index 944a24b89d8..8d3b3e9b6b5 100644 --- a/addons/website/static/src/js/website.editor.newpage.js +++ b/addons/website/static/src/js/website.editor.newpage.js @@ -2,6 +2,7 @@ "use strict"; var website = openerp.website; + var _t = openerp._t; website.is_editable = true; website.is_editable_button = true; @@ -16,7 +17,8 @@ 'click a[data-action=new_page]': function (ev) { ev.preventDefault(); website.prompt({ - window_title: "New Page", + id: "editor_new_page", + window_title: _t("New Page"), input: "Page Title", }).then(function (val) { if (val) { -- cgit v1.2.3 From 4663f5b10ca78a2acbbffbbd8d68f7893e1d2f54 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 7 Feb 2014 08:47:45 +0100 Subject: [IMP] website test: add a timeout in phantom js to raise a better error and improve log error bzr revid: chm@openerp.com-20140207074745-ffrcoi2aj5m67i8m --- addons/website/static/src/js/website.tour.js | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.tour.js b/addons/website/static/src/js/website.tour.js index 4285656e39a..25d8ac89a12 100644 --- a/addons/website/static/src/js/website.tour.js +++ b/addons/website/static/src/js/website.tour.js @@ -75,9 +75,8 @@ website.Tour = openerp.Class.extend({ website.Tour.busy = true; - if (automatic) { - this.localStorage.setItem("tour-"+this.id+"-test-automatic", true); - } + this.localStorage.setItem("tour-"+this.id+"-test-automatic", automatic); + this.automatic = automatic; if (this.path) { // redirect to begin of the tour in function of the language @@ -93,12 +92,13 @@ website.Tour = openerp.Class.extend({ website.Tour.waitReady.call(this, function () {self._running();}); }, running: function () { + var self = this; if (+this.localStorage.getItem("tour-"+this.id+"-test") >= this.steps.length-1) { this.endTour(); return; } - if (website.Tour.is_busy() || !this.testPathUrl()) return; + if (website.Tour.is_busy()) return; // launch tour with url this.checkRunningUrl(); @@ -106,6 +106,21 @@ website.Tour = openerp.Class.extend({ // mark tour as busy (only one test running) if (this.localStorage.getItem("tour-"+this.id+"-test") != null) { website.Tour.busy = true; + this.automatic = !!this.localStorage.getItem("tour-"+this.id+"-test-automatic"); + } + + if (!this.testPathUrl()) { + if (this.automatic) { + this.timer = setTimeout(function () { + self.reset(); + throw new Error("Wrong url for running " + self.id + + '\ntestPath: ' + self.testPath + + '\nhref: ' + window.location.href + + "\nreferrer: " + document.referrer + ); + },this.defaultOverLaps); + } + return; } var self = this; @@ -115,7 +130,6 @@ website.Tour = openerp.Class.extend({ var stepId = this.localStorage.getItem("tour-"+this.id+"-test"); if (stepId != null) { - this.automatic = !!this.localStorage.getItem("tour-"+this.id+"-test-automatic"); this.registerTour(); this.nextStep(stepId, this.automatic ? this.autoNextStep : null, this.automatic ? this.defaultOverLaps : null); } -- cgit v1.2.3 From 8879fb17288c0ab902cb4c106dbabe430ab55d6f Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 7 Feb 2014 11:07:34 +0100 Subject: [FIX] website snippet: reset snippet-editor and overlay because the rte re-generate the dom and cancelled all snippet datas bzr revid: chm@openerp.com-20140207100734-pdzr0qz8mtmha96m --- addons/website/static/src/js/website.snippets.editor.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index 8a3e7a4421d..7965c4b88f0 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -416,6 +416,19 @@ } setTimeout(function () { $("#oe_snippets").trigger('snippet-dropped', $target); + + // reset snippet for rte + $target.removeData("snippet-editor"); + $target.removeData("overlay"); + self.create_overlay($target); + $target.find("[data-snippet-id]").each(function () { + var $snippet = $(this); + $snippet.removeData("snippet-editor"); + $snippet.removeData("overlay"); + self.create_overlay($snippet); + }); + // end + self.make_active($target); },0); } else { -- cgit v1.2.3 From b21bb08c22680b12c6ae6f6b82dc04ca87f60594 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 7 Feb 2014 13:52:31 +0100 Subject: [ADD] website: test login, backend, go back, branding, edit, logout bzr revid: chm@openerp.com-20140207125231-3zd0i1axdwuht5g4 --- .../static/src/js/website.tour.test.admin.js | 106 +++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 addons/website/static/src/js/website.tour.test.admin.js (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.tour.test.admin.js b/addons/website/static/src/js/website.tour.test.admin.js new file mode 100644 index 00000000000..81078185a35 --- /dev/null +++ b/addons/website/static/src/js/website.tour.test.admin.js @@ -0,0 +1,106 @@ +(function () { + 'use strict'; + + var website = openerp.website; + + website.Tour.LoginEdit = website.Tour.extend({ + id: 'login_edit', + name: "Try to log as admin and check editor", + path: '/', + init: function () { + var self = this; + self.steps = [ + { + title: "click login", + element: '#top_menu a[href*="/web/login"]', + }, + { + title: "insert login", + element: '.oe_login_form input[name="login"]', + sampleText: typeof user !== "undefined" ? user : "admin", + }, + { + title: "insert password", + waitFor: '.oe_login_form input[name="login"][value!=""]', + element: '.oe_login_form input[name="password"]', + sampleText: typeof password !== "undefined" ? password : "admin", + }, + { + title: "select 2 Standard tickets", + waitFor: '.oe_login_form input[name="password"][value!=""]', + element: '.oe_login_form button', + }, + { + title: "go back to website from backend", + element: 'a[data-action-model="ir.actions.act_url"]:contains("Website")', + }, + { + title: 'try to edit', + waitNot: '#wrap .carousel', + element: 'button[data-action=edit]:visible', + }, + { + title: 'check edit mode', + waitFor: 'button[data-action=save]:visible', + }, + { + title: 'check branding', + waitFor: '#wrap[data-oe-model="ir.ui.view"]', + }, + { + title: 'check rte', + waitFor: '#oe_rte_toolbar', + }, + { + title: 'check insert block button', + element: '[data-action="snippet"]:visible', + }, + { + title: 'add snippets', + snippet: 'carousel', + }, + { + title: 'try to save', + waitFor: '.oe_overlay_options .oe_options:visible', + element: 'button[data-action=save]:visible', + }, + { + title: 'check saved', + waitFor: '#wrap div.carousel', + element: 'button[data-action=edit]:visible', + }, + { + title: 'try to re-edit', + waitFor: 'button[data-action=save]:visible', + element: '#wrap .carousel', + }, + { + title: 'remove snippet', + element: '.oe_snippet_remove', + }, + { + title: 'try to re-save', + waitNot: '#wrap .carousel', + element: 'button[data-action=save]:visible', + }, + { + title: "click admin", + waitFor: 'button[data-action=edit]:visible', + element: 'a:contains("Administrator")', + }, + { + title: "click logout", + element: '#top_menu a[href*="/logout"]', + }, + { + title: "check logout", + waitFor: '#top_menu a[href*="/web/login"]', + }, + ]; + return this._super(); + }, + }); + // for test without editor bar + website.Tour.add(website.Tour.LoginEdit); + +}()); -- cgit v1.2.3 From 6cb5b1e556f5a97e2caa45fdc1f6ad605bc028a5 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 7 Feb 2014 14:01:04 +0100 Subject: [FIX] website: test tour: use admin insead of tools.config['admin_passwd'] bzr revid: chm@openerp.com-20140207130104-nuwurzlsvt4cu1jr --- addons/website/static/src/js/website.tour.test.admin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.tour.test.admin.js b/addons/website/static/src/js/website.tour.test.admin.js index 81078185a35..787f05beb23 100644 --- a/addons/website/static/src/js/website.tour.test.admin.js +++ b/addons/website/static/src/js/website.tour.test.admin.js @@ -17,13 +17,13 @@ { title: "insert login", element: '.oe_login_form input[name="login"]', - sampleText: typeof user !== "undefined" ? user : "admin", + sampleText: "admin", }, { title: "insert password", waitFor: '.oe_login_form input[name="login"][value!=""]', element: '.oe_login_form input[name="password"]', - sampleText: typeof password !== "undefined" ? password : "admin", + sampleText: "admin", }, { title: "select 2 Standard tickets", -- cgit v1.2.3 From 76841f14e4ae1e56516d680bca09b41381d3ee75 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 7 Feb 2014 14:37:12 +0100 Subject: [FIX] website: snippet: display baner in mobile view; background cover insead of 100%; paralax scrolling bzr revid: chm@openerp.com-20140207133712-srtik2knhwyybgse --- addons/website/static/src/js/website.snippets.animation.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.snippets.animation.js b/addons/website/static/src/js/website.snippets.animation.js index 60c5aea49e2..048cf20231f 100644 --- a/addons/website/static/src/js/website.snippets.animation.js +++ b/addons/website/static/src/js/website.snippets.animation.js @@ -105,7 +105,7 @@ var offset = 0; var padding = parseInt($(document.body).css("padding-top")); if (speed < 1) { - var inner_offset = self.$target.outerHeight() - this.height / this.width * document.body.clientWidth; + var inner_offset = - self.$target.outerHeight() + this.height / this.width * document.body.clientWidth; var outer_offset = self.$target.offset().top - (document.body.clientHeight - self.$target.outerHeight()) - padding; offset = - outer_offset * speed + inner_offset; } else { -- cgit v1.2.3 From 25117ffd0b964ea58ce3c1c1f2a0467c4d14b16a Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 7 Feb 2014 14:45:48 +0100 Subject: [FIX] tour test log error bzr revid: chm@openerp.com-20140207134548-lr2563gtlgjphxrp --- addons/website/static/src/js/website.tour.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.tour.test.js b/addons/website/static/src/js/website.tour.test.js index b98adb98b27..4fc9f1fe213 100644 --- a/addons/website/static/src/js/website.tour.test.js +++ b/addons/website/static/src/js/website.tour.test.js @@ -13,7 +13,7 @@ if (typeof Tour === "undefined") { } for (var i in scripts) { if (typeof jQuery === "undefined") { - throw new Error("jQuery not found.\nhref: " + window.location.href + "\n\n" + document.body.innerHTML); + throw new Error("jQuery not found.\nhref: " + window.location.href + (document && document.body ? "\n\n" + document.body.innerHTML : "")); } jQuery.ajax({ async: false, -- cgit v1.2.3 From 5f6f08899be4b1d7b0bec75cc81581583d141ada Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 7 Feb 2014 14:59:46 +0100 Subject: [IMP] insert a banner --> build a page bzr revid: fp@tinyerp.com-20140207135946-7gkzt6zodhf0hdxi --- addons/website/static/src/js/website.tour.banner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.tour.banner.js b/addons/website/static/src/js/website.tour.banner.js index 2c26ae34e98..abbdc80ec7e 100644 --- a/addons/website/static/src/js/website.tour.banner.js +++ b/addons/website/static/src/js/website.tour.banner.js @@ -12,7 +12,7 @@ website.BannerTour = website.Tour.extend({ id: 'banner', - name: "Insert a banner", + name: "Build a page", path: '/page/website.homepage', init: function (editor) { var self = this; -- cgit v1.2.3 From f767f6ca4722313bdff194de023db559156865d7 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 7 Feb 2014 15:34:37 +0100 Subject: [FIX] website tour test: import with ajax insead of jquery (and auto load jquery) bzr revid: chm@openerp.com-20140207143437-uptdehmpegzze61y --- addons/website/static/src/js/website.tour.test.js | 47 +++++++++++++---------- 1 file changed, 26 insertions(+), 21 deletions(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.tour.test.js b/addons/website/static/src/js/website.tour.test.js index 4fc9f1fe213..ce2cc721a82 100644 --- a/addons/website/static/src/js/website.tour.test.js +++ b/addons/website/static/src/js/website.tour.test.js @@ -1,27 +1,32 @@ (function () { -var scripts = []; + +function LoadScript(src) { + xmlHttp = new XMLHttpRequest(); + xmlHttp.onreadystatechange = function() { + if(xmlHttp.readyState == 4) { + if (xmlHttp.status == 200 || xmlHttp.status == 304) { + new Function(xmlHttp.responseText)(); + } else { + throw new Error("Can't load JavaScript.\nhref: " + window.location.href + "\nsrc: " + src); + } + } + }; + xmlHttp.open("GET", src, false); + xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); + xmlHttp.send(null); +} + +if (typeof jQuery === "undefined") + LoadScript("/web/static/lib/jquery/jquery.js"); if (typeof openerp === "undefined") { - scripts.push("/web/static/lib/qweb/qweb2.js"); - scripts.push("/web/static/lib/qweb/openerpframework.js"); + LoadScript("/web/static/lib/qweb/qweb2.js"); + LoadScript("/web/static/lib/qweb/openerpframework.js"); } if (typeof openerp === "undefined" || !openerp.website || !openerp.website.add_template_file) - scripts.push("/website/static/src/js/website.js"); + LoadScript("/website/static/src/js/website.js"); if (typeof openerp === "undefined" || !openerp.website.Tour) - scripts.push("/website/static/src/js/website.tour.js"); -if (typeof Tour === "undefined") { - scripts.push("/website/static/lib/bootstrap-tour/bootstrap-tour.js"); -} -for (var i in scripts) { - if (typeof jQuery === "undefined") { - throw new Error("jQuery not found.\nhref: " + window.location.href + (document && document.body ? "\n\n" + document.body.innerHTML : "")); - } - jQuery.ajax({ - async: false, - type: 'GET', - data: null, - url: scripts[i], - dataType: "script", - error: function (a,b,e) {throw e;} - }); -} + LoadScript("/website/static/src/js/website.tour.js"); +if (typeof Tour === "undefined") + LoadScript("/website/static/lib/bootstrap-tour/bootstrap-tour.js"); + })(); \ No newline at end of file -- cgit v1.2.3 From 6900662b540f4e92842e4473e177510224f2620f Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 7 Feb 2014 15:51:49 +0100 Subject: [FIX] page creation broken because what is grep bzr revid: xmo@openerp.com-20140207145149-fem1wnr0t10rcgsn --- addons/website/static/src/js/website.editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index e5ba5018316..fab9dbcc4a7 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -1082,7 +1082,7 @@ } else { // Create the page, get the URL back done = $.get(_.str.sprintf( - '/pagenew/%s?noredirect=1', encodeURI(data.id))) + '/website/add/%s?noredirect=1', encodeURI(data.id))) .then(function (response) { self.make_link(response, false, data.id); }); -- cgit v1.2.3 From 6d7eccf10ab732b539ed44566d8679189b5d2561 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Fri, 7 Feb 2014 16:45:20 +0100 Subject: [FIX] website snippet drop for rte; remove dependence to qweb template (remove popover from tours); fx import file with ajax bzr revid: chm@openerp.com-20140207154520-2injapzg9lgrdbvc --- .../static/src/js/website.snippets.editor.js | 10 ++++++-- .../website/static/src/js/website.tour.banner.js | 29 +++++++++++----------- addons/website/static/src/js/website.tour.js | 16 ++++++++---- addons/website/static/src/js/website.tour.test.js | 8 +++--- 4 files changed, 38 insertions(+), 25 deletions(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index 28dab725792..e45bee9685b 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -419,12 +419,18 @@ // reset snippet for rte $target.removeData("snippet-editor"); - $target.removeData("overlay"); + if ($target.data("overlay")) { + $target.data("overlay").remove(); + $target.removeData("overlay"); + } self.create_overlay($target); $target.find("[data-snippet-id]").each(function () { var $snippet = $(this); $snippet.removeData("snippet-editor"); - $snippet.removeData("overlay"); + if ($snippet.data("overlay")) { + $snippet.data("overlay").remove(); + $snippet.removeData("overlay"); + } self.create_overlay($snippet); }); // end diff --git a/addons/website/static/src/js/website.tour.banner.js b/addons/website/static/src/js/website.tour.banner.js index 9fe0843f618..c5b04091b40 100644 --- a/addons/website/static/src/js/website.tour.banner.js +++ b/addons/website/static/src/js/website.tour.banner.js @@ -19,10 +19,9 @@ var self = this; self.steps = [ { - title: _t("Welcome to your website!"), - content: _t("This tutorial will guide you to build your home page. We will start by adding a banner."), - template: self.popover({ next: _t("Start Tutorial"), end: _t("Skip It") }), - backdrop: true, + title: _t("Welcome to your website!"), + content: _t("This tutorial will guide you to build your home page. We will start by adding a banner."), + popover: { next: _t("Start Tutorial"), end: _t("Skip It") }, }, { waitNot: '.popover.tour', @@ -30,21 +29,21 @@ placement: 'bottom', title: _t("Edit this page"), content: _t("Every page of your website can be modified through the Edit button."), - template: self.popover({ fixed: true }), + popover: { fixed: true }, }, { element: 'button[data-action=snippet]', placement: 'bottom', title: _t("Insert building blocks"), content: _t("To add content in a page, you can insert building blocks."), - template: self.popover({ fixed: true }), + popover: { fixed: true }, }, { snippet: 'carousel', placement: 'bottom', title: _t("Drag & Drop a Banner"), content: _t("Drag the Banner block and drop it in your page."), - template: self.popover({ fixed: true }), + popover: { fixed: true }, }, { waitFor: '.oe_overlay_options .oe_options:visible', @@ -52,14 +51,14 @@ placement: 'top', title: _t("Customize banner's text"), content: _t("Click in the text and start editing it. Click continue once it's done."), - template: self.popover({ next: _t("Continue") }), + popover: { next: _t("Continue") }, }, { element: '.oe_overlay_options .oe_options', placement: 'left', title: _t("Customize the banner"), content: _t("Customize any block through this menu. Try to change the background of the banner."), - template: self.popover({ next: _t("Continue") }), + popover: { next: _t("Continue") }, }, { waitNot: '.popover.tour', @@ -67,14 +66,14 @@ placement: 'bottom', title: _t("Add Another Block"), content: _t("Let's add another building block to your page."), - template: self.popover({ fixed: true }), + popover: { fixed: true }, }, { snippet: 'three-columns', placement: 'bottom', title: _t("Drag & Drop a Block"), content: _t("Drag the '3 Columns' block and drop it below the banner."), - template: self.popover({ fixed: true }), + popover: { fixed: true }, }, { waitFor: '.oe_overlay_options .oe_options:visible', @@ -82,13 +81,13 @@ placement: 'right', title: _t("Save your modifications"), content: _t("Publish your page by clicking on the 'Save' button."), - template: self.popover({ fixed: true }), + popover: { fixed: true }, }, { waitFor: 'button[data-action=edit]:visible', title: _t("Congratulation!"), content: _t("Your homepage has been updated."), - template: self.popover({ next: _t("Continue") }), + popover: { next: _t("Continue") }, }, { waitNot: '.popover.tour', @@ -96,7 +95,7 @@ placement: 'bottom', title: _t("Test Your Mobile Version"), content: _t("Let's check how your homepage looks like on mobile devices."), - template: self.popover({ fixed: true }), + popover: { fixed: true }, }, { element: 'button[data-dismiss=modal]', @@ -108,7 +107,7 @@ waitNot: '.modal', title: _t("Congrats"), content: _t("Congratulation. This tour is finished."), - template: self.popover({ fixed: true, next: _t("Close Tutorial") }), + popover: { fixed: true, next: _t("Close Tutorial") }, }, ]; return this._super(); diff --git a/addons/website/static/src/js/website.tour.js b/addons/website/static/src/js/website.tour.js index 25d8ac89a12..408a4c01539 100644 --- a/addons/website/static/src/js/website.tour.js +++ b/addons/website/static/src/js/website.tour.js @@ -2,6 +2,8 @@ 'use strict'; var website = openerp.website; + +if (typeof QWeb2 !== "undefined") website.add_template_file('/website/static/src/xml/website.tour.xml'); if (website.EditorBar) @@ -185,8 +187,9 @@ website.Tour = openerp.Class.extend({ var step = this.steps[index]; step.stepId = step.stepId || ""+index; - if (!step.waitNot && index > 0 && $(this.steps[index-1].template).has("button[data-role='next']").size()) { - step.waitNot = '.popover.tour'; + if (!step.waitNot && index > 0 && this.steps[index-1] && + this.steps[index-1].popover && this.steps[index-1].popover.next) { + step.waitNot = '.popover.tour:visible'; } if (!step.waitFor && index > 0 && this.steps[index-1].snippet) { step.waitFor = '.oe_overlay_options .oe_options:visible'; @@ -194,6 +197,8 @@ website.Tour = openerp.Class.extend({ step._title = step._title || step.title; step.title = this.popoverTitle({ title: step._title }); + step.template = step.template || this.popover( step.popover ); + if (!step.element) step.orphan = true; if (step.snippet) { step.element = '#oe_snippets div.oe_snippet[data-snippet-id="'+step.snippet+'"] .oe_snippet_thumbnail'; @@ -201,9 +206,10 @@ website.Tour = openerp.Class.extend({ } - if ($(this.steps[index-1].template).has("button[data-role='next']").size()) { + if (this.steps[index-1] && + this.steps[index-1].popover && this.steps[index-1].popover.next) { var step = { - stepId: index, + stepId: ""+index, waitNot: '.popover.tour:visible' }; this.steps.push(step); @@ -437,7 +443,7 @@ website.Tour.each = function (callback) { website.Tour.waitReady = function (callback) { var self = this; $(document).ready(function () { - if ($.ajaxBusy == null || $.ajaxBusy) { + if ($.ajaxBusy) { $(document).ajaxStop(function() { setTimeout(function () { callback.call(self); diff --git a/addons/website/static/src/js/website.tour.test.js b/addons/website/static/src/js/website.tour.test.js index ce2cc721a82..3e85ce20dae 100644 --- a/addons/website/static/src/js/website.tour.test.js +++ b/addons/website/static/src/js/website.tour.test.js @@ -18,15 +18,17 @@ function LoadScript(src) { if (typeof jQuery === "undefined") LoadScript("/web/static/lib/jquery/jquery.js"); +if (typeof _ === "undefined") + LoadScript("/web/static/lib/underscore/underscore.js"); if (typeof openerp === "undefined") { LoadScript("/web/static/lib/qweb/qweb2.js"); - LoadScript("/web/static/lib/qweb/openerpframework.js"); + LoadScript("/web/static/src/js/openerpframework.js"); } if (typeof openerp === "undefined" || !openerp.website || !openerp.website.add_template_file) LoadScript("/website/static/src/js/website.js"); -if (typeof openerp === "undefined" || !openerp.website.Tour) - LoadScript("/website/static/src/js/website.tour.js"); if (typeof Tour === "undefined") LoadScript("/website/static/lib/bootstrap-tour/bootstrap-tour.js"); +if (typeof openerp === "undefined" || !openerp.website.Tour) + LoadScript("/website/static/src/js/website.tour.js"); })(); \ No newline at end of file -- cgit v1.2.3 From ec10577cb2559c8e5bf5eb7ff7040ad3fbc35b6f Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 7 Feb 2014 22:32:54 +0100 Subject: [IMP] tutorial banner bzr revid: fp@tinyerp.com-20140207213254-jxw1fwplg3kjbm78 --- addons/website/static/src/js/website.tour.banner.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.tour.banner.js b/addons/website/static/src/js/website.tour.banner.js index abbdc80ec7e..c125ebad105 100644 --- a/addons/website/static/src/js/website.tour.banner.js +++ b/addons/website/static/src/js/website.tour.banner.js @@ -86,8 +86,8 @@ }, { waitFor: 'button[data-action=edit]:visible', - title: "Congratulation!", - content: "Your homepage has been updated.", + title: "Good Job!", + content: "Well done, you created your homepage.", template: self.popover({ next: "Continue" }), }, { @@ -105,10 +105,11 @@ content: "Scroll in the mobile preview to test the rendering. Once it's ok, close this dialog.", }, { - waitNot: '.modal', - title: "Congrats", - content: "Congratulation. This tour is finished.", - template: self.popover({ fixed: true, next: "Close Tutorial" }), + title: "Congratulation", + element: 'a[id=content-menu-button]', + placement: 'bottom', + content: "This tour is finished. You can continue discovering features with the 'Content' menu.", + template: self.popover({ next: "Close Tutorial" }), }, ]; return this._super(); -- cgit v1.2.3 From 54beb6d0b8440ebfe5e4bbb76ebc8dc7e58d90f4 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Sat, 8 Feb 2014 12:47:50 +0100 Subject: [IMP] Buttons snippet bzr revid: fp@tinyerp.com-20140208114750-jgtx0h5oevqjz4zm --- addons/website/static/src/js/website.tour.banner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.tour.banner.js b/addons/website/static/src/js/website.tour.banner.js index c125ebad105..ee679f13cd5 100644 --- a/addons/website/static/src/js/website.tour.banner.js +++ b/addons/website/static/src/js/website.tour.banner.js @@ -51,7 +51,7 @@ sampleText: 'My Title', placement: 'top', 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.", }, { waitNot: '#wrap [data-snippet-id=carousel]:first .carousel-caption:contains("Your Banner Title")', -- cgit v1.2.3 From e95eb140a74487a91a4c657c3616e4ceb10ea9b4 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Mon, 10 Feb 2014 14:05:04 +0100 Subject: [CHG] website: fp wants image 'change' buttons to be btn-sm bzr revid: xmo@openerp.com-20140210130504-hejvay436emh7f36 --- addons/website/static/src/js/website.editor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index 1e8246366a9..7e867dca685 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -638,7 +638,7 @@ image_dialog(editor, new CKEDITOR.dom.element(previous)); $image_button.hide(); previous = null; - }); + }, 'btn-sm'); // previous is the state of the button-trigger: it's the // currently-ish hovered element which can trigger a button showing. -- cgit v1.2.3 From abc49aebd5ab904c598c16374db17df65eb2e408 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Mon, 10 Feb 2014 15:59:23 +0100 Subject: [FIX] website: don't set tour as automatic when reload page bzr revid: chm@openerp.com-20140210145923-2w9vbxqqgewgkb0w --- addons/website/static/src/js/website.tour.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.tour.js b/addons/website/static/src/js/website.tour.js index 408a4c01539..8b1284f0a07 100644 --- a/addons/website/static/src/js/website.tour.js +++ b/addons/website/static/src/js/website.tour.js @@ -77,7 +77,11 @@ website.Tour = openerp.Class.extend({ website.Tour.busy = true; - this.localStorage.setItem("tour-"+this.id+"-test-automatic", automatic); + if (automatic) { + this.localStorage.setItem("tour-"+this.id+"-test-automatic", true); + } else { + this.localStorage.removeItem("tour-"+this.id+"-test-automatic"); + } this.automatic = automatic; if (this.path) { -- cgit v1.2.3 From 3a273b989cf403d4c35f03f7032fcb5b5a5239db Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Mon, 10 Feb 2014 16:17:41 +0100 Subject: [IMP] website: typo for tutorial bzr revid: chm@openerp.com-20140210151741-grf5wsvjonuihxw0 --- .../website/static/src/js/website.tour.banner.js | 28 +++++++++++++++++----- 1 file changed, 22 insertions(+), 6 deletions(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.tour.banner.js b/addons/website/static/src/js/website.tour.banner.js index c5b04091b40..7bcd4fbcbd1 100644 --- a/addons/website/static/src/js/website.tour.banner.js +++ b/addons/website/static/src/js/website.tour.banner.js @@ -71,8 +71,8 @@ { snippet: 'three-columns', placement: 'bottom', - title: _t("Drag & Drop a Block"), - content: _t("Drag the '3 Columns' block and drop it below the banner."), + title: _t("Drag & Drop This Block"), + content: _t("Drag the 'Three Columns' block and drop it below the banner."), popover: { fixed: true }, }, { @@ -98,16 +98,32 @@ popover: { fixed: true }, }, { - element: 'button[data-dismiss=modal]', + element: '.modal:has(#mobile-viewport) button[data-dismiss=modal]', placement: 'right', title: _t("Close Mobile Preview"), content: _t("Scroll in the mobile preview to test the rendering. Once it's ok, close this dialog."), }, { waitNot: '.modal', - title: _t("Congrats"), - content: _t("Congratulation. This tour is finished."), - popover: { fixed: true, next: _t("Close Tutorial") }, + element: '#content-menu-button', + placement: 'bottom', + title: _t("Add new pages and menus"), + content: _t("The 'Content' menu allows you to add pages or add the top menu."), + popover: { next: _t("Continue") }, + }, + { + element: '#customize-menu-button', + placement: 'bottom', + title: _t("Customize your pages"), + content: _t("The 'Customize' menu allows you to activate options and change the theme."), + popover: { next: _t("Continue") }, + }, + { + element: 'a[data-action="promote-current-page"]', + placement: 'bottom', + title: _t("Promote your website"), + content: _t("The 'Promote' menu allows you to promote each page for google and other search engines."), + popover: { next: _t("Close Tutorial") }, }, ]; return this._super(); -- cgit v1.2.3 From 1ac9b4d20d0c549be3aa51c13ae4b1448334ff5b Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Mon, 10 Feb 2014 16:52:51 +0100 Subject: [IMP] website: banner tutorial: remove step about customize and promote bzr revid: chm@openerp.com-20140210155251-iyj3v06r18vexj7d --- addons/website/static/src/js/website.tour.banner.js | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.tour.banner.js b/addons/website/static/src/js/website.tour.banner.js index 7bcd4fbcbd1..e23ea01d0d6 100644 --- a/addons/website/static/src/js/website.tour.banner.js +++ b/addons/website/static/src/js/website.tour.banner.js @@ -109,20 +109,6 @@ placement: 'bottom', title: _t("Add new pages and menus"), content: _t("The 'Content' menu allows you to add pages or add the top menu."), - popover: { next: _t("Continue") }, - }, - { - element: '#customize-menu-button', - placement: 'bottom', - title: _t("Customize your pages"), - content: _t("The 'Customize' menu allows you to activate options and change the theme."), - popover: { next: _t("Continue") }, - }, - { - element: 'a[data-action="promote-current-page"]', - placement: 'bottom', - title: _t("Promote your website"), - content: _t("The 'Promote' menu allows you to promote each page for google and other search engines."), popover: { next: _t("Close Tutorial") }, }, ]; -- cgit v1.2.3