Awight has uploaded a new change for review.
https://gerrit.wikimedia.org/r/282001
Change subject: Reuse common error display code
......................................................................
Reuse common error display code
This surfaces server errors in the iDEAL forms.
Bug: T92567
Change-Id: Id9ab41f4060be4e592c62ab17abc2f4c7366f0a6
---
M globalcollect_gateway/forms/html/rtbt/rtbt-ideal-noadd.html
M globalcollect_gateway/forms/html/rtbt/rtbt-ideal.html
M globalcollect_gateway/forms/js/webitects2nd.js
3 files changed, 7 insertions(+), 42 deletions(-)
git pull
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface
refs/changes/01/282001/1
diff --git a/globalcollect_gateway/forms/html/rtbt/rtbt-ideal-noadd.html
b/globalcollect_gateway/forms/html/rtbt/rtbt-ideal-noadd.html
index 23217cd..f73d55e 100644
--- a/globalcollect_gateway/forms/html/rtbt/rtbt-ideal-noadd.html
+++ b/globalcollect_gateway/forms/html/rtbt/rtbt-ideal-noadd.html
@@ -40,6 +40,9 @@
<div id="donate">
<div id="donate-content">
<div id="donate-body"
style="padding: 0 1em;">
+ @noscript
+ <p id="topError"
class="errorMsg"></p>
+
<form method="post"
name="paypalcontribution">
<div
id="step1header"><h3>%donate_interface-amount-legend% <span
id="selected-amount"></span> <span class="mute" id="change-amount"
style="display: none;">(<a
href="#">%donate_interface-change%</a>)</span></h3></div>
<div
id="step1wrapper" style="display: none;">
diff --git a/globalcollect_gateway/forms/html/rtbt/rtbt-ideal.html
b/globalcollect_gateway/forms/html/rtbt/rtbt-ideal.html
index b6b1ce3..c735fab 100644
--- a/globalcollect_gateway/forms/html/rtbt/rtbt-ideal.html
+++ b/globalcollect_gateway/forms/html/rtbt/rtbt-ideal.html
@@ -40,6 +40,9 @@
<div id="donate">
<div id="donate-content">
<div id="donate-body"
style="padding: 0 1em;">
+ @noscript
+ <p id="topError"
class="errorMsg"></p>
+
<form method="post"
name="paypalcontribution">
<div
id="step1header"><h3>%donate_interface-amount-legend% <span
id="selected-amount"></span> <span class="mute" id="change-amount"
style="display: none;">(<a
href="#">%donate_interface-change%</a>)</span></h3></div>
<div
id="step1wrapper" style="display: none;">
diff --git a/globalcollect_gateway/forms/js/webitects2nd.js
b/globalcollect_gateway/forms/js/webitects2nd.js
index fa1ef82..4bc55a3 100644
--- a/globalcollect_gateway/forms/js/webitects2nd.js
+++ b/globalcollect_gateway/forms/js/webitects2nd.js
@@ -5,48 +5,7 @@
$( '#step2header' ).show();
$( '#step2wrapper' ).show();
- // check for RapidHtml errors and display, if any
- var temp, e, f, g, prevError, previousAmount, matched, amount,
otherAmount,
- amountErrorString = '',
- billingErrorString = '',
- paymentErrorString = '';
-
- // generate formatted errors to display
- temp = [];
- for ( e in amountErrors ) {
- if ( amountErrors[ e ] !== '' ) {
- temp[ temp.length ] = amountErrors[ e ];
- }
- }
- amountErrorString = temp.join( '<br />' );
-
- temp = [];
- for ( f in billingErrors ) {
- if ( billingErrors[ f ] !== '' ) {
- temp[ temp.length ] = billingErrors[ f ];
- }
- }
- billingErrorString = temp.join( '<br />' );
-
- temp = [];
- for ( g in paymentErrors ) {
- if ( paymentErrors[ g ] !== '' ) {
- temp[ temp.length ] = paymentErrors[ g ];
- }
- }
- paymentErrorString = temp.join( '<br />' );
-
- // show the errors
- prevError = false;
- if ( amountErrorString !== '' ) {
- $( '#amtErrorMessages' ).html( amountErrorString );
- }
- if ( billingErrorString !== '' ) {
- $( '#billingErrorMessages' ).html( billingErrorString );
- }
- if ( paymentErrorString !== '' ) {
- $( '#paymentErrorMessages' ).html( paymentErrorString );
- }
+ window.displayErrors();
$( '#paymentContinueBtn' ).on( 'click', function () {
if ( validate_personal( document.paypalcontribution ) &&
validateAmount() ) {
--
To view, visit https://gerrit.wikimedia.org/r/282001
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id9ab41f4060be4e592c62ab17abc2f4c7366f0a6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/DonationInterface
Gerrit-Branch: master
Gerrit-Owner: Awight <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits