Thread:VisualEditor/Feedback/Adding Buttons that Replaces Text

Hi. Is it super-difficult to add a button to this visual editor, that would replace some text like:

 replace this 

into

Hello World.

Can i make a button that calls a custom java-script function?