diff --git a/src/js/darkwire.js b/src/js/darkwire.js index e344391..782048f 100644 --- a/src/js/darkwire.js +++ b/src/js/darkwire.js @@ -299,9 +299,9 @@ export default class Darkwire { } generateMessage(fileId, fileName, messageType) { - let message = '
is attempting to send you ' + fileName + ' (' + messageType + ')'; + let message = '
is attempting to send you ' + fileName + ' (' + messageType + ')'; message += '
WARNING: We cannot strictly verify the integrity of this file, its recipients or its owners. By accepting this file, you are liable for any risks that may arise from reciving this file.'; - message += '
Accept File
'; + message += '
Accept File
'; return message; } diff --git a/src/js/fileHandler.js b/src/js/fileHandler.js index fdedccc..df60dad 100644 --- a/src/js/fileHandler.js +++ b/src/js/fileHandler.js @@ -44,7 +44,7 @@ export default class FileHandler { } let fileId = uuid.v4(); - let confirmMessage = 'You are about to send ' + file.name + ' to all parties in this chat. Confirm | Cancel'; + let confirmMessage = 'You are about to send ' + file.name + ' to all participants in this chat. Confirm | Cancel'; let fileData = { id: fileId, file: file @@ -81,7 +81,7 @@ export default class FileHandler { fileName: file.name }; this.darkwire.encodeMessage(base64, fileType, additionalData).then((socketData) => { - this.chat.replaceMessage('#transfer-' + fileId, 'Sent ' + file.name); + this.chat.replaceMessage('#transfer-' + fileId, 'Sent ' + file.name + ''); this.socket.emit('new message', socketData); }); this.resetInput(); @@ -93,7 +93,8 @@ export default class FileHandler { destroyFile(fileId) { const file = _.findWhere(this.localFileQueue, {id: fileId}); this.localFileQueue = _.without(this.localFileQueue, file); - return this.chat.replaceMessage('#transfer-' + fileId, 'The file transfer for ' + file.file.name + ' has been canceled.'); + this.resetInput(); + return this.chat.replaceMessage('#transfer-' + fileId, 'The file transfer for ' + file.file.name + ' has been canceled.'); } createBlob(base64, fileType) { diff --git a/src/js/main.js b/src/js/main.js index 9c4ff0b..e784695 100644 --- a/src/js/main.js +++ b/src/js/main.js @@ -173,7 +173,7 @@ $(function() { let li; if (user.username === window.username) { // User is me - li = $('
  • ' + user.username + ' (you)
  • ').css('color', chat.getUsernameColor(user.username)); + li = $('
  • ' + user.username + ' (you)
  • ').css('color', chat.getUsernameColor(user.username)); } else { li = $('
  • ' + user.username + '
  • ').css('color', chat.getUsernameColor(user.username)); } @@ -259,7 +259,7 @@ $(function() { } } - darkwire.encodeMessage('Downloaded ' + file.additionalData.fileName, 'text').then((socketData) => { + darkwire.encodeMessage('Accepted ' + file.additionalData.fileName + '', 'text').then((socketData) => { socket.emit('new message', socketData); }).catch((err) => { console.log(err); diff --git a/src/public/style.css b/src/public/style.css index 606e38b..d59bced 100644 --- a/src/public/style.css +++ b/src/public/style.css @@ -74,6 +74,10 @@ p { margin: 15px 0 15px; } +a { + cursor: pointer; +} + /* Typography */ .bold { font-family: "SourceCodePro-Bold", diff --git a/test/acceptance/app.js b/test/acceptance/app.js index b18c63e..91bf9f8 100644 --- a/test/acceptance/app.js +++ b/test/acceptance/app.js @@ -193,7 +193,7 @@ describe('Darkwire', () => { browser.switchWindow(result.value[0], () => { browser.waitForElementPresent('span.messageBody', 5000, () => { browser.pause(5000); - browser.assert.containsText('span.messageBody', 'You are about to send ricky.jpg to all parties in this chat. Confirm | Cancel'); + browser.assert.containsText('span.messageBody', 'You are about to send ricky.jpg to all participants in this chat. Confirm | Cancel'); }); }); }); @@ -202,9 +202,9 @@ describe('Darkwire', () => { it('Should show sent confirmation message', () => { browser.windowHandles((result) => { browser.switchWindow(result.value[0], () => { - browser.waitForElementPresent('span.messageBody a:first-child', 5000, () => { - browser.click('span.messageBody a:first-child', () => { - browser.waitForElementNotPresent('span.messageBody a:first-child', 5000, () => { + browser.waitForElementPresent('a.file-trigger-confirm', 5000, () => { + browser.click('a.file-trigger-confirm', () => { + browser.waitForElementNotPresent('a.file-trigger-confirm', 5000, () => { browser.assert.containsText('span.messageBody', 'Sent ricky.jpg'); }); });