Commit Graph
59 Commits
Author SHA1 Message Date
f14cecfc0a [REV] web_editor: revert summernote update
Summernote was updated alongside the new editor of saas-12.2. However,
since we are putting back the editor of 12.0, summernote needs to be
downgraded back to the version that was compatible with the 12.0 editor.

This is a revert of 17c6d005.

Part of PR 35677.

Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
2019-08-21 18:52:19 +00:00
Christophe Matthieu 17c6d00531 [IMP] web_editor,*: Update the Summernote library
The refactoring of the wysiwyg editor and 'html' field allow for the
update of the Summernote library.
2019-01-17 08:40:21 +00:00
Christophe Simonis b4e1be8ab0 [MERGE] forward port branch saas-11.3 up to b09f624f20 2018-11-22 20:06:48 +01:00
Christophe Simonis 263b388c50 [MERGE] forward port branch saas-15 up to e44c35f407 2018-11-22 17:06:31 +01:00
Nicolas Lempereur 258eaa7a3c [FIX] web_editor: firefox `´ accent no break position
On firefox if we do for example:

ALT+GR + [ALT+GRable ´ key]

Firefox may send keys "AltGr" and "Dead" instead of just "AltGr".

This was possibly causing caret to go a position too low when writing
speedily with diacritical marks.

opw-1903865
closes #28739
2018-11-15 16:52:31 +01:00
Christophe Simonis 68d36512ef [MERGE] forward port branch saas-11.4 up to d78f23df84 2018-09-07 20:20:45 +02:00
Christophe Simonis 49c3264ce0 [MERGE] forward port branch saas-11.3 up to 4850fb0838 2018-09-07 14:43:48 +02:00
Nicolas Lempereur 7a453b0b7a [FIX] web_editor: focus lost with inline editor
When an inline editor is eg. in a form view, the focus is always stolen
by it.

This is because we trigger a mouseup on the editor to update its
toolbars values and informations.

In 10.0 this was not necessary since the default values were sanely set
when the editor was inside the DOM. In 11.0 the editor is not in the DOM
when this is being done and the info was wrong (eg. NaN for text size).

With this commit, we don't steal the focus and get the default like it
was done in 10.0 instead.

fixes #26366
opw-1874880
closes #26582
2018-09-03 16:51:20 +02:00
qsm-odoo d9b9c4e8e1 [FIX] *: BS4, restore some popover design
Completes commit https://github.com/odoo/odoo/commit/2d5595fcbad73ed0ce03f048fdd870d9659bcd5e
2018-08-02 09:55:20 +02:00
qsm-odoo 37b746c6cf [FIX] *: BS4, restore modal headers
Close icon should now be put after the modal title in the DOM.
Completes commit https://github.com/odoo/odoo/commit/d9801c1abe06b4c20702c0e94c56eea6a3ed8327
2018-07-31 13:07:48 +02:00
qsm-odoo 8c32bfb45d [REF] web_editor: make our Summernote/BS3 work with BS4
The big plan is to remove our current editor and its customization and
replace it with an updated summernote. Meanwhile, we have to patch our
current lib directly so that it works with BS4.
2018-07-27 12:36:54 +02:00
qsm-odoo d48b8593dd [REF] *: BS4, 'pull-left/right' -> 'float-left/right' 2018-07-27 12:36:54 +02:00
qsm-odoo 443735949e [REF] *: BS4, replace img-rounded/img-circle classes
'img-rounded' -> 'rounded'
'img-circle' -> 'rounded-circle'
2018-07-27 12:36:54 +02:00
qsm-odoo ed1b18f103 [REF] *: BS4, adapt col-related classes
col-lg-* -> col-xl-*
col-md-* -> col-lg-*
col-sm-* -> col-md-*
col-xs-* -> col-*

col-lg-offset-* -> offset-xl-*
col-md-offset-* -> offset-lg-*
col-sm-offset-* -> offset-md-*
col-xs-offset-* -> offset-*

col-lg-pull-* -> order-xl-1
col-md-pull-* -> order-lg-1
col-sm-pull-* -> order-md-1
col-xs-pull-* -> order-1

col-lg-push-* -> order-xl-2
col-md-push-* -> order-lg-2
col-sm-push-* -> order-md-2
col-xs-push-* -> order-2
2018-07-27 12:36:54 +02:00
qsm-odoo c59380bac5 [REF] *: BS4, rename btn-default to btn-secondary
BS4 "btn-default" class was replaced with "btn-secondary", which makes
more sense.
2018-07-27 12:36:54 +02:00
qsm-odoo 2c966909e2 [FIX] *: fix some side-effects of https://github.com/odoo/odoo/commit/9de1bc0eef6f5bfaa2a8d745431caa361ae91548
- JS Modals were not correctly built anymore, their .modal-body element
  was duplicated and many without-effect JS lines were introduced (as a
  side effect, the form view design was broken when inside modals)

- Tests were changed to make bugs go unnoticed. For example, the media
  dialog functionnality was entirely broken because the .modal-dialog
  element was not receiving the correct class anymore.

- The JS translation function is _t, not _

- Do not use the <title/> tag as a regular DOM element, it is meant to
  be unique, in the <head/> section

- CSS rules were added to the utils.scss file, which is meant to contain
  functions and mixins, otherwise, the rule is duplicated in every asset

- Some icons were still broken, as missed by https://github.com/odoo/odoo/commit/f90cf060a3cfeb37a67bec83264c0aaab8892b56

- Tests were changed to use [role="dialog"]/footer/header in their
  selectors without any reason, this commit restores some of that to
  avoid rebase conflicts with the BS4 work.

- ...

Note: other elements should still be discussed, like the direct use of
the 'o_form_label' class in views definition... but those do not cause
direct problems.
2018-07-09 11:59:30 +02:00
kujiu 9de1bc0eef [IMP] Improve compatibility with screen readers (accessibility) (#24574)
Today, Odoo is really tricky to use without seeing the screen, it must be improved to be usable.

This PR forbid to use labels without a "for" attribute, add some title, rule and aria attributes in HTML. With that, Odoo will be fully usable with a screen reader.


* [IMP] Labels must have a for attribute. Improve accessibility.
* [IMP] Better error message when trying to read a missing cached value
* [FIX] Add some aria-label and title attributes for screen readers.
* [FIX] Template name is not included in the error message in case of SyntaxError in QWeb
* [FIX] Improve the Tour failed at step error message to be more explicit.
* [IMP] Add aria-labels
* [FIX] Add missing aria-label on failing test
* [IMP] aria-hidden means hidden. Fix all bad aria-hidden and hide aria-hidden for all.
* [IMP] Color names on kanban views and many2many tags
* [IMP] Add some checks on views for accessibility.
* [IMP] Add `alt` attribute on `img` tags.
* [IMP] Add aria-label and title on non-described icons
* [IMP] Add button role to widgets with btn class
* [IMP] Translate aria and formatted attributes.
* [IMP] Remove wrong aria-labelledby
* [IMP] Add menu role on dropdowns
* [IMP] Buttons must be focusable
* [IMP] Add aria attributes on progress bars
* [IMP] Improve accessibility of basic widgets
* [IMP] Change main layout to more semantic tags
* [IMP] Add menuitem role when missing
* [IMP] Remove wrong role='presentation'
* [IMP] Improve accessibility of tab panels
* [IMP] Add aria-invalid on invalid fields
* [IMP] Add aria-sort on ordered columns
* [IMP] Add role on alerts
* [IMP] Use dialog role, header, main and footer tags for modals
* [IMP] Add labels on o_status
* [IMP] Improve accessibility of kanban view with feeds and articles
* [IMP] Add alerts in case of new messages
* [IMP] Add widget, navigation or img role to aria-labelled items
2018-06-22 21:22:21 +02:00
Christophe Simonis 73652a0b19 [MERGE] forward port branch saas-11.3 up to 50860317cc
Note: 1aacc96262 has been ignored and will
be forward-ported later
2018-06-15 13:27:27 +02:00
Christophe Simonis b05e4d5f95 [MERGE] forward port branch saas-15 up to a53bea49fe 2018-06-14 21:28:39 +02:00
Christophe Simonis 23a1bce2a9 [MERGE] forward port branch 9.0 up to 90165e2d96 2018-06-14 17:29:56 +02:00
Nicolas Lempereur c4ddf55880 [FIX] web_editor: link don't duplicate child text
If we applied a link eg. on:

```
<span>hello <b>world</b></span>
```

The system actually gets the "label": hello worldworld because there is
3 nodes:

 text node: hello
 element node: `<b>world</b>`
 text node: world

Also since "hello worldworld" is different than "hello world",
instead of just keeping existing nodes and adding the link, the system
would replace the selected range by:

 `<span><a>hello worldworld</a></span>'

