steveathon / bootstrap-wysiwyg

Tiny bootstrap-compatible WYSIWYG rich text editor
MIT License
661 stars 1.71k forks source link

Expose API to allow bulding on top of the plugin #147

Open yonjah opened 5 years ago

yonjah commented 5 years ago

It would be great of some of the api was exposed so we could programmatically call methods and run commands. I mostly think of a command runner similar to what toolbar click handler is doing only with a generic command and value

runCommand(command, value) {
            self.restoreSelection(  );
            editor.focus();
            self.execCommand( command, value, editor, options, toolbarBtnSelector );
            self.saveSelection( );
}

This will allow more flexibility and custom ui when calling commands (like poping up a dialog to enter url)