Bruger:Thomas81/monobook.js

Fra Wikipedia, den frie encyklopædi
 // ---------------------------------------
 // BEGIN CUSTOM EXTRA MENU
 function addNewMenu()
 {
     if (document.getElementById("p-extramenu")) return;
     var div_parent = document.getElementById("p-Navigation");
     if (!div_parent) return;
     //
     // setup list, h5 and div
     var h5 = document.createElement("h5");
     h5.appendChild(document.createTextNode("mine værktøjer"));
     var div_node = document.createElement("div");
     div_node.setAttribute("id", "p-extramenu");
     div_node.setAttribute("class", "pBody");
     var ul_node = document.createElement("ul");
     //
     // now add menu points
     ul_node.appendChild(createLink("n-patrol", "Se ikke-patruljerede ændringger", "/w/index.php?title=Speciel:Seneste_%C3%A6ndringer&days=30&limit=5000&hideliu=1&hidepatrolled=1", "Patruljér"));
  ul_node.appendChild(createLink("n-Village_pump", "Se Brønden", "/w/index.php?title=Wikipedia:Landsbybrønden&limit=50&namespace=14", "Landsbybrønden")); 
 ul_node.appendChild(createLink("n-Skabeloner", "Skabeloner", "/w/index.php?title=Wikipedia:Skabeloner", "Skabeloner")); 
 ul_node.appendChild(createLink("n-Laboratoriet", "Laboratoriet", "/w/index.php?title=Bruger:Thomas81/Laboratoriet", "Laboratoriet")); 
    //
     // then add list to div and break, h5 and div to container
     div_node.appendChild(ul_node);
     div_parent.appendChild(document.createElement("br"));
     div_parent.appendChild(h5);
     div_parent.appendChild(div_node);
 }
 function createLink(id, title, href, text) {
     var li = document.createElement("li");
     li.setAttribute("id", id);
     li.setAttribute("title", title);
     li.appendChild(document.createElement("a"));
     li.firstChild.setAttribute("href",href);
     li.firstChild.appendChild(document.createTextNode(text));
     return li;
 }
 addOnloadHook(addNewMenu);
 // 
 // END CUSTOM EXTRA MENU
 // ---------------------------------------