<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/web_editor/static/src/js/wysiwyg/plugin/keyboard.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>[REV] wev_editor, website: revert saas-12.2 editor</title>
<updated>2019-08-21T18:52:36+00:00</updated>
<author>
<name>Gorash</name>
<email>chm@odoo.com</email>
</author>
<published>2019-08-20T06:23:06+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=35b61822a8b12ebbdb455495479df6f2e13db03e'/>
<id>35b61822a8b12ebbdb455495479df6f2e13db03e</id>
<content type='text'>
This commit reverts the saas-12.2 editor by putting back the editor
of Odoo 12.

The saas-12.2 editor was an intermediate work between the previous
editor of Odoo 12 and the new one slated for Odoo 13. It was unstable
but it was supposed to be replaced by the new editor of version 13.

However, since the new editor has been postponed to Odoo 14, the
saas-12.2 one would have been staying in Odoo 13, which would have
been a nightmare to maintain. To avoid this outcome, we chose to
put back the 12.0 editor in its place.

This has the particular advantage that Odoo 13 will share the same
bugfixes as Odoo 12 and 11 as they all run under the same core
editor, while the saas-12.2 one would have been an entirely
different beast to maintain.

This is a partial revert of f2969923.

Part of PR 35677.

Co-authored-by: Nicolas Bayet &lt;nby@odoo.com&gt;
Co-authored-by: Antoine Guenet &lt;age@odoo.com&gt;
Co-authored-by: Christophe Matthieu &lt;chm@odoo.com&gt;
Co-authored-by: David Monjoie &lt;dmo@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit reverts the saas-12.2 editor by putting back the editor
of Odoo 12.

The saas-12.2 editor was an intermediate work between the previous
editor of Odoo 12 and the new one slated for Odoo 13. It was unstable
but it was supposed to be replaced by the new editor of version 13.

However, since the new editor has been postponed to Odoo 14, the
saas-12.2 one would have been staying in Odoo 13, which would have
been a nightmare to maintain. To avoid this outcome, we chose to
put back the 12.0 editor in its place.

This has the particular advantage that Odoo 13 will share the same
bugfixes as Odoo 12 and 11 as they all run under the same core
editor, while the saas-12.2 one would have been an entirely
different beast to maintain.

This is a partial revert of f2969923.

Part of PR 35677.

Co-authored-by: Nicolas Bayet &lt;nby@odoo.com&gt;
Co-authored-by: Antoine Guenet &lt;age@odoo.com&gt;
Co-authored-by: Christophe Matthieu &lt;chm@odoo.com&gt;
Co-authored-by: David Monjoie &lt;dmo@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: Do not remove block</title>
<updated>2019-08-07T15:00:25+00:00</updated>
<author>
<name>Goaman</name>
<email>nby@odoo.com</email>
</author>
<published>2019-08-07T10:13:13+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=b384a00fe26131d716dd0c87f3fcf0a164f95aee'/>
<id>b384a00fe26131d716dd0c87f3fcf0a164f95aee</id>
<content type='text'>
Do not remove block in _removeNextEmptyUnbreakable.

Before this commit, when you tried to remove insert a character in
a td, with an empty td after the first one. The function
_removeNextEmptyUnbreakable removed the empty td. It was for
example breaking snippet in the website and mass_mailing.

closes odoo/odoo#32096

Signed-off-by: Adrien Dieudonné (adr) &lt;adr@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Do not remove block in _removeNextEmptyUnbreakable.

Before this commit, when you tried to remove insert a character in
a td, with an empty td after the first one. The function
_removeNextEmptyUnbreakable removed the empty td. It was for
example breaking snippet in the website and mass_mailing.

closes odoo/odoo#32096

