@hammaadhrasheedh/editorjs-iframe
v1.0.21
Published
Iframe Tool for Editor.js
Downloads
595
Maintainers
Readme
Editor js iframe plugin
Provides iframe support for the Editor.js.
Works only with pasted iframe tags and requires no server-side setup.
Installation
Install via NPM
Get the package
npm i --save-dev @hammaadhrasheedh/editorjs-iframe
Include module at your application
const Iframe = require('@hammaadhrasheedh/editorjs-iframe');
Download to your project's source dir
- Upload folder
dist
from repository - Add
dist/bundle.js
file to your page.
Then require this script on page with Editor.js.
<script src="..."></script>
Usage
Add a new Tool to the tools
property of the Editor.js initial config.
var editor = EditorJS({
...
tools: {
...
iframe: Iframe,
}
...
});
Config Params
This Tool has no config params
Tool's settings
Left align
Center align
Right align
Output data
| Field | Type | Description |
| -------------- | --------- | ------------------------------- |
| frame | string
| iframe |
| alignment | string
| alignment of iframe |
{
"type" : "image",
"data" : {
"frame" : "<iframe width=\"560\" height=\"315\" src=\"https://www.youtube.com/embed/n9Hn2J9_n7k\" title=\"YouTube video player\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen=\"\"></iframe>",
"alignment" : "Centered",
}
}