Commit Graph
2725 Commits
Author SHA1 Message Date
Romain Derie 50cb0f3276 [IMP] web_editor: remove the img overlay replace and delete
As replace and delete are already in the right panel, this is kind of a
duplicate. Related to f3ccc91d42

Also, add border around selected image so the used knows what image is selected

task-2502679
Closes #69340

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-05-26 09:55:16 +00:00
Romain Derie 6c895f8920 [IMP] web_editor: use brand-primary color for replace btn
task-2502679
Closes #69340
2021-05-26 09:52:01 +00:00
Romain Derie d585b0e560 [IMP] web_editor: remove quality optimization warning
It creates confusion for no good reason

task-2502679
Closes #69340
2021-05-26 09:52:01 +00:00
Antoine Guenet 7e46a7ee42 [FIX] web_editor: properly indent checklist items
Indenting a checklist item duplicated its checkbox. This properly copies
the css from the editor that was lost in translation.

X-original-commit: 14efea8ac944eba483f7300d6ba6e51592f26b80
2021-05-27 14:56:38 +00:00
xO-Tx 4a7c562471 [FIX] website, web_editor: fix colorpicker preview
Issue:

> Set bg color combination for a snippet... > Save
> Edit mode > Select the snippet
> Open color palette in bg option
> Hover a color option
> When a color button is left, the preview is cancelled
  but the color combination class is not applied anymore.

In '_computeWidgetState' (for 'selectStyle' method), the right
value ('o_cci') is not returned because we get empty "colorNames"
(the "colorPalette" is not rendered on start).

The goal of this commit is to fix this behaviour by rendering the
colorPalette in start for snippet options, this way, the new code
won't affect the speed fix added in [1] for 'OPTIONS' tab.

[1]: https://github.com/odoo/odoo/pull/65223/commits/ce54c3f21293513673cb1fc6073ada5f0a2b5641

task-2538326

closes odoo/odoo#71365

X-original-commit: fd31c9a10f97c92a48d0589a8bbeaf13a641e891
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-05-27 17:35:40 +00:00
Sébastien Theys c6716847aa [IMP] web, *: clean up notification API
task-2476867

closes odoo/odoo#67009

Related: odoo/enterprise#16760
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-05-27 13:47:23 +00:00
Sébastien Geelen (sge) eb1fa6d2a9 [FIX] web_editor : remove duplicate focus() declaration
closes odoo/odoo#71319

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-05-27 09:17:36 +00:00
Sébastien Geelen (sge) d193e5a1d7 [FIX] web_editor: add missing title on toolbar button
closes odoo/odoo#71194

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-05-25 07:39:54 +00:00
Mohammed Shekha ccc56e28a3 [IMP] *: replace fa-spinner with fa-circle-o-notch
Slightly improve the overall UI of Odoo with a more modern feel by updating the
current 'loading' icons that look quite old school.

Use fa-circle-o-notch instead of old style fa-spinner

task-2346142

closes odoo/odoo#59454

Related: odoo/enterprise#13908
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-05-21 11:48:32 +00:00
Antoine Guenet d934b81aaa [IMP] web_editor: move icon and image tools to snippet option
Wherever there is a sidebar, this moves all icon and image options to
their own section of it. This also enables previews.
The "spin" option was deemed unnecessary and therefore removed.

TODO: restore the link option for icons. It wasn't working properly
before this and was removed until it is fixed so as not to do any
unnecessary coding for a broken option.

closes odoo/odoo#70952

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-05-21 09:00:58 +00:00
Antoine Guenet 3e76664d49 [FIX] web_editor, website: properly record history on col count change
When changing the number of columns of a snippet, the history was
recorded too many times and at wrong moments, resulting in a mess of
undos to trigger before restoring the original column state.
The issue was due a combination of dead code and the fact that
`_updateColumnCount` triggered `remove_snippet` for each of its columns
while `remove_snippet` in turn triggered a history step at every
execution.
This fixes it by removing the dead code, replacing it where necessary
with a call to the editor's `historyStep` method, and adding an option
to `remove_snippet` so its triggering of a history step can be bypassed.

