Thread:Project:Support desk/Trying to create a custom button to old edit toolbar with onClick function

How can I create a new button in the old toolbar with a custom onClick js function?

I'm trying to create it with the addbutton function but it does not work at all, and I do not know how should I pass my custom function to the addbutton.

p.e:

if ( mw.toolbar ) { function test{

alert("Hi"); }

mw.toolbar.addButton({speedTip:"Hi", onClick: function{prueba} }); }

The button appears, but when clicking on it, it does not do anything...

any ideas?

Ty!!