User:Tomchen1989/newmessage
This page contains material that is kept because it is considered humorous. Such material is not meant to be taken seriously. |
Description
[edit]This template shows a fake "You have new messages" alert for joke, it only works on "User" or "User talk" pages.
Usage
[edit]Basically, using
{{User:Tomchen1989/newmessage}}
without any parameters is fine:
If you want to choose which pages "new messages" and "last change" link to, or what the small tip is, use:
{{User:Tomchen1989/newmessage|<which page "new messages" links to>|<which page "last change" links to>|<tip>}}
By default, both "new messages" and "last change" link to User:Tomchen1989/newmessage/doc, the small tip is an image which links to User:Tomchen1989/newmessage: .
Example:
{{User:Tomchen1989/newmessage|hoax|Wikipedia:Do not create hoaxes|[[File:Joke Alert.svg|16px|This is not only a hoax.|link=Meta:Category:Humor]]}}
it shows:
How to hide
[edit]How to hide other users' fake "You have new messages" boxes (but not hide real ones) if I don't like this hoax?
Custom JS for Wikipedia
[edit]Edit your common.js (or the custom JavaScript of your current skin. default is monobook.js), add the following JavaScript code at the end of this .js (create this .js if not exist), then clear your browser cache.
//==Hide fake usermessages BEGIN==
function HWFU(){
var divs = document.getElementsByTagName("div");
var us = [];
var u;
for (i = 0, l = divs.length; i < l; i++) {
if ( /(^|\s)usermessage(\s|$)/.test(divs[i].className) ) {
u = divs[i];
var uas = u.getElementsByTagName("a");
if (uas.length>1) {
if (uas[1].href.substr(-8)!=="diff=cur" || /(^|\s)external(\s|$)/.test(uas[1].className)) {
u.style.display = "none";
}
} else {
u.style.display = "none";
}
}
}
}
if (window.addEventListener) {
window.addEventListener("load", HWFU, false);
} else if (window.attachEvent) {
window.attachEvent("onload", HWFU);
}
//==Hide fake usermessages END==
UserScript
[edit]Use "Hide Wikipedia fake usermessages" UserScript (click here to install it directly).
- Google Chrome can install UserScripts directly;
- Firefox needs Greasemonkey add-on;
- Opera can also handle those UserScripts, you should set your "User JavaScript folder" in "Settings" -> "Advanced" -> "Content" -> "JavaScript Options...";
- Internet Explorer needs Trixie, IE7Pro or "Greasemonkey for IE";
- Safari needs GreaseKit or other plug-ins.