qms-angular 1.1.41 → 1.1.43
Sign up to get free protection for your applications and to get access to all the features.
- package/bundles/qms-angular.umd.js +1569 -441
- package/bundles/qms-angular.umd.js.map +1 -1
- package/esm2015/lib/common/enum/data-type.enum.js +2 -1
- package/esm2015/lib/common/enum/process-classification.enum.js +6 -0
- package/esm2015/lib/common/qms-icon.const.js +116 -111
- package/esm2015/lib/common/themes.const.js +2 -2
- package/esm2015/lib/components/app-icon/icon-registry.service.js +5 -2
- package/esm2015/lib/components/related/common/video.const.js +3 -1
- package/esm2015/lib/components/related/content/related-content.component.js +2 -2
- package/esm2015/lib/components/related/list-other-related/list-related.component.js +5 -2
- package/esm2015/lib/components/related/model/popup-data.model.js +3 -1
- package/esm2015/lib/components/related/model/related-data.model.js +1 -1
- package/esm2015/lib/components/related/popup/related-popup.component.js +48 -32
- package/esm2015/lib/components/related/related.module.js +3 -2
- package/esm2015/lib/components/related/risk/analysis/analysis.component.js +2 -2
- package/esm2015/lib/components/select-access-dialog/select-access-dialog.component.js +24 -4
- package/esm2015/lib/components/select-department-tree/select-department-tree.component.js +5 -4
- package/esm2015/lib/components/select-one/select-one.component.js +2 -2
- package/esm2015/lib/components/select-process-document/select-process-document.component.js +15 -11
- package/esm2015/lib/components/tree/model/tree-config.model.js +1 -1
- package/esm2015/lib/components/tree/tree.component.js +12 -4
- package/esm2015/lib/components/treeNew/model/tree-node.model.js +1 -1
- package/esm2015/lib/components/treeNew/model/tree.model.js +1 -1
- package/esm2015/lib/components/treeNew/tree.component.js +8 -4
- package/esm2015/lib/components/treeNew/tree.function.js +8 -4
- package/esm2015/lib/model/en.js +86 -2
- package/esm2015/lib/model/no.js +87 -3
- package/esm2015/lib/model/sv.js +437 -0
- package/esm2015/lib/qms-ckeditor-components/common/functions/common.function.js +15 -14
- package/esm2015/lib/qms-ckeditor-components/common/functions/resource.function.js +207 -0
- package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-data.model.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/common/models/qms-ckeditor-url.model.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-imagemap/qms-ckeditor-imagemap.component.js +262 -29
- package/esm2015/lib/qms-ckeditor-components/components/qms-ckeditor-link/qms-ckeditor-link.component.js +102 -36
- package/esm2015/lib/qms-ckeditor-components/models/qms-ckeditor-imagemap.model.js +1 -1
- package/esm2015/lib/qms-ckeditor-components/models/qms-ckeditor-video.model.js +16 -0
- package/esm2015/lib/qms-ckeditor-components/qms-ckeditor.component.js +39 -118
- package/esm2015/lib/qms-ckeditor-components/services/qms-ckeditor-bpmn.service.js +10 -3
- package/esm2015/lib/qms-ckeditor-components/services/qms-ckeditor-tree.service.js +7 -3
- package/esm2015/lib/services/translation-registry.service.js +7 -5
- package/fesm2015/qms-angular.js +1603 -503
- package/fesm2015/qms-angular.js.map +1 -1
- package/lib/common/enum/data-type.enum.d.ts +2 -1
- package/lib/common/enum/process-classification.enum.d.ts +4 -0
- package/lib/common/qms-icon.const.d.ts +1 -0
- package/lib/components/app-icon/icon-registry.service.d.ts +1 -0
- package/lib/components/related/common/video.const.d.ts +2 -0
- package/lib/components/related/content/related-content.component.d.ts +1 -1
- package/lib/components/related/list-other-related/list-related.component.d.ts +2 -2
- package/lib/components/related/model/popup-data.model.d.ts +3 -0
- package/lib/components/related/model/related-data.model.d.ts +1 -0
- package/lib/components/related/popup/related-popup.component.d.ts +7 -3
- package/lib/components/select-access-dialog/select-access-dialog.component.d.ts +3 -2
- package/lib/components/select-one/select-one.component.d.ts +1 -1
- package/lib/components/select-process-document/select-process-document.component.d.ts +5 -6
- package/lib/components/tree/model/tree-config.model.d.ts +1 -1
- package/lib/components/tree/tree.component.d.ts +1 -1
- package/lib/components/treeNew/model/tree-node.model.d.ts +1 -0
- package/lib/components/treeNew/model/tree.model.d.ts +1 -0
- package/lib/components/treeNew/tree.component.d.ts +5 -2
- package/lib/model/en.d.ts +84 -0
- package/lib/model/no.d.ts +84 -0
- package/lib/model/sv.d.ts +436 -0
- package/lib/qms-ckeditor-components/common/functions/common.function.d.ts +29 -10
- package/lib/qms-ckeditor-components/common/functions/resource.function.d.ts +194 -0
- package/lib/qms-ckeditor-components/common/models/qms-ckeditor-data.model.d.ts +3 -0
- package/lib/qms-ckeditor-components/common/models/qms-ckeditor-url.model.d.ts +2 -0
- package/lib/qms-ckeditor-components/components/qms-ckeditor-imagemap/qms-ckeditor-imagemap.component.d.ts +13 -2
- package/lib/qms-ckeditor-components/components/qms-ckeditor-link/qms-ckeditor-link.component.d.ts +1 -0
- package/lib/qms-ckeditor-components/models/qms-ckeditor-imagemap.model.d.ts +1 -0
- package/lib/qms-ckeditor-components/models/qms-ckeditor-video.model.d.ts +10 -0
- package/lib/qms-ckeditor-components/qms-ckeditor.component.d.ts +1 -2
- package/lib/qms-ckeditor-components/services/qms-ckeditor-tree.service.d.ts +2 -1
- package/lib/services/translation-registry.service.d.ts +1 -0
- package/package.json +1 -1
- package/qms-angular.metadata.json +1 -1
- package/src/assets/jointjs/scss/bpmn.scss +914 -906
- package/src/assets/qms-ckeditor-plugin/build/ckeditor.js +1 -1
- package/src/assets/qms-ckeditor-plugin/build/ckeditor.js.map +1 -1
- package/src/assets/qms-ckeditor-plugin/build/translations/no.js +1 -1
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-find-and-replace/src/findandreplaceui.js +223 -223
- package/src/assets/qms-ckeditor-plugin/src/plugins/ckeditor5-source-editing/lang/translations/no.po +21 -0
- package/src/assets/qms-ckeditor-plugin/src/plugins/fullscreen/qmsCKEditorFullscreenPlugin.js +52 -50
- package/src/assets/qms-ckeditor-plugin/src/plugins/heading/headingui.js +115 -115
- package/src/assets/qms-ckeditor-plugin/src/plugins/heading/utils.js +42 -42
- package/src/assets/qms-ckeditor-plugin/src/plugins/link/linkcommand.js +1 -1
- package/src/assets/qms-ckeditor-plugin/src/plugins/media/mediaembedediting.js +281 -283
- package/src/assets/qms-ckeditor-plugin/src/plugins/media/theme/mediaembed.css +30 -30
- package/src/assets/qms-ckeditor-plugin/src/plugins/media/theme/mediaembedediting.css +57 -57
- package/src/assets/qms-ckeditor-plugin/src/plugins/table/theme/snippet.css +3877 -3876
- package/src/assets/qms-ckeditor-plugin/src/plugins/video/theme/video.css +17 -17
- package/src/assets/qms-ckeditor-plugin/src/plugins/video/theme/videoresize.css +33 -32
- package/src/assets/qms-ckeditor-plugin/src/plugins/video/video/videoediting.js +81 -75
- package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoresize/resizevideocommand.js +35 -35
- package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoresize/videoresizeediting.js +104 -92
- package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoupload/browsevideodialogcommand.js +69 -25
- package/src/assets/qms-ckeditor-plugin/src/plugins/video/videoupload/uploadvideocommand.js +21 -21
- package/src/lib/components/related/popup/related-popup.component.scss +374 -350
- package/esm2015/lib/components/related/common/data-type.enum.js +0 -14
- package/esm2015/lib/components/select-one/common/data-type.enum.js +0 -14
- package/lib/components/related/common/data-type.enum.d.ts +0 -12
- package/lib/components/select-one/common/data-type.enum.d.ts +0 -12
@@ -1,283 +1,281 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
|
6
|
-
/**
|
7
|
-
* @module media-embed/mediaembedediting
|
8
|
-
*/
|
9
|
-
|
10
|
-
import { Plugin } from 'ckeditor5/src/core';
|
11
|
-
|
12
|
-
import { modelToViewUrlAttributeConverter } from './converters';
|
13
|
-
import MediaEmbedCommand from './mediaembedcommand';
|
14
|
-
import MediaRegistry from './mediaregistry';
|
15
|
-
import { toMediaWidget, createMediaFigureElement } from './utils';
|
16
|
-
|
17
|
-
import './theme/mediaembedediting.css';
|
18
|
-
|
19
|
-
/**
|
20
|
-
* The media embed editing feature.
|
21
|
-
*
|
22
|
-
* @extends module:core/plugin~Plugin
|
23
|
-
*/
|
24
|
-
export default class MediaEmbedEditing extends Plugin {
|
25
|
-
/**
|
26
|
-
* @inheritDoc
|
27
|
-
*/
|
28
|
-
static get pluginName() {
|
29
|
-
return 'MediaEmbedEditing';
|
30
|
-
}
|
31
|
-
|
32
|
-
/**
|
33
|
-
* @inheritDoc
|
34
|
-
*/
|
35
|
-
constructor( editor ) {
|
36
|
-
super( editor );
|
37
|
-
|
38
|
-
editor.config.define( 'mediaEmbed', {
|
39
|
-
elementName: 'oembed',
|
40
|
-
providers: [
|
41
|
-
{
|
42
|
-
name: 'dailymotion',
|
43
|
-
url: /^dailymotion\.com\/video\/(\w+)/,
|
44
|
-
html: match => {
|
45
|
-
const id = match[ 1 ];
|
46
|
-
|
47
|
-
return (
|
48
|
-
'<div style="position: relative; padding-bottom: 100%; height: 0; ">' +
|
49
|
-
`<iframe src="https://www.dailymotion.com/embed/video/${ id }" ` +
|
50
|
-
'style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" ' +
|
51
|
-
'frameborder="0" width="480" height="270" allowfullscreen allow="autoplay">' +
|
52
|
-
'</iframe>' +
|
53
|
-
'</div>'
|
54
|
-
);
|
55
|
-
}
|
56
|
-
},
|
57
|
-
|
58
|
-
{
|
59
|
-
name: 'spotify',
|
60
|
-
url: [
|
61
|
-
/^open\.spotify\.com\/(artist\/\w+)/,
|
62
|
-
/^open\.spotify\.com\/(album\/\w+)/,
|
63
|
-
/^open\.spotify\.com\/(track\/\w+)/
|
64
|
-
],
|
65
|
-
html: match => {
|
66
|
-
const id = match[ 1 ];
|
67
|
-
|
68
|
-
return (
|
69
|
-
'<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 126%;">' +
|
70
|
-
`<iframe src="https://open.spotify.com/embed/${ id }" ` +
|
71
|
-
'style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" ' +
|
72
|
-
'frameborder="0" allowtransparency="true" allow="encrypted-media">' +
|
73
|
-
'</iframe>' +
|
74
|
-
'</div>'
|
75
|
-
);
|
76
|
-
}
|
77
|
-
},
|
78
|
-
|
79
|
-
{
|
80
|
-
name: 'youtube',
|
81
|
-
url: [
|
82
|
-
/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)/,
|
83
|
-
/^(?:m\.)?youtube\.com\/v\/([\w-]+)/,
|
84
|
-
/^youtube\.com\/embed\/([\w-]+)/,
|
85
|
-
/^youtu\.be\/([\w-]+)/
|
86
|
-
],
|
87
|
-
html: match => {
|
88
|
-
const id = match[ 1 ];
|
89
|
-
|
90
|
-
return (
|
91
|
-
'<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;">' +
|
92
|
-
`<iframe src="https://www.youtube.com/embed/${ id }" ` +
|
93
|
-
'style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" ' +
|
94
|
-
'frameborder="0" allow="autoplay; encrypted-media" allowfullscreen>' +
|
95
|
-
'</iframe>' +
|
96
|
-
'</div>'
|
97
|
-
);
|
98
|
-
}
|
99
|
-
},
|
100
|
-
|
101
|
-
{
|
102
|
-
name: 'vimeo',
|
103
|
-
url: [
|
104
|
-
/^vimeo\.com\/(\d+)/,
|
105
|
-
/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,
|
106
|
-
/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,
|
107
|
-
/^vimeo\.com\/channels\/[^/]+\/(\d+)/,
|
108
|
-
/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,
|
109
|
-
/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,
|
110
|
-
/^player\.vimeo\.com\/video\/(\d+)/
|
111
|
-
],
|
112
|
-
html: match => {
|
113
|
-
const id = match[ 1 ];
|
114
|
-
|
115
|
-
return (
|
116
|
-
'<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;">' +
|
117
|
-
`<iframe src="https://player.vimeo.com/video/${ id }" ` +
|
118
|
-
'style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" ' +
|
119
|
-
'frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen>' +
|
120
|
-
'</iframe>' +
|
121
|
-
'</div>'
|
122
|
-
);
|
123
|
-
}
|
124
|
-
},
|
125
|
-
|
126
|
-
{
|
127
|
-
name: 'instagram',
|
128
|
-
url: /^instagram\.com\/p\/(\w+)/
|
129
|
-
},
|
130
|
-
{
|
131
|
-
name: 'twitter',
|
132
|
-
url: /^twitter\.com/
|
133
|
-
},
|
134
|
-
{
|
135
|
-
name: 'googleMaps',
|
136
|
-
url: /^google\.com\/maps/
|
137
|
-
},
|
138
|
-
{
|
139
|
-
name: 'flickr',
|
140
|
-
url: /^flickr\.com/
|
141
|
-
},
|
142
|
-
{
|
143
|
-
name: 'facebook',
|
144
|
-
url: /^facebook\.com/
|
145
|
-
}
|
146
|
-
]
|
147
|
-
} );
|
148
|
-
|
149
|
-
/**
|
150
|
-
* The media registry managing the media providers in the editor.
|
151
|
-
*
|
152
|
-
* @member {module:media-embed/mediaregistry~MediaRegistry} #registry
|
153
|
-
*/
|
154
|
-
this.registry = new MediaRegistry( editor.locale, editor.config.get( 'mediaEmbed' ) );
|
155
|
-
}
|
156
|
-
|
157
|
-
/**
|
158
|
-
* @inheritDoc
|
159
|
-
*/
|
160
|
-
init() {
|
161
|
-
const editor = this.editor;
|
162
|
-
const schema = editor.model.schema;
|
163
|
-
const t = editor.t;
|
164
|
-
const conversion = editor.conversion;
|
165
|
-
const renderMediaPreview = editor.config.get( 'mediaEmbed.previewsInData' );
|
166
|
-
const elementName = editor.config.get( 'mediaEmbed.elementName' );
|
167
|
-
|
168
|
-
const registry = this.registry;
|
169
|
-
|
170
|
-
editor.commands.add( 'mediaEmbed', new MediaEmbedCommand( editor ) );
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
//
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
}
|
283
|
-
}
|
1
|
+
/**
|
2
|
+
* @license Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
|
6
|
+
/**
|
7
|
+
* @module media-embed/mediaembedediting
|
8
|
+
*/
|
9
|
+
|
10
|
+
import { Plugin } from 'ckeditor5/src/core';
|
11
|
+
|
12
|
+
import { modelToViewUrlAttributeConverter } from './converters';
|
13
|
+
import MediaEmbedCommand from './mediaembedcommand';
|
14
|
+
import MediaRegistry from './mediaregistry';
|
15
|
+
import { toMediaWidget, createMediaFigureElement } from './utils';
|
16
|
+
|
17
|
+
import './theme/mediaembedediting.css';
|
18
|
+
|
19
|
+
/**
|
20
|
+
* The media embed editing feature.
|
21
|
+
*
|
22
|
+
* @extends module:core/plugin~Plugin
|
23
|
+
*/
|
24
|
+
export default class MediaEmbedEditing extends Plugin {
|
25
|
+
/**
|
26
|
+
* @inheritDoc
|
27
|
+
*/
|
28
|
+
static get pluginName() {
|
29
|
+
return 'MediaEmbedEditing';
|
30
|
+
}
|
31
|
+
|
32
|
+
/**
|
33
|
+
* @inheritDoc
|
34
|
+
*/
|
35
|
+
constructor( editor ) {
|
36
|
+
super( editor );
|
37
|
+
|
38
|
+
editor.config.define( 'mediaEmbed', {
|
39
|
+
elementName: 'oembed',
|
40
|
+
providers: [
|
41
|
+
{
|
42
|
+
name: 'dailymotion',
|
43
|
+
url: /^dailymotion\.com\/video\/(\w+)/,
|
44
|
+
html: match => {
|
45
|
+
const id = match[ 1 ];
|
46
|
+
|
47
|
+
return (
|
48
|
+
'<div style="position: relative; padding-bottom: 100%; height: 0; ">' +
|
49
|
+
`<iframe src="https://www.dailymotion.com/embed/video/${ id }" ` +
|
50
|
+
'style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" ' +
|
51
|
+
'frameborder="0" width="480" height="270" allowfullscreen allow="autoplay">' +
|
52
|
+
'</iframe>' +
|
53
|
+
'</div>'
|
54
|
+
);
|
55
|
+
}
|
56
|
+
},
|
57
|
+
|
58
|
+
{
|
59
|
+
name: 'spotify',
|
60
|
+
url: [
|
61
|
+
/^open\.spotify\.com\/(artist\/\w+)/,
|
62
|
+
/^open\.spotify\.com\/(album\/\w+)/,
|
63
|
+
/^open\.spotify\.com\/(track\/\w+)/
|
64
|
+
],
|
65
|
+
html: match => {
|
66
|
+
const id = match[ 1 ];
|
67
|
+
|
68
|
+
return (
|
69
|
+
'<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 126%;">' +
|
70
|
+
`<iframe src="https://open.spotify.com/embed/${ id }" ` +
|
71
|
+
'style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" ' +
|
72
|
+
'frameborder="0" allowtransparency="true" allow="encrypted-media">' +
|
73
|
+
'</iframe>' +
|
74
|
+
'</div>'
|
75
|
+
);
|
76
|
+
}
|
77
|
+
},
|
78
|
+
|
79
|
+
{
|
80
|
+
name: 'youtube',
|
81
|
+
url: [
|
82
|
+
/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)/,
|
83
|
+
/^(?:m\.)?youtube\.com\/v\/([\w-]+)/,
|
84
|
+
/^youtube\.com\/embed\/([\w-]+)/,
|
85
|
+
/^youtu\.be\/([\w-]+)/
|
86
|
+
],
|
87
|
+
html: match => {
|
88
|
+
const id = match[ 1 ];
|
89
|
+
|
90
|
+
return (
|
91
|
+
'<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;">' +
|
92
|
+
`<iframe src="https://www.youtube.com/embed/${ id }" ` +
|
93
|
+
'style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" ' +
|
94
|
+
'frameborder="0" allow="autoplay; encrypted-media" allowfullscreen>' +
|
95
|
+
'</iframe>' +
|
96
|
+
'</div>'
|
97
|
+
);
|
98
|
+
}
|
99
|
+
},
|
100
|
+
|
101
|
+
{
|
102
|
+
name: 'vimeo',
|
103
|
+
url: [
|
104
|
+
/^vimeo\.com\/(\d+)/,
|
105
|
+
/^vimeo\.com\/[^/]+\/[^/]+\/video\/(\d+)/,
|
106
|
+
/^vimeo\.com\/album\/[^/]+\/video\/(\d+)/,
|
107
|
+
/^vimeo\.com\/channels\/[^/]+\/(\d+)/,
|
108
|
+
/^vimeo\.com\/groups\/[^/]+\/videos\/(\d+)/,
|
109
|
+
/^vimeo\.com\/ondemand\/[^/]+\/(\d+)/,
|
110
|
+
/^player\.vimeo\.com\/video\/(\d+)/
|
111
|
+
],
|
112
|
+
html: match => {
|
113
|
+
const id = match[ 1 ];
|
114
|
+
|
115
|
+
return (
|
116
|
+
'<div style="position: relative; padding-bottom: 100%; height: 0; padding-bottom: 56.2493%;">' +
|
117
|
+
`<iframe src="https://player.vimeo.com/video/${ id }" ` +
|
118
|
+
'style="position: absolute; width: 100%; height: 100%; top: 0; left: 0;" ' +
|
119
|
+
'frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen>' +
|
120
|
+
'</iframe>' +
|
121
|
+
'</div>'
|
122
|
+
);
|
123
|
+
}
|
124
|
+
},
|
125
|
+
|
126
|
+
{
|
127
|
+
name: 'instagram',
|
128
|
+
url: /^instagram\.com\/p\/(\w+)/
|
129
|
+
},
|
130
|
+
{
|
131
|
+
name: 'twitter',
|
132
|
+
url: /^twitter\.com/
|
133
|
+
},
|
134
|
+
{
|
135
|
+
name: 'googleMaps',
|
136
|
+
url: /^google\.com\/maps/
|
137
|
+
},
|
138
|
+
{
|
139
|
+
name: 'flickr',
|
140
|
+
url: /^flickr\.com/
|
141
|
+
},
|
142
|
+
{
|
143
|
+
name: 'facebook',
|
144
|
+
url: /^facebook\.com/
|
145
|
+
}
|
146
|
+
]
|
147
|
+
} );
|
148
|
+
|
149
|
+
/**
|
150
|
+
* The media registry managing the media providers in the editor.
|
151
|
+
*
|
152
|
+
* @member {module:media-embed/mediaregistry~MediaRegistry} #registry
|
153
|
+
*/
|
154
|
+
this.registry = new MediaRegistry( editor.locale, editor.config.get( 'mediaEmbed' ) );
|
155
|
+
}
|
156
|
+
|
157
|
+
/**
|
158
|
+
* @inheritDoc
|
159
|
+
*/
|
160
|
+
init() {
|
161
|
+
const editor = this.editor;
|
162
|
+
const schema = editor.model.schema;
|
163
|
+
const t = editor.t;
|
164
|
+
const conversion = editor.conversion;
|
165
|
+
const renderMediaPreview = editor.config.get( 'mediaEmbed.previewsInData' );
|
166
|
+
const elementName = editor.config.get( 'mediaEmbed.elementName' );
|
167
|
+
|
168
|
+
const registry = this.registry;
|
169
|
+
|
170
|
+
editor.commands.add( 'mediaEmbed', new MediaEmbedCommand( editor ) );
|
171
|
+
// Configure the schema.
|
172
|
+
schema.register( 'media', {
|
173
|
+
isObject: true,
|
174
|
+
isBlock: true,
|
175
|
+
allowWhere: '$block',
|
176
|
+
allowAttributes: [ 'url' ]
|
177
|
+
} );
|
178
|
+
|
179
|
+
// Model -> Data
|
180
|
+
conversion.for( 'dataDowncast' ).elementToElement( {
|
181
|
+
model: 'media',
|
182
|
+
view: ( modelElement, { writer } ) => {
|
183
|
+
const url = modelElement.getAttribute( 'url' );
|
184
|
+
return createMediaFigureElement( writer, registry, url, {
|
185
|
+
elementName,
|
186
|
+
renderMediaPreview: url && renderMediaPreview
|
187
|
+
} );
|
188
|
+
}
|
189
|
+
} );
|
190
|
+
|
191
|
+
// Model -> Data (url -> data-oembed-url)
|
192
|
+
conversion.for( 'dataDowncast' ).add(
|
193
|
+
modelToViewUrlAttributeConverter( registry, {
|
194
|
+
elementName,
|
195
|
+
renderMediaPreview
|
196
|
+
} ) );
|
197
|
+
|
198
|
+
// Model -> View (element)
|
199
|
+
conversion.for( 'editingDowncast' ).elementToElement( {
|
200
|
+
model: 'media',
|
201
|
+
view: ( modelElement, { writer } ) => {
|
202
|
+
const url = modelElement.getAttribute( 'url' );
|
203
|
+
const figure = createMediaFigureElement( writer, registry, url, {
|
204
|
+
elementName,
|
205
|
+
renderForEditingView: true
|
206
|
+
} );
|
207
|
+
|
208
|
+
return toMediaWidget( figure, writer, t( 'media widget' ) );
|
209
|
+
}
|
210
|
+
} );
|
211
|
+
|
212
|
+
// Model -> View (url -> data-oembed-url)
|
213
|
+
conversion.for( 'editingDowncast' ).add(
|
214
|
+
modelToViewUrlAttributeConverter( registry, {
|
215
|
+
elementName,
|
216
|
+
renderForEditingView: true
|
217
|
+
} ) );
|
218
|
+
|
219
|
+
// View -> Model (data-oembed-url -> url)
|
220
|
+
conversion.for( 'upcast' )
|
221
|
+
// Upcast semantic media.
|
222
|
+
.elementToElement( {
|
223
|
+
view: element => [ 'oembed', elementName ].includes( element.name ) && element.getAttribute( 'url' ) ?
|
224
|
+
{ name: true } :
|
225
|
+
null,
|
226
|
+
model: ( viewMedia, { writer } ) => {
|
227
|
+
const url = viewMedia.getAttribute( 'url' );
|
228
|
+
|
229
|
+
if ( registry.hasMedia( url ) ) {
|
230
|
+
return writer.createElement( 'media', { url } );
|
231
|
+
}
|
232
|
+
}
|
233
|
+
} )
|
234
|
+
// Upcast non-semantic media.
|
235
|
+
.elementToElement( {
|
236
|
+
view: {
|
237
|
+
name: 'div',
|
238
|
+
attributes: {
|
239
|
+
'data-oembed-url': true
|
240
|
+
}
|
241
|
+
},
|
242
|
+
model: ( viewMedia, { writer } ) => {
|
243
|
+
const url = viewMedia.getAttribute( 'data-oembed-url' );
|
244
|
+
|
245
|
+
if ( registry.hasMedia( url ) ) {
|
246
|
+
return writer.createElement( 'media', { url } );
|
247
|
+
}
|
248
|
+
}
|
249
|
+
} )
|
250
|
+
// Upcast for iframe from ck4-editor.
|
251
|
+
.elementToElement( {
|
252
|
+
view: {
|
253
|
+
name: 'iframe',
|
254
|
+
attributes: {
|
255
|
+
'data-src': true
|
256
|
+
}
|
257
|
+
},
|
258
|
+
model: ( viewMedia, { writer } ) => {
|
259
|
+
const url = viewMedia.getAttribute( 'data-src' );
|
260
|
+
if ( registry.hasMedia( url ) ) {
|
261
|
+
return writer.createElement( 'media', { url } );
|
262
|
+
}
|
263
|
+
}
|
264
|
+
} )
|
265
|
+
// for video upload from ck4
|
266
|
+
// .elementToElement( {
|
267
|
+
// view: {
|
268
|
+
// name: 'video',
|
269
|
+
// attributes: {
|
270
|
+
// 'poster': true
|
271
|
+
// }
|
272
|
+
// },
|
273
|
+
// model: ( viewMedia, { writer } ) => {
|
274
|
+
// const url = viewMedia.getAttribute( 'poster' );
|
275
|
+
// if ( registry.hasMedia( url ) ) {
|
276
|
+
// return writer.createElement( 'media', { url } );
|
277
|
+
// }
|
278
|
+
// }
|
279
|
+
// } );
|
280
|
+
}
|
281
|
+
}
|
@@ -1,30 +1,30 @@
|
|
1
|
-
/*
|
2
|
-
* Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
|
6
|
-
/* .ck-content .media {
|
7
|
-
clear: both;
|
8
|
-
margin: 1em 0;
|
9
|
-
display: table;
|
10
|
-
min-width: 15em;
|
11
|
-
text-align: center;
|
12
|
-
} */
|
13
|
-
|
14
|
-
.ck-content .media {
|
15
|
-
display: table;
|
16
|
-
clear: both;
|
17
|
-
text-align: center;
|
18
|
-
margin: 1em auto;
|
19
|
-
|
20
|
-
& media {
|
21
|
-
display: block;
|
22
|
-
margin: 0 auto;
|
23
|
-
max-width: 100%;
|
24
|
-
min-width: 50px;
|
25
|
-
}
|
26
|
-
}
|
27
|
-
|
28
|
-
.ck.ck-editor__editable .media > figcaption.ck-placeholder::before {
|
29
|
-
position: static;
|
30
|
-
}
|
1
|
+
/*
|
2
|
+
* Copyright (c) 2003-2021, CKSource - Frederico Knabben. All rights reserved.
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
+
*/
|
5
|
+
|
6
|
+
/* .ck-content .media {
|
7
|
+
clear: both;
|
8
|
+
margin: 1em 0;
|
9
|
+
display: table;
|
10
|
+
min-width: 15em;
|
11
|
+
text-align: center;
|
12
|
+
} */
|
13
|
+
|
14
|
+
.ck-content .media {
|
15
|
+
display: table;
|
16
|
+
clear: both;
|
17
|
+
text-align: center;
|
18
|
+
margin: 1em auto;
|
19
|
+
width: 640px;
|
20
|
+
& media {
|
21
|
+
display: block;
|
22
|
+
margin: 0 auto;
|
23
|
+
max-width: 100%;
|
24
|
+
min-width: 50px;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
.ck.ck-editor__editable .media > figcaption.ck-placeholder::before {
|
29
|
+
position: static;
|
30
|
+
}
|