instead of:

 `<span><a>hello </a><b><a>world</a></b></span>`

This commit ignores element nodes when creating a new link, since when
getting the label of the link from the selection, only the text nodes
insides the element nodes have any interest.

There was a second issue because if we had:

```
<i><a href="hello">world</a></i>!
```

and tried to put a link over "world!", the code would decide: "world" is
inside a link so we will just update that link.

Thus we would get:

```
<i><a href="hello">world!</a></i>!
```

instead of:

```
<i><a href="hello">world</a></i><a href="hello">!</a>
```

opw-1848351
closes #25187
2018-06-13 16:20:40 +02:00
Christophe Simonis f36e6917bd [MERGE] forward port branch saas-11.3 up to 37eed7c509 2018-05-29 17:34:43 +02:00
Nicolas Martinelli 5a1c789861 [FIX] web_editor: drag and drop
Commit 6494f51171 introduces an access token to read images inside an
email. This avoids access errors when accessing the email through a
proxy (e.g. Gmail). That implies that all images are added as
attachments.

When going through the usual media dialog, the form is submitted to
action '/web_editor/attachment/add', creating the attachment. However,
the copy or the drag and drop of an image completely fails. Indeed,
the same method `_onImageUpload` is called, but with a completely
different argument type: `attachments` is a `FileList`, not a list of
attachments.

