[wikka-community] adding a button to the wikka editor

Michaël Perez perez.mick
Fri Sep 18 07:34:25 GMT 2009


Cool! Thanks for sharing


On Fri, Sep 18, 2009 at 06:49, Mike C <mailmichael at yahoo.com> wrote:

> Hi,
>
> I just joined this mailing list to ask how to create my own button
> in WikkaEdit.  Fortunately for you :), I was able to figure it out
> myself.  Thus, I thought I would share. (BTW, couldn't figure out
> how to search the mailman archives... if anyone knows, let me know!
> TIA)
>
> To add a custom button, follow the procedures below.  The example
> below shows how to insert a date stamp.
>
> Edit 3rdparty/plugins/wikkaedit/wikkaedit_data.js to add in the
> button.  Inside this function:
>
>   WikkaEdit.prototype.initButtons = function() {
>
> add the following line where appropriate:
>
>   this.we_buttons.we_date = {type:"button", title:"Date"};
>
> Then in 3rdparty/plugins/wikkaedit/wikkaedit.js, tell it what to
> do when the button gets clicked:
>
>   case "date" : this.addToSelection(Date()); break;
>
> Lastly, create/add a gif for date in the
> 3rdparty/plugins/wikkaedit/images folder named after the
> button/command:
>
>   images/date.gif
>
> I just copied over one of the other gifs.  Perhaps I'll make a
> custom one.  Another thing I may do eventually is read up on
> Javascript to reduce the date to something better suited for a
> Wikka page.
>
> Hope this is useful to someone.
>
> Best Regards,
> Mike
>
> _______________________________________________
> WikkaWiki Community mailing list
> community at wikkawiki.org
> http://mail.wikkawiki.org/mailman/listinfo/community_wikkawiki.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.wikkawiki.org/pipermail/community_wikkawiki.org/attachments/20090918/13d57bbc/attachment.html>



More information about the community mailing list