MediaWiki:MenuChanges.js

/* */

/* ============== MENU CHANGES=============================== autor:      Petr Kajzar User:Slepi datum:      03/2009 dokumentace: - licence:    for Wikilectures popis:      changes of the personal menu ==========================================================

/* ====================== PERSONAL MENU ====================== */

// FUNCTION ADDING "MY SANDBOX" function sandbox { addPortletLink('p-personal', wgServer + wgScriptPath + '/index.php?title=User:' + wgUserName + '/Sandbox', 'my sandbox', 'pt-sandbox', 'Space, where I can do experiments', 'a', document.getElementById('pt-preferences')); }

/* ================ SIDEBAR ========================== */

// FUNCTION ADDING "CATEGORY HISTORY" // (Josmart) function categoryHistory { addPortletLink('p-tb', wgServer + wgScriptPath + '/index.php/Special:CategoryHistory/'+wgTitle, 'Category history', 't-cathistory', 'History of articles in the category'); }

// FUNCTION ADDING SOME OTHER EDU PORTALS function addEdu { if (skin != "monobook") return false; novaSekce = document.createElement("div"); novaSekce.id = "p-edu"; novaSekce.className = "portlet"; document.getElementById("column-one").appendChild(novaSekce);

mefanet = ' '; portalLF = ' '; elearningPortal = ' ';

novaSekce.innerHTML = " " + mefanet + "

" + portalLF + "

" + elearningPortal; }

// FUNCTION THAT HIDES TOOLS function hideTools(id) { tool = document.getElementById(id); tool.style.display = "none"; tool.style.position = "absolute"; }

// FUNCTION ADDING FOOTER LINKS function addLfFooter { links = document.createElement("div"); links.id = "myLfFooter"; document.getElementById("globalWrapper").appendChild(links); links.innerHTML = 'Charles University in Prague | 1st Faculty of Medicine | e-mail: wiki&#64;lf1.cuni.cz'; }

/* =============== RECENT CHANGES ========================= */

// FUNCTION HIDING REAL NAME IN RECENT CHANGES function hideRealName { realNames = getElementsByClass("mw-recent-realname"); for(i=0; i<realNames.length; i++) realNames[i].style.display = "none"; }

/* =============== START FUNCTIONS ======================= */

// START ONLY IF LOGGED IN

if (wgUserName==null) { // hidden toolbox: now disabled // addOnloadHook(function{hideTools("p-tb")}); addOnloadHook(hideRealName); }

// START ONLY IF NOT LOGGED IN if (wgUserName!=null) { addOnloadHook(sandbox); if (wgCanonicalNamespace == "Category" && wgTitle) addOnloadHook(categoryHistory); }

// START EVERYTIME addOnloadHook(addEdu); addOnloadHook(addLfFooter); /* */