Commit Graph
151 Commits
Author SHA1 Message Date
David Monjoie ce639f28a9 [FIX] web_editor: fix img being removed on copy/paste
The img nodes where being wrongly considered empty by isShrunkNode
because the image was not loaded yet.

closes odoo/odoo#77646

X-original-commit: d18d51191bca8f063effd4a216c3963c187a8767
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-10-04 14:12:15 +00:00
b63ee52552 [FIX] *: remove scss 'extend' from dropdown components
This commit removes all the 'extend' initially introduced to avoid code
repetition and ensure visual consistency across Bootstrap and Owl dropdowns.

Despite achieving the desired results, using 'extend' in this context
was seriously impacting the bundle generation time, probably due to an
underestimated amount of Apps' legacy-code applied on these elements.

In order to achieve the same results, the chosen strategy is to add
Bootstrap default classes directly into Owl dropdowns.
Also, it moves code related to bootstrap dropdown in 'webclient.scss',
leaving 'core/dropdown/dropdown.scss' for Owl code only.

Due to the discrepancies between Bootstrap and Owl html
structure, the '.dropdown-item' class could not have been added
directly to Owl's '.o_dropdown_item' itself, without refactoring
the Dropdown component structure.

// ==== Bootstrap 4.6 default Structure ================================
<div class="dropdown-menu">
  <button class="dropdown-item" type="button">Action</button>
  <a class="dropdown-item" href="#">Another action</a>
</div>

// ==== OWL default Structure before this commit =======================
<ul class="o_dropdown_menu">
  <li class="o_dropdown_item">
     <span>Action</span>
  </li>
  <li class="o_dropdown_item">
     <a href="#">Another action</a>
  </li>
</ul>

// ==== OWL Structure after this commit ================================
<div class="o-dropdown--menu dropdown-menu">
  <span class="dropdown-item">Action</span>
  <a class="dropdown-item" href="#">Another action</a>
</div>

// ==== web.assets_backend.css Bundle Generation Comparison ============
With all modules installed (enterprise edition over runbot):
Before this commit, bundle took ~2.5s and ~4s to generate and weighted ~322kB (~2.5MB uncompressed)
After this commit, it takes between ~1.2s and ~1.6s and weights ~257kB (~1.6MB uncompressed)

closes odoo/odoo#77649

X-original-commit: 84715436d87bb05b421bc9ccaacda67d07571690
Related: odoo/enterprise#21370
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Co-authored-by: Stefano Rigano <sri@odoo.com>
Co-authored-by: François Georis <fge@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
2021-10-04 07:57:00 +00:00
Benoit Socias 2e35193b94 [FIX] web_editor: compute deepest position offset according to used node
Before this commit when computing the deepest position for a non-visible
node, if that node had no next visible sibling it used the previous
siblings, but it still marked the offset within that sibling as 0.
Because of this, the selection sometimes got lost.
E.g. in Firefox, drop an "Image - Text" block and triple click on the
header text: upon changing its color the range got set to the text node
but ending at offset 0.

After this commit if the used node in the "previous sibling" from the
evaluated element, the offset is set to the length of that node.

task-2655176

closes odoo/odoo#77567

X-original-commit: 3c4426c71ebe080bcbd285e271c61bf1580c3afa
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
Signed-off-by: Benoit Socias (bso) <bso-odoo@users.noreply.github.com>
2021-10-01 07:41:00 +00:00
Sébastien Mottet (oms) fe8f8eacf0 [FIX] web_editor: fix black line problem for odd width images
When adding an odd width images on website, a thin black line is
drawn on its right side. The problem comes from the getSourceCanvas
of the cropperjs library. A translation is applied followed by an other
translation in the opposite direction. However the second translation
was not the exact reverse of the first due to a rounding problem.

The fix proposed here comes from: https://github.com/fengyuanchen/cropperjs/pull/300/commits/a6481c052cfc93ef14dd95a3bd00142215dda36e

