diff --git a/src/Phrasebook/Editor.vue b/src/Phrasebook/Editor.vue index 5e21df70..69fa1849 100644 --- a/src/Phrasebook/Editor.vue +++ b/src/Phrasebook/Editor.vue @@ -20,6 +20,7 @@ {{ p.name }} +

@@ -131,6 +132,10 @@ export default defineComponent({ { immediate: true } ); + function copyId() { + if (phrase.value) navigator.clipboard.writeText(phrase.value.id); + } + return { file, corpus, @@ -138,6 +143,7 @@ export default defineComponent({ phrase, translation, block, + copyId, }; }, }); diff --git a/src/Phrasebook/PhraseCard.vue b/src/Phrasebook/PhraseCard.vue index c0dc09a8..e53c62e1 100644 --- a/src/Phrasebook/PhraseCard.vue +++ b/src/Phrasebook/PhraseCard.vue @@ -34,6 +34,7 @@ import { computed, defineComponent, PropType, reactive, ref } from "vue"; import { Phrase, BlockSnapshot } from "./types"; import player from "@/audio-player"; +import { phrase } from "./main"; export default defineComponent({ components: { Context, Block, Notes, Flag, Seeker }, @@ -63,7 +64,7 @@ export default defineComponent({ props.lect, vblocks .map(({ state }) => state?.texts.map(({ plain }) => plain)) - .map((p) => "phrasebook/" + (p?.join("") ?? "")) + .map((p) => `phrasebook/${phrase.value?.id}/${p?.join("") ?? ""}`) ); else player.stop(); },