To solve this, we only call `_onImageUpload` on a the custom `onUpload`
callback, which is not triggered during a drag and drop or a copy. Any
image included thanks to these methods will be post-processed in the
`create` method of `mail.message` (`base64_to_boundary`).

Unfortunately, it's not possible to simulate an actual drag and drop or
a copy, so we cannot add a test.

opw-1840237
opw-1840411
2018-05-08 08:58:22 +02:00
Christophe Simonis 320b631c81 [MERGE] forward port branch saas-15 up to 810603f4ef 2018-05-02 15:34:42 +02:00
Christophe Simonis a33362bb51 [MERGE] forward port branch 9.0 up to 532b11ce41 2018-05-02 11:01:38 +02:00
qsm-odoo ce6f8632cc [FIX] web_editor: update summernote copy-paste feature
The copy-paste feature of summernote was messy and led most of the time
to breaking the template you were trying to edit. While it is difficult
to solve as it mostly comes from the lib itself and that the lib is in
a complicated state as Odoo had to overridde part of its internal code
for its own purposes, this commit hopes to solve the problem by updating
only the copy-paste feature to the latest summernote version.

Of course, as summernote changed a lot meanwhile, it was not possible to
just take the up-to-date summernote file. This commit refactores the
up-to-date summernote clipboard code so that it fits the old summernote
version Odoo is using.

Note: the main problems occurred while using Windows/Mac and not Linux.

opw-1837818
2018-04-27 12:28:57 +02:00
qsm-odoo 9435fe110c [REF] web_editor: convert summernote less to css
Summernote is using LESS and no SCSS version exists (at least
officially). As summernote is meant to be replaced in the future and
that the LESS file was already overridden directly by Odoo, this
commit converts the LESS file to CSS once and for all.
2018-04-18 15:59:12 +02:00
Christophe Simonis 868e718e09 [MERGE] forward port branch saas-15 up to 8d0942380b 2017-10-17 15:14:47 +02:00
Christophe Simonis cbca27d005 [MERGE] forward port branch 9.0 up to d5c0cae60b 2017-10-17 11:42:05 +02:00
qsm-odoo 296498fb58 [FIX] web_editor: do not break <p/> when pasting a <p/> element
This fixes a bug when pasting text in a paragraph, it was always
creating a new paragraph for no reason.
2017-10-16 14:14:47 +02:00
Christophe Matthieu 5dd23f7de2 [FIX] web_editor: prevent crash when publishing a payment in edit mode
When updateStyleInfo is called, the options is not necessarily on
editable area (eg: when update the toolbar for image)
2017-05-04 17:19:25 +02:00
Christophe Simonis 856476d441 [MERGE] forward port branch saas-12 up to b1b700a 2016-09-22 15:23:45 +02:00
Christophe Simonis b1b700adb1 [MERGE] forward port branch saas-11 up to 6854887 2016-09-22 14:23:07 +02:00
Christophe Matthieu ab06013e30 [FIX] mass_mailing: can't change color button snippet when edit mass mailing 2016-09-21 16:14:49 +02:00
qsm-odoo f196afc80b [IMP] web_editor: come back to a more regular summernote colorpicker
Splitting the summernote colorpicker into bg colorpicker and foreground
colorpicker seems to have been a bad idea as people tend to click on
the recent color button thinking it will open a dropdown.

