Before this commit, when a hierarchy of options was displayed in the
editor left panel and that the user click on any one, the related
snippet was enabled making all the children options disappear (like
the "go to parent" button in the old UI). Now we only keep this behavior
when we click on the title of the snippet's options.
closesodoo/odoo#37538
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
If we have a content such as:
`aaa <B>bbb</B> ccc`
and you eg. change size of `a bbb c`, the c gets bold because of an
issue in the merging after style is applied.
reason: we check that the style was same as previous nodes, but because
walkpoints text[a]->B->text[bbb]->B->text[c] is expurged of duplicates
it becomes text[a]->B->text[bbb]->text[c] so we erroneoulsy think that
the node before text[c] is text[bbb] (instead of B tag)
note: 12.5 forward-port (skipping [12.3,12.4]) of 11.0 #37254 (also
contain #37345)
opw-2071930
closes#37295
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Before this commit, the web_editor toolbar wasn't horizontally scrollable
and part ot the items were not displayed.
To fix this, we have to revert back the initial position on some elements.
closesodoo/odoo#37076
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Before this commit, the web_editor toolbar wasn't horizontally scrollable
and part ot the items were out of the screen area.
To fix this, we have to revert back the initial position on some elements.
Before this commit, web_editor dialog was opened inside an iframe and
not on the window.top. So dialogs didn't take all screen area.
To fix this, we open dialogs in full screen mode but we also put the
web editor in full screen to increase the size of the iframe.
Note that the initial state of the web editor (full screen or not) is
preserved when you close the modal.
We also add some fixes to make the "web_editor media dialog" responsive.
* website
Following the new editor merge at https://github.com/odoo/odoo/pull/29775
(which was finally partially reverted for 13.0), the crop dialog was not
working anymore on sub-sequent crop. This was due to 2 things:
1) Re-cropping an image that was just cropped now
The original source of the recently cropped image is saved as temporary
jQuery data on the image element. Unfortunately, for some strange
reason, that image is cloned before any edition and thus lose that data.
This commit fixes the problem by cloning the data too... supposing the
orignal clone is there for a reason.
2) Re-cropping an image that was saved before
This did not work anymore simply because... the cropped images were not
saved in database anymore but saved as base64 data in the view... For
some reason, the cropped images to save were searched in the original
DOM instead of the edited DOM...
Also fixing the random use of a mutex.
Discovered while working on task-2059480
closesodoo/odoo#36878
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
In the inline editor (eg. task description), the inline bar of an
element (eg. link or image) has higher bootstrap z-index than modal that
can be opened via this bar (eg. croping window for an image, link
editing for a link).
So the bar would be over the modal opened by the bar which is
unexpected.
This was solved in 12.3 f2969923 by setting the inline bar to z-index of
$o-wysiwyg-zindex (defined to 1000).
This is the equivalent of 12.0 #37119 fix.
opw-2073761
closes#37125
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
In multi-level checkboxes, if there is only one checkbox per level, the
expected behavior is that all checkbox will be checked if one of them is
checked. This was not the case before this commit.
When setting align right on a picture, the popover of the picture was
partially overflowing the editable zone, rendering it useless.
This commit mimicks the behavior of Odoo 12 by disabling the fact
that the popover follows the picture.
The style for custom color in the editor color menu from 12.0 was
dropped in 12.3 (correctly because of the changed structure) but in 12.5
the HTML structure changed again and the CSS is once again necessary.
opw-2073734
closes#37090
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
When clicking on edit in a form with a wysiwig widget inside, that widget would gain focus. It is not the expected behaviour (focusing the first field) and is really an issue on mobile, where the screen would scroll and the keyboard open.
The mouseup event was there to force summernote refreshing the editor toolbar (which will not display which buttons were active until the editor is focused). So removing it still has drawbacks (the toolbar is not up-to-date), but with chm it was decided to remove it as the issue with focus is worse.
Task-2047389 Closes#36360
* web_editor
This commit adds support to set background videos to all the snippets
that already support setting background images (except on parallax
background for now).
task-1920630
closesodoo/odoo#36261
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Varun Raval <var@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
* web_editor, website
Editing the cover images or sizes was not working anymore. When it
worked, it was thanks to the 'o_dirty' class appearing magically on a
cover part... and that magic seems to be gone.
This commit fixes the problem by adding the 'o_dirty' class on all
elements whose content is changed, not only the editable ones (this is
the case for the blog cover: it is a non editable element whose bg
image can be changed).
Note: this also fixes the edition of multiple covers (of different blogs
or posts) at the same time (this could be backported in 12.0 if needed).
closesodoo/odoo#36999
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Just after we first added the library in Odoo (in april 2018), the
library was released in its last and deprecated version (4.0.0). At the
same time, the author indeed split its 'cropper' library into 2 parts:
'cropperjs' which is the core of the original library without jquery
and 'jquery-cropper' which is a jquery wrapper of the 'cropperjs'
library. This commit updates our code to use the latest version of those
two libraries.
Note: the commit also removes the lazy loading of the library which is
useless and maybe breaking since it comes with the editor assets which
are themself lazy loaded.
Note 2: we may want to remove the jquery wrapper in another update and
simply use the standard JS library.
Part of https://github.com/odoo/odoo/pull/36880
task-2059480
closesodoo/odoo#36880
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, when rotating an image so that it overflew the
cropper canvas, it was not possible to unzoom on some part of the image.
Now, with the new set of options used by this commit, the cropping zone
and the image can be moved independently allowing to do everything.
Part of https://github.com/odoo/odoo/pull/36880
task-2059480
If a model is tagged with _translate=False, it should not be translated.
A special case was made for ir.model.fields but not ir.model.fields.selection
Before this commit, the selections of web_editor.converter.test were translated
closesodoo/odoo#36576
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Before this commit, the overlay cover operation was deferred while an
animation was ongoing on the target element. The problem was that the
animation end event is not triggered if the related DOM is removed
before the animation ends... or simply if the animation is infinite.
When this occured, the overlay never appeared.
Note: this could probably be backported if the need rises.
Part of https://github.com/odoo/odoo/pull/36803
task-2070930
Slovenian language, as many others languages, is not present in the
beta/master projects in Transifex.
For some reason, Transiflex removed all current translations, this was
already fixed in 12, but as there are not automatic forward-port for
translations, this is a manual forward-port.
opw-2060055
closesodoo/odoo#36374
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
* website_forum, website_profile
- Share some code between website_forum and website_profile by exposing
a function in web_editor to instantiate a wysiwyg instance on a
textarea
- Use no-lazy loaded JS to add a visual loading effect while the
wysiwyg is not yet available.
This is made in preparation of task-2024197
(see https://github.com/odoo/odoo/pull/35749)
Thanks to @stefanorigano
closesodoo/odoo#36581
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
* website_form
Now, the snippets options are still displayed in the left panel but all
the parent options are also shown (and do not require to toggle them
anymore). On hovering them, the overlay style is turned in preview mode
(even for the sticky one) allowing to see which part of the DOM the
option is editing.
Part of https://github.com/odoo/odoo/pull/36515
When hovering a set of options we display a purple dashed overlay, the
problem is that it was not visible over purple-like colors. Now it is
an alternance of purple and white.
Part of https://github.com/odoo/odoo/pull/36515
* web_editor
When starting a drag and drop in the editor, a series of dropzones
appear to indicate to the user where he can drop the block being
dragged. In the website editor, when an editable structure is empty,
it is filled with a message to indicate we can drag and drop something
in there. The problem was that this message and the design that comes
with it disappeared when starting a drag and drop as it was replaced by
the editor dropzones. Now, the 2 are combined: when a dropzone appears
in an empty editable structure, the message and its design are kept and
just changes color and animation to match the one of an editor dropzone.
Part of https://github.com/odoo/odoo/pull/36515
task-2057320
Before this commit, translations were edited in a list view with a filter
on the field that needed to be translated.
After this commit, the translations for each fields are translated in a
dedicated dialog. The changes done to the current language are taken
into account immediately, both ways, from the dialog to the form and
from the form to the dialog.
Translating terms is also available in create mode, the user will be
prompted to save before editing a translation
Task ID: 2028152
closesodoo/odoo#36185
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
The color picker in snippet options has two way to set a color: have a
data-color attribute => it is used, or have a o_custom_color class and
the background-color is set directly on that color.
In the case where we select no background color (transparent), it would
work in preview, but when applied the opaque color of the transparent
button (since opacity is not copied) is set which is wrong and
unexpected.
opw-2053636
closes#36131
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
When pasting from clipboard, the editor filters the nodes to paste.
Among other things, it removes `meta`, `style` and `script` nodes. It
did so using `jQuery`'s `not` method but that method has a side effect:
it removes text and comment nodes as well if you pass it a `jQuery`
selector. As a result, unwrapped text nodes could not be pasted. This
commit fixes that by using `each` to remove the targeted nodes instead
of using `not`.
closesodoo/odoo#36012
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>