FANDOM


/*
 */
 
importScriptPage('MediaWiki:APIQuery.js', 'monchbox');
 
function KillMessageWall() {
	if(wgPageName != 'User:' + wgUserName + '/talk' && wgPageName != 'User:' + wgUserName + '/Talk') {
		//check if someone edited your /talk or /Talk page
		var api = new APIQuery({logger: function() {}});
		api.newQuery('GET', {action: 'query', prop: 'info', titles: 'User:' + wgUserName + '/talk|User:' + wgUserName + '/Talk'}, function(result) {
			var pages = result.query.pages;
			for(var i in pages) {
				if(i > 0 && pages[i].lastrevid > readCookie('msgwl_' + pages[i].title.substring(pages[i].title.lastIndexOf('/') + 1))) {
					var sub = pages[i].title.substring(pages[i].title.lastIndexOf('/') + 1);
					if(skin == 'oasis') {
						document.getElementById('WikiaFooter').getElementsByTagName('ul')[0].outerHTML += '<ul id="WikiaNotifications" class="WikiaNotifications"><li><div data-type="1"><a class="sprite close-notification"></a>You have <a href="/index.php?title=User:' + wgUserName + '/' + sub + '&redirect=no" title="User:' + wgUserName + '/' + sub + '">new messages</a>.</div></li></ul>';
					}
					else {
						document.getElementById('contentSub').outerHTML += '<div class="usermessage">You have <a href="/index.php?title=User:' + wgUserName + '/' + sub + '&redirect=no" title="User:' + wgUserName + '/' + sub + '">new messages</a> (<a href="/index.php?title=User:' + wgUserName + '/' + sub + '&diff=cur" title="User:' + wgUserName + '/' + sub + '">show most recent</a>).</div>';
					}
				}
			}
		});
		api.send(0);
	}
	else {createCookie('msgwl_' + wgPageName.substring(wgPageName.lastIndexOf('/') + 1), wgCurRevisionId, 99999);}
}
addOnloadHook(KillMessageWall);
 
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
 
/*
*/

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.