qsm-odoo 69d4383d7b [FIX] web_editor: browser-unify alignment editor option
Summernote uses `document.execCommand` to apply most styles when
editing, leveraging the implementation to the browser.

Summernote is configured to use HTML styling (`'styleWithSpan': false`),
and in this case, browsers such as Firefox use HTML attributes for
styling text align, while Chrome still uses CSS for that. In fact,
`document.execCommand` is browser-inconsistent... but so is the
`styleWithSpan` option. Indeed, setting the option to `true` will make
Firefox use CSS property for alignment too... but not Internet Explorer.
So we might consider changing this option's value but this would not
solve the current problem.

Indeed, any CSS `text-align` style in Firefox takes precedence above
the element's `align` attribute, so when users were trying to align text
on stuff that was pre-aligned, they were unable to do so.

We can better explain the situation with this example:
A user tries to left-align in Firefox a `p.text-center` element, and
produces this:

```html
<p class="text-center" align="left"/>
```

(`align` attribute is ignored because of the `text-center` class)

On Chrome, this would be produced with the same steps:

```html
<p class="text-center" style="text-align:left"/>
```

With this patch, we actually make that HTML look like expected by the
user, no matter the browser he's using, by forcing the editor to use
the text-align CSS property. Note that the implementation is quite
ugly but had to take care of compatibility.

See https://github.com/odoo/odoo/pull/20900
(thanks to @Yajo for original PR)
2017-12-15 14:06:04 +01: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, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ...

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.

If you are a developer you may type the following command at your terminal:

wget -O- https://raw.githubusercontent.com/odoo/odoo/9.0/odoo.py | python

Then follow the developer tutorials

For Odoo employees

To add the odoo-dev remote use this command:

$ ./odoo.py setup_git_dev

To fetch odoo merge pull requests refs use this command:

$ ./odoo.py setup_git_review
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%