User:Dser/global.js

// Imports

importScriptPage('MediaWiki:APIQuery.js', 'monchbox'); importScriptPage('User:Monchoman45/ChatHacks.js', 'community'); importScriptPage('User:Joeytje50/ChatPMs.js', 'community'); importScriptPage('MediaWiki:FindReplace.js', 'kangaroopower');

var AdvancedOasisUIConfig = { accountNavFollowedPages: false, accountNavWatchlist: false, categoryRedlink: true, RCHeader: false, lightbox: false, randomPageLimitedTo: "", userLang: true, }; importScriptPage('AdvancedOasisUI/code.js', 'dev');

// Custom buttons if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/common/__cb41319/skins/common/images/button_sig.png", "speedTip": "Signature timestamp", "tagOpen": "--", "sampleText": ""}; }

if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/c/c8/Button_redirect.png", "speedTip": "Redirect", "tagOpen": "#REDIRECT ",    "tagClose": "", "sampleText": "Insert text"}; mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://images.wikia.com/central/images/c/c9/Button_strike.png", "speedTip": "Strike", "tagOpen": " ", "tagClose": " ", "sampleText": "Strike-through text"}; }

// WantedFiles fix (by Fandyllic) function ImgDescEditLink2ImgLink { $('ol.special > li > a.new').each(function {   this.setAttribute("href", this.getAttribute("href").replace(/\&action\=edit/, ""));  }); } addOnloadHook(ImgDescEditLink2ImgLink);

// Kills message wall (code by Monchoman45) 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);} } 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; }