MediaWiki:ThankYouPage.js: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
No edit summary |
No edit summary |
||
Line 31: | Line 31: | ||
if ( navigator.share ) { |
if ( navigator.share ) { |
||
$('#ty-web-share').click(function() { |
$('#ty-web-share').click(function() { |
||
⚫ | |||
if ( $(this).data('share-lang') ) { |
|||
url += '&uselang=' + $(this).data('share-lang'); |
|||
} |
|||
navigator.share({ |
navigator.share({ |
||
text: $(this).data('share-text'), |
text: $(this).data('share-text'), |
||
url: url |
|||
⚫ | |||
}); |
}); |
||
}); |
}); |
Revision as of 17:25, 19 April 2019
mw.loader.using( 'mediawiki.util', function() {
var paymentMethod = mw.util.getParamValue('payment_method'),
country = mw.util.getParamValue('country');
if ( paymentMethod === 'bt' ) {
document.getElementById('ty-banktransfer').style.display = 'block';
}
if ( paymentMethod === 'bitcoin' ) {
document.getElementById('ty-bitcoin').style.display = 'block';
}
if ( paymentMethod === 'bpay' ) {
document.getElementById('ty-bpay').style.display = 'block';
}
if ( country === 'US' || country === 'CA' ) {
document.getElementById('ty-store').style.display = 'block';
}
});
// Hint to click a share button when icon is clicked
document.getElementsByClassName('ty-share')[0].addEventListener('click', function() {
var primaryClick = this;
primaryClick.classList.add('highlight');
setTimeout(function() {
primaryClick.classList.remove('highlight');
}, 400);
});
if ( navigator.share ) {
$('#ty-web-share').click(function() {
var url = 'https://donate.wikimedia.org/?utm_medium=SocialMedia&utm_campaign=ThankYouPage&utm_source=WebShare';
if ( $(this).data('share-lang') ) {
url += '&uselang=' + $(this).data('share-lang');
}
navigator.share({
text: $(this).data('share-text'),
url: url
});
});
$('#ty-web-share').show();
}