bootstrap-markdown-editor
bootstrap-markdown-editor copied to clipboard
Adds ability to create custom toolbar items [WIP]
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:
htmlcontains the HTML markup which is added between the default buttons and the preview buttons (on the right).onCreatedis a callback which is called after the editor adds the element to the DOM. It has the parametercontainerwhich holds the jQuery container of the editor.callbacksis a hash list with property names being the name of the callback and their value being a callback (parameters:element, editor, container, selectedText). If thebtn-dataproperty is provided, its value must correspond to a callback with the same name within thecallbackslist.
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)