closes odoo/odoo#70932

X-original-commit: 877e5c807087afed880aeba3eab79def3a7b583c
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-05-18 08:11:26 +00:00
Sébastien Geelen (sge) fa2e0a6349 [IMP] web_editor: Add rel="ugc" to some user generated links
See odoo task : https://www.odoo.com/web#action=333&active_id=1695&cids=1&id=2319575&menu_id=4720&model=project.task&view_type=form

closes odoo/odoo#70614

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-05-17 08:58:50 +00:00
Antoine Guenet c910976162 [FIX] web_editor: update odoo-editor lib to commit 1021d47 2021-05-17 08:58:50 +00:00
Antoine Guenet 9d0c754437 [FIX] web_editor: properly display list buttons as a dropdown in toolbar
The list buttons in the toolbar were stacked, messing up the layout of
the toolbar. This restores them as they were before
https://github.com/odoo/odoo/commit/b2dd95937346561495ab86b90715210ffd9a474a
somehow messed it up.

closes odoo/odoo#70644

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-05-11 09:32:31 +00:00
Martin Trigaux 41d8b8cf68 [I18N] *: export saas-14.3 source terms
closes odoo/odoo#70673

X-original-commit: bcb9ff784e44462384b0a43a0a23eed7a1111bc5
Related: odoo/enterprise#18269
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-05-11 12:28:28 +00:00
Xavier Morel 79a4d11e24 [FIX] *: bunch of mismarked translation specifiers
`_(xyz)` will wrap them in an underscore.js object, which when used in
a string context will just return the string. So it's basically a
no-op, but it certainly doesn't translate the terms.

closes odoo/odoo#70476

X-original-commit: 92352ed2b5524c97b0aeeba3193c6a8d93ed82a1
Related: odoo/enterprise#18172
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-05-06 12:06:22 +00:00
Jorge Pinna PuissantandSamuel Degueldre f43a0814ae [IMP]*: configuration of ESLint for specific files
This commit will add the needed ESLint configurations on the JS files.
These configurations are added if the JS file uses a different
environment (serviceworker, node, etc) or if it uses a specific global
(google, ace, etc).

Co-authored-by: Samuel Degueldre <sad@odoo.com>
2021-05-04 13:32:49 +00:00
qsm-odoo 215ae8cadb [FIX] web_editor, *: remove some post new editor dead code
*: website, website_event

Remove some dead code introduced by the new editor merge at [1].

[1]: https://github.com/odoo/odoo/commit/499e8860f194a7eb09a2e224b713a362923d77ac

closes odoo/odoo#70257

X-original-commit: 0a890a353dd89a60fd156f4280d069596b199cc7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-05-03 12:36:35 +00:00
Samuel DegueldreandTom De Caluwé 2cfb8658bf [FIX] web_editor: fix default shapes not reacting to palette changes
Previously, when toggling on background shapes, they always had the
default colours. In [1] we made it so that when you toggle on a shape on
a section, it would automatically reuse the colors of the surrounding
shapes if any.

Unfortunately, when the "implicit" colors were also the default colors,
they were still marked on the shape, and it got an explicit background
image that would no longer react to changes in the palette.

This was caused by the fact that the call to _getDefaultColors returns
an empty object when the section doesn't already have a shape-container,
this was not a problem before since we were not passing in any colors
when creating the initial shape previously, the the aforementioned
change made it so that we did.

This commit fixes the issue by creating the shape-container before
calling the method that will set the colors on the shape, this way
getDefaultColors works as expected, and the colors are not marked on the
section when they are the default ones, restoring the ability of the
shape colors to adapt to the palette

