Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #2 from ckeditor/t/1
Browse files Browse the repository at this point in the history
Feature: The basic media embed feature. Closes #1.
  • Loading branch information
Reinmar committed Aug 24, 2018
2 parents ca038da + e0dd71e commit 4c9b642
Show file tree
Hide file tree
Showing 31 changed files with 3,792 additions and 0 deletions.
Empty file.
13 changes: 13 additions & 0 deletions docs/_snippets/features/build-media-source.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

/* globals window */

import ClassicEditor from '@ckeditor/ckeditor5-build-classic/src/ckeditor';
import MediaEmbed from '@ckeditor/ckeditor5-media-embed/src/mediaembed';

ClassicEditor.builtinPlugins.push( MediaEmbed );

window.ClassicEditor = ClassicEditor;
36 changes: 36 additions & 0 deletions docs/_snippets/features/media-embed.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<div id="snippet-media-embed">
<h3>YouTube</h3>

<figure class="media">
<oembed url="https://www.youtube.com/watch?v=DgM5DfAPQTI"></oembed>
</figure>

<h3>Vimeo</h3>

<figure class="media">
<oembed url="https://vimeo.com/1084537"></oembed>
</figure>

<h3>Twitter</h3>

<figure>
<oembed url="https://twitter.com/ckeditor/status/1027571541989572612"></oembed>
</figure>

<h3>Google Maps</h3>

<figure class="media">
<oembed url="https://www.google.com/maps/place/Poland/@51.9537505,19.1343786,6z/data=!3m1!4b1!4m5!3m4!1s0x47009964a4640bbb:0x97573ca49cc55ea!8m2!3d51.919438!4d19.145136?hl=en"></oembed>
</figure>
</div>

<style>
.ck.ck-content .media iframe {
/* Override default Umberto guide styles. */
margin: 0;
}

input.example-input {
min-width: 600px;
}
</style>
28 changes: 28 additions & 0 deletions docs/_snippets/features/media-embed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* @license Copyright (c) 2003-2018, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md.
*/

/* globals ClassicEditor, console, window, document */

import { CS_CONFIG } from '@ckeditor/ckeditor5-cloud-services/tests/_utils/cloud-services-config';

ClassicEditor
.create( document.querySelector( '#snippet-media-embed' ), {
cloudServices: CS_CONFIG,
toolbar: {
items: [
'mediaEmbed', '|', 'heading', '|', 'bold', 'italic', '|', 'undo', 'redo'
],
viewportTopOffset: 60
},
mediaEmbed: {
semanticDataOutput: true
}
} )
.then( editor => {
window.editor = editor;
} )
.catch( err => {
console.error( err.stack );
} );
30 changes: 30 additions & 0 deletions docs/api/media-embed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
category: api-reference
---

# Media embed feature for CKEditor 5

[![npm version](https://badge.fury.io/js/%40ckeditor%2Fckeditor5-media-embed.svg)](https://www.npmjs.com/package/@ckeditor/ckeditor5-media-embed)

This package implements the media embed feature for CKEditor 5.

## Documentation

See the {@link features/media-embed Media embed feature} guide and the {@link module:media-embed/mediaembed~MediaEmbed} plugin documentation.

## Installation

```bash
npm install --save @ckeditor/ckeditor5-media-embed
```

## Contribute

The source code of this package is available on GitHub in https://github.com/ckeditor/ckeditor5-media-embed.

## External links

* [`@ckeditor/ckeditor5-media-embed` on npm](https://www.npmjs.com/package/@ckeditor/ckeditor5-media-embed)
* [`ckeditor/ckeditor5-media-embed` on GitHub](https://github.com/ckeditor/ckeditor5-media-embed)
* [Issue tracker](https://github.com/ckeditor/ckeditor5-media-embed/issues)
* [Changelog](https://github.com/ckeditor/ckeditor5-media-embed/blob/master/CHANGELOG.md)
Loading

0 comments on commit 4c9b642

Please sign in to comment.