Since saas-12, when deleting contents, parents are deleted too if they
become empty (while it was not possible to delete contents in that case
before). The problem here was that the history was recorded multiple
times if one deletion made multiple snippets be deleted and this
sometimes could crash.
Now the history is recorded only on first deletion when the user ask
for it.
There is a hackish feature in the web_editor which forces the
contenteditable to true on links which are clicked and removes it
anywhere else in the page so that only the link is editable after
click. This allows to add text at the end of a link without adding it
outside of the link by mistake.
The feature was badly implemented because, if the link was editable
without having any parent which is editable, the contenteditable was
forced to true, then immediatly forced to false when forcing to false
every page element. This was the case for lots of t-field. By example
the product categories in eCommerce are t-field links which are in non
editable <li/> elements...
web_editor Qweb: Add 'zoom' option for widget image
<span t-field="product.image_small" t-options="{'widget': 'image', 'zoom': 'image_medium'}" />
website: Add Zoom code to be standard for all website module
website_sale: add zoom on Main product image
* + web_editor
The feature was only activated in the web_editor in snippet contents
(before they are dropped in the page). Now, on first theme selection,
the feature is activated in the template content.
The web_editor transcoder, who is in charge to change mail css style
into inline style and vice versa, has a cache to improve its
efficiency. The problem is that it was designed to work only if a
particular "<tag>.className" has always the same css style no matter
what its parent or neighbors are. This is obviously not compatible
with theme switching. Indeed, only by switching from one theme to
another, the parent of every snippet have a different className which
is used in css to design differently every snippet. Also inside a same
theme, we obviously want to be able to style a particuler .myClass
element differently from one snippet to another without having to
multiple css classes.
This commit removes the cache system to allow theme switching and
liberty in theme designing. This however make the edition start and
the saving really slower...
website -> web_editor so that they are available for mass_mailing.
To allow setting margins on td elements:
As the above mentionned option allows to control the mt and mb classes
on the mass mailing items, the problem is that we would ideally want it
to be functionnal on td element as they are the main part of a mail.
As they don't support margins, there were many options to fix the
problem:
- Add more JS to place the mt and mb classes on children of td element
- Place the option on children of td element and not td element itself
but in that case, the width control of td would imply a lot of parent
option hierarchy, or the width control had also to be adapted to control
children
- Control padding instead of margin. This forces to add lots of
css rules like pt4 pt8, ... (or td.mt4, td.mt8, ...).
The last solution has been chosen. Padding is more supported than
margins in mail client anyway and the css rules will be isolated in
the mail editor anyway. Using td.mt4 instead of pt4 had the advantage
to not require any JS modification.
The system was lost with the editor refactoring which came with saas-10
and commit bf39884a5c.
Indeed the show() method of the BuildingBlock class was removed as the
widget is now always showed but the show_blocks() method it called was
not removed (and thus was not called anymore).
As a fix, the show_blocks method is now called again, on snippets
initializations and each time a snippet is dropped or removed.
The .dropdown is in a .btn-group environment while a .btn-group can
only contain .btn or .btn-group elements.
This induced problems where the m2o options covers the full overlay
environment, preventing clicks on the customize dropdown.
When a snippet contains two p elements, they will both get the
"o_default_snippet_text" when placed in the page. The individual p are
then automatically selected on mouseup event. This induces strange
behavior when trying to select the two paragraph together ; indeed
only the paragraph on which you mouseup will be selected.
The snippet options can define an on_remove method which was supposed
to be called when the snippet is removed. This was not the case since
the method was written so that the options were removed before the
on_remove method was called... (Un)fortunately, the on_remove callbacks
were not doing any critical job in current implementation. In saas-13
however, some elements will rely on this.
* Add the ability to define palettes custom selection.
* Add the ability to define a custom title for the colorpicker dropdown
* Define a custom layout for single (unique) palette layout
* Define overlay color options based on new colopicker for
Cover and Banner text containers
* Define default palettes
Commit 404ed0f788 tried to solve the
problem but only solved a part of it. Indeed, if the snippet child
has a bg color option but not a bg image option, the event propagation
stops in the parent handler, when it is too late.
Solution is checking that the event comes from the same element on
which the callback is attached to.
* Remove mass mailing template switching system (lemon, airmail, ...)
and replace it with a theme selector which only toggle a different
class on the body.
* Lint JS files.
* Change the way the editor is overridden by mass_mailing in a more
odoo way (put the JS in assets and check on runtime if it must be
applied.
+ fix editor style
+ remove useless code
+ remove odoo template