From 4f25641706f99b4411a0e4e1a48d45fa0ee1e0b1 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Mon, 24 Oct 2016 10:53:57 +0200 Subject: [PATCH] Added support for legacy clipboard action objects --- wcfsetup/install/files/js/WCF.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index da301d810b..a920a608eb 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -1312,12 +1312,24 @@ WCF.Clipboard = { * @param integer pageObjectID */ init: function(page, hasMarkedItems, actionObjects, pageObjectID) { - require(['WoltLabSuite/Core/Controller/Clipboard'], function(ControllerClipboard) { + require(['EventHandler', 'WoltLabSuite/Core/Controller/Clipboard'], function(EventHandler, ControllerClipboard) { ControllerClipboard.setup({ hasMarkedItems: (hasMarkedItems > 0), pageClassName: page, pageObjectId: pageObjectID }); + + for (var type in actionObjects) { + if (actionObjects.hasOwnProperty(type)) { + (function (type) { + EventHandler.add('com.woltlab.wcf.clipboard', type, function (data) { + if (actionObjects[type].hasOwnProperty(data.responseData.actionName)) { + actionObjects[type][data.responseData.actionName].triggerEffect(data.responseData.objectIDs); + } + }); + })(type); + } + } }); }, -- 2.20.1