2023-09-30 20:14:02 +02:00
|
|
|
<script setup="setup">
|
|
|
|
|
|
|
|
import { ref } from 'vue'
|
|
|
|
|
|
|
|
const { etherpadUrl, etherpadPrefix } = useRuntimeConfig().public
|
|
|
|
|
|
|
|
const props = defineProps({
|
2023-11-12 22:55:24 +01:00
|
|
|
revisionId: String,
|
|
|
|
onLoad: Function
|
2023-09-30 20:14:02 +02:00
|
|
|
})
|
|
|
|
|
|
|
|
const embed = ref(null)
|
|
|
|
|
|
|
|
onMounted(() => {
|
2023-11-12 22:55:24 +01:00
|
|
|
// Ce ni revisionId propertyja, se random generira.
|
2023-09-30 20:14:02 +02:00
|
|
|
const uuid = props.revisionId ? props.revisionId : crypto.randomUUID()
|
2023-11-12 23:46:57 +01:00
|
|
|
const padUrl = `${etherpadUrl}/p/${etherpadPrefix}${uuid}?showChat=false&showLineNumbers=false&toc=false`
|
2023-09-30 20:14:02 +02:00
|
|
|
embed.value.src = padUrl
|
|
|
|
})
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-11-12 22:55:24 +01:00
|
|
|
<iframe ref="embed" class="etherpad-textarea" @load="props.onLoad" />
|
2023-09-30 20:14:02 +02:00
|
|
|
</template>
|