User:Fleela/monobook.js: Difference between revisions
From Tolkien Gateway
mNo edit summary |
mNo edit summary |
||
Line 25: | Line 25: | ||
if(e) e.value = "/* Intro */ "; | if(e) e.value = "/* Intro */ "; | ||
} | } | ||
}); | |||
addOnloadHook(function () { | |||
var tabs = document.getElementById('p-cactions').cloneNode(true); | |||
tabs.id = 'mytabs'; | |||
var listitems = tabs.getElementsByTagName('LI'); | |||
for (i=0;i<listitems.length;i++) { | |||
if(listitems[i].id) listitems[i].id = 'mytabs-' + listitems[i].id; | |||
} | |||
content = document.getElementById("content"); // Find the content div | |||
content.parentNode.insertBefore(tabs, content.nextSibling); // Place tab list right after content div | |||
}); | }); |
Revision as of 23:21, 17 June 2007
hookEvent("load", function () { if(window.location.href.indexOf("/wiki/Special:") != -1) return; if(document.getElementById("wikiPreview")) return; if(document.getElementById("histlegend")) return; if(document.getElementById("difference")) return; if(document.getElementById("watchdetails")) return; if(document.getElementById("mainpage")) return; if(window.location.href.indexOf("&action=edit") == -1) { var pageTitle = document.title.split(" - ")[0].replace(" ", "_"); var divContainer = document.createElement("div"); divContainer.innerHTML = '<div class="editsection" style="float:right;">\ [<a href="/w/index.php?title=' + pageTitle + '&action=edit§ion=0" \ title="' + document.title.split(" - ")[0] + '">edit</a>]</div>'; var coos = document.getElementById("coordinates"); if(coos) coos.style.right = "4.5em"; document.getElementById("content").insertBefore( divContainer, document.getElementsByTagName("h1")[0]); } else if(window.location.href.indexOf("&action=edit§ion=0") != -1) { e = document.getElementById("wpSummary"); if(e) e.value = "/* Intro */ "; } }); addOnloadHook(function () { var tabs = document.getElementById('p-cactions').cloneNode(true); tabs.id = 'mytabs'; var listitems = tabs.getElementsByTagName('LI'); for (i=0;i<listitems.length;i++) { if(listitems[i].id) listitems[i].id = 'mytabs-' + listitems[i].id; } content = document.getElementById("content"); // Find the content div content.parentNode.insertBefore(tabs, content.nextSibling); // Place tab list right after content div });