User:Cinderthomtrooper/global.js

importArticles({   type: 'script',    articles: [        'u:dev:PurgeButton/code.js',    ] }); /* jshint browser:true, jquery:true */ /* global mediaWiki */ (function($, mw) {   'use strict';

var config = mw.config.get([       'skin',        'wgNamespaceNumber'    ]), $button;

if (config.wgNamespaceNumber < 0 || window.PurgeButtonsLoaded || $('#control_purge').exists) { return; }   window.PurgeButtonsLoaded = true; // prevent duplicate running (but not dupe buttons from outside this code)

if (!window.dev || !window.dev.i18n) { importArticle({           type: 'script',            article: 'u:dev:MediaWiki:I18n-js/code.js'        }); }

function purgePage { $.get('?action=purge', function {           location.reload(true);        }); $('html, body').css({           overflow: 'hidden',            display: 'block'        }); $(' ').css({           background: 'rgba(255, 255, 255, 0.5)',            position: 'fixed',            height: '100%',            width: '100%',            left: '0',            top: '0',            'z-index': '1000000000'        }).html(            '' +                '' +                    ' ' +                '' +            ' '        ).appendTo(document.body); }

function addOasisPurgeButton { switch (config.wgNamespaceNumber) { case 500: case 502: // Blog namespaces $('.page-header__contribution-buttons').append($button.addClass('wds-button wds-is-squished wds-is-secondary')); break; default: // .UserProfileActionButton is for root user pages (they don't use new page header yet) $('.UserProfileActionButton .wikia-menu-button .WikiaMenuElement, .page-header__contribution-buttons .wds-list').first .append($('').append($button)); }   }

function addPurgeButton(i18n) { i18n.useUserLang; $button = $('', {           'class': 'custom-purge-button',            href: '#',            title: i18n.msg('purge').plain,            text: window.PurgeButtonText || i18n.msg('refresh').plain        }).click(purgePage); switch(config.skin) { case 'uncyclopedia': case 'monobook': $('#p-cactions > .pBody > ul').append($('', { id: 'ca-purge' }).append($button)); break; case 'oasis': case 'wikia': addOasisPurgeButton; break; }   }

mw.hook('dev.i18n').add(function(i18no) {       i18no.loadMessages('PurgeButton').then(addPurgeButton);    }); }(jQuery, mediaWiki)); importArticles({ type: 'script', articles: [ 'u:dev:ChatHacks.js' ] }); window.ChatHacksPingSound = 'full URL to audio file'; /* * ChatHacks.js, by Monchoman45. * Version 7.0 * * Features: *  Ability to clear your chat window *   A host of slash commands *   Ability to create multi user private chats *   Inline alerts every time your away status changes *   Icons next to messages by staff and chat mods in the room *   Pings when someone mentions your name or any other specified phrases */ if (wgCanonicalSpecialPageName == 'Chat') {	window.hasFocus = true;	window.dinged = false;	window.ding = 0;	window.titleorig = document.title;	//Function for adding messages to the window	NodeChatDiscussion.prototype.iconPing = function (chat) {		var icon = '';		for(var i in this.model.users.models) {			if(this.model.users.models[i].attributes.name == chat.attributes.name) {				if(this.model.users.models[i].attributes.isStaff) {					icon = $(' ').addClass('stafficon') .attr('src', window.ChatHacksIconStaff || 'https://images.wikia.nocookie.net/wikiaglobal/images/6/6c/Staff_icon.png'); }				else if(this.model.users.models[i].attributes.isModerator) { icon = $(' ').addClass('modicon') .attr('src', window.ChatHacksIconMod || 'https://images.wikia.nocookie.net/monchbox/images/6/6b/Icon-chatmod.png'); }				break; }		}		if(icon && window.ChatHacksNoStar !== true) { this.chatUL.children.last.children('.username').append(' ', icon); }		if(mainRoom.isInitialized && chat.attributes.name != wgUserName && !chat.attributes.isInlineAlert) { //resolve HTML var text = chat.attributes.text; var pings = document.getElementById('pings').value.trim.split('\n'); for(var i = 0; i < pings.length; i++) { if(text.toLowerCase.indexOf(pings[i].toLowerCase) != -1 || this != mainRoom.viewDiscussion) { if(!window.hasFocus) { //Only annoy people if the window isn't focused if (window.ChatHacksPingSound !== false) { document.getElementById('sound').innerHTML = $(' ').attr({								autoplay: true,								src: window.ChatHacksPingSound || 'https://images.wikia.nocookie.net/monchbox/images/0/01/Beep-sound.ogg'							}).prop('outerHTML'); }						if(!window.dinged) { window.dinged = true; window.ding = setInterval(FlashTitle, 500); }					}					this.scrollToBottom; if(this == mainRoom.viewDiscussion) { var ref = text.toLowerCase.indexOf(pings[i].toLowerCase); var phrase = text.slice(ref, ref + pings[i].length); this.chatUL.children.last.children('.message').addClass('ping'); }					break; }			}		}		//Kill emoticons this.chatUL.children.last.children('.message img').each(function {this.outerHTML = '' + this.title + ' ';}); };	mw.hook('chathacks.mainRoomIsReady').add(function {		mainRoom.model.chats.bind('afteradd', $.proxy(mainRoom.viewDiscussion.iconPing, mainRoom.viewDiscussion));	}); //Away status functions NodeChatController.prototype.setAway = function (msg) { if(!msg) {msg = '';} $.log("Attempting to go away with message: " + msg); var setStatusCommand = new models.SetStatusCommand({			statusState: STATUS_STATE_AWAY,			statusMessage: msg		}); this.inlineAlert(i18n['away']); this.socket.send(setStatusCommand.xport); };	NodeChatController.prototype.setBack = function { if( !this.comingBackFromAway ) { // if we have sent this command (but just haven't finished coming back yet), don't keep spamming the server w/this command $.log("Telling the server that I'm back."); this.comingBackFromAway = true; var setStatusCommand = new models.SetStatusCommand({				statusState: STATUS_STATE_PRESENT,				statusMessage: ''			}); this.inlineAlert(i18n['back']); this.socket.send(setStatusCommand.xport); }	};	//Send message function NodeChatController.prototype.sendMessage = function (event) { if(!this.active) { return true; }		if (event.which == 13 && !event.shiftKey) { event.preventDefault; mainRoom.resetActivityTimer; var inputField = this.viewDiscussion.getTextInput; var send = preparse.call(this, inputField.val); if (inputField.val && send) { var chatEntry = new models.ChatEntry({roomId: this.roomId, name: wgUserName, text: inputField.val}); if( this.isPrivate === true ) { //is prive if( this.afterInitQueue.length < 1 || this.model.users.length < 2 ){ this.mainController.socket.send( this.model.privateRoom.xport ); }					if( !this.isInitialized ) { this.afterInitQueue.push(chatEntry.xport); //temp chat entry in case of slow connection time chatEntry.set({temp : true, avatarSrc: wgAvatarUrl }); this.model.chats.add(chatEntry); } else { this.socket.send(chatEntry.xport); }				} else { this.socket.send(chatEntry.xport); }				event.preventDefault; }			inputField.val(''); $.log('submitting form'); inputField.focus; }	};	mw.hook('chathacks.mainRoomIsReady').add(function {		mainRoom.viewDiscussion.unbind('sendMessage');		mainRoom.viewDiscussion.bind('sendMessage', $.proxy(mainRoom.sendMessage, mainRoom));	}); //Functions that have to be changed for interwiki chat NodeChatController.prototype.openPrivateRoom = function (users) { users.push( wgUserName ); $.ajax({			type: 'POST',			url: wgScript + '?action=ajax&rs=ChatAjax&method=getPrivateRoomID',			data: {				users : users.join(',')			},			success: $.proxy(function (data) { $.log("Attempting create private room with users " + users.join(',')); data = new models.OpenPrivateRoom({roomId: data.id, users: users}); this.baseOpenPrivateRoom(data, true); this.showRoom(data.get('roomId') ); this.chats.privates[ data.get('roomId') ].isPrivate = true; this.chats.privates[ data.get('roomId') ].init; //this.socket.send(data.xport); }, this)		}); this.viewUsers.hideMenu; };	NodeRoomController.prototype.onJoin = function (message) { var joinedUser = new models.User; joinedUser.mport(message.joinData); var connectedUser = this.model.users.findByName(joinedUser.get('name')); if(typeof connectedUser == "undefined"){ this.model.users.add(joinedUser); this.fire('afterJoin', joinedUser); //TODO: move it to other class if( !this.isPrivate ) { // Create the inline-alert (on client side so that we only display it if the user actually IS new to the room and not just disconnecting/reconnecting). var newChatEntry = new models.InlineAlert({text: $.msg('chat-user-joined', [joinedUser.get('name')] ) }); this.model.chats.add(newChatEntry); }			this.disableRoom(joinedUser, false); } else { // The user is already in the room... just update them (in case they have changed). this.model.users.remove(connectedUser); this.model.users.add(joinedUser); }	};	NodeRoomController.prototype.onPart = function (message) { var partedUser = new models.User; partedUser.mport(message.data); var connectedUser = this.model.users.findByName(partedUser.get('name')); if(typeof connectedUser != "undefined"){ //TODO: move it to other class if( !this.isPrivate ) { var newChatEntry = new models.InlineAlert({text: $.msg('chat-user-parted', [connectedUser.get('name')] ) }); this.model.chats.add(newChatEntry); }			this.model.users.remove(connectedUser); this.disableRoom(connectedUser, true); }	};	NodeRoomController.prototype.disableRoom = function (user, flag) { if( this.isPrivate === false ) { //TODO: fix it for multiuser priv chat var privateUser = this.model.privateUsers.findByName(user.get('name')); if(typeof privateUser != "undefined"){ var roomId = privateUser.get('roomId'); if( typeof( this.chats.privates[roomId] ) != "undefined" ){ this.chats.privates[roomId].model.room.set({						'blockedMessageInput': flag					}); }				//try to reconnect if(flag === false && this.chats.privates[roomId].model.chats.length > 0) { this.socket.send( this.chats.privates[roomId].model.privateRoom.xport ); }			}		}	};	NodeChatController.prototype.showRoom = function (roomId) { $.log(roomId); if( this.activeRoom == roomId ) { return false; }		this.activeRoom = roomId; if(roomId == 'main') { this.chats.main.setActive(true); } else { this.chats.main.setActive(false); }		for(var i in this.chats.privates) { if(i == roomId) { this.chats.privates[i].setActive(true); } else { this.chats.privates[i].setActive(false); }		}		for(var i in this.chats.opens) { if(i == roomId) { this.chats.opens[i].setActive(true); } else { this.chats.opens[i].setActive(false); }		}		return true; };	NodeChatController.prototype.openPublicRoom = function (roomId) { this.chats.opens[roomId] = new NodeRoomController(roomId); this.chats.opens[roomId].mainController = this; //set main controller for this chat room this.showRoom(roomId); this.chats.opens[roomId].init; };	/* //For interwiki chatting, a merger of NodeRoomController's private management functions, and NodeChatController's public management functions. NodeInterwikiController = $.createClass(NodeRoomController, {		constructor: function (roomId) {			NodeInterwikiController.superclass.constructor.apply(this,arguments);			this.socket.bind('updateUser', $.proxy(this.onUpdateUser, this)); //Check			this.bind('afterJoin', $.proxy(this.afterJoin, this));			this.viewUsers = new NodeChatUsers({model: this.model, el: $('body')});			this.viewUsers.bind('showPrivateMessage', $.proxy(this.privateMessage, this) );			this.viewUsers.bind('kickBan', $.proxy(this.kickBan, this) );			this.viewUsers.bind('giveChatMod', $.proxy(this.giveChatMod, this) );			this.viewUsers.bind('blockPrivateMessage', $.proxy(this.blockPrivate, this) ); //Check			this.viewUsers.bind('allowPrivateMessage', $.proxy(this.allowPrivate, this) ); //Check			this.viewUsers.bind('mainListClick', $.proxy(this.mainListClick, this) ); //Check			this.viewUsers.bind('privateListClick', $.proxy(this.privateListClick, this) ); //Check this.viewUsers.bind('clickAnchor', $.proxy(this.clickAnchor, this) ); //Check this.viewUsers.render; this.viewDiscussion.show; return this; }	}); */	NodeChatController.prototype.inlineAlert = function (text) {		for(var i in text.split('\n')) {			mainRoom.model.chats.add( new models.InlineAlert({text: text.split('\n')[i]}) );		}		this.viewDiscussion.scrollToBottom;	};	function FlashTitle {		if(document.title == window.titleorig) {			document.title = i18n['activity'].replace(/\$1/g, wgSiteName);		}		else {			document.title = window.titleorig;		}	}	// parse slash commands	// return true to send text to chat unparsed	//       false to discard it after parsing	function preparse(input) {		var			commands = window.commands,			com = input.slice(1)				.trim				.replace(/\s+/g, ' ')				.split(' '),			ref = com.shift,			done = false;		if ((input.charAt(0) === '/') && (ref.length > 0)) {			while (!done) {				switch (typeof commands[ref]) {				// look up synonyms				case 'string':					while (typeof commands[ref] === 'string') {						ref = commands[ref];					}					break;				// parse hierarchical commands, if ever there are any				case 'object':					commands = commands[ref];					if (com.length === 0) {						// there is no next keyword ref = 'fallback'; } else { ref = com[0]; if (typeof commands[ref] === 'undefined') { // the next keyword isn't a command, so it's an argument ref = 'fallback'; } else { // the next keyword is a command, so one less argument com.shift; }					}					break; // it's a function or it's not; either way, we're done default: done = true; }			}			if (typeof commands[ref] === 'function') { return commands[ref].call(this, com.join(' '), input); }		}		return true; }	window.commands = { 'away': 'afk', 'afk': function (com, text) { if($('#ChatHeader .User').hasClass('away') === false) {toggleAway;} //if you're away, hitting enter has already sent you back },		'clear': function (com, text) { //Clear the active chat window this.clearWindow; },		'nc': function (com, text) { //Nobody cares $('#Write [name="message"]').val( + (com || i18n['nobodycares']) + ); return true; },		'devoice': function (com, text) { //IRCpwnt $('#Write [name="message"]').val('* ChanServ set channel mode -v ' + (com || wgUserName)); return true; },		'coppa': function (com, text) { //Too young $('#Write [name="message"]').val('https://coppa.org/ ' + (com || i18n['coppa'])); return true; },		'silence': function (com, text) { //Idle $('#Write [name="message"]').val('People idle, enjoy the silence. https://www.youtube.com/watch?v=diT3FvDHMyo'); return true; },		'kick': function (com, text) { //Kickban a user if(com) { mainRoom.kick({					name: com				}); }			else {this.inlineAlert(i18n['erruser'].replace(/\$1/g, text.split(' ')[0]));} },		'ban': 'kickban', 'kb': 'kickban', 'kickban': function (com, text) { //Kickban a user if(com) { mainRoom.socket.send(new models.BanCommand({ userToBan: com, time: '36400', //1 day it's enough, idk, no time specified reason: 'Misbehaving in chat' // i guess }).xport); }			else {this.inlineAlert(i18n['erruser'].replace(/\$1/g, text.split(' ')[0]));} },		'unban': function (com, text) { //Unban a user if(com) { mainRoom.socket.send(new models.BanCommand({ userToBan: com // Empty ban command === unban }).xport); }			else {this.inlineAlert(i18n['erruser'].replace(/\$1/g, text.split(' ')[0]));} },		'mod': function (com, text) { //Make a user a mod if(com) { var giveChatModCommand = new models.GiveChatModCommand({userToPromote: com}); this.socket.send(giveChatModCommand.xport); }			else {this.inlineAlert(i18n['erruser'].replace(/\$1/g, text.split(' ')[0]));} },		'demod': function (com, text) { //Remove a user's mod right if(com) { $.getJSON(mw.util.wikiScript('api') + '?action=query&list=users&ustoken=userrights&ususers=' + com + '&format=json', function (token) {				$.post(mw.util.wikiScript('api'), { format: 'json', action: 'userrights', user: com, remove: 'chatmoderator', token: token.query.users[0].userrightstoken }, function (result) { if(result.userrights.removed[0] == 'chatmoderator') { this.inlineAlert(i18n['demodded'].replace(/\$1/g, com)); } else { this.inlineAlert(i18n['notmod'].replace(/\$1/g, result.userrights.user)); }				});			});		}		else {this.inlineAlert(i18n['erruser'].replace(/\$1/g, text.split(' ')[0]));} },		'block': function (com, text) { //Block a user from private chatting you if(com) {this.blockPrivate({name: com});} else {this.inlineAlert(i18n['erruser'].replace(/\$1/g, text.split(' ')[0]));} },		'unblock': function (com, text) { //Unblock a user from private chatting you - should merge this into a toggle if(com) {this.allowPrivate({name: com});} else {this.inlineAlert(i18n['erruser'].replace(/\$1/g, text.split(' ')[0]));} },		'chat': 'private', 'room': 'private', 'private': function (com, text) { //Invoke a private room if (com.length > 0) { var users = com.replace(/\s*,\s*/g, ',').split(','); var curRoom = mainRoom.model.privateUsers.findByName(users[0]); if (!curRoom) { mainRoom.openPrivateChat(users); } else { mainRoom.showRoom(curRoom.attributes.roomId); }			} else { this.inlineAlert(i18n.erruser.replace(/\$1/g, text.replace(/\s+$/, ''))); }		},		/*'enter': 'join', 'join': function (com, text) { //Now for a command with chutzpah - join any chat on Wikia //Need to fix this so that joined rooms can be selected if(com) { var data = new models.OpenPrivateRoom({roomId: com}); mainRoom.baseOpenPrivateRoom(data, true); $('.private').before(' ' + com + ' 0 '); mainRoom.showRoom(com); mainRoom.chats.privates[com].init; }			else {this.inlineAlert(i18n['errroom'].replace(/\$1/g, text.split(' ')[0]));} },		'leave': 'part', 'part': function (com, text) { //Leave the room you're looking at, or the room you specify if(!com) {var id = this.roomId; var chat = this;} else {var id = com; var chat = mainRoom.chats.privates[com];} $('#Room_' + id).remove; chat.socket.autoReconnect = false; chat.socket.socket.disconnect; if(!com) {mainRoom.show('main');} },*/		'roomid': 'id', 'id': function (com, text) { this.inlineAlert(i18n['id'] + ': ' + this.roomId); },		'self': function (com, text) { //Send a message to yourself if(com) { var newstr = ' '; for(var i = 0; i < com.length; i++) { switch(com.charAt(i)) { case '[': if(com.charAt(i + 1) == '[') { var k = com.indexOf(']', i); if(com.charAt(k + 1) == ']') { var link = com.substring(i + 2, k); var linktext = link; if(link.indexOf('|') != -1) { link = link.substring(0, link.indexOf('|')); linktext = linktext.substring(linktext.indexOf('|') + 1, linktext.length); }									newstr += '' + linktext + ''; i = k + 1; }							}							else if(com.substring(i + 1, i + 8) == 'http://' || com.substring(i + 1, i + 9) == 'https://') { var k = com.indexOf(']', i); var splstr = com.substring(i + 1, k).split(' '); var link = splstr.shift; var linktext = splstr.join(' ') || '[1]'; newstr += '' + linktext + ''; i = k;							} break; default: newstr += com.charAt(i); break; }				}				this.viewDiscussion.chatUL.append(' ' + wgUserName + ' ' + i18n['self'] + newstr + ' </li>'); }			else { this.viewDiscussion.chatUL.append('<li><img class="avatar" src="' + $('#ChatHeader .User img').attr('src') + '"> ' + wgUserName + ' ' + i18n['self'] + ' </li>'); }			this.viewDiscussion.scrollToBottom; },		'help': function (com, text) { if(com) { var ref = com.replace(/ /g, '.'); var str = ''; var subcoms = []; var subdirs = []; while(typeof window.commands[ref] == 'string') { ref = window.commands[ref]; }				if(i18n['help-' + ref]) { str += i18n['help'] .replace(/\$1/g, ref.replace(/\./g, ' ')) .replace(/\$2/g, i18n['help-' + ref]							.replace(/\$1/g, i18n['example'])							.replace(/\$2/g, i18n['exampleuser'])						); }				var command = window.commands[ref]; if(typeof command == 'object') { for(var i in command) { if(typeof command[i] == 'function') {subcoms.push(i);} if(typeof command[i] == 'object') {subdirs.push(i);} }				}				if(subcoms.length > 0) {str += '\n' + i18n['subcoms'] + ': ' + subcoms.join(', ');} if(subdirs.length > 0) {str += '\n' + i18n['subdirs'] + ': ' + subdirs.join(', ');} str = str.trim; if(str !== '') {this.inlineAlert(str);} else {this.inlineAlert(i18n['nohelp'].replace(/\$1/g, ref));} }			else { var str = []; for(var i in window.commands) { if(typeof window.commands[i] == 'function' || typeof window.commands[i] == 'object') {str.push(i);} }				this.inlineAlert(i18n['commands'].replace(/\$1/g, str.join(', '))); }		}	};	function toggleAway(msg) { if(!msg) {msg = '';} if($('#ChatHeader .User').hasClass('away') == true) { mainRoom.setBack; }		else { mainRoom.setAway(msg); }	}	toggleAway.back = function { //Force back status if($('#ChatHeader .User').hasClass('away') == true) {mainRoom.setBack;} };	toggleAway.away = function (msg) { //Force away status if(!msg) {msg = '';} if($('#ChatHeader .User').hasClass('away') == false) {mainRoom.setAway(msg);} };	NodeChatController.prototype.clearWindow = function { this.viewDiscussion.chatUL.html(''); this.inlineAlert(i18n['cleared']); };	function active { //Returns the NodeChatController for the active window if(mainRoom.activeRoom && mainRoom.activeRoom != 'main') {return mainRoom.chats.privates[mainRoom.activeRoom];} else {return mainRoom;} }	(function {		//Fire hook once mainRoom is ready		var mainRoomIsReady = setInterval(function  { if (window.mainRoom && mainRoom.isInitialized === true) { clearInterval(mainRoomIsReady); mw.hook('chathacks.mainRoomIsReady').fire; }		}, 500);	});	$(function {		importArticles({ type: 'script', articles: ['u:dev:ChatHacks.js/i18n.js'] });		mw.util.addCSS('.stafficon {\n\tmargin-bottom:-4px;\n\twidth:14px;\n\theight:14px;\n}\n.modicon {\n\tmargin-bottom:-3px;\n\twidth:14px;\n\theight:14px;\n}\n.UserStatsMenu {\n\tcolor:#000;\n}\n.Write [name="message"] {\n\twidth:93%;\n}\n.inline-alert span {\n\tcolor:#006CB0;\n\tcursor:pointer;\n}\n.inline-alert span:hover {\n\ttext-decoration:underline;\n}\n#pingspan {\n\tposition:absolute;\n\tz-index:5;\n\ttop:23px;\n\tmargin-left:15px;\n\tfont-size:15px;\n\tfont-weight:normal;\n\tline-height:15px;\n}\n#pings {\n\tresize:none;\n\tmargin-left:0;\n\tfont-size:12px;\n\theight:100px;\n\tdisplay:block;\n}\n#pingspan div span {\n\tfont-size:55%;\n}\n#ChatHeader {\n\tz-index:9999;\n}\n#ChatHeader {\n\tz-index:9999;\n}\n.message.ping {\n\tcolor:red;\n}');		//Unbind all of the window listeners that set your status to back		$(window).unbind('mousemove').unbind('focus').unbind('keypress');		//Bind focus and blur for handling page title on ding $(window).bind('focus', function { //for fixing the title after you've been dinged			document.title = window.titleorig;			clearInterval(window.ding);			window.hasFocus = true;			window.dinged = false;		}); $(window).bind('blur', function {window.hasFocus = false;}); //Add the sound space $(document.body).append(' '); }); } else {	//Not chat	$(function { var a = document.querySelectorAll('a[href^="/wiki/Special:Chat"]'); for(var i = 0; i < a.length; i++) { a[i].addEventListener('click', function (event) {event.preventDefault; OpenChatWindow;}); a[i].removeAttribute('data-canonical'); }		if(document.body.className.indexOf('skin-oasis') != -1) { window.chatcheck = setInterval(ChatCheck, 200); }		else { $.nirvana.getJson('Chat', 'index', function {				$('<li id="joinChat">Chat</a></li>').appendTo('.generated-sidebar:first ul');			}); }	});	function ChatCheck {		if($('.chat-join button').length != 0) {			$('.chat-join button').replaceWith('' + $('.chat-join button').html + '</a>');			clearInterval(window.chatcheck);		}		if ($('.start-a-chat-button').length != 0) {			$('.start-a-chat-button').replaceWith('' + $('.start-a-chat-button').html + '</a>');			clearInterval(window.chatcheck);		}	}	function OpenChatWindow {		window.chatwindow = window.open('/wiki/Special:Chat?useskin=oasis', 'chat');		window.chatwindow.onload = function {			window.chatwindow.importScriptPage('User:' + wgUserName + '/global.js', 'c');			window.chatwindow.importScript('User:' + wgUserName + '/wikia.js');		};	} }