@ckeditor/ckeditor5-media-embed 0.0.0-internal-20241017.0
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/CHANGELOG.md +4 -0
- package/LICENSE.md +17 -0
- package/README.md +26 -0
- package/build/media-embed.js +5 -0
- package/build/translations/ar.js +1 -0
- package/build/translations/az.js +1 -0
- package/build/translations/bg.js +1 -0
- package/build/translations/bn.js +1 -0
- package/build/translations/ca.js +1 -0
- package/build/translations/cs.js +1 -0
- package/build/translations/da.js +1 -0
- package/build/translations/de-ch.js +1 -0
- package/build/translations/de.js +1 -0
- package/build/translations/el.js +1 -0
- package/build/translations/en-au.js +1 -0
- package/build/translations/en-gb.js +1 -0
- package/build/translations/es.js +1 -0
- package/build/translations/et.js +1 -0
- package/build/translations/fa.js +1 -0
- package/build/translations/fi.js +1 -0
- package/build/translations/fr.js +1 -0
- package/build/translations/gl.js +1 -0
- package/build/translations/he.js +1 -0
- package/build/translations/hi.js +1 -0
- package/build/translations/hr.js +1 -0
- package/build/translations/hu.js +1 -0
- package/build/translations/id.js +1 -0
- package/build/translations/it.js +1 -0
- package/build/translations/ja.js +1 -0
- package/build/translations/ko.js +1 -0
- package/build/translations/ku.js +1 -0
- package/build/translations/lt.js +1 -0
- package/build/translations/lv.js +1 -0
- package/build/translations/ms.js +1 -0
- package/build/translations/ne.js +1 -0
- package/build/translations/nl.js +1 -0
- package/build/translations/no.js +1 -0
- package/build/translations/pl.js +1 -0
- package/build/translations/pt-br.js +1 -0
- package/build/translations/pt.js +1 -0
- package/build/translations/ro.js +1 -0
- package/build/translations/ru.js +1 -0
- package/build/translations/sk.js +1 -0
- package/build/translations/sq.js +1 -0
- package/build/translations/sr-latn.js +1 -0
- package/build/translations/sr.js +1 -0
- package/build/translations/sv.js +1 -0
- package/build/translations/th.js +1 -0
- package/build/translations/tk.js +1 -0
- package/build/translations/tr.js +1 -0
- package/build/translations/uk.js +1 -0
- package/build/translations/ur.js +1 -0
- package/build/translations/uz.js +1 -0
- package/build/translations/vi.js +1 -0
- package/build/translations/zh-cn.js +1 -0
- package/build/translations/zh.js +1 -0
- package/ckeditor5-metadata.json +89 -0
- package/dist/augmentation.d.ts +29 -0
- package/dist/automediaembed.d.ts +59 -0
- package/dist/converters.d.ts +42 -0
- package/dist/index-content.css +10 -0
- package/dist/index-editor.css +96 -0
- package/dist/index.css +154 -0
- package/dist/index.css.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +1127 -0
- package/dist/index.js.map +1 -0
- package/dist/mediaembed.d.ts +42 -0
- package/dist/mediaembedcommand.d.ts +40 -0
- package/dist/mediaembedconfig.d.ts +282 -0
- package/dist/mediaembedediting.d.ts +39 -0
- package/dist/mediaembedtoolbar.d.ts +38 -0
- package/dist/mediaembedui.d.ts +42 -0
- package/dist/mediaregistry.d.ts +70 -0
- package/dist/translations/ar.d.ts +8 -0
- package/dist/translations/ar.js +5 -0
- package/dist/translations/ar.umd.js +11 -0
- package/dist/translations/az.d.ts +8 -0
- package/dist/translations/az.js +5 -0
- package/dist/translations/az.umd.js +11 -0
- package/dist/translations/bg.d.ts +8 -0
- package/dist/translations/bg.js +5 -0
- package/dist/translations/bg.umd.js +11 -0
- package/dist/translations/bn.d.ts +8 -0
- package/dist/translations/bn.js +5 -0
- package/dist/translations/bn.umd.js +11 -0
- package/dist/translations/ca.d.ts +8 -0
- package/dist/translations/ca.js +5 -0
- package/dist/translations/ca.umd.js +11 -0
- package/dist/translations/cs.d.ts +8 -0
- package/dist/translations/cs.js +5 -0
- package/dist/translations/cs.umd.js +11 -0
- package/dist/translations/da.d.ts +8 -0
- package/dist/translations/da.js +5 -0
- package/dist/translations/da.umd.js +11 -0
- package/dist/translations/de-ch.d.ts +8 -0
- package/dist/translations/de-ch.js +5 -0
- package/dist/translations/de-ch.umd.js +11 -0
- package/dist/translations/de.d.ts +8 -0
- package/dist/translations/de.js +5 -0
- package/dist/translations/de.umd.js +11 -0
- package/dist/translations/el.d.ts +8 -0
- package/dist/translations/el.js +5 -0
- package/dist/translations/el.umd.js +11 -0
- package/dist/translations/en-au.d.ts +8 -0
- package/dist/translations/en-au.js +5 -0
- package/dist/translations/en-au.umd.js +11 -0
- package/dist/translations/en-gb.d.ts +8 -0
- package/dist/translations/en-gb.js +5 -0
- package/dist/translations/en-gb.umd.js +11 -0
- package/dist/translations/en.d.ts +8 -0
- package/dist/translations/en.js +5 -0
- package/dist/translations/en.umd.js +11 -0
- package/dist/translations/es.d.ts +8 -0
- package/dist/translations/es.js +5 -0
- package/dist/translations/es.umd.js +11 -0
- package/dist/translations/et.d.ts +8 -0
- package/dist/translations/et.js +5 -0
- package/dist/translations/et.umd.js +11 -0
- package/dist/translations/fa.d.ts +8 -0
- package/dist/translations/fa.js +5 -0
- package/dist/translations/fa.umd.js +11 -0
- package/dist/translations/fi.d.ts +8 -0
- package/dist/translations/fi.js +5 -0
- package/dist/translations/fi.umd.js +11 -0
- package/dist/translations/fr.d.ts +8 -0
- package/dist/translations/fr.js +5 -0
- package/dist/translations/fr.umd.js +11 -0
- package/dist/translations/gl.d.ts +8 -0
- package/dist/translations/gl.js +5 -0
- package/dist/translations/gl.umd.js +11 -0
- package/dist/translations/he.d.ts +8 -0
- package/dist/translations/he.js +5 -0
- package/dist/translations/he.umd.js +11 -0
- package/dist/translations/hi.d.ts +8 -0
- package/dist/translations/hi.js +5 -0
- package/dist/translations/hi.umd.js +11 -0
- package/dist/translations/hr.d.ts +8 -0
- package/dist/translations/hr.js +5 -0
- package/dist/translations/hr.umd.js +11 -0
- package/dist/translations/hu.d.ts +8 -0
- package/dist/translations/hu.js +5 -0
- package/dist/translations/hu.umd.js +11 -0
- package/dist/translations/id.d.ts +8 -0
- package/dist/translations/id.js +5 -0
- package/dist/translations/id.umd.js +11 -0
- package/dist/translations/it.d.ts +8 -0
- package/dist/translations/it.js +5 -0
- package/dist/translations/it.umd.js +11 -0
- package/dist/translations/ja.d.ts +8 -0
- package/dist/translations/ja.js +5 -0
- package/dist/translations/ja.umd.js +11 -0
- package/dist/translations/ko.d.ts +8 -0
- package/dist/translations/ko.js +5 -0
- package/dist/translations/ko.umd.js +11 -0
- package/dist/translations/ku.d.ts +8 -0
- package/dist/translations/ku.js +5 -0
- package/dist/translations/ku.umd.js +11 -0
- package/dist/translations/lt.d.ts +8 -0
- package/dist/translations/lt.js +5 -0
- package/dist/translations/lt.umd.js +11 -0
- package/dist/translations/lv.d.ts +8 -0
- package/dist/translations/lv.js +5 -0
- package/dist/translations/lv.umd.js +11 -0
- package/dist/translations/ms.d.ts +8 -0
- package/dist/translations/ms.js +5 -0
- package/dist/translations/ms.umd.js +11 -0
- package/dist/translations/ne.d.ts +8 -0
- package/dist/translations/ne.js +5 -0
- package/dist/translations/ne.umd.js +11 -0
- package/dist/translations/nl.d.ts +8 -0
- package/dist/translations/nl.js +5 -0
- package/dist/translations/nl.umd.js +11 -0
- package/dist/translations/no.d.ts +8 -0
- package/dist/translations/no.js +5 -0
- package/dist/translations/no.umd.js +11 -0
- package/dist/translations/pl.d.ts +8 -0
- package/dist/translations/pl.js +5 -0
- package/dist/translations/pl.umd.js +11 -0
- package/dist/translations/pt-br.d.ts +8 -0
- package/dist/translations/pt-br.js +5 -0
- package/dist/translations/pt-br.umd.js +11 -0
- package/dist/translations/pt.d.ts +8 -0
- package/dist/translations/pt.js +5 -0
- package/dist/translations/pt.umd.js +11 -0
- package/dist/translations/ro.d.ts +8 -0
- package/dist/translations/ro.js +5 -0
- package/dist/translations/ro.umd.js +11 -0
- package/dist/translations/ru.d.ts +8 -0
- package/dist/translations/ru.js +5 -0
- package/dist/translations/ru.umd.js +11 -0
- package/dist/translations/sk.d.ts +8 -0
- package/dist/translations/sk.js +5 -0
- package/dist/translations/sk.umd.js +11 -0
- package/dist/translations/sq.d.ts +8 -0
- package/dist/translations/sq.js +5 -0
- package/dist/translations/sq.umd.js +11 -0
- package/dist/translations/sr-latn.d.ts +8 -0
- package/dist/translations/sr-latn.js +5 -0
- package/dist/translations/sr-latn.umd.js +11 -0
- package/dist/translations/sr.d.ts +8 -0
- package/dist/translations/sr.js +5 -0
- package/dist/translations/sr.umd.js +11 -0
- package/dist/translations/sv.d.ts +8 -0
- package/dist/translations/sv.js +5 -0
- package/dist/translations/sv.umd.js +11 -0
- package/dist/translations/th.d.ts +8 -0
- package/dist/translations/th.js +5 -0
- package/dist/translations/th.umd.js +11 -0
- package/dist/translations/tk.d.ts +8 -0
- package/dist/translations/tk.js +5 -0
- package/dist/translations/tk.umd.js +11 -0
- package/dist/translations/tr.d.ts +8 -0
- package/dist/translations/tr.js +5 -0
- package/dist/translations/tr.umd.js +11 -0
- package/dist/translations/uk.d.ts +8 -0
- package/dist/translations/uk.js +5 -0
- package/dist/translations/uk.umd.js +11 -0
- package/dist/translations/ur.d.ts +8 -0
- package/dist/translations/ur.js +5 -0
- package/dist/translations/ur.umd.js +11 -0
- package/dist/translations/uz.d.ts +8 -0
- package/dist/translations/uz.js +5 -0
- package/dist/translations/uz.umd.js +11 -0
- package/dist/translations/vi.d.ts +8 -0
- package/dist/translations/vi.js +5 -0
- package/dist/translations/vi.umd.js +11 -0
- package/dist/translations/zh-cn.d.ts +8 -0
- package/dist/translations/zh-cn.js +5 -0
- package/dist/translations/zh-cn.umd.js +11 -0
- package/dist/translations/zh.d.ts +8 -0
- package/dist/translations/zh.js +5 -0
- package/dist/translations/zh.umd.js +11 -0
- package/dist/ui/mediaformview.d.ts +93 -0
- package/dist/utils.d.ts +71 -0
- package/lang/contexts.json +12 -0
- package/lang/translations/ar.po +58 -0
- package/lang/translations/az.po +58 -0
- package/lang/translations/bg.po +58 -0
- package/lang/translations/bn.po +58 -0
- package/lang/translations/ca.po +58 -0
- package/lang/translations/cs.po +58 -0
- package/lang/translations/da.po +58 -0
- package/lang/translations/de-ch.po +58 -0
- package/lang/translations/de.po +58 -0
- package/lang/translations/el.po +58 -0
- package/lang/translations/en-au.po +58 -0
- package/lang/translations/en-gb.po +58 -0
- package/lang/translations/en.po +58 -0
- package/lang/translations/es.po +58 -0
- package/lang/translations/et.po +58 -0
- package/lang/translations/fa.po +58 -0
- package/lang/translations/fi.po +58 -0
- package/lang/translations/fr.po +58 -0
- package/lang/translations/gl.po +58 -0
- package/lang/translations/he.po +58 -0
- package/lang/translations/hi.po +58 -0
- package/lang/translations/hr.po +58 -0
- package/lang/translations/hu.po +58 -0
- package/lang/translations/id.po +58 -0
- package/lang/translations/it.po +58 -0
- package/lang/translations/ja.po +58 -0
- package/lang/translations/ko.po +58 -0
- package/lang/translations/ku.po +58 -0
- package/lang/translations/lt.po +58 -0
- package/lang/translations/lv.po +58 -0
- package/lang/translations/ms.po +58 -0
- package/lang/translations/ne.po +58 -0
- package/lang/translations/nl.po +58 -0
- package/lang/translations/no.po +58 -0
- package/lang/translations/pl.po +58 -0
- package/lang/translations/pt-br.po +58 -0
- package/lang/translations/pt.po +58 -0
- package/lang/translations/ro.po +58 -0
- package/lang/translations/ru.po +58 -0
- package/lang/translations/sk.po +58 -0
- package/lang/translations/sq.po +58 -0
- package/lang/translations/sr-latn.po +58 -0
- package/lang/translations/sr.po +58 -0
- package/lang/translations/sv.po +58 -0
- package/lang/translations/th.po +58 -0
- package/lang/translations/tk.po +58 -0
- package/lang/translations/tr.po +58 -0
- package/lang/translations/uk.po +58 -0
- package/lang/translations/ur.po +58 -0
- package/lang/translations/uz.po +58 -0
- package/lang/translations/vi.po +58 -0
- package/lang/translations/zh-cn.po +58 -0
- package/lang/translations/zh.po +58 -0
- package/package.json +46 -0
- package/src/augmentation.d.ts +25 -0
- package/src/augmentation.js +5 -0
- package/src/automediaembed.d.ts +55 -0
- package/src/automediaembed.js +137 -0
- package/src/converters.d.ts +38 -0
- package/src/converters.js +53 -0
- package/src/index.d.ts +15 -0
- package/src/index.js +13 -0
- package/src/mediaembed.d.ts +38 -0
- package/src/mediaembed.js +44 -0
- package/src/mediaembedcommand.d.ts +36 -0
- package/src/mediaembedcommand.js +71 -0
- package/src/mediaembedconfig.d.ts +278 -0
- package/src/mediaembedconfig.js +5 -0
- package/src/mediaembedediting.d.ts +35 -0
- package/src/mediaembedediting.js +247 -0
- package/src/mediaembedtoolbar.d.ts +34 -0
- package/src/mediaembedtoolbar.js +50 -0
- package/src/mediaembedui.d.ts +38 -0
- package/src/mediaembedui.js +132 -0
- package/src/mediaregistry.d.ts +66 -0
- package/src/mediaregistry.js +232 -0
- package/src/ui/mediaformview.d.ts +89 -0
- package/src/ui/mediaformview.js +132 -0
- package/src/utils.d.ts +67 -0
- package/src/utils.js +85 -0
- package/theme/icons/media/twitter.svg +20 -0
- package/theme/icons/media-placeholder.svg +1 -0
- package/theme/icons/media.svg +1 -0
- package/theme/mediaembed.css +23 -0
- package/theme/mediaembedediting.css +48 -0
- package/theme/mediaform.css +39 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module media-embed/mediaembedui
|
|
7
|
+
*/
|
|
8
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
9
|
+
import { ButtonView, CssTransitionDisablerMixin, MenuBarMenuListItemButtonView, Dialog } from 'ckeditor5/src/ui.js';
|
|
10
|
+
import MediaFormView from './ui/mediaformview.js';
|
|
11
|
+
import MediaEmbedEditing from './mediaembedediting.js';
|
|
12
|
+
import mediaIcon from '../theme/icons/media.svg';
|
|
13
|
+
/**
|
|
14
|
+
* The media embed UI plugin.
|
|
15
|
+
*/
|
|
16
|
+
export default class MediaEmbedUI extends Plugin {
|
|
17
|
+
/**
|
|
18
|
+
* @inheritDoc
|
|
19
|
+
*/
|
|
20
|
+
static get requires() {
|
|
21
|
+
return [MediaEmbedEditing, Dialog];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get pluginName() {
|
|
27
|
+
return 'MediaEmbedUI';
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
static get isOfficialPlugin() {
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* @inheritDoc
|
|
37
|
+
*/
|
|
38
|
+
init() {
|
|
39
|
+
const editor = this.editor;
|
|
40
|
+
editor.ui.componentFactory.add('mediaEmbed', () => {
|
|
41
|
+
const t = this.editor.locale.t;
|
|
42
|
+
const button = this._createDialogButton(ButtonView);
|
|
43
|
+
button.tooltip = true;
|
|
44
|
+
button.label = t('Insert media');
|
|
45
|
+
return button;
|
|
46
|
+
});
|
|
47
|
+
editor.ui.componentFactory.add('menuBar:mediaEmbed', () => {
|
|
48
|
+
const t = this.editor.locale.t;
|
|
49
|
+
const button = this._createDialogButton(MenuBarMenuListItemButtonView);
|
|
50
|
+
button.label = t('Media');
|
|
51
|
+
return button;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Creates a button for menu bar that will show media embed dialog.
|
|
56
|
+
*/
|
|
57
|
+
_createDialogButton(ButtonClass) {
|
|
58
|
+
const editor = this.editor;
|
|
59
|
+
const buttonView = new ButtonClass(editor.locale);
|
|
60
|
+
const command = editor.commands.get('mediaEmbed');
|
|
61
|
+
const dialogPlugin = this.editor.plugins.get('Dialog');
|
|
62
|
+
buttonView.icon = mediaIcon;
|
|
63
|
+
buttonView.bind('isEnabled').to(command, 'isEnabled');
|
|
64
|
+
buttonView.on('execute', () => {
|
|
65
|
+
if (dialogPlugin.id === 'mediaEmbed') {
|
|
66
|
+
dialogPlugin.hide();
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
this._showDialog();
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
return buttonView;
|
|
73
|
+
}
|
|
74
|
+
_showDialog() {
|
|
75
|
+
const editor = this.editor;
|
|
76
|
+
const dialog = editor.plugins.get('Dialog');
|
|
77
|
+
const command = editor.commands.get('mediaEmbed');
|
|
78
|
+
const t = editor.locale.t;
|
|
79
|
+
if (!this._formView) {
|
|
80
|
+
const registry = editor.plugins.get(MediaEmbedEditing).registry;
|
|
81
|
+
this._formView = new (CssTransitionDisablerMixin(MediaFormView))(getFormValidators(editor.t, registry), editor.locale);
|
|
82
|
+
this._formView.on('submit', () => this._handleSubmitForm());
|
|
83
|
+
}
|
|
84
|
+
dialog.show({
|
|
85
|
+
id: 'mediaEmbed',
|
|
86
|
+
title: t('Insert media'),
|
|
87
|
+
content: this._formView,
|
|
88
|
+
isModal: true,
|
|
89
|
+
onShow: () => {
|
|
90
|
+
this._formView.url = command.value || '';
|
|
91
|
+
this._formView.resetFormStatus();
|
|
92
|
+
this._formView.urlInputView.fieldView.select();
|
|
93
|
+
},
|
|
94
|
+
actionButtons: [
|
|
95
|
+
{
|
|
96
|
+
label: t('Cancel'),
|
|
97
|
+
withText: true,
|
|
98
|
+
onExecute: () => dialog.hide()
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
label: t('Accept'),
|
|
102
|
+
class: 'ck-button-action',
|
|
103
|
+
withText: true,
|
|
104
|
+
onExecute: () => this._handleSubmitForm()
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
_handleSubmitForm() {
|
|
110
|
+
const editor = this.editor;
|
|
111
|
+
const dialog = editor.plugins.get('Dialog');
|
|
112
|
+
if (this._formView.isValid()) {
|
|
113
|
+
editor.execute('mediaEmbed', this._formView.url);
|
|
114
|
+
dialog.hide();
|
|
115
|
+
editor.editing.view.focus();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
function getFormValidators(t, registry) {
|
|
120
|
+
return [
|
|
121
|
+
form => {
|
|
122
|
+
if (!form.url.length) {
|
|
123
|
+
return t('The URL must not be empty.');
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
form => {
|
|
127
|
+
if (!registry.hasMedia(form.url)) {
|
|
128
|
+
return t('This media URL is not supported.');
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
];
|
|
132
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module media-embed/mediaregistry
|
|
7
|
+
*/
|
|
8
|
+
import type { DowncastWriter, ViewElement } from 'ckeditor5/src/engine.js';
|
|
9
|
+
import { type Locale } from 'ckeditor5/src/utils.js';
|
|
10
|
+
import type { MediaEmbedConfig, MediaEmbedProvider } from './mediaembedconfig.js';
|
|
11
|
+
import type { MediaOptions } from './utils.js';
|
|
12
|
+
/**
|
|
13
|
+
* A bridge between the raw media content provider definitions and the editor view content.
|
|
14
|
+
*
|
|
15
|
+
* It helps translating media URLs to corresponding {@link module:engine/view/element~Element view elements}.
|
|
16
|
+
*
|
|
17
|
+
* Mostly used by the {@link module:media-embed/mediaembedediting~MediaEmbedEditing} plugin.
|
|
18
|
+
*/
|
|
19
|
+
export default class MediaRegistry {
|
|
20
|
+
/**
|
|
21
|
+
* The {@link module:utils/locale~Locale} instance.
|
|
22
|
+
*/
|
|
23
|
+
locale: Locale;
|
|
24
|
+
/**
|
|
25
|
+
* The media provider definitions available for the registry. Usually corresponding with the
|
|
26
|
+
* {@link module:media-embed/mediaembedconfig~MediaEmbedConfig media configuration}.
|
|
27
|
+
*/
|
|
28
|
+
providerDefinitions: Array<MediaEmbedProvider>;
|
|
29
|
+
/**
|
|
30
|
+
* Creates an instance of the {@link module:media-embed/mediaregistry~MediaRegistry} class.
|
|
31
|
+
*
|
|
32
|
+
* @param locale The localization services instance.
|
|
33
|
+
* @param config The configuration of the media embed feature.
|
|
34
|
+
*/
|
|
35
|
+
constructor(locale: Locale, config: MediaEmbedConfig);
|
|
36
|
+
/**
|
|
37
|
+
* Checks whether the passed URL is representing a certain media type allowed in the editor.
|
|
38
|
+
*
|
|
39
|
+
* @param url The URL to be checked
|
|
40
|
+
*/
|
|
41
|
+
hasMedia(url: string): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* For the given media URL string and options, it returns the {@link module:engine/view/element~Element view element}
|
|
44
|
+
* representing that media.
|
|
45
|
+
*
|
|
46
|
+
* **Note:** If no URL is specified, an empty view element is returned.
|
|
47
|
+
*
|
|
48
|
+
* @param writer The view writer used to produce a view element.
|
|
49
|
+
* @param url The URL to be translated into a view element.
|
|
50
|
+
*/
|
|
51
|
+
getMediaViewElement(writer: DowncastWriter, url: string, options: MediaOptions): ViewElement;
|
|
52
|
+
/**
|
|
53
|
+
* Returns a `Media` instance for the given URL.
|
|
54
|
+
*
|
|
55
|
+
* @param url The URL of the media.
|
|
56
|
+
* @returns The `Media` instance or `null` when there is none.
|
|
57
|
+
*/
|
|
58
|
+
private _getMedia;
|
|
59
|
+
/**
|
|
60
|
+
* Tries to match `url` to `pattern`.
|
|
61
|
+
*
|
|
62
|
+
* @param url The URL of the media.
|
|
63
|
+
* @param pattern The pattern that should accept the media URL.
|
|
64
|
+
*/
|
|
65
|
+
private _getUrlMatches;
|
|
66
|
+
}
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
import { IconView, Template } from 'ckeditor5/src/ui.js';
|
|
6
|
+
import { logWarning, toArray } from 'ckeditor5/src/utils.js';
|
|
7
|
+
import mediaPlaceholderIcon from '../theme/icons/media-placeholder.svg';
|
|
8
|
+
const mediaPlaceholderIconViewBox = '0 0 64 42';
|
|
9
|
+
/**
|
|
10
|
+
* A bridge between the raw media content provider definitions and the editor view content.
|
|
11
|
+
*
|
|
12
|
+
* It helps translating media URLs to corresponding {@link module:engine/view/element~Element view elements}.
|
|
13
|
+
*
|
|
14
|
+
* Mostly used by the {@link module:media-embed/mediaembedediting~MediaEmbedEditing} plugin.
|
|
15
|
+
*/
|
|
16
|
+
export default class MediaRegistry {
|
|
17
|
+
/**
|
|
18
|
+
* Creates an instance of the {@link module:media-embed/mediaregistry~MediaRegistry} class.
|
|
19
|
+
*
|
|
20
|
+
* @param locale The localization services instance.
|
|
21
|
+
* @param config The configuration of the media embed feature.
|
|
22
|
+
*/
|
|
23
|
+
constructor(locale, config) {
|
|
24
|
+
const providers = config.providers;
|
|
25
|
+
const extraProviders = config.extraProviders || [];
|
|
26
|
+
const removedProviders = new Set(config.removeProviders);
|
|
27
|
+
const providerDefinitions = providers
|
|
28
|
+
.concat(extraProviders)
|
|
29
|
+
.filter(provider => {
|
|
30
|
+
const name = provider.name;
|
|
31
|
+
if (!name) {
|
|
32
|
+
/**
|
|
33
|
+
* One of the providers (or extra providers) specified in the media embed configuration
|
|
34
|
+
* has no name and will not be used by the editor. In order to get this media
|
|
35
|
+
* provider working, double check your editor configuration.
|
|
36
|
+
*
|
|
37
|
+
* @error media-embed-no-provider-name
|
|
38
|
+
*/
|
|
39
|
+
logWarning('media-embed-no-provider-name', { provider });
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
return !removedProviders.has(name);
|
|
43
|
+
});
|
|
44
|
+
this.locale = locale;
|
|
45
|
+
this.providerDefinitions = providerDefinitions;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Checks whether the passed URL is representing a certain media type allowed in the editor.
|
|
49
|
+
*
|
|
50
|
+
* @param url The URL to be checked
|
|
51
|
+
*/
|
|
52
|
+
hasMedia(url) {
|
|
53
|
+
return !!this._getMedia(url);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* For the given media URL string and options, it returns the {@link module:engine/view/element~Element view element}
|
|
57
|
+
* representing that media.
|
|
58
|
+
*
|
|
59
|
+
* **Note:** If no URL is specified, an empty view element is returned.
|
|
60
|
+
*
|
|
61
|
+
* @param writer The view writer used to produce a view element.
|
|
62
|
+
* @param url The URL to be translated into a view element.
|
|
63
|
+
*/
|
|
64
|
+
getMediaViewElement(writer, url, options) {
|
|
65
|
+
return this._getMedia(url).getViewElement(writer, options);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Returns a `Media` instance for the given URL.
|
|
69
|
+
*
|
|
70
|
+
* @param url The URL of the media.
|
|
71
|
+
* @returns The `Media` instance or `null` when there is none.
|
|
72
|
+
*/
|
|
73
|
+
_getMedia(url) {
|
|
74
|
+
if (!url) {
|
|
75
|
+
return new Media(this.locale);
|
|
76
|
+
}
|
|
77
|
+
url = url.trim();
|
|
78
|
+
for (const definition of this.providerDefinitions) {
|
|
79
|
+
const previewRenderer = definition.html;
|
|
80
|
+
const pattern = toArray(definition.url);
|
|
81
|
+
for (const subPattern of pattern) {
|
|
82
|
+
const match = this._getUrlMatches(url, subPattern);
|
|
83
|
+
if (match) {
|
|
84
|
+
return new Media(this.locale, url, match, previewRenderer);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Tries to match `url` to `pattern`.
|
|
92
|
+
*
|
|
93
|
+
* @param url The URL of the media.
|
|
94
|
+
* @param pattern The pattern that should accept the media URL.
|
|
95
|
+
*/
|
|
96
|
+
_getUrlMatches(url, pattern) {
|
|
97
|
+
// 1. Try to match without stripping the protocol and "www" subdomain.
|
|
98
|
+
let match = url.match(pattern);
|
|
99
|
+
if (match) {
|
|
100
|
+
return match;
|
|
101
|
+
}
|
|
102
|
+
// 2. Try to match after stripping the protocol.
|
|
103
|
+
let rawUrl = url.replace(/^https?:\/\//, '');
|
|
104
|
+
match = rawUrl.match(pattern);
|
|
105
|
+
if (match) {
|
|
106
|
+
return match;
|
|
107
|
+
}
|
|
108
|
+
// 3. Try to match after stripping the "www" subdomain.
|
|
109
|
+
rawUrl = rawUrl.replace(/^www\./, '');
|
|
110
|
+
match = rawUrl.match(pattern);
|
|
111
|
+
if (match) {
|
|
112
|
+
return match;
|
|
113
|
+
}
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Represents media defined by the provider configuration.
|
|
119
|
+
*
|
|
120
|
+
* It can be rendered to the {@link module:engine/view/element~Element view element} and used in the editing or data pipeline.
|
|
121
|
+
*/
|
|
122
|
+
class Media {
|
|
123
|
+
constructor(locale, url, match, previewRenderer) {
|
|
124
|
+
this.url = this._getValidUrl(url);
|
|
125
|
+
this._locale = locale;
|
|
126
|
+
this._match = match;
|
|
127
|
+
this._previewRenderer = previewRenderer;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Returns the view element representation of the media.
|
|
131
|
+
*
|
|
132
|
+
* @param writer The view writer used to produce a view element.
|
|
133
|
+
*/
|
|
134
|
+
getViewElement(writer, options) {
|
|
135
|
+
const attributes = {};
|
|
136
|
+
let viewElement;
|
|
137
|
+
if (options.renderForEditingView || (options.renderMediaPreview && this.url && this._previewRenderer)) {
|
|
138
|
+
if (this.url) {
|
|
139
|
+
attributes['data-oembed-url'] = this.url;
|
|
140
|
+
}
|
|
141
|
+
if (options.renderForEditingView) {
|
|
142
|
+
attributes.class = 'ck-media__wrapper';
|
|
143
|
+
}
|
|
144
|
+
const mediaHtml = this._getPreviewHtml(options);
|
|
145
|
+
viewElement = writer.createRawElement('div', attributes, (domElement, domConverter) => {
|
|
146
|
+
domConverter.setContentOf(domElement, mediaHtml);
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
if (this.url) {
|
|
151
|
+
attributes.url = this.url;
|
|
152
|
+
}
|
|
153
|
+
viewElement = writer.createEmptyElement(options.elementName, attributes);
|
|
154
|
+
}
|
|
155
|
+
writer.setCustomProperty('media-content', true, viewElement);
|
|
156
|
+
return viewElement;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Returns the HTML string of the media content preview.
|
|
160
|
+
*/
|
|
161
|
+
_getPreviewHtml(options) {
|
|
162
|
+
if (this._previewRenderer) {
|
|
163
|
+
return this._previewRenderer(this._match);
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
// The placeholder only makes sense for editing view and media which have URLs.
|
|
167
|
+
// Placeholder is never displayed in data and URL-less media have no content.
|
|
168
|
+
if (this.url && options.renderForEditingView) {
|
|
169
|
+
return this._getPlaceholderHtml();
|
|
170
|
+
}
|
|
171
|
+
return '';
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Returns the placeholder HTML when the media has no content preview.
|
|
176
|
+
*/
|
|
177
|
+
_getPlaceholderHtml() {
|
|
178
|
+
const icon = new IconView();
|
|
179
|
+
const t = this._locale.t;
|
|
180
|
+
icon.content = mediaPlaceholderIcon;
|
|
181
|
+
icon.viewBox = mediaPlaceholderIconViewBox;
|
|
182
|
+
const placeholder = new Template({
|
|
183
|
+
tag: 'div',
|
|
184
|
+
attributes: {
|
|
185
|
+
class: 'ck ck-reset_all ck-media__placeholder'
|
|
186
|
+
},
|
|
187
|
+
children: [
|
|
188
|
+
{
|
|
189
|
+
tag: 'div',
|
|
190
|
+
attributes: {
|
|
191
|
+
class: 'ck-media__placeholder__icon'
|
|
192
|
+
},
|
|
193
|
+
children: [icon]
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
tag: 'a',
|
|
197
|
+
attributes: {
|
|
198
|
+
class: 'ck-media__placeholder__url',
|
|
199
|
+
target: '_blank',
|
|
200
|
+
rel: 'noopener noreferrer',
|
|
201
|
+
href: this.url,
|
|
202
|
+
'data-cke-tooltip-text': t('Open media in new tab')
|
|
203
|
+
},
|
|
204
|
+
children: [
|
|
205
|
+
{
|
|
206
|
+
tag: 'span',
|
|
207
|
+
attributes: {
|
|
208
|
+
class: 'ck-media__placeholder__url__text'
|
|
209
|
+
},
|
|
210
|
+
children: [this.url]
|
|
211
|
+
}
|
|
212
|
+
]
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
}).render();
|
|
216
|
+
return placeholder.outerHTML;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Returns the full URL to the specified media.
|
|
220
|
+
*
|
|
221
|
+
* @param url The URL of the media.
|
|
222
|
+
*/
|
|
223
|
+
_getValidUrl(url) {
|
|
224
|
+
if (!url) {
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
if (url.match(/^https?/)) {
|
|
228
|
+
return url;
|
|
229
|
+
}
|
|
230
|
+
return 'https://' + url;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module media-embed/ui/mediaformview
|
|
7
|
+
*/
|
|
8
|
+
import { type InputTextView, LabeledFieldView, View } from 'ckeditor5/src/ui.js';
|
|
9
|
+
import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils.js';
|
|
10
|
+
import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';
|
|
11
|
+
import '../../theme/mediaform.css';
|
|
12
|
+
/**
|
|
13
|
+
* The media form view controller class.
|
|
14
|
+
*
|
|
15
|
+
* See {@link module:media-embed/ui/mediaformview~MediaFormView}.
|
|
16
|
+
*/
|
|
17
|
+
export default class MediaFormView extends View {
|
|
18
|
+
/**
|
|
19
|
+
* Tracks information about the DOM focus in the form.
|
|
20
|
+
*/
|
|
21
|
+
readonly focusTracker: FocusTracker;
|
|
22
|
+
/**
|
|
23
|
+
* An instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
|
|
24
|
+
*/
|
|
25
|
+
readonly keystrokes: KeystrokeHandler;
|
|
26
|
+
/**
|
|
27
|
+
* The value of the URL input.
|
|
28
|
+
*/
|
|
29
|
+
mediaURLInputValue: string;
|
|
30
|
+
/**
|
|
31
|
+
* The URL input view.
|
|
32
|
+
*/
|
|
33
|
+
urlInputView: LabeledFieldView<InputTextView>;
|
|
34
|
+
/**
|
|
35
|
+
* An array of form validators used by {@link #isValid}.
|
|
36
|
+
*/
|
|
37
|
+
private readonly _validators;
|
|
38
|
+
/**
|
|
39
|
+
* The default info text for the {@link #urlInputView}.
|
|
40
|
+
*/
|
|
41
|
+
private _urlInputViewInfoDefault?;
|
|
42
|
+
/**
|
|
43
|
+
* The info text with an additional tip for the {@link #urlInputView},
|
|
44
|
+
* displayed when the input has some value.
|
|
45
|
+
*/
|
|
46
|
+
private _urlInputViewInfoTip?;
|
|
47
|
+
/**
|
|
48
|
+
* @param validators Form validators used by {@link #isValid}.
|
|
49
|
+
* @param locale The localization services instance.
|
|
50
|
+
*/
|
|
51
|
+
constructor(validators: Array<(v: MediaFormView) => string | undefined>, locale: Locale);
|
|
52
|
+
/**
|
|
53
|
+
* @inheritDoc
|
|
54
|
+
*/
|
|
55
|
+
render(): void;
|
|
56
|
+
/**
|
|
57
|
+
* @inheritDoc
|
|
58
|
+
*/
|
|
59
|
+
destroy(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Focuses the {@link #urlInputView}.
|
|
62
|
+
*/
|
|
63
|
+
focus(): void;
|
|
64
|
+
/**
|
|
65
|
+
* The native DOM `value` of the {@link #urlInputView} element.
|
|
66
|
+
*
|
|
67
|
+
* **Note**: Do not confuse it with the {@link module:ui/inputtext/inputtextview~InputTextView#value}
|
|
68
|
+
* which works one way only and may not represent the actual state of the component in the DOM.
|
|
69
|
+
*/
|
|
70
|
+
get url(): string;
|
|
71
|
+
set url(url: string);
|
|
72
|
+
/**
|
|
73
|
+
* Validates the form and returns `false` when some fields are invalid.
|
|
74
|
+
*/
|
|
75
|
+
isValid(): boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Cleans up the supplementary error and information text of the {@link #urlInputView}
|
|
78
|
+
* bringing them back to the state when the form has been displayed for the first time.
|
|
79
|
+
*
|
|
80
|
+
* See {@link #isValid}.
|
|
81
|
+
*/
|
|
82
|
+
resetFormStatus(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Creates a labeled input view.
|
|
85
|
+
*
|
|
86
|
+
* @returns Labeled input view instance.
|
|
87
|
+
*/
|
|
88
|
+
private _createUrlInput;
|
|
89
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module media-embed/ui/mediaformview
|
|
7
|
+
*/
|
|
8
|
+
import { LabeledFieldView, View, createLabeledInputText, submitHandler } from 'ckeditor5/src/ui.js';
|
|
9
|
+
import { FocusTracker, KeystrokeHandler } from 'ckeditor5/src/utils.js';
|
|
10
|
+
// See: #8833.
|
|
11
|
+
// eslint-disable-next-line ckeditor5-rules/ckeditor-imports
|
|
12
|
+
import '@ckeditor/ckeditor5-ui/theme/components/responsive-form/responsiveform.css';
|
|
13
|
+
import '../../theme/mediaform.css';
|
|
14
|
+
/**
|
|
15
|
+
* The media form view controller class.
|
|
16
|
+
*
|
|
17
|
+
* See {@link module:media-embed/ui/mediaformview~MediaFormView}.
|
|
18
|
+
*/
|
|
19
|
+
export default class MediaFormView extends View {
|
|
20
|
+
/**
|
|
21
|
+
* @param validators Form validators used by {@link #isValid}.
|
|
22
|
+
* @param locale The localization services instance.
|
|
23
|
+
*/
|
|
24
|
+
constructor(validators, locale) {
|
|
25
|
+
super(locale);
|
|
26
|
+
this.focusTracker = new FocusTracker();
|
|
27
|
+
this.keystrokes = new KeystrokeHandler();
|
|
28
|
+
this.set('mediaURLInputValue', '');
|
|
29
|
+
this.urlInputView = this._createUrlInput();
|
|
30
|
+
this._validators = validators;
|
|
31
|
+
this.setTemplate({
|
|
32
|
+
tag: 'form',
|
|
33
|
+
attributes: {
|
|
34
|
+
class: [
|
|
35
|
+
'ck',
|
|
36
|
+
'ck-media-form',
|
|
37
|
+
'ck-responsive-form'
|
|
38
|
+
],
|
|
39
|
+
tabindex: '-1'
|
|
40
|
+
},
|
|
41
|
+
children: [
|
|
42
|
+
this.urlInputView
|
|
43
|
+
]
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* @inheritDoc
|
|
48
|
+
*/
|
|
49
|
+
render() {
|
|
50
|
+
super.render();
|
|
51
|
+
submitHandler({
|
|
52
|
+
view: this
|
|
53
|
+
});
|
|
54
|
+
// Register the view in the focus tracker.
|
|
55
|
+
this.focusTracker.add(this.urlInputView.element);
|
|
56
|
+
// Start listening for the keystrokes coming from #element.
|
|
57
|
+
this.keystrokes.listenTo(this.element);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @inheritDoc
|
|
61
|
+
*/
|
|
62
|
+
destroy() {
|
|
63
|
+
super.destroy();
|
|
64
|
+
this.focusTracker.destroy();
|
|
65
|
+
this.keystrokes.destroy();
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Focuses the {@link #urlInputView}.
|
|
69
|
+
*/
|
|
70
|
+
focus() {
|
|
71
|
+
this.urlInputView.focus();
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The native DOM `value` of the {@link #urlInputView} element.
|
|
75
|
+
*
|
|
76
|
+
* **Note**: Do not confuse it with the {@link module:ui/inputtext/inputtextview~InputTextView#value}
|
|
77
|
+
* which works one way only and may not represent the actual state of the component in the DOM.
|
|
78
|
+
*/
|
|
79
|
+
get url() {
|
|
80
|
+
return this.urlInputView.fieldView.element.value.trim();
|
|
81
|
+
}
|
|
82
|
+
set url(url) {
|
|
83
|
+
this.urlInputView.fieldView.value = url.trim();
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Validates the form and returns `false` when some fields are invalid.
|
|
87
|
+
*/
|
|
88
|
+
isValid() {
|
|
89
|
+
this.resetFormStatus();
|
|
90
|
+
for (const validator of this._validators) {
|
|
91
|
+
const errorText = validator(this);
|
|
92
|
+
// One error per field is enough.
|
|
93
|
+
if (errorText) {
|
|
94
|
+
// Apply updated error.
|
|
95
|
+
this.urlInputView.errorText = errorText;
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Cleans up the supplementary error and information text of the {@link #urlInputView}
|
|
103
|
+
* bringing them back to the state when the form has been displayed for the first time.
|
|
104
|
+
*
|
|
105
|
+
* See {@link #isValid}.
|
|
106
|
+
*/
|
|
107
|
+
resetFormStatus() {
|
|
108
|
+
this.urlInputView.errorText = null;
|
|
109
|
+
this.urlInputView.infoText = this._urlInputViewInfoDefault;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Creates a labeled input view.
|
|
113
|
+
*
|
|
114
|
+
* @returns Labeled input view instance.
|
|
115
|
+
*/
|
|
116
|
+
_createUrlInput() {
|
|
117
|
+
const t = this.locale.t;
|
|
118
|
+
const labeledInput = new LabeledFieldView(this.locale, createLabeledInputText);
|
|
119
|
+
const inputField = labeledInput.fieldView;
|
|
120
|
+
this._urlInputViewInfoDefault = t('Paste the media URL in the input.');
|
|
121
|
+
this._urlInputViewInfoTip = t('Tip: Paste the URL into the content to embed faster.');
|
|
122
|
+
labeledInput.label = t('Media URL');
|
|
123
|
+
labeledInput.infoText = this._urlInputViewInfoDefault;
|
|
124
|
+
inputField.inputMode = 'url';
|
|
125
|
+
inputField.on('input', () => {
|
|
126
|
+
// Display the tip text only when there is some value. Otherwise fall back to the default info text.
|
|
127
|
+
labeledInput.infoText = inputField.element.value ? this._urlInputViewInfoTip : this._urlInputViewInfoDefault;
|
|
128
|
+
this.mediaURLInputValue = inputField.element.value.trim();
|
|
129
|
+
});
|
|
130
|
+
return labeledInput;
|
|
131
|
+
}
|
|
132
|
+
}
|