Commit Graph
136 Commits
Author SHA1 Message Date
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
Sébastien Geelen (sge) d7c4362319 [FIX] web_editor: update odoo-editor lib to commit 68108b2a
X-original-commit: d3c17baf260d962eb620c77e03afccea8c16c1d1
2021-04-09 10:48:30 +00:00
Sébastien Geelen (sge) 510da70768 [FIX] web_editor: adapt $.tranfo() to be iframe compatible
closes odoo/odoo#68878

X-original-commit: c180c8d76862cd65df413f40787e05bad76367b5
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-07 10:25:49 +00:00
Antoine Guenet 5d8a8841a6 [IMP] web_editor: update odoo-editor lib to commit fb68d86
closes odoo/odoo#68687

Related: odoo/enterprise#17463
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-02 09:44:12 +00:00
740168ce8d [REF] web_editor, website_*, mass_mailing: adapt to Odoo Editor
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Emilien Durieu <edu@odoo.com>
2021-04-01 16:01:06 +00:00
93e88da2e6 [ADD] web_editor: introduce Odoo Editor wysiwyg rte library
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Emilien Durieu <edu@odoo.com>
Co-authored-by: Fabien Pinckaers <fp@odoo.com>
Co-authored-by: Quentin Smetz <qsm@odoo.com>
2021-04-01 12:49:47 +00:00
27166ff9df [REM] web_editor, website: remove Summernote wysiwyg rte library
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Emilien Durieu <edu@odoo.com>
2021-04-01 12:49:47 +00:00
xO-Tx 048612f21b [FIX] web_editor: fix anchor range selection
When we double click a form submit anchor, and depending on the selected
element before click, the selection range ("document.getSelection()") can
start from a parent of the targeted node. This will send a wrong range
to be used in LinkDialog widget.

The goal of this commit is to prevent this behaviour by adjusting the range
if it starts from anchor parent.

Note: the bug only occurred in Firefox.

Part of https://github.com/odoo/odoo/pull/62206
task-2381305

closes odoo/odoo#62206

closes odoo/odoo#67171

closes odoo/odoo#67176

X-original-commit: 9a16c313f131ed2e1017566a5f1bed134e22cc10
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-04 16:48:50 +00:00
xO-Tx 6c8fea3c1e [FIX] website_form, *: allow to update buttons using link dialog
*: web_editor, website_mass_mailing

When we double click a link/button, a link dialog appears
to update the target properties, and since the current link dialog
can only handle anchor targets, using it on buttons leads to some
inconsistencies :

- visible href options for button & url required to save changes.
- missing preview when button style changed.
...

The goal of this commit is to add a fix (with minimum of code) on
summernote linkdialog to handle button elements using the same logic as
anchor nodes.

Also, update website form test tour to test those new changes.

Part of https://github.com/odoo/odoo/pull/62206
task-2381305

X-original-commit: 19fbbdc0327482b5d70bdbcf17c2a5a950327d63
2021-03-04 16:22:08 +00:00
xO-Tx 2d58bbece6 [FIX] web_editor: fix anchor click on submit button
Context:
1) Edit mode
2) Click on anchor edition button of website form submit button
3) Traceback occurs

The "focus" triggered on $editable element in editor's 'getLinkInfo()'
discards user's text selection on submit button, as a result,
'range.create()' method returns null since no selection is found.

Note: the bug only occurred in Chrome.

Note 2: [1] apparently tried to solve the same issue but the fix was not
        solving it correctly, at least not in all cases.

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

opw-2443441

closes odoo/odoo#66574

X-original-commit: adf3d039acbac60b7ea7e6ab0ea8fdd9f940c3b2
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-19 18:45:16 +00:00
qsm-odoo 16656e7113 [REV] web_editor, *: remove JW empty assets
*: mass_mailing, website

The revert of Jabberwock at [1] was made reverting all the commits
that happened during and after the Jabberwock merge. This missed a
preparation commit [2] which added empty asset files a few days earlier.
This reverts that commit.

[1]: https://github.com/odoo/odoo/commit/e5572c317a7775a58675ed73efc89b5c9f6c0c39
[2]: https://github.com/odoo/odoo/commit/55f10ac9a0bb574a893e84c3ee6237e1d439750b

closes odoo/odoo#64860

