summaryrefslogtreecommitdiff
path: root/addons/web_editor/views/editor.xml
diff options
context:
space:
mode:
authorGorash <chm@odoo.com>2019-08-08 15:08:09 +0000
committerDavid Monjoie <dmo@odoo.com>2019-08-22 06:41:05 +0000
commit56d0c1ed97784a2d2e6608caf8feafc5fa611d68 (patch)
tree0ef4b5e9db4cbe39ca2d411792dd450ce5adf13c /addons/web_editor/views/editor.xml
parent1eb1c2b029c7216c70becbf4cd0d9e6535deea96 (diff)
[REF] web_editor, mass_mailing: new iframe mechanism
Since we reverted the saas-12.2 editor in favor of the 12.0 one, we faced a dilemna regarding how the editor iframe is handled in mass_mailing. The 12.0 version was using a special controller to get the website assets required for mass_mailing while the saas-12.2 version used a completely different mechanism that was, obviously, not handled by the 12.0 version. We did not want to reintroduce the old controllers who were considered to be a hack to load the assets in the mass_mailing iframe. However, we were very cautious about changing the editor itself to avoid introducing new bugs in the editor core of 13.0. The approach we chose at the end, is to use the loadAsset mechanism introduced in saas-12.2 to load the necessary assets and inject them in the mass_mailing iframe. This did not reintroduce the controllers nor did it require to change the code of the editor itself. However, it required moderate changes to the wysiwyg interface. 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>
Diffstat (limited to 'addons/web_editor/views/editor.xml')
-rw-r--r--addons/web_editor/views/editor.xml11
1 files changed, 9 insertions, 2 deletions
diff --git a/addons/web_editor/views/editor.xml b/addons/web_editor/views/editor.xml
index 1d425a684e3..8be49ec0c20 100644
--- a/addons/web_editor/views/editor.xml
+++ b/addons/web_editor/views/editor.xml
@@ -2,8 +2,12 @@
<odoo>
<template id="wysiwyg_iframe_css_assets" name="CSS assets for wysiwyg iframe content">
- <t t-call-assets="web.assets_common" t-js="false"/>
- <t t-call-assets="web.assets_backend" t-js="false"/>
+</template>
+
+<template id="wysiwyg_iframe_editor_assets" name="Editor assets for wysiwyg iframe content">
+ <t t-call-assets="web.assets_common"/>
+ <t t-call-assets="web.assets_frontend" t-js="false"/>
+ <t t-call-assets="web_editor.assets_wysiwyg"/>
</template>
<template id="compiled_assets_wysiwyg" name="Wysiwyg Editor">
@@ -53,6 +57,8 @@
<!-- Launcher -->
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/wysiwyg.js"/>
+ <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/wysiwyg_snippets.js"/>
+ <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js"/>
</template>
<template id="summernote" name="Summernote">
@@ -152,6 +158,7 @@
</xpath>
<xpath expr="script[last()]" position="after">
<script type="text/javascript" src="/web_editor/static/src/js/backend/field_html.js" />
+ <script type="text/javascript" src="/web_editor/static/src/js/backend/convert_inline.js" />
</xpath>
</template>