Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

editore

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

editore

> It's a magnific javascript editor! It's easy to create and valitade fields and get data from them, even better is that you don't need to handle contenteditable yourself :8ball:

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

editore.js Build Status npm version

It's a magnific javascript editor! It's easy to create and valitade fields and get data from them, even better is that you don't need to handle contenteditable yourself :8ball:

basic usage

It's easy to use! Load editor.js into your application, create the editor wrapper element, set some fields and instantiate a new editor to use it.

Let's load editor.js:

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

Enable pseudo fields placeholder:

.placeholder::after { 
  content: attr(data-placeholder);
  position: absolute;
  top: 0;
}

Create editor wrapper element and some fields:

<form id="editor">
  <h1 data-field="title" data-placeholder="Title" data-require="true" data-length="60"></h1>
  <article data-field="article" data-placeholder="Article" data-type="rich" data-require="true"></article>
</form>

Instantiate a new editor passing its wrapper element:

var editor = new Editor(document.getElementById('editor'));

Subscribe for editor input events:

editor.subscribe('input', function(field) {
  console.log('Current editing field:', field);
});

To register insert plugin into its components collection:

editor.register('insert', SampleActionPlugin);

To tegister edition plugin into its components collection:

editor.register('edition', SampleEditionPlugin);

If you need to remove editor elements and listeners:

editor.destroy();

API
constructor
new Editor(element);
parameters
  • element: is the element from where the editor should get its child elements to transform in fields according with their data-attributes. Child elements that don't have the required data-attributes will not be converted into editor fields.
field
  <h1 data-field="title" data-placeholder="Title" data-require="true" data-length="60"></h1>
data-attributes
  • data-field:
  • data-placeholder:
  • data-required (optional):
  • data-type (optional):
  • data-length (optional):

support
  • chrome:
  • firefox:
  • safari:
  • internet explore:

contribute

Everyone can contribute! Finding bugs, creating issues, improving editor it self or creating components. Every contribution will be welcomed! :santa:

Fork it -> Branch it -> Test it -> Push it -> Pull Request it :gem:

Keywords

FAQs

Package last updated on 11 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc