alohaeditor / Aloha-Editor

Aloha Editor is a JavaScript content editing library
http://www.alohaeditor.org
Other
2.46k stars 535 forks source link

Insert Custom HTML Plugin #858

Open nozpheratu opened 11 years ago

nozpheratu commented 11 years ago

It would be great to have a plugin that allows you to add custom HTML source code, perhaps using the "InsertHTML" command. See https://getsatisfaction.com/aloha_editor/topics/insert_element_button

evo42 commented 11 years ago

That would be great -- you're invited to write it ;-) http://aloha-editor.org/blog/2012/12/a-short-guide-on-writing-plug-ins-for-aloha-editor/

If you need any help let us know!

nozpheratu commented 11 years ago

I did actually begin to write this, but my work was halted due to some licensing conflicts I've been having with my app and Aloha. I'm still interested and contributing however so I'll see if I can find some time over the weekend. I like how the Mercury Editor in particular handles this. They have an HTML editor module that once clicked renders out the editable content as raw HTML inside a textarea. Does Aloha have any methods for returning the HTML that can be used?

evo42 commented 11 years ago

What licensing conflicts do you have? Maybe we can help out -- you can send a message to rene.kapusta//ät//aloha-editor.org

Yes, you can use .getContents() to get the HTML of an editable (the textarea you would need to add yourself) Example: https://gist.github.com/1448270#file-aloha-save-js-L6

Activate the dom-to-xhtml plugin to retrieve XHTML content: http://aloha-editor.org/guides/plugin_dom_to_xhtml.html

Looking forward to your plugin :-)

aweddy commented 11 years ago

We have one that we're looking to submit in about a week, it's a simple modal popup that checks against your contentHandler section of your config for the whitelist before inserting... simple, but works!