Related: odoo/upgrade#2098
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-21 13:32:10 +00:00
qsm-odoo e5572c317a [REV] web_editor, *: remove Jabberwock
*: barcodes, mail, mass_mailing, note, test_website, web, web_tour,
   website, website_blog, website_event, website_form, website_forum,
   website_mail_channel, website_mass_mailing, website_profile,
   website_sale, website_twitter, doc

New solutions are being investigated in master. For the moment, it seems
better to remove Jabberwock to unlock difficult forward-port between
14.0 and 14.1/master, until we decide what to do once and for all in
a later master. We may un-revert this later but that would be way easier
than reverting Jabberwock in a few months.

This was done as safely as possible by removing any commit related to
Jabberwock, then resolving conflicts, then reforcing commits from 14.0
that were hugely adapted for 14.1/master, then forcing the whole diff
over a rebased 14.1/master. The only possible miss (other than me making
a mistake) would be commits that were not forward-ported to 14.1 thanks
to Jabberwock handling the issue on its own (I know we had such commits
in website, which I manually included in this revert, see below).

For reference:

Commits which were reforced to their 14.0 version:
- https://github.com/odoo/odoo/commit/1a916fc2362c0b006460d94a219366ade1cce058
- https://github.com/odoo/odoo/commit/fd9e58a675bb7ec1bf97cb77b21b3c65369d51fe
- https://github.com/odoo/odoo/commit/bdfddace29b16404c06a7ebfc0cc242463a0e768
- https://github.com/odoo/odoo/commit/42b3ad10e0b32b7fc72f801e2c67d6baf938c566
- https://github.com/odoo/odoo/commit/710784da1f02d45cbe898da426ba7e2ac63dc711
- https://github.com/odoo/odoo/commit/597585c9b8b1350bcfd84e8433ea6c82060bcc3d
- https://github.com/odoo/odoo/commit/333a9124608ff655bd9ad5e63044a5cb7ef9c636

Commits that were not forward-ported to 14.1/master and now are:
- https://github.com/odoo/odoo/commit/55ff2d971b672dec5f103215be39101c88856b6c
- https://github.com/odoo/odoo/commit/ebbb3de1e5f363689a5ba1647bb4c26416e42d5b

+ Adapt this forward-port: https://github.com/odoo/odoo/pull/60976 (as
  it was simplified for non-stable master version relying to the
  Jabberwock implementation and now needed to be adapted to the
  summernote implementation).
  See `!$el.data('oe-expression') && $el.data('oe-xpath')`

+ Revert https://github.com/odoo/odoo/pull/60477 and reforce original
  14.0 fix https://github.com/odoo/odoo/commit/746bf53b4aecfc601f0581a948d7cb7153812c82

Note: this also means that any good refactoring that was done by the
Jabberwock-related commits is lost for now. Once the revert reaches
master, I'll try and restore what we want from those commits. Here
are their references (but obviously they have the opposite conflicts
than those resolved during this revert):

