SimpleChatTCRV:ChatMessage:Copy using PopOver menu & navigator
Currently only the text/content part is handled wrt copy. Image URL isnt handled, even if present.
This commit is contained in:
parent
6a67d002d6
commit
c0dbc1d59c
|
|
@ -1434,9 +1434,14 @@ class MultiChatUI {
|
|||
|
||||
this.elPopoverChatMsgCopyBtn.addEventListener('click', (ev) => {
|
||||
console.log(`DBUG:MCUI:ChatMsgPO:Copy:${this.curChatId}:${this.uniqIdChatMsgPO}`)
|
||||
let index = this.simpleChats[this.curChatId].get_chatmessage(this.uniqIdChatMsgPO)
|
||||
let items = new ClipboardItem({ });
|
||||
navigator.clipboard.write([items])
|
||||
let chatSession = this.simpleChats[this.curChatId]
|
||||
let index = chatSession.get_chatmessage(this.uniqIdChatMsgPO)
|
||||
let chat = chatSession.xchat[index]
|
||||
if (!chat.ns.has_content()) {
|
||||
return
|
||||
}
|
||||
let item = new ClipboardItem({ 'text/plain': new Blob([chat.ns.getContent()], { type: 'text/plain'}) });
|
||||
navigator.clipboard.write([item])
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue