Commit Graph
2030 Commits
Author SHA1 Message Date
Benjamin Vray 00025dd406 [FIX] web, web_editor: disable horizontal scroll when dragging snippet
This commit adds an option to disable horizontal scrolling in the
smoothScrollOnDrag feature options and use it when dragging and
dropping a snippet into the editor to prevent the wrapwrap from
scrolling horizontally when an element overflow the page (e.g. an
animated element).

task-2215118

closes odoo/odoo#74518

X-original-commit: fdbc109780f336c4b7dcac31585beaad682e029a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-30 18:18:35 +00:00
xO-Tx eb1262960f [IMP] web_editor: allow adding a shape-on-image via custom URL (themes)
The goal of this commit is to add a "Python version" of the
shape-on-image feature using a controller.

Since the whole logic to apply shapes on image is JS-based, we need
to use this URL (just like for background shapes) when we want to add
a shape by default on images in themes. When the configurator replaces a
snippet image (which the theme defines to have a shape), the shape
option should still be applied on the new image.

On the JS side, loadImageInfo() is overridden in order to mark
images (with theme default shapes) with corresponding attachment
data (original-id, original-src, mimetype).

Here is an example of the minimum xpath required to add a shape on a
snippet image in a theme:

```
<template id="s_image_text" inherit_id="website.s_image_text">
    <xpath expr="//img" position="attributes">
        <attribute name="src">/web_editor/image_shape/website.s_image_text_default_image/web_editor/solid/blob_1_solid_rd.svg?c2=o-color-1</attribute>
        <attribute name="data-shape">web_editor/solid/blob_1_solid_rd</attribute>
        <attribute name="data-original-mimetype">image/jpeg</attribute>
        <attribute name="data-file-name">s_image_text.svg</attribute>
        <attribute name="data-shape-colors">;o-color-1;;;</attribute>
    </xpath>
</template>
```

task-2593454

closes odoo/odoo#73938

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-30 17:35:19 +00:00
Arthur Detroux (ard)andqsm-odoo 1c442782f8 [IMP] website, *: add visibility options on sections
*: web_editor

Provide the user with an option to hide or display a section tag
depending on the visitor's location (if geoip enabled), language,
utm_medium, utm_source and utm_campaign.

Users can use a M2M widget to select different records. These will be
used to create a CSS selector on save that will hide the section tag
depending on the various options they selected.
This CSS selectors will be applied, as well as various data attributes
when the page loads to hide the targeted tag. All of these operations
are handled client side.

The geoip country had to be added to the session for the feature to work
with countries.

Part of https://github.com/odoo/odoo/pull/67140
task-2381049

closes odoo/odoo#67140

Related: odoo/enterprise#19907
Related: odoo/upgrade#2658
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-07-30 14:03:42 +00:00
Younn Olivier 7ec2077e22 [FIX] web_editor: start snippet widgets after creating its options
ISSUE
Since 14.4, dropping the image gallery to a website was causing a
traceback.

CAUSE
The bug appeared when new options were added to i.fa elements (such as
Alignment, Shape, Padding). It was an issue for the image gallery as in
the start method of the snippet widget, o_indicators_left and
o_indicators_right elements are removed if not necessary. They are
removed and not only hidden in order to keep the snippet responsive.

In that situation, there was a concurrency issue, as an editor of a
child snippet removed from the DOM (here in the chevrons, removed in the
start method of the parent snippet) was created and initializing options
for an element that was not there anymore.

SOLUTION
When a snippet is dropped on a page, we wait for its options to be
created before starting its widgets.

task-2604383

closes odoo/odoo#74422

X-original-commit: 60d7bf6d7daea83db9332b4fc47a4ac6892d21d7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-29 11:18:06 +00:00
stefanorigano (SRI) 4edfe4b45c [MOV] web, web_editor: move 'print-variable' mixin in utils.scss
Allows to use 'print-variable' mixin in any bundle.

task-2579123
2021-07-23 06:54:18 +00:00
Samuel Degueldre cfe079221c [FIX] web, web_editor: restore media upload progress toast
In odoo/odoo#72675 the new services were made available in the frontend,
and calls to the legacy notification services were redirected to the new
notification service. However, some of the behaviour of the legacy
notification service was not replicated in the new one, like the ability
to pass an HTML element to use inside the notification.

While html content can be passed, it is cloned, meaning that the DOM of
the element cannot be manipulated by the caller, which is what was being
done to show progress during media upload.

Although the upload progress toast looks like a notification, it's
hardly a standard notification and adds a lot of behaviour, because
manipulating DOM directly when it is managed by owl cannot be done
safely, it has been decided to simply make it its own widget separate
from the notification service, which can manipulate its own DOM freely.

task-2607393

closes odoo/odoo#74027

Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-07-20 13:13:03 +00:00
Achraf (abz) ad7e6c19bf [FIX] web_editor: Allow internal users to copy/paste
On windows when you copy paste text in and into Odoo (for example in the description when creating a ticket) a traceback occurs.
There is an isWhitelist function which verifies that a node is indeed in the authorized items via the following instruction

`item.matches (CLIPBOARD_WHITELISTS.nodes.join (','))`

But on windows there is a comment node containing `<--StartFragment-->`

Here is the clipboard data on linux and on windows for the same copied text (Hello):

- Linux

```
  <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
  <span style=\"color: rgb(102, 102, 102); font-family: &quot;Lucida Grande&quot;, Helvetica, Verdana, Arial, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;\">Hello</span>
```

- Windows

```
	<html>
		<body>
			<!--StartFragment--><span style="color: rgb(102, 102, 102); font-family: &quot;Lucida Grande&quot;, Helvetica, Verdana, Arial, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">Hello</span><!--EndFragment-->
		</body>
	</html>
```
Except for this additional comment on Windows, the `.matches()` method does not exist.

This PR uses the `Array.includes` function on the item's `nodeName`, which should work in all cases while keeping the same behavior.

opw-2591597

closes odoo/odoo#74029

X-original-commit: 41802bc518b4bcd1c71d8659ac560cb748befd95
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2021-07-20 11:22:21 +00:00
Xavier Morel 9f9d913fb7 [FIX] web_editor: de-traw-ify wysiwyg template
`0` should be implicitly markup-safe.

Also migrate the two escs to t-out, there's no reason not to.
2021-07-20 05:41:35 +00:00
Xavier Morel 80061de80c [FIX] web, web_editor: de-traw-ify
Convert assets cssContents and jsContents to Markup objects.
2021-07-20 05:41:35 +00:00
Nicolas Bayet ac4ded1639 [FIX] web_editor: delete a contenteditable='false' node
Deleting a node with attribute contenteditable="false" did not work.

closes odoo/odoo#73987

Related: odoo/odoo#73588
X-original-commit: 1e15a85575d867f85c056c564dda94c900da1ea7
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-07-19 15:50:41 +00:00
Nicolas Bayet bc25b371ef [FIX] web_editor: properly capture any form of url on paste
The regex that automatically detect link when pasting text or
when pressing space when editing was not good enough and
for instance did not capture fully an url like:
https://1234-abc.runbot007.odoo.com/web#id=3&menu_id=221

Task ID: 2602725

closes odoo/odoo#73972

X-original-commit: ebe74cb8017ebadbdb6b651e43c59a1d506ba8de
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-07-19 14:15:19 +00:00
Sébastien Geelen (sge) fbca03ead5 [FIX] web_editor: fix traceback in applyColor
When the selectedChildren array was empty it generated an error and a traceback appeared in Odoo.

Task-2580158

closes odoo/odoo#73846

X-original-commit: 65b8ffb56485895cc08be024b18928d1e51949b7
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-07-16 10:59:42 +00:00
Achraf (abz) 71a7f5be71 [FIX] web_editor: Allow internal users to copy/paste
On windows when you copy paste text in and into Odoo (for example in the description when creating a ticket) a traceback occurs.
There is an isWhitelist function which verifies that a node is indeed in the authorized items via the following instruction

