diff options
| author | Gorash <chm@odoo.com> | 2019-08-20 06:23:06 +0000 |
|---|---|---|
| committer | David Monjoie <dmo@odoo.com> | 2019-08-21 18:52:36 +0000 |
| commit | 35b61822a8b12ebbdb455495479df6f2e13db03e (patch) | |
| tree | 999c382ea06b53b8da8d7db2d82e671d831dd856 /addons/web_editor/views/editor.xml | |
| parent | f14cecfc0a7f401533213aaa968ee233e19d1325 (diff) | |
[REV] wev_editor, website: revert saas-12.2 editor
This commit reverts the saas-12.2 editor by putting back the editor
of Odoo 12.
The saas-12.2 editor was an intermediate work between the previous
editor of Odoo 12 and the new one slated for Odoo 13. It was unstable
but it was supposed to be replaced by the new editor of version 13.
However, since the new editor has been postponed to Odoo 14, the
saas-12.2 one would have been staying in Odoo 13, which would have
been a nightmare to maintain. To avoid this outcome, we chose to
put back the 12.0 editor in its place.
This has the particular advantage that Odoo 13 will share the same
bugfixes as Odoo 12 and 11 as they all run under the same core
editor, while the saas-12.2 one would have been an entirely
different beast to maintain.
This is a partial revert of f2969923.
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.xml | 104 |
1 files changed, 67 insertions, 37 deletions
diff --git a/addons/web_editor/views/editor.xml b/addons/web_editor/views/editor.xml index 3f1fdce0aef..38d56407dbe 100644 --- a/addons/web_editor/views/editor.xml +++ b/addons/web_editor/views/editor.xml @@ -13,10 +13,9 @@ <template id="assets_wysiwyg" name="Wysiwyg Editor Assets"> <!-- lib --> - <link rel="stylesheet" type="text/css" href="/web_editor/static/lib/summernote/summernote.css"/> - <link rel="stylesheet" type="text/css" href="/web_editor/static/lib/cropper/css/cropper.css"/> + <t t-call-assets="web_editor.summernote"/> - <script type="text/javascript" src="/web_editor/static/lib/summernote/summernote.js"/> + <link rel="stylesheet" type="text/css" href="/web_editor/static/lib/cropper/css/cropper.css"/> <script type="text/javascript" src="/web_editor/static/lib/cropper/js/cropper.js"/> <script type="text/javascript" src="/web_editor/static/lib/jQuery.transfo.js"/> @@ -24,6 +23,7 @@ <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 --> @@ -31,12 +31,13 @@ <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"/> - <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_iframe.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin_registry.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/options.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/translation.js"/> <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"/> + <script type="text/javascript" src="/web_editor/static/src/js/editor/editor.js"/> + <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/tours/rte.js"/> <!-- widgets & plugins --> @@ -49,40 +50,70 @@ <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/wysiwyg/plugin/abstract.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/plugins.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/helper.js"/> - - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/toolbar.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/dropzone.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/history.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/table.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/text.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/editor.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/media.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/buttons.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/link.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/font.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/font_buttons.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/keyboard.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/unbreakable.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/transform.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/hint.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/bullet.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/codeview.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/plugin/help_dialog.js"/> + <!-- Launcher --> + + <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg/wysiwyg.js"/> +</template> + +<template id="summernote" name="Summernote"> + <script type="text/javascript"> + (function () { + "use strict"; + odoo.define('jquery', function () {return $;}); + + var uniqId = 0; + odoo.__define__ = window.define; + window.define = function (id) { + var args = Array.prototype.slice.call(arguments); + var factorie = args.pop(); + var id = args[0]; + + if (id instanceof Array) { + var name = "summernote_factorie_" + (++uniqId); + odoo[name] = factorie; + + var head = ''; + var fn = 'var fn = odoo.'+name+';\ndelete odoo.'+name+';\n'; + fn += 'return fn('; + for (var k=0; k<id.length; k++) { + head += 'var a'+(++uniqId)+' = require("'+id[k]+'");\n'; + fn += 'a'+uniqId+', '; + } + fn += 'null);'; + + odoo.define(odoo.website_next_define, new Function('require', head + fn)); + } else { + odoo.define(id, factorie); + } + }; + })(); + </script> + <t t-set="summer_js_files" t-value="['core/async', 'core/func', 'core/agent', 'core/list', + 'core/dom', 'core/key', 'core/range', 'editing/Bullet', 'editing/History', 'editing/Style', + 'editing/Table', 'editing/Typing', 'module/Editor', 'module/Button', 'module/Clipboard', + 'module/Codeview', 'module/DragAndDrop', 'module/Fullscreen', 'module/Handle', + 'module/HelpDialog', 'module/ImageDialog', 'module/LinkDialog', 'module/Popover', + 'module/Statusbar', 'module/Toolbar', 'Renderer', 'EventHandler', 'defaults', 'summernote']" /> + <t t-foreach="summer_js_files" t-as="file"> + <script>odoo.website_next_define = 'summernote/<t t-esc="file" />';</script> + <script type="text/javascript" t-attf-src="/web_editor/static/lib/summernote/src/js/{{ file }}.js"></script> + </t> + <script type="text/javascript" src="/web_editor/static/src/js/editor/summernote.js" /> + <script type="text/javascript"> + window.define = odoo.__define__; + delete odoo.__define__; + delete odoo.website_next_define; + </script> + <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="." position="inside"> - <link rel="stylesheet" type="text/scss" href="/web_editor/static/src/scss/wysiwyg_variables.scss"/> + <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/wysiwyg_snippets/wysiwyg_snippets.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg_snippets/snippets.editor.js"/> - <script type="text/javascript" src="/web_editor/static/src/js/wysiwyg_snippets/snippets.options.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> @@ -121,7 +152,6 @@ </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> |
