diff --git a/addons/calendar/calendar_data.xml b/addons/calendar/calendar_data.xml index 4435e8a4324..268c4b96bed 100644 --- a/addons/calendar/calendar_data.xml +++ b/addons/calendar/calendar_data.xml @@ -401,7 +401,7 @@
Dear ${object.cn} ,
-

this it a reminder for the event below :

+

That is a reminder for the event below :

diff --git a/addons/website/data/website_demo.xml b/addons/website/data/website_demo.xml index 8abf901fd89..63900506741 100644 --- a/addons/website/data/website_demo.xml +++ b/addons/website/data/website_demo.xml @@ -25,7 +25,7 @@ Partner Detail
-
+
@@ -73,7 +73,7 @@ response = request.website.render("website.template_partner_post", values) Partners
-
+
diff --git a/addons/website/static/src/css/snippets.css b/addons/website/static/src/css/snippets.css index a19baa33fd6..4121b70ef2e 100644 --- a/addons/website/static/src/css/snippets.css +++ b/addons/website/static/src/css/snippets.css @@ -344,6 +344,12 @@ -moz-box-shadow: 0 0 5px 3px rgba(255, 255, 255, 0.7); box-shadow: 0 0 5px 3px rgba(255, 255, 255, 0.7); } +.oe_overlay .oe_handle.readonly { + cursor: auto !important; +} +.oe_overlay .oe_handle.readonly:before, .oe_overlay .oe_handle.readonly.size { + display: none !important; +} .oe_overlay .icon.btn { display: inline-block; } @@ -351,7 +357,7 @@ position: absolute; left: 50% !important; text-align: center; - top: -11px; + top: -20px; z-index: 1002; } .oe_overlay .oe_overlay_options > .btn-group { @@ -618,8 +624,3 @@ height: 16px; display: inline-block; } - -[data-snippet-id] { - min-height: 10px; - min-width: 10px; -} diff --git a/addons/website/static/src/css/snippets.sass b/addons/website/static/src/css/snippets.sass index afdb261a2a5..d7442a5b0f7 100644 --- a/addons/website/static/src/css/snippets.sass +++ b/addons/website/static/src/css/snippets.sass @@ -252,6 +252,10 @@ background: rgba(30, 30, 30, .8) color: #fff +box-shadow(0 0 5px 3px rgba(255,255,255,.7)) + &.readonly + cursor: auto !important + &:before, &.size + display: none !important .icon.btn display: inline-block @@ -260,7 +264,7 @@ position: absolute left: 50% !important text-align: center - top: -11px + top: -20px z-index: 1002 > .btn-group left: -50% @@ -485,10 +489,6 @@ height: 16px display: inline-block -[data-snippet-id] - min-height: 10px - min-width: 10px - diff --git a/addons/website/static/src/css/website.css b/addons/website/static/src/css/website.css index 774be6ae09a..310f6b8156e 100644 --- a/addons/website/static/src/css/website.css +++ b/addons/website/static/src/css/website.css @@ -119,6 +119,7 @@ header a.navbar-brand img { .container .container { padding-left: 0; padding-right: 0; + width: auto; } /* ----- BOOTSTRAP HACK FOR HEADER NAV BAR ----- */ @@ -280,12 +281,13 @@ ul.nav-stacked > li > a { background-size: 100%; } -[data-snippet-id], .colmd, .hr, .blockquote { +section, .carousel, .parallax, .row, .hr, .blockquote { + min-height: 30px; overflow: hidden; } @media (max-width: 400px) { - [data-snippet-id]:not([data-snippet-id="carousel"]) { + section, .parallax, .row, .hr, .blockquote { height: auto !important; } } @@ -380,10 +382,10 @@ ul.nav-stacked > li > a { } /* Parallax Theme */ -div.carousel[data-snippet-id="slider"] .carousel-indicators li { +div.carousel .carousel-indicators li { border: 1px solid grey; } -div.carousel[data-snippet-id="slider"] .carousel-indicators .active { +div.carousel .carousel-indicators .active { background-color: grey; } diff --git a/addons/website/static/src/css/website.sass b/addons/website/static/src/css/website.sass index 4796d88cbb8..563dcae95ec 100644 --- a/addons/website/static/src/css/website.sass +++ b/addons/website/static/src/css/website.sass @@ -89,6 +89,7 @@ header .container padding-left: 0 padding-right: 0 + width: auto /* ----- BOOTSTRAP HACK FOR HEADER NAV BAR ----- */ @@ -230,11 +231,12 @@ ul.nav-stacked > li > a .oe_img_bg background-size: 100% -[data-snippet-id],.colmd,.hr,.blockquote +section, .carousel, .parallax, .row, .hr, .blockquote + min-height: 30px overflow: hidden @media (max-width: 400px) - [data-snippet-id]:not([data-snippet-id="carousel"]) + section, .parallax, .row, .hr, .blockquote height: auto !important .carousel-inner @@ -312,7 +314,7 @@ ul.nav-stacked > li > a /* Parallax Theme */ -div.carousel[data-snippet-id="slider"] +div.carousel .carousel-indicators li border: 1px solid grey diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index 3965e1c3d1a..c89bf9ec2fb 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -106,6 +106,7 @@ }, canUndo: false, editorFocus: true, + context: 'a', }); //noinspection JSValidateTypes editor.addCommand('image', { @@ -115,6 +116,7 @@ }, canUndo: false, editorFocus: true, + context: 'img', }); editor.ui.addButton('Link', { @@ -205,8 +207,9 @@ icon: '/website/static/src/img/bglink.png', modes: { wysiwyg: true }, editorFocus: true, + context: 'a', panel: { - css: '/website/static/lib/bootstrap/css/bootstrap.css', + css: '/web/static/lib/bootstrap/css/bootstrap.css', attributes: { 'role': 'listbox', 'aria-label': label }, }, @@ -346,14 +349,40 @@ requires: 'widget', init: function (editor) { + var specials = { + // Can't find the correct ACL rule to only allow img tags + image: { content: '*' }, + html: { text: '*' }, + monetary: { + text: { + selector: 'span.oe_currency_value', + allowedContent: { } + } + } + }; + _(specials).each(function (editable, type) { + editor.widgets.add(type, { + draggable: false, + editables: editable, + upcast: function (el) { + return el.attributes['data-oe-type'] === type; + + } + }); + }); editor.widgets.add('oeref', { - editables: { text: '*' }, draggable: false, - + editables: { + text: { + selector: '*', + allowedContent: { } + }, + }, upcast: function (el) { - var matches = el.attributes['data-oe-type'] && el.attributes['data-oe-type'] !== 'monetary'; - if (!matches) { return false; } - + var type = el.attributes['data-oe-type']; + if (!type || (type in specials)) { + return false; + } if (el.attributes['data-oe-original']) { while (el.children.length) { el.children[0].remove(); @@ -363,16 +392,9 @@ )); } return true; - }, - }); - editor.widgets.add('monetary', { - editables: { text: 'span.oe_currency_value' }, - draggable: false, - - upcast: function (el) { - return el.attributes['data-oe-type'] === 'monetary'; } }); + editor.widgets.add('icons', { draggable: false, diff --git a/addons/website/static/src/js/website.js b/addons/website/static/src/js/website.js index 54ee4689814..249058d91fb 100644 --- a/addons/website/static/src/js/website.js +++ b/addons/website/static/src/js/website.js @@ -231,11 +231,13 @@ dialog.on('click', '.btn-primary', function () { def.resolve(field.val(), field, dialog); dialog.remove(); + $('.modal-backdrop').remove(); }); }); dialog.on('hidden.bs.modal', function () { def.reject(); dialog.remove(); + $('.modal-backdrop').remove(); }); if (field.is('input[type="text"], select')) { field.keypress(function (e) { diff --git a/addons/website/static/src/js/website.snippets.animation.js b/addons/website/static/src/js/website.snippets.animation.js index f1d19125a0c..56ad596d71a 100644 --- a/addons/website/static/src/js/website.snippets.animation.js +++ b/addons/website/static/src/js/website.snippets.animation.js @@ -5,20 +5,26 @@ if (!website.snippet) website.snippet = {}; website.snippet.readyAnimation = []; - website.snippet.start_animation = function () { + website.snippet.start_animation = function (editable_mode, $target) { for (var k in website.snippet.animationRegistry) { var Animation = website.snippet.animationRegistry[k]; - var selector = "[data-snippet-id='"+k+"']"; + var selector = ""; if (Animation.prototype.selector) { - selector += ", " + Animation.prototype.selector; + if (selector != "") selector += ", " + selector += Animation.prototype.selector; } + if ($target) { + if ($target.is(selector)) selector = $target; + else continue; + } + $(selector).each(function() { var $snipped_id = $(this); if ( !$snipped_id.parents("#oe_snippets").length && !$snipped_id.parent("body").length && !$snipped_id.data("snippet-view")) { website.snippet.readyAnimation.push($snipped_id); - $snipped_id.data("snippet-view", new Animation($snipped_id)); + $snipped_id.data("snippet-view", new Animation($snipped_id, editable_mode)); } }); } @@ -32,7 +38,9 @@ } }); }; - $(document).ready(website.snippet.start_animation); + $(document).ready(function () { + website.snippet.start_animation(); + }); website.snippet.animationRegistry = {}; @@ -41,9 +49,9 @@ $: function () { return this.$el.find.apply(this.$el, arguments); }, - init: function (dom) { + init: function (dom, editable_mode) { this.$el = this.$target = $(dom); - this.start(); + this.start(editable_mode); }, /* * start @@ -71,7 +79,7 @@ }); website.snippet.animationRegistry.parallax = website.snippet.Animation.extend({ - parallax: ".parallax", + selector: ".parallax", start: function () { var self = this; setTimeout(function () {self.set_values();}); @@ -108,7 +116,7 @@ img.onload = function () { var offset = 0; var padding = parseInt($(document.body).css("padding-top")); - if (speed < 1) { + if (speed > 1) { 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; @@ -123,4 +131,21 @@ } }); + website.snippet.animationRegistry.share = website.snippet.Animation.extend({ + selector: ".oe_share", + start: function () { + var url = encodeURIComponent(window.location.href); + var title = encodeURIComponent($("title").text()); + this.$target.find("a").each(function () { + var $a = $(this); + $a.attr("href", $(this).attr("href").replace("{url}", url).replace("{title}", title)); + if ($a.attr("target") && $a.attr("target").match(/_blank/i)) { + $a.click(function () { + window.open(this.href,'','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=550,width=600'); + return false; + }); + } + }); + }, + }); })(); diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index ee07840b12d..8ff89466368 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -18,7 +18,7 @@ }, edit: function () { var self = this; - $("body").off('click'); + $("[data-oe-model] *, [data-oe-type=html] *").off('click'); website.snippet.stop_animation(); window.snippets = this.snippets = new website.snippet.BuildingBlock(this); this.snippets.appendTo(this.$el); @@ -41,12 +41,7 @@ return this._super.apply(this, arguments); }, save: function () { - this.snippets.make_active(false); - - // FIXME: call clean_for_save on all snippets of the page, not only modified ones - // important for banner of parallax that changes data automatically. this.snippets.clean_for_save(); - remove_added_snippet_id(); this._super(); }, }); @@ -59,38 +54,14 @@ })) { return; } - hack_to_add_snippet_id() - }); - - // puts $el at the same absolute position as $target - function hack_to_add_snippet_id () { - _.each(website.snippet.selector, function (val) { - $(val[0]).each(function() { - if (!$(this).is("[data-snippet-id]") && $(this).parents("[data-oe-model]").length) { - $(this).attr("data-snippet-id", val[1]); - } - }); - }); - } - function remove_added_snippet_id () { - _.each(website.snippet.selector, function (val) { - $(val[0]).each(function() { - if ($(this).data("snippet-id") === val[1]) { - $(this).removeAttr("data-snippet-id"); - } - }); - }); - } - - $(document).ready(function() { - hack_to_add_snippet_id(); }); // 'snippet-dropped' is triggered on '#oe_snippets' whith $target as attribute when a snippet is dropped // 'snippet-activated' is triggered on '#oe_snippets' (and on snippet) when a snippet is activated if (!website.snippet) website.snippet = {}; - website.snippet.styles = {}; + website.snippet.templateOptions = {}; + website.snippet.globalSelector = ""; website.snippet.selector = []; website.snippet.BuildingBlock = openerp.Widget.extend({ template: 'website.snippets', @@ -102,7 +73,6 @@ $("
").appendTo('body'); } this.$active_snipped_id = false; - hack_to_add_snippet_id(); this.snippets = []; observer.observe(document.body, { @@ -169,17 +139,23 @@ .then(function (html) { var $html = $(html); - var $styles = $html.find("[data-snippet-style-id]"); + var selector = []; + var $styles = $html.find("[data-snippet-option-id]"); $styles.each(function () { var $style = $(this); - var style_id = $style.data('snippet-style-id'); - website.snippet.styles[style_id] = { - 'snippet-style-id' : style_id, + var style_id = $style.data('snippet-option-id'); + website.snippet.templateOptions[style_id] = { + 'snippet-option-id' : style_id, 'selector': $style.data('selector'), '$el': $style, + 'selector-siblings': $style.data('selector-siblings'), + 'selector-children': $style.data('selector-children'), + 'selector-vertical-children': $style.data('selector-vertical-children') }; + selector.push($style.data('selector')); }); $styles.addClass("hidden"); + website.snippet.globalSelector = selector.join(","); self.$snippets = $html.find(".tab-content > div > div").addClass("oe_snippet"); self.$el.append($html); @@ -204,10 +180,10 @@ 'top': pos.top - mt - 5, 'left': pos.left }); - $el.find(">.e,>.w").css({'height': $target.outerHeight() + mt + mb+1}); - $el.find(">.s").css({'top': $target.outerHeight() + mt + mb}); - $el.find(">.size").css({'top': $target.outerHeight() + mt}); - $el.find(">.s,>.n").css({'width': $target.outerWidth()-2}); + $el.find(".oe_handle.e,.oe_handle.w").css({'height': $target.outerHeight() + mt + mb+1}); + $el.find(".oe_handle.s").css({'top': $target.outerHeight() + mt + mb}); + $el.find(".oe_handle.size").css({'top': $target.outerHeight() + mt}); + $el.find(".oe_handle.s,.oe_handle.n").css({'width': $target.outerWidth()-2}); }, show: function () { this.$el.removeClass("hidden"); @@ -224,12 +200,24 @@ bind_snippet_click_editor: function () { var self = this; + var snipped_event_flag; $("#wrapwrap").on('click', function (event) { - var $target = $(event.srcElement || event.target); - if (!$target.attr("data-snippet-id")) { - $target = $target.parents("[data-snippet-id]:first"); + if (snipped_event_flag || !event.srcElement) { + return; } - if (!$target.attr("data-oe-model") && !$target.parents("[data-oe-model]:first").length) { + snipped_event_flag = true; + + setTimeout(function () {snipped_event_flag = false;}, 0); + var $target = $(event.srcElement); + + if ($target.parents(".oe_overlay").length) { + return; + } + + if (!$target.is(website.snippet.globalSelector)) { + $target = $target.parents(website.snippet.globalSelector).first(); + } + if (!self.dom_filter($target).length) { $target = false; } if (self.$active_snipped_id && self.$active_snipped_id.is($target)) { @@ -253,13 +241,16 @@ } }, clean_for_save: function () { - for (var k in this.snippets) { - if (!this.snippets.hasOwnProperty(k)) { continue; } - var editor = $(this.snippets[k]).data("snippet-editor"); + 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(); } - } + }); }, make_active: function ($snippet) { if ($snippet && this.$active_snipped_id && this.$active_snipped_id.get(0) === $snippet.get(0)) { @@ -286,8 +277,7 @@ if (typeof $snippet.data("snippet-editor") === 'undefined') { var $targets = this.activate_overlay_zones($snippet); if (!$targets.length) return; - var editor = website.snippet.editorRegistry[$snippet.data("snippet-id")] || website.snippet.editorRegistry.resize; - $snippet.data("snippet-editor", new editor(this, $snippet)); + $snippet.data("snippet-editor", new website.snippet.Editor(this, $snippet)); } this.cover_target($snippet.data('overlay'), $snippet); }, @@ -323,36 +313,47 @@ start: function(){ self.hide(); dropped = false; + // snippet_selectors => to get selector-siblings, selector-children, selector-vertical-children $snippet = $(this); - snipped_id = $snippet.data('snippet-id'); + $toInsert = $snippet.find('.oe_snippet_body').clone(); + $toInsert.removeClass('oe_snippet_body'); + + var selector = []; + var selector_siblings = []; + var selector_children = []; + var selector_vertical_children = []; + for (var k in website.snippet.templateOptions) { + if ($toInsert.is(website.snippet.templateOptions[k].selector)) { + selector.push(website.snippet.templateOptions[k].selector); + if (website.snippet.templateOptions[k]['selector-siblings']) + selector_siblings.push(website.snippet.templateOptions[k]['selector-siblings']); + if (website.snippet.templateOptions[k]['selector-children']) + selector_children.push(website.snippet.templateOptions[k]['selector-children']); + if (website.snippet.templateOptions[k]['selector-vertical-children']) + selector_vertical_children.push(website.snippet.templateOptions[k]['selector-vertical-children']); + } + } + action = $snippet.find('.oe_snippet_body').size() ? 'insert' : 'mutate'; + if( action === 'insert'){ - if (!$snippet.data('selector-siblings') && !$snippet.data('selector-children') && !$snippet.data('selector-vertical-children')) { + if (!selector_siblings.length && !selector_children.length && !selector_vertical_children.length) { console.debug($snippet.data("snippet-id") + " have oe_snippet_body class and have not for insert action"+ "data-selector-siblings, data-selector-children or data-selector-vertical-children tag for mutate action"); return; } self.activate_insertion_zones({ - siblings: $snippet.data('selector-siblings'), - children: $snippet.data('selector-children'), - vertical_children: $snippet.data('selector-vertical-children') + siblings: selector_siblings.join(","), + children: selector_children.join(","), + vertical_children: selector_vertical_children.join(","), }); - $toInsert = $snippet.find('.oe_snippet_body').clone(); - $toInsert.removeClass('oe_snippet_body'); - $toInsert.data('src-snippet-id', snipped_id); - if (!$toInsert.data('snippet-id')) { - $toInsert.attr('data-snippet-id', snipped_id); - } else { - snipped_id = $toInsert.data('snippet-id'); - } - } else if( action === 'mutate' ){ if (!$snippet.data('selector')) { console.debug($snippet.data("snippet-id") + " have not oe_snippet_body class and have not data-selector tag"); return; } - var $targets = self.activate_overlay_zones($snippet.data('selector')); + var $targets = self.activate_overlay_zones(selector_children.join(",")); $targets.each(function(){ var $clone = $(this).data('overlay').clone(); $clone.addClass("oe_drop_zone").data('target', $(this)); @@ -387,38 +388,30 @@ } $('.oe_drop_zone').droppable('destroy').remove(); + if (dropped) { var $target = false; - if(action === 'insert'){ - $target = $toInsert; + $target = $toInsert; - website.snippet.start_animation(); + setTimeout(function () { + $("#oe_snippets").trigger('snippet-dropped', $target); + website.snippet.start_animation(true, $target); + + // drop_and_build_snippet self.create_overlay($target); if ($target.data("snippet-editor")) { $target.data("snippet-editor").drop_and_build_snippet($target); } - - $target.find("[data-snippet-id]").each(function () { - var $snippet = $(this); - var snippet_id = $snippet.data("data-snippet-id"); - self.create_overlay($snippet); - if ($snippet.data("snippet-editor")) { - $snippet.data("snippet-editor").drop_and_build_snippet($snippet); - } - }); - - } else { - $target = $(this).data('target'); - - self.create_overlay($target); - if (website.snippet.editorRegistry[snipped_id]) { - var snippet = new website.snippet.editorRegistry[snipped_id](self, $target); - snippet.drop_and_build_snippet($target); + for (var k in website.snippet.templateOptions) { + $target.find(website.snippet.templateOptions[k].selector).each(function () { + var $snippet = $(this); + self.create_overlay($snippet); + if ($snippet.data("snippet-editor")) { + $snippet.data("snippet-editor").drop_and_build_snippet($snippet); + } + }); } - } - setTimeout(function () { - $("#oe_snippets").trigger('snippet-dropped', $target); // reset snippet for rte $target.removeData("snippet-editor"); @@ -434,9 +427,9 @@ $snippet.removeData("overlay"); } }); + self.create_overlay($target); // end - self.create_overlay($target); self.make_active($target); },0); } else { @@ -554,7 +547,7 @@ // generate drop zones covering the elements selected by the selector // we generate overlay drop zones only to get an idea of where the snippet are, the drop activate_overlay_zones: function(selector){ - var $targets = this.dom_filter(selector || '[data-snippet-id]'); + var $targets = this.dom_filter(selector); var self = this; if (typeof selector !== 'string' && !$targets.length) { @@ -613,18 +606,19 @@ }); - website.snippet.styleRegistry = {}; - website.snippet.StyleEditor = openerp.Class.extend({ + website.snippet.options = {}; + website.snippet.Option = openerp.Class.extend({ // initialisation (don't overwrite) - init: function (parent, $target, snippet_id) { - this.parent = parent; + init: function (BuildingBlock, editor, $target, snippet_id) { + this.BuildingBlock = BuildingBlock; + this.editor = editor; this.$target = $target; - var styles = this.$target.data("snippet-style-ids") || {}; + var styles = this.$target.data("snippet-option-ids") || {}; styles[snippet_id] = this; - this.$target.data("snippet-style-ids", styles); + this.$target.data("snippet-option-ids", styles); this.$overlay = this.$target.data('overlay'); - this['snippet-style-id'] = snippet_id; - this.$el = website.snippet.styles[snippet_id].$el.find(">li").clone(); + this['snippet-option-id'] = snippet_id; + this.$el = website.snippet.templateOptions[snippet_id].$el.find(">li").clone(); this.required = this.$el.data("required"); @@ -682,6 +676,13 @@ // start is call just after the init start: function () { }, + /* + * drop_and_build_snippet + * This method is called just after that a thumbnail is drag and dropped into a drop zone + * (after the insertion of this.$body, if this.$body exists) + */ + drop_and_build_snippet: function ($target) { + }, /* select * called when a user select an item * variables: np = {$next, $prev} @@ -730,11 +731,15 @@ .first() .addClass("active"); this.$el.find('li:has(li[data-class].active)').addClass("active"); + }, + /* clean_for_save + * function called just before save vue + */ + clean_for_save: function () { } }); - - website.snippet.styleRegistry.background = website.snippet.StyleEditor.extend({ + website.snippet.options.background = website.snippet.Option.extend({ _get_bg: function () { return this.$target.css("background-image").replace(/url\(['"]*|['"]*\)|^none$/g, ""); }, @@ -800,230 +805,181 @@ } }); + website.snippet.options.slider = website.snippet.Option.extend({ + drop_and_build_snippet: function() { + var id = $(".carousel").length; + this.id = "myCarousel" + id; + this.$target.attr("id", this.id); + this.$target.find(".carousel-control").attr("href", "#myCarousel" + id); + this.$target.find("[data-target]").attr("data-target", "#myCarousel" + id); - website.snippet.editorRegistry = {}; - website.snippet.Editor = openerp.Class.extend({ - init: function (parent, dom) { - this.parent = parent; - this.$target = $(dom); - this.$overlay = this.$target.data('overlay'); - this.$overlay.find('a[data-toggle="dropdown"]').dropdown(); - this.snippet_id = this.$target.data("snippet-id"); - this._readXMLData(); - this.load_style_options(); - this.get_parent_block(); - this.start(); + this.rebind_event(); }, - - /* - * _readXMLData - * Read data XML and set value into: - * this.$el : - * all xml data - * this.$overlay : - * Dom hover the $target who content options - * this.$editor : - * content of .oe_snippet_options - * Displayed into the overlay options on focus - */ - _readXMLData: function() { + // rebind event to active carousel on edit mode + rebind_event: function () { var self = this; - this.$el = this.parent.$snippets.filter(function () { return $(this).data("snippet-id") == self.snippet_id; }).clone(); - this.$editor = this.$el.find(".oe_snippet_options"); - var $options = this.$overlay.find(".oe_overlay_options"); - this.$editor.prependTo($options.find(".oe_options ul")); - if ($options.find(".oe_options ul li").length) { - $options.find(".oe_options").removeClass("hidden"); - } + this.$target.find('.carousel-indicators [data-target]').off('click').on('click', function () { + self.$target.carousel(+$(this).data('slide-to')); }); + + this.$target.attr('contentEditable', 'false'); + this.$target.find('.oe_structure, .content>.row').attr('contentEditable', 'true'); }, - - - // activate drag and drop for the snippets in the snippet toolbar - _drag_and_drop: function(){ - var self = this; - this.dropped = false; - this.$overlay.draggable({ - greedy: true, - appendTo: 'body', - cursor: "move", - handle: ".oe_snippet_move", - cursorAt: { - left: 18, - top: 14 - }, - helper: function() { - var $clone = $(this).clone().css({width: "24px", height: "24px", border: 0}); - $clone.find(".oe_overlay_options >:not(:contains(.oe_snippet_move)), .oe_handle").remove(); - $clone.find(":not(.glyphicon)").css({position: 'absolute', top: 0, left: 0}); - $clone.appendTo("body").removeClass("hidden"); - return $clone; - }, - start: _.bind(self._drag_and_drop_start, self), - stop: _.bind(self._drag_and_drop_stop, self) - }); - }, - _drag_and_drop_after_insert_dropzone: function (){}, - _drag_and_drop_active_drop_zone: function ($zones){ - var self = this; - $zones.droppable({ - over: function(){ - $(".oe_drop_zone.hide").removeClass("hide"); - $(this).addClass("hide").first().after(self.$target); - self.dropped = true; - }, - out: function(){ - $(this).removeClass("hide"); - self.$target.detach(); - self.dropped = false; - }, - }); - }, - _drag_and_drop_start: function (){ - var self = this; - self.parent.hide(); - self.parent.editor_busy = true; - self.size = { - width: self.$target.width(), - height: self.$target.height() - }; - self.$target.after("
-
+
Features @@ -214,7 +207,7 @@
-
+
Big Picture @@ -246,7 +239,7 @@
-
+
Three Columns @@ -291,7 +284,7 @@
-
+
Well @@ -303,7 +296,7 @@
-
+
Quote @@ -318,7 +311,7 @@
-
+
Panel @@ -335,7 +328,7 @@
-
+
Separator @@ -343,11 +336,29 @@
+ +
+
+ + Share +
+
+

