Commit Graph
3103 Commits
Author SHA1 Message Date
Fabien Pinckaers eedf37d6e2 [IMP] Better handling of indexes
Three supported types:
- btree (default for index=True)
- btree not null (when >90% of the data are null)
- gin trigram search (for char fields)

Review of indexes on all objects.

closes odoo/odoo#83015

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-01-19 16:52:23 +00:00
Nicolas Lempereur 96ec641217 [FIX] web_editor: no !important bg-color
The tool to change background color in mass mailing will currently
set the CSS property as !important.

On outlook software (or windows mail app) this seems to fail:

- !important on inline CSS should not be used

In this fix we remove !important when inlining CSS.

opw-2641343

note: this forward-port is only taking half of 14.0 d7e5101603 since the
issue of targetting DIV elements does not apply here (the <div/> with
the background color are transformed in table in convert_inline.js).

closes odoo/odoo#82924

X-original-commit: fb675251ce8b13d36dfac7a50e9b1cea4759cc02
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2022-01-19 10:30:52 +00:00
Thibault Libioulle 54c5160264 [IMP] website_sale: search tag in product snippet
This commit adds a search on tag in product snippet.

task-2675384

closes odoo/odoo#79296

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-01-17 14:07:46 +00:00
Nicolas Bayet b467e4df8c [FIX] web_editor: remove image toolbar when removing image
Task-2728793

closes odoo/odoo#82881

X-original-commit: 0ff6f919e10388f7fd6d8efbfb0c8f9644b2505e
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-17 12:17:31 +00:00
Nicolas Bayet 48045a069b [FIX] web_editor: change fix for scrolling powerbox
The fix to add an `overflow: hidden` in order to prevent the browser
from chaning the scroll create a glitch where the scrollbar dissapear
when it is overflow: hidden.
A new css property exists to specify exactly this behavior
(`overscroll-behavior: contain;`).

Task-2728791

closes odoo/odoo#82880

X-original-commit: 4cfa9e786d41a27d1bc850eff4fc89e1c4b32974
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-17 12:17:28 +00:00
Guillaume (gdi)andRomain Derie 8f7c6997e8 [IMP] website: propose a new social media snippet
This commit introduces a new social_media snippet that allows social
networks to be displayed. This snippet shares the same options as the
share snippet, but also provides a list to edit the URLs of the social
networks in the company data (social_facebook, ...). This list also
allows to manage links to custom social networks (which are not stored
in the DB).

Headers and footers now use this new social_media snippet instead of the
share snippet and in the settings, the urls to the DB social networks
are editable/visible only in developer mode.

task-2687447

closes odoo/odoo#80217

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Co-authored-by: Guillaume (gdi) <gdi@odoo.com>
Co-authored-by: Romain Derie <rde@odoo.com>
2022-01-16 23:36:46 +00:00
Guillaume (gdi) 3dde03308d [IMP] web_editor, website: add placeholder and undeletable on we-list
This commits introduces new behaviors on the we-list:
1. Possibility to add a placeholder on inputs
2. Possibility to make elements non deletable
3. Possibility to make element activated/toggled by default
4. Possibility to generate ID for new elements

task-2687447

Part-of: odoo/odoo#80217
2022-01-16 23:36:46 +00:00
Benoit Socias 48a60fe268 [FIX] web_editor: discard background positioning when clicking outside
Since [1] options could still be used while a background positioning
overlay was opened.

After this commit the overlay is deactivated whenever an element outside
of it is clicked - as initially intended.

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

task-2735690

closes odoo/odoo#82824

X-original-commit: 574ae49acb950d99ef4ab2b0504cfd7f39bca406
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-01-16 16:48:50 +00:00
Nicolas Bayet d3b328358f [FIX] web_editor: prevent editor powerbox hint duplication
Whenever the browser is lagging between multiple enter,
the command hints were not being updated until the browser
main thread process the event queue.

Task-2728794

closes odoo/odoo#82795

