r102230 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102229‎ | r102230 | r102231 >
Date:02:26, 7 November 2011
Author:kaldari
Status:ok
Tags:
Comment:
follow-up to r102227 - in case amount is set as 0.00 due to defaults, also adding to lightbox forms
Modified paths:
  • /trunk/extensions/DonationInterface/gateway_forms/rapidhtml/js/lightbox1.js (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/lightbox1.js (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects_2_3step.js (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/js/lightbox1.js (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/js/webitects_2_3step.js (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/js/webitects_2_3step.js
@@ -59,7 +59,7 @@
6060
6161 // If the form is being reloaded, restore the amount
6262 var previousAmount = $( 'input[name="amount"]' ).val();
63 - if ( previousAmount ) {
 63+ if ( previousAmount && previousAmount > 0 ) {
6464 var matched = false;
6565 $( 'input[name="amountRadio"]' ).each( function( index ) {
6666 if ( $( this ).val() == previousAmount ) {
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/js/lightbox1.js
@@ -7,6 +7,23 @@
88 modal: true,
99 title: 'Donate by Credit Card'
1010 } );
 11+
 12+ // If the form is being reloaded, restore the amount
 13+ var previousAmount = $( 'input[name="amount"]' ).val();
 14+ if ( previousAmount && previousAmount > 0 ) {
 15+ var matched = false;
 16+ $( 'input[name="amountRadio"]' ).each( function( index ) {
 17+ if ( $( this ).val() == previousAmount ) {
 18+ $( this ).attr( 'checked', true );
 19+ matched = true;
 20+ }
 21+ } );
 22+ if ( !matched ) {
 23+ $( 'input#input_amount_other' ).attr( 'checked', true );
 24+ $( 'input#other-amount' ).val( previousAmount );
 25+ }
 26+ }
 27+
1128 $( '#cc' ).click( function() {
1229 if ( validateAmount( document.paypalcontribution ) ) {
1330 $( '#dialog' ).dialog( 'open' );
Index: trunk/extensions/DonationInterface/gateway_forms/rapidhtml/js/lightbox1.js
@@ -7,6 +7,23 @@
88 modal: true,
99 title: 'Donate by Credit Card'
1010 } );
 11+
 12+ // If the form is being reloaded, restore the amount
 13+ var previousAmount = $( 'input[name="amount"]' ).val();
 14+ if ( previousAmount && previousAmount > 0 ) {
 15+ var matched = false;
 16+ $( 'input[name="amountRadio"]' ).each( function( index ) {
 17+ if ( $( this ).val() == previousAmount ) {
 18+ $( this ).attr( 'checked', true );
 19+ matched = true;
 20+ }
 21+ } );
 22+ if ( !matched ) {
 23+ $( 'input#input_amount_other' ).attr( 'checked', true );
 24+ $( 'input#other-amount' ).val( previousAmount );
 25+ }
 26+ }
 27+
1128 $( '#cc' ).click( function() {
1229 if ( validateAmount( document.paypalcontribution ) ) {
1330 $( '#dialog' ).dialog( 'open' );
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects_2_3step.js
@@ -59,7 +59,7 @@
6060
6161 // If the form is being reloaded, restore the amount
6262 var previousAmount = $( 'input[name="amount"]' ).val();
63 - if ( previousAmount ) {
 63+ if ( previousAmount && previousAmount > 0 ) {
6464 var matched = false;
6565 $( 'input[name="amountRadio"]' ).each( function( index ) {
6666 if ( $( this ).val() == previousAmount ) {
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/lightbox1.js
@@ -10,7 +10,7 @@
1111
1212 // If the form is being reloaded, restore the amount
1313 var previousAmount = $( 'input[name="amount"]' ).val();
14 - if ( previousAmount ) {
 14+ if ( previousAmount && previousAmount > 0 ) {
1515 var matched = false;
1616 $( 'input[name="amountRadio"]' ).each( function( index ) {
1717 if ( $( this ).val() == previousAmount ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r102243MFT r102191, r102195, r102196, r102200, r102203, r102213, r102214, r102215, r...awjrichards03:31, 7 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r102227adding amount restoration to webitects formskaldari01:44, 7 November 2011

Status & tagging log