This commit keeps the design that had been decided for colorpicker
template and do not change the "background-color" snippet option.
However, the colors for background and foreground text changes are
now displayed in an unique dropdown again, with reviewed style.

+ adapt the rte tour
2016-08-19 17:44:27 +02:00
qsm-odoo 73898ccb8b [IMP] web_editor: change image edition toolbar
* Move description button at the end of the toolbar
* Add an "auto" state button for the image width (alongside 100%,
50% and 25%) (when these last three are unchecked, the auto button
becomes checked).
2016-07-05 18:05:24 +02:00
Christophe Matthieu 025263d3bf Revert "[FIX] web_editor: test jinja content to load editor in codeview"
This reverts commit f38f8930f0.

Revert for internal choice. Odoo want to use qweb in template and remove jinja support on next version.
If users want to use jinja they can change the view to use text widget instead of html widget.
2016-06-23 11:45:17 +02:00
Christophe Matthieu f38f8930f0 [FIX] web_editor: test jinja content to load editor in codeview
The preview change the content because the browser try to fix the dom.
If a user use jinja and activate the preview, the jinja code is (re)moved by the browser and broke the template.
2016-06-22 14:26:42 +02:00
qsm-odoo 6610d05549 [REF] web_editor,website,mass_mailing: JS/XML update
* Adapt DOM selectors
* Refactore dialog XMLs to have odoo styling
* New editor options (background-position, ...)
* Various improvements
2016-02-24 13:47:36 +01:00
qsm-odoo 5b65befcd8 [REF] web,web_editor,website,report,mass_mailing,mail: LESS
* Convert some CSS to LESS
* Split/Join LESS files
* Remove duplicates between website and web_editor
* UI improvements
* Allow simple customizations thanks to LESS var&mixins for website
2016-02-24 13:09:48 +01:00
stefanorigano c4a896a8a0 [REF] website,web_editor: complete restyling 2016-02-24 11:15:55 +01:00
Christophe Matthieu 2ef6e249d0 [FIX] web_editor: merge span when paste, only if no content between tags
opw-667263
2016-01-20 13:23:23 +01:00
Christophe Matthieu 86b80689d7 [FIX] web_editor: remove empty table ligne when paste content 2016-01-20 13:23:23 +01:00
Christophe Matthieu 6e1ed6c8bb [FIX] web_editor: paste simple text must wrap first line by p and remove unless font 2016-01-14 15:21:39 +01:00
Christophe Matthieu 50057c08aa [FIX] web_editor: clean pasted dom and avoid crappy dom
Chrome on windows add few comment tags and insert unwanted span.
2016-01-11 15:20:49 +01:00
Nicolas Lempereur cbb8799b6f [FIX] web_editor, mass_mailing: summernote oversight and video
* some oversight when updating summernote with d33086c,
* fix style when replacing image with video
2015-10-02 12:24:05 +02:00
Nicolas Lempereur 56aa103a43 [FIX] web_editor: useless margin for air editor in translation 2015-09-30 11:27:00 +02:00
Nicolas Lempereur 142a3e4176 [IMP] web_editor: rename and delete summernote files 2015-09-29 14:47:37 +02:00
Nicolas Lempereur d33086c03f [IMP] web_editor: update summernote up to 2015-08-31
update summernote library up to revision:
 https://github.com/summernote/summernote/commit/a0f26e300

see https://github.com/summernote/summernote/ for history

closes #8704
2015-09-29 14:47:24 +02:00
Nicolas Lempereur eed63c793a Revert "[IMP] web_editor: update summernote up to 2015-08-31"
Revert till several issues are solved.
2015-09-25 10:53:08 +02:00