GithubHelp home page GithubHelp logo

febincloudyuga / simple-image-tutorial Goto Github PK

View Code? Open in Web Editor NEW

This project forked from editor-js/simple-image-tutorial

0.0 0.0 0.0 6 KB

Final result of guide series learning how to create own Block Tool

HTML 16.11% CSS 5.59% JavaScript 78.30%

simple-image-tutorial's Introduction

Simple Image tutorial project

Final result of guide series learning how to create own Block Tool for Editor.js

Simple Image — paste image URL and get the image Block rendered. Also supports pasting files and substitutions of <img> tags on pasting. Does not support uploading images from the device.

Chapters

Installation

Note. If you want to use such tool in production, see full-featured Simple Image Tool. The tutorial code and functionality are simplified for better understanding of basics API usage.

Configuration

This Tool supports following configuration properties:

name description
placeholder Custom placeholder for «Paste URL» field

Example of connection:

  /**
   * Initialize the Editor
   */
  const editor = new EditorJS({
    autofocus: true,
    tools: {
      image: {
        class: SimpleImage,
        inlineToolbar: true,
        config: {
          placeholder: 'Paste image URL'
        }
      }
    },
  });

Output data format

This Tool return following data format:

{
  url: 'https://cdn.pixabay.com/photo/2017/09/01/21/53/blue-2705642_1280.jpg'
  caption: 'Image caption example',
  withBorder: false,
  withBackground: false,
  stretched: false
}
field type description
url string image source URL
caption string image caption
withBorder boolean flag for adding a border
withBackground boolean flag for adding a background
stretched boolean flag for stretching image to the full width of content

simple-image-tutorial's People

Contributors

nespecc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.