`item.matches (CLIPBOARD_WHITELISTS.nodes.join (','))`

But on windows there is a comment node containing `<--StartFragment-->`

Here is the clipboard data on linux and on windows for the same copied text (Hello):

- Linux

  <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">
  <span style=\"color: rgb(102, 102, 102); font-family: &quot;Lucida Grande&quot;, Helvetica, Verdana, Arial, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;\">Hello</span>

- Windows

	<html>
		<body>
			<!--StartFragment--><span style="color: rgb(102, 102, 102); font-family: &quot;Lucida Grande&quot;, Helvetica, Verdana, Arial, sans-serif; font-size: 13px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">Hello</span><!--EndFragment-->
		</body>
	</html>

Except for this additional comment on Windows, the `.matches()` method does not exist.

This PR uses the `Array.includes` function on the item's `nodeName`, which should work in all cases while keeping the same behavior.

opw-2591597

closes odoo/odoo#73952

X-original-commit: 9478cfa0942ad2aee69de197024660cdd6f6c739
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
2021-07-19 10:36:20 +00:00
Younn Olivier e90e7c3e00 [FIX] web_editor: fix colorpicker display on html fields
ISSUE
When selecting colors options from the editor toolbar on a html field,
the colorpicker was not displayed under the toolbar.

CAUSE
Before this commit, the colorpicker dropdown position was computed with
top, bottom and height css properties.

After a new colorpicker was introduced with multiple sections of
different sizes, the size of the dropdown-menu could not be fixed
anymore and [1] broke the existing computation to display the dropdown
above or below the toolbar.

SOLUTION
Using bootstrap dropdown 'dropup' class instead of top, bottom and
height css properties.

[1]: https://github.com/odoo/odoo/commit/96ab729850983162a0039e40c77537ef65cd039e

closes odoo/odoo#73947

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-19 09:19:14 +00:00
Nicolas Bayet d1fcb9ac74 [FIX] web_editor: prevent double insert link on paste
When pasting text containing url, the url was pasted twice.
One being simple text and the other one being a link.

Task ID: 2602785

closes odoo/odoo#73709

Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-07-19 07:38:07 +00:00
Nicolas Bayet 6ab81fe053 [FIX] web_editor: paste multiline
Inserting text that contain multiline does not work.
One "\n" is removed.
Two "\n" become only one.

Task ID: 2602881

closes odoo/odoo#73835

X-original-commit: 89450137653526d9947bc21410cc4163e8b9b440
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-07-16 09:55:23 +00:00
Nicolas Bayet a66e5c660d [FIX] web_editor: properly set the url for youtube embed
There was a typo setting the url of youtube when pasting
youtube url and trying to embed it.

closes odoo/odoo#73711

Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-07-14 12:30:03 +00:00
Kamen Zhekov 22a76c230b [IMP] website: clarify drag&drop zones for website edit mode
When using drag&drop for adding elements to a product's page through
the website edit mode, users sometimes find the feature confusing to
use. Two examples of said confusion can be seen here:
- https://dashboard.userbrain.net/shared/qwl65bqlk6jg?t=404
- https://dashboard.userbrain.net/shared/k796mnj95pow?t=258

The suggestion for improvement was to reduce height and opacity for
the top and bottom droppable zones (available on all products), and
make any element not explicitly dropped in those zones go to the
zone below the product, available only on the product's own page.

This behaviour is extended to be more generic and is applied when
a dropzone has the class oe_structure_not_nearest, which excludes
it from the nearest search, unless the element is dropped explicitly
in a zone that has the class oe_structure_not_nearest.

task-2581641

closes odoo/odoo#73580

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-15 12:16:14 +00:00
qsm-odoo 017c335ab2 [FIX] web_editor: properly handle media "text tools" options
Since their convertion to "snippet" options with [1], the media options
were not handling previews correctly anymore, but also were recoding
their entire logic for each of the options instead of using generic
methods like selectClass or selectStyle.

One example of a bug was that previewing the 25% width option on an
image, not enabling it and saving the editor forced the image to a fixed
px width (its original one). Changing that image to another would keep
that wrong fixed width.

Note: this reveals that selectClass and selectStyle need more parameters
to handle all of this correctly. Most was added as a specific override
for these features but it could be handled even more generically.

[1]: https://github.com/odoo/odoo/commit/d934b81aaae8d68b5579d1489b1fbe8ea347b4ed

Related to task-2578242
task-2577848

closes odoo/odoo#73734

X-original-commit: f59affcdfe9529645a02680214f3d7d96ebacf6e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-14 16:55:32 +00:00
qsm-odoo f34e944c2a [FIX] web_editor: use linter on snippets.editor.js file
Sorry but not sorry, I have to fix this file's "codestyle" (unread
variable, missing or extra ";" characters, etc) post-editor merge...
hard to work inside of it in the current state.

closes odoo/odoo#73629

X-original-commit: dbf245891099b506f21a66ea8e7a9146f6c9e28b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-13 12:13:33 +00:00
qsm-odoo 508a7f9806 [IMP] web_editor: consider common colors as custom when used in the page
Before this commit, if the user chose the "red" color suggestion, "red"
did not appear as a custom color (but the color suggestion was marked
as selected). This made sense in the previous colorpalette widgets but
not anymore as the suggestions do not always appear in all colorpickers
anymore.

Now those colors are always considered custom when used in the page and
at worst appear as "common" and "custom" at the same time (the "common"
one being the one which can appear as selected in that case).

Part of https://github.com/odoo/odoo/pull/67545
task-2476601

closes odoo/odoo#67545

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-13 08:20:02 +00:00
Younn Olivierandqsm-odoo f383905616 [IMP] website, web_editor: improve the colorpicker tabs selection
It is now possible to initialize the colorpicker with a selected tab.

Part of https://github.com/odoo/odoo/pull/67545
task-2476601

Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-07-13 08:20:02 +00:00
Younn Olivier 96ab729850 [IMP] web_editor: update color picker layout
In order to save space and gain clarity, the colorpicker elements are
now displayed in two separate tabs: "theme" and "custom".
It is still possible to display the combinations tab instead of the
theme one (for the background color option for example).

Part of https://github.com/odoo/odoo/pull/67545
task-2476601
2021-07-13 08:20:02 +00:00
Sébastien Geelen (sge) 1b90997324 [FIX] web_editor: allow deletion of unbreakable elements when empty
Unbreakable elements were being considered as unremovable in some deleteBackward cases.

With these changes it is now possible to remove a unbreakble element if it is empty.

task-2580158

(cherry picked from commit 18abf537f07bd9c504dc19c3fa8eda5b1f4d4e9e)

closes odoo/odoo#73592

Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-07-13 07:39:27 +00:00
Sébastien Geelen (sge) 0d4a21bae5 [FIX] web_editor: ensure <font> colors are kept properly
Color and background-color styles on `<font>` tags were being wrongly overridden when applying another color or background color to the element.

Task-2580158

(cherry picked from commit a532d096faf55550ac6d01795aaa2b6843ebc988)
2021-07-13 07:38:49 +00:00
xO-Txandqsm-odoo 92b184f6e2 [FIX] web_editor: set style for selected color combination
Part of https://github.com/odoo/odoo/pull/69857
task-2431484

closes odoo/odoo#73562

X-original-commit: 6e6adad730956c6ddceb1f2461a0eb341edf7433
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-07-12 11:21:02 +00:00
xO-Txandqsm-odoo 54fbee30c7 [FIX] web_editor: fix shapes snippet option
- Exclude '.o_we_pager_header' from click behaviour so clicking on the
  shape dropdown does not close it if an user misclicks next to a pager
  button.

- Add borders on navigation buttons in shapes option to improve
  visibility.

- Cut the last visible option in the shapes list, this way the user
  will understand that he can scroll.

Part of https://github.com/odoo/odoo/pull/69857
task-2431484

X-original-commit: 0d8e4368775bf7fd1aca1376e57c5847b283bded
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-07-12 11:21:00 +00:00
xO-Tx 1bea3d5dd8 [IMP] website, *: expand click handler on theme color palettes
*: web_editor

The goal of this commit is make the whole we-collapse elements
clickable for theme color palettes.

Part of https://github.com/odoo/odoo/pull/68061
task-2431484
2021-07-12 08:30:57 +00:00
xO-Tx ebfa28638b [IMP] website, *: allow to handle snippets with a list of items
*: web_editor

The goal of this commit is to add the "MultipleItems" option
to be able to add new elements in snippets with a list of items.

In this commit, the option is used for "Media List" & "Tabs".

Part of https://github.com/odoo/odoo/pull/68061
task-2431484
2021-07-12 08:30:57 +00:00
xO-Tx 7ea2350255 [IMP] web_editor: set tooltips on sidebar elements
The goal of this commit is to add BS tooltips for editor
sidebar elements using "data-tooltip" attribute to select targets.

The code used to show tooltips on sidebar tab buttons is removed
in this commit since it has no effect after [1].

[1]: c71cf6c618b48da36fbc5063140703312248bc09

Part of https://github.com/odoo/odoo/pull/68061
task-2431484
2021-07-12 08:30:56 +00:00
Nicolas Bayet 4600086e7a [IMP] web_editor: move odoo-editor into odoo
The code of the Odoo editor was on another repository
and that created unnecessary overhead. This commit move
the code inside Odoo and slightly change the folder
structure.

Related PR:
saas-14.3: #73345
saas-14.4: #73348

closes odoo/odoo#73272

Master: #73272
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-07-08 15:31:45 +00:00
qsm-odoo f70ad06775 [FIX] web_editor: remove loading effect during snippet drag and drop
When starting a drag and drop of a snippet, a loading effect on the
editor panel was performed for the whole duration of the drag. Worse:
even if the drop was done immediately, the loading effect still occurred
for 400ms as it was only marked as finished after the scroll to the
dropped snippet.

The loading effect addition was in fact a side-effect of first disabling
all editor overlays at the start of the drag... but that action was in
fact entirely unnecessary because this is not possible to have any
overlay enabled when the snippet panel is opened (because opening it
already disables all editor overlays and enabling an overlay forces the
editor to switch out of the blocks panel).

closes odoo/odoo#73437

X-original-commit: adad8a33071fbbff16d78741904ec33b3595e00b
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-08 14:01:23 +00:00
Younn Olivier 45835afe24 [FIX] web_editor: reintroduce request_editable event (2)
Forward-port of a commit that was wrongly forward-ported with [1], half
of the diff was lost because it landed in master before the merge of
another commit which removes what was being reintroduced here...

[1]: https://github.com/odoo/odoo/commit/e7f497b027d5931b1cf57febcab5deda573b45bb

closes odoo/odoo#73287

X-original-commit: 68d7d42cce012269342e18373a30970e2c582ba3
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-06 09:56:31 +00:00
Younn Olivier d2189dc3bf [FIX] web_editor: correctly display selected basic color
When selecting a "basic" color from the color picker, it was displayed
as a custom color.

It was due to the fact that the basic colors were not correctly computed
to build the existing colors: the array of the rows was used instead of
the array of the colors.

Part of https://github.com/odoo/odoo/pull/72978
task-2476601

closes odoo/odoo#73139

X-original-commit: 23b182ab1bce9a00cb75d12b0d0c504d1fe19e2f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-02 11:26:12 +00:00
Younn Olivier e7f497b027 [FIX] web_editor: reintroduce request_editable event
The commit fixes the display of custom colors in the color picker.

