@hammaadhrasheedh/editorjs-iframe

1.0.21 • Public • Published

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

  1. Upload folder dist from repository
  2. 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

  1. Left align

  2. Center align

  3. 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",
    }
}

Package Sidebar

Install

npm i @hammaadhrasheedh/editorjs-iframe

Weekly Downloads

234

Version

1.0.21

License

MIT

Unpacked Size

17.9 kB

Total Files

4

Last publish

Collaborators

  • hammaadhrasheedh