From 35b61822a8b12ebbdb455495479df6f2e13db03e Mon Sep 17 00:00:00 2001 From: Gorash Date: Tue, 20 Aug 2019 06:23:06 +0000 Subject: [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 Co-authored-by: Antoine Guenet Co-authored-by: Christophe Matthieu Co-authored-by: David Monjoie --- .../static/src/js/wysiwyg/plugin/codeview.js | 60 ---------------------- 1 file changed, 60 deletions(-) delete mode 100644 addons/web_editor/static/src/js/wysiwyg/plugin/codeview.js (limited to 'addons/web_editor/static/src/js/wysiwyg/plugin/codeview.js') diff --git a/addons/web_editor/static/src/js/wysiwyg/plugin/codeview.js b/addons/web_editor/static/src/js/wysiwyg/plugin/codeview.js deleted file mode 100644 index 01ffc52b205..00000000000 --- a/addons/web_editor/static/src/js/wysiwyg/plugin/codeview.js +++ /dev/null @@ -1,60 +0,0 @@ -odoo.define('web_editor.wysiwyg.plugin.codeview', function (require) { -'use strict'; - -var core = require('web.core'); -var Plugins = require('web_editor.wysiwyg.plugins'); -var registry = require('web_editor.wysiwyg.plugin.registry'); - -var _t = core._t; - - -var CodeviewPlugin = Plugins.codeview.extend({ - /** - * @override - */ - activate: function () { - this._super(); - if (this.$codable.height() === 0) { - this.$codable.height(180); - } - this.context.invoke('editor.hidePopover'); - this.context.invoke('editor.clearTarget'); - }, - /** - * @override - */ - deactivate: function () { - if ( - this.context.invoke('HelperPlugin.hasJinja', this.context.invoke('code')) && - !this.isBeingDestroyed - ) { - var message = _t("Your code contains JINJA conditions.\nRemove them to return to WYSIWYG HTML edition."); - this.do_warn(_t("Cannot edit HTML"), message); - this.$codable.focus(); - return; - } - this._super(); - this.$editable.css('height', ''); - }, - /** - * @override - */ - destroy: function () { - this.isBeingDestroyed = true; - this._super(); - }, - /** - * Force activation of the code view. - */ - forceActivate: function () { - if (!this.isActivated()) { - this.activate(); - } - }, -}); - -registry.add('codeview', CodeviewPlugin); - -return CodeviewPlugin; - -}); -- cgit v1.2.3