diff options
| author | sri-odoo <sri@odoo.com> | 2019-08-29 13:48:12 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2019-10-01 16:52:20 +0000 |
| commit | c8c8eb3d5652e9834d0ecd5aad907ee359edb657 (patch) | |
| tree | 854984a5b6010953d8087337bc02e4e786dc4269 /addons/web_editor/static | |
| parent | 83284a962cdbce53a30a42e2282953d777949fa1 (diff) | |
[IMP] website_forum, *: revamp design
* web_editor, website_profile
Part of https://github.com/odoo/odoo/pull/35749
task-2024197
Co-authored-by: Jérémy Kersten <jke@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
Co-authored-by: fja-odoo <fja@odoo.com>
Diffstat (limited to 'addons/web_editor/static')
| -rw-r--r-- | addons/web_editor/static/src/js/editor/summernote.js | 7 | ||||
| -rw-r--r-- | addons/web_editor/static/src/js/wysiwyg/root.js | 22 |
2 files changed, 26 insertions, 3 deletions
diff --git a/addons/web_editor/static/src/js/editor/summernote.js b/addons/web_editor/static/src/js/editor/summernote.js index 3d2c4c205d4..4228d353d1a 100644 --- a/addons/web_editor/static/src/js/editor/summernote.js +++ b/addons/web_editor/static/src/js/editor/summernote.js @@ -3,6 +3,7 @@ odoo.define('web_editor.summernote', function (require) { var core = require('web.core'); require('summernote/summernote'); // wait that summernote is loaded +var weDefaultOptions = require('web_editor.wysiwyg.default_options'); var _t = core._t; @@ -1044,7 +1045,7 @@ options.keyMap.mac['ESCAPE'] = 'cancel'; options.keyMap.mac['UP'] = 'up'; options.keyMap.mac['DOWN'] = 'down'; -options.styleTags = ['p', 'pre', 'small', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote']; +options.styleTags = weDefaultOptions.styleTags; $.summernote.pluginEvents.insertTable = function (event, editor, layoutInfo, sDim) { var $editable = layoutInfo.editable(); @@ -2083,7 +2084,7 @@ eventHandler.modules.editor.currentStyle = function (target) { return styleInfo; }; -options.fontSizes = [_t('Default'), 8, 9, 10, 11, 12, 14, 18, 24, 36, 48, 62]; +options.fontSizes = weDefaultOptions.fontSizes; $.summernote.pluginEvents.applyFont = function (event, editor, layoutInfo, color, bgcolor, size) { var r = range.create(); if (!r) return; @@ -2486,7 +2487,7 @@ function mouseDownChecklist (e) { $lis.addClass('o_checked'); } while ($lis.length); } -}; +} var fn_attach = eventHandler.attach; eventHandler.attach = function (oLayoutInfo, options) { diff --git a/addons/web_editor/static/src/js/wysiwyg/root.js b/addons/web_editor/static/src/js/wysiwyg/root.js index c2b3d703733..e5c225e646d 100644 --- a/addons/web_editor/static/src/js/wysiwyg/root.js +++ b/addons/web_editor/static/src/js/wysiwyg/root.js @@ -60,3 +60,25 @@ var WysiwygRoot = Widget.extend({ return WysiwygRoot; }); + +odoo.define('web_editor.wysiwyg.default_options', function (require) { +'use strict'; + +/** + * TODO this should be refactored to be done another way, same as the 'root' + * module that should be done another way. + * + * This allows to have access to default options that are used in the summernote + * editor so that they can be tweaked (instead of entirely replaced) when using + * the editor on an editable content. + */ + +var core = require('web.core'); + +var _lt = core._lt; + +return { + styleTags: ['p', 'pre', 'small', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'blockquote'], + fontSizes: [_lt('Default'), 8, 9, 10, 11, 12, 14, 18, 24, 36, 48, 62], +}; +}); |
