Skip to content

Instantly share code, notes, and snippets.

@poying
Created February 6, 2014 15:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poying/8846545 to your computer and use it in GitHub Desktop.
Save poying/8846545 to your computer and use it in GitHub Desktop.
Edittor.registerPragraphType('h1', new Editor.ParagraphType());
// ...
Edittor.registerButton('link', new Editor.Button());
// ...
var options = {
selector: '#editor',
paragraphTypes: ['h1'],
buttons: ['link']
};
window.onload = function () {
var editor = new Edittor(options);
var data = editor.getData();
// data => { paragraphs: [{ type: 'h1', content: 'hello world' }...], notes: [{ paragraphName: 'asdfww' }...] }
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment