Last active
May 13, 2022 10:50
-
-
Save simahawk/b65d0e0911ab79194a07 to your computer and use it in GitHub Desktop.
Override Odoo website builder text editor options
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="utf-8" ?> | |
| <odoo> | |
| <template id="summernote" name="My summernote assets" inherit_id="web_editor.assets_editor"> | |
| <xpath expr="//script[last()]" position="after"> | |
| <script type="text/javascript" src="/my_mod/static/js/summernote_overrides.js"></script> | |
| </xpath> | |
| </template> | |
| </odoo> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| odoo.define('web_editor.summernote_override', function (require) { | |
| 'use strict'; | |
| var core = require('web.core'); | |
| var editor = require('web_editor.summernote'); | |
| require('summernote/summernote'); // wait that summernote is loaded | |
| var _t = core._t; | |
| var options = $.summernote.options; | |
| // limit style tags | |
| options.styleTags = ['p', 'blockquote']; | |
| // disable some editor features | |
| // XXX: this is not working, unfortunately but `options.styleTags` above is. weird :S | |
| options.toolbar = [ | |
| ['font', ['bold', 'italic', 'underline', 'clear']], | |
| ['para', ['ul', 'ol', 'paragraph']], | |
| ['height', ['height']], | |
| ['insert', ['link', 'picture', 'hr']], | |
| ['view', ['fullscreen', 'codeview']], | |
| ['help', ['help']] | |
| ]; | |
| return $.summernote; | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hmm i guess this is no longer valid in v15 ?