e766842a92b6 [REM] web_editor,website: empty summernote files
08c94c986e09 [REF] web_editor,web: adapt to new jabberwock editor
1546c1b74713 [REF] mass_mailing: adapt to new jabberwock editor
fd0b963c6028 [REF] website: adapt to new jabberwock editor
0113d05c6c94 [ADD] web_editor: add new Jabberwock editor lib
d0c88a396493 [FIX] web_editor: don't change background color out of the website editor
d52d3d67d4e1 [FIX] web_editor : better icon in text style dropdown
61cb2f0d21da [FIX] web_editor: should not ask if want to leave the page twice
c42012b863b5 [FIX] web_editor: trigger a resize when use the mobile preview
d934d05d6e39 [FIX] web_editor: need to build the snippet before commit it into vDom
495bea924745 [FIX] web_editor: remove box shadow on the #wrap container
bffb5612e689 [ADD] field_html: add resizer in most field_html
f3c94e40cccf [IMP] web_editor: update Jabberwock library to commit 41e4063
cc87dea3ef32 [FIX] web_editor: update header change position to work with JW
5d9b25f66704 [FIX] web_editor: do not insert chars around step icon on click
70d3f0e4630c [IMP] web_editor: update Jabberwock library to commit 0bd94881
a57f13891f82 [FIX] web_editor: open media modal in appropriate tab on dblclick media
5b7537397e08 [IMP] web_editor: update Jabberwock library to commit a7ba7c34
a8d7ec235eeb [FIX] web_editor: adapt iframe Qunit test to new editor
5f794eac7209 [FIX] mass_mailing: hide all panels on show themes
551d45641d19 [IMP] website: remove unused reference
10580e1c102f [IMP] wesbite: add comment in tour
c17049f6b764 [FIX] web_editor: Fix description toggle in pricelist snippet
18a428e854b1 [IMP] web_editor: update Jabberwock library to commit 43a10003
58a161c645a5 [REF] web_editor, website: use editor helper setClass
62dd0bd3bc66 [FIX] web_editor: properly deactivate snippets and reactivate the last
99eebcaa34cb [FIX] web_editor: disable snippet in preview mode on mouse leave options
a84216932958 [FIX] web_editor: fix the image gallery snippet
f8dd4ea3e7d5 [FIX] web_editor: fix shadow selector for Safari
e50a4f3a16de [IMP] web_editor: update Jabberwock library to commit de13ed7e
4a2718f7a5ba [FIX] web_editor: ensure dom is properly cleaned at end of save test
03684c004a4e [FIX] website: ensure reset of bg-image on add bg-video
d63397159708 [FIX] web_editor: fix image remove from images wall
82fa5142f1a5 [IMP] note: restyle note without sheet or resizer
8b9f1ce603d5 [FIX] web_editor: properly mock createWysiwygIntance (sic) in tests
fc2183b66305 [FIX] web_editor: image overlay did not update with changes
cd0d2f5791cd [FIX] web_editor: add color preview to color picker
28a168172454 [FIX] web_editor: restore removal of spinner
67c90dd3b946 [FIX] website_forum: properly initialize editor
920dfe2a430a [FIX] website_forum: better css in the JW toolbar
43f33fd651af [IMP] web_editor: update Jabberwock library to commit 6853b60
71246c92f8de [FIX] Web_editor: table options button should be inside the toolbar
12b9e5916692 [FIX] web_editor: properly update the image options on replace image
e889cf8583da [FIX] website, website_sale: properly save filter id of dynamic snippets
e0fd11e36e45 [IMP] web_editor: update Jabberwock library to commit 4b2c903b
8f2b7ba35614 [FIX] web_editor: properly stop snippet option changed event propagation
a30c2c4105c7 [FIX] website: fix megamenu snippet editor behavior
312091cf822b [FIX] web_editor: fix overlay that is not reappearing
9f1d03dda613 [FIX] web_editor: table picker not fully displayed
814ddada6124 [IMP] web_editor: remove message before leaving page if editor is destro
4f38e26af7da [FIX] web: allow saving copyright footer
01e947b6123b [FIX] web_editor: only save translations that changed
103676072c50 [FIX] web_editor: prevent traceback on open crop dialog
5844ff66d4a0 [FIX] web_editor: apply image crop in jw on save dialog
1b435652e4a0 [FIX] website_forum: ensure media modal opens on click button
4f4a6ca0b8ac [FIX] web_editor: ensure valid default html value
51e22026ac7b [IMP] web_editor: update Jabberwock library to commit ab1184f8
2413fa19be0e [FIX] web_editor: Qunit test properly wait for editor stop
aa89e1ea3e97 [FIX] web_editor: properly save view blocks with an id
e2e90b53992e [FIX] web_editor: ensure language selector is non editable
0efd72089d5c [IMP] web_editor: clean useless lines
f54dfc7631f9 [IMP] web_editor: remove useless comment
3995ab1b84f2 [IMP] web_editor: update Jabberwock library to commit b8d73691
0834b1e5740a [IMP] web_editor: withDomMutations
f1459fb7b45c [FIX] web_editor: fix non-deterministic error in QUnit wysiwyg tests
6e8acc6c8cc7 [IMP] web_editor: update Jabberwock library to commit 3bbb175c
18a0c95d51cb [FIX] website, web_editor: #wrapwrap in body
4686a92e742c [FIX] website_form: allow edition of success message
78cc4da075cc [FIX] web_editor: allow edition of branded nodes only
bcffa7353448 [FIX] web: dialog should not use field value footer items
67ff56e14746 [FIX] web_editor,website_mass_mailing: display the popup preview
3cb9bea50c20 [IMP] web_editor: update Jabberwock library to commit a20492ea
518f03e6f1c9 [FIX] web_editor: use withIntangibles to find ZoneNode
d0ad6a568f49 [FIX] website: move sidebar out of theme
d690f5da13ea [FIX] website: properly save popup id
43b3433df3e6 [FIX] web_editor: fix non-deterministic error in QUnit wysiwyg tests
4ee8f4dedc30 [FIX] web_editor: prevent deadlock when removing child snippet of popup
850be198ef6d [FIX] web_editor: prevent traceback on reposition background image
4c3eaba41f5d [FIX] mass_mailing: adapt tour to the new editor design.
496d3ea272ed [FIX] web_editor: properly position sidebar scrollbar
5be4de703074 [FIX] web_editor: Show the toolbar when select the text in forum edition

