r103239 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103238‎ | r103239 | r103240 >
Date:22:07, 15 November 2011
Author:kaldari
Status:ok
Tags:
Comment:
RapidHTML TwoStepTwoColumnLetter3 stuff
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/html/TwoStepTwoColumnLetter3-legal.html (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/js/TwoStepTwoColumnLetter3.js (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/html/TwoStepTwoColumnLetter3-legal.html
@@ -1,11 +1,11 @@
22 <script type="text/javascript">
33 mw.loader.load('pfp.form.rapidhtml.TwoStepTwoColumnLetter3');
44 // these must go through RapidHTML and thus are inline
5 -// var amountErrors = ['#general|escape','#retryMsg|escape','#amount|escape'];
6 -// var billingErrors = ['#fname|escape','#lname|escape','#city|escape','#country|escape','#street|escape','#state|escape','#zip|escape','#emailAdd|escape'];
7 -// var paymentErrors = ['#card_num|escape','#card_type|escape','#cvv|escape'];
8 -// var actionURL = "@action";
9 -// var scriptPath = "@script_path";
 5+ var amountErrors = ['#general|escape','#retryMsg|escape','#amount|escape'];
 6+ var billingErrors = ['#fname|escape','#lname|escape','#city|escape','#country|escape','#street|escape','#state|escape','#zip|escape','#emailAdd|escape'];
 7+ var paymentErrors = ['#card_num|escape','#card_type|escape','#cvv|escape'];
 8+ var actionURL = "@action";
 9+ var scriptPath = "@script_path";
1010 </script>
1111
1212 <table width="100%" cellspacing="0" cellpadding="0" border="0">
@@ -21,6 +21,7 @@
2222 <p id="noscript-msg">It appears that you do not have JavaScript enabled, or your browser does not support it. In order to provide a safe, secure and pleasant experience, our donation form requires JavaScript.</p><p id="noscript-redirect-msg">If you cannot or do not wish to enable JavaScript, you may still contribute by visiting:</p><p id="noscript-redirect-link"><a href="http://wikimediafoundation.org/wiki/DonateNonJS/en">http://wikimediafoundation.org/wiki/DonateNonJS/en</a></p>
2323 </div>
2424 </noscript>
 25+
2526 <h2 id="donate-head">Please complete your donation below ...</h2>
2627
2728 <p id="topError" class="creditcard-error-msg"></p>
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/js/TwoStepTwoColumnLetter3.js
@@ -41,12 +41,14 @@
4242 }
4343
4444 $( "#ccSubmitButton" ).click( function() {
45 - // Safety check for people who hit the back button
46 - checkedValue = $( "input[name='amountRadio']:checked" ).val();
47 - currenctAmount = $( 'input[name="amount"]' ).val();
48 - // The currenctAmount could be set to empty string or '0.00'
49 - if ( ( currentAmount == '0.00' || currentAmount == '' ) && checkedValue && !isNaN( checkedValue ) ) {
50 - $( 'input[name="amount"]' ).val( checkedValue );
 45+ // Safety check for people who hit the back button on forms with amount radio buttons
 46+ if ( $( "input[name='amountRadio']" ).length {
 47+ checkedValue = $( "input[name='amountRadio']:checked" ).val();
 48+ currentAmount = $( 'input[name="amount"]' ).val();
 49+ // The currenctAmount could be set to empty string or '0.00'
 50+ if ( ( currentAmount == '0.00' || currentAmount == '' ) && checkedValue && !isNaN( checkedValue ) ) {
 51+ $( 'input[name="amount"]' ).val( checkedValue );
 52+ }
5153 }
5254 if ( validateAmount() ) {
5355 if ( validate_form() ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r103263MFT r103080, r103130, r103219, r103223, r103229, r103235, r103237, r103238, r...awjrichards23:43, 15 November 2011

Status & tagging log