It improves previous fix from #72294, which was not returning all
editables from the editor, thus only the custom colors of the target
were displayed.
For that the request_editable event is reintroduced at the SnippetsMenu
level.

Part of https://github.com/odoo/odoo/pull/72978
task-2476601

X-original-commit: 68d7d42cce012269342e18373a30970e2c582ba3
2021-07-02 11:26:10 +00:00
Younn Olivier e69633cf2d [FIX] web_editor: close widgets when clicking on dropdown buttons
The commit fixes an issue with the editor toolbars dropdowns, that would
not close already opened widgets. For example, when the widget color
picker for snippets background was open, opening the one from the editor
toolbar for the font would only close it for the first click, but not
for the ones after.

The issue was coming from Bootstrap, which stops the propagation of
click events for dropdowns. As a result, the click event on these
'.dropdown-toggle' elements was not processed by the listener at the
SnippetsMenu level, in charge of closing the widgets that were already
open in this context. It was the case only for the first click that was
instancing a Dropdown, but not for the ones after.
https://github.com/odoo/odoo/blame/cd9c071c9357cef14635ef094a9f14fc5431956c/addons/web/static/lib/bootstrap/js/dropdown.js#L308-L314

A solution would be to update bootstrap:
https://github.com/twbs/bootstrap/blame/688bce4fa695cc360a0d084e34f029b0c192b223/js/src/dropdown.js#L232-L237

The fix can be to listen to mouseup events on such '.dropdown-toggle'
elements while waiting for a bootstrap update.

Part of https://github.com/odoo/odoo/pull/72539
task-2476601

closes odoo/odoo#73032

X-original-commit: 048a329fc514b2c98cf7e6af7279f90fce53eb09
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-06-30 18:21:24 +00:00
Younn Olivier 8f62471ef6 [FIX] web_editor: close text color palettes when opening option ones
When the color palette for the text was open, opening the background
color options was not closing it.
The click event was stopped at the snippet option level for all events,
where it should only be the case if the click was done inside the
colorpicker.

Part of https://github.com/odoo/odoo/pull/72539
task-2476601

X-original-commit: 888f1bd44d0aa431d3d89ee3c913c6eb64c3d54d
2021-06-30 18:21:23 +00:00
Younn Olivier 168943d915 [FIX] web_editor: fix snippets custom colors display on color palette
After the new editor was merged, custom event 'request_editable'
triggered by the ColorPaletteWidget to retrieve custom colors from the
editable was not processed.

Now, we pass the editable in the options when we init the
ColorPaletteWidget.

task-2476601

closes odoo/odoo#72959

X-original-commit: 3d98268cf93087516743e3f0a2f3af950d4feb6a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-07-02 08:31:39 +00:00
qsm-odoo 75efaca796 [FIX] web_editor: properly use snippet data in the editor
closes odoo/odoo#72947

X-original-commit: ff6d0b16cd32a5ed56a2cc039f5226dc56f6db6a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-06-29 14:47:30 +00:00
Ivan Yelizariev 0249f87ed0 [FIX] web: prevent selecting element from html field
html field allows to insert html structures that can be treated as elements of
odoo web client. This patch updates setLocalState method (part of the web
client) to check if an element is inside html field, so such elements will be
ignored

---

opw-2520403

closes odoo/odoo#72877

X-original-commit: d2733da4863bd03b0cf853355596a44e901405d2
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2021-06-28 14:17:07 +00:00
Lucas Perais (lpe) 0ffc12c0a4 [REF] web_editor: loader split the loading and the creation of wysiwyg
Before this commit, the wysiwyg loader had only one method to both load and create it.

After this commit, it has two separate methods to do it. This is practical if one wants to load
in some other context, like studio

closes odoo/odoo#72454

Related: odoo/enterprise#19139
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-06-24 15:05:23 +00:00
Younn Olivier 3426283c22 [IMP] web_editor: display toolbar only when needed
For now, the toolbar was hidden from the snippets menu only if:
- it was an image
- it had no editable parent or was outside the wrapwrap
- for model fields that were not html nor views

