I added this code to MediaWiki:Common.js
var button = { "imageFile": " https://compbio.iupui.edu/support/wiki/images/e/e3/Button_GNU.png", //image to be shown on the button (may be a full URL too), 22x22 pixels "speedTip": "Use this to mark free software that's ALSO open source", //text shown in a tooltip when hovering the mouse over the button "tagOpen": "{{", //the text to use to mark the beginning of the block "tagClose": "GNU}}", //the text to use to mark the end of the block (if any) "sampleText": "" //the sample text to place inside the block }; mwCustomEditButtons.push(button);
The goal is to put a *{{GNU}}* tag into the wiki whenever a button is pressed. If I put the {{GNU}} within "tagOpen" the template is interpreted before insertion into the page which is NOT what I want. The button should insert the template name "{{GNU}}" and not the text the template references. So I split the template in half but the cursor is in the middle of the template. e.g.:
{{|GNU}}
What I would like to do is put the cursor at the end of the template. For example:
{{GNU}} |
That way someone can insert the template and keep typing without messing up the template. Any ideas on how to do this?
Thanks,
Jonathan Nowacki