Commit Graph
12 Commits
Author SHA1 Message Date
Antoine Guenet d4b3daa871 [REF] web_editor: import odoo-editor utils into convertInline
Some code from odoo-editor utils is needed in convertInline. In order to
avoid duplication, we need to import that code. To that effect, we can't
have the utils being lazy loaded into mass mailing's iframe while
convertInline is loaded the usual way.
This loads the lightweight utils together with convertInline and turns
convertInline into an odoo-module, which makes it easier to simply
import the utils and delete duplicated code.

X-original-commit: 067c94b009609caa0bd78a75b826247e37557417
Part-of: odoo/odoo#80621
2021-12-08 09:35:00 +00:00
Nicolas BayetandAntony Lesuisse f98db923e2 [FIX] web_editor: fix module auto install with web
The web_editor dependency with mail was problematic:
- web_editor would not auto_intall without the mail being installed
- A circular dependency problem with discuss

In order to avoid creating a new module shared by mail
and web editor, the use of a hack has been decided.
By checking if `notification_type` is in the session, we ensure
that the module mail is installed.

Task-2698655

closes odoo/odoo#80640

X-original-commit: 4e611d7527f85fc074115bd018adb7d6e5ea2c53
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Co-authored-by: Antony Lesuisse <al@odoo.com>
2021-12-01 08:01:00 +00:00
Nicolas Bayet e68a9d37dc [IMP] web_editor: allow to use link popover everywhere
Before this commit, the link popover was only available in the website
builder. Now it is available anywhere the wysiwyg is used.

Task-2678412

closes odoo/odoo#79542

X-original-commit: 161c5fc8e742294e8d85c889b4bf8d3d8cd484f5
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-11-09 14:00:56 +00:00
Nicolas Bayet 344d82ca25 [IMP] web_editor: add collaborative feature
This commit allows to use the editor collaboratively for any html
field in peer to peer using webRTC.

task-2497931

closes odoo/odoo#75768

Signed-off-by: Antony Lesuisse (al) <al@openerp.com>
2021-09-06 19:42:56 +00:00
Xavier-Do 288595f558 [FIX] *: add explicit license to all manifest
The license is missing in most enterprise manifest so
the decision was taken to make it explicit in all cases.
When not defined, a warning will be triggered starting from
14.0 when falling back on the default LGPL-3.

closes odoo/odoo#74245

Related: odoo/design-themes#48
Related: odoo/enterprise#19862
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-07-26 13:09:57 +00:00
Nicolas Bayet 4600086e7a [IMP] web_editor: move odoo-editor into odoo
The code of the Odoo editor was on another repository
and that created unnecessary overhead. This commit move
the code inside Odoo and slightly change the folder
structure.

Related PR:
saas-14.3: #73345
saas-14.4: #73348

closes odoo/odoo#73272

Master: #73272
Signed-off-by: Antoine Guenet <Zinston@users.noreply.github.com>
2021-07-08 15:31:45 +00:00
740168ce8d [REF] web_editor, website_*, mass_mailing: adapt to Odoo Editor
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Emilien Durieu <edu@odoo.com>
2021-04-01 16:01:06 +00:00
93e88da2e6 [ADD] web_editor: introduce Odoo Editor wysiwyg rte library
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Emilien Durieu <edu@odoo.com>
Co-authored-by: Fabien Pinckaers <fp@odoo.com>
Co-authored-by: Quentin Smetz <qsm@odoo.com>
2021-04-01 12:49:47 +00:00
27166ff9df [REM] web_editor, website: remove Summernote wysiwyg rte library
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Sébastien Geelen <sge@odoo.com>
Co-authored-by: Emilien Durieu <edu@odoo.com>
2021-04-01 12:49:47 +00:00
Julien MougenotandSimon Genin 03641610c2 [REF] *: convert all modules to new asset system
Conversion of all modules to the new manifest assets declaration.

Part of task: 2352566

Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Simon Genin <ges@odoo.com>
2021-03-31 13:57:18 +02:00
Christophe MatthieuandAntoine Guenet f296992317 [IMP] web_editor,*: Refactoring the wysiwyg editor and 'html' field
* 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 <age@odoo.com>
2019-01-17 08:40:21 +00:00
Olivier Dony 859d443863 [IMP] *: rename manifest files for v10 naming convention 2016-09-05 11:57:50 +02:00