From: Alexander Ebert Date: Thu, 25 Aug 2016 17:19:26 +0000 (+0200) Subject: Fixed event handling X-Git-Tag: 3.0.0_Beta_1~501 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=3919fbc8caecb85a0b450afdec872e3830e5c011;p=GitHub%2FWoltLab%2FWCF.git Fixed event handling --- diff --git a/com.woltlab.wcf/templates/wysiwyg.tpl b/com.woltlab.wcf/templates/wysiwyg.tpl index c26711b263..f98501aaf2 100644 --- a/com.woltlab.wcf/templates/wysiwyg.tpl +++ b/com.woltlab.wcf/templates/wysiwyg.tpl @@ -158,6 +158,7 @@ // WoltLab specials 'WoltLabBlock', + 'WoltLabEvent', 'WoltLabKeydown', // WoltLab core @@ -169,7 +170,6 @@ 'WoltLabCode', 'WoltLabColor', 'WoltLabDropdown', - 'WoltLabEvent', 'WoltLabImage', 'WoltLabInlineCode', 'WoltLabInsert', diff --git a/wcfsetup/install/files/acp/templates/wysiwyg.tpl b/wcfsetup/install/files/acp/templates/wysiwyg.tpl index c26711b263..f98501aaf2 100644 --- a/wcfsetup/install/files/acp/templates/wysiwyg.tpl +++ b/wcfsetup/install/files/acp/templates/wysiwyg.tpl @@ -158,6 +158,7 @@ // WoltLab specials 'WoltLabBlock', + 'WoltLabEvent', 'WoltLabKeydown', // WoltLab core @@ -169,7 +170,6 @@ 'WoltLabCode', 'WoltLabColor', 'WoltLabDropdown', - 'WoltLabEvent', 'WoltLabImage', 'WoltLabInlineCode', 'WoltLabInsert', diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabEvent.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabEvent.js index 8f52ad7e9d..c9c11e2969 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabEvent.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabEvent.js @@ -45,6 +45,8 @@ $.Redactor.prototype.WoltLabEvent = function() { register: function(callbackName, callback) { require(['EventHandler'], (function(EventHandler) { + var uuid = this.uuid; + if (this._callbacks.indexOf(callbackName) === -1) { this.opts.callbacks[callbackName] = (function (event) { var data = { @@ -53,7 +55,7 @@ $.Redactor.prototype.WoltLabEvent = function() { redactor: this }; - EventHandler.fire('com.woltlab.wcf.redactor2', callbackName + '_' + this.WoltLabEvent._elementId, data); + EventHandler.fire('com.woltlab.wcf.redactor2', callbackName + '_' + uuid + '_' + this.WoltLabEvent._elementId, data); return (data.cancel === false); }).bind(this); @@ -62,7 +64,7 @@ $.Redactor.prototype.WoltLabEvent = function() { } require(['EventHandler'], (function(EventHandler) { - EventHandler.add('com.woltlab.wcf.redactor2', callbackName + '_' + this.WoltLabEvent._elementId, callback); + EventHandler.add('com.woltlab.wcf.redactor2', callbackName + '_' + uuid + '_' + this.WoltLabEvent._elementId, callback); }).bind(this)); }).bind(this)); }