summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2019-08-23 10:57:54 +0000
committerqsm-odoo <qsm@odoo.com>2019-08-28 09:04:25 +0000
commitb47f097feb7f99be1296cde1f0cd1e4f950d83fd (patch)
tree397f7248e6257fe91545b93ccccf5a531ad6b2a2
parent7acb22a5e5c9beceb18ed6fea691e14502b93ad7 (diff)
[FIX] web_editor, *: review assets organisation
* mass_mailing, point_of_sale, website - Lib files were included twice - Variables files were split but added multiple times in the same assets bundle - Useless assets templates were defined or split - ... Part of https://github.com/odoo/odoo/pull/36068 Related to task-1942370
-rw-r--r--addons/mass_mailing/views/assets.xml4
-rw-r--r--addons/point_of_sale/views/pos_templates.xml2
-rw-r--r--addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js5
-rw-r--r--addons/web_editor/static/src/scss/web_editor.variables.scss43
-rw-r--r--addons/web_editor/static/src/scss/wysiwyg_variables.scss42
-rw-r--r--addons/web_editor/views/editor.xml20
-rw-r--r--addons/website/views/website_templates.xml1
7 files changed, 51 insertions, 66 deletions
diff --git a/addons/mass_mailing/views/assets.xml b/addons/mass_mailing/views/assets.xml
index d2645ef6c14..6143a5bd602 100644
--- a/addons/mass_mailing/views/assets.xml
+++ b/addons/mass_mailing/views/assets.xml
@@ -24,9 +24,7 @@
</template>
<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="/web_editor/static/src/scss/wysiwyg_variables.scss"/>
- </t>
+ <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="/web/static/src/scss/webclient.scss"/>
</template>
diff --git a/addons/point_of_sale/views/pos_templates.xml b/addons/point_of_sale/views/pos_templates.xml
index bc555a2ab6d..5ff4b1f1a04 100644
--- a/addons/point_of_sale/views/pos_templates.xml
+++ b/addons/point_of_sale/views/pos_templates.xml
@@ -75,7 +75,7 @@
</script>
</template>
-<template id="pos_editor_assets" inherit_id="web_editor.wysiwyg_snippets">
+<template id="pos_editor_assets" inherit_id="web_editor.assets_wysiwyg">
<xpath expr="//script[last()]" position="after">
<script type="text/javascript" src="/point_of_sale/static/src/js/pos.web_editor.js"/>
</xpath>
diff --git a/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js b/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js
index 64b7c6a8f8c..c0709a2c90e 100644
--- a/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js
+++ b/addons/web_editor/static/src/js/wysiwyg/wysiwyg_iframe.js
@@ -23,9 +23,6 @@ Wysiwyg.include({
init: function (parent, options) {
this._super.apply(this, arguments);
if (this.options.inIframe) {
- if (!this.options.iframeCssAssets) {
- this.options.iframeCssAssets = 'web_editor.wysiwyg_iframe_css_assets';
- }
this._onUpdateIframeId = 'onLoad_' + this.id;
}
},
@@ -133,4 +130,4 @@ Wysiwyg.include({
},
});
-}); \ No newline at end of file
+});
diff --git a/addons/web_editor/static/src/scss/web_editor.variables.scss b/addons/web_editor/static/src/scss/web_editor.variables.scss
index e317fe7616b..fd821c547c2 100644
--- a/addons/web_editor/static/src/scss/web_editor.variables.scss
+++ b/addons/web_editor/static/src/scss/web_editor.variables.scss
@@ -48,6 +48,29 @@ $o-checklist-margin-left: 20px;
$o-checklist-checkmark-width: 2px;
$o-checklist-before-size: 13px;
+$o-wysiwyg-zindex: 1000;
+
+$o-wysiwyg-md-ease: cubic-bezier(0.19, 1, 0.22, 1) !default;
+
+$o-wysiwyg-font-family: Roboto,
+"Montserrat",
+"Segoe UI",
+"Helvetica Neue",
+Helvetica,
+Arial,
+sans-serif;
+
+$o-wysiwyg-toolbar-height: 32px;
+
+$o-wysiwyg-color: #212629 !default;
+$o-wysiwyg-color-light: #616669 !default;
+$o-wysiwyg-color-danger: #912629 !default;
+$o-wysiwyg-color-success: #219629 !default;
+$o-wysiwyg-bg-color: #f7f7f7 !default;
+$o-wysiwyg-bg-color-dark: #a7a7a7 !default;
+$o-wysiwyg-border-color: #a9a9a9 !default;
+
+
// ============ 'Preview' component Mixins ===============
// Create a "preview" work-area to edit/customize specific elements
@@ -66,6 +89,26 @@ $o-checklist-before-size: 13px;
box-shadow: 0 0 15px 2px #000;
}
+// Mixins for buttons with alpha bg-color
+@mixin o-alpha-button-preview {
+ position: relative;
+ z-index: 1;
+
+ // Place an overlay that inherit the button's bg-color.
+ &::before {
+ content: "";
+ @include o-position-absolute(0, 0, 0, 0);
+ background-color: inherit;
+ }
+
+ &::after {
+ content: "";
+ @include o-position-absolute(0, 0, 0, 0);
+ z-index: -1;
+ background-image: url('/web_editor/static/src/img/transparent.png');
+ background-size: 10px auto;
+ }
+}
// ============ Preservation mixins ===============
// Used to preserve web_editor and website UI from themes customizations
diff --git a/addons/web_editor/static/src/scss/wysiwyg_variables.scss b/addons/web_editor/static/src/scss/wysiwyg_variables.scss
deleted file mode 100644
index 2beafe71681..00000000000
--- a/addons/web_editor/static/src/scss/wysiwyg_variables.scss
+++ /dev/null
@@ -1,42 +0,0 @@
-// Mixins for buttons with alpha bg-color
-@mixin o-alpha-button-preview {
- position: relative;
- z-index: 1;
-
- // Place an overlay that inherit the button's bg-color.
- &::before {
- content: "";
- @include o-position-absolute(0, 0, 0, 0);
- background-color: inherit;
- }
-
- &::after {
- content: "";
- @include o-position-absolute(0, 0, 0, 0);
- z-index: -1;
- background-image: url('/web_editor/static/src/img/transparent.png');
- background-size: 10px auto;
- }
-}
-
-$o-wysiwyg-zindex: 1000;
-
-$o-wysiwyg-md-ease: cubic-bezier(0.19, 1, 0.22, 1) !default;
-
-$o-wysiwyg-font-family: Roboto,
-"Montserrat",
-"Segoe UI",
-"Helvetica Neue",
-Helvetica,
-Arial,
-sans-serif;
-
-$o-wysiwyg-toolbar-height: 32px;
-
-$o-wysiwyg-color: #212629 !default;
-$o-wysiwyg-color-light: #616669 !default;
-$o-wysiwyg-color-danger: #912629 !default;
-$o-wysiwyg-color-success: #219629 !default;
-$o-wysiwyg-bg-color: #f7f7f7 !default;
-$o-wysiwyg-bg-color-dark: #a7a7a7 !default;
-$o-wysiwyg-border-color: #a9a9a9 !default;
diff --git a/addons/web_editor/views/editor.xml b/addons/web_editor/views/editor.xml
index 8be49ec0c20..c16aca1485a 100644
--- a/addons/web_editor/views/editor.xml
+++ b/addons/web_editor/views/editor.xml
@@ -1,9 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
-<template id="wysiwyg_iframe_css_assets" name="CSS assets for wysiwyg iframe content">
-</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"/>
@@ -27,7 +24,6 @@
<t t-call="web._assets_helpers">
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/bootstrap_overridden.scss"/>
- <link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/wysiwyg_variables.scss"/>
</t>
<!-- integration -->
@@ -35,6 +31,8 @@
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/wysiwyg.scss"/>
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/wysiwyg_iframe.scss"/>
+ <link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/wysiwyg_snippets.scss"/>
+
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/fonts.js"/>
<script type="text/javascript" src="/web_editor/static/lib/nearest/jquery.nearest.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/base.js"/>
@@ -54,6 +52,9 @@
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/widgets/media_dialog.js"/>
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/widgets/widgets.js"/>
+ <script type="text/javascript" src="/web_editor/static/src/js/editor/snippets.editor.js"/>
+ <script type="text/javascript" src="/web_editor/static/src/js/editor/snippets.options.js"/>
+
<!-- Launcher -->
<script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/wysiwyg.js"/>
@@ -113,20 +114,9 @@
<link rel="stylesheet" type="text/css" href="/web_editor/static/lib/summernote/src/css/summernote.css"/>
</template>
-<template id="wysiwyg_snippets" inherit_id="web_editor.assets_wysiwyg" name="Wysiwyg Editor additional snippets">
- <xpath expr="script[@src='/web_editor/static/src/js/editor/rte.summernote.js']" position="after">
- <link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/wysiwyg_snippets.scss"/>
-
- <script type="text/javascript" src="/web_editor/static/lib/nearest/jquery.nearest.js"/>
- <script type="text/javascript" src="/web_editor/static/src/js/editor/snippets.editor.js"/>
- <script type="text/javascript" src="/web_editor/static/src/js/editor/snippets.options.js"/>
- </xpath>
-</template>
-
<template id="_assets_primary_variables" inherit_id="web._assets_primary_variables">
<xpath expr="//link[last()]" position="after">
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/web_editor.variables.scss"/>
- <link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/wysiwyg_variables.scss"/>
</xpath>
</template>
diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml
index b89cb0721b4..56e7219ab12 100644
--- a/addons/website/views/website_templates.xml
+++ b/addons/website/views/website_templates.xml
@@ -91,7 +91,6 @@
<template id="website.assets_wysiwyg" name="Website Editor Assets (used in website editor)">
<t t-call="web._assets_helpers">
<link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/bootstrap_overridden.scss"/>
- <link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/wysiwyg_variables.scss"/>
</t>
<link rel="stylesheet" type="text/scss" href="/website/static/src/scss/website.wysiwyg.scss"/>
<link rel="stylesheet" type="text/scss" href="/website/static/src/scss/website.editor.ui.scss"/>