We also want to hide it for every selected element that is not editable,
as the options will have no effect on such element.
When an element is not editable, it is useless to display the toolbar.

For example, for the website form fields, or the newsletter
subscription, the toolbar was displayed even if it had no effect on the
snippet.

To hide it, we test on the last element at the wysiwyg level.

Part of https://github.com/odoo/odoo/pull/72180
task-2566338
2021-06-25 07:39:54 +00:00
Antoine Guenet e5990c2746 [FIX] website_event_exhibitor, web_editor: restore exhibitor videos
The media modal from the description field of an exhibitor was missing
its video tab. This is because it was disabled as a rule for field_html.
This adds the possibility to restore it via node option, and sets that
option on the exhibitor description field.

closes odoo/odoo#72335

Task: 2551345
X-original-commit: 7ec752651332980fe8288bbcad5e8378bf5ab816
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-06-22 07:39:50 +00:00
cd403480f9 [IMP] web_editor, mass_mailing, *: add shape clipping option on images
*: tools

The ImageOptimizer option can now set shapes on images to use those
shapes as clip path and background. It uses a flexible path so that the
shape will always fit the image proportionally. We also added an html
file alongside a javascript file to semi-convert the shape from
illustrator into a usable shape for this usecase (the clip path must
have values between one and zero therefore we must do some computation
before the shape is ready to use).

Thanks to Samuel for this specific shape-converter tool and other
technical points about svgs and clip-paths.

Thanks to Mehdi for remaining development post-testing and post-reviews
and for the many fixes.

Thanks to Brieuc for the actual shape SVG files.

Part of https://github.com/odoo/odoo/pull/69179
task-2327045

closes odoo/odoo#69179

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: xO-Tx <mou@odoo.com>
Co-authored-by: Brieuc-brd <brd@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
2021-06-21 16:31:07 +00:00
xO-Tx c1ab1beb0d [FIX] web_editor: fix style for we-button icons
On fieldHtml editor, icons are not positioned at the center of the
we-button element since the 'display: block' style does not allow that.

The goal of this commit is to center the icons by adjusting the
'line-height' property.

Part of https://github.com/odoo/odoo/pull/69179
task-2327045
2021-06-21 14:43:54 +00:00
Sébastien Geelen (sge) 92aac327e9 [FIX] web_editor: various fixes and improvements for the commandbar
See oddo task : https://www.odoo.com/web#id=2522564&action=333&active_id=1695&model=project.task&view_type=form&cids=1&menu_id=4720

closes odoo/odoo#72365

X-original-commit: 7137e97c2409306a5351aed5c70b67f4766ea86a
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-06-18 15:20:18 +00:00
Sébastien Geelen (sge) 6308964ba7 [IMP] web_editor: update odoo-editor lib to commit 5fea955f
X-original-commit: 2b0bfd4152db6b20631b0c99c0288197485bebb1
2021-06-18 15:20:16 +00:00
stefanorigano (SRI) cac131c1e3 [FIX] web_editor: scope '.dropdown-item' css rules
Prior to this commit web_editor custom rules were affecting the entire
bundle.
2021-06-18 21:31:32 +02:00
Brieuc-brdandqsm-odoo ebc56f7605 [IMP] web_editor: add label for animated shapes
This commit adds a little label on the top corner of animated shapes
previews.

Part of #70843
task-2319488

Related: odoo/design-themes#17
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-06-15 12:17:41 +00:00
Brieuc-brd 50458a208d [IMP] web_editor: clean and improve shapes
1. Change some shapes to apply correctly the color presets:
e.g. the default color of the shape erased the background
color of the preset.
2. Improve some shapes to have a better render by changing
the colors and/or adding animations.
3. Some svgs could give the same result. To have a clean list,
many svgs were combined.
4. Letting the old svg files to assure the compatibility with themes.
5. Improve the preview of some shapes for a better reading.

Part of #70843
task-2319488
2021-06-15 11:53:50 +00:00