Signed-off-by: Adrien Dieudonné (adr) &lt;adr@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: disable custom handling for Safari MacOS</title>
<updated>2019-08-07T10:09:28+00:00</updated>
<author>
<name>David Monjoie</name>
<email>dmo@odoo.com</email>
</author>
<published>2019-08-07T09:04:35+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=d0e80593304415b605bc28f00239a391604a4fcf'/>
<id>d0e80593304415b605bc28f00239a391604a4fcf</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: remove virtual corrector/completion keyboard glitch</title>
<updated>2019-08-06T10:45:04+00:00</updated>
<author>
<name>Gorash</name>
<email>chm@odoo.com</email>
</author>
<published>2019-03-21T12:16:01+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=8e4b8be4e6465204038798db137451c95a8050b6'/>
<id>8e4b8be4e6465204038798db137451c95a8050b6</id>
<content type='text'>
For the ours need, we can not let the contentEditable behavior. Indeed,
this one does not have the same behavior according to the browser. The
DOM node could be erase, merge, cut, in them according to the keyboard
interactions. The problem is that if we have to manage these behaviors,
we have to manage everything. It was already the case in the previous
version, however before we created an editor by zone and by a hack we
mix the history.
In the case of the virtual keyboard of some OS / Phone, the events are
different and the autocompletion does not update (bug that prevents
modification interactions with javascript). In order to solve these
problems, we use another event for the insertion of the characters.
However, we must also force the update of the corrector by forcing a blur
and a focus.
The current version is a temporary version. We are currently working on a
version that uses a virtual dom and does not need to do excessive prevent
default.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
For the ours need, we can not let the contentEditable behavior. Indeed,
this one does not have the same behavior according to the browser. The
DOM node could be erase, merge, cut, in them according to the keyboard
interactions. The problem is that if we have to manage these behaviors,
we have to manage everything. It was already the case in the previous
version, however before we created an editor by zone and by a hack we
mix the history.
In the case of the virtual keyboard of some OS / Phone, the events are
different and the autocompletion does not update (bug that prevents
modification interactions with javascript). In order to solve these
problems, we use another event for the insertion of the characters.
However, we must also force the update of the corrector by forcing a blur
and a focus.
The current version is a temporary version. We are currently working on a
version that uses a virtual dom and does not need to do excessive prevent
default.</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: uncheck new checklist item on split</title>
<updated>2019-04-15T11:40:05+00:00</updated>
<author>
<name>Antoine Guenet</name>
<email>age@odoo.com</email>
</author>
<published>2019-04-15T11:40:05+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=17aff7b59b7b5e997da14a00e0df1d2ed7c16164'/>
<id>17aff7b59b7b5e997da14a00e0df1d2ed7c16164</id>
<content type='text'>
On ENTER in a checklist item, a new checklist item is created. The new
one should never be checked. This ensures that ENTER in a checked
checklist item never creates a checked checklist item but instead cleans
the class.

closes odoo/odoo#32684

Signed-off-by: Pierre Paridans &lt;pparidans@users.noreply.github.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On ENTER in a checklist item, a new checklist item is created. The new
one should never be checked. This ensures that ENTER in a checked
checklist item never creates a checked checklist item but instead cleans
the class.

closes odoo/odoo#32684

Signed-off-by: Pierre Paridans &lt;pparidans@users.noreply.github.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: do nothing on select all with empty editable</title>
<updated>2019-04-01T12:59:41+00:00</updated>
<author>
<name>Antoine Guenet</name>
<email>age@odoo.com</email>
</author>
<published>2019-04-01T12:59:41+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=028a03b8f107b3ecbee8933921214d111a5f677c'/>
<id>028a03b8f107b3ecbee8933921214d111a5f677c</id>
<content type='text'>
Ctrl-A on an empty editable threw an error. This fixes it.

closes odoo/odoo#32301

Signed-off-by: Adrien Dieudonné (adr) &lt;adr@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Ctrl-A on an empty editable threw an error. This fixes it.

closes odoo/odoo#32301

