r103983 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103982‎ | r103983 | r103984 >
Date:23:51, 22 November 2011
Author:pgehres
Status:ok
Tags:
Comment:
Fixes for ew-webmoney
Modified paths:
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/ew/ew-webmoney.html (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects.bt.js (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects.js (modified) (history)
  • /trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects2nd.js (modified) (history)
  • /trunk/extensions/DonationInterface/modules/validate_input.js (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/html/ew/ew-webmoney.html
@@ -42,7 +42,7 @@
4343 <div id="donate-body" style="padding: 0 1em;">
4444 <form method="post" name="paypalcontribution">
4545
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>
4747
4848 <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>
4949 <div id="step2wrapper">
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects.js
@@ -101,6 +101,13 @@
102102 }
103103 // Display selected amount
104104 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 );
106113 $( "#change-amount" ).show();
107114 }
Index: trunk/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects.bt.js
@@ -1,6 +1,9 @@
22
33 $( document ).ready( function () {
44
 5+ $( "#step2header" ).show();
 6+ $( "#step2wrapper" ).show();
 7+
58 // check for RapidHtml errors and display, if any
69 var amountErrorString = "",
710 billingErrorString = "",
@@ -51,8 +54,7 @@
5255 if( amount == null || isNaN( amount.val() ) || amount.val() <= 0 ){
5356 // the amount is not set
5457 $( "#step1wrapper" ).slideDown();
55 - $( "#selected-amount" ).html( '(' + $( 'input[name="currency_code"]' ).val() + ')' );
56 -
 58+// showAmount( document.getElementByName( 'amount' ) );
5759 } else {
5860 showAmount( $( 'input[name="amount"]' ) );
5961 }
@@ -89,8 +91,7 @@
9092 $( "#step1wrapper" ).slideDown();
9193 $( "#change-amount" ).hide();
9294 } );
93 -
94 -
 95+
9596 // If the form is being reloaded, restore the amount
9697 var previousAmount = $( 'input[name="amount"]' ).val();
9798 if ( previousAmount && previousAmount > 0 ) {
@@ -106,17 +107,10 @@
107108 $( 'input#other-amount' ).val( previousAmount );
108109 }
109110 }
110 -
111111 showAmount( $( 'input[name="amount"]' ) );
112 -
113112 } );
114113
115114 // set the hidden amount input to the value of the selected element
116115 function setAmount( e ) {
117116 $( 'input[name="amount"]' ).val( e.val() );
118117 }
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 @@
151151 $( 'input[name="amount"]' ).val( e.val() );
152152 }
153153 // 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 );
156163 $( "#change-amount" ).show();
157164 }
158165
Index: trunk/extensions/DonationInterface/modules/validate_input.js
@@ -56,7 +56,13 @@
5757 error = ( amount == null || isNaN( amount ) || amount.value <= 0 );
5858
5959 // 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+ }
6167 if ( typeof( wgCurrencyMinimums[currency_code] ) == 'undefined' ) {
6268 wgCurrencyMinimums[currency_code] = 1;
6369 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r103986MFT r103871, r103960, r103963, r103972, r103983khorn00:08, 23 November 2011
r103987MFT r103871, r103960, r103963, r103972, r103983khorn00:09, 23 November 2011
r103989MFT r103842, r103845, r103854, r103960, r103963, r103971, r103983khorn00:26, 23 November 2011

Status & tagging log