mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-07-24 07:39:42 +02:00
chore(editor): update editor, add embed tool (#142)
* update editor * add embed tool * prod bundle
This commit is contained in:
parent
3552105e38
commit
059cfb96f9
10 changed files with 62 additions and 56 deletions
|
@ -13,6 +13,7 @@ import Warning from '@editorjs/warning';
|
|||
import Checklist from '@editorjs/checklist';
|
||||
import LinkTool from '@editorjs/link';
|
||||
import RawTool from '@editorjs/raw';
|
||||
import Embed from '@editorjs/embed';
|
||||
|
||||
/**
|
||||
* Inline Tools for the Editor
|
||||
|
@ -110,6 +111,8 @@ export default class Editor {
|
|||
},
|
||||
|
||||
raw: RawTool,
|
||||
|
||||
embed: Embed,
|
||||
},
|
||||
data: {
|
||||
blocks: [
|
||||
|
|
|
@ -484,3 +484,17 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
.block-embed {
|
||||
margin: 0;
|
||||
|
||||
&__iframe {
|
||||
width: 100%;
|
||||
height: 450px;
|
||||
border: 0;
|
||||
|
||||
@media (--mobile) {
|
||||
height: 200px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
12
src/views/pages/blocks/embed.twig
Normal file
12
src/views/pages/blocks/embed.twig
Normal file
|
@ -0,0 +1,12 @@
|
|||
<figure class="block-embed">
|
||||
<iframe
|
||||
class="block-embed__iframe"
|
||||
src="{{ embed }}"
|
||||
frameborder="0"
|
||||
></iframe>
|
||||
{% if caption %}
|
||||
<footer class="block-iframe__caption">
|
||||
{{ caption }}
|
||||
</footer>
|
||||
{% endif %}
|
||||
</figure>
|
|
@ -35,7 +35,7 @@
|
|||
{% for block in page.body.blocks %}
|
||||
{# Skip first header, because it is already showed as a Title #}
|
||||
{% if not (loop.first and block.type == 'header') %}
|
||||
{% if block.type in ['paragraph', 'header', 'image', 'code', 'list', 'delimiter', 'table', 'warning', 'checklist', 'linkTool', 'raw'] %}
|
||||
{% if block.type in ['paragraph', 'header', 'image', 'code', 'list', 'delimiter', 'table', 'warning', 'checklist', 'linkTool', 'raw', 'embed'] %}
|
||||
{% include './blocks/' ~ block.type ~ '.twig' with block.data %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue