@mapomodule/uikit 1.0.0-alpha.9 → 2.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +167 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.mjs +18 -0
- package/dist/module.d.cts +2 -0
- package/dist/module.d.mts +2 -0
- package/dist/module.d.ts +2 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +18 -0
- package/dist/types.d.mts +13 -0
- package/package.json +63 -10
- package/src/index.ts +10 -0
- package/src/module.ts +181 -0
- package/src/runtime/assets/main.css +59 -0
- package/src/runtime/components/MapoConfirmDialog.vue +34 -0
- package/src/runtime/components/MapoDetail.vue +861 -0
- package/src/runtime/components/MapoDetailLangSwitch.vue +166 -0
- package/src/runtime/components/MapoList.vue +339 -0
- package/src/runtime/components/MapoListActions.vue +152 -0
- package/src/runtime/components/MapoListFilters.vue +289 -0
- package/src/runtime/components/MapoListHead.vue +12 -0
- package/src/runtime/components/MapoListQuickEdit.vue +163 -0
- package/src/runtime/components/MapoListTable.vue +926 -0
- package/src/runtime/components/MapoListTabs.vue +48 -0
- package/src/runtime/components/MapoLogin.vue +209 -0
- package/src/runtime/components/MapoLogoutButton.vue +46 -0
- package/src/runtime/components/MapoRootComponents.vue +9 -0
- package/src/runtime/components/MapoSidebar.vue +112 -0
- package/src/runtime/components/MapoSidebarList.vue +35 -0
- package/src/runtime/components/MapoSidebarListItem.vue +79 -0
- package/src/runtime/components/MapoSidebarProfile.vue +57 -0
- package/src/runtime/components/MapoSnackBar.vue +42 -0
- package/src/runtime/components/MapoThemeToggle.vue +23 -0
- package/src/runtime/components/MapoTopbar.vue +36 -0
- package/src/runtime/layouts/default.vue +53 -0
- package/src/runtime/layouts/empty.vue +9 -0
- package/src/runtime/page-meta.nuxt.d.ts +45 -0
- package/src/runtime/pages/index.vue +14 -0
- package/src/runtime/pages/login.vue +7 -0
- package/src/runtime/types/list.ts +64 -0
- package/CHANGELOG.md +0 -177
- package/LICENSE.md +0 -20
- package/assets/mixins.scss +0 -22
- package/assets/variables.scss +0 -18
- package/components/ConfirmDialog.vue +0 -152
- package/components/Detail/Detail.vue +0 -566
- package/components/Detail/DetailField.vue +0 -142
- package/components/Detail/DetailLangSwitch.vue +0 -72
- package/components/Detail/defaults.js +0 -57
- package/components/DropArea.vue +0 -250
- package/components/List/List.vue +0 -254
- package/components/List/ListActions.vue +0 -164
- package/components/List/ListFilters.vue +0 -334
- package/components/List/ListHead.vue +0 -67
- package/components/List/ListQuickEdit.vue +0 -302
- package/components/List/ListTable.vue +0 -406
- package/components/List/ListTabs.vue +0 -65
- package/components/Login.vue +0 -124
- package/components/Logo.vue +0 -79
- package/components/LogoutButton.vue +0 -39
- package/components/MediaManager/MediaEditor.vue +0 -309
- package/components/MediaManager/MediaFolders.vue +0 -263
- package/components/MediaManager/MediaGallery.vue +0 -206
- package/components/MediaManager/MediaManager.vue +0 -233
- package/components/MediaManager/MediaManagerDialog.vue +0 -96
- package/components/MediaManager/MediaPreview.vue +0 -180
- package/components/MediaManager/MediaUploader.vue +0 -165
- package/components/RootComponents.vue +0 -25
- package/components/SnackBar.vue +0 -70
- package/components/fields/DateField.vue +0 -74
- package/components/fields/FksField.vue +0 -60
- package/components/fields/MediaField.vue +0 -213
- package/components/fields/MediaM2mField.vue +0 -243
- package/components/fields/SeoPreview.vue +0 -89
- package/components/fields/wygEditor/defaults.js +0 -55
- package/components/fields/wygEditor/utils/events.js +0 -64
- package/components/fields/wygEditor/utils/mapomedia.plugin.js +0 -31
- package/components/fields/wygEditor/utils/script.injector.js +0 -29
- package/components/fields/wygEditor/wygEditor.vue +0 -196
- package/components/layout/Sidebar/Sidebar.vue +0 -80
- package/components/layout/Sidebar/SidebarFooter.vue +0 -71
- package/components/layout/Sidebar/SidebarList.vue +0 -44
- package/components/layout/Sidebar/SidebarListItem.vue +0 -144
- package/components/layout/Topbar/Topbar.vue +0 -27
- package/components/layout/routebuilder.js +0 -48
- package/defaults.js +0 -29
- package/layouts/default.vue +0 -21
- package/layouts/empty.vue +0 -6
- package/layouts/error.vue +0 -45
- package/module.js +0 -78
- package/pages/index.vue +0 -35
- package/pages/login.vue +0 -10
- package/static/favicon.ico +0 -0
|
@@ -1,243 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<v-card
|
|
4
|
-
v-bind="{
|
|
5
|
-
minWidth,
|
|
6
|
-
minHeight,
|
|
7
|
-
height,
|
|
8
|
-
width,
|
|
9
|
-
maxHeight,
|
|
10
|
-
maxWidth,
|
|
11
|
-
elevation,
|
|
12
|
-
dark,
|
|
13
|
-
light: !dark,
|
|
14
|
-
}"
|
|
15
|
-
>
|
|
16
|
-
<v-card-title v-if="!pages">Media Carousel</v-card-title>
|
|
17
|
-
<v-card-actions>
|
|
18
|
-
<v-row justify="center" class="ma-1" no-gutters>
|
|
19
|
-
<v-col>
|
|
20
|
-
<v-btn
|
|
21
|
-
@click="mmdialog = true"
|
|
22
|
-
block
|
|
23
|
-
outlined
|
|
24
|
-
:min-height="pages ? undefined : minHeight"
|
|
25
|
-
>
|
|
26
|
-
<div v-if="pages">New Selection</div>
|
|
27
|
-
<v-icon v-else size="80"> mdi-plus-circle-outline </v-icon>
|
|
28
|
-
</v-btn>
|
|
29
|
-
</v-col>
|
|
30
|
-
</v-row>
|
|
31
|
-
</v-card-actions>
|
|
32
|
-
|
|
33
|
-
<v-window v-model="page">
|
|
34
|
-
<v-window-item
|
|
35
|
-
class="page"
|
|
36
|
-
v-for="(pageMedias, i) in paginatedMedias"
|
|
37
|
-
:key="i"
|
|
38
|
-
>
|
|
39
|
-
<v-container class="pa-0">
|
|
40
|
-
<v-row
|
|
41
|
-
v-for="row in rows"
|
|
42
|
-
:key="row"
|
|
43
|
-
align="center"
|
|
44
|
-
align-content="center"
|
|
45
|
-
justify="center"
|
|
46
|
-
>
|
|
47
|
-
<v-col v-for="col in cols" :key="col">
|
|
48
|
-
<MediaElement
|
|
49
|
-
v-if="pageMedias[getIndexFromGrid(row, col)]"
|
|
50
|
-
v-model="pageMedias[getIndexFromGrid(row, col)]"
|
|
51
|
-
:aspect-ratio="1"
|
|
52
|
-
:dark="dark"
|
|
53
|
-
rm-add-btn
|
|
54
|
-
@changed-media="checkMediaEdit($event, i, row, col)"
|
|
55
|
-
/>
|
|
56
|
-
<div v-else class="placeholder"></div>
|
|
57
|
-
</v-col>
|
|
58
|
-
</v-row>
|
|
59
|
-
</v-container>
|
|
60
|
-
</v-window-item>
|
|
61
|
-
</v-window>
|
|
62
|
-
|
|
63
|
-
<v-card-actions class="paginator mt-auto" v-if="pages">
|
|
64
|
-
<v-row justify="center" class="py-2">
|
|
65
|
-
<v-btn :disabled="readonly" text @click="prev">
|
|
66
|
-
<v-icon>mdi-chevron-left</v-icon>
|
|
67
|
-
</v-btn>
|
|
68
|
-
<v-item-group v-model="page" class="text-center mx-1" mandatory>
|
|
69
|
-
<v-item
|
|
70
|
-
v-for="n in pages"
|
|
71
|
-
:key="`btn-${n}`"
|
|
72
|
-
v-slot="{ active, toggle }"
|
|
73
|
-
>
|
|
74
|
-
<v-btn :disabled="readonly" :input-value="active" icon @click="toggle">
|
|
75
|
-
<v-icon>mdi-record</v-icon>
|
|
76
|
-
</v-btn>
|
|
77
|
-
</v-item>
|
|
78
|
-
</v-item-group>
|
|
79
|
-
<v-btn :disabled="readonly" text @click="next">
|
|
80
|
-
<v-icon>mdi-chevron-right</v-icon>
|
|
81
|
-
</v-btn>
|
|
82
|
-
</v-row>
|
|
83
|
-
</v-card-actions>
|
|
84
|
-
</v-card>
|
|
85
|
-
|
|
86
|
-
<media-manager-dialog
|
|
87
|
-
v-model="mmdialog"
|
|
88
|
-
select="multi"
|
|
89
|
-
v-on:selectionChange="update"
|
|
90
|
-
:light="!dark"
|
|
91
|
-
:dark="dark"
|
|
92
|
-
>
|
|
93
|
-
</media-manager-dialog>
|
|
94
|
-
</div>
|
|
95
|
-
</template>
|
|
96
|
-
|
|
97
|
-
<style scoped>
|
|
98
|
-
.v-card {
|
|
99
|
-
display: flex;
|
|
100
|
-
flex-direction: column;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
.v-window {
|
|
104
|
-
overflow: hidden;
|
|
105
|
-
position: relative;
|
|
106
|
-
width: 100%;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
.placeholder {
|
|
110
|
-
padding-bottom: 100%;
|
|
111
|
-
}
|
|
112
|
-
</style>
|
|
113
|
-
|
|
114
|
-
<script>
|
|
115
|
-
export default {
|
|
116
|
-
name: "MediaM2mField",
|
|
117
|
-
transition: "tasks-transition",
|
|
118
|
-
data() {
|
|
119
|
-
return {
|
|
120
|
-
child_medias: [],
|
|
121
|
-
|
|
122
|
-
page: 0,
|
|
123
|
-
mmdialog: false,
|
|
124
|
-
};
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
props: {
|
|
128
|
-
medias: {
|
|
129
|
-
type: Array,
|
|
130
|
-
default: () => [],
|
|
131
|
-
},
|
|
132
|
-
cols: {
|
|
133
|
-
type: Number,
|
|
134
|
-
default: 2,
|
|
135
|
-
},
|
|
136
|
-
rows: {
|
|
137
|
-
type: Number,
|
|
138
|
-
default: 2,
|
|
139
|
-
},
|
|
140
|
-
|
|
141
|
-
//reflections
|
|
142
|
-
minWidth: {
|
|
143
|
-
type: Number | String,
|
|
144
|
-
default: 300,
|
|
145
|
-
},
|
|
146
|
-
minHeight: {
|
|
147
|
-
type: Number | String,
|
|
148
|
-
default: 300,
|
|
149
|
-
},
|
|
150
|
-
height: {
|
|
151
|
-
type: Number | String,
|
|
152
|
-
},
|
|
153
|
-
width: {
|
|
154
|
-
type: Number | String,
|
|
155
|
-
},
|
|
156
|
-
maxHeight: {
|
|
157
|
-
type: Number | String,
|
|
158
|
-
},
|
|
159
|
-
maxWidth: {
|
|
160
|
-
type: Number | String,
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
elevation: {
|
|
164
|
-
type: Number | String,
|
|
165
|
-
default: undefined,
|
|
166
|
-
},
|
|
167
|
-
flat: {
|
|
168
|
-
type: Boolean,
|
|
169
|
-
default: false,
|
|
170
|
-
},
|
|
171
|
-
|
|
172
|
-
dark: {
|
|
173
|
-
type: Boolean,
|
|
174
|
-
default: false,
|
|
175
|
-
},
|
|
176
|
-
// This set the component status to readonly, stopping the user interaction.
|
|
177
|
-
readonly: {
|
|
178
|
-
type: Boolean,
|
|
179
|
-
default: false,
|
|
180
|
-
},
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
model: {
|
|
184
|
-
prop: "medias",
|
|
185
|
-
event: "changed-selection",
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
mounted() {
|
|
189
|
-
if (this.medias) this.child_medias = this.medias;
|
|
190
|
-
},
|
|
191
|
-
|
|
192
|
-
computed: {
|
|
193
|
-
mediasPerPage() {
|
|
194
|
-
return this.cols * this.rows;
|
|
195
|
-
},
|
|
196
|
-
pages() {
|
|
197
|
-
return Math.ceil(this.child_medias.length / this.mediasPerPage);
|
|
198
|
-
},
|
|
199
|
-
paginatedMedias() {
|
|
200
|
-
var array = new Array(this.pages);
|
|
201
|
-
for (let i = 0; i < array.length; i++) {
|
|
202
|
-
array[i] = this.child_medias.slice(
|
|
203
|
-
i * this.mediasPerPage,
|
|
204
|
-
(i + 1) * this.mediasPerPage
|
|
205
|
-
);
|
|
206
|
-
}
|
|
207
|
-
return array;
|
|
208
|
-
},
|
|
209
|
-
},
|
|
210
|
-
|
|
211
|
-
methods: {
|
|
212
|
-
getIndexFromGrid(row, col) {
|
|
213
|
-
return (row - 1) * this.cols + col - 1;
|
|
214
|
-
},
|
|
215
|
-
update(selection) {
|
|
216
|
-
this.child_medias = [...selection];
|
|
217
|
-
this.$emit("changed-selection", [...selection]);
|
|
218
|
-
},
|
|
219
|
-
checkMediaEdit(event, page, row, col) {
|
|
220
|
-
//if event is not empty, then exit
|
|
221
|
-
let index = this.mediasPerPage * page + this.getIndexFromGrid(row, col);
|
|
222
|
-
if (event) {
|
|
223
|
-
this.child_medias[index] = event;
|
|
224
|
-
} else {
|
|
225
|
-
this.child_medias.splice(index, 1);
|
|
226
|
-
}
|
|
227
|
-
this.update(this.child_medias);
|
|
228
|
-
},
|
|
229
|
-
next() {
|
|
230
|
-
this.page = this.page + 1 === this.length ? 0 : this.page + 1;
|
|
231
|
-
},
|
|
232
|
-
prev() {
|
|
233
|
-
this.page = this.page - 1 < 0 ? this.length - 1 : this.page - 1;
|
|
234
|
-
},
|
|
235
|
-
},
|
|
236
|
-
|
|
237
|
-
watch: {
|
|
238
|
-
medias(val) {
|
|
239
|
-
this.child_medias = val;
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
};
|
|
243
|
-
</script>
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="container">
|
|
3
|
-
<div class="preview">
|
|
4
|
-
<span class="preview__title">{{ getTitle }}</span>
|
|
5
|
-
<br />
|
|
6
|
-
<span class="preview__url">{{ getPermalink }}</span>
|
|
7
|
-
<br />
|
|
8
|
-
<span class="preview__desc">{{ getDescription }}</span>
|
|
9
|
-
</div>
|
|
10
|
-
</div>
|
|
11
|
-
</template>
|
|
12
|
-
|
|
13
|
-
<style lang="scss" scoped>
|
|
14
|
-
.container {
|
|
15
|
-
background: #ffffff;
|
|
16
|
-
border-radius: 3px;
|
|
17
|
-
}
|
|
18
|
-
.preview {
|
|
19
|
-
display: block;
|
|
20
|
-
max-width: 32em;
|
|
21
|
-
margin: 30px 8px;
|
|
22
|
-
&__title {
|
|
23
|
-
color: #035ac6;
|
|
24
|
-
font-size: 1.2em;
|
|
25
|
-
cursor: pointer;
|
|
26
|
-
&:hover {
|
|
27
|
-
text-decoration: underline;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
&__url {
|
|
31
|
-
color: green;
|
|
32
|
-
font-size: 0.92em;
|
|
33
|
-
}
|
|
34
|
-
&__desc {
|
|
35
|
-
color: #9b9da1;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
</style>
|
|
39
|
-
|
|
40
|
-
<script>
|
|
41
|
-
/**
|
|
42
|
-
* This component is used to make a preview of seo data.
|
|
43
|
-
*/
|
|
44
|
-
export default {
|
|
45
|
-
name: "SeoPreview",
|
|
46
|
-
props: {
|
|
47
|
-
// V-model for DetailField (need to be an object `{title, permalink, description}`)
|
|
48
|
-
value:{
|
|
49
|
-
type: Object,
|
|
50
|
-
default: () => {}
|
|
51
|
-
},
|
|
52
|
-
// Seo title
|
|
53
|
-
title: {
|
|
54
|
-
type: String,
|
|
55
|
-
default:
|
|
56
|
-
"It was the best of times, it was the blurst of times, it was the ..."
|
|
57
|
-
},
|
|
58
|
-
// Seo permalink
|
|
59
|
-
permalink: {
|
|
60
|
-
type: String,
|
|
61
|
-
default: "example.com/how_to_dive"
|
|
62
|
-
},
|
|
63
|
-
// Seo description
|
|
64
|
-
description: {
|
|
65
|
-
type: String,
|
|
66
|
-
default:
|
|
67
|
-
"This is an example description that will get replaced when you start typing. Make sure to keep descriptions mobile-friendly and keyword-rich!"
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
computed: {
|
|
71
|
-
getTitle(){
|
|
72
|
-
if (this.value && this.value.title)
|
|
73
|
-
return this.value.title
|
|
74
|
-
return this.title
|
|
75
|
-
},
|
|
76
|
-
getPermalink(){
|
|
77
|
-
if (this.value && this.value.permalink)
|
|
78
|
-
return this.value.permalink
|
|
79
|
-
return this.permalink
|
|
80
|
-
},
|
|
81
|
-
getDescription(){
|
|
82
|
-
if (this.value && this.value.description)
|
|
83
|
-
return this.value.description
|
|
84
|
-
return this.description
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
};
|
|
89
|
-
</script>
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
var useDarkMode = false;
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
plugins: 'mapomedia preview paste importcss searchreplace autolink directionality code visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount imagetools textpattern noneditable help charmap quickbars emoticons',
|
|
5
|
-
// imagetools_cors_hosts: ['picsum.photos'],
|
|
6
|
-
menubar: 'file edit view insert format tools table help',
|
|
7
|
-
toolbar: 'undo redo | bold italic underline strikethrough | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview | insertfile image mapomedia media template link anchor codesample | ltr rtl',
|
|
8
|
-
toolbar_sticky: true,
|
|
9
|
-
image_advtab: true,
|
|
10
|
-
// link_list: [
|
|
11
|
-
// { title: 'My page 1', value: 'https://www.tiny.cloud' },
|
|
12
|
-
// { title: 'My page 2', value: 'http://www.moxiecode.com' }
|
|
13
|
-
// ],
|
|
14
|
-
// image_list: [
|
|
15
|
-
// { title: 'My page 1', value: 'https://www.tiny.cloud' },
|
|
16
|
-
// { title: 'My page 2', value: 'http://www.moxiecode.com' }
|
|
17
|
-
// ],
|
|
18
|
-
// image_class_list: [
|
|
19
|
-
// { title: 'None', value: '' },
|
|
20
|
-
// { title: 'Some class', value: 'class-name' }
|
|
21
|
-
// ],
|
|
22
|
-
importcss_append: true,
|
|
23
|
-
// file_picker_callback: function (callback, value, meta) {
|
|
24
|
-
// /* Provide file and text for the link dialog */
|
|
25
|
-
// if (meta.filetype === 'file') {
|
|
26
|
-
// callback('https://www.google.com/logos/google.jpg', { text: 'My text' });
|
|
27
|
-
// }
|
|
28
|
-
|
|
29
|
-
// /* Provide image and alt text for the image dialog */
|
|
30
|
-
// if (meta.filetype === 'image') {
|
|
31
|
-
// callback('https://www.google.com/logos/google.jpg', { alt: 'My alt text' });
|
|
32
|
-
// }
|
|
33
|
-
|
|
34
|
-
// /* Provide alternative source and posted for the media dialog */
|
|
35
|
-
// if (meta.filetype === 'media') {
|
|
36
|
-
// callback('movie.mp4', { source2: 'alt.ogg', poster: 'https://www.google.com/logos/google.jpg' });
|
|
37
|
-
// }
|
|
38
|
-
// },
|
|
39
|
-
// templates: [
|
|
40
|
-
// { title: 'New Table', description: 'creates a new table', content: '<div class="mceTmpl"><table width="98%%" border="0" cellspacing="0" cellpadding="0"><tr><th scope="col"> </th><th scope="col"> </th></tr><tr><td> </td><td> </td></tr></table></div>' },
|
|
41
|
-
// { title: 'Starting my story', description: 'A cure for writers block', content: 'Once upon a time...' },
|
|
42
|
-
// { title: 'New list with dates', description: 'New List with dates', content: '<div class="mceTmpl"><span class="cdate">cdate</span><br /><span class="mdate">mdate</span><h2>My List</h2><ul><li></li><li></li></ul></div>' }
|
|
43
|
-
// ],
|
|
44
|
-
template_cdate_format: '[Date Created (CDATE): %m/%d/%Y : %H:%M:%S]',
|
|
45
|
-
template_mdate_format: '[Date Modified (MDATE): %m/%d/%Y : %H:%M:%S]',
|
|
46
|
-
height: 400,
|
|
47
|
-
image_caption: true,
|
|
48
|
-
quickbars_selection_toolbar: 'bold italic | quicklink h2 h3 blockquote quickimage quicktable',
|
|
49
|
-
noneditable_noneditable_class: 'mceNonEditable',
|
|
50
|
-
toolbar_mode: 'sliding',
|
|
51
|
-
contextmenu: 'link image imagetools table',
|
|
52
|
-
skin: useDarkMode ? 'oxide-dark' : 'oxide',
|
|
53
|
-
content_css: useDarkMode ? 'dark' : 'default',
|
|
54
|
-
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }'
|
|
55
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
export default [
|
|
2
|
-
'Activate',
|
|
3
|
-
'AddUndo',
|
|
4
|
-
'BeforeAddUndo',
|
|
5
|
-
'BeforeExecCommand',
|
|
6
|
-
'BeforeGetContent',
|
|
7
|
-
'BeforeRenderUI',
|
|
8
|
-
'BeforeSetContent',
|
|
9
|
-
'BeforePaste',
|
|
10
|
-
'Blur',
|
|
11
|
-
'Change',
|
|
12
|
-
'ClearUndos',
|
|
13
|
-
'Click',
|
|
14
|
-
'ContextMenu',
|
|
15
|
-
'Copy',
|
|
16
|
-
'Cut',
|
|
17
|
-
'Dblclick',
|
|
18
|
-
'Deactivate',
|
|
19
|
-
'Dirty',
|
|
20
|
-
'Drag',
|
|
21
|
-
'DragDrop',
|
|
22
|
-
'DragEnd',
|
|
23
|
-
'DragGesture',
|
|
24
|
-
'DragOver',
|
|
25
|
-
'Drop',
|
|
26
|
-
'ExecCommand',
|
|
27
|
-
'Focus',
|
|
28
|
-
'FocusIn',
|
|
29
|
-
'FocusOut',
|
|
30
|
-
'GetContent',
|
|
31
|
-
'Hide',
|
|
32
|
-
'Init',
|
|
33
|
-
'KeyDown',
|
|
34
|
-
'KeyPress',
|
|
35
|
-
'KeyUp',
|
|
36
|
-
'LoadContent',
|
|
37
|
-
'MouseDown',
|
|
38
|
-
'MouseEnter',
|
|
39
|
-
'MouseLeave',
|
|
40
|
-
'MouseMove',
|
|
41
|
-
'MouseOut',
|
|
42
|
-
'MouseOver',
|
|
43
|
-
'MouseUp',
|
|
44
|
-
'NodeChange',
|
|
45
|
-
'ObjectResizeStart',
|
|
46
|
-
'ObjectResized',
|
|
47
|
-
'ObjectSelected',
|
|
48
|
-
'Paste',
|
|
49
|
-
'PostProcess',
|
|
50
|
-
'PostRender',
|
|
51
|
-
'PreProcess',
|
|
52
|
-
'ProgressState',
|
|
53
|
-
'Redo',
|
|
54
|
-
'Remove',
|
|
55
|
-
'Reset',
|
|
56
|
-
'SaveContent',
|
|
57
|
-
'SelectionChange',
|
|
58
|
-
'SetAttrib',
|
|
59
|
-
'SetContent',
|
|
60
|
-
'Show',
|
|
61
|
-
'Submit',
|
|
62
|
-
'Undo',
|
|
63
|
-
'VisualAid'
|
|
64
|
-
];
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export default function (callback) {
|
|
2
|
-
const pluginmanager = window.tinymce.util.Tools.resolve('tinymce.PluginManager');
|
|
3
|
-
pluginmanager.add('mapomedia', function (editor, url) {
|
|
4
|
-
const conf = ['mapomedia', {
|
|
5
|
-
icon: 'image',
|
|
6
|
-
text: 'Mapo Media',
|
|
7
|
-
onAction: () => callback().then(html => {
|
|
8
|
-
editor.focus();
|
|
9
|
-
editor.undoManager.transact(() => editor.selection.setContent(html))
|
|
10
|
-
editor.selection.setCursorLocation();
|
|
11
|
-
editor.nodeChanged();
|
|
12
|
-
}).catch(() => null)
|
|
13
|
-
}]
|
|
14
|
-
editor.addCommand('mceMapoMedia', () => callback().then(html => {
|
|
15
|
-
editor.focus();
|
|
16
|
-
editor.undoManager.transact(() => editor.selection.setContent(html))
|
|
17
|
-
editor.selection.setCursorLocation();
|
|
18
|
-
editor.nodeChanged();
|
|
19
|
-
}).catch(() => null))
|
|
20
|
-
editor.ui.registry.addButton(...conf);
|
|
21
|
-
editor.ui.registry.addMenuItem(...conf);
|
|
22
|
-
return {
|
|
23
|
-
getMetadata: function () {
|
|
24
|
-
return {
|
|
25
|
-
name: "Mapo Media",
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export default async function () {
|
|
2
|
-
return new Promise((resolve, reject) => {
|
|
3
|
-
if (typeof window.tinymce !== 'undefined'){
|
|
4
|
-
resolve()
|
|
5
|
-
}
|
|
6
|
-
let scriptTag = document.getElementById("tinymce-script") || null
|
|
7
|
-
const handler = () => {
|
|
8
|
-
scriptTag.removeEventListener('load', handler);
|
|
9
|
-
resolve()
|
|
10
|
-
};
|
|
11
|
-
if (!scriptTag) {
|
|
12
|
-
try {
|
|
13
|
-
scriptTag = document.createElement('script');
|
|
14
|
-
scriptTag.referrerPolicy = 'origin';
|
|
15
|
-
scriptTag.type = 'application/javascript';
|
|
16
|
-
scriptTag.id = 'tinymce-script';
|
|
17
|
-
scriptTag.src = "https://cdn.tiny.cloud/1/y3orc2on59mn794gzviet9lpuj9sr051d0045ir9bmrixn3o/tinymce/5/tinymce.min.js";
|
|
18
|
-
// scriptTag.src = "https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js";
|
|
19
|
-
scriptTag.async = true
|
|
20
|
-
scriptTag.addEventListener('load', handler);
|
|
21
|
-
document.head.appendChild(scriptTag);
|
|
22
|
-
} catch (error) {
|
|
23
|
-
reject(error)
|
|
24
|
-
}
|
|
25
|
-
} else {
|
|
26
|
-
scriptTag.addEventListener('load', handler);
|
|
27
|
-
}
|
|
28
|
-
})
|
|
29
|
-
}
|