User:Wattz2000/global.js

importScriptPage('AjaxRC/code.js', 'dev'); importScriptPage('AdvancedOasisUI/code.js', 'dev'); $(function { $('.WikiHeaderRestyle div.buttons nav').replaceWith('  Recent Changes '); });

/* Kill message wall */ 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 += ' You have new messages. ';					}					else {						document.getElementById('contentSub').outerHTML += ' You have new messages (show most recent). ';					}				}			}		});		api.send(0);	}	else {createCookie('msgwl_' + wgPageName.substring(wgPageName.lastIndexOf('/') + 1), wgCurRevisionId, 99999);}	if(wgCanonicalNamespace.indexOf('Message_Wall') == 0 || wgCanonicalNamespace == 'Thread') {		if(document.getElementById('Wall')) { //Page is an actual wall or thread			if(document.getElementById('WallBrickHeader')) {				var header = document.getElementById('WallBrickHeader').getElementsByTagName('a')[0];				header.innerHTML = 'Message Wall:' + header.href.substring(header.href.indexOf('/wiki/Message_Wall:') + '/wiki/Message_Wall:'.length);			}			var blocks = document.getElementById('Wall').getElementsByTagName('blockquote');			for(var i = 0; i < blocks.length; i++) {				if(blocks[i].className == 'speech-bubble-message') {					var div = blocks[i].getElementsByTagName('div');					if(div[0] && div[0].className == 'edited-by') {var links = blocks[i].getElementsByTagName('div')[0].getElementsByTagName('a');} else if(div[0]) {var links = blocks[i].getElementsByTagName('div')[1].getElementsByTagName('a');} if(links[1] && links[1].innerHTML) { links[1].className = ''; links[0].style.display = 'none'; }				}			}		}		else { //Page is history if(skin == 'oasis') {var page = document.getElementById('WikiaArticle');} else {var page = document.getElementById('bodyContent');} var header = page.getElementsByTagName('nav')[0].getElementsByTagName('a')[0]; header.innerHTML = 'Message Wall:' + header.href.substring(header.href.indexOf('/wiki/Message_Wall:') + '/wiki/Message_Wall:'.length); var entries = document.getElementById('WallHistory').getElementsByTagName('tr'); for(var i = 0; i < entries.length; i++) { if(entries[i].className == 'info-entry') { var links = entries[i].getElementsByTagName('a'); if(links[2] && links[2].parentNode.className != 'threadHistory') { links[2].innerHTML = links[2].children[0].innerHTML; links[2].className = ''; links[1].style.display = 'none'; }				}			}		}	} } addOnloadHook(KillMessageWall);