ElkArte Community

Project Support => General ElkArte discussions => Topic started by: Adrek on July 18, 2014, 02:11:19 pm

Title: How to add BBCode button?
Post by: Adrek on July 18, 2014, 02:11:19 pm
I hate javascript...

I read files and it led me to jquery.sceditor.elkarte.js. Then I added there my code just after end of pre tag, but my button is still not visible.

Just can't figure out how to add this button :|
Title: Re: How to add BBCode button?
Post by: Spuds on July 19, 2014, 09:08:32 am
To add new BBC's there are a few steps.

1) add code to parse_bbc so the page parser knows what to do with it
2) add item icon to the toolbar
3) add item code to the JS so it can be

The only thing needed is item 1) ... 2 and 3 are optional but complete a fully integrated button.    I'll try to come up with a quick example to show how this done (unless @emanuele  has one already)
Title: Re: How to add BBCode button?
Post by: Adrek on July 19, 2014, 02:03:43 pm
I added bbcode with hook (integrate_bbc_codes), but only button is making me problems :/
Title: Re: How to add BBCode button?
Post by: emanuele on July 20, 2014, 10:09:39 am
Nope, no examples handy...
Title: Re: How to add BBCode button?
Post by: Spuds on July 22, 2014, 04:29:00 pm
Here is a quick example, hope it helps: http://www.elkarte.net/community/index.php?topic=1750
Title: Re: How to add BBCode button?
Post by: Adrek on July 22, 2014, 04:31:30 pm
Thanks :) Now I know where was my mistake ::)
Title: Re: How to add BBCode button?
Post by: Swamp Monkey on August 22, 2014, 12:15:34 pm
Thank you for this.  I want to add a couple of custom buttons and I think this will help.