Uživatel:Gorn/monobook.js: Porovnání verzí

z deskovehry.cz - od hráčů pro hráče
Skočit na navigaci Skočit na vyhledávání
m
m
Řádek 1: Řádek 1:
function topTabsToRightPlace() {
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. This is necessary for my language links at the top to work properly, but it is cleaner anyway. */
   /* 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 bodycontent = document.getElementById('bodyContent');
   var tabs = document.getElementById('p-cactions');
   var tabs = document.getElementById('p-cactions');
 
   bodycontent.parentNode.insertBefore(tabs,bodycontent);  
   bodycontent.parentNode.insertBefore(tabs,bodycontent);  
}
}
Řádek 9: Řádek 10:
function reformatMyPage() {
function reformatMyPage() {
   topTabsToRightPlace();   
   topTabsToRightPlace();   
}
  var mpTitle = "Test";
  var isMainPage = (document.title.substr(0, mpTitle.length) == mpTitle)
 
  if (isMainPage) {
    var bodycontent = document.getElementById('bodyContent');
    var firstheading = bodycontent.previousSibling;
    var fakehead = document.getElementById('fakehead');


    bodycontent.parentNode.removeChild(firstheading);
    bodycontent.parentNode.insertBefore(fakehead,bodycontent);
  }
if (window.addEventListener) window.addEventListener("load",reformatMyPage,false);
if (window.addEventListener) window.addEventListener("load",reformatMyPage,false);
else if (window.attachEvent) window.attachEvent("onload",reformatMyPage);
else if (window.attachEvent) window.attachEvent("onload",reformatMyPage);

Verze z 4. 4. 2006, 23:51

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() {
  topTabsToRightPlace();  
  var mpTitle = "Test";
  var isMainPage = (document.title.substr(0, mpTitle.length) == mpTitle)
  
  if (isMainPage) {
    var bodycontent = document.getElementById('bodyContent');
    var firstheading = bodycontent.previousSibling;
    var fakehead = document.getElementById('fakehead');

    bodycontent.parentNode.removeChild(firstheading);
    bodycontent.parentNode.insertBefore(fakehead,bodycontent); 
  } 
}   
 
if (window.addEventListener) window.addEventListener("load",reformatMyPage,false);
else if (window.attachEvent) window.attachEvent("onload",reformatMyPage);