1.0.21 • Published 3 years ago

@hammaadhrasheedh/editorjs-iframe v1.0.21

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

npm.io

Editor js iframe plugin

Provides iframe support for the Editor.js.

Works only with pasted iframe tags and requires no server-side setup.

npm.io

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

npm.io

  1. Left align

  2. Center align

  3. Right align

Output data

FieldTypeDescription
framestringiframe
alignmentstringalignment 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",
    }
}
1.0.2

3 years ago

1.0.21

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago