Commit Graph
1114 Commits
Author SHA1 Message Date
mgh-odoo 1f57d4a34c [FIX] web_editor: FieldHtml commitChanges called too soon
The original issue appeared in mass_mailing where triggering the mail
template preview throws a client error.

This commit prevents commitChanges() from being called before the
element is rendered.

Task-ID: 1950784
2019-04-17 09:30:38 +00:00
Christophe Simonis e145f2b0c8 [MERGE] forward port branch saas-12.2 up to 2694174b41 2019-04-10 15:10:24 +02:00
Christophe Simonis 6c8e30cae6 [MERGE] forward port branch saas-12.1 up to 6d4940675f 2019-04-09 12:16:06 +02:00
Christophe Simonis 6d4940675f [MERGE] forward port branch 12.0 up to ea1fc124ef 2019-04-09 11:11:48 +02:00
Christophe Simonis fef49061ea [MERGE] forward port branch saas-11.3 up to 4c61621efb 2019-04-08 19:52:29 +02:00
Christophe Simonis 4c61621efb [MERGE] forward port branch 11.0 up to 9a7e3c8b49 2019-04-08 17:45:00 +02:00
Christophe Simonis 3f95b074e9 [MERGE] forward port branch saas-12.2 up to f2be461f09 2019-04-05 18:46:10 +02:00
Martin Geubelle f391b8c5a5 [FIX] web_editor: restore ace style
The recent refactoring odoo/odoo@f296992 wrongly moved the ace editor
style from `web_editor` to `website`, even though ace is in `«eb_editor`.

The editor is also used in Studio (which does not depend on website) so
the style was missing in this case.

Task 1951290

closes odoo/odoo#32384

Signed-off-by: Christophe Matthieu <Gorash@users.noreply.github.com>
2019-04-03 12:46:57 +00:00
Antoine Guenet 028a03b8f1 [FIX] web_editor: do nothing on select all with empty editable
Ctrl-A on an empty editable threw an error. This fixes it.

closes odoo/odoo#32301

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-04-01 12:59:41 +00:00
Christophe Simonis 5dbf7bf357 [MERGE] forward port branch saas-12.1 up to f00c490be8 2019-03-26 10:33:26 +01:00
Christophe Simonis f00c490be8 [MERGE] forward port branch 12.0 up to 11b1e12cde 2019-03-25 19:45:26 +01:00
Christophe Simonis 11b1e12cde [MERGE] forward port branch saas-11.3 up to e9068c290b 2019-03-25 18:28:16 +01:00
Christophe Simonis e9068c290b [MERGE] forward port branch 11.0 up to 0196a6feb5 2019-03-25 16:47:05 +01:00
Nicolas Lempereur e1b1d3cd1b [FIX] web_editor: no lose tooltip on selection
The editor has a tooltip editor wizard "Change media description and
tooltip", but when selecting an image there is also a tooltip:

  "Double-click to edit"

added by the editor.

The combination of the two break the functionality, eg:

- if a tooltip is set with editor, then selecting the tooltip: we see
  the set tooltip and not "Double-click to edit"

- if a tooltip is set with editor, then selecting the image back, then
  opening the tooltip editor => the set tooltip is lost

With this changeset, we just do not show "Double-click to edit" tooltip
if there is a tooltip set on the element.

opw-1946801
closes #32482

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-04-08 08:17:57 +00:00
Christophe Simonis e3f5f17561 [MERGE] forward port branch saas-15 up to 214e819c1b 2019-04-04 20:07:27 +02:00
Christophe Simonis 214e819c1b [MERGE] forward port branch saas-14 up to 6e0c89867e 2019-04-04 19:34:35 +02:00
Christophe Simonis 6e0c89867e [MERGE] forward port branch 10.0 up to 60592561d7 2019-04-04 18:33:42 +02:00
qsm-odoo 60592561d7 [FIX] web_editor: support youtube-nocookie.com
closes odoo/odoo#32332

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-04-04 09:21:09 +00:00
Julien Castiaux e9026bd522 [FIX] web_editor: editor hang on an infinite loop
In the `getMatchedCSSRule`, the transcoder try to find the real value of
a `text-align: inherit` css rule by ascending the html tree until it
finds a `text-align` with a meaningful value. By default is exits if it
reachs the `<html>` top node but doesn't exit if a call to `.parent()`
exits the dom (the behavior of jquery is to return a dummy element when
calling `.parent()` on an element that has no parent). This lead to an
infinite loop for badly formatted html content.

opw-1951095

closes odoo/odoo#32014

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2019-03-21 13:45:12 +00:00
qsm-odoo c8339ce10e [FIX] web_editor: remove we validation icons
Since the bootstrap update to 4.2.1 (which was made with
https://github.com/odoo/odoo/commit/63e52e6acfabb927aad6eaf7b020520dc206e50f)
bootstrap includes automatic validation icons when a form is validated.

This allows to remove the Odoo custom ones in the editor (which appeared
on top of the bootstrap ones).

closes odoo/odoo#32051

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-22 13:40:12 +00:00
Christophe Simonis 4eff0af02e [MERGE] forward port branch saas-12.1 up to 6878c9f342 2019-03-21 13:58:37 +01:00
Pierre Paridans 45e3e432a3 [FIX] web_editor: html field with long links
Following the refactoring of the web_editor (JS & CSS) when adding a
long link in a task's description the line starts to overflow from the
field and create an horizontal scroll.

This commit restores the CSS word-wrap properties to the form field html
allowing to nicely break the line on a word basis, preventing a possible
overflow.

Also it doesn't make sense to apply it on an iframe.

Task ID: 1942179

closes odoo/odoo#31988

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-03-21 08:53:51 +00:00
qsm-odoo 36289e77ba [FIX] web_editor: restore theme responsive spacing
The factor parameter of the mixin in charge of generating the spacing
classes was not correctly used.

closes odoo/odoo#31996

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-20 15:48:34 +00:00
qsm-odoo 92f8a3c9ef [FIX] web_editor: review drag and drop in the editor
Forward-port of https://github.com/odoo/odoo/commit/be689c53c13330832510c8cef332ac862d4ed5e8
was missed from 11.0.

closes odoo/odoo#31971

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-20 10:15:49 +00:00
Christophe Simonis c50d7d6bc5 [MERGE] forward port branch 12.0 up to 82c4393fd0 2019-03-19 15:14:23 +01:00
qsm-odoo 2a39ab0579 [FIX] web_editor: handle snippet option submenus of submenus
Commit https://github.com/odoo/odoo/commit/8ca92330b367d54fddf1c02089ee9d0bc3edbfdc
did not think about submenus inside submenus, which is the case in the
website animate option. This made snippets potentially have multiple
animations on them, with undesired behaviors.

This commit also accordingly reviews the _setActive method for the
select-class option and also adapts following the recent forward-port of
https://github.com/odoo/odoo/pull/31440

Related to task-1929133

closes odoo/odoo#31477

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-03-15 13:58:50 +00:00
Christophe Simonis bd63913326 [MERGE] forward port branch saas-11.3 up to 4e39328a76 2019-03-18 20:03:24 +01:00
Christophe Simonis 71faa19af0 [MERGE] forward port branch saas-12.1 up to 2b3296bbf8 2019-03-11 14:42:34 +01:00
Christophe Simonis 2c5c9b8342 [MERGE] forward port branch 12.0 up to c023d0784f 2019-03-08 17:56:14 +01:00
Antoine Guenet c9b1401a23 [FIX] web_editor: update the handle on click input node in website edit
When clicking on a snippet containing an input node on Firfeox, the
handle wouldn't appear as expected. This is due to trying JQuery (but
not only) trying to modify properties that are restricted on Firefox but
not on Chrome. The error message still appears from time to time due to
Summernote using `document.getSelection`, which is problematic with
Firefox. This will be fixed with the next version of the editor. In the
meantime the direct effect of that error (the handle issue) is fixed
with this commit.

The standard target (`Event.target`) is now looked for in first position
instead of non-standard 'Event.srcElement` (IE alias for `Event.target`)
then `Event.originalTarget` (Mozilla-specific) and finally
`Event.target` (standard). `Event.originalTarget` is restricted on
Firefox so it was giving the same cryptic error as mentioned above
("Error: Permission denied to access property", which generally points
to same-origin policy violations).

Ref:
- https://developer.mozilla.org/en-US/docs/Web/API/Event/srcElement
- https://developer.mozilla.org/en-US/docs/Web/API/Event/originalTarget
- https://developer.mozilla.org/en-US/docs/Web/API/Event/target
- https://developer.mozilla.org/en-US/docs/Web/API/Window/getSelection#Related_objects
- https://developer.mozilla.org/en-US/docs/web/javascript/reference/errors/property_access_denied

closes odoo/odoo#31710

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-03-08 14:41:49 +00:00
Christophe Simonis 3e54704e66 [MERGE] forward port branch 11.0 up to 27081bf6f5 2019-03-05 17:26:04 +01:00
mgh-odoo f217aa528f [FIX]web_editor: Fixed traceback due to 'field_html' widget while saving record
Previously, when user edited record having 'field_html' widget and
tried to save the record immediately, a traceback was faced sometimes
because content was not loaded yet. This commit fixes the issue
by calling super method if the content is not loaded yet properly.

Task: #1932687
Closes: #30833

closes odoo/odoo#31581

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-05 09:09:33 +00:00
Antoine Guenet 0374ecaeb8 [FIX] web_editor: properly set media dialog onlyImages and find video
Media dialog was trying to reach the current media's parent node, which
was not possible as it was cloned on instantiation.
To fix this, the `showImageDialog` now passes the `onlyImages` option
upon instantiation, checking the parent's data. It also passes the
media's parent if said parent is a video. This way, neither of these two
things need to be done in media dialog.

closes odoo/odoo#31634

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-03-06 12:51:41 +00:00
Gorash e797d7a3c3 [FIX] web_editor: wrong focus detection in the editor
Issue detected with tests in the branch that replace deferred by native
Promise. Need to add isMedia to detect if the target is already a media
when focus the editor.

closes odoo/odoo#31632

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-03-06 12:33:36 +00:00
Gorash a8e95217c9 [FIX] web_editor: Expose focus method for activate method of html field
closes odoo/odoo#31577

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-04 08:41:09 +00:00
Gorash 972a1c9920 [FIX] web_editor: Evoid the risk of deleting the summernote library
For iframes, we need to inject summernote because there are references
to "document" in it. When loading the iframe, if it is canceled, there
is a risk that the library is erased and that it breaks the field html.
We must also slightly modify the library to prevent it from making
changes to the library of the main "window".
2019-03-04 08:33:53 +00:00
qsm-odoo 395c169db9 [FIX] web_editor: wait for animation end before covering snippets
Part of https://github.com/odoo/odoo/pull/31440
opw-1929133

closes odoo/odoo#31440
2019-03-01 13:52:14 +00:00
qsm-odoo 8405c7f5fa [FIX] web_editor: properly check snippet options
Commit https://github.com/odoo/odoo/commit/c2b8d2a3017256e4ea60a3710bdaab6d1f693d81
made the mistake of considering each dropdown-menu individually while
all are considered to be the same when enabling a class. From saas-11.x,
commit https://github.com/odoo/odoo/commit/8ca92330b367d54fddf1c02089ee9d0bc3edbfdc
will group by dropdown menu but that will be another fix to make.

Part of https://github.com/odoo/odoo/pull/31440
opw-1929133
2019-03-01 13:52:14 +00:00
Christophe Simonis 0e7675847f [MERGE] forward port branch saas-12.1 up to 0f4abc5c22 2019-02-22 16:25:02 +01:00
Christophe Simonis 1d2b6f1bef [MERGE] forward port branch 12.0 up to 84143a34b3 2019-02-21 15:37:19 +01:00
Antoine Guenet 4339101afe [IMP] web_editor: add tests for deleting all contents of format block
Implementing new behavior on delete all contents of a format block
revealed insufficient testing, which is now covered.

closes odoo/odoo#31277
2019-02-21 09:13:32 +00:00
Antoine Guenet 2a010c38f3 [FIX] web_editor: remove broken and unnecessary test
The next test was identical to the removed one, with the exception that
it inserts a character at the end, which really is the behavior we want
to test. The removed test was broken because it expected the range on
the parent, which is anyway equivalent in this case. This is confirmed
by the fact that inserting a character at either ranges indeed inserts
the character where it is expected to do so.
2019-02-21 09:13:31 +00:00
Antoine Guenet 00a78af98e [FIX] web_editor: stop removing empty block after deleting its contents
Deleting all the contents of a block node replaced it with a blank
paragraph node. To restore v12 behavior, it should only do that when
pressing backspace in an already empty block, which is now what it does.
2019-02-21 09:13:30 +00:00
Antoine Guenet 8b8d6d0a5b [FIX] web_editor: do nothing on save if no media was selected in modal
When in the media modal, if one selected no media but clicked the "ADD"
button it resulted in an error and a failed RPC instead of simply
closing the modal without doing anything. v12 behavior is now restored.

closes odoo/odoo#31308
2019-02-21 07:32:38 +00:00
Gorash 05c095a73b [FIX] website: edition of links on safari and firefox is now possible
closes odoo/odoo#31629

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-03-07 16:03:03 +00:00
Antoine Guenet 6c38ed2f8d [FIX] web_editor: open the link modal on dblclick button descendent
The link modal only opened on double-click directly on an anchor,
meaning that double-clicking text in a span node within the button (as
is the case in the call-to-action snippet for instance) wouldn't open
the modal.
Now it opens as long as we have an ancestor that is an anchor, unless
the double-click occurs on a media (eg: a pictogram), in which case it
should open the media's modal.

closes odoo/odoo#31229
2019-02-19 09:56:32 +00:00
Christophe Simonis 6b4758cd9a [MERGE] forward port branch saas-12.2 up to 7c1a9a8204 2019-03-27 14:29:01 +01:00
Raphael Collet 1ced3bfca4 [FIX] *: pass context in kwargs in rpc calls 2019-03-22 16:42:08 +00:00
Christophe Simonis 5df4746c9a [MERGE] forward port branch saas-12.2 up to 230ad8c381
closes odoo/odoo#32088

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-25 11:13:41 +00:00
Christophe Simonis 44515bc7be [MERGE] forward port branch saas-12.2 up to c9f832d9f0
closes odoo/odoo#31790

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-13 14:24:51 +00:00