1.2.1 • Published 5 years ago

codex.editor.simple-image v1.2.1

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

npm.io

Simple Image Tool

Provides Image Blocks for the CodeX Editor.

Works only with pasted image URLs and requires no server-side uploader.

npm.io

Installation

Install via NPM

Get the package

npm i --save-dev codex.editor.simple-image

Include module at your application

const SimpleImage = require('codex.editor.simple-image');

Download to your project's source dir

  1. Upload folder dist from repository
  2. Add dist/bundle.js file to your page.

Load from CDN

You can load specific version of package from jsDelivr CDN.

https://cdn.jsdelivr.net/npm/codex.editor.simple-image@1.0.1

Then require this script on page with CodeX Editor.

<script src="..."></script>

Usage

Add a new Tool to the tools property of the CodeX Editor initial config.

var editor = CodexEditor({
  ...
  
  tools: {
    ...
    image: SimpleImage,
  }
  
  ...
});

Config Params

This Tool has no config params

Tool's settings

npm.io

  1. Add border

  2. Stretch to full-width

  3. Add background

Output data

FieldTypeDescription
urlstringimage's url
captionstringimage's caption
withBorderbooleanadd border to image
withBackgroundbooleanneed to add background
stretchedbooleanstretch image to screen's width
{
    "type" : "image",
    "data" : {
        "url" : "https://www.tesla.com/tesla_theme/assets/img/_vehicle_redesign/roadster_and_semi/roadster/hero.jpg",
        "caption" : "Roadster // tesla.com",
        "withBorder" : false,
        "withBackground" : false,
        "stretched" : true
    }
}
1.2.1

5 years ago

1.2.0

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago