kjdskjk
This commit is contained in:
@@ -1,11 +1,8 @@
|
||||
<script setup>
|
||||
import { onMounted, onUnmounted, ref, createApp } from 'vue';
|
||||
import ToastManager from '~/components/managers/ToastManager.vue';
|
||||
import { emitter } from '~/services/Emitter';
|
||||
import { GetWidget, ParseMarkdown } from '~/services/Marker';
|
||||
import Server from '~/services/Server';
|
||||
import { DisplayToast } from '~/services/Toaster';
|
||||
import TestWidget from '../widgets/TestWidget.vue';
|
||||
import { DeleteNote, FetchCampaignNotes } from '~/services/Content';
|
||||
|
||||
// import { GetNote, GetContent } from '@/services/Content';
|
||||
const props = defineProps(['text', 'title', 'noteKey']);
|
||||
@@ -15,12 +12,11 @@ const sourceText = ref(''); // Original markdown source, used for editing
|
||||
const displayText = ref(''); // Compiled HTML from markdown
|
||||
|
||||
const editingMode = ref(false);
|
||||
const editableTitle = ref(null);
|
||||
const title = ref(props.title);
|
||||
const displayTitle = ref('');
|
||||
|
||||
function closeNote(){
|
||||
emitter.emit('delete-note', props.noteKey);
|
||||
DeleteNote(props.noteKey);
|
||||
}
|
||||
|
||||
const compiledMarkdown = computed(() => {
|
||||
@@ -29,7 +25,7 @@ const compiledMarkdown = computed(() => {
|
||||
|
||||
function mountComponents() {
|
||||
// Should no need more
|
||||
const widget_types = ['display', 'inline'];
|
||||
const widget_types = ['display', 'inline', 'link'];
|
||||
widget_types.forEach((widget_type) => {
|
||||
const nodes = document.querySelectorAll('.vue-component-' + widget_type);
|
||||
nodes.forEach(el => {
|
||||
@@ -96,6 +92,7 @@ function SaveNote(){
|
||||
return;
|
||||
}
|
||||
// DisplayToast('green', "Note saved successfully.", 500);
|
||||
FetchCampaignNotes();
|
||||
}).catch((error) => {
|
||||
// Handle error (e.g., show a notification)
|
||||
});
|
||||
@@ -149,6 +146,7 @@ function setupCallout() {
|
||||
|
||||
const editTitle = (e) => {
|
||||
title.value = e.target.innerText;
|
||||
SaveNote();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user