Difference between revisions of "MediaWiki:Common.js"
Jump to navigation
Jump to search
James Hare (talk | contribs) (Code for embedding a particular YouTube video) |
James Hare (talk | contribs) (Never mind) |
||
Line 37: | Line 37: | ||
} |
} |
||
− | /* Embed a YouTube video into Government Outreach and Engagement page */ |
||
− | if ( ( mw.config.get('wgPageName') == 'Government outreach and engagement' ) ) { |
||
− | $('#opendatayoutube').html('<iframe width="420" height="315" src="http://www.youtube.com/embed/UC_ojnFSKSk" frameborder="0" allowfullscreen></iframe>'); |
||
− | } |
||
/* Add a few links to the toolbox */ |
/* Add a few links to the toolbox */ |
Revision as of 04:30, 23 June 2013
/* 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) {
addOnloadHook(customizeSidebarForAnon);
addOnloadHook(customizeTopbarForAnon);
}
/* 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()"><span class="btn btn-large btn-primary btn-membership btn-basic">$10 per year</span></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()"><span class="btn btn-large btn-primary btn-membership btn-bronze">$25 per year</span></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()"><span class="btn btn-large btn-primary btn-membership btn-silver">$50 per year</span></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()"><span class="btn btn-large btn-primary btn-membership btn-gold">$100 per year</span></a></form></div>');
}
/* Add donation buttons */
if ( ( mw.config.get('wgPageName') == 'Donate' ) ) {
var formId = 'donateform';
$('#donatebutton').html('<div class="plainlinks"><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()"><span class="btn btn-large btn-primary btn-donate">$10</span></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()"><span class="btn btn-large btn-primary btn-donate">$25</span></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()"><span class="btn btn-large btn-primary btn-donate">$50</span></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()"><span class="btn btn-large btn-primary btn-donate">$100</span></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()"><span class="btn btn-large btn-primary btn-donate">$200</span></a></form></div>');
}
/* 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' );
});