bootstrap-markdown-editor icon indicating copy to clipboard operation
bootstrap-markdown-editor copied to clipboard

Adds ability to create custom toolbar items [WIP]

Open frostieDE opened this issue 8 years ago • 0 comments

This PR adds the (basic) ability to add custom toolbar items.

This feature adds one option to the options variable: toolbar. It has the following properties:

  • html contains the HTML markup which is added between the default buttons and the preview buttons (on the right).
  • onCreated is a callback which is called after the editor adds the element to the DOM. It has the parameter container which holds the jQuery container of the editor.
  • callbacks is a hash list with property names being the name of the callback and their value being a callback (parameters: element, editor, container, selectedText). If the btn-data property is provided, its value must correspond to a callback with the same name within the callbacks list.

Take a look at the index.html file which holds an example.

Note: I chose not to provide any API to add buttons, comboboxes, checkboxes etc. to make this extension a little more "light". Also it gives the developer to add any kind of control to the editor :-)

Note: I did not update the javascript within the dist folder yet.

What do you think?

(This PR closes #5)

frostieDE avatar May 16 '17 12:05 frostieDE