Uživatel:Gorn/monobook.js: Porovnání verzí
Skočit na navigaci
Skočit na vyhledávání
m |
m |
||
Řádek 12: | Řádek 12: | ||
var isMainPage = (document.title.substr(0, mpTitle.length) == mpTitle) | var isMainPage = (document.title.substr(0, mpTitle.length) == mpTitle) | ||
if (isMainPage) { | |||
if (isMainPage) { | |||
var bodycontent = document.getElementById('bodyContent'); | var bodycontent = document.getElementById('bodyContent'); | ||
var fakehead = document.getElementById('fakehead'); | var fakehead = document.getElementById('fakehead'); | ||
var fh = bodycontent.parentNode.getElementsByTagName("h1"); | var fh = bodycontent.parentNode.getElementsByTagName("h1"); | ||
bodycontent.parentNode.insertBefore(fakehead,bodycontent); | bodycontent.parentNode.insertBefore(fakehead,bodycontent); | ||
fh[0].parentNode.removeChild(fh[0]); | fh[0].parentNode.removeChild(fh[0]); | ||
} | |||
topTabsToRightPlace(); | topTabsToRightPlace(); | ||
} | } |
Verze z 5. 4. 2006, 02:31
function topTabsToRightPlace() { /* Remove the top "tabs" from the .portlet side column (why were they ever put there?) and put them at the top of the content area, where they belong! (This allows me to use simple relative positioning to get a proper layout. I don't have to mess around with absolute positioning. */ var bodycontent = document.getElementById('bodyContent'); var tabs = document.getElementById('p-cactions'); bodycontent.parentNode.insertBefore(tabs,bodycontent); } function reformatMyPage() { var mpTitle = "Test"; var isMainPage = (document.title.substr(0, mpTitle.length) == mpTitle) if (isMainPage) { var bodycontent = document.getElementById('bodyContent'); var fakehead = document.getElementById('fakehead'); var fh = bodycontent.parentNode.getElementsByTagName("h1"); bodycontent.parentNode.insertBefore(fakehead,bodycontent); fh[0].parentNode.removeChild(fh[0]); } topTabsToRightPlace(); } if (window.addEventListener) window.addEventListener("load",reformatMyPage,false); else if (window.attachEvent) window.attachEvent("onload",reformatMyPage);