Difference between revisions of "MediaWiki:Common.js"

From Wikimedia District of Columbia
Jump to navigation Jump to search
(Undo revision 9788 by James Hare (talk))
(making donate button slightly longer)
(38 intermediate revisions by 2 users not shown)
Line 21: Line 21:
   
 
if (wgUserName == null) {
 
if (wgUserName == null) {
addOnloadHook(customizeSidebarForAnon);
+
$(customizeSidebarForAnon);
addOnloadHook(customizeTopbarForAnon);
+
$(customizeTopbarForAnon);
 
}
 
}
   
 
/* Add membership payment buttons */
 
/* Add membership payment buttons */
if ( ( mw.config.get('wgPageName') == 'Membership' ) ) {
 
var formId = 'membership';
 
$('#membershipbutton').html('<div class="plainlinks"><form id="membership10" 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"><a href="#" onclick="document.getElementById(formId + 10).submit()"><div class="arrowbutton-green" style="background:#0f5733; color:#ffffff; font-size:175%; width:200px; padding-top:0.3em; padding-bottom:0.3em; padding-left:0.5em; padding-right:0.5em; line-height:1.5em; margin-bottom:0.5em;">⇒&nbsp;$10 per year</div></a></form><form id="membership25" 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"><a href="#" onclick="document.getElementById(formId + 25).submit()"><div class="arrowbutton-green" style="background:#CB7D2B; color:#ffffff; font-size:175%; width:200px; padding-top:0.3em; padding-bottom:0.3em; padding-left:0.5em; padding-right:0.5em; line-height:1.5em; margin-bottom:0.5em;">⇒&nbsp;$25 per year</div></a></form><form id="membership50" 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"><a href="#" onclick="document.getElementById(formId + 50).submit()"><div class="arrowbutton-green" style="background:#939191; color:#ffffff; font-size:175%; width:200px; padding-top:0.3em; padding-bottom:0.3em; padding-left:0.5em; padding-right:0.5em; line-height:1.5em; margin-bottom:0.5em;">⇒&nbsp;$50 per year</div></a></form><form id="membership100" 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"><a href="#" onclick="document.getElementById(formId + 100).submit()"><div class="arrowbutton-green" style="background:#E5B921; color:#ffffff; font-size:175%; width:200px; padding-top:0.3em; padding-bottom:0.3em; padding-left:0.5em; padding-right:0.5em; line-height:1.5em;">⇒&nbsp;$100 per year</div></a></form></div>');
 
}
 
   
  +
var monthlyId = 'monthlyform';
/* Add donation buttons */
 
var formId = 'donateform';
+
var annuallyId = 'annuallyform';
   
