MediaWiki:Common.js

/* Interface modifications for anonymous users */

function removeSidebarSection(section) { try { var target = "p-" + section; var sidebar = document.getElementById("mw-panel"); var element = document.getElementById(target); sidebar.removeChild(element); } catch (e) { return; } }

function customizeSidebarForAnon { removeSidebarSection("tb"); }

function customizeTopbarForAnon { mw.util.addPortletLink( 'p-personal', '/wiki/Membership', 'Join now', 'pt-join', 'Join Wikimedia DC and help support our mission!', 'j', '#pt-createaccount' ); }

if (wgUserName == null) { $(customizeSidebarForAnon); $(customizeTopbarForAnon); }

/* Add membership payment buttons */

var monthlyId = 'monthlyform'; var annuallyId = 'annuallyform';

$('#memberbutton-monthly').html('  $5   $10   $25  <input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="B7ETK3LZRACLQ"> $50 </a> <form id="monthlyform100" style="display:inline;" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="B9F73YWFQBYXA"> $100 </a> <form id="monthlyform200" style="display:inline;" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="4E42KFD7MCNJ4"> $200 </a> ');

$('#memberbutton-annually').html(' <form id="annuallyform5" style="display:inline;" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="ZAKPCZYTXDRYN"> $5 </a> <form id="annuallyform10" style="display:inline;" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="8T8NESE2DWVX6"> $10 </a> <form id="annuallyform25" style="display:inline;" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="GSH4BLP9UTP6Q"> $25 </a> <form id="annuallyform50" style="display:inline;" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="BUJSW3H45AJY8"> $50 </a> <form id="annuallyform100" style="display:inline;" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="DWBBFHL3JKGPC"> $100 </a> <form id="annuallyform200" style="display:inline;" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="CPVX2SG6GSXNL"> $200 </a> ');

/* Add donation buttons */ var dwYesMember = 'member'; var dwNoMember = 'donation';

var dwPartOne = ' <form id="member" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="';

var dwPartTwo = '"> Yes, sign me up as a member! </a> <form id="donation" action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="';

var dwPartThree = '"> Just the donation </a> ';

$('#dw-5m').html(dwPartOne + '9MHQE5FETJYFW' + dwPartTwo + 'VHB9L9U8THY9A' + dwPartThree); $('#dw-10m').html(dwPartOne + 'ZJQJ5SPKDFQTY' + dwPartTwo + 'ELPHVEA56BGBA' + dwPartThree); $('#dw-25m').html(dwPartOne + '5XSU2JHD29WA6' + dwPartTwo + 'Y9PGPAGD2EMP8' + dwPartThree); $('#dw-50m').html(dwPartOne + 'B7ETK3LZRACLQ' + dwPartTwo + 'PR7VLZVEEX8CA' + dwPartThree); $('#dw-100m').html(dwPartOne + 'B9F73YWFQBYXA' + dwPartTwo + 'WDJKYZF7XPRUL' + dwPartThree); $('#dw-200m').html(dwPartOne + '4E42KFD7MCNJ4' + dwPartTwo + '4KL7SURFTFHA4' + dwPartThree); $('#dw-5a').html(dwPartOne + 'ZAKPCZYTXDRYN' + dwPartTwo + 'FUHX7TBVKE2BG' + dwPartThree); $('#dw-10a').html(dwPartOne + '8T8NESE2DWVX6' + dwPartTwo + 'UEBVSV6KF9SSE' + dwPartThree); $('#dw-25a').html(dwPartOne + 'GSH4BLP9UTP6Q' + dwPartTwo + 'A922FAUXLDQSN' + dwPartThree); $('#dw-50a').html(dwPartOne + 'BUJSW3H45AJY8' + dwPartTwo + 'MPXGN9SKV7HVY' + dwPartThree); $('#dw-100a').html(dwPartOne + 'DWBBFHL3JKGPC' + dwPartTwo + 'SLSKUBGGA63C8' + dwPartThree); $('#dw-200a').html(dwPartOne + 'CPVX2SG6GSXNL' + dwPartTwo + 'X4HUYHNVHN8M2' + dwPartThree); $('#dw-5x').html(dwPartOne + 'QLWRD4W5AEYK4' + dwPartTwo + 'FG88LU479HZ7J' + dwPartThree); $('#dw-10x').html(dwPartOne + '8Z4XGBQYJFP2L' + dwPartTwo + 'S7YX2BAZDVSAE' + dwPartThree); $('#dw-25x').html(dwPartOne + '8SDTJWLUAE3TW' + dwPartTwo + 'J3RV9PVMSRH8Y' + dwPartThree); $('#dw-50x').html(dwPartOne + '9C2JUGA7CWZWJ' + dwPartTwo + '3E66M99JDV836' + dwPartThree); $('#dw-100x').html(dwPartOne + '4736NTBYA9SGN' + dwPartTwo + 'GNEQ7GUKNF9BS' + dwPartThree); $('#dw-200x').html(dwPartOne + 'ZUK7NJQSFMBX4' + dwPartTwo + 'BU3YMWQSVJ9HW' + dwPartThree);

/* Add mailing list signup form */ var mailingList = 'mailinglist';

$('#mailinglistsignup').html('<link href="//cdn-images.mailchimp.com/embedcode/slim-081711.css" rel="stylesheet" type="text/css"><style type="text/css">	#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; } <div id="mc_embed_signup"><form action="//wikimediadc.us12.list-manage.com/subscribe/post?u=f329c96f3ad7841331cbffd9f&amp;id=0fc61a72a9" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate style="padding-left:0;"><div id="mc_embed_signup_scroll"><input type="email" value="" name="EMAIL" class="email" id="mce-EMAIL" placeholder="email address" required style="width:98%; height:20px; font-size:115%;"> <input type="text" name="b_f329c96f3ad7841331cbffd9f_0fc61a72a9" tabindex="-1" value=""> <input type="submit" value="⇒ Subscribe" name="subscribe" id="mc-embedded-subscribe" class="arrowbutton arrowbutton-green" style="font-size:115%; width:125px;"> ');

/* Add embedded chat */ $('#eventchat').html(' <script language="JavaScript" type="text/javascript" src="//www.rumbletalk.com/client/?L3aL2eqy"> ');

/* Add a few links to the toolbox */ $(function { mw.util.addPortletLink( 'p-tb', '/wiki/Internal:Dashboard', 'Dashboard', 't-dashboard', 'Dashboard ', 'r', '#t-whatlinkshere' );  mw.util.addPortletLink( 'p-tb', '/wiki/Special:RecentChanges', 'Recent changes', 't-recentchanges', 'Recent changes ', 'r', '#t-recentchangeslinked' );  $( '#megaheader img' ).css( 'opacity', 1 ); /* Thank you Jack Phoenix! */ });