|
|
@@ -13,6 +13,8 @@ import MediaEmbedUI from './mediaembedui';
|
|
|
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
|
|
|
import Widget from '@ckeditor/ckeditor5-widget/src/widget';
|
|
|
|
|
|
+import '../theme/mediaembed.css';
|
|
|
+
|
|
|
/**
|
|
|
* The media embed plugin.
|
|
|
*
|
|
|
@@ -20,9 +22,9 @@ import Widget from '@ckeditor/ckeditor5-widget/src/widget';
|
|
|
*
|
|
|
* This is a "glue" plugin which loads the following plugins:
|
|
|
*
|
|
|
- * * {@link module:media-embed/mediaembedediting~MediaEmbedEditing media embed editing feature},
|
|
|
- * * {@link module:media-embed/mediaembedui~MediaEmbedUI media embed UI feature} and
|
|
|
- * * {@link module:media-embed/automediaembed~AutoMediaEmbed auto-media embed feature}.
|
|
|
+ * * The {@link module:media-embed/mediaembedediting~MediaEmbedEditing media embed editing feature},
|
|
|
+ * * The {@link module:media-embed/mediaembedui~MediaEmbedUI media embed UI feature} and
|
|
|
+ * * The {@link module:media-embed/automediaembed~AutoMediaEmbed auto-media embed feature}.
|
|
|
*
|
|
|
* @extends module:core/plugin~Plugin
|
|
|
*/
|
|
|
@@ -76,7 +78,7 @@ export default class MediaEmbed extends Plugin {
|
|
|
* url: /^.+/
|
|
|
* }
|
|
|
*
|
|
|
- * To implement a responsive media, you can use the following HTML structure:
|
|
|
+ * To implement responsive media, you can use the following HTML structure:
|
|
|
*
|
|
|
* {
|
|
|
* ...
|
|
|
@@ -92,14 +94,14 @@ export default class MediaEmbed extends Plugin {
|
|
|
* @property {String} name The name of the provider. Used e.g. when
|
|
|
* {@link module:media-embed/mediaembed~MediaEmbedConfig#removeProviders removing providers}.
|
|
|
* @property {RegExp|Array.<RegExp>} url The `RegExp` object (or array of objects) defining the URL of the media.
|
|
|
- * If any URL matches the `RegExp`, it becomes the media in editor model, as defined by the provider. The result
|
|
|
+ * If any URL matches the `RegExp`, it becomes the media in the editor model, as defined by the provider. The result
|
|
|
* of matching (output of `String.prototype.match()`) is passed to the `html` rendering function of the media.
|
|
|
*
|
|
|
- * **Note:** You do not need to include the protocol (`http://`, `https://`) and `www` sub–domain in your `RegExps`,
|
|
|
+ * **Note:** You do not need to include the protocol (`http://`, `https://`) and `www` subdomain in your `RegExps`,
|
|
|
* they are stripped from the URLs before matching anyway.
|
|
|
- * @property {Function} [html] (optional) Rendering function of the media. The function receives the entire matching
|
|
|
+ * @property {Function} [html] (optional) The rendering function of the media. The function receives the entire matching
|
|
|
* array from the corresponding `url` `RegExp` as an argument, allowing rendering a dedicated
|
|
|
- * preview of a media identified by a certain id or a hash. When not defined, the media embed feature
|
|
|
+ * preview of the media identified by a certain ID or a hash. When not defined, the media embed feature
|
|
|
* will use a generic media representation in the view and output data.
|
|
|
* Note that when
|
|
|
* {@link module:media-embed/mediaembed~MediaEmbedConfig#previewsInData `config.mediaEmbed.previewsInData`}
|
|
|
@@ -134,14 +136,14 @@ export default class MediaEmbed extends Plugin {
|
|
|
/**
|
|
|
* The default media providers supported by the editor.
|
|
|
*
|
|
|
- * Names of providers with rendering functions (previews):
|
|
|
+ * The names of providers with rendering functions (previews):
|
|
|
*
|
|
|
* * "dailymotion",
|
|
|
* * "spotify",
|
|
|
* * "youtube",
|
|
|
* * "vimeo"
|
|
|
*
|
|
|
- * Names of providers without rendering functions:
|
|
|
+ * The names of providers without rendering functions:
|
|
|
*
|
|
|
* * "instagram",
|
|
|
* * "twitter",
|
|
|
@@ -155,15 +157,15 @@ export default class MediaEmbed extends Plugin {
|
|
|
* **Note**: The default media provider configuration may not support all possible media URLs,
|
|
|
* only the most common are included.
|
|
|
*
|
|
|
- * **Note**: Media without are always represented in the data using the "semantic" markup. See
|
|
|
+ * Media without rendering functions are always represented in the data using the "semantic" markup. See
|
|
|
* {@link module:media-embed/mediaembed~MediaEmbedConfig#previewsInData `config.mediaEmbed.previewsInData`} to
|
|
|
* learn more about possible data outputs.
|
|
|
*
|
|
|
- * **Note:**: The priority of media providers corresponds to the order of configuration. The first provider
|
|
|
- * to match the URL is always used, even if there are other providers which support a particular URL.
|
|
|
- * The URL is never matched against remaining providers.
|
|
|
+ * The priority of media providers corresponds to the order of configuration. The first provider
|
|
|
+ * to match the URL is always used, even if there are other providers that support a particular URL.
|
|
|
+ * The URL is never matched against the remaining providers.
|
|
|
*
|
|
|
- * To discard **all** default media providers, simply override this config with your own
|
|
|
+ * To discard **all** default media providers, simply override this configuration with your own
|
|
|
* {@link module:media-embed/mediaembed~MediaEmbedProvider definitions}:
|
|
|
*
|
|
|
* ClassicEditor
|
|
|
@@ -183,7 +185,7 @@ export default class MediaEmbed extends Plugin {
|
|
|
* .then( ... )
|
|
|
* .catch( ... );
|
|
|
*
|
|
|
- * You can take inspirtation from the default configuration of this feature which you can find in:
|
|
|
+ * You can take inspiration from the default configuration of this feature which you can find in:
|
|
|
* https://github.com/ckeditor/ckeditor5-media-embed/blob/master/src/mediaembedediting.js
|
|
|
*
|
|
|
* To **extend** the list of default providers, use
|
|
|
@@ -222,7 +224,7 @@ export default class MediaEmbed extends Plugin {
|
|
|
*/
|
|
|
|
|
|
/**
|
|
|
- * The list of media providers which should not be used despite being available in
|
|
|
+ * The list of media providers that should not be used despite being available in
|
|
|
* {@link module:media-embed/mediaembed~MediaEmbedConfig#providers `config.mediaEmbed.providers`} and
|
|
|
* {@link module:media-embed/mediaembed~MediaEmbedConfig#extraProviders `config.mediaEmbed.extraProviders`}
|
|
|
*
|
|
|
@@ -252,7 +254,7 @@ export default class MediaEmbed extends Plugin {
|
|
|
* </div>
|
|
|
* </figure>
|
|
|
*
|
|
|
- * **Note:** Preview–less media are always represented in the data using the "semantic" markup
|
|
|
+ * **Note:** Media without preview are always represented in the data using the "semantic" markup
|
|
|
* regardless of the value of the `previewsInData`. Learn more about different kinds of media
|
|
|
* in the {@link module:media-embed/mediaembed~MediaEmbedConfig#providers `config.mediaEmbed.providers`}
|
|
|
* configuration description.
|