$('#donatebutton').html('<div class="plainlinks"> <form id="donateform5" 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="FG88LU479HZ7J"><a href="#" onclick="document.getElementById(formId + 5).submit()"><div class="arrowbutton-blue roundbutton" style="background:#4f79a2; font-size:30px; line-height:1.75em;">$5</div></a></form><form id="donateform10" 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="S7YX2BAZDVSAE"><a href="#" onclick="document.getElementById(formId + 10).submit()"><div class="arrowbutton-blue roundbutton" style="background:#4f79a2; font-size:30px; line-height:1.75em;">$10</div></a></form><form id="donateform25" 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="J3RV9PVMSRH8Y"><a href="#" onclick="document.getElementById(formId + 25).submit()"><div class="arrowbutton-blue roundbutton" style="background:#4f79a2; font-size:30px; line-height:1.75em;">$25</div></a></form><form id="donateform50" 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="3E66M99JDV836"><a href="#" onclick="document.getElementById(formId + 50).submit()"><div class="arrowbutton-blue roundbutton" style="background:#4f79a2; font-size:30px; line-height:1.75em;">$50</div></a></form><form id="donateform100" 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="GNEQ7GUKNF9BS"><a href="#" onclick="document.getElementById(formId + 100).submit()"><div class="arrowbutton-blue roundbutton" style="background:#4f79a2; font-size:25px; line-height:2em;">$100</div></a></form><form id="donateform200" 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="BU3YMWQSVJ9HW"><a href="#" onclick="document.getElementById(formId + 200).submit()"><div class="arrowbutton-blue roundbutton" style="background:#4f79a2; font-size:25px; line-height:2em;">$200</div></a></form></div>');
+
$('#memberbutton-monthly').html('<div class="plainlinks"><form id="monthlyform5" 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="9MHQE5FETJYFW"><a href="#" onclick="document.getElementById(monthlyId + 5).submit()"><div class="arrowbutton-green roundbutton-large" style="font-size:38px; line-height:1.75em;">$5</div></a></form><form id="monthlyform10" 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="ZJQJ5SPKDFQTY"><a href="#" onclick="document.getElementById(monthlyId + 10).submit()"><div class="arrowbutton-green roundbutton-large" style="font-size:38px; line-height:1.75em;">$10</div></a></form><form id="monthlyform25" 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="5XSU2JHD29WA6"><a href="#" onclick="document.getElementById(monthlyId + 25).submit()"><div class="arrowbutton-green roundbutton-large" style="font-size:38px; line-height:1.75em;">$25</div></a></form><form id="monthlyform50" 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="B7ETK3LZRACLQ"><a href="#" onclick="document.getElementById(monthlyId + 50).submit()"><div class="arrowbutton-green roundbutton-large" style="font-size:38px; line-height:1.75em;">$50</div></a></form><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"><a href="#" onclick="document.getElementById(monthlyId + 100).submit()"><div class="arrowbutton-gold roundbutton-large" style="font-size:31px; line-height:2.3em;">$100</div></a></form><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"><a href="#" onclick="document.getElementById(monthlyId + 200).submit()"><div class="arrowbutton-gold roundbutton-large" style="font-size:31px; line-height:2.3em;">$200</div></a></form></div>');
   
 
$('#memberbutton-annually').html('<div class="plainlinks"><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"><a href="#" onclick="document.getElementById(annuallyId + 5).submit()"><div class="arrowbutton-blue roundbutton" style="font-size:30px; line-height:1.75em;">$5</div></a></form><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"><a href="#" onclick="document.getElementById(annuallyId + 10).submit()"><div class="arrowbutton-blue roundbutton" style="font-size:30px; line-height:1.75em;">$10</div></a></form><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"><a href="#" onclick="document.getElementById(annuallyId + 25).submit()"><div class="arrowbutton-blue roundbutton" style="font-size:30px; line-height:1.75em;">$25</div></a></form><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"><a href="#" onclick="document.getElementById(annuallyId + 50).submit()"><div class="arrowbutton-blue roundbutton" style="font-size:30px; line-height:1.75em;">$50</div></a></form><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"><a href="#" onclick="document.getElementById(annuallyId + 100).submit()"><div class="arrowbutton-blue roundbutton" style="font-size:25px; line-height:2.1em;">$100</div></a></form><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"><a href="#" onclick="document.getElementById(annuallyId + 200).submit()"><div class="arrowbutton-blue roundbutton" style="font-size:25px; line-height:2.1em;">$200</div></a></form></div>');
var dwYesMember = "member";
 
   
var dwNoMember = "donation";
+
/* Add donation buttons */
 
var dwYesMember = 'member';
  +
var dwNoMember = 'donation';
   
