2023-11-12 22:55:24 +01:00
|
|
|
<script setup="setup">
|
|
|
|
|
2023-11-12 23:46:57 +01:00
|
|
|
const { etherpadApiUrl, etherpadPrefix } = useRuntimeConfig().public
|
|
|
|
|
2023-11-12 22:55:24 +01:00
|
|
|
const prikazi = ref(false)
|
|
|
|
const revisionId = ref(null)
|
|
|
|
|
2023-11-12 23:46:57 +01:00
|
|
|
const dodajPojem = async () => {
|
2023-11-12 22:55:24 +01:00
|
|
|
revisionId.value = crypto.randomUUID()
|
2023-11-12 23:46:57 +01:00
|
|
|
|
|
|
|
// Ustvari nov, prazen pad
|
|
|
|
const padId = etherpadPrefix + revisionId.value
|
|
|
|
const resp = await $fetch(`${etherpadApiUrl}/createPad?padID=${padId}&text=`)
|
2023-11-12 22:55:24 +01:00
|
|
|
prikazi.value = true
|
|
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
2023-06-15 20:45:38 +02:00
|
|
|
<template>
|
2023-11-12 22:55:24 +01:00
|
|
|
<div>
|
|
|
|
<div class="gumb" @click="dodajPojem()">
|
2023-06-15 20:45:38 +02:00
|
|
|
Dodaj pojem
|
2023-11-12 22:55:24 +01:00
|
|
|
</div>
|
|
|
|
<PojemForm v-if="prikazi" :revisionId="revisionId" />
|
|
|
|
</div>
|
2023-06-15 20:45:38 +02:00
|
|
|
</template>
|