|
|
@ -2,7 +2,7 @@
|
|
|
|
<div class="newMessageBanner" ref="newMessageBanner">
|
|
|
|
<div class="newMessageBanner" ref="newMessageBanner">
|
|
|
|
<reply-event v-if="replyTo" :event="replyTo" @click.native="resetReplyTo()"/>
|
|
|
|
<reply-event v-if="replyTo" :event="replyTo" @click.native="resetReplyTo()"/>
|
|
|
|
<div v-if="attachment" class="attachment">
|
|
|
|
<div v-if="attachment" class="attachment">
|
|
|
|
<event-content :content="attachment" class="attachmentContent" :compact="true"/>
|
|
|
|
<event-content :content="attachment" class="attachmentContent" :compact="true" :onUpdate="resizeMessageBanner()"/>
|
|
|
|
<icon
|
|
|
|
<icon
|
|
|
|
title="remove"
|
|
|
|
title="remove"
|
|
|
|
class="remove"
|
|
|
|
class="remove"
|
|
|
@ -13,6 +13,7 @@
|
|
|
|
<textarea
|
|
|
|
<textarea
|
|
|
|
@keyup.enter.exact="onSubmit(event)"
|
|
|
|
@keyup.enter.exact="onSubmit(event)"
|
|
|
|
@input="resizeMessageBanner(); sendTyping(2000);"
|
|
|
|
@input="resizeMessageBanner(); sendTyping(2000);"
|
|
|
|
|
|
|
|
@paste="onPaste"
|
|
|
|
v-model="event.content.body"
|
|
|
|
v-model="event.content.body"
|
|
|
|
ref="newMessageInput" class="newMessageInput"
|
|
|
|
ref="newMessageInput" class="newMessageInput"
|
|
|
|
rows="1" placeholder="type a message ..."
|
|
|
|
rows="1" placeholder="type a message ..."
|
|
|
@ -55,6 +56,7 @@ import {VEmojiPicker} from 'v-emoji-picker';
|
|
|
|
import EventContent from '@/components/eventContent';
|
|
|
|
import EventContent from '@/components/eventContent';
|
|
|
|
import SoundRecorder from '@/components/soundRecorder';
|
|
|
|
import SoundRecorder from '@/components/soundRecorder';
|
|
|
|
import FileUpload from '@/components/fileUpload';
|
|
|
|
import FileUpload from '@/components/fileUpload';
|
|
|
|
|
|
|
|
import {readFileBlob} from '@/lib/readFileBlob';
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: 'newMessage',
|
|
|
|
name: 'newMessage',
|
|
|
@ -157,6 +159,12 @@ export default {
|
|
|
|
'video': 'm.video'
|
|
|
|
'video': 'm.video'
|
|
|
|
}[fileType.split('/', 1)[0]] || 'm.file';
|
|
|
|
}[fileType.split('/', 1)[0]] || 'm.file';
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
onPaste(event){
|
|
|
|
|
|
|
|
let item = (event.clipboardData || event.originalEvent.clipboardData).items[0];
|
|
|
|
|
|
|
|
if (item.kind !== 'file') return false;
|
|
|
|
|
|
|
|
let file = item.getAsFile();
|
|
|
|
|
|
|
|
return readFileBlob(file).then(blob => this.setAttachment({blob, file}));
|
|
|
|
|
|
|
|
},
|
|
|
|
parseMessage,
|
|
|
|
parseMessage,
|
|
|
|
calcUserName
|
|
|
|
calcUserName
|
|
|
|
},
|
|
|
|
},
|
|
|
|