r103077 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103076‎ | r103077 | r103078 >
Date:23:40, 14 November 2011
Author:kaldari
Status:ok
Tags:
Comment:
foolproof amount setting
Modified paths:
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects.bt.js (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects2nd-US.js (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects2nd.js (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects_2_3step.js (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects_2_3step.js
@@ -158,10 +158,18 @@
159159 } );
160160 // reset the amount field when "other" is changed
161161 $( "#other-amount" ).keyup( function() {
162 - if ( $( '#input_amount_other' ).is(':checked') ) {
 162+ if ( $( '#input_amount_other' ).is( ':checked' ) ) {
163163 setAmount( $( this ) );
164164 }
165165 } );
 166+ // change the amount when "other" is focused
 167+ $( "#other-amount" ).focus( function() {
 168+ $( '#input_amount_other' ).attr( 'checked', true );
 169+ var otherAmount = $( 'input#other-amount' ).val();
 170+ if ( otherAmount && !isNaN( otherAmount ) ) {
 171+ setAmount( $( 'input#other-amount' ) );
 172+ }
 173+ } );
166174
167175 // show the CVV help image on click
168176 $( "#where" ).click( function() {
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects.bt.js
@@ -72,10 +72,18 @@
7373 } );
7474 // reset the amount field when "other" is changed
7575 $( "#other-amount" ).keyup( function() {
76 - if ( $( '#input_amount_other' ).is(':checked') ) {
 76+ if ( $( '#input_amount_other' ).is( ':checked' ) ) {
7777 setAmount( $( this ) );
7878 }
7979 } );
 80+ // change the amount when "other" is focused
 81+ $( "#other-amount" ).focus( function() {
 82+ $( '#input_amount_other' ).attr( 'checked', true );
 83+ var otherAmount = $( 'input#other-amount' ).val();
 84+ if ( otherAmount && !isNaN( otherAmount ) ) {
 85+ setAmount( $( 'input#other-amount' ) );
 86+ }
 87+ } );
8088
8189 $( "#step1header" ).click( function() {
8290 $( "#step1wrapper" ).slideDown();
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects2nd.js
@@ -106,10 +106,18 @@
107107 } );
108108 // reset the amount field when "other" is changed
109109 $( "#other-amount" ).keyup( function() {
110 - if ( $( '#input_amount_other' ).is(':checked') ) {
 110+ if ( $( '#input_amount_other' ).is( ':checked' ) ) {
111111 setAmount( $( this ) );
112112 }
113113 } );
 114+ // change the amount when "other" is focused
 115+ $( "#other-amount" ).focus( function() {
 116+ $( '#input_amount_other' ).attr( 'checked', true );
 117+ var otherAmount = $( 'input#other-amount' ).val();
 118+ if ( otherAmount && !isNaN( otherAmount ) ) {
 119+ setAmount( $( 'input#other-amount' ) );
 120+ }
 121+ } );
114122
115123 $( "#step1header" ).click( function() {
116124 // show the correct sections
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects2nd-US.js
@@ -98,10 +98,18 @@
9999 } );
100100 // reset the amount field when "other" is changed
101101 $( "#other-amount" ).keyup( function() {
102 - if ( $( '#input_amount_other' ).is(':checked') ) {
 102+ if ( $( '#input_amount_other' ).is( ':checked' ) ) {
103103 setAmount( $( this ) );
104104 }
105105 } );
 106+ // change the amount when "other" is focused
 107+ $( "#other-amount" ).focus( function() {
 108+ $( '#input_amount_other' ).attr( 'checked', true );
 109+ var otherAmount = $( 'input#other-amount' ).val();
 110+ if ( otherAmount && !isNaN( otherAmount ) ) {
 111+ setAmount( $( 'input#other-amount' ) );
 112+ }
 113+ } );
106114
107115 $( "#step1header" ).click( function() {
108116 // show the correct sections

Follow-up revisions

RevisionCommit summaryAuthorDate
r103081MFT r103077awjrichards23:45, 14 November 2011

Status & tagging log