task-2652904

closes odoo/odoo#77562

X-original-commit: 53f13979cc363c74a8f4e2cec0d24ca10c6ac11c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-09-30 18:28:04 +00:00
Nicolas Bayet e52bde906f [IMP] web_editor: allow qweb edition
Add a plugin for the Odoo editor that includes:
- make dynamic variables (eg. `<t t-out="variable"/>`) not editable
  (for preventing the user to shoot himself in the foot)
- group and hide related logical branching (ie. t-if, t-elif and t-else)
  in order to see only one at once
- a floating select input to switch visibility of a particular logical
  branching
- style t-tags to make them stand out

Task-27033

X-original-commit: odoo/odoo@300da82eb4
Part-of: odoo/odoo#77377
2021-09-28 23:42:55 +00:00
Nicolas Bayet 810f832703 [FIX] web_editor: allow to delete backward a contenteditable
Deleting a node content-editable false did not work.

X-original-commit: odoo/odoo@de42d0f965
Part-of: odoo/odoo#77377
2021-09-28 23:42:54 +00:00
Nicolas Bayet 4813f42997 [IMP] mail,*: replace jinja with qweb
Jinja as a templating engine was problematic in differents respect:
- introduce external dependency to Odoo (less controll)
- add another templating mechanism in the stack
- specific feature in qweb cannot be reused
- difficulty in rendering easily editable templates
- more knowledge required with no betterment

By replacing jinja with qweb we can now build tools to edit a qweb
that will work with the previously jinja encoded document
(essentially `mail.template` records).

There is a catch however. Some email fields (eg. email_to) used jinja
syntax for rendering dynamic variables (ie. ${object.something} and
${object.something_that_should_not_be_escaped | safe}).

We still want user to use dynamic variables for some char fields (eg.
subject, from, to, ...). We made a new rendering engine called
"inline_template" that will render an expression enclosed by `{{` and
`}}`.

To be able to edit the templates from the backend interface, a
plugin to the Odoo editor has been made for seamlessly edit the
document.

This qweb plugin includes:
- make dynamic variables (eg. `<t t-out="variable"/>`) not editable
  (for preventing the user to shoot himself in the foot)
- group and hide related logical branching (ie. t-if, t-elif, and t-else)
  in order to see only one at once
- a floating select input to switch visibility of a particular logical
  branching

Task-27033

X-original-commit: odoo/odoo@68182baff4
Part-of: odoo/odoo#77377
2021-09-28 23:42:54 +00:00
David Monjoie f50f880655 [FIX] web_editor: fix traceback when no command is selected
closes odoo/odoo#77150

X-original-commit: 4b15136799ec3e394b61f2ef2a7949e1bd0f2340
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-09-24 12:35:29 +00:00
David Monjoie 17b864ce0e [FIX] web_editor: split list on enter in empty li
This matches the behavior of GDocs and CKEditor.

closes odoo/odoo#77115

X-original-commit: a84a6c869b815bf372d81db538b458cd23c99b07
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-09-24 11:09:13 +00:00
Sébastien Geelen (sge) 02b7bf524a [FIX] web_editor: toolbar outside of editable zone
On very small editors the restriction on the toolbar size
and position could generate issue (blocking text visibility).

So we changed the rules to allow the toolbar to overflow
outsize of the editable zone.

task-2648156

closes odoo/odoo#76710

X-original-commit: 6390a4225ea8a97fd0bc0b267d0d016846d27e46
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
Signed-off-by: Sébastien Geelen <sebgeelen@users.noreply.github.com>
2021-09-17 05:59:10 +00:00
Benoit Socias b5263be24c [FIX] web_editor: restore lost selection when updating color
Before this commit if the text selection was lost while the color
palette was used, the color selection was not applied on anything.

After this commit if the text selection was lost, it is restored to the
last selection known in history before applying (or previewing) the
color selection.
Also avoid to remember selections that are not part of the editable.

task-2599771

closes odoo/odoo#76357

X-original-commit: 0e706d508d6e747cff566c33d34b794a321eef5c
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-09-10 16:10:47 +00:00
Nicolas Bayet 0a0a108969 [FIX] web_editor: use the proper serialize method
Use the method serializeNode of the editor rather than directly
the one from utils  in order to only serialize when the collaboration
is active.

closes odoo/odoo#76143

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-09-08 10:22:06 +00:00
Nicolas Bayet 4c03a56dab [FIX] web_editor: stop making snapshot when no collaboration
When the collaboration is not active, it is not necessary to create
snapshot as they will not be sent to anybody.

Part-of: odoo/odoo#76143
2021-09-08 10:22:06 +00:00
Nicolas Bayet cc66d73836 [FIX] web_editor: ensure editor history always has more than 0 steps
344d82c commit changed how the editor `_historySteps` should behave.
Before that commit, `_historySteps` could have 0 steps whereas after
that commit `_historySteps` should always have at least the first step
be a snapshot. When reseting the history, we should now add a snapshot
as a first step. This commit guarantees it.

closes odoo/odoo#75901

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-09-08 09:03:07 +00:00
Nicolas Bayet 344d82ca25 [IMP] web_editor: add collaborative feature
This commit allows to use the editor collaboratively for any html
field in peer to peer using webRTC.

task-2497931

closes odoo/odoo#75768

Signed-off-by: Antony Lesuisse (al) <al@openerp.com>
2021-09-06 19:42:56 +00:00
Sébastien Geelen (sge) 28efd996b6 [IMP] web_editor: add support for field html placeholder
The editor now support the field html placeholder value when given.

task-2586137

closes odoo/odoo#75863

Related: odoo/enterprise#20571
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-09-03 08:11:57 +00:00
stefanorigano (SRI) 9337562cca [REF] web_editor, *: review editor toolbar design
*: web, website

This commit redesigns the editor toolbar improving its visual appearance
and introducing substantial changes wherever it is rendered.

== "Into-sidebar" design
The grid layout has been refined, improving its components allocation.
For the sake of visual simplification, "list-type" buttons have been
unwrapped from their original dropdown. For the same reason the button
to create a new table has been removed (users will have to use the
command-bar to create a new table).
Table's options have been moved to a section "ad-hoc", visible only when
a table is selected.

== Floating design (backend only)
The toolbar is now white to match the command-bar design.
In order to simplify frontend inheritance, the floating toolbar now uses
grid layout.

== Colorpicker
The generic code necessary for each design has been moved from
'wysiwyg_snippets.scss' to 'wysiwyg.scss'.
The style is now controlled by css variables allowing to customize
critical design properties without the need of SCSS overrides.
By default the design is white(-ish) to match the floating toolbar,
while in 'wysiwyg_snippets.scss' the variables are customized to get the
typical sidebar's dark feel.

Note: despite the task main objective was just to improve/fix the
design, this aimed to simplify design inheritance and reduce the css
too. While inheritance has been improved reducing the amount of
overrides, the attempt to reduce the css partially failed (in the final
lines count must be considered that a new sidebar section has been
created).
The reason is that we currently suffer from a deep and complicated
inheritance structure for this component. The xml template uses default
bootstrap classes that are styled differently depending if loaded in a
community or enterprise environment. This approach leads to overrides
that must cover all the scenarios while further customization must be
taken in account too 'cause the toolbar can be rendered into the sidebar
with a totally different design.

A possible solution would be to detach from bootstrap directly in the
lib using custom classes names, and then @​extend these classes
differently according to the current environment but probably not a good
idea as we want the toolbar to use bootstrap for in-website editors (so
they can match the theme correctly) but this has to be reviewed as well
anyway. To be checked.

Part of https://github.com/odoo/odoo/pull/73565
task-2496339