var dwPartOne = "<div class='plainlinks'><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 dwPartOne = '<div class="plainlinks"><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 = '"><a href="#" onclick="document.getElementById(dwYesMember).submit()"><div class="arrowbutton arrowbutton-green" style="font-size:115%; width:300px; margin-bottom:0.5em;"><span style="font-weight:bold;">Yes</span>, sign me up as a member!</div></a></form><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 dwPartTwo = "'><a href='#' onclick='document.getElementById('";
 
   
var dwPartThree = "').submit()'><div class='arrowbutton arrowbutton-green' style='font-size:115%; width:300px; margin-bottom:0.5em;'><span style='font-weight:bold;'>⇒&nbsp;Yes</span>, sign me up as a member!</div></a></form><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 = '"><a href="#" onclick="document.getElementById(dwNoMember).submit()"><div class="arrowbutton arrowbutton-blue" style="font-size:115%; width:190px; margin-bottom:0.5em;"><span style="font-weight:bold;"></span>Just the donation</div></a></form></div>';
   
 
$('#dw-5m').html(dwPartOne + '9MHQE5FETJYFW' + dwPartTwo + 'VHB9L9U8THY9A' + dwPartThree);
var dwPartFour = "'><a href='#' onclick='document.getElementById('";
 
 
$('#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 dwPartFive = "').submit()'><div class='arrowbutton arrowbutton-blue' style='font-size:115%; width:180px; margin-bottom:0.5em;'><span style='font-weight:bold;'>⇒&nbsp;</span>Just the donation</div></a></form></div>'";
 
  +
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; }</style><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%;"><!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups--><div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_f329c96f3ad7841331cbffd9f_0fc61a72a9" tabindex="-1" value=""></div><div class="clear"><input type="submit" value="⇒ Subscribe" name="subscribe" id="mc-embedded-subscribe" class="arrowbutton arrowbutton-green" style="font-size:115%; width:125px;"></div></div></form></div>');
$("#dw-5m").html(dwPartOne + "9MHQE5FETJYFW" + dwPartTwo + dwYesMember + dwPartThree + "VHB9L9U8THY9A" + dwPartFour + dwNoMember + dwPartFive);
 
$("#dw-10m").html(dwPartOne + "ZJQJ5SPKDFQTY" + dwPartTwo + dwYesMember + dwPartThree + "ELPHVEA56BGBA" + dwPartFour + dwNoMember + dwPartFive);
 
$("#dw-25m").html(dwPartOne + "9MHQE5FETJYFW" + dwPartTwo + dwYesMember + dwPartThree + "VHB9L9U8THY9A" + dwPartFour + dwNoMember + dwPartFive);
 
$("#dw-50m").html(dwPartOne + "B7ETK3LZRACLQ" + dwPartTwo + dwYesMember + dwPartThree + "PR7VLZVEEX8CA" + dwPartFour + dwNoMember + dwPartFive);
 
$("#dw-100m").html(dwPartOne + "B9F73YWFQBYXA" + dwPartTwo + dwYesMember + dwPartThree + "WDJKYZF7XPRUL" + dwPartFour + dwNoMember + dwPartFive);
 
$("#dw-200m").html(dwPartOne + "4E42KFD7MCNJ4" + dwPartTwo + dwYesMember + dwPartThree + "4KL7SURFTFHA4" + dwPartFour + dwNoMember + dwPartFive);
 
$("#dw-5a").html(dwPartOne + "ZAKPCZYTXDRYN" + dwPartTwo + dwYesMember + dwPartThree + "FUHX7TBVKE2BG" + dwPartFour + dwNoMember + dwPartFive);
 
$("#dw-10a").html(dwPartOne + "8T8NESE2DWVX6" + dwPartTwo + dwYesMember + dwPartThree + "UEBVSV6KF9SSE" + dwPartFour + dwNoMember + dwPartFive);
 
$("#dw-25a").html(dwPartOne + "GSH4BLP9UTP6Q" + dwPartTwo + dwYesMember + dwPartThree + "A922FAUXLDQSN" + dwPartFour + dwNoMember + dwPartFive);
 
$("#dw-50a").html(dwPartOne + "BUJSW3H45AJY8" + dwPartTwo + dwYesMember + dwPartThree + "MPXGN9SKV7HVY" + dwPartFour + dwNoMember + dwPartFive);
 
$("#dw-100a").html(dwPartOne + "DWBBFHL3JKGPC" + dwPartTwo + dwYesMember + dwPartThree + "SLSKUBGGA63C8" + dwPartFour + dwNoMember + dwPartFive);
 