[1]: https://github.com/odoo/odoo/commit/875aca63f7dab287c61485ebe999b3b8dd89d91c

task-2500607

closes odoo/odoo#70054

X-original-commit: 63acc2b0d1957dedd40af2033722f9ea4ef2e597
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: Tom De Caluwé <tdc@odoo.com>
2021-05-03 09:27:44 +00:00
Sébastien Geelen (sge) ed12ad006a [FIX] web_editor: update toolbar position on scroll
closes odoo/odoo#70221

X-original-commit: 044c047cee83c915b33d21aeddb08d1096ab8060
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-05-03 07:48:18 +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
Antoine Guenet a502bb7223 [FIX] web_editor, note: autofocus the editor on load note form view edit
On creating a new note, the focus was automatically set into the "tags"
field. This was inconvenient and was replaced with an autofocus on the
note itself so we the user can immediately start typing.

closes odoo/odoo#70195

X-original-commit: 8fe89c5ebc138cb517938dbd6d975b8bec4eaf4d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-30 15:23:36 +00:00
Sébastien Geelen (sge) 86dbb2f4ae [FIX] web_editor: prevent linktool destroy on autocomplete click
closes odoo/odoo#70167

X-original-commit: 3acf90df2f70793554ff13e262cb4ad0e38308bd
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-30 11:31:23 +00:00
Sébastien Geelen (sge) 0c5c4664f6 [FIX] web_editor: fix icon replacement when using toolbar replace button
closes odoo/odoo#70143

X-original-commit: b5ed6558185bb4686d6be6e8c1c4e8c4573c6e14
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-30 08:06:32 +00:00
Sébastien Geelen (sge) d54959bd9d [FIX] web_editor: fix icon link edition
X-original-commit: 8bb7610e8893cad692cf9ad2f5a89a503a6175ef
2021-04-30 08:06:31 +00:00
Nicolas Lempereur 26a6c99eb0 [FIX] web_editor: email receiver see file icon
Scenario:

- add a file in mass mailing editor => an generic icon (instead of lower
  version where icon depended on mimetype) is added linking the file

- save and send mail => no icon is shown in email received

The system is targeting `a[href*="/web/content/"][data-mimetype]:empty`
to add real image inside instead of using background-image attribute
which is stripped in sanitized.

With this commit, data-mimetype is not removed when image processing
attributes are removed when a file is inserted.

opw-2474053

closes odoo/odoo#70022

X-original-commit: eb3772508ce518ff3f84724eebbe43fd1e040d77
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-04-28 13:41:14 +00:00
Antoine Guenet dc6737290c [FIX] web_editor: ensure document filename doesn't overflow its cell
The media modal's document tab has cells with icons and filenames. If
the filename was too long, it would overflow its cell, which caused an
ugly design glitch. This ensures an ellipsis on the filename when it is
too long.

closes odoo/odoo#69990

X-original-commit: 8a4f4bf04bd5e5f9cf827273ea27a189a43c2515
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-04-28 11:19:09 +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
Nicolas Bayet ef145ea7dc [IMP] web_editor: add commandbar 2021-04-28 07:34:43 +00:00
Nicolas Bayet b2dd959373 [IMP] web_editor: cleanup the toolbar 2021-04-28 07:34:43 +00:00
Sébastien Geelen (sge) c3e08e7a7b [FIX] web_editor: add support for a.btn-link in emails templates
closes odoo/odoo#69922

X-original-commit: 7062ad7495d4ecd7e8a1a89419375c74411c1752
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-27 12:26:39 +00:00
Antoine Guenet 9569fbef2a [FIX] web_editor: preserve note-editable class on editable in iframe
The "note-editable" class was lost on the editable element when loading
it into an iframe. As a result, some selectors failed, making it so that
some options wouldn't activate when they should.

closes odoo/odoo#69908

X-original-commit: d71b7d87daa5b33f16eb9c6ade29580fb2076313
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-27 11:28:53 +00:00
Antoine GuenetandNicolas Bayet b79a09c7b2 [FIX] web_editor: ensure proper jquery reference on snippets editor $el
In an iframe, we need to make sure the element is using jquery on its
own window and not on the top window lest jquery behave unexpectedly.
This was apparent with tooltip which was called in snippets.editor with
the "wrong jquery", with the result that tooltip.js had a reference to
the top window/document instead of that of the iframe. Because of that,
it appended its tooltips to the top window instead of the iframe, and
as a result, said tooltips were wrongly positioned.

closes odoo/odoo#69879

X-original-commit: 19be8709efa8f690ccff8d04dd9a17e4ef4d82fd
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
2021-04-27 07:20:17 +00:00
Antoine Guenet 8d0d5e0d07 [FIX] web_editor: ensure editor in iframe can be scrolled on crop image
The overlay around an image when cropping it is positioned absolutely.
If it has no relative ancestor, it will cover the entire body. This is
what happend in mass_mailing, making it impossible to scroll the page
while cropping. This commit addresses the issue by positioning that
editable relatively so that the overlay never goes beyond its bounds.

closes odoo/odoo#69878

X-original-commit: c4d423640a9f1f9892e9d24dc08531ba0bbf8887
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-27 07:14:38 +00:00
Antoine Guenet 002cdcab0a [FIX] web_editor: show/hide toolbar on click in editor document
We need to check the selection on click in the editor's document so as
to update the visibility of the toolbar (we want to hide it if the
selection is in a non-editable area). When the editor was in an iframe
however, the wrong document was targeted: we want to check on clicks in
the editor's document, not the top document.

closes odoo/odoo#69775

X-original-commit: b0429c96e30751390991a9471a4c031dfed98d81
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-23 15:25:33 +00:00
Antoine Guenet 1129e5727d [FIX] web_editor: apply "editor_enable" class to iframe body
Before introducing the new Odoo Editor, the body of an iframe containing
the editor has the class "editor_enable". Now it's applied to the main
document's body. This ensure the class is applied on the iframe's body
like before.
As a consequence, some CSS had to be adapted:
- The position property of the snippets menu which had been overridden,
  probably as an ad-hoc fix for the fact that this class was missing.
- The top padding which is applied to accomodate a top toolbar which was
  removed with the new editor and can now be removed.

closes odoo/odoo#69767

X-original-commit: b7cbb8a8fdbebdb7d33e3286fa9f4ec760ad9fe6
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-23 14:20:36 +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
Sébastien Geelen (sge) 6c095fbee5 [FIX] web_editor: Fix floating toolbar position when inside a iframe 2021-04-23 12:20:08 +00:00
Antoine Guenet 0c02549186 [FIX] web_editor: properly hide the toolbar when needed in iframe
This fixes a bug in mass mailing, that made the toolbar still visible
while the selection was not in an editable area. It was due to a jquery
selector targetting the top document instead of the iframe's document.

closes odoo/odoo#69707

X-original-commit: 5e3cda847a42561ae709cb792d3e612f8a5e66dc
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-22 15:03:05 +00:00
Antoine Guenet db420f14e9 [FIX] web_editor, website: ensure editor toolbar doesn't hide dropdowns
A colorpicker in an option positioned above the toolbar in a snippets
menu would be hidden by the toolbar because of the toolbar's z-index.

That z-index is only needed when the editor is in a modal.

The bug this commit fixes only arises when the toolbar is in a snippets
menu.

This applies the z-index only when there is a snippets menu in the page.
To accomplish that we need the "editor_has_snippets" class that the
website module applied to the body. For the sake of harmony within Odoo,
that class is now applied by snippets.editor so that no matter the
module, if there is a snippets bar, the class is on the body of its
document.

closes odoo/odoo#69680

