<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/web_editor/static/src/js/editor/rte.summernote.js, branch 14.0</title>
<subtitle>The current checkout of upstream Odoo</subtitle>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/'/>
<entry>
<title>[FIX] website_forum: show normal image modal in forum</title>
<updated>2021-03-17T13:13:57+00:00</updated>
<author>
<name>Nicolas Lempereur</name>
<email>nle@odoo.com</email>
</author>
<published>2021-03-16T12:25:06+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=063421353b3093421bfe2587ba60b38bc1760671'/>
<id>063421353b3093421bfe2587ba60b38bc1760671</id>
<content type='text'>
In #67893 the image icon was removed, but it contradicts the interface
and made a feature that was working for employee less available.

Since saas-12.3, we always use the full media dialog when showing the
editor on the forum so we could not add an image with the image icon if
were not an employee.

Before saas-12.3, the original summernote image dialog was shown for
everyone but website editor that saw the full media dialog (beecause we
are using the same editor to do both things).

With this change, we always have the original dialog in the forum
message editor thanks to a new option "disableFullMediaDialog".

opw-2470720

closes odoo/odoo#68018

X-original-commit: 74af23fb0be60c996503ad599eb96bc2ab4d64f9
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In #67893 the image icon was removed, but it contradicts the interface
and made a feature that was working for employee less available.

Since saas-12.3, we always use the full media dialog when showing the
editor on the forum so we could not add an image with the image icon if
were not an employee.

Before saas-12.3, the original summernote image dialog was shown for
everyone but website editor that saw the full media dialog (beecause we
are using the same editor to do both things).

With this change, we always have the original dialog in the forum
message editor thanks to a new option "disableFullMediaDialog".

opw-2470720

closes odoo/odoo#68018

X-original-commit: 74af23fb0be60c996503ad599eb96bc2ab4d64f9
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: don't save cropping tool on CTRL+Z</title>
<updated>2021-02-18T13:05:48+00:00</updated>
<author>
<name>Nicolas Lempereur</name>
<email>nle@odoo.com</email>
</author>
<published>2021-02-18T12:59:28+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=ce93cbd78e282e6957aaeba6f06945f94bfffb26'/>
<id>ce93cbd78e282e6957aaeba6f06945f94bfffb26</id>
<content type='text'>
Scenario:

- start cropping of an image
- press TAB key
- do CTRL + Z

=&gt; now the image cropping tool are inside the page and there is no way
to remove them.

Why:

The image crop tool was added inside the editable elemnt, so if we did
an action that changed history the cropping tools are saved in the
snapshot and going back to it will add them without any code handling
their removal.

opw-2394877
opw-2423445

closes odoo/odoo#66462

Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Scenario:

- start cropping of an image
- press TAB key
- do CTRL + Z

=&gt; now the image cropping tool are inside the page and there is no way
to remove them.

Why:

The image crop tool was added inside the editable elemnt, so if we did
an action that changed history the cropping tools are saved in the
snapshot and going back to it will add them without any code handling
their removal.

opw-2394877
opw-2423445

closes odoo/odoo#66462

Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: solve bold command issues</title>
<updated>2021-01-13T12:50:30+00:00</updated>
<author>
<name>qsm-odoo</name>
<email>qsm@odoo.com</email>
</author>
<published>2020-07-29T13:46:54+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=ff319d1ac02fd4588ae672bd00d0c15eeba518fc'/>
<id>ff319d1ac02fd4588ae672bd00d0c15eeba518fc</id>
<content type='text'>
Summernote uses execCommand and, worth, obsolete queryCommandState
function to customize the edited content. Here we try to hack the
function to solve some problems by making the DOM and style easier to
understand for the base functions for the duration of their executions.
This won't obviously solves all problems but this is an improvement
while waiting for the new Odoo editor coming in future versions.

The original problem this solves is handling bold text in blog posts.
Posts are using font-weight: 300 which is enough to confuse summernote.
Hitting bold on a selected paragraph wraps its content in a &lt;b&gt; tag but
hitting bold again does nothing... having a &lt;b&gt; rendered as fw-400 is
enough to break it. What this commit does is: before any execCommand or
queryCommandState being used to modify the DOM or retrieve its state,
the whole DOM is forced to fw-400 and &lt;b&gt; elements to fw-700. This also
solves issues in some base snippets.

closes odoo/odoo#64472

X-original-commit: 424d9661c5657cbcf10ce40acb94a7a200c2a48b
Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summernote uses execCommand and, worth, obsolete queryCommandState
function to customize the edited content. Here we try to hack the
function to solve some problems by making the DOM and style easier to
understand for the base functions for the duration of their executions.
This won't obviously solves all problems but this is an improvement
while waiting for the new Odoo editor coming in future versions.

The original problem this solves is handling bold text in blog posts.
Posts are using font-weight: 300 which is enough to confuse summernote.
Hitting bold on a selected paragraph wraps its content in a &lt;b&gt; tag but
hitting bold again does nothing... having a &lt;b&gt; rendered as fw-400 is
enough to break it. What this commit does is: before any execCommand or
queryCommandState being used to modify the DOM or retrieve its state,
the whole DOM is forced to fw-400 and &lt;b&gt; elements to fw-700. This also
solves issues in some base snippets.

closes odoo/odoo#64472

X-original-commit: 424d9661c5657cbcf10ce40acb94a7a200c2a48b
Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: fix replacing media leaving unexpected elements</title>
<updated>2021-01-07T17:45:49+00:00</updated>
<author>
<name>Samuel Degueldre</name>
<email>sad@odoo.com</email>
</author>
<published>2020-11-09T13:20:45+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=f23806e1e768e65873ec578e5135a430ade7aa68'/>
<id>f23806e1e768e65873ec578e5135a430ade7aa68</id>
<content type='text'>
Previously, changing a media from a video/icon/document to a different
type would leave empty elements in the DOM, this is because summernote's
range API `range.insertNode` function deletes the content but not the
structure (HTML elements).

This commit fixes that by using jQuery's replaceWith method instead of
summernote's insertNode when a media was found, and only using
summernote in case no media was found (eg. a text range).

Part of: odoo/odoo#60450

X-original-commit: 63f80995a05eeab1061b769c7733a1cfa98c726e</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, changing a media from a video/icon/document to a different
type would leave empty elements in the DOM, this is because summernote's
range API `range.insertNode` function deletes the content but not the
structure (HTML elements).

This commit fixes that by using jQuery's replaceWith method instead of
summernote's insertNode when a media was found, and only using
summernote in case no media was found (eg. a text range).

Part of: odoo/odoo#60450

X-original-commit: 63f80995a05eeab1061b769c7733a1cfa98c726e</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: stop suggesting shapes for model-related images</title>
<updated>2020-12-24T13:21:20+00:00</updated>
<author>
<name>qsm-odoo</name>
<email>qsm@odoo.com</email>
</author>
<published>2020-12-22T11:17:56+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=dca6d7382e5d84997648952d442ad77df5d6ee82'/>
<id>dca6d7382e5d84997648952d442ad77df5d6ee82</id>
<content type='text'>
Those kind of images use a specific route (/web_editor/shape/...) to
be fetched. While waiting for a more complete solution to maybe handle
them for model-related images, this commit only allows their use for
images in views and HTML fields.

closes odoo/odoo#63682

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Those kind of images use a specific route (/web_editor/shape/...) to
be fetched. While waiting for a more complete solution to maybe handle
them for model-related images, this commit only allows their use for
images in views and HTML fields.

closes odoo/odoo#63682

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: disable embedded video for html fields in backend</title>
<updated>2020-10-21T15:59:35+00:00</updated>
<author>
<name>IEL</name>
<email>iel@odoo.com</email>
</author>
<published>2020-10-21T08:52:22+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=746bf53b4aecfc601f0581a948d7cb7153812c82'/>
<id>746bf53b4aecfc601f0581a948d7cb7153812c82</id>
<content type='text'>
TLDR: the videos doesn't work anyway, but nobody noticed it for years; at the
same time there is no easy way to fix it

STEPS:

* create a record with html field, e.g. project.task
* add an embedded video (File/Image icon)
* save

BEFORE: video doesn't work

AFTER: there is no option to add embedded video anymore

WHY:

