<data xmlns="http://www.woltlab.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.woltlab.com http://www.woltlab.com/XSD/maelstrom/clipboardAction.xsd">
<import>
<!-- conversation -->
- <action name="label">
+ <action name="assignLabel">
<actionclassname><![CDATA[wcf\system\clipboard\action\ConversationClipboardAction]]></actionclassname>
<showorder>1</showorder>
<pages>
}
});
+/**
+ * Provides extended actions for thread clipboard actions.
+ */
+WCF.Conversation.Clipboard = Class.extend({
+ /**
+ * editor handler
+ * @var WCF.Conversation.EditorHandler
+ */
+ _editorHandler: null,
+
+ /**
+ * Initializes a new WCF.Conversation.Clipboard object.
+ *
+ * @param WCF.Conversation.EditorHandler editorHandler
+ */
+ init: function(editorHandler) {
+ this._editorHandler = editorHandler;
+
+ // bind listener
+ $('.jsClipboardEditor').each($.proxy(function(index, container) {
+ var $container = $(container);
+ var $types = eval($container.data('types'));
+ if (WCF.inArray('com.woltlab.wcf.conversation.conversation', $types)) {
+ $container.on('clipboardAction', $.proxy(this._execute, this));
+ $container.on('clipboardActionResponse', $.proxy(this._evaluateResponse, this));
+ return false;
+ }
+ }, this));
+ },
+
+ /**
+ * Handles clipboard actions.
+ *
+ * @param object event
+ * @param string type
+ * @param string actionName
+ * @param object parameters
+ */
+ _execute: function(event, type, actionName, parameters) {
+ if (type === 'com.woltlab.wcf.conversation.conversation' && actionName === 'conversation.assignLabel') {
+ new WCF.Conversation.Label.Editor(this._editorHandler, null, parameters.objectTypeIDs);
+ }
+ }
+});
+
/**
* Inline editor implementation for conversations.
*
public function execute(array $objects, $actionName, $typeData = array()) {
$item = new ClipboardEditorItem();
- // DEBUG ONLY
- if ($actionName == 'label') $actionName = 'assignLabel';
- // DEBUG ONLY
-
switch ($actionName) {
case 'assignLabel':
$conversationIDs = $this->validateAssignLabels($objects);
$item->addParameter('objectIDs', $conversationIDs);
$item->addParameter('actionName', 'assignLabel');
- $item->addParameter('className', 'wcf\data\conversation\label\ConversationLabelAction');
$item->setName('conversation.assignLabel');
break;
var $editorHandler = new WCF.Conversation.EditorHandler();
var $inlineEditor = new WCF.Conversation.InlineEditor('.conversation');
$inlineEditor.setEditorHandler($editorHandler);
+
+ new WCF.Conversation.Clipboard($editorHandler);
new WCF.Conversation.Label.Manager('{link controller='ConversationList'}{if $filter}filter={@$filter}{/if}&sortField={$sortField}&sortOrder={$sortOrder}&pageNo={@$pageNo}{/link}');
});
//]]>