Forgive my ignorance on board programming language, but how come the function itself works, then? Is it not a matter of assigning a shortcut to it?
Because the mod Strat got to work doesn't offer a button in the first place.
Sadly most of them don't. Like I'm no SMF expert but it's pretty easy to grasp Post is where the stream of information is converted from bbcode to actual HTML and devise your own code using string.Replace. I mean you basically do something like this.
string.replace( /[spoiler]/gi, "<button type="button" onclick="{ if ( document.getElementById('Spoiler1').style.display == 'block' ) { document.getElementById('Spoiler1').style.display = 'none'; } else { document.getElementById('Spoiler1').style.display = 'block'; } }">Spoiler: Show/Hide</button><div id="Spoiler1" style="display: none;">" );
string.replace( /[\/spoiler]/gi, "</div>" );
In php & jquery. So it's really simple to write any text substitute you want to create new tags. But adding a button is done through GenericControls which calls context and runs through an array and like I'd have to read into it to figure out where the heck you set up the onclicks for them because I have no idea. And apparently no many people bother with figuring that out either. The easy way is to just look at a mod that already does it, but meh.