MediaWiki:Common.js: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
add utm parameter handling (from form) |
add form javascrip |
||
Line 280: | Line 280: | ||
$("#input_amount_other_box").val( otherVal ); |
$("#input_amount_other_box").val( otherVal ); |
||
} |
} |
||
/* Form functions */ |
|||
function clearOther(box) { |
|||
document.getElementById("input_amount_other").checked = true; |
|||
box.value = ""; |
|||
box.style.color = "#000000"; |
|||
} |
|||
function resetOther(box) { |
|||
box.value = "</html>{{int:donate_interface-other}}<html>"; |
|||
} |
|||
function selectAmount() { |
|||
$('#input_amount_other_box').val(''); |
|||
$('input[name="amountGiven"]').val(''); |
|||
} |
|||
/* End form functions */ |
|||
Line 308: | Line 325: | ||
if( mw.util.getParamValue('monthly') ) { |
if( mw.util.getParamValue('monthly') ) { |
||
$('#frequency_monthly').click(); |
$('#frequency_monthly').click(); |
||
} |
|||
$(".frequency-options label").click(function() { |
|||
$(".frequency-options label").removeClass("checked"); |
|||
$(this).addClass("checked"); |
|||
}); |
|||
$(".radiobuttons-cell label").click(function() { |
|||
$(".radiobuttons-cell label").removeClass("checked"); |
|||
$(this).addClass("checked"); |
|||
}); |
|||
$(".input_amount_other").click(function() { |
|||
$("#input_amount_other_box").focus(); |
|||
}); |
|||
// hide frequency options in India, where we can only handle one-time donations |
|||
if (document.paypalcontribution.country.value === 'IN') { |
|||
$("#frequency_onetime").attr('checked', true); |
|||
$(".frequency-options").hide(); |
|||
$("#cancel-monthly").hide(); |
|||
} |
} |
||