X-original-commit: bfed1edd26312488dc0f45e8982b51ea4d98db76
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-14 16:37:54 +00:00
Antoine Guenet dc17e84778 [IMP] web_editor: prevent icon and text tools in stars widget
When clicking, double clicking or triple clicking in the stars widget of
the Powerbox, we don't want to see the regular options of icons or text.
This prevents them from showing.

task-2575449

closes odoo/odoo#81920

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-14 10:21:31 +00:00
Antoine Guenet d6688ca759 [ADD] web_editor: allow rating with stars in readonly fields
Similar to checklists, this allows the user to click the powerbox stars
widget even in readonly mode, so as to change a rating without going in
edit mode.

task-2575449

Part-of: odoo/odoo#81920
2022-01-14 10:21:30 +00:00
Antoine Guenet 199874c963 [REF] web_editor: change field html widget to modern module
This adapts the html field widget so it uses the modern import system
rather than the old `require`.

Part-of: odoo/odoo#81920
2022-01-14 10:21:30 +00:00
Antoine Guenet 41e98ccbe4 [FIX] web_editor: check/uncheck checkboxes in readonly fields
When a checklist is present in an html field, there is a feature that
allows us to check/uncheck its boxes without going through edit mode.
That feature was broken due to a dead callback in wysiwyg.js, which is
hereby restored.
Meanwhile, the behaviour of checklists had changed but the python code
handling the readonly checking/unchecking hadn't so this brings it up to
date[1].
Finally, the code managing checklist ids was unnecessarily complicated
as it was trying to keep the ids consecutive for no particular reason.
This refactors it to simply use unique ids based on date stamps.

[1] It used to be that checking a box checked all the children of that
box but it was in the meantime decided not to do that anymore.

Part-of: odoo/odoo#81920
2022-01-14 10:21:30 +00:00
Antoine Guenet 8266b978e1 [ADD] web_editor: two new powerbox widgets to rate with 3 or 5 stars
This adds two new widgets to the powerbox, which allow the user to
quickly insert 3 or 5 stars, then click on them to color them gold.

task-2575449

Part-of: odoo/odoo#81920
2022-01-14 10:21:29 +00:00
Nicolas Bayet 89c215983b [REF] web_editor: remove dead code
closes odoo/odoo#82742

X-original-commit: a101ead524148825c99a4032a50138140527365a
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-14 09:25:50 +00:00
Nicolas Bayet f4b76e99ef [FIX] web_editor, mass_mailing: create link in new tab
In mass_mailing, creating a link from the linktool in mass mailing
generated link that would not create a new tab when clicked.

Task-2734760

closes odoo/odoo#82735

X-original-commit: c6b7556a35182174c3384c2069256826205bba22
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-14 09:25:42 +00:00
Nicolas Bayet 45cc8fa5a1 [FIX] web_editor: postprocess snippet once added through powerbox
Whenever adding a snippet from the powerbox, the postprocessing was not
made. This could result in unexpected behavior of the snippet.

Task-2601600

closes odoo/odoo#82694

X-original-commit: bcbf8e59c83200cb079ef15cb1fa5f7783023d88
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-13 12:47:12 +00:00
Benoit Socias bb015c4bdb [FIX] web_editor: disable command hints on navigation items
Before this commit a "List" command hint was set as placeholder in
navigation items without content upon selection of the header menu. This
showed up when using the sidebar template of the header menu.

After this commit the command hints are blacklisted for nav-items in
website.

task-2677310

closes odoo/odoo#82693

X-original-commit: e0cc23b44d798a5bf79d3e8f7e183f5e8a3c6901
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-01-13 12:47:08 +00:00
Guillaume (gdi)andqsm-odoo 7c8323e816 [FIX] web_editor, website: permit the user to set link on images
This restores a (basic) feature that was lost in 15.0 by mistake.

Allow the user to set a link on an image. The user can access this link
tool in the editor panel or via the CTRL+K shortcut. This tool is very
similar to the existing link tool for texts. This tool uses the
suggestion system already existing on the text link tool.

task-2666467

closes odoo/odoo#82512

