Jump to content

User:Writ Keeper/Scripts/orangeBar.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Writ Keeper (talk | contribs) at 19:02, 7 May 2013 (oops). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
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('wgUserNewMsgRevisionId') != null)
	{
		var orangeBarDiv = document.createElement("div");
		orangeBarDiv.innerHTML = 'You have <a href="/wiki/User_talk:' + wgUserName.replace(/ /g, '_') + '" title="User talk:'+wgUserName+'">new messages</a> (<a href="/w/index.php?title=User_talk:'+wgUserName.replace(/ /g, '_')+'&diff=cur&old='+wgUserNewMsgRevisionId+'">last change</a>).';
		orangeBarDiv.className = "usermessage";
		$("#contentSub").after(orangeBarDiv);
		$(".tagline").after(orangeBarDiv);
	}
});