function addLink(name, link, after) { var afterID = document.getElementById(after).getElementsByTagName("ul")[0]; var li = document.createElement("li"); var a = document.createElement("a"); a.innerHTML = name; a.href = link; afterID.appendChild(li); li.appendChild(a); }; function addTitle(name, ID, after) { var afterID = document.getElementById("mw-panel"); var wrapper = document.createElement("div"); var label = document.createElement("h3"); var body = document.createElement("div"); var ul = document.createElement("ul"); wrapper.className = "portal collapsed"; wrapper.id = ID; label.innerHTML = name; body.className = "body"; afterID.insertBefore(wrapper, afterID.children[after]); wrapper.appendChild(label); wrapper.appendChild(body); body.appendChild(ul); }; function editLink(element, name) { var elementID = document.getElementById(element); if (name != "remove") { elementID.getElementsByTagName("a")[0].innerHTML = name; } else { if (elementID != null) { elementID.remove(); } } }; editLink("n-admin_notice", "Администраторы"); editLink("n-Trade", "remove"); editLink("n-faq", "FAQ"); editLink("t-whatlinkshere", "remove"); editLink("t-recentchangeslinked", "remove"); editLink("t-emailuser", "remove"); editLink("t-info", "Информация"); editLink("t-specialpages", "remove"); editLink("t-permalink", "remove"); addTitle("Статьи", "p-articles", "p-Useful_links"); addTitle("Шаблоны", "p-templates", "p-Useful_links"); addLink("ThaumCraft", "/ThaumCraft", "p-articles"); addLink("Immersive Engineering", "/Immersive Engineering", "p-articles"); addLink("Ender IO", "/Ender IO", "p-articles"); addLink("IndustrialCraft 2", "/IndustrialCraft 2", "p-articles"); addLink("Draconic Evolution", "/Draconic Evolution", "p-articles"); addLink("Спрайты", "/Шаблон:Спрайт/Навигация", "p-templates"); addLink("AutoUnsigned", "/Шаблон:AutoUnsigned", "p-templates"); addLink("Спецстраницы", "/Служебная:Спецстраницы", "p-Useful_links");