Jump to content

User:Writ Keeper/Scripts/oldschoolOrangeBar.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
$(document).ready(function()
{
	if(mw.config.get("wgNamespaceNumber") == "3" && mw.config.get("wgTitle") == mw.config.get("wgUsername"))
	{
		
	}
	else if(mw.config.get('wgUserNewMsgRevisionId') != null)
	{
		var orangeBarDiv = document.createElement("div");
		orangeBarDiv.innerHTML = 'You have <a href="/wiki/User_talk:' + mw.config.get("wgUserName").replace(/ /g, '_') + '" title="User talk:'+mw.config.get("wgUserName")+'">new messages</a> (<a href="/w/index.php?title=User_talk:'+mw.config.get("wgUserName").replace(/ /g, '_')+'&diff=cur&old='+mw.config.get("wgUserNewMsgRevisionId")+'">last change</a>).';
		orangeBarDiv.className = "usermessage";
		$("#contentSub").after(orangeBarDiv);
		$(".tagline").after(orangeBarDiv);
	}
});