From 7581490345a1bafbc8a3b46f607fefcec7cf97c1 Mon Sep 17 00:00:00 2001 From: Maximilian Mader Date: Sun, 6 Oct 2013 02:59:13 +0200 Subject: [PATCH] Improve attachment system Now it's possible to upload attachments and generate an attachment message. The attachments are registered in the database correctly and can be viewed WCF's attachment list in ACP. TODO: Proper design in frontend and some backend functions. --- file/js/be.bastelstu.Chat.litcoffee | 224 ++++++++++++++++-- file/lib/data/message/Message.class.php | 12 + file/lib/data/message/MessageAction.class.php | 72 ++++++ .../MessageAttachmentObjectType.class.php | 12 +- template/chat.tpl | 18 +- template/javascriptInclude.tpl | 2 +- 6 files changed, 315 insertions(+), 25 deletions(-) diff --git a/file/js/be.bastelstu.Chat.litcoffee b/file/js/be.bastelstu.Chat.litcoffee index 8ad112a..1440f4c 100644 --- a/file/js/be.bastelstu.Chat.litcoffee +++ b/file/js/be.bastelstu.Chat.litcoffee @@ -37,6 +37,7 @@ exposed by a function if necessary. current: {} allTime: {} currentRoom = {} + fileUploaded = no errorVisible = false inputErrorHidingTimer = null @@ -809,35 +810,218 @@ Remove the given callback from the given event. events[event].remove callback true - - if WCF?.Attachment?.Upload? + +The following code handles attachment uploads + +Enable attachment code if `WCF.Attachment.Upload` is defined + + if WCF?.Attachment?.Upload? and $('#timsChatUploadContainer').length Attachment = WCF.Attachment.Upload.extend + fileUploaded: no + +Initialize WCF.Attachment.Upload +See WCF.Attachment.Upload.init() + init: -> - @_super $('#timsChatUploadContainer'), $('