User:Original Authority/global.js

(function(mw){ if ( mw.config.get( "wgCanonicalSpecialPageName" ) === "Chat" ) { window.Clearvoice = {	messages: {		0: {			text: "",			key: "Intro",		},		1: {			text: "",			key: "Chatbombing",		},		2: {			text: "Per Wikia's terms of use and the COPPA federal law ( http://coppa.org ), you have to be thirteen (13) years or older to legally have an account at Wikia.",			key: "COPPA"		},		3: {			text: "If you have a social issue with another user on your wiki, please report it to Wikia Staff at Special:Contact/general. Your message will be checked and replied to in a maximum of three workdays.",			key: "Drama"		},		4: {			text: "Hey, please don't ask to ask a question, simply ask the question (all on one line, so that others can read and follow it easily). If anyone knows the answer they will most likely reply. :)", key: "Ask" }	}, 	fillMessage: function ( index ) { document.getElementById( "message" ).value = this.messages[index].text; } }; } window.onload = function { if ( mw.config.get( "wgPageName" ) === "Undefined" ) { window.close; }	var portal = document.getElementsByClassName( "subnav-2 firstChild" )[0].getElementsByTagName( "a" )[4]; if ( portal ) { portal.removeAttribute( "href" ); portal.onclick = function { window.chatwindow = window.open( "/wiki/Special:Chat", "chat"); chatwindow.onload = function { var framework = chatwindow.document.createElement( "script" ); framework.async = false; framework.src = "http://community.wikia.com/wiki/User:Original_Authority/global.js?action=raw&ctype/text/javascript"; chatwindow.document.head.appendChild(framework); }	} } if ( mw.config.get("wgCanonicalSpecialPageName") === "Chat" ) { document.body.style.backgroundColor = "black"; document.getElementsByTagName( "h1" )[0].id = "chat-dashboard"; document.getElementsByTagName( "textarea" )[0].id = "message"; var messages = Clearvoice.messages; for ( var property in messages ) { if ( messages.hasOwnProperty( property ) ) { var trigger = document.createElement( "button" ); trigger.id = messages[property].key.toLowerCase; trigger.textContent = messages[property].key; document.getElementById( "chat-dashboard" ).appendChild( trigger ); }				}				document.getElementById( "intro" ).addEventListener( "click", function { window.Clearvoice.fillMessage( 0 ); }, false ); document.getElementById( "chatbombing" ).addEventListener( "click", function { window.Clearvoice.fillMessage( 1 ); }, false ); document.getElementById( "coppa" ).addEventListener( "click", function { window.Clearvoice.fillMessage( 2 ); }, false ); document.getElementById( "drama" ).addEventListener( "click", function { window.Clearvoice.fillMessage( 3 ); }, false ); document.getElementById( "ask" ).addEventListener( "click", function { window.Clearvoice.fillMessage( 4 ); }, false ); } }(mediaWiki));