X-original-commit: bfcd25c5d66765b7436114dba3316ac7331a4d97
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2022-01-11 14:27:00 +00:00
Guillaume (gdi)andqsm-odoo 5957cad422 [FIX] web_editor: ensure order of the we-input events
This commit ensures that changes are applied in the same order as the
events are triggered on the InputUserValueWidget. This was not the case
because of another bug we had to consider and which is not there
anymore, this is why this fix is done in 15.0 and not before.

Actually, this also greatly improves the inputs behavior using the
natural "change" event which occurs... when a change was made. Before,
if you hit enter 5 times then left an input, you had the option applied
6 times (which was particularly annoying for options which reload assets
like the header border or something like that).

task-2666467

X-original-commit: db62a5fac123fc72e37e94709b1a0c80f32a8a29
Part-of: odoo/odoo#82512
Co-authored-by: qsm-odoo <qsm@odoo.com>
2022-01-11 14:27:00 +00:00
qsm-odoo 3490b998ee [FIX] web, *: fix the grab cursor not working on all browsers
*: web_editor, point_of_sale, pos_restaurant

The grab cursor is currently not working on all browsers (at least
Chrome Linux). The fallback rule does not even work, meaning that if
you type:

```
cursor: move;
cursor: grab;
```

Those browsers does not even use "move" as they see "grab" as valid but
use the "default" cursor.

This commit replaces our "grab" uses with a local cursor ensuring it
works.

Related to task-2431469

closes odoo/odoo#82093

X-original-commit: 23ebcca902781f2fa0f2381997be4f3d375385b5
Related: odoo/enterprise#23193
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-01-03 18:58:41 +00:00
Younn Olivierandqsm-odoo 30682fd44c [FIX] web_editor: remove rename button from custom snippet on drag
Commit [1] added a rename button for custom snippets... but forgot to
remove it once the snippet is being dragged.

[1]: https://github.com/odoo/odoo/commit/1044a76a19d94ce93c4cd41841fb805d36a160e3

closes odoo/odoo#82080

X-original-commit: 2d81a6e4a1a8ebb915f00bf37267fb445b7027b7
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-12-30 15:15:37 +00:00
qsm-odoo 29e5516e2a [FIX] web_editor: re-encourage to use snippets in empty oe_structure
This commit re-applies the commit that was merged at [1] but whose
code was lost during Jabberwock revert at [2].

Make the draggable snippets "wizz" when the user clicks on an empty
oe_structure.

[1]: https://github.com/odoo/odoo/commit/3ed3537abd416ebc35f8bc2ee65f209840c071bf
[2]: https://github.com/odoo/odoo/commit/e5572c317a7775a58675ed73efc89b5c9f6c0c39

Related to task-2363616

closes odoo/odoo#82046

X-original-commit: 668539aa17f061c8851099863e4d5fb7b11b59e8
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-30 11:16:11 +00:00
Younn Olivierandqsm-odoo 116afad9fa [FIX] web_editor: correctly move snippets on a popup
Inside a scrollable popup, the scroll was not correctly triggered when
moving one of its snippets through drag and drop.

This commit correctly defines the SmoothScrollOnDrag.$scrollTarget when
a modal is shown.

task-2431469

closes odoo/odoo#82040

X-original-commit: 844051168311ac0c3e8640dda2a90545e373c98d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-12-30 11:16:08 +00:00
Younn Olivierandqsm-odoo a50c09e3b4 [IMP] web_editor: display help tooltip when clicking on a snippet
This commit introduces a tooltip to indicate to the user that he can
drag and drop the block into the page.

This tooltip is shown after a delay; if the user has started dragging
the block in the meantime, the tooltip won't be shown. Otherwise, it
auto fades out.

task-2431469

closes odoo/odoo#81430

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-12-29 15:16:22 +00:00
qsm-odoo 2e4d4485c9 [FIX] website, *: do not lose the shadow configuration on option hover
*: web_editor

Hovering the shadow mode option reset the entire shadow instead of just
previewing the mode change.

Related to opw-2701512

closes odoo/odoo#81980

