OscarGodson / EpicEditor

EpicEditor is an embeddable JavaScript Markdown editor with split fullscreen editing, live previewing, automatic draft saving, offline support, and more. For developers, it offers a robust API, can be easily themed, and allows you to swap out the bundled Markdown parser with anything you throw at it.
http://epiceditor.com
MIT License
4.25k stars 337 forks source link

Optional buttons for common styling #41

Open OscarGodson opened 12 years ago

OscarGodson commented 12 years ago

Sort of like a WYSIWYG, have buttons for bold, italics, links, etc. see GitHubs wiki editor for an example. This should be off by default tho.

librarian commented 12 years ago

I need this feature. Maybe you could suggest how to implement this feature by myself?

OscarGodson commented 12 years ago

@librarian This will be tough and why it's a v2 thing. The tough part is moving the cursor around. It's a contenteditable so it'll be like implementing any other WYSIWYG buttons. I suggest googling it because there's a lot you'd have to do. You could have a look at how markItUp does it: http://markitup.jaysalvat.com/examples/

If you do it, let me know. I'd be interested in your implementation.

librarian commented 12 years ago

Thanks, I will try at my free time

mahemoff commented 12 years ago

This would be great to see. It looks like Rangy is the way to go (http://code.google.com/p/rangy/wiki/SelectionSaveRestoreModule). Relevant: http://stackoverflow.com/questions/1181700/set-cursor-position-on-contenteditable-div

OscarGodson commented 12 years ago

@mahemoff @hongymagic was really close then left on vacation. He actually had the selection AND a prototype with buttons. The problem was the scope of the pull request was too big. If he makes a new pull request with just the text selection stuff I'll pull it in. If I don't hear from him by 0.3.0 i'll start looking into getting some text selection API's in myself.

Original Pull: https://github.com/OscarGodson/EpicEditor/pull/166 Demo of buttons: http://epiceditor-demos.herokuapp.com/

corydeppen commented 10 years ago

Would you be able to provide an update on the status of this request?

OscarGodson commented 10 years ago

@corydeppen Unfortunately, I havent had time to keep up with this project lately. This was supposed to be for 2.0 but there's still a lot to do for 1.0 :( https://github.com/OscarGodson/EpicEditor/issues?milestone=3&state=open