Odoo's Mergebot b01f92ad8f [MERGE] web_editor: improve code to ease knowledge and new commands integration
# Preparatory work for the new Knowledge module (part 1)

## Contents

* Add contenteditable as a safe attribute for DOMPurify.sanitize

> Before this change, the function _safeSetAttribute would remove contenteditable
attributes in collaborative mode when it should not have.

* Add failsafe upon CTRL+BACKSPACE

> The /template command creates a block which will contain paragraphs. We don't
want to allow this block to not have children.
>
> This commit prevents the removal of a `<p>` element if it is empty and is the
last child of its parent.
>
> In other cases, allows the removal of the last node, but insert an empty `<p>`
if the parent is a block when it becomes empty because of a CTRL+BACKSPACE.

* Prevent command refocus when unnecessary

> When typing a command in a template block, the caret must stay in the
template.
>
> Since it is CONTENTEDITABLE=FALSE and has a CONTENTEDITABLE=TRUE element, the
editable context changes and calling `this.editable.focus` will force the caret
out. Instead, we only have to call the focus if the activeElement is not a child
of `this.editable`.

* Expand deleterange for uneditables

> In Chrome, it is possible to partially select the contents of a
CONTENTEDITABLE=FALSE element if it has a CONTENTEDITABLE=TRUE child.
>
> This commit prevents breaking such uneditables by expanding the range in a
deleterange to fully contain such elements.
>
> This will prevent removing only the toolbar of a /template block in
Knowledge.

closes odoo/odoo#86489

Task-id: 2794990
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-05-05 11:41:58 +02:00
2022-04-23 07:37:55 +02:00
…
…
2021-10-07 17:59:53 +00:00
2022-01-14 15:44:52 +00:00

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%