diff options
| author | qsm-odoo <qsm@odoo.com> | 2019-08-23 10:57:54 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2019-08-28 09:04:25 +0000 |
| commit | b47f097feb7f99be1296cde1f0cd1e4f950d83fd (patch) | |
| tree | 397f7248e6257fe91545b93ccccf5a531ad6b2a2 /addons/web_editor | |
| parent | 7acb22a5e5c9beceb18ed6fea691e14502b93ad7 (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
Diffstat (limited to 'addons/web_editor')
4 files changed, 49 insertions, 61 deletions
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> |