X-original-commit: b1aa9c6093cea918337d5600ff9b16b7dd80de23
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-22 12:02:31 +00:00
Antoine Guenet 459d4e27a8 [FIX] web_editor: ensure dropdown menus in toolbar are fully visible
Dropdown menus (eg.: font-size) had their contents cropped if space was
lacking underneath the toolbar. With this the user can scroll down to
see the rest of it if needed.

More info: https://github.com/twbs/bootstrap/issues/23378

closes odoo/odoo#69644

X-original-commit: d360b751acfc1649673739b185b635732cf5b78f
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-22 09:11:23 +00:00
Gorash aa47eda087 [IMP] web: add mode qweb in ace
Add a new parser in the ace for the qweb highlight. This makes it possible
to visualize the qweb tags and the part of code.
Used in the website and in xml fields.

closes odoo/odoo#69609

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-04-21 12:15:01 +00:00
Antoine Guenet 5af915f74d [FIX] web_editor: properly select the target link on destroy link tools
`setCursor` routinely failed to actually select the target link on
destroy the link tools because the nodes passed to it were not in the
DOM. This fixes that problem, which in turns has the effect of keeping
the editor's toolbar in the sidebar on the website builder after link
insertion.

closes odoo/odoo#69525

X-original-commit: c8fa05813da82fd2b282721f3a86053b7b6661ba
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-20 10:15:42 +00:00
Antoine Guenet f1cbe733b5 [FIX] web_editor: ensure focus is in editable after insert link
Prior to this fix, pressing CTRL+Z right after saving a link dialog
didn't do anything because the dialog prevents the focus from being in
the editable, even though the range is in the link. This waits for the
dialog to be removed from the dom so we can force the focus on the
editable.

X-original-commit: 769a22a579e4622861ca239084d7259820266b23
2021-04-20 10:15:42 +00:00
Antoine Guenet 6db6134f97 [FIX] web_editor: create a history step on insert a link with link tools
Prior to this fix, link tools didn't create a history step when they
were destroyed, meaning that you couldn't undo the creation of the link.
This ensures that the link tools are destroyed whenever a click is done
outside the toolbar, which ends the link edition and commits it to the
DOM. At that moment we can consider the link edition is over, equivalent
to saving the link dialog, and we can create a history step.

X-original-commit: 9b10c5923dadab3a49d474eb236c7c2617fb4be0
2021-04-20 10:15:42 +00:00
Antoine Guenet bcd6f6208b [FIX] web_editor: properly load iframe wysiwyg without defining it twice
Template `wysiwyg.iframeContent`'s `#iframe_target` includes a `script`
element that defines an odoo module (`web_editor.wysiwyg.iniframe`).
`wysiwyg_iframe.js` resets the html of that target so that the node
prototypes are defined relative to the top window rather than the iframe
window. Resetting that html had as a side effect that the script was run
a second time while that is unnecessary given that the module has
already been defined. This resulted in an error, which is here fixed by
removing the `script` element from the html when resetting it.

closes odoo/odoo#69492

X-original-commit: 3d4e0f15dd9a0009a7d0fc19fc29a5df9a6f92e8
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-19 14:22:49 +00:00
Sébastien Geelen (sge) d5ec63cd48 [FIX] web_editor: fix traceback for some CTRL+A cases in mass_mailing
closes odoo/odoo#69486

X-original-commit: 22926d0bfca472daad8cebddbc19e6bb3e846904
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-19 13:25:06 +00:00
Sébastien Geelen (sge) f3043e94e9 [FIX] web_editor : correctly update toolbar inside iframe
closes odoo/odoo#69479

X-original-commit: cdd625b9c6ea6eb5f8a7c35175e85cf701869648
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-19 12:29:41 +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
Antoine Guenet 6b0bed04df [IMP] web_editor: remove useless resizer on mobile
X-original-commit: 808207b0b7b1ebc22c65d83034bd75f761c0efed
2021-04-16 16:54:29 +00:00