+ Share + + + + + +

+
+
+
-
+
Portfolio @@ -380,7 +391,7 @@
-
+
Image Gallery @@ -422,7 +433,7 @@
-
+
Comparisons @@ -528,7 +539,7 @@
-
+
Button @@ -545,7 +556,7 @@
-
+
FAQ @@ -592,7 +603,7 @@
-
+
References @@ -609,7 +620,7 @@
-
+

Write a quote here from one of your customers. Quotes are a great way to build confidence in your products or services. @@ -618,7 +629,7 @@

-
+

OpenERP provides essential platform for our project management. Things are better organized and more visible with it. @@ -646,14 +657,7 @@

-
-
  • -
  • - Add Slide -
  • -
  • - Remove Slide -
  • +
    Quotes Slider @@ -706,7 +710,7 @@
    -
    +
    Feature Grid @@ -766,22 +770,11 @@
    -
    +
    Parallax
    -
    @@ -789,16 +782,16 @@
    -
    +
    Parallax Slider
    -
    -
    - - - + + + + diff --git a/addons/website_mail/views/website_mail.xml b/addons/website_mail/views/website_mail.xml index e7a17c8f3db..2882125de67 100644 --- a/addons/website_mail/views/website_mail.xml +++ b/addons/website_mail/views/website_mail.xml @@ -9,7 +9,6 @@ @@ -22,6 +21,7 @@