-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVideoPopup.vue
More file actions
82 lines (72 loc) · 1.7 KB
/
Copy pathVideoPopup.vue
File metadata and controls
82 lines (72 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<script setup lang="ts">
import DxPopup from 'devextreme-vue/popup';
import DxTextBox from 'devextreme-vue/text-box';
import DxFileUploader from 'devextreme-vue/file-uploader';
import DxButton from 'devextreme-vue/button';
import { useVideoPopup, setupClipboard, registerBlot } from '../composables/useVideoPopup';
const props = defineProps<{
editor: any;
}>();
const {
visible,
urlValue,
fileValue,
show,
onUrlChanged,
onFileChanged,
applyVideo,
} = useVideoPopup(() => props.editor);
defineExpose({ show, setupClipboard, registerBlot });
</script>
<template>
<DxPopup
v-model:visible="visible"
:show-title="true"
title="Insert Video"
:width="450"
:height="320"
:defer-rendering="false"
:show-close-button="true"
>
<template #content>
<div class="video-popup-content">
<DxTextBox
v-model:value="urlValue"
placeholder="Enter video URL..."
:show-clear-button="true"
@value-changed="onUrlChanged"
/>
<div class="video-separator">— OR —</div>
<DxFileUploader
v-model:value="fileValue"
select-button-text="Upload a Video File"
label-text=""
accept="video/*"
upload-mode="useForm"
@value-changed="onFileChanged"
/>
<DxButton
text="Insert"
type="default"
width="100%"
class="video-apply-btn"
@click="applyVideo"
/>
</div>
</template>
</DxPopup>
</template>
<style scoped>
.video-popup-content {
padding: 10px;
}
.video-separator {
text-align: center;
margin: 15px 0;
font-weight: bold;
color: #888;
}
.video-apply-btn {
margin-top: 25px;
}
</style>