X-original-commit: cae1b99052ded63a3e532b92419236dd51056fd8
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-28 15:06:48 +00:00
Nasreddin Boulif (bon)andqsm-odoo ab5c7f7ea8 [FIX] web_editor: allow to remove shadow on all cards
Steps to reproduce:

  - Install `website_hr_recruiment` module
  - Go to `your_website.com/jobs`
  - Activate Edit mode and add a "3 Columns" block
  - Select one of the columns and set the shadow to `None`

Issue:

  Shadow is not removed, and by default the "outset" mode is selected.

Cause:

  When we check the state of the shadow with `css('box-shadow')`, it
  will always be set because a custom css 'box-shadow' is set by the
  module website_hr_recruitment on card element, and therefore the value
  will always be either 'inset' or 'outset'.

Solution:

  If widget value is set to '', replace `box-shadow` style to 'none'
  (only if needed) so it will override the style from css file.

opw-2701512

X-original-commit: 212d8ec10bb48e8fd7de3d3ff7660447b968c62a
Part-of: odoo/odoo#81980
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-12-28 15:06:48 +00:00
David Monjoie 21bec66dce [FIX] web_editor: fix double unload popup
task-2710507

closes odoo/odoo#81820

X-original-commit: c32732c142f3a695703f0c60168e02a86374df44
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-23 09:37:08 +00:00
qsm-odoo acab821676 [FIX] web_editor: consider all remaining DOM changes before save
When clicking on save, the saved HTML should be what the user currently
sees. Before this commit, there might be cases where clicking on save
actually triggers a DOM update which occurs too late for the change to
be considered for the save. In 15.0, this manifests for example with
the blog cover saving*: if the color is being changed with the
colorpicker and that the user does not close the colorpicker before
saving, the color change is not considered because the previewMode=false
update of the colorpicker is not received. With this commit, we ensure
that DOM updates which occur because of the click on the save button
are considered before saving.

* That bug is however due to two other issues which are being fixed with
  the PR at [1].

[1]: https://github.com/odoo/odoo/pull/79028

closes odoo/odoo#81762

X-original-commit: 508332963202090bace0a3c877574132063c29a6
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-22 11:22:55 +00:00
David Monjoie 2d295d6c1f [FIX] web_editor: fix multiple editors removing each other hints
The previous code resulted in only the last editor to trigger its
handler having hints, as all the others would be killed by the last one.

closes odoo/odoo#81743

Task-id: 2632841
X-original-commit: e24b039ea120597ff5438deca3c69c7a1d54cd31
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-21 15:56:00 +00:00
qsm-odoo f7ad4ff8ec [IMP] web_editor, website: review s_popup drop-in selector
The final forward-port work merged in master at [1] should have been
adapted to avoid the JS "hack".

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

closes odoo/odoo#81699

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-20 19:16:55 +00:00
Benjamin Vrayandqsm-odoo e51cdc1e60 [FIX] web_editor: prevent dropping popup inside a substructure
Before this commit, it was possible to drag and drop a popup inside an
oe_structure which was itself inside an other oe_structure (e.g. snippet
parallax). It didn't make sense and moreover created bugs.

After this commit, it is no longer possible to drag and drop the popup
snippet or the newsletter popup snippet in a substructure.

task-2491976

closes odoo/odoo#81669

X-original-commit: 49050c124795852ce7ad51b92958498972730dcf
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2021-12-20 16:52:57 +00:00
Antoine Guenet c53ebf8244 [FIX] web_editor: prevent line breaks at edges of anchor on press enter
When pressing enter at the edge of an anchor that is a child of an
unbreakable element, we inserted line breaks in the anchor itself, which
is unexpected. This inserts the anchors after/before it instead.

closes odoo/odoo#81662

X-original-commit: df6f8dd0c54c40ea7edbd3821ae068d79b1b7af7
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-20 16:04:49 +00:00
Antoine Guenet d049e3d7d7 [FIX] web_editor: ensure snippet selection is kept when acting in it
The snippet selection was lost on every action in mass mailing. The code
that prevents that was checking if the target of a click was the body
element but for mass mailing we needed to be a little bit more
restrictive since the editable area is not the body itself and we want
to actually prevent changing the snippet selection when the target is
the iframe target as well.
Since the mailing itself has a options, the sidebar is actually never
empty and therefore removing a snippet doesn't bring us back to the
block tab. Since therefore also ensures that we actually do.

task-2716397

X-original-commit: ecdb71bf6a566f5f6c294904e84f2132561dbb3c
Part-of: odoo/odoo#81662
2021-12-20 16:04:49 +00:00
Arthur Detroux (ard) 583f7ceb2d [IMP] website, web_editor: provide clarity for theme colors
Prior to this commit, the color presets generated by the color palette
would always be visible by the user which could lead to confusion.
Most users would click on the presets and edit them instead of editing
the color palette.

This commit groups the presets into a collapsed section under the color
palette to incentivize the user to click on the color bubbles instead.

task-2687469

closes odoo/odoo#79921

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-17 16:57:57 +00:00
Arthur Detroux (ard) b7a110bf21 [IMP] web_editor: improve snippet search placeholder message
Tests showed that users didn't understand the goal of the search bar
above the snippets block under the tabs.

This commit changes the placeholder of the search bar to better
indicate its purpose.

task-2607728

closes odoo/odoo#81222

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-12-17 13:39:57 +00:00
qsm-odoo 037bc4c255 [FIX] web_editor: remove useless test-breaking warning
A console.warn instruction was added with [1] in case an user interacts
with an editor widget which does not declare any linked option method
(as it is most probably a dev mistake). We have cases where it makes
sense though, adding a custom button with more complex events and
interactions or simply in some strange custo. This warning prevents to
test those uncommon behaviors in a tour test (which is what following
commits of this PR are trying to do).

This commit simply removes the warning.

[1]: https://github.com/odoo/odoo/commit/be05ac7e2b8d866a72693b761f3bc8576d54e59e#diff-ffb61e86e6b8297ef8997f9c605de14de896b54161c032d88a80bbaeac4f89beR490

X-original-commit: 1b18747c7a328df142d7b2cf206a84c39d5eac05
Part-of: odoo/odoo#81557
2021-12-17 09:18:07 +00:00
Antoine Guenet 1f9f7a13d4 [FIX] web_editor: prevent traceback on remove flex styles
A traceback was triggered when removing flex styles in convert_inline.
This is fixed by iterating over the styles rather that over all keys of
the style object.

task-2697159

closes odoo/odoo#81540

X-original-commit: 18db94d9fc320c35e811d991fc4a32533d481083
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-12-16 15:58:25 +00:00
David Monjoie 8b1012a79d [FIX] web_editor: fix css rules computing everywhere
X-original-commit: bf9928d28818324c85318968a235d238398bca68
Part-of: odoo/odoo#81540
2021-12-16 15:58:24 +00:00
David Monjoie 096c3ab82f [FIX] web_editor: remove unneeded calls to jQuery html method
X-original-commit: 41788a90157e50659a338467b9e18113a467957c
Part-of: odoo/odoo#81540
2021-12-16 15:58:24 +00:00
David Monjoie c05b700bed [FIX] web_editor: properly export toInline
X-original-commit: c30029e0c5112a092441353873cc627c6b0bf94c
Part-of: odoo/odoo#81540
2021-12-16 15:58:24 +00:00
Antoine Guenet bd884ae51d [REF] web_editor, mass_mailing: abstract convert_inline function calls
This adds a `toInline` function that replaces the code that was
duplicated between convert_inline and mass_mailing_widget. The
duplication was confusing and error prone.

X-original-commit: 916582af2d707fc1aa462c6feffa3f5defda75a2
Part-of: odoo/odoo#81540
2021-12-16 15:58:23 +00:00
Antoine Guenet 770ea95b5b [REF] web_editor: reorder, rename and document convert_inline functions
This simply reorders (alphabetically and public/private), renames and
document (with docstrings) all functions of convert_inline.

X-original-commit: 970a3686b1f5edea97bbf86bf4fadc90cfe63357
Part-of: odoo/odoo#81540
2021-12-16 15:58:23 +00:00
Antoine Guenet de558e5da0 [REF] mass_mailing, web_editor: speed up class to inline conversion
When saving an email, its contents pass through convert_inline to ensure
wide e-mail client compatibility. One phase of that process is the
conversion of classes to inline styles, which involves parsing through
all the styles in all the stylesheets of the document, and matching them
with each element in the DOM. That is an extremely expensive process and
because of that, saving an e-mail can take a very long time depending on
how large the DOM is.
This refactors it for performance gains. Tested on an exaggeratingly big
DOM, what used to take about 12s now takes about 5s.

- The process of parsing through the document's stylesheets is now done
  on opening the email (about 500ms) rather than on saving it so we
  split the processing time between the two.
- When parsing the stylesheets, we now also preprocess them by grouping
  whatever can be grouped together and precomputing the specificity so
  as to sort them appropriately. This has the benefit of considerably
  reducing the number of rules to iterate over for each element (from
  11k+ to 3k+).
- In the process, some things were re-written for improved readability.

X-original-commit: 10e749537186dfb80aee1f2537f3b5804f66cfe5
Part-of: odoo/odoo#81540
2021-12-16 15:58:23 +00:00
Antoine Guenet 638d60460f [ADD] web_editor: unit tests for convert_inline
This provide tests for the main unit testable functions of
convert_inline, as well as a couple of test utils to that purpose.

X-original-commit: 6a17ff7442a8395663c3e215cc14c057c098d4b5
Part-of: odoo/odoo#81540
2021-12-16 15:58:22 +00:00
Antoine Guenet 6ec1f4cc4e [FIX] web_editor: include doctype in iframe
This introduces a doctype declaration in the initialization of html
fields iframes and wysiwyg iframes. That prevents the browser from
rendering in Quirks mode[1] which makes tables override the usual style
inheritance patterns. As a result, this fixes an issue with text colors
and alignments that were lost on converting divs to table structures.

[1] See https://developer.mozilla.org/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode

X-original-commit: da5cf4bcac696a73c33d856ac889342fe8670e65
Part-of: odoo/odoo#81540
2021-12-16 15:58:22 +00:00
Antoine Guenet b1c21a696d [FIX] web_editor: fix missing docstrings and hard-to-read code
This covers minor refactors in convert_inline, and adds docstrings to
some of its functions that were missing them.

X-original-commit: 7c67a703ac5874cbd05ab5e82f566499b1e07849
Part-of: odoo/odoo#81540
2021-12-16 15:58:22 +00:00
Antoine Guenet c9b30ede56 [FIX] web_editor: remove dead code in getMatchedCSSRules
There was a section of code in `getMatchedCSSRules` that didn't do
anything. Essentially its loop did `a === b ? a = b : break`. As for
what was done before the loop (a = b), it's what is done with the styles
returned by `getMatchedCSSRules` in `classToStyle`.

X-original-commit: 835dba6ec02f1eb4dc43c33fc3bd5eab08032707
Part-of: odoo/odoo#81540
2021-12-16 15:58:21 +00:00
Antoine Guenet 29fac54b14 [FIX] web_editor: properly add nested tables where needed
There was dead code in `addTables` that would never get triggered. When
fixing that, the code crashed because of a reference to the wrong
variable. Those two problems are hereby fixed.

X-original-commit: 21dccd1521c654eb9723a93bceda8e3e3ec8cc6a
Part-of: odoo/odoo#81540
2021-12-16 15:58:21 +00:00
Antoine Guenet fabfaff010 [FIX] web_editor: round px values converted from rem to 1 decimal place
When converting an rem size to a pixel size, we sometimes ended up with
values with many decimal places. This rounds them to one decimal place.

X-original-commit: 8f8d5bf93f60560040a37695c3439600d5d88287
Part-of: odoo/odoo#81540
2021-12-16 15:58:21 +00:00