Difference between revisions of "MediaWiki:Monobook.js"
Jump to navigation
Jump to search
m (Added new Monobook specific javascript function.) |
(added WinFirefoxUploadDialogueFixer) |
||
Line 41: | Line 41: | ||
addOnloadHook(columnAreaImage); | addOnloadHook(columnAreaImage); | ||
/*Currently only text colour of the upload dialogue is able to be styled for the Windows version of Firefox, all versions (currently 3.0.9)*/ | |||
function WinFirefoxUploadDialogueFixer(){ | |||
if(navigator.userAgent.match("Firefox") && navigator.userAgent.match("Windows")) | |||
{ | |||
var uploadFile; | |||
if (document.getElementById ) { | |||
uploadFile= document.getElementById("wpUploadFile"); | |||
} else if (document.all ) { | |||
uploadFile= document.all["wpUploadFile"]; | |||
} else { | |||
return; | |||
} | |||
if ( uploadFile&& uploadFile.style ){ | |||
uploadFile.style.color = 'black'; | |||
} | |||
} | |||
} | |||
addOnloadHook(WinFirefoxUploadDialogueFixer); |
Revision as of 09:08, 27 April 2009
/* Any JavaScript here will be loaded for users using the MonoBook skin */ function columnAreaImage(){ if(document.title.split(" ")[0] == "Preferences") { return; } var divS; var divC; if (document.getElementById ) { divS = document.getElementById("column-content"); divC = document.getElementById("content"); } else if (document.all ) { divS = document.all["column-content"]; divC = document.all["content"]; } else { return; } if ( divS && divS.style ){ var divSHval; if (divS.style.pixelHeight) { divSHval= divS.style.pixelHeight; } else { divSHval= divS.offsetHeight; } if(Number(divSHval) >1176){ //1136=768(number bigger than background image and side buttons)+imgheight(370) divS.style.backgroundImage = "url(/images/c/cb/Infosphere_Sidebar.png)"; divS.style.backgroundPosition = "bottom left"; divS.style.backgroundRepeat = "no-repeat"; if(divC && divC.style ) { //Uhm... apparently this is working now! Woo! divC.style.backgroundImage = "url(/images/4/43/Infosphere_Content.png)"; divC.style.backgroundPosition = "bottom left"; divC.style.backgroundRepeat = "no-repeat"; } } } } addOnloadHook(columnAreaImage); /*Currently only text colour of the upload dialogue is able to be styled for the Windows version of Firefox, all versions (currently 3.0.9)*/ function WinFirefoxUploadDialogueFixer(){ if(navigator.userAgent.match("Firefox") && navigator.userAgent.match("Windows")) { var uploadFile; if (document.getElementById ) { uploadFile= document.getElementById("wpUploadFile"); } else if (document.all ) { uploadFile= document.all["wpUploadFile"]; } else { return; } if ( uploadFile&& uploadFile.style ){ uploadFile.style.color = 'black'; } } } addOnloadHook(WinFirefoxUploadDialogueFixer);