From 334bf078a4bfd600e1be4b22fc2511ca58aa4e94 Mon Sep 17 00:00:00 2001 From: Benjamin Vray Date: Fri, 4 Dec 2020 09:44:48 +0000 Subject: [FIX] website_forum, website_profile: disable editor toolbar options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this commit, the inline style added with some options of the editor toolbar when editing a textarea was removed due to the strip_style of the content field. Since we cannot remove this strip_style for security reasons, we can only disable options that add inline style. This commit closes #34288 closes odoo/odoo#62906 X-original-commit: 74e4114e20186e31343af12a673fa3e4bc4eac4a Signed-off-by: Jérémy Kersten (jke) --- addons/website_profile/static/src/js/website_profile.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'addons/website_profile') diff --git a/addons/website_profile/static/src/js/website_profile.js b/addons/website_profile/static/src/js/website_profile.js index 8030d06f0fe..105bdb03033 100644 --- a/addons/website_profile/static/src/js/website_profile.js +++ b/addons/website_profile/static/src/js/website_profile.js @@ -60,13 +60,26 @@ publicWidget.registry.websiteProfileEditor = publicWidget.Widget.extend({ return def; } + // Warning: Do not activate any option that adds inline style. + // Because the style is deleted after save. + var toolbar = [ + ['style', ['style']], + ['font', ['bold', 'italic', 'underline', 'clear']], + ['para', ['ul', 'ol', 'paragraph']], + ['table', ['table']], + ['insert', ['link', 'picture']], + ['history', ['undo', 'redo']], + ]; + var $textarea = this.$('textarea.o_wysiwyg_loader'); var loadProm = wysiwygLoader.load(this, $textarea[0], { + toolbar: toolbar, recordInfo: { context: this._getContext(), res_model: 'res.users', res_id: parseInt(this.$('input[name=user_id]').val()), }, + disableResizeImage: true, }).then(wysiwyg => { this._wysiwyg = wysiwyg; }); -- cgit v1.2.3