summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/lib/summernote/plugin/hello/summernote-ext-hello.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/plugin/hello/summernote-ext-hello.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/plugin/hello/summernote-ext-hello.js')
-rw-r--r--addons/web_editor/static/lib/summernote/plugin/hello/summernote-ext-hello.js81
1 files changed, 0 insertions, 81 deletions
diff --git a/addons/web_editor/static/lib/summernote/plugin/hello/summernote-ext-hello.js b/addons/web_editor/static/lib/summernote/plugin/hello/summernote-ext-hello.js
deleted file mode 100644
index 22e4f6ac034..00000000000
--- a/addons/web_editor/static/lib/summernote/plugin/hello/summernote-ext-hello.js
+++ /dev/null
@@ -1,81 +0,0 @@
-(function(factory) {
- /* global define */
- if (typeof define === 'function' && define.amd) {
- // AMD. Register as an anonymous module.
- define(['jquery'], factory);
- } else if (typeof module === 'object' && module.exports) {
- // Node/CommonJS
- module.exports = factory(require('jquery'));
- } else {
- // Browser globals
- factory(window.jQuery);
- }
-}(function($) {
- // Extends plugins for adding hello.
- // - plugin is external module for customizing.
- $.extend($.summernote.plugins, {
- /**
- * @param {Object} context - context object has status of editor.
- */
- 'hello': function(context) {
- var self = this;
-
- // ui has renders to build ui elements.
- // - you can create a button with `ui.button`
- var ui = $.summernote.ui;
-
- // add hello button
- context.memo('button.hello', function() {
- // create button
- var button = ui.button({
- contents: '<i class="fa fa-child"/> Hello',
- tooltip: 'hello',
- click: function() {
- self.$panel.show();
- self.$panel.hide(500);
- // invoke insertText method with 'hello' on editor module.
- context.invoke('editor.insertText', 'hello');
- }
- });
-
- // create jQuery object from button instance.
- var $hello = button.render();
- return $hello;
- });
-
- // This events will be attached when editor is initialized.
- this.events = {
- // This will be called after modules are initialized.
- 'summernote.init': function(we, e) {
- console.log('summernote initialized', we, e);
- },
- // This will be called when user releases a key on editable.
- 'summernote.keyup': function(we, e) {
- console.log('summernote keyup', we, e);
- }
- };
-
- // This method will be called when editor is initialized by $('..').summernote();
- // You can create elements for plugin
- this.initialize = function() {
- this.$panel = $('<div class="hello-panel"/>').css({
- position: 'absolute',
- width: 100,
- height: 100,
- left: '50%',
- top: '50%',
- background: 'red'
- }).hide();
-
- this.$panel.appendTo('body');
- };
-
- // This methods will be called when editor is destroyed by $('..').summernote('destroy');
- // You should remove elements on `initialize`.
- this.destroy = function() {
- this.$panel.remove();
- this.$panel = null;
- };
- }
- });
-}));