From dd382e02dd03202430670d4208b0c343a4ba618f Mon Sep 17 00:00:00 2001 From: Elizabeth Danzberger Date: Mon, 19 Feb 2024 14:22:38 -0500 Subject: [PATCH 1/6] changed from link-specific message to general copy-paste message Signed-off-by: Elizabeth Danzberger --- src/mixins/CopyToClipboardMixin.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mixins/CopyToClipboardMixin.js b/src/mixins/CopyToClipboardMixin.js index d350e06352c..0ebd3177c32 100644 --- a/src/mixins/CopyToClipboardMixin.js +++ b/src/mixins/CopyToClipboardMixin.js @@ -10,23 +10,23 @@ export default { }, methods: { - async copyToClipboard(url) { + async copyToClipboard(content) { // change to loading status this.copyLoading = true // copy link to clipboard try { - await navigator.clipboard.writeText(url) + await navigator.clipboard.writeText(content) this.copySuccess = true this.copied = true // Notify success - showSuccess(t('collectives', 'Link copied')) + showSuccess(t('text', 'Copied to the clipboard')) } catch (error) { this.copySuccess = false this.copied = true showError( - `
${t('collectives', 'Could not copy link to the clipboard:')}
${url}
`, + `
${t('text', 'Could not copy to the clipboard')}
`, { isHTML: true }) } finally { this.copyLoading = false From ca0d4b0bdd0a612a3114f8ee00f751234e3267bf Mon Sep 17 00:00:00 2001 From: Elizabeth Danzberger Date: Mon, 19 Feb 2024 14:24:09 -0500 Subject: [PATCH 2/6] added code block copy button Signed-off-by: Elizabeth Danzberger --- src/nodes/CodeBlockView.vue | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/src/nodes/CodeBlockView.vue b/src/nodes/CodeBlockView.vue index 6780cf31aa2..0c03c8d4043 100644 --- a/src/nodes/CodeBlockView.vue +++ b/src/nodes/CodeBlockView.vue @@ -1,8 +1,21 @@