* + 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
* On firefox, you had to click twice on a link to be able to start
typing text
* When selecting text which contained a <br/>, you were not able to
replacing it correctly (you had to click again before starting typing)
* When replacing a whole paragraph content which was below a title,
the text was not replaced and you had to click again and the title
transformed into a paragraph.
* ...
These colors were usually hardcoded in some snippets (.s_banner for
example) to increase text legibility over background images.
This commit will let the user personalize them.
* Review style of some UI components
* Rename some content
* Define a font-family less variable to be used to avoid that themes
customizations affect the UI. Note: theme should ideally not redefine
the font family of the body but of the #wrapwrap element but this is
done for safety.
* Overwrite other theme's customisations
* Minor style fixes
Before this commit, we had to click on the image we want, then click
on save in the modal footer. Now we can also double click on the image
we want, with the same result.
Same goes for icons.
background and color snippet options
The background and color snippet options communicate so that if a
color is set while a background is already set, the backgrond is
removed. The problem is that the event propagation was not stop
so if a snippet had a background and one of its child set a color,
the background was removed.
Before this commit, the focus point the user can move on the image in
the background position configuration dialog was only following the
mouse as we want if the image original width was larger than the dialog
one. This is because the javascript relies on the fact the image takes
100% width of its container. To fix this, the container now does not
take 100% of modal width but the size of its internal image (with a
max-width of 100%).
In some snippets, the parent hierarchy has many elements. So, when
selecting a deep child of one of those, the customize dropdown had
many dropdown headers showing the parent hierarchy but without any
option for many of them.
Commit de0d9fd666 already fixed the case
where the dropdown only contains dropdown headers. This commit is an
adaptation to hide these headers one by one.