MediaWiki:ThankYouPage.js: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
move share hints here from Template:Thank You 2018/js |
add web share test |
||
Line 28: | Line 28: | ||
}, 400); |
}, 400); |
||
}); |
}); |
||
if ( navigator.Share ) { |
|||
$('#ty-web-share').click(function() { |
|||
navigator.share({ |
|||
title: 'Test', |
|||
text: 'Testing Web Share API', |
|||
url: 'https://donate.wikimedia.org' |
|||
}); |
|||
}); |
|||
$('#ty-web-share').show(); |
|||
} |
Revision as of 15: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() {
navigator.share({
title: 'Test',
text: 'Testing Web Share API',
url: 'https://donate.wikimedia.org'
});
});
$('#ty-web-share').show();
}