$("#dw-200a").html(dwPartOne + "CPVX2SG6GSXNL" + dwPartTwo + dwYesMember + dwPartThree + "X4HUYHNVHN8M2" + dwPartFour + dwNoMember + dwPartFive);
 
   
/* Add mailing list signup form */
+
/* Add embedded chat */
  +
$('#eventchat').html('<div id="rt-e8370f98c4dbfd6ee093107c010e5dcf"></div><script language="JavaScript" type="text/javascript" src="//www.rumbletalk.com/client/?L3aL2eqy"></script>');
$('#mailinglistsignup').html('<FORM Method=POST ACTION="https://lists.wikimedia.org/mailman/subscribe/wikimedia-dc"><input type="Text" name="email" value="" style="display:block; width: 15em; font-size:110%; margin-bottom:0.7em;" placeholder="Email address"><input type="Text" name="fullname" value="" style="display:block; width: 15em; font-size:110%; margin-bottom:0.7em;" placeholder="Name (optional)"><p>Which language do you prefer to display your messages?<br /><Select name="language"> <option value="ar"> Arabic </option> <option value="ca"> Catalan </option> <option value="zh_CN"> Chinese (China) </option> <option value="zh_TW"> Chinese (Taiwan) </option> <option value="hr"> Croatian </option> <option value="cs"> Czech </option> <option value="da"> Danish </option> <option value="nl"> Dutch </option> <option value="en" Selected> English (USA) </option> <option value="et"> Estonian </option> <option value="eu"> Euskara </option> <option value="fi"> Finnish </option> <option value="fr"> French </option> <option value="de"> German </option> <option value="hu"> Hungarian </option> <option value="ia"> Interlingua </option> <option value="it"> Italian </option> <option value="ja"> Japanese </option> <option value="ko"> Korean </option> <option value="lt"> Lithuanian </option> <option value="no"> Norwegian </option> <option value="pl"> Polish </option> <option value="pt"> Portuguese </option> <option value="pt_BR"> Portuguese (Brazil) </option> <option value="ro"> Romanian </option> <option value="ru"> Russian </option> <option value="sr"> Serbian </option> <option value="sl"> Slovenian </option> <option value="es"> Spanish (Spain) </option> <option value="sv"> Swedish </option> <option value="tr"> Turkish </option> <option value="uk"> Ukrainian </option> <option value="vi"> Vietnamese </option></Select></p><p>Would you like to receive messages batched in a daily digest?<br /><input type=radio name="digest" value="0" CHECKED> No <input type=radio name="digest" value="1"> Yes </p><p>You will be sent an email to confirm your subscription.</p><input type="submit" name="email-button" value="→&nbsp;Subscribe" class="arrowbutton-green" style="background:#0f5733; color:#ffffff; font-size:125%; border:0; font-family:&#39;Helvetica Neue&#39;, &#39;Lucida Grande&#39;, Tahoma, Verdana, sans-serif; padding-top:0.3em; padding-bottom:0.3em; padding-left:0.5em; padding-right:0.5em;" /></FORM>');
 
   
   
 
/* Add a few links to the toolbox */
 
/* Add a few links to the toolbox */
addOnloadHook(function() {
+
$(function() {
 
mw.util.addPortletLink( 'p-tb', '/wiki/Internal:Dashboard', 'Dashboard', 't-dashboard', 'Dashboard ', 'r', '#t-whatlinkshere' );
 
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' );
 
mw.util.addPortletLink( 'p-tb', '/wiki/Special:RecentChanges', 'Recent changes', 't-recentchanges', 'Recent changes ', 'r', '#t-recentchangeslinked' );
mw.util.addPortletLink( 'p-tb', '/wiki/Special:AllPages', 'All pages', 't-allpages', 'All pages ', 'p', '#t-recentchanges' );
 
 
$( '#megaheader img' ).css( 'opacity', 1 ); /* Thank you Jack Phoenix! */
 
$( '#megaheader img' ).css( 'opacity', 1 ); /* Thank you Jack Phoenix! */
 
});
 
});

