Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/ew/ew-webmoney.html |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | <div id="donate-body" style="padding: 0 1em;"> |
44 | 44 | <form method="post" name="paypalcontribution"> |
45 | 45 | |
46 | | - <div id="step1header"><h3>%donate_interface-amount-legend% <span id="selected-amount"></span> </div> |
| 46 | + <div id="step1header"><h3>%donate_interface-amount-legend% <span id="selected-amount"></span></h3></div> |
47 | 47 | |
48 | 48 | <div id="step2header"><h3>%donate_interface-cc-form-header-payment% <span class="mute" id="change-billing" style="display: none;">(<a href="#">%donate_interface-change%</a>)</span></h3></div> |
49 | 49 | <div id="step2wrapper"> |
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects.js |
— | — | @@ -101,6 +101,13 @@ |
102 | 102 | } |
103 | 103 | // Display selected amount |
104 | 104 | window.showAmount = function( e ) { |
105 | | - $( "#selected-amount" ).html( "$" + e.val() + "" ); |
| 105 | + var currency_code = ""; |
| 106 | + if( $( 'input[name="currency_code"]' ).length ){ |
| 107 | + currency_code = $( 'input[name="currency_code"]' ).val(); |
| 108 | + } |
| 109 | + if( $( 'select[name="currency_code"]' ).length ){ |
| 110 | + currency_code = $( 'select[name="currency_code"]' ).val(); |
| 111 | + } |
| 112 | + $( "#selected-amount" ).html( + e.val() + " " + currency_code ); |
106 | 113 | $( "#change-amount" ).show(); |
107 | 114 | } |
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects.bt.js |
— | — | @@ -1,6 +1,9 @@ |
2 | 2 | |
3 | 3 | $( document ).ready( function () { |
4 | 4 | |
| 5 | + $( "#step2header" ).show(); |
| 6 | + $( "#step2wrapper" ).show(); |
| 7 | + |
5 | 8 | // check for RapidHtml errors and display, if any |
6 | 9 | var amountErrorString = "", |
7 | 10 | billingErrorString = "", |
— | — | @@ -51,8 +54,7 @@ |
52 | 55 | if( amount == null || isNaN( amount.val() ) || amount.val() <= 0 ){ |
53 | 56 | // the amount is not set |
54 | 57 | $( "#step1wrapper" ).slideDown(); |
55 | | - $( "#selected-amount" ).html( '(' + $( 'input[name="currency_code"]' ).val() + ')' ); |
56 | | - |
| 58 | +// showAmount( document.getElementByName( 'amount' ) ); |
57 | 59 | } else { |
58 | 60 | showAmount( $( 'input[name="amount"]' ) ); |
59 | 61 | } |
— | — | @@ -89,8 +91,7 @@ |
90 | 92 | $( "#step1wrapper" ).slideDown(); |
91 | 93 | $( "#change-amount" ).hide(); |
92 | 94 | } ); |
93 | | - |
94 | | - |
| 95 | + |
95 | 96 | // If the form is being reloaded, restore the amount |
96 | 97 | var previousAmount = $( 'input[name="amount"]' ).val(); |
97 | 98 | if ( previousAmount && previousAmount > 0 ) { |
— | — | @@ -106,17 +107,10 @@ |
107 | 108 | $( 'input#other-amount' ).val( previousAmount ); |
108 | 109 | } |
109 | 110 | } |
110 | | - |
111 | 111 | showAmount( $( 'input[name="amount"]' ) ); |
112 | | - |
113 | 112 | } ); |
114 | 113 | |
115 | 114 | // set the hidden amount input to the value of the selected element |
116 | 115 | function setAmount( e ) { |
117 | 116 | $( 'input[name="amount"]' ).val( e.val() ); |
118 | 117 | } |
119 | | -// Display selected amount |
120 | | -function showAmount( e ) { |
121 | | - $( "#selected-amount" ).html( + e.val() + " " + $( 'input[name="currency_code"]' ).val() ); |
122 | | - $( "#change-amount" ).show(); |
123 | | -} |
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects2nd.js |
— | — | @@ -150,8 +150,15 @@ |
151 | 151 | $( 'input[name="amount"]' ).val( e.val() ); |
152 | 152 | } |
153 | 153 | // Display selected amount |
154 | | -function showAmount( e ) { |
155 | | - $( "#selected-amount" ).html( + e.val() + " " + $( 'input[name="currency_code"]' ).val() ); |
| 154 | +window.showAmount = function( e ) { |
| 155 | + var currency_code = ""; |
| 156 | + if( $( 'input[name="currency_code"]' ).length ){ |
| 157 | + currency_code = $( 'input[name="currency_code"]' ).val(); |
| 158 | + } |
| 159 | + if( $( 'select[name="currency_code"]' ).length ){ |
| 160 | + currency_code = $( 'select[name="currency_code"]' ).val(); |
| 161 | + } |
| 162 | + $( "#selected-amount" ).html( + e.val() + " " + currency_code ); |
156 | 163 | $( "#change-amount" ).show(); |
157 | 164 | } |
158 | 165 | |
Index: trunk/extensions/DonationInterface/modules/validate_input.js |
— | — | @@ -56,7 +56,13 @@ |
57 | 57 | error = ( amount == null || isNaN( amount ) || amount.value <= 0 ); |
58 | 58 | |
59 | 59 | // Check amount is at least the minimum |
60 | | - var currency_code = $( 'input[name="currency_code"]' ).val(); |
| 60 | + var currency_code = ''; |
| 61 | + if( $( 'input[name="currency_code"]' ).length ){ |
| 62 | + currency_code = $( 'input[name="currency_code"]' ).val(); |
| 63 | + } |
| 64 | + if( $( 'select[name="currency_code"]' ).length ){ |
| 65 | + currency_code = $( 'select[name="currency_code"]' ).val(); |
| 66 | + } |
61 | 67 | if ( typeof( wgCurrencyMinimums[currency_code] ) == 'undefined' ) { |
62 | 68 | wgCurrencyMinimums[currency_code] = 1; |
63 | 69 | } |