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 New England Wikimedians and help support our mission!', 'j', '#pt-createaccount' ); }

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

/* Add membership payment buttons */ if ( ( mw.config.get('wgPageName') == 'Membership' ) ) { var formId = 'membership'; $('#membershipbutton').html(' ⇒ $10 per year  ⇒ $25 per year  <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;">⇒ $50 per year </a> <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"><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;">⇒ $100 per year </a> '); }

/* Add donation buttons */ if ( ( mw.config.get('wgPageName') == 'Donate' ) ) { var formId = 'donateform'; $('#donatebutton').html(' <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"><span class="arrowbutton-blue" style="background:#13476c; color:#ffffff; font-size:175%; line-height:1.5em; width:100px; padding-top:0.3em; padding-bottom:0.3em; padding-left:0.5em; padding-right:0.5em; margin-right:0.5em;">$10 </a> <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"><span class="arrowbutton-blue" style="background:#13476c; color:#ffffff; font-size:175%; line-height:1.5em; width:100px; padding-top:0.3em; padding-bottom:0.3em; padding-left:0.5em; padding-right:0.5em; margin-right:0.5em;">$25 </a> <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"><span class="arrowbutton-blue" style="background:#13476c; color:#ffffff; font-size:175%; line-height:1.5em; width:100px; padding-top:0.3em; padding-bottom:0.3em; padding-left:0.5em; padding-right:0.5em; margin-right:0.5em;">$50 </a> <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"><span class="arrowbutton-blue" style="background:#13476c; color:#ffffff; font-size:175%; line-height:1.5em; width:100px; padding-top:0.3em; padding-bottom:0.3em; padding-left:0.5em; padding-right:0.5em; margin-right:0.5em;">$100 </a> <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"><span class="arrowbutton-blue" style="background:#13476c; color:#ffffff; font-size:175%; line-height:1.5em; width:100px; padding-top:0.3em; padding-bottom:0.3em; padding-left:0.5em; padding-right:0.5em; margin-right:0.5em;">$200 </a> '); }

/* Add mailing list signup form */ $('#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)"> Which language do you prefer to display your messages? <Select name="language"> Arabic Catalan <option value="zh_CN"> Chinese (China) <option value="zh_TW"> Chinese (Taiwan)  Croatian  Czech  Danish  Dutch <option value="en" Selected> English (USA)  Estonian  Euskara  Finnish  French  German  Hungarian  Interlingua  Italian  Japanese  Korean  Lithuanian  Norwegian  Polish  Portuguese <option value="pt_BR"> Portuguese (Brazil)  Romanian  Russian  Serbian  Slovenian  Spanish (Spain)  Swedish  Turkish  Ukrainian  Vietnamese </Select>  Would you like to receive messages batched in a daily digest? <input type=radio name="digest" value="0" CHECKED> No <input type=radio name="digest" value="1"> Yes You will be sent an email to confirm your subscription. <input type="submit" name="email-button" value="→ 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 */ addOnloadHook(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' );  mw.util.addPortletLink( 'p-tb', '/wiki/Special:AllPages', 'All pages', 't-allpages', 'All pages ', 'p', '#t-recentchanges' ); });