View Single Post
Old 08-13-2012, 09:47 AM   PM User | #1
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
wysihtml5 editor - need to add buttons to insert some symbols to the typing area

Hello,

I'm trying to use https://github.com/xing/wysihtml5, after customising the toolbar.

I just need to add some buttons that should insert some unicode symbols to the typing area, when clicked. I believe this won't require any changes in the parser script.

I've made the GUI, but I don't know how to define the 'commands'

I've uploaded a demo at http://itsnot.freehostia.com/wysihtm...ihtml5-new.htm

I've added the additional buttons to the markup, like
Code:
<li data-wysihtml5-command="insertInches" title="Insert inches symbol" class="command"></li>

<li data-wysihtml5-command-group="foreFrac" class="fore-frac command" title="Insert the fraction">

<ul>

<li data-wysihtml5-command="foreFrac" data-wysihtml5-command-value="½">½</li>

<li data-wysihtml5-command="foreFrac" data-wysihtml5-command-value="⅓">⅓</li>

<li data-wysihtml5-command="foreFrac" data-wysihtml5-command-value="⅔">⅔</li>

</ul>

</li>
Can anyone please give some hints to define the commands?

(I don't even need to stick with the syntax/structure of the wysihtml5-0.3.0.js script. Something that would insert the innerHTML value of the <li>s to the typing would even be useful)

Thanks.
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

Last edited by abduraooft; 08-14-2012 at 05:19 AM..
abduraooft is offline   Reply With Quote