I am wanting to add a particular button.
I sort of accomplished this on NBBC but I never got to truly do what I was hoping for (that being part 2).
Maybe you can point me in the right direction, unless it's something you could think up in 5 seconds and decide to post the code.
If I wanted a button that would, for example:
[card]Rewind[/card]
And on the HTML side it does:
<a href="http://magiccards.info/query?q=Rewind">Rewind</a>
What current button does something similar that I can sort of borrow the concept from? I thought that URL would be similar enough, but while playing around I couldn't quite figure out how to get it working.
I mean similar to the URL in the sense it takes what is between the BBCode and uses it as a url, but I'm not quite sure how to add it to a preexisting string. Like, the preexisting string would be http://magiccards.info/query?q=.
The second thing I'm trying to get done is a way to group a list of cards, so it'd have to do the same as above but for each new line within the tags. Something like:
[cards]Rewind Animate Dead Duress[/cards]
I don't think there is a current BBCode or Markdown case switch that actually does something to each individual line, is there?
Best Answer
-
Tim Vanilla Staff
Button Bar is not currently very easy to extend without modifying the core files. However, if you feel up to it you can do just that.
Modify views/buttonbar.php
echo '<span class="ButtonWrap"><span>card</span></span>';
Modify js/buttonbar.js
Add a handler for the 'card' event.
At line 361:bbcodeOpts = { opener: '[', closer: ']' } switch (Operation) { case 'bold': $(TextArea).insertRoundTag('b',bbcodeOpts); break; case 'card': $(TextArea).insertRoundTag('card',bbcodeOpts); break; ...
Button Bar relies on Garden's formatters to handle rendering within comments, so you would need to mess with the NBBC plugin to make it handle the rendering side, and that's something beyond the scope of this help.
0
Answers
I keep getting notified that I have an answer and should accept it if correct. I come here and only see my post. Heh.
Button Bar is not currently very easy to extend without modifying the core files. However, if you feel up to it you can do just that.
Modify views/buttonbar.php
echo '<span class="ButtonWrap"><span>card</span></span>';
Modify js/buttonbar.js
Add a handler for the 'card' event.
At line 361:
Button Bar relies on Garden's formatters to handle rendering within comments, so you would need to mess with the NBBC plugin to make it handle the rendering side, and that's something beyond the scope of this help.
Vanilla Forums COO [GitHub, Twitter, About.me]
Hey sorry that question was old and silly. I couldn't modify it. Yeah it's terribly easy to add buttons to this plugin. Thanks for responding though, so I can finally mark this answered and end the jquery notifications.