steveathon / bootstrap-wysiwyg

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

Remove jQuery Hotkeys dependency #83

Open codewithtyler opened 8 years ago

codewithtyler commented 8 years ago

@steveathon currently we already require users to have jQuery as part of their site. What are your thoughts on removing the jQuery Hotkeys dependency and having our own implementation? This only takes up one method at the moment so we should be able to do it without affecting the rest of the code.

steveathon commented 8 years ago

I'm happy to look at options where we can reduce dependency sizes and drop the overall project size down. What did you have in mind?

codewithtyler commented 8 years ago

As far as I know the only dependencies we have are jQuery Hotkeys and jQuery. I've looked over the jQuery Hotkeys source and I don't think it would be hard for us to create our own implementation in pure JavaScript. Also we're using very little of the jQuery library. We're mostly just using the selector and a few functions like addClass all of which can be done in pure JavaScript.

Removing both dependencies would not only make it easier on our users to use our library but we'd also greatly reduce our file size. Depending on how much you wanted to do on issue #3 this might be all we need to do to solve that as well.

I also want to mention that there is the option of leaving out any type of hotkey implementation completely. Then later on when we get the plugin system implemented we could create a new repo for hotkeys and have an official hotkey plugin. This way the user could decide if they want to use hotkeys or not.

spreadred commented 7 years ago

I agree that this would be helpful. As of now, users may have difficulty locating the proper jquery.hotkeys script.

I was able to use: https://github.com/jeresig/jquery.hotkeys/blob/master/jquery.hotkeys.js - Can I get verification that this is in fact the correct version of jquery.hotkeys we should be using?

But other versions of a script named the same exist as well; the few of these I tried did not work properly with bootstrap-wysiwyg.

ppbntl19 commented 7 years ago

https://gist.github.com/ppbntl19/455f68af728382e001070d9cced0c70e Support for a simple toolbar without using Font-awesome and jQuery Hotkeys .

spreadred commented 7 years ago

@ppbntl19 I haven't had a chance to try/delve into your code. I see you didn't remove references to the actual hotkeys under default options. Does that mean hotkeys still work without the jQuery Hotkeys dependency? Or you just disabled the requirement and left that legacy code in there?

What I mean is, are you just showing a way to implement a simple toolbar without font-awesome and jquery hotkeys, but lacks those features?