User:DeletedAccount738/global.js

importScriptPage('User:Monchoman45/ChatHacks.js', 'c'); window.RevealAnonIP = { permissions : ['*'] }; var tabKeyEnabled = true; importArticles({   type: 'script',    articles: [ 'u:dev:RevealAnonIP/code.js', 'u:dev:PortableCSSPad/code.js', 'u:dev:AjaxUndo/code.js', 'u:rs:User:Joeytje50/tabkey.js', 'u:vstf:User:Joeyaa/wham.js', 'u:lmbw:MediaWiki:AjaxRC.js'    ] }); /* Add a links to the Wikia nav */ $(function {       $('.WikiHeader nav ul li.marked ul').append('Recent ChangesLog'); });

/* Add quicklink to Special:Statistics */ $(document).ready(function {   $(' Statistics (Advanced)  ').insertAfter('.toolbar > .tools > li:nth-child(3)'); });

/* Disable mobile skin */ $.cookie('mobilefullsite','true',{expires: 365});

window.talkPages = ['lmbtest','christianlegofans','legomessageboards']; /* Talk Page Notifications * Code by Seaside98 */

//Variables var talkWikis = window.talkWikis || ['lmbtest','christianlegofans']; var talkNames = []; var pageName = window.talkName || 'Talk'; //Uppercase the first letter of each wiki's name for (var a in talkWikis) { talkNames[a] = talkWikis[a].replace(/\b./g, function(m){ return m.toUpperCase; }); checkWiki(a); } //Add WikiaNotification element if not present if (!$('#WikiaNotifications').length) { $('#WikiaBarWrapper').before(''); } //Function to check for new messages function checkWiki(z) { //If we are on the talkpage or the cookie isn't set, then update the timestamp if (wgServer+wgPageName == 'http://'+talkWikis[z]+'.wikia.comUser:'+wgUserName+'/'+pageName || !$.cookie('talk'+talkWikis[z])) { setStamp(z); } else { //Load the edits since the last timestamp, organize the data, and then display it to the user $.ajax({			contentType: "application/json; charset=utf-8",			url: "http://"+talkWikis[z]+".wikia.com/api.php?action=query&prop=revisions&titles=User:"+encodeURIComponent(wgUserName)+"/"+pageName+"&rvprop=user&rvend="+$.cookie('talk'+talkWikis[z])+"&format=json",			dataType: "jsonp",			cache: false		}).done(function(data) {			var userAry = [];			var userList;			var plural;			var p; for (p in data.query.pages) { break; }			if ("revisions" in data.query.pages[p]) {				for (var i=0; i <a class="sprite close-notification talkClose" onclick="setStamp('+z+')"></a>You have <a href="http://'+talkWikis[z]+'.wikia.com/wiki/User:'+encodeURIComponent(wgUserName)+'/'+pageName+'">'+plural+'</a> from '+userList+'. </li>');				} else {						$('#WikiaNotifications').append(' <a class="sprite close-notification talkClose" onclick="setStamp('+z+')"></a>You have '+plural+' on the <a href="http://'+talkWikis[z]+'.wikia.com/wiki/User:'+encodeURIComponent(wgUserName)+'/'+pageName+'">'+talkNames[z]+' Wiki</a> from '+userList+'. </li>');				}				$('.talkClose').click(function { $(this).parent.remove; });			}		});	} } //Function to update the timestamp cookie function setStamp(z) { //Load the last revision to get the timestamp instead of relying on the user's computer for the correct time $.ajax({		contentType: "application/json; charset=utf-8",		url: "http://"+talkWikis[z]+".wikia.com/api.php?action=query&prop=revisions&titles=User:"+encodeURIComponent(wgUserName)+"/"+pageName+"&rvprop=timestamp&rvlimit=1&format=json",		dataType: "jsonp",		cache: false	}).done(function(data) {		var p; for (p in data.query.pages) { break; }		//Add 1 second to the timestamp of the last edit and store it as a cookie		if ("revisions" in data.query.pages[p]) {			var curTime = (parseInt(data.query.pages[p].revisions[0].timestamp.replace(/[^0-9]/g, ""))+1).toString			$.cookie('talk'+talkWikis[z],curTime,{expires: 5, path: '/', domain: '.wikia.com'});			console.log(curTime);		//If the page doesn't exist, prompt the user to create it		} else if (wgServer+wgPageName != 'http://'+talkWikis[z]+'.wikia.comUser:'+wgUserName+'/'+pageName) {			$('#WikiaNotifications').append(' Please create the page <a href="http://'+talkWikis[z]+'.wikia.com/wiki/User:'+encodeURIComponent(wgUserName)+'/'+pageName+'">User:'+wgUserName+'/'+pageName+'</a> on the '+talkNames[z]+' Wiki. </li>');		}	}); }