User:X-Spider2/monobook.js
From Homestar Runner Wiki
(Difference between revisions)
| Line 36: | Line 36: | ||
addQuickbarLink("javascript:history.forward()", "forward", "userpage"); | addQuickbarLink("javascript:history.forward()", "forward", "userpage"); | ||
addQuickbarLink("javascript:location.reload()", "refresh", "userpage"); | addQuickbarLink("javascript:location.reload()", "refresh", "userpage"); | ||
| + | addQuickbarLink("http://www.hrwiki.org/index.php/Help:Contents", "wiki help", ""); | ||
} | } | ||
if (window.addEventListener) window.addEventListener('load', addLinks, false); | if (window.addEventListener) window.addEventListener('load', addLinks, false); | ||
else if (window.attachEvent) window.attachEvent('onload', addLinks); | else if (window.attachEvent) window.attachEvent('onload', addLinks); | ||
Revision as of 02:51, 20 May 2006
// Adds bottom tabs
function morelinks() {
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;
}
document.getElementById('column-content').appendChild(tabs);
}
if (window.addEventListener) window.addEventListener("load",morelinks,false);
else if (window.attachEvent) window.attachEvent("onload",morelinks);
function addQuickbarLink(href, title, before)
{
var li = document.createElement('li');
var a = document.createElement('a');
a.appendChild(document.createTextNode(title));
a.href = href;
li.appendChild(a);
if (!before)
{
document.getElementById('pt-logout').parentNode.appendChild(li);
}
else
{
before = document.getElementById('pt-'+before);
before.parentNode.insertBefore(li, before);
}
}
function addLinks()
{
addQuickbarLink("http://www.hrwiki.org/index.php/User:X-Spider2/sig", "my signature", "preferences");
addQuickbarLink("http://www.hrwiki.org/index.php?title=User:X-Spider2/monobook.js&action=edit", "edit my js", "preferences");
addQuickbarLink("javascript:history.back()", "back", "userpage");
addQuickbarLink("javascript:history.forward()", "forward", "userpage");
addQuickbarLink("javascript:location.reload()", "refresh", "userpage");
addQuickbarLink("http://www.hrwiki.org/index.php/Help:Contents", "wiki help", "");
}
if (window.addEventListener) window.addEventListener('load', addLinks, false);
else if (window.attachEvent) window.attachEvent('onload', addLinks);