closes odoo/odoo#73565

Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-08-31 10:00:46 +00:00
qsm-odoo 7c1c6ecc52 [IMP] web_editor: better show active entry in the text style dropdown
Replace the "¶" icon with the name of the current active text style
entry.

Part of https://github.com/odoo/odoo/pull/73565
task-2496339

Part-of: odoo/odoo#73565
2021-08-31 10:00:46 +00:00
Hubert Van de Walle (huvw) 8285412dbc [FIX] web_editor: prevent traceback when InputEvent.data = null
Step to follow

1. open any record with a chatter enabled )
2. start to write a log note in the the full composer
3. write a line with at least one character, then shift+enter
-> There is a traceback

Cause of the issue

InputEvent.data can be null

opw-2622051

closes odoo/odoo#75726

X-original-commit: 503bbe7a4d0cdd0aefcb723460210b089732831a
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-08-30 13:28:09 +00:00
Emilien Durieu (edu) 9c8b0e299a [FIX] web_editor: prevent merging of unbreakable node
closes odoo/odoo#75432

X-original-commit: 1632bf17090b38eb8998edb09c1522929dc0312b
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-08-23 09:43:45 +00:00
qsm-odooandBenoit Socias a48a30f954 [IMP] website, web_editor, *: allow to use pre-configured gradients
*: web

After this commit pre-configured gradients can be used as snippet
backgrounds, snippet filters or as text effects / highlight effects.

The background colors (and now gradients) are now possible to add
*alongside* a color combination class (editing one does not remove the
other). Background colors and gradients are mutually exclusive.

Part of https://github.com/odoo/odoo/pull/73611
task-2599770

closes odoo/odoo#73611

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Benoit Socias <bso@odoo.com>
2021-08-17 17:43:50 +00:00
Nicolas Bayet 072c038df5 [FIX] web_editor: prevent Odoo editor hints on technical elements
Some templates contain empty <li> elements for styling purposes
only and should be blacklisted in the context of Odoo editor hints
as these elements are not editable.

task-2550858

closes odoo/odoo#74944

Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-08-16 07:13:23 +00:00
Nicolas Bayet a51df6c850 [FIX] web_editor: disable Powerbox in Odoo fields that are not html
If the active element is an Odoo field (ie. a field with the
`data-oe-model` attribute) it means the content should not be
considered html, unless its type is specifically `html`.

If the Odoo field is of the `html` type, the Powerbox should only
be triggered if the active element is _within_ that field rather
than _being_ the field itself.

task-2550858
2021-08-16 07:12:32 +00:00
Emilien Durieu (edu) 40e339f449 [FIX] web_editor: command bar hints styling issues
The command bar hints were not properly text-aligned, and the color was sometime not visible depending on the background.

task-2607335
task-2607337

closes odoo/odoo#75028

X-original-commit: 0cd597558c2da268148ca8871442014edba3fdcb
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-08-12 13:06:37 +00:00
Emilien Durieu (edu) 8567b9cb69 [FIX] web_editor: fix bold that bolds too many nodes
The bold command used `assignInlineStyle`, which misidentified when a text node needed
to be wrapped in an inline element in some situations, eg:
`<p>aaa<span style="font-weight: normal;">[bbb<span>c]cccc</span>bb</span>dddddd</p>`

task-2613476

closes odoo/odoo#75015

X-original-commit: a61fe7a338289b9195dfca56389593411daf2401
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-08-12 11:54:50 +00:00
Emilien Durieu (edu) b684ad963c [FIX] web_editor: detect spaces correctly
Because of css rules, when a space was inserted (which is supposed to close the power box), it wouldn't be present in the innerText string.
It was fixed by using the textContent property instead, which contains all the spaces, including the invisible ones.
This might cause problems in some situation where the markup that the editor is modifying contains formatting spaces.

task-2584101

