mirror of
https://github.com/turboderp-org/exui.git
synced 2026-07-15 11:34:13 +00:00
Merge remote-tracking branch 'github/master'
This commit is contained in:
@@ -707,6 +707,14 @@ class ChatBlock {
|
||||
this.deleteBlock(false);
|
||||
});
|
||||
|
||||
span = document.createElement("span");
|
||||
span.classList.add("action");
|
||||
span.innerHTML = "⧉ Copy";
|
||||
this.actdiv.appendChild(span);
|
||||
span.addEventListener('click', () => {
|
||||
this.copyBlock();
|
||||
});
|
||||
|
||||
span = document.createElement("span");
|
||||
span.classList.add("action");
|
||||
span.innerHTML = "🖉 Edit";
|
||||
@@ -760,6 +768,15 @@ class ChatBlock {
|
||||
});
|
||||
}
|
||||
|
||||
copyBlock() {
|
||||
const text = this.block.text;
|
||||
navigator.clipboard.writeText(text).then(() => {
|
||||
console.log('Text copied to clipboard');
|
||||
}).catch(err => {
|
||||
console.error('Error in copying text: ', err);
|
||||
});
|
||||
}
|
||||
|
||||
editBlock() {
|
||||
this.element.classList.add("hidden_h");
|
||||
util.makeEditable(this.textBlock, null, (id, val) => {
|
||||
|
||||
Reference in New Issue
Block a user