* iframe tags are removed before storing html in database, so after saving a
record, embedded video doesn't work anymore
* possible fixes look too tricky for stable branches:

  * new field attribute sanitize_iframe=False -- requires changes in core python framework which may have side effect

  * adding iframe on client side -- the problem is that the backend doesn't
  have mechanism to use animation in html fields like it's done in
  website: https://github.com/odoo/odoo/blob/ced500e9bcbb5c84033463689d135ad4c7dc4f39/addons/website/static/src/js/content/snippets.animation.js#L623-L632

  * adding iframe on server side -- parsing html fields in _read... Doesn't look good either

* double selector is required to make it work both in frontend and backend:

      $editable.closest('.o_editable, .note-editor')

* we don't need hardcoded exception for mailing.mailing, mail.compose.message
because those fields marked as sanitized (default value)

  https://github.com/odoo/odoo/blob/c92f058571b0656451f24e24154dd1bdb3bdb48a/odoo/fields.py#L1589-L1590
  https://github.com/odoo/odoo/blob/c92f058571b0656451f24e24154dd1bdb3bdb48a/addons/mail/wizard/mail_compose_message.py#L115
  https://github.com/odoo/odoo/blob/61734cdaf1cf6857125b1ece63928ab080359c6c/addons/mass_mailing/models/mailing.py#L77

* I don't apply this for Odoo 12, because js is refactored in Odoo 13 (e.g.
field_html.js has another name in Odoo 12)

---

opw-2353103

closes odoo/odoo#60474

X-original-commit: 2dcbac08effcedafbcf50610355752030902b16d
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
Signed-off-by: Ivan Yelizariev // IEL &lt;yelizariev@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
TLDR: the videos doesn't work anyway, but nobody noticed it for years; at the
same time there is no easy way to fix it

STEPS:

* create a record with html field, e.g. project.task
* add an embedded video (File/Image icon)
* save

BEFORE: video doesn't work

AFTER: there is no option to add embedded video anymore

WHY:

* iframe tags are removed before storing html in database, so after saving a
record, embedded video doesn't work anymore
* possible fixes look too tricky for stable branches:

  * new field attribute sanitize_iframe=False -- requires changes in core python framework which may have side effect

  * adding iframe on client side -- the problem is that the backend doesn't
  have mechanism to use animation in html fields like it's done in
  website: https://github.com/odoo/odoo/blob/ced500e9bcbb5c84033463689d135ad4c7dc4f39/addons/website/static/src/js/content/snippets.animation.js#L623-L632

  * adding iframe on server side -- parsing html fields in _read... Doesn't look good either

* double selector is required to make it work both in frontend and backend:

      $editable.closest('.o_editable, .note-editor')

* we don't need hardcoded exception for mailing.mailing, mail.compose.message
because those fields marked as sanitized (default value)

  https://github.com/odoo/odoo/blob/c92f058571b0656451f24e24154dd1bdb3bdb48a/odoo/fields.py#L1589-L1590
  https://github.com/odoo/odoo/blob/c92f058571b0656451f24e24154dd1bdb3bdb48a/addons/mail/wizard/mail_compose_message.py#L115
  https://github.com/odoo/odoo/blob/61734cdaf1cf6857125b1ece63928ab080359c6c/addons/mass_mailing/models/mailing.py#L77

* I don't apply this for Odoo 12, because js is refactored in Odoo 13 (e.g.
field_html.js has another name in Odoo 12)

---

opw-2353103

closes odoo/odoo#60474

X-original-commit: 2dcbac08effcedafbcf50610355752030902b16d
Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
Signed-off-by: Ivan Yelizariev // IEL &lt;yelizariev@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: restore background and foreground color previews</title>
<updated>2020-09-28T15:31:14+00:00</updated>
<author>
<name>qsm-odoo</name>
<email>qsm@odoo.com</email>
</author>
<published>2020-09-28T15:26:49+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=19be84634d394f47ceb882c5ddd24585f31b50ae'/>
<id>19be84634d394f47ceb882c5ddd24585f31b50ae</id>
<content type='text'>
Forward-port of [1] for the custom text tools for the website editor.
Still has to be improved with the future text tools.

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

Part of https://github.com/odoo/odoo/pull/58638

closes odoo/odoo#58638

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Forward-port of [1] for the custom text tools for the website editor.
Still has to be improved with the future text tools.

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

Part of https://github.com/odoo/odoo/pull/58638

closes odoo/odoo#58638

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor, *: show text tools in style tab only</title>
<updated>2020-09-28T15:09:44+00:00</updated>
<author>
<name>qsm-odoo</name>
<email>qsm@odoo.com</email>
</author>
<published>2020-09-28T11:07:30+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=0f65015b1b0a849bf109df11fd18a9e3a62820e4'/>
<id>0f65015b1b0a849bf109df11fd18a9e3a62820e4</id>
<content type='text'>
*: website

As the text editor is still the summernote one, this improvement was
made possible through a series of hack. It has to be reviewed once the
new editor is ready.
This makes the text tools only appear in the style tab by switching to
it as soon as the summernote tools are updated. To prevent flickering,
css and js hacks had to be made.

This also moves the undo/redo buttons in the top bar with another hack:
those simulates click on the hidden summernote ones.

Part of https://github.com/odoo/odoo/pull/58638</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
*: website

As the text editor is still the summernote one, this improvement was
made possible through a series of hack. It has to be reviewed once the
new editor is ready.
This makes the text tools only appear in the style tab by switching to
it as soon as the summernote tools are updated. To prevent flickering,
css and js hacks had to be made.

This also moves the undo/redo buttons in the top bar with another hack:
those simulates click on the hidden summernote ones.

Part of https://github.com/odoo/odoo/pull/58638</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web_editor, *: move image optimization feature to left-panel</title>
<updated>2020-06-05T18:11:53+00:00</updated>
<author>
<name>Samuel Degueldre</name>
<email>sad@odoo.com</email>
</author>
<published>2020-05-19T09:21:49+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=aa8d2a8be2c8f713b4b39b2aa1ea2aaf1839396c'/>
<id>aa8d2a8be2c8f713b4b39b2aa1ea2aaf1839396c</id>
<content type='text'>
*: website, mass_mailing

In continuity with the nline crop, in an effort to make the image
workflow as seamless as possible in the website editor, the image
optimization feature has been moved out of the modal which could be
opened through the media-dialog and into the left panel.

This commit adds a quality slider and a width selector, as well as a
preview of the image's weight to the left panel, and removes the
image_optimize dialog.

This commit also introduces the possibility to add a color filter on
images.

Part of https://github.com/odoo/odoo/pull/51517
task-2192755

closes odoo/odoo#51517

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
*: website, mass_mailing

In continuity with the nline crop, in an effort to make the image
workflow as seamless as possible in the website editor, the image
optimization feature has been moved out of the modal which could be
opened through the media-dialog and into the left panel.

This commit adds a quality slider and a width selector, as well as a
preview of the image's weight to the left panel, and removes the
image_optimize dialog.

This commit also introduces the possibility to add a color filter on
images.

Part of https://github.com/odoo/odoo/pull/51517
task-2192755

closes odoo/odoo#51517

Signed-off-by: Quentin Smetz (qsm) &lt;qsm@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web_editor, *: change image cropping from modal to inline widget</title>
<updated>2020-06-05T18:11:42+00:00</updated>
<author>
<name>Samuel Degueldre</name>
<email>sad@odoo.com</email>
</author>
<published>2020-03-31T07:10:34+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=c2de755bc690987f59cda27bd83a7429278955fc'/>
<id>c2de755bc690987f59cda27bd83a7429278955fc</id>
<content type='text'>
*: base

Previously, cropping an image was done inside of a modal window, turning
it into an inline widget makes the editor feel more integrated and
allows you to better see the result of cropping directly in the page,
it's also less intrusive to the user's edition workflow.

At the same time, the way cropped images are saved was refactored to use
the new original_id field on ir_attachment, as the old system was
creating problems.

Part of https://github.com/odoo/odoo/pull/51517
task-2192755</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
*: base

Previously, cropping an image was done inside of a modal window, turning
it into an inline widget makes the editor feel more integrated and
allows you to better see the result of cropping directly in the page,
it's also less intrusive to the user's edition workflow.

At the same time, the way cropped images are saved was refactored to use
the new original_id field on ir_attachment, as the old system was
creating problems.

Part of https://github.com/odoo/odoo/pull/51517
task-2192755</pre>
</div>
</content>
</entry>
</feed>
