[Mediawiki-l] custom tool button breaks all other tool buttons

Adam Meyer meyer7 at mindspring.com
Wed Feb 20 13:36:00 UTC 2008


I added this code (below) to my mediawiki:common.js. It works, but it  
causes all of the other tool buttons to stop working. I was wondering  
if anyone knew why. It is just a changed version of http://es.wikipedia.org/wiki/Usuario:Platonides/TablaFacil.js 
  . But then again, their code does the same thing.

If I hit one of the other buttons, it just un-focuses the edit area  
and does not insert anything.

Thank you in advance,
-Adam

Code = "<a href=\"javascript:window.open('Adams/ajax/', '',  
'height=400,width=425');\"><img src=\"skins/common/button_addimage.png 
\" alt=\"info\" title=\"hint\" /></a>";

function PopupTool() {
	if (document.getElementById('toolbar')){
		document.getElementById('toolbar').innerHTML+= Code;
	}
}

if ( typeof ( buttons ) != "undefined" ){
	buttons += Code;
}else{

	if (window.addEventListener){
		window.addEventListener("load", PopupTool ,false);
	
	}else if (window.attachEvent){
		window.attachEvent("onload", PopupTool );
	}	
}



More information about the MediaWiki-l mailing list