closes odoo/odoo#63768

Related: odoo/enterprise#15458
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-24 13:36:49 +00:00
David Monjoie 4b8cbea36c [IMP] web_editor: update Jabberwock library to commit a20492ea
Changelog:
[IMP] BundleOdooWebsiteEditor: share withIntangibles object for odoo
[FIX] *: use withIntangibles walker to find intangible ZoneNodes
[REF] Layout: ZoneNode is now intangible
[REF] Core: refactor allowEmpty
[FIX] DomHelpers, DomLayout: ensure mutation on correct vdom match
[IMP] core: move browse the arch methods into a walker object
[IMP] core: add support for not tangible container
[ADD] Small: handle <small>
[ADD] Test: some new space tests

X-original-commit: 19661cf0bb8b5ec1fb832c6a935f816da4730b20
2020-12-15 12:04:18 +00:00
David Monjoie c498dfcb19 [IMP] web_editor: update Jabberwock library to commit 3bbb175c
Changelog:
[IMP] Odoo: add option to wrap the main zone

X-original-commit: 3fff28df08678a1ca4f5b60d5d96bfeb6115f31c
2020-12-11 17:56:51 +00:00
David Monjoie 7498d58edc [IMP] web_editor: update Jabberwock library to commit b8d73691
Changelog:
[IMP] Odoo: allow empty structure nodes
[IMP] Odoo: expand parsing range of OdooStructureNode
[FIX] DomHelpers: removeNodes only when they exist
[FIX] withDomMutations : getParentModifiers
[FIX] withDomMutations: don't get node loosely
[FIX] withDomMutations: remove the proper observer
[FIX] OdooField: do not apply empty class if placeholder
[FIX] OdooWebsiteEditor: add expected Theme plugin

X-original-commit: 537c3318a6f2751d83a011345602456125420590
2020-12-11 15:32:36 +00:00
David Monjoie 923b38ba39 [IMP] web_editor: update Jabberwock library to commit ab1184f8
Changelog:
[FIX] Core,Underline: fix compilation errors after cascading
[IMP] DomHelpers: transfer dom mutation in VDocument
[IMP] Core: add iterable capacity to modifiers
[IMP] core: add cascading modifier support
[FIX] DomLayout: firefox screenshot feature
[FIX] Underline: always put <u> as deep as possible in the rendered DOM
[FIX] JWEditor: Await the new stop event mutex + adapat some tests
[FIX] EventNormalizer: Clean _triggerEventBatchOutside at destroy()
[IMP] JWEditor: Wait for all mutex to be done before stopping the editor
[FIX] Textarea: use tag name for textarea parser predicate
[IMP] Quote: add quote plugin
[FIX] DomLayout: Make sure falsy attribute values are not transformed into null
[IMP] Heading, Blockquote, Pre: do not preserve modifiers on end split
[FIX] history: change icon to be compatible with Odoo FA version (1.4.7)
[FIX] table: table-picker rendered under some buttons
[FIX] Odoo: add OdooFields css to OdooWebsiteEditor
[FIX] Color: do not color a ZoneNode
[IMP] Table: add component "Table options" button + visible on group
[IMP] Pre: never duplicate a pre on insertParagraphBreak
[IMP] Blockquote: never duplicate a blockquote on insertParagraphBreak
[FIX] List: should not have the list-style none attribute in the vDoc
[FIX] List: toggle list should removes list-style from li element
[FIX] Iframe: IframeNode should be rendered in the layout.
[ADD] Core: handle deleteHardLine

closes odoo/odoo#63006

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2020-12-08 11:25:57 +00:00