From 11ad84b8f8f0bdf80b9d7cdce4b43981475f4945 Mon Sep 17 00:00:00 2001 From: guy Date: Mon, 18 Sep 2017 21:14:07 +0800 Subject: [PATCH] add --- bi/base.js | 24 +++++++++++--------- dist/base.js | 24 +++++++++++--------- dist/bundle.js | 24 +++++++++++--------- src/base/richeditor/bar/button.richeditor.js | 5 ++++ src/base/richeditor/bar/texttoolbar.js | 11 ++++----- src/base/richeditor/niceditor/niceditor.js | 1 + src/base/richeditor/richeditor.js | 7 ++---- 7 files changed, 52 insertions(+), 44 deletions(-) diff --git a/bi/base.js b/bi/base.js index 1fab1c8a13..c3981ad98e 100644 --- a/bi/base.js +++ b/bi/base.js @@ -16113,6 +16113,7 @@ BI.RichEditorAction = BI.inherit(BI.Widget, { o.editor.on(BI.NicEditor.EVENT_BLUR, function () { self.setEnable(false); }); + o.editor.on(BI.NicEditor.EVENT_KEY, BI.bind(this.key, this)); }, checkNodes: function (e) { @@ -16142,6 +16143,10 @@ BI.RichEditorAction = BI.inherit(BI.Widget, { return false; }, + key: function () { + + }, + activate: function () { }, @@ -16158,12 +16163,12 @@ BI.RichEditorAction = BI.inherit(BI.Widget, { * 颜色选择 * * Created by GUY on 2015/11/26. - * @class BI.TextToolbar + * @class BI.RichEditorTextToolbar * @extends BI.Widget */ -BI.TextToolbar = BI.inherit(BI.Widget, { +BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { _defaultConfig: function () { - return BI.extend(BI.TextToolbar.superclass._defaultConfig.apply(this, arguments), { + return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-text-toolbar bi-background", buttons: [ {type: "bi.rich_editor_size_chooser"}, @@ -16181,7 +16186,7 @@ BI.TextToolbar = BI.inherit(BI.Widget, { }, _init: function () { - BI.TextToolbar.superclass._init.apply(this, arguments); + BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); var self = this, o = this.options; BI.createWidget({ type: "bi.left", @@ -16196,8 +16201,7 @@ BI.TextToolbar = BI.inherit(BI.Widget, { }) }, }); -BI.TextToolbar.EVENT_CHANGE = "BI.TextToolbar.EVENT_CHANGE"; -BI.shortcut('bi.text_toolbar', BI.TextToolbar);/** +BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** * 富文本编辑器 * * Created by GUY on 2017/9/15. @@ -16271,6 +16275,7 @@ BI.shortcut('bi.text_toolbar', BI.TextToolbar);/** }); BI.NicEditor.EVENT_SELECTED = "selected"; BI.NicEditor.EVENT_BLUR = "blur"; + BI.NicEditor.EVENT_KEY = "key"; BI.shortcut('bi.nic_editor', BI.NicEditor); var prefix = "niceditor-"; @@ -17037,14 +17042,10 @@ BI.RichEditor = BI.inherit(BI.Widget, { }); this.toolbar = BI.createWidget({ - type: "bi.text_toolbar", + type: "bi.rich_editor_text_toolbar", editor: this.editor }); - this.toolbar.on(BI.TextToolbar.EVENT_CHANGE, function () { - var style = this.getValue(); - }); - this.combo = BI.createWidget({ type: "bi.combo", element: this, @@ -17057,6 +17058,7 @@ BI.RichEditor = BI.inherit(BI.Widget, { popup: { el: this.toolbar, height: 30, + stopPropagation: true, stopEvent: true } }); diff --git a/dist/base.js b/dist/base.js index af4959cf23..51d3a8f332 100644 --- a/dist/base.js +++ b/dist/base.js @@ -16113,6 +16113,7 @@ BI.RichEditorAction = BI.inherit(BI.Widget, { o.editor.on(BI.NicEditor.EVENT_BLUR, function () { self.setEnable(false); }); + o.editor.on(BI.NicEditor.EVENT_KEY, BI.bind(this.key, this)); }, checkNodes: function (e) { @@ -16142,6 +16143,10 @@ BI.RichEditorAction = BI.inherit(BI.Widget, { return false; }, + key: function () { + + }, + activate: function () { }, @@ -16158,12 +16163,12 @@ BI.RichEditorAction = BI.inherit(BI.Widget, { * 颜色选择 * * Created by GUY on 2015/11/26. - * @class BI.TextToolbar + * @class BI.RichEditorTextToolbar * @extends BI.Widget */ -BI.TextToolbar = BI.inherit(BI.Widget, { +BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { _defaultConfig: function () { - return BI.extend(BI.TextToolbar.superclass._defaultConfig.apply(this, arguments), { + return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-text-toolbar bi-background", buttons: [ {type: "bi.rich_editor_size_chooser"}, @@ -16181,7 +16186,7 @@ BI.TextToolbar = BI.inherit(BI.Widget, { }, _init: function () { - BI.TextToolbar.superclass._init.apply(this, arguments); + BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); var self = this, o = this.options; BI.createWidget({ type: "bi.left", @@ -16196,8 +16201,7 @@ BI.TextToolbar = BI.inherit(BI.Widget, { }) }, }); -BI.TextToolbar.EVENT_CHANGE = "BI.TextToolbar.EVENT_CHANGE"; -BI.shortcut('bi.text_toolbar', BI.TextToolbar);/** +BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** * 富文本编辑器 * * Created by GUY on 2017/9/15. @@ -16271,6 +16275,7 @@ BI.shortcut('bi.text_toolbar', BI.TextToolbar);/** }); BI.NicEditor.EVENT_SELECTED = "selected"; BI.NicEditor.EVENT_BLUR = "blur"; + BI.NicEditor.EVENT_KEY = "key"; BI.shortcut('bi.nic_editor', BI.NicEditor); var prefix = "niceditor-"; @@ -17037,14 +17042,10 @@ BI.RichEditor = BI.inherit(BI.Widget, { }); this.toolbar = BI.createWidget({ - type: "bi.text_toolbar", + type: "bi.rich_editor_text_toolbar", editor: this.editor }); - this.toolbar.on(BI.TextToolbar.EVENT_CHANGE, function () { - var style = this.getValue(); - }); - this.combo = BI.createWidget({ type: "bi.combo", element: this, @@ -17057,6 +17058,7 @@ BI.RichEditor = BI.inherit(BI.Widget, { popup: { el: this.toolbar, height: 30, + stopPropagation: true, stopEvent: true } }); diff --git a/dist/bundle.js b/dist/bundle.js index 9999c5b6b1..ed49930645 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -44919,6 +44919,7 @@ BI.RichEditorAction = BI.inherit(BI.Widget, { o.editor.on(BI.NicEditor.EVENT_BLUR, function () { self.setEnable(false); }); + o.editor.on(BI.NicEditor.EVENT_KEY, BI.bind(this.key, this)); }, checkNodes: function (e) { @@ -44948,6 +44949,10 @@ BI.RichEditorAction = BI.inherit(BI.Widget, { return false; }, + key: function () { + + }, + activate: function () { }, @@ -44964,12 +44969,12 @@ BI.RichEditorAction = BI.inherit(BI.Widget, { * 颜色选择 * * Created by GUY on 2015/11/26. - * @class BI.TextToolbar + * @class BI.RichEditorTextToolbar * @extends BI.Widget */ -BI.TextToolbar = BI.inherit(BI.Widget, { +BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { _defaultConfig: function () { - return BI.extend(BI.TextToolbar.superclass._defaultConfig.apply(this, arguments), { + return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-text-toolbar bi-background", buttons: [ {type: "bi.rich_editor_size_chooser"}, @@ -44987,7 +44992,7 @@ BI.TextToolbar = BI.inherit(BI.Widget, { }, _init: function () { - BI.TextToolbar.superclass._init.apply(this, arguments); + BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); var self = this, o = this.options; BI.createWidget({ type: "bi.left", @@ -45002,8 +45007,7 @@ BI.TextToolbar = BI.inherit(BI.Widget, { }) }, }); -BI.TextToolbar.EVENT_CHANGE = "BI.TextToolbar.EVENT_CHANGE"; -BI.shortcut('bi.text_toolbar', BI.TextToolbar);/** +BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar);/** * 富文本编辑器 * * Created by GUY on 2017/9/15. @@ -45077,6 +45081,7 @@ BI.shortcut('bi.text_toolbar', BI.TextToolbar);/** }); BI.NicEditor.EVENT_SELECTED = "selected"; BI.NicEditor.EVENT_BLUR = "blur"; + BI.NicEditor.EVENT_KEY = "key"; BI.shortcut('bi.nic_editor', BI.NicEditor); var prefix = "niceditor-"; @@ -45843,14 +45848,10 @@ BI.RichEditor = BI.inherit(BI.Widget, { }); this.toolbar = BI.createWidget({ - type: "bi.text_toolbar", + type: "bi.rich_editor_text_toolbar", editor: this.editor }); - this.toolbar.on(BI.TextToolbar.EVENT_CHANGE, function () { - var style = this.getValue(); - }); - this.combo = BI.createWidget({ type: "bi.combo", element: this, @@ -45863,6 +45864,7 @@ BI.RichEditor = BI.inherit(BI.Widget, { popup: { el: this.toolbar, height: 30, + stopPropagation: true, stopEvent: true } }); diff --git a/src/base/richeditor/bar/button.richeditor.js b/src/base/richeditor/bar/button.richeditor.js index 21854e6c13..938efb669f 100644 --- a/src/base/richeditor/bar/button.richeditor.js +++ b/src/base/richeditor/bar/button.richeditor.js @@ -25,6 +25,7 @@ BI.RichEditorAction = BI.inherit(BI.Widget, { o.editor.on(BI.NicEditor.EVENT_BLUR, function () { self.setEnable(false); }); + o.editor.on(BI.NicEditor.EVENT_KEY, BI.bind(this.key, this)); }, checkNodes: function (e) { @@ -54,6 +55,10 @@ BI.RichEditorAction = BI.inherit(BI.Widget, { return false; }, + key: function () { + + }, + activate: function () { }, diff --git a/src/base/richeditor/bar/texttoolbar.js b/src/base/richeditor/bar/texttoolbar.js index 1f605fc976..2b0379f583 100644 --- a/src/base/richeditor/bar/texttoolbar.js +++ b/src/base/richeditor/bar/texttoolbar.js @@ -2,12 +2,12 @@ * 颜色选择 * * Created by GUY on 2015/11/26. - * @class BI.TextToolbar + * @class BI.RichEditorTextToolbar * @extends BI.Widget */ -BI.TextToolbar = BI.inherit(BI.Widget, { +BI.RichEditorTextToolbar = BI.inherit(BI.Widget, { _defaultConfig: function () { - return BI.extend(BI.TextToolbar.superclass._defaultConfig.apply(this, arguments), { + return BI.extend(BI.RichEditorTextToolbar.superclass._defaultConfig.apply(this, arguments), { baseCls: "bi-text-toolbar bi-background", buttons: [ {type: "bi.rich_editor_size_chooser"}, @@ -25,7 +25,7 @@ BI.TextToolbar = BI.inherit(BI.Widget, { }, _init: function () { - BI.TextToolbar.superclass._init.apply(this, arguments); + BI.RichEditorTextToolbar.superclass._init.apply(this, arguments); var self = this, o = this.options; BI.createWidget({ type: "bi.left", @@ -40,5 +40,4 @@ BI.TextToolbar = BI.inherit(BI.Widget, { }) }, }); -BI.TextToolbar.EVENT_CHANGE = "BI.TextToolbar.EVENT_CHANGE"; -BI.shortcut('bi.text_toolbar', BI.TextToolbar); \ No newline at end of file +BI.shortcut('bi.rich_editor_text_toolbar', BI.RichEditorTextToolbar); \ No newline at end of file diff --git a/src/base/richeditor/niceditor/niceditor.js b/src/base/richeditor/niceditor/niceditor.js index 3a68278bf7..2f233f7343 100644 --- a/src/base/richeditor/niceditor/niceditor.js +++ b/src/base/richeditor/niceditor/niceditor.js @@ -72,6 +72,7 @@ }); BI.NicEditor.EVENT_SELECTED = "selected"; BI.NicEditor.EVENT_BLUR = "blur"; + BI.NicEditor.EVENT_KEY = "key"; BI.shortcut('bi.nic_editor', BI.NicEditor); var prefix = "niceditor-"; diff --git a/src/base/richeditor/richeditor.js b/src/base/richeditor/richeditor.js index f752be9743..5c9c78f2e4 100644 --- a/src/base/richeditor/richeditor.js +++ b/src/base/richeditor/richeditor.js @@ -25,14 +25,10 @@ BI.RichEditor = BI.inherit(BI.Widget, { }); this.toolbar = BI.createWidget({ - type: "bi.text_toolbar", + type: "bi.rich_editor_text_toolbar", editor: this.editor }); - this.toolbar.on(BI.TextToolbar.EVENT_CHANGE, function () { - var style = this.getValue(); - }); - this.combo = BI.createWidget({ type: "bi.combo", element: this, @@ -45,6 +41,7 @@ BI.RichEditor = BI.inherit(BI.Widget, { popup: { el: this.toolbar, height: 30, + stopPropagation: true, stopEvent: true } });