Derrick Farnell wrote :
Thanks for your help Alexis. I did use the double
quotes. I've now replaced
the lines of normal text with the lines of wikitext:
http://www.chainsofreason.org/wiki/MediaWiki:Common.js
(at the bottom of the page)
and the toolbar button disappears again. Also, the show/hide functionality -
created by the first section of the code on the above page - no longer works
too. *However*, when I delete Template:Hide, which is used to implement the
show/hide functionality, the button appears, and when pressed inserts the
wikitext. So the problem is obviously due to the fact that the wikitext that
I want users to be able to insert using the button contains the wikitext for
the hide template. Removing the template removes the problem (of course, in
your case, the template never existed in the first place). But now I don't
have the show/hide functionality!
Any ideas how I can have both?! I don't know any javascript, and very little
wikitext.
indeed if I create the hide template, I still have the button (NB : I don't have any
<nowiki> tag in my code) but the template content is directly inserted instead of
" {{hide|\n "
however, if I use the opening and closing tags, it does the trick. In my
MediaWiki:Common.js, I only have this :
if (mwCustomEditButtons) {
mwCustomEditButtons[mwCustomEditButtons.length] = {
"imageFile": "test.png",
"speedTip": "see also",
"tagOpen": ":*see also: {{",
"tagClose": "}}",
"sampleText":
"hide|\n" +
"::*link 1\n" +
"::*link 2"
};
}
and it worked (don't forget to force-refresh your browser)