Difference between revisions of "MediaWiki:Common.js"
Jump to navigation
Jump to search
(Testing) |
(Testing) |
||
Line 17: | Line 17: | ||
function customizeTopbarForAnon() { |
function customizeTopbarForAnon() { |
||
− | mw.util.addPortletLink( 'p-personal', '//wikimediadc.org/wiki/Membership', 'Become a member', ' |
+ | mw.util.addPortletLink( 'p-personal', '//wikimediadc.org/wiki/Membership', 'Become a member', 'pt-join', 'Join Wikimedia DC now!', 'j', '#pt-createaccount' ); |
} |
} |
||
Revision as of 02:11, 28 March 2013
/* sidebar 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', '//wikimediadc.org/wiki/Membership', 'Become a member', 'pt-join', 'Join Wikimedia DC now!', 'j', '#pt-createaccount' );
}
if (wgUserName == null) {
addOnloadHook(customizeSidebarForAnon);
addOnloadHook(customizeTopbarForAnon);
}
/* add membership payment button */
if ( ( mw.config.get('wgPageName') == 'Membership' ) && ( wgNamespaceNumber == 0 ) ) {
$('#membershipbutton').html('<form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="R9RT2GWXZZWXL"><table><tr><td><input type="hidden" name="on0" value="Donation Options"></td></tr><tr><td><select name="os0"><option value="Regular Membership">Regular Membership : $10.00 USD - yearly</option><option value="Bronze Sponsor">Bronze Sponsor : $25.00 USD - yearly</option><option value="Silver Sponsor">Silver Sponsor : $50.00 USD - yearly</option><option value="Gold Sponsor">Gold Sponsor : $100.00 USD - yearly</option></select></td></tr></table><input type="hidden" name="currency_code" value="USD"><input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"></form>');
}
/* add donate button */
if ( ( mw.config.get('wgPageName') == 'Donate' ) && ( wgNamespaceNumber == 0 ) ) {
$('#donatebutton').html('<form action="https://www.paypal.com/cgi-bin/webscr" method="post"><input type="hidden" name="cmd" value="_s-xclick"><input type="hidden" name="hosted_button_id" value="PSCZL9L3NKNRQ"><input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"><img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1"></form>');
}
/* add special:recentchanges to toolbox */
addOnloadHook(function() {
mw.util.addPortletLink( 'p-tb', '//wikimediadc.org/wiki/Internal:Dashboard', 'Dashboard', 't-dashboard', 'Dashboard ', 'r', '#t-whatlinkshere' );
mw.util.addPortletLink( 'p-tb', '//wikimediadc.org/wiki/Special:Recentchanges', 'Recent changes', 't-recentchanges', 'Recent changes ', 'r', '#t-recentchangeslinked' );
mw.util.addPortletLink( 'p-tb', '//wikimediadc.org/wiki/Special:AllPages', 'All pages', 't-allpages', 'All pages ', 'p', '#t-recentchanges' );
});