closes odoo/odoo#74766

Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-08-10 07:56:35 +00:00
Emilien Durieu (edu) de2c7cff6f [FIX] web_editor: prevent double space insertion
The auto-link making feature would insert two spaces when the user would try to add one space.
It is no longer the case.
Some selection management with the link making has been fixed as well.

task-2584101
2021-08-10 07:56:35 +00:00
stefanorigano (SRI) 79d069d21a [FIX] web_editor: add missing style entries
When the user selects text, the editor compares its closest block type
with a pre-made list of text types (eg. p, h1...).
In case of a match, the 'active' class is applied on the relative
toolbar component.

This commit will extend the comparison list adding text styles that were
initially missing (= the code, h4, h5 and h6 tags were never marked as
active).

Related to task-2496339

closes odoo/odoo#74925

X-original-commit: 1f1157c7e5c2df1bf318ad3a32e7030c969f5261
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-08-10 11:19:48 +00:00
Younn Olivier 02f845ea68 [FIX] web_editor: only send observerApply event when needed
REASON FOR THE FIX
To correctly display the overlay over a rotated element, we need to
reset the transform of the element, to be able to apply it on the
overlay.

Changing the style of the element in the SnippetEditor cover method
would trigger a DOM mutation, which will result in setting the
odooEditor observer unactive.

The issue was that flushing the observer (when setting it unactive)
would always send an event observerApply, even if no record was
processed.

It was an issue as the SnippetsMenu was triggering a content_changed
event at the reception of this event, which would rerender the
SnippetEditor overlay cover (and create an infinite loop of events).

SOLUTION
To avoid that, the observerApply event is sent only if records were
processed.

Part of https://github.com/odoo/odoo/pull/74592
task-2554608
2021-08-05 08:10:10 +00:00
Nicolas Bayet 112aad4863 [FW][FIX] web_editor: correct delete forward and backward on non editable
Trying to delete forward a non editable was erasing the first
character of the non editable.
Trying to delete backward one character after the contenteditable false
made the cursor jump before the contenteditable.

closes odoo/odoo#74623

X-original-commit: 9b7d9ad3771579ccb60a1be526f5d7571f64e638
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-08-03 11:32:49 +00:00
Nicolas Bayet b006e7e8c3 [FW][REF] web_editor: refactor traversal functions for clarity
The generator was quite confusing and also
did not provide enough flexibility for when to
stop traversing and under which condition it is
going down the tree.

This refactor was necessary for a future commit
that require to use the new parameters `isNodeDescendantTraversable`
and `stopFunction`.

X-original-commit: c8d44120b49ac967ac12f3715bdaf83cdff3c4c6
2021-08-03 11:32:49 +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
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
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
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
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
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
Antoine Guenet c910976162 [FIX] web_editor: update odoo-editor lib to commit 1021d47 2021-05-17 08:58:50 +00:00
Sébastien Geelen (sge) 7845a77c61 [FIX] web_editor: update odoo-editor lib to commit 77a1e98
X-original-commit: ea86110cc781b603a6665523cd4359a405f5babd
2021-05-03 07:48:18 +00:00
Nicolas Bayet 6227dee6ac [IMP] web_editor: update odoo-editor lib to commit 62dbf38
closes odoo/odoo#69471

Related: odoo/enterprise#17788
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-28 07:46:31 +00:00
David Monjoie 1551a459cb [FIX] web_editor: update Odoo Editor lib to commit f031cf78
closes odoo/odoo#69761

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-23 12:30:49 +00:00
Antoine Guenet 61fc91243c [FIX] web_editor: build editor up to commit fa480dd
closes odoo/odoo#69422

X-original-commit: 6ba1571547a9b7d62438fed15d061485d1696026
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-16 16:54:31 +00:00
Nicolas Bayet 4e34a17575 [FIX] web_editor: update odoo-editor lib to commit 2d94352
X-original-commit: 201ef89c07adcbed0dd16b7553f804b793ef8224
2021-04-13 15:46:27 +00:00