From d6c81460963d1fae6be712a1e506cbcb4e4b6388 Mon Sep 17 00:00:00 2001 From: N-Pex Date: Mon, 3 Nov 2025 09:44:08 +0100 Subject: [PATCH] "Copy link" for the verify button --- .../content-credentials/C2PAInfo.vue | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/src/components/content-credentials/C2PAInfo.vue b/src/components/content-credentials/C2PAInfo.vue index 5a6ab66..bf0ba70 100644 --- a/src/components/content-credentials/C2PAInfo.vue +++ b/src/components/content-credentials/C2PAInfo.vue @@ -14,10 +14,19 @@
- +
@@ -51,8 +60,10 @@ const props = defineProps<{ showFlagsOnly?: boolean; }>(); +const verifyLink = ref("https://contentcredentials.org/verify"); const infoText: Ref = ref(undefined); const details: Ref<(CCPropertyProps & { link?: string })[]> = ref([]); +const copiedVerifyLink = ref(false); const hasC2PA = computed(() => { return props.proof?.integrity?.c2pa !== undefined; @@ -117,6 +128,21 @@ const updateDetails = () => { details.value = d; }; +const copyVerifyLink = async () => { + if (copiedVerifyLink.value) return + try { + await navigator.clipboard.writeText(verifyLink.value); + // Success! + copiedVerifyLink.value = true; + setInterval(() => { + // Hide again + copiedVerifyLink.value = false; + }, 3000); + } catch ($e) { + console.error('Cannot copy'); + } +}; + watch( props, () => {