User:Phlip/monobook.js
From Homestar Runner Wiki
< User:Phlip(Difference between revisions)
(they're getting annoying...) |
(to make censoring easier) |
||
| (includes 4 intermediate revisions) | |||
| Line 1: | Line 1: | ||
| - | + | // include utility functions | |
| + | document.write('<script type="text/javascript" src="/index.php?title=User:Phlip/utilities.js&action=raw&ctype=text/javascript&dontcountme=s"></script>'); | ||
| + | |||
| + | function dostuff() | ||
{ | { | ||
| - | + | with (utilities) | |
| - | + | ||
| - | + | ||
{ | { | ||
| - | + | addMonobookTab("http://validator.w3.org/check?uri=" + escape(getArticleURL()), "Validate", true) | |
| + | addMonobookBottomTabs() | ||
| + | if (getArticleNamespace() == 2 || getArticleNamespace() == 3) | ||
{ | { | ||
| - | + | var username = getArticleTitle(); | |
| - | if ( | + | var i = username.indexOf('/') |
| + | if (i >= 0) | ||
| + | username = username.substr(0, i); | ||
| + | addMonobookNavboxLink(localurl("Contributions/" + username, -1), "Contribs", "tb"); | ||
| + | addMonobookNavboxLink(localurl("Log", -1, "user=" + username), "Show Logs (user)", "tb"); | ||
| + | addMonobookNavboxLink(localurl("Log", -1, "page=User:" + username), "Show Logs (target)", "tb"); | ||
} | } | ||
} | } | ||
| - | |||
} | } | ||
| - | function | + | if (window.addEventListener) window.addEventListener("load",dostuff,false); |
| + | else if (window.attachEvent) window.attachEvent("onload",dostuff); | ||
| + | |||
| + | function killfakeusermessage() | ||
{ | { | ||
| - | |||
| - | |||
var a = document.getElementsByTagName('DIV'); | var a = document.getElementsByTagName('DIV'); | ||
| - | |||
for (var i = 0; i < a.length; i++) | for (var i = 0; i < a.length; i++) | ||
{ | { | ||
| - | if (a[i].className == " | + | if (a[i].className == "usermessage") |
{ | { | ||
b = getChildType(a[i], "A", 1); | b = getChildType(a[i], "A", 1); | ||
| - | if (b | + | if (b && b.href != "/index.php/User_talk:Phlip" |
| - | + | && b.href != "http://hrwiki.org/index.php/User_talk:Phlip" | |
| + | && b.href != "http://www.hrwiki.org/index.php/User_talk:Phlip") | ||
| + | a[i].style.background = "inherit"; | ||
} | } | ||
} | } | ||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
| - | |||
} | } | ||
| - | + | if (window.addEventListener) window.addEventListener("load",killfakeusermessage,false); | |
| - | if (window.addEventListener) window.addEventListener("load", | + | else if (window.attachEvent) window.attachEvent("onload",killfakeusermessage); |
| - | else if (window.attachEvent) window.attachEvent("onload", | + | |
| - | + | mwCustomEditButtons[mwCustomEditButtons.length] = | |
{ | { | ||
| - | + | "imageFile": 'http://forum.hrwiki.org/images/smiles/emoblush.gif', | |
| - | + | "speedTip": 'Mark a swear', | |
| - | + | "tagOpen": '{{{swear|', | |
| - | + | "tagClose": '}}}', | |
| - | + | "sampleText": '' | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
} | } | ||
Current revision as of 02:29, 10 May 2007
// include utility functions
document.write('<script type="text/javascript" src="/index.php?title=User:Phlip/utilities.js&action=raw&ctype=text/javascript&dontcountme=s"></script>');
function dostuff()
{
with (utilities)
{
addMonobookTab("http://validator.w3.org/check?uri=" + escape(getArticleURL()), "Validate", true)
addMonobookBottomTabs()
if (getArticleNamespace() == 2 || getArticleNamespace() == 3)
{
var username = getArticleTitle();
var i = username.indexOf('/')
if (i >= 0)
username = username.substr(0, i);
addMonobookNavboxLink(localurl("Contributions/" + username, -1), "Contribs", "tb");
addMonobookNavboxLink(localurl("Log", -1, "user=" + username), "Show Logs (user)", "tb");
addMonobookNavboxLink(localurl("Log", -1, "page=User:" + username), "Show Logs (target)", "tb");
}
}
}
if (window.addEventListener) window.addEventListener("load",dostuff,false);
else if (window.attachEvent) window.attachEvent("onload",dostuff);
function killfakeusermessage()
{
var a = document.getElementsByTagName('DIV');
for (var i = 0; i < a.length; i++)
{
if (a[i].className == "usermessage")
{
b = getChildType(a[i], "A", 1);
if (b && b.href != "/index.php/User_talk:Phlip"
&& b.href != "http://hrwiki.org/index.php/User_talk:Phlip"
&& b.href != "http://www.hrwiki.org/index.php/User_talk:Phlip")
a[i].style.background = "inherit";
}
}
}
if (window.addEventListener) window.addEventListener("load",killfakeusermessage,false);
else if (window.attachEvent) window.attachEvent("onload",killfakeusermessage);
mwCustomEditButtons[mwCustomEditButtons.length] =
{
"imageFile": 'http://forum.hrwiki.org/images/smiles/emoblush.gif',
"speedTip": 'Mark a swear',
"tagOpen": '{{{swear|',
"tagClose": '}}}',
"sampleText": ''
}
