From e06a7036f108f473dde1a795c64a2273c5e2b0fe Mon Sep 17 00:00:00 2001 From: "Kunal Chavda (Open ERP)" Date: Mon, 7 Apr 2014 14:13:58 +0530 Subject: [IMP]Implement effect on close tour like smartsheet. bzr revid: kch@tinyerp.com-20140407084358-xnfsn6vsnnqy3lzf --- addons/website/static/src/js/website.tour.js | 30 ++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 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 b7e55fe166b..32b7582a988 100644 --- a/addons/website/static/src/js/website.tour.js +++ b/addons/website/static/src/js/website.tour.js @@ -297,13 +297,31 @@ website.Tour = openerp.Class.extend({ $(".popover.tour button") .off() .on("click", function () { - $(".popover.tour").remove(); + var help = $("#help-menu-button"); + var offset = help.offset(); + var left = (offset.left > 0) ? (offset.left + link.width()) : offset.left; + var top = (link.height() > 0) ? (offset.top + link.height()) : offset.top; + + if ($(this).is("[data-role='next']") && step.element) { + $(".popover.tour").remove(); + } if (step.busy) return; - if (!$(this).is("[data-role='next']")) { - clearTimeout(self.timer); - step.busy = true; - self.tour.end(); - self.endTour(callback); + if (!$(this).is("[data-role='next']") || !step.element) { + $('.popover.tour') + .animate({ + left: left, + top: top, + width: '1px', + height: '1px', + opacity: 0 + }, 1000, + function(){ + $(".popover.tour").remove(); + clearTimeout(self.timer); + step.busy = true; + self.tour.end(); + self.endTour(callback); + }); } }); -- cgit v1.2.3 From ae8f388dedc3ba1458b58c65a833e2220558e0de Mon Sep 17 00:00:00 2001 From: "Kunal Chavda (Open ERP)" Date: Thu, 10 Apr 2014 14:59:01 +0530 Subject: [FIX]forgot to change variable name. bzr revid: kch@tinyerp.com-20140410092901-3422iz7nam26xr9c --- addons/website/static/src/js/website.tour.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.js b/addons/website/static/src/js/website.tour.js index 32b7582a988..665853212af 100644 --- a/addons/website/static/src/js/website.tour.js +++ b/addons/website/static/src/js/website.tour.js @@ -299,8 +299,8 @@ website.Tour = openerp.Class.extend({ .on("click", function () { var help = $("#help-menu-button"); var offset = help.offset(); - var left = (offset.left > 0) ? (offset.left + link.width()) : offset.left; - var top = (link.height() > 0) ? (offset.top + link.height()) : offset.top; + var left = (offset.left > 0) ? (offset.left + help.width()) : offset.left; + var top = (help.height() > 0) ? (offset.top + help.height()) : offset.top; if ($(this).is("[data-role='next']") && step.element) { $(".popover.tour").remove(); -- cgit v1.2.3 From 67b413dba5a5aa7d52f58df975346284fed7bcd4 Mon Sep 17 00:00:00 2001 From: "Kunal Chavda (Open ERP)" Date: Fri, 11 Apr 2014 11:38:33 +0530 Subject: [IMP]improved code for increasing speed pf closing help as per usability review. bzr revid: kch@tinyerp.com-20140411060833-mjf3j2549ya2pre9 --- addons/website/static/src/js/website.tour.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.js b/addons/website/static/src/js/website.tour.js index 665853212af..4a2767d958a 100644 --- a/addons/website/static/src/js/website.tour.js +++ b/addons/website/static/src/js/website.tour.js @@ -314,7 +314,7 @@ website.Tour = openerp.Class.extend({ width: '1px', height: '1px', opacity: 0 - }, 1000, + }, 800, function(){ $(".popover.tour").remove(); clearTimeout(self.timer); -- cgit v1.2.3 From d264cd164017795cee3a8b463eee318c7dc61552 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 16 Apr 2014 12:59:01 +0200 Subject: [IMP] website_mail: make the template / mail editor work. We now have a limited set of fields that we try to edit (body_html and body for body, email_from and email for email-from, name and subject for subject), because t-field is not dynamic. If the model that should be edited does not hold those fields, the mail editor won't work. Also fixed editor not being actiated when going into the body edition. bzr revid: tde@openerp.com-20140416105901-vavkh9erjsq4mof9 --- 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 365b8cf46ea..2119d05f650 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -427,6 +427,7 @@ editor.edit(); } }); + website.editor_bar = editor; }; /* ----- TOP EDITOR BAR FOR ADMIN ---- */ -- cgit v1.2.3 From 02a9df59b78ef83962a07a5b6e0a10c20cb72b42 Mon Sep 17 00:00:00 2001 From: "chm@openerp.com" <> Date: Fri, 18 Apr 2014 17:08:31 +0200 Subject: [FIX] website: media editor: display popup when user click on save button of the view bzr revid: chm@openerp.com-20140418150831-k7fnd7y6ywrmxv6j --- addons/website/static/src/js/website.snippets.editor.js | 4 ++++ 1 file changed, 4 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 f59f2cf07ca..bae014029e1 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -161,6 +161,7 @@ return this._super.apply(this, arguments); }, save: function () { + website.snippet.clean_for_save = true; this.snippets.clean_for_save(); this._super(); }, @@ -1518,6 +1519,9 @@ }); }, onFocus : function () { + // don't open media editor before clean for save + if (website.snippet.clean_for_save) return; + var self = this; if (this.$target.parent().data("oe-field") === "image") { this.$overlay.addClass("hidden"); -- cgit v1.2.3 From ff9ae691d55846bd282fa49b7b46d940f4ed0d55 Mon Sep 17 00:00:00 2001 From: "chm@openerp.com" <> Date: Wed, 23 Apr 2014 11:59:01 +0200 Subject: [FIX] website: snippet editor: speed up save view (construct only option with clean_for_save method); fix carousel arrow bzr revid: chm@openerp.com-20140423095901-q945d4593uet41xy --- .../static/src/js/website.snippets.editor.js | 48 ++++++++-------------- 1 file changed, 18 insertions(+), 30 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 bae014029e1..0177e8b8b64 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -130,6 +130,7 @@ */ + var dummy = function () {}; var website = openerp.website; website.add_template_file('/website/static/src/xml/website.snippets.xml'); @@ -161,7 +162,6 @@ return this._super.apply(this, arguments); }, save: function () { - website.snippet.clean_for_save = true; this.snippets.clean_for_save(); this._super(); }, @@ -362,15 +362,21 @@ }, clean_for_save: function () { var self = this; - $(website.snippet.globalSelector).each(function () { - var $snippet = $(this); - self.make_active($snippet); - self.make_active(false); - var editor = $snippet.data("snippet-editor"); - if (editor) { - editor.clean_for_save(); + + $("*[contentEditable], *[attributeEditable]") + .removeAttr('contentEditable') + .removeAttr('attributeEditable'); + + var options = website.snippet.options; + var template = website.snippet.templateOptions; + for (var k in options) { + if (template[k] && options[k].prototype.clean_for_save !== dummy) { + var $snippet = this.dom_filter(template[k].selector); + $snippet.each(function () { + new options[k](self, null, $(this), k).clean_for_save(); + }); } - }); + } }, make_active: function ($snippet) { if ($snippet && this.$active_snipped_id && this.$active_snipped_id.get(0) === $snippet.get(0)) { @@ -854,8 +860,7 @@ } }, - clean_for_save: function () { - } + clean_for_save: dummy }); website.snippet.options.background = website.snippet.Option.extend({ @@ -943,8 +948,7 @@ this.id = this.unique_id(); this.$target.attr("id", this.id); this.$target.find("[data-slide]").attr("data-cke-saved-href", "#" + this.id); - this.$target.find("[data-slide-to]").attr("data-target", "#" + this.id); - + this.$target.find("[data-target]").attr("data-target", "#" + this.id); this.rebind_event(); }, on_clone: function ($clone) { @@ -964,7 +968,7 @@ }, clean_for_save: function () { this._super(); - this.$target.find(".item").removeClass("next prev left right"); + $(".carousel").find(".item").removeClass("next prev left right active"); if(!this.$target.find(".item.active").length) { this.$target.find(".item:first").addClass("active"); } @@ -1519,9 +1523,6 @@ }); }, onFocus : function () { - // don't open media editor before clean for save - if (website.snippet.clean_for_save) return; - var self = this; if (this.$target.parent().data("oe-field") === "image") { this.$overlay.addClass("hidden"); @@ -1761,19 +1762,6 @@ } this.$overlay.removeClass('oe_active'); }, - - /* clean_for_save - * function called just before save vue - */ - clean_for_save: function () { - for (var i in this.styles){ - this.styles[i].clean_for_save(); - } - this.$target.removeAttr('contentEditable') - .find('*').removeAttr('contentEditable'); - this.$target.removeAttr('attributeEditable') - .find('*').removeAttr('attributeEditable'); - }, }); })(); -- cgit v1.2.3