Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds ability to create custom toolbar items [WIP] #38

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

frostieDE
Copy link

@frostieDE frostieDE commented May 16, 2017

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom buttons
1 participant