Signed-off-by: Adrien Dieudonné (adr) &lt;adr@odoo.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: stop removing empty block after deleting its contents</title>
<updated>2019-02-21T09:13:30+00:00</updated>
<author>
<name>Antoine Guenet</name>
<email>age@odoo.com</email>
</author>
<published>2019-02-19T10:53:55+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=00a78af98eaacbf582233956777263185685d886'/>
<id>00a78af98eaacbf582233956777263185685d886</id>
<content type='text'>
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.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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.</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] web_editor: on anchor split, rerange and clean data on getValue</title>
<updated>2019-02-07T10:20:57+00:00</updated>
<author>
<name>Antoine Guenet</name>
<email>age@odoo.com</email>
</author>
<published>2019-02-07T10:20:57+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=eea58a3cf85b08e58c8b2f755fca933af171d1f7'/>
<id>eea58a3cf85b08e58c8b2f755fca933af171d1f7</id>
<content type='text'>
Due to a wrong order of operations, after splitting an anchor (press
ENTER), the range was setting on the first anchor. Now it sets on the
second one (as the code - but not the tests - suggests was supposed to
happen). Tests were adapted to reflect that change.

In tests, after splitting the anchor, `Wysiwyg.getValue` didn't always
properly clean up `data-original-title`. Targetting empty
`data-original-title` attribute instead of `aria-describedby` attribute
should fix that issue.

closes odoo/odoo#30923</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Due to a wrong order of operations, after splitting an anchor (press
ENTER), the range was setting on the first anchor. Now it sets on the
second one (as the code - but not the tests - suggests was supposed to
happen). Tests were adapted to reflect that change.

In tests, after splitting the anchor, `Wysiwyg.getValue` didn't always
properly clean up `data-original-title`. Targetting empty
`data-original-title` attribute instead of `aria-describedby` attribute
should fix that issue.

closes odoo/odoo#30923</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web_editor: handle CTRL+A (and then DELETE) locally</title>
<updated>2019-02-04T09:44:18+00:00</updated>
<author>
<name>Antoine Guenet</name>
<email>age@odoo.com</email>
</author>
<published>2019-01-28T14:34:40+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=48cb3c71d12711b4ce173b985a59faf334738058'/>
<id>48cb3c71d12711b4ce173b985a59faf334738058</id>
<content type='text'>
This fixes issues with CTRL+A then delete.
Now CTRL+A selects all the contents of the unbreakable node in
which the range is contained. Deleting it all will replace the contents
with `&lt;p&gt;&lt;br&gt;&lt;/p&gt;` so the user can start editing afresh.

Note: Only CTRL+A is handled: ``select all`` in contextual and edit
menus are still handled by the browser.

closes odoo/odoo#30648</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes issues with CTRL+A then delete.
Now CTRL+A selects all the contents of the unbreakable node in
which the range is contained. Deleting it all will replace the contents
with `&lt;p&gt;&lt;br&gt;&lt;/p&gt;` so the user can start editing afresh.

Note: Only CTRL+A is handled: ``select all`` in contextual and edit
menus are still handled by the browser.

closes odoo/odoo#30648</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] web_editor,*: Refactoring the wysiwyg editor and 'html' field</title>
<updated>2019-01-17T08:40:21+00:00</updated>
<author>
<name>Christophe Matthieu</name>
<email>chm@odoo.com</email>
</author>
<published>2019-01-10T11:07:17+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=f296992317e96562c66bd7ad59a5080d6c551ed5'/>
<id>f296992317e96562c66bd7ad59a5080d6c551ed5</id>
<content type='text'>
* Creating a new structure by transforming all the plugins in the
  library using the odoo inheritance system. Plugins are easier to
  implement with the AbstractPlugin to add Odoo behaviors.

* From now on, the methods of the library (in this case Summernote) can
  no longer be called by other modules or files. Only the wysiwyg
  widgets can access it, to simplify the updating process. The wysiwyg
  object serves as an interface.

* Depending on the options the snippets will be loaded or not, the
  editor will be in an iframe or not... all of this is transparent from
  the outside.

* Regarding iframes, all controllers related to editing have been
  removed: the new API no longer needs them. This speeds up loading,
  eases testing and removes complexity for the same
  features.

PUBLIC FEATURES

There are several public methods on the Wysiwyg class:
* Wysiwyg.prepare (WidgetParent): returns a deferred resolved when the
  library (xml, lazy, assets...) is loaded.
* Wysiwyg.getRange (DOM): returns the range (selection in the dom)
* Wysiwyg.setRange (startNode, startOffset, endNode, endOffset): creates
  a range (selection in the dom)
* Wysiwyg.setRangeFromNode (DOM, options) that creates a range from an
  element (option available to select all, start or end)

A jQuery selector was added: :o_editable, which indicates whether the
current element is editable. That is, if it is contained in a tag with
the attribute 'contentEditable = "true"' or in a tag with the class
o_editable.
Several methods are also present:
* focusIn: makes a focus and places the cursor at the beginning of the
  element
* focusInEnd: makes a focus and places the cursor at the end of the
  element
* selectContent: makes a focus and selects the content

HTML FIELD

The HTML field can receive different options:
* style-inline: {boolean} transforms a class into an inline style when
  saving and vice versa when reading.
* no-attachment: {boolean} prevents the use of attachments (in media
  dialog)
* cssEdit: {xml_id} to use a template containing the css to loaded in
  an iframe when editing
* cssReadonly: {xml_id} to use a template containing the css to load
  into an iframe when viewing in readonly
* snippets: {xml_id} snippets template (can be used with or without
  cssEdit)
* wrapper: {template} qweb static template (containing a tag:
  id = "wrapper") that will include the content during editing (removed
  on save)

MASS MAILING

A widget was created for mass mailing. There are now two fields:
body_html and body_arch.
body_arch contains the code with the class without conversion into
inline style, useful when editing and one with the inline style that is
visible in readonly mode and sent by email.
Advantage: no spreading errors, able to update css/theme, able to do
more changes when converting to inline style so that a maximum of mail
clients have an impeccable rendering.

Co-authored-by: Antoine Guenet &lt;age@odoo.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Creating a new structure by transforming all the plugins in the
  library using the odoo inheritance system. Plugins are easier to
  implement with the AbstractPlugin to add Odoo behaviors.

* From now on, the methods of the library (in this case Summernote) can
  no longer be called by other modules or files. Only the wysiwyg
  widgets can access it, to simplify the updating process. The wysiwyg
  object serves as an interface.

* Depending on the options the snippets will be loaded or not, the
  editor will be in an iframe or not... all of this is transparent from
  the outside.

* Regarding iframes, all controllers related to editing have been
  removed: the new API no longer needs them. This speeds up loading,
  eases testing and removes complexity for the same
  features.

PUBLIC FEATURES

There are several public methods on the Wysiwyg class:
* Wysiwyg.prepare (WidgetParent): returns a deferred resolved when the
  library (xml, lazy, assets...) is loaded.
* Wysiwyg.getRange (DOM): returns the range (selection in the dom)
* Wysiwyg.setRange (startNode, startOffset, endNode, endOffset): creates
  a range (selection in the dom)
* Wysiwyg.setRangeFromNode (DOM, options) that creates a range from an
  element (option available to select all, start or end)

A jQuery selector was added: :o_editable, which indicates whether the
current element is editable. That is, if it is contained in a tag with
the attribute 'contentEditable = "true"' or in a tag with the class
o_editable.
Several methods are also present:
* focusIn: makes a focus and places the cursor at the beginning of the
  element
* focusInEnd: makes a focus and places the cursor at the end of the
  element
* selectContent: makes a focus and selects the content

HTML FIELD

The HTML field can receive different options:
* style-inline: {boolean} transforms a class into an inline style when
  saving and vice versa when reading.
* no-attachment: {boolean} prevents the use of attachments (in media
  dialog)
* cssEdit: {xml_id} to use a template containing the css to loaded in
  an iframe when editing
* cssReadonly: {xml_id} to use a template containing the css to load
  into an iframe when viewing in readonly
* snippets: {xml_id} snippets template (can be used with or without
  cssEdit)
* wrapper: {template} qweb static template (containing a tag:
  id = "wrapper") that will include the content during editing (removed
  on save)

MASS MAILING

A widget was created for mass mailing. There are now two fields:
body_html and body_arch.
body_arch contains the code with the class without conversion into
inline style, useful when editing and one with the inline style that is
visible in readonly mode and sent by email.
Advantage: no spreading errors, able to update css/theme, able to do
more changes when converting to inline style so that a maximum of mail
clients have an impeccable rendering.

Co-authored-by: Antoine Guenet &lt;age@odoo.com&gt;</pre>
</div>
</content>
</entry>
</feed>
