From 45fa0080d20f02f4eb9422c7255c8c4b3c095d66 Mon Sep 17 00:00:00 2001 From: Maximilian Mader Date: Sun, 6 Oct 2013 17:34:58 +0200 Subject: [PATCH] Adapt to WoltLab/WCF@d9e099418464c2e433725a139f6c5330672b150e --- file/js/be.bastelstu.Chat.litcoffee | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/file/js/be.bastelstu.Chat.litcoffee b/file/js/be.bastelstu.Chat.litcoffee index 1440f4c..41de5c9 100644 --- a/file/js/be.bastelstu.Chat.litcoffee +++ b/file/js/be.bastelstu.Chat.litcoffee @@ -951,28 +951,29 @@ Create a message containing the uploaded attachment li.click (event) => @_insert(event) filename = li.data 'filename' + internalFileID = li.data 'internalFileID' - if data.returnValues and data.returnValues.attachments[filename] - if data.returnValues.attachments[filename].tinyURL - li.find('.box32 > div.attachmentImageContainer > .icon-paper-clip').replaceWith $("""""") + if data.returnValues and data.returnValues.attachments[internalFileID] + if data.returnValues.attachments[internalFileID].tinyURL + li.find('.box32 > div.attachmentImageContainer > .icon-paper-clip').replaceWith $("""""") link = $ '' - link.attr {'href': data.returnValues.attachments[filename].url, 'title': filename} + link.attr {'href': data.returnValues.attachments[internalFileID].url, 'title': filename} - unless parseInt(data.returnValues.attachments[filename].isImage) is 0 + unless parseInt(data.returnValues.attachments[internalFileID].isImage) is 0 link.addClass('jsImageViewer') - if !data.returnValues.attachments[filename].tinyURL - li.find('.box32 > div.attachmentImageContainer > .icon-paper-clip').replaceWith $("""""") + if !data.returnValues.attachments[internalFileID].tinyURL + li.find('.box32 > div.attachmentImageContainer > .icon-paper-clip').replaceWith $("""""") li.find('.attachmentTinyThumbnail').wrap link - li.find('small').append data.returnValues.attachments[filename].formattedFilesize + li.find('small').append data.returnValues.attachments[internalFileID].formattedFilesize - li.data 'objectID', data.returnValues.attachments[filename].attachmentID + li.data 'objectID', data.returnValues.attachments[internalFileID].attachmentID deleteButton = $ """
  • - + #{WCF.Language.get('wcf.global.button.delete')} @@ -981,8 +982,8 @@ Create a message containing the uploaded attachment else $('#timsChatUpload .icon-spinner').removeClass('icon-spinner').addClass 'icon-ban-circle' - if data.returnValues and data.returnValues.errors[filename] - errorMessage = data.returnValues.errors[filename].errorType + if data.returnValues and data.returnValues.errors[internalFileID] + errorMessage = data.returnValues.errors[internalFileID].errorType else errorMessage = 'uploadFailed'