Revision as of 18:26, 15 July 2017

/* 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('<div class="plainlinks"><form id="monthlyform5" 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="9MHQE5FETJYFW"><a href="#" onclick="document.getElementById(monthlyId + 5).submit()"><div class="arrowbutton-green roundbutton-large" style="font-size:38px; line-height:1.75em;">$5</div></a></form><form id="monthlyform10" 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="ZJQJ5SPKDFQTY"><a href="#" onclick="document.getElementById(monthlyId + 10).submit()"><div class="arrowbutton-green roundbutton-large" style="font-size:38px; line-height:1.75em;">$10</div></a></form><form id="monthlyform25" 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="5XSU2JHD29WA6"><a href="#" onclick="document.getElementById(monthlyId + 25).submit()"><div class="arrowbutton-green roundbutton-large" style="font-size:38px; line-height:1.75em;">$25</div></a></form><form id="monthlyform50" 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="B7ETK3LZRACLQ"><a href="#" onclick="document.getElementById(monthlyId + 50).submit()"><div class="arrowbutton-green roundbutton-large" style="font-size:38px; line-height:1.75em;">$50</div></a></form><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"><a href="#" onclick="document.getElementById(monthlyId + 100).submit()"><div class="arrowbutton-gold roundbutton-large" style="font-size:31px; line-height:2.3em;">$100</div></a></form><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"><a href="#" onclick="document.getElementById(monthlyId + 200).submit()"><div class="arrowbutton-gold roundbutton-large" style="font-size:31px; line-height:2.3em;">$200</div></a></form></div>');

$('#memberbutton-annually').html('<div class="plainlinks"><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"><a href="#" onclick="document.getElementById(annuallyId + 5).submit()"><div class="arrowbutton-blue roundbutton" style="font-size:30px; line-height:1.75em;">$5</div></a></form><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"><a href="#" onclick="document.getElementById(annuallyId + 10).submit()"><div class="arrowbutton-blue roundbutton" style="font-size:30px; line-height:1.75em;">$10</div></a></form><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"><a href="#" onclick="document.getElementById(annuallyId + 25).submit()"><div class="arrowbutton-blue roundbutton" style="font-size:30px; line-height:1.75em;">$25</div></a></form><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"><a href="#" onclick="document.getElementById(annuallyId + 50).submit()"><div class="arrowbutton-blue roundbutton" style="font-size:30px; line-height:1.75em;">$50</div></a></form><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"><a href="#" onclick="document.getElementById(annuallyId + 100).submit()"><div class="arrowbutton-blue roundbutton" style="font-size:25px; line-height:2.1em;">$100</div></a></form><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"><a href="#" onclick="document.getElementById(annuallyId + 200).submit()"><div class="arrowbutton-blue roundbutton" style="font-size:25px; line-height:2.1em;">$200</div></a></form></div>');

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

var dwPartOne = '<div class="plainlinks"><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 = '"><a href="#" onclick="document.getElementById(dwYesMember).submit()"><div class="arrowbutton arrowbutton-green" style="font-size:115%; width:300px; margin-bottom:0.5em;"><span style="font-weight:bold;">Yes</span>, sign me up as a member!</div></a></form><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 = '"><a href="#" onclick="document.getElementById(dwNoMember).submit()"><div class="arrowbutton arrowbutton-blue" style="font-size:115%; width:190px; margin-bottom:0.5em;"><span style="font-weight:bold;"></span>Just the donation</div></a></form></div>';

$('#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; }</style><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%;"><!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups--><div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text" name="b_f329c96f3ad7841331cbffd9f_0fc61a72a9" tabindex="-1" value=""></div><div class="clear"><input type="submit" value="⇒ Subscribe" name="subscribe" id="mc-embedded-subscribe" class="arrowbutton arrowbutton-green" style="font-size:115%; width:125px;"></div></div></form></div>');

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


/* 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! */
});