[IMP] web_editor: add assets for jabberwock editor

This commit lays the groundwork for the new editor by adding empty files to the assets in
order to change them later on. The new editor is not stable enough to be merged right
now, but delaying it to 15.0 would be problematic as the current editor has many bugs that
we are unable to fix because of how summernote interacts with browser-dependent code as well
as all the hacks that were done on top of it for Odoo since 8.0.
This commit is contained in:
Goaman
2020-10-02 08:52:40 +00:00
committed by David Monjoie
parent e215422bc0
commit 55f10ac9a0
12 changed files with 32 additions and 6 deletions
+4
View File
@@ -5,6 +5,7 @@
<link rel="stylesheet" type="text/scss" href="/mass_mailing/static/src/scss/mass_mailing.scss"/>
<link rel="stylesheet" type="text/scss" href="/mass_mailing/static/src/scss/mass_mailing_mobile.scss"/>
<link rel="stylesheet" href="/mass_mailing/static/src/css/email_template.css"/>
<link rel="stylesheet" type="text/scss" href="/mass_mailing/static/src/scss/mass_mailing.ui.jw.scss"/>
<script type="text/javascript" src="/mass_mailing/static/src/js/mass_mailing.js"></script>
<script type="text/javascript" src="/mass_mailing/static/src/js/mass_mailing_widget.js"></script>
@@ -26,10 +27,13 @@
<template id="assets_mail_themes_edition"> <!-- maybe to remove and convert into a field dumy with attr invisible if the template is not selected -->
<t t-call="web._assets_helpers"/>
<link rel="stylesheet" type="text/scss" href="/mass_mailing/static/src/scss/mass_mailing.ui.scss"/>
<link rel="stylesheet" type="text/scss" href="/mass_mailing/static/src/scss/mass_mailing.ui.shadow.scss"/>
<link rel="stylesheet" type="text/scss" href="/web/static/src/scss/webclient.scss"/>
</template>
<template id="iframe_css_assets_edit" groups="base.group_user">
<t t-call-assets="web.assets_common" t-js="false"/>
<t t-call-assets="web_editor.assets_wysiwyg" t-js="false"/>
<t t-call-assets="mass_mailing.assets_mail_themes" t-js="false"/>
<t t-call-assets="mass_mailing.assets_mail_themes_edition" t-js="false"/>
</template>
@@ -0,0 +1 @@
odoo.__enable_summernote__ = true;
+20 -6
View File
@@ -11,7 +11,7 @@
<t t-call-assets="web_editor.assets_wysiwyg"/>
</template>
<template id="assets_wysiwyg" name="Wysiwyg Editor Assets">
<template id="web_editor.assets_wysiwyg" name="Wysiwyg Editor Assets">
<!-- lib -->
<t t-call-assets="web_editor.assets_summernote"/>
@@ -41,6 +41,7 @@
<script type="text/javascript" src="/web_editor/static/src/js/editor/rte.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/editor/rte.summernote.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/editor/image_processing.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/editor/custom_colors.js"/>
<!-- widgets & plugins -->
@@ -57,13 +58,16 @@
<script type="text/javascript" src="/web_editor/static/src/js/editor/snippets.options.js"/>
<!-- Launcher -->
<script type="text/javascript" src="/web_editor/static/lib/jabberwock/jabberwock.js"/>
<link rel="stylesheet" type="text/css" href="/web_editor/static/lib/jabberwock/jabberwock.css"/>
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/wysiwyg_translate_attributes.js"/>
<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="assets_summernote" name="Summernote">
<script type="text/javascript" src="/web_editor/static/lib/summernote/src/js/enable_summernote.js"/>
<script type="text/javascript">
(function () {
"use strict";
@@ -72,6 +76,7 @@
var uniqId = 0;
odoo.__define__ = window.define;
window.define = function (id) {
if (!odoo.__enable_summernote__) return;
var args = Array.prototype.slice.call(arguments);
var factorie = args.pop();
var id = args[0];
@@ -111,6 +116,7 @@
window.define = odoo.__define__;
delete odoo.__define__;
delete odoo.website_next_define;
delete odoo.__enable_summernote__;
</script>
<link rel="stylesheet" type="text/css" href="/web_editor/static/lib/summernote/src/css/summernote.css"/>
</template>
@@ -155,6 +161,7 @@
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/web_editor.backend.scss"/>
</xpath>
<xpath expr="script[last()]" position="after">
<script type="text/javascript" src="/web_editor/static/src/js/frontend/loader.js" />
<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>
@@ -188,18 +195,25 @@
odoo.define('web_editor.wysiwyg.root.test', function (require) {
'use strict';
var WysiwygRoot = require('web_editor.wysiwyg.root');
WysiwygRoot.include({
assetLibs: null // We need to add the asset because tests performed overwrites (Dialog, Unbreakable...)
});
if (WysiwygRoot) {
WysiwygRoot.include({
assetLibs: null // We need to add the asset because tests performed overwrites (Dialog, Unbreakable...)
});
}
});
</script>
<t t-call="web_editor.compiled_assets_wysiwyg"/>
<t t-call="web_editor.assets_wysiwyg"/>
<script type="text/javascript" src="/web_editor/static/tests/test_utils.js"/>
<script type="text/javascript" src="/web_editor/static/tests/field_html_tests.js"/>
</xpath>
</template>
<template id="assets_edit_html_field" name="Wysiwyg Editor Assets for html field (style-inline)" groups="base.group_user,base.group_portal">
<t t-call-assets="web.assets_common" t-js="false"/>
<t t-call-assets="web_editor.assets_wysiwyg" t-js="false"/>
</template>
<!--
The web_editor.colorpicker template regroups section of colorpicker menu for website customization
(text foreground/background but also snippet background color option).
+5
View File
@@ -1,6 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="snippets" groups="base.group_user">
<form class="o_we_website_top_actions d-none">
<button type="button" class="btn btn-primary" name="save" data-action="save" accesskey="s">Save</button>
<button type="button" class="btn btn-secondary" name="cancel" data-action="cancel" accesskey="j">Discard</button>
<button type="button" class="btn btn-secondary" name="mobile" data-action="mobile">Mobile preview</button>
</form>
<div id="snippets_menu">
<button type="button" tabindex="1" class="o_we_add_snippet_btn active text-uppercase" accesskey="1">
<span>Blocks</span>
+2
View File
@@ -118,6 +118,8 @@
<link rel="stylesheet" type="text/scss" href="/website/static/src/scss/website.edit_mode.scss"/>
<script type="text/javascript" src="/website/static/src/js/editor/editor.js"/>
<script type="text/javascript" src="/website/static/src/js/utils.js"/>
<script type="text/javascript" src="/website/static/src/js/editor/mega_menu.js"/>
<script type="text/javascript" src="/website/static/src/js/editor/snippets.editor.js"/>
<script type="text/javascript" src="/website/static/src/js/editor/rte.summernote.js"/>
<script type="text/javascript" src="/website/static/src/js/editor/snippets.options.js"/>