MediaWiki:ChatParty.js

$('head').append('#partyTrigger,#partyMenuButton{margin:0 !important;font-size:16px;cursor:pointer;vertical-align:top;color:silver;display:inline-block;}#partyTrigger{padding:0 10px;}#WikiaPage,#partyMenu{transition:background .5s;-moz-transition:background .5s;-webkit-transition:background .5s;-ms-transition:background .5s;} '); navigator.info = (function {	var N = navigator.appName, ua = navigator.userAgent, tem;	var M = ua.match(/(opera|chrome|safari|firefox|msie)\/?\s*(\.?\d+(\.\d+)*)/i);	if (M && (tem = ua.match(/version\/([\.\d]+)/i))!== null) M[2] = tem[1];	M = M? [M[1], M[2]] : [N, navigator.appVersion, '-?'];	return M; } ); if (navigator.info[0] == "Chrome") { $('#ChatHeader .public').append(' Party Mode'); console.log('ChatParty initialized'); } else if (navigator.info[0] == "MSIE" && navigator.info[1] >= 10) { $('#ChatHeader .public').append(' Party Mode'); console.log('ChatParty initialized'); } else if (navigator.info[0] == "Firefox" && navigator.info[1] >= 5) { $('#ChatHeader .public').append(' Party Mode'); console.log('ChatParty initialized'); } else if (navigator.info[0] == "Safari" && navigator.platform == "Mac" || "iPad" ) { $('#ChatHeader .public').append(' Party Mode'); console.log('ChatParty initialized'); } else { } $('#partyTrigger').toggle(function {	$('.ChatWindow').append('         <div class="light green" style="top: 45%; animation-delay: 7.5s; -moz-animation-delay: 7.5s; -webkit-animation-delay: 7.5s; -ms-animation-delay: 7.5s; background: black; box-shadow: 0 0 80px 40px black;"> <div class="light yellow" style="top: 65%; animation-delay: 0.5s; -moz-animation-delay: 0.5s; -webkit-animation-delay: 0.5s; -ms-animation-delay: 0.5s; background: black; box-shadow: 0 0 80px 40px black;"> <div class="light blue" style="top: 65%; animation-delay: 2.5s; -moz-animation-delay: 2.5s; -webkit-animation-delay: 2.5s; -ms-animation-delay: 2.5s; background: black; box-shadow: 0 0 80px 40px black;"> <div class="light orange" style="top: 65%; animation-delay: 4.5s; -moz-animation-delay: 4.5s; -webkit-animation-delay: 4.5s; -ms-animation-delay: 4.5s; background: black; box-shadow: 0 0 80px 40px black;"> <div class="light red" style="top: 85%; animation-delay: 1.5s; -moz-animation-delay: 1.5s; -webkit-animation-delay: 1.5s; -ms-animation-delay: 1.5s; background: black; box-shadow: 0 0 80px 40px black;"> <div class="light green" style="top: 85%; animation-delay: 3.5s; -moz-animation-delay: 3.5s; -webkit-animation-delay: 3.5s; -ms-animation-delay: 3.5s; background: black; box-shadow: 0 0 80px 40px black;"> <div class="light yellow" style="top: 85%; animation-delay: 5.5s; -moz-animation-delay: 5.5s; -webkit-animation-delay: 5.5s; -ms-animation-delay: 5.5s; background: black; box-shadow: 0 0 80px 40px black;">   <form id="skin" class="group" style="padding: 0 10px; font-size: 14px; margin-top: 5px;"><p style="margin-bottom: -15px; font-weight: bold;">Skin </a>'); skinDarkNexus; if (navigator.info[0] == "MSIE") { $('#partyMode source[type="audio/ogg"]').remove; $('#partyMode audio').append('<source src="' + partyLinkIE1 + '" type="audio/mpeg">'); }	$('#partyMenuButton > span').click(function {		$('#partyMenuButton').toggleClass('active');		$('#partyMenu').toggle; }	); $('#black').click(function {		$('#discoBall').show;		$('.light').css({'background':'black','boxShadow':'0 0 80px 40px black'}); }	); $('#colored').click(function {		$('#discoBall').show;		$('.light.blue').css({'background':'blue','boxShadow':'0 0 80px 40px blue'});		$('.light.orange').css({'background':'orange','boxShadow':'0 0 80px 40px orange'});		$('.light.red').css({'background':'red','boxShadow':'0 0 80px 40px red'});		$('.light.green').css({'background':'green','boxShadow':'0 0 80px 40px green'});		$('.light.yellow').css({'background':'yellow','boxShadow':'0 0 80px 40px yellow'}); }	); $('#off').click(function {		$('#discoBall').hide; }	); $('#partyMenu input').click(function {		$(this).parents('.group').find('span').css('textShadow','none');		$(this).next('span').css('textShadow','0 0 4px black'); }	); $('#option-1').on('click',function {		source = $('#partyMode source').attr('src');		if (navigator.info[0] == "MSIE" && source != partyLinkIE1) {			$('#partyMode audio').remove;			$('#partyMode').append(' <source src="' + partyLinkIE1 + '" type="audio/mpeg"> ');		}		else if (navigator.info[0] == "Firefox" && source != partyLink1) {			$('#partyMode audio').remove;			$('#partyMode').append(' <source src="' + partyLink1 + '" type="audio/ogg"> ');		}		else if (source != partyLink1) {			$('#partyMode source').remove;			$('#partyMode audio').append('<source src="' + partyLink1 + '" type="audio/ogg">');		}		else {		} }	); $('#option-2').on('click',function {		source = $('#partyMode source').attr('src');		if (navigator.info[0] == "MSIE" && source != partyLinkIE2) {			$('#partyMode audio').remove;			$('#partyMode').append(' <source src="' + partyLinkIE2 + '" type="audio/mpeg"> ');		}		else if (navigator.info[0] == "Firefox" && source != partyLink2) {			$('#partyMode audio').remove;			$('#partyMode').append(' <source src="' + partyLink2 + '" type="audio/ogg"> ');		}		else if (source != partyLink2) {			$('#partyMode source').remove;			$('#partyMode audio').append('<source src="' + partyLink2 + '" type="audio/ogg">');		}		else {		} }	); $('#option-3').on('click',function {		source = $('#partyMode source').attr('src');		if (navigator.info[0] == "MSIE" && source != partyLinkIE3) {			$('#partyMode audio').remove;			$('#partyMode').append(' <source src="' + partyLinkIE3 + '" type="audio/mpeg"> ');		}		else if (navigator.info[0] == "Firefox" && source != partyLink3) {			$('#partyMode audio').remove;			$('#partyMode').append(' <source src="' + partyLink3 + '" type="audio/ogg"> ');		}		else if (source != partyLink3) {			$('#partyMode source').remove;			$('#partyMode audio').append('<source src="' + partyLink3 + '" type="audio/ogg">');		}		else {		} }	); $('#option-4:not(:checked)').on('click',function {		$('#partyMode audio').remove;		if (navigator.info[0] == "MSIE" || navigator.info[0] == "Firefox") {		}		else {			$('#partyMode').append(' ');		} }	); $('#skinDarkNexus').click(function {		$('#style style').remove;		skinDarkNexus; }	); $('#skinDerpCrew').click(function {		$('#style style').remove;		$('#style').append('<style type="text/css">.ChatWindow{background-color:black !important;background-image:url(http://images.wikia.com/newzcsftest/images/c/cf/Derp_Crew_unite.png) !important;}#ChatHeader,.ChatWindow #WikiaPage,.ChatWindow #Write,.ChatWindow #UserStatsMenu,.ChatWindow #UserStatsMenu .info,#partyMenu{background-color:rgba(89,44,1,.7) !important;}.ChatHeader:hover,.ChatWindow #Write:hover,.ChatWindow #UserStatsMenu:hover,#partyMenu:hover{background-color:rgba(89,44,1,.9) !important;}.ChatWindow .Write::after{background:rgba(89,44,1,.7);}.ChatWindow .Rail{border-left:1px solid rgba(89,44,1,.7) !important;} '); }	); $('#skinTed10').click(function {		$('#style style').remove;		$('#style').append('<style type="text/css">.ChatWindow{background-color:black !important;background-image:url(http://images.wikia.com/zcrushersstrikeforce/images/d/d2/Jay_3.png) !important;}#ChatHeader,.ChatWindow #WikiaPage,.ChatWindow #Write,.ChatWindow #UserStatsMenu,.ChatWindow #UserStatsMenu .info,#partyMenu{background-color:rgba(46,89,1,.7) !important;}.ChatHeader:hover,.ChatWindow #Write:hover,.ChatWindow #UserStatsMenu:hover,#partyMenu:hover{background-color:rgba(46,89,1,.9) !important;}.ChatWindow .Write::after{background:rgba(46,89,1,.7);}.ChatWindow .Rail{border-left:1px solid rgba(46,89,1,.7) !important;} '); }	); $('#skinLTFlirtCentral').click(function {		$('#style style').remove;		$('#style').append('<style type="text/css">.ChatWindow{background-color:black !important;background-image:url(http://art.ngfiles.com/images/172/nonn3rs_fionna-and-marshal-lee-x-s.jpg) !important;}#ChatHeader,.ChatWindow #WikiaPage,.ChatWindow #Write,.ChatWindow #UserStatsMenu,.ChatWindow #UserStatsMenu .info,#partyMenu{background-color:rgba(1,2,89,.7) !important;}.ChatHeader:hover,.ChatWindow #Write:hover,.ChatWindow #UserStatsMenu:hover,#partyMenu:hover{background-color:rgba(1,2,89,.9) !important;}.ChatWindow .Write::after{background:rgba(1,2,89,.7);}.ChatWindow .Rail{border-left:1px solid rgba(1,2,89,.7) !important;} '); }	); $('#skinGotenAndTrunks').click(function {		$('#style style').remove;		$('#style').append('<style type="text/css">.ChatWindow{background-color:black !important;background-image:url(http://images4.fanpop.com/image/photos/17800000/Goten-and-Trunks-little-goten-17896885-2560-1600.jpg) !important;}#ChatHeader,.ChatWindow #WikiaPage,.ChatWindow #Write,.ChatWindow #UserStatsMenu,.ChatWindow #UserStatsMenu .info,#partyMenu{background-color:rgba(89,1,2,.7) !important;}.ChatHeader:hover,.ChatWindow #Write:hover,.ChatWindow #UserStatsMenu:hover,#partyMenu:hover{background-color:rgba(89,1,2,.9) !important;}.ChatWindow .Write::after{background:rgba(89,1,2,.7);}.ChatWindow .Rail{border-left:1px solid rgba(89,1,2,.7) !important;} '); }	); function skinDarkNexus { $('#style').append('<style type="text/css">.ChatWindow{background-color:black !important;} '); } },	function { $('#partyMode audio').off; $('#partyMode, #partyMenuButton').remove; } );