Giter VIP home page Giter VIP logo

medium-editor-multi-placeholders-plugin's Introduction

MediumEditorMultiPlaceholders Plugin

A plugin that allows you to setup multiple placeholders with MediumEditor

NPM

Travis Build Status Dependency Status devDependency Status

Demo

Demo

Try at Demo page

Basic usage

Installation

Via npm:

Run in your console:

npm install medium-editor-multi-placeholders-plugin

Then build the project by running

grunt

Via bower:

bower install medium-editor-multi-placeholders-plugin

Usage

First thing: don't forget to load the plugin after MediumEditor

<script src="dist/medium-editor-multi-placeholders-plugin.min.js"></script>

Now when you create MediumEditor instance, just disable normal placeholder and specify the extension and placeholder options:

var editor = new MediumEditor('#editor', {
      placeholder: false,
      extensions: {
        'multi_placeholder': new MediumEditorMultiPlaceholders({
          placeholders: [
              {
                tag: 'h1',
                text: 'Title'
              },
              {
                tag: 'p',
                text: 'Tell your story...'
              }
          ]
        })
      }
    });

Plugin Options

The plugin itself only takes one option: placeholders which is an array of placeholder objects. Each placeholder object is in the format { tag: 'HTMLTag', text: 'Placeholder Text' }.

var multiPlaceholders = new MediumEditorMultiPlaceholders({
    placeholders: [
	    /* Your place holders goes here
	       You can have as many placeholders as you want!
	       Example: { tag: 'h1', text: 'Title' } */
    ]
});

Known Issues

Conflicts with MediumEditor Insert Plugin, because placeholder: false doesn't work with the some version of the it.

License

MIT: https://github.com/smiled0g/medium-editor-multi-placeholders-plugin/blob/master/LICENSE

medium-editor-multi-placeholders-plugin's People

Contributors

smiled0g avatar

Watchers

bartus 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.