summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/lib/summernote/src/js/app.js
diff options
context:
space:
mode:
authorGorash <chm@odoo.com>2019-08-19 09:51:34 +0000
committerDavid Monjoie <dmo@odoo.com>2019-08-21 18:52:19 +0000
commitf14cecfc0a7f401533213aaa968ee233e19d1325 (patch)
treee037e1372e7d0c426fc067e18a55b9d347faeeaa /addons/web_editor/static/lib/summernote/src/js/app.js
parent3dccf0dffd80ac8c4dfa884b55b62a76f23ae341 (diff)
[REV] web_editor: revert summernote update
Summernote was updated alongside the new editor of saas-12.2. However, since we are putting back the editor of 12.0, summernote needs to be downgraded back to the version that was compatible with the 12.0 editor. This is a revert of 17c6d005. 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/static/lib/summernote/src/js/app.js')
-rw-r--r--addons/web_editor/static/lib/summernote/src/js/app.js42
1 files changed, 42 insertions, 0 deletions
diff --git a/addons/web_editor/static/lib/summernote/src/js/app.js b/addons/web_editor/static/lib/summernote/src/js/app.js
new file mode 100644
index 00000000000..fba17afd588
--- /dev/null
+++ b/addons/web_editor/static/lib/summernote/src/js/app.js
@@ -0,0 +1,42 @@
+require.config({
+ baseUrl: 'src/js',
+ paths: {
+ jquery: '//code.jquery.com/jquery-1.11.3',
+ bootstrap: '//netdna.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min',
+ summernotevideo: '/../../plugin/summernote-ext-video',
+ CodeMirror: '//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/codemirror',
+ CodeMirrorXml: '//cdnjs.cloudflare.com/ajax/libs/codemirror/3.20.0/mode/xml/xml.min',
+ CodeMirrorFormatting: '//cdnjs.cloudflare.com/ajax/libs/codemirror/2.36.0/formatting.min'
+ },
+ shim: {
+ bootstrap: ['jquery'],
+ CodeMirror: { exports: 'CodeMirror' },
+ CodeMirrorXml: ['CodeMirror'],
+ CodeMirrorFormatting: ['CodeMirror', 'CodeMirrorXml'],
+ summernotevideo: ['summernote']
+ },
+ packages: [{
+ name: 'summernote',
+ location: './',
+ main: 'summernote'
+ }]
+});
+
+require([
+ 'jquery', 'bootstrap', 'CodeMirrorFormatting',
+ 'summernote', 'summernotevideo'
+], function ($) {
+ // summernote
+ $('.summernote').summernote({
+ height: 300, // set editable area's height
+ focus: true, // set focus editable area after summernote loaded
+ tabsize: 2, // size of tab
+ placeholder: 'Type your message here...', // set editable area's placeholder text
+ codemirror: { // code mirror options
+ mode: 'text/html',
+ htmlMode: true,
+ lineNumbers: true,
+ theme: 'monokai'
+ }
+ });
+});