r103223 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103222‎ | r103223 | r103224 >
Date:21:19, 15 November 2011
Author:kaldari
Status:ok
Tags:
Comment:
rapidHtml TwoStepTwoColumnLetter3
Modified paths:
  • /trunk/extensions/DonationInterface/gateway_forms/rapidhtml/RapidHtmlResources.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/html/TwoStepTwoColumnLetter3.html (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/js/TwoStepTwoColumnLetter3.js (added) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/html/TwoStepTwoColumnLetter3.html
@@ -1,11 +1,11 @@
22 <script type="text/javascript">
33 mw.loader.load('pfp.form.rapidhtml.TwoStepTwoColumnLetter3');
44 // these must go through RapidHTML and thus are inline
5 -// var amountErrors = ['#general|escape','#retryMsg|escape','#amount|escape'];
6 -// var billingErrors = ['#fname|escape','#lname|escape','#city|escape','#country|escape','#street|escape','#state|escape','#zip|escape','#emailAdd|escape'];
7 -// var paymentErrors = ['#card_num|escape','#card_type|escape','#cvv|escape'];
8 -// var actionURL = "@action";
9 -// var scriptPath = "@script_path";
 5+ var amountErrors = ['#general|escape','#retryMsg|escape','#amount|escape'];
 6+ var billingErrors = ['#fname|escape','#lname|escape','#city|escape','#country|escape','#street|escape','#state|escape','#zip|escape','#emailAdd|escape'];
 7+ var paymentErrors = ['#card_num|escape','#card_type|escape','#cvv|escape'];
 8+ var actionURL = "@action";
 9+ var scriptPath = "@script_path";
1010 </script>
1111
1212 <table width="100%" cellspacing="0" cellpadding="0" border="0">
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/js/TwoStepTwoColumnLetter3.js
@@ -0,0 +1,59 @@
 2+/*
 3+ * The following variable are declared inline in webitects_2_3step.html:
 4+ * amountErrors, billingErrors, paymentErrors, scriptPath, actionURL
 5+ */
 6+$( document ).ready( function () {
 7+
 8+ // check for RapidHtml errors and display, if any
 9+ var amountErrorString = "",
 10+ billingErrorString = "",
 11+ paymentErrorString = "";
 12+
 13+ // generate formatted errors to display
 14+ var temp = [];
 15+ for ( var e in amountErrors )
 16+ if ( amountErrors[e] != "" )
 17+ temp[temp.length] = amountErrors[e];
 18+ amountErrorString = temp.join( "<br />" );
 19+
 20+ temp = [];
 21+ for ( var f in billingErrors )
 22+ if ( billingErrors[f] != "" )
 23+ temp[temp.length] = billingErrors[f];
 24+ billingErrorString = temp.join( "<br />" );
 25+
 26+ temp = [];
 27+ for ( var g in paymentErrors )
 28+ if ( paymentErrors[g] != "" )
 29+ temp[temp.length] = paymentErrors[g];
 30+ paymentErrorString = temp.join( "<br />" );
 31+
 32+ // show the errors
 33+ var prevError = false;
 34+ if ( amountErrorString != "" ) {
 35+ $( "#amtErrorMessages" ).html( amountErrorString );
 36+ }
 37+ if ( billingErrorString != "" ) {
 38+ $( "#billingErrorMessages" ).html( billingErrorString );
 39+ }
 40+ if ( paymentErrorString != "" ) {
 41+ $( "#paymentErrorMessages" ).html( paymentErrorString );
 42+ }
 43+
 44+ $( "#ccSubmitButton" ).click( function() {
 45+ // Safety check for people who hit the back button
 46+ checkedValue = $( "input[name='amountRadio']:checked" ).val();
 47+ currenctAmount = $( 'input[name="amount"]' ).val();
 48+ // The currenctAmount could be set to empty string or '0.00'
 49+ if ( ( currentAmount == '0.00' || currentAmount == '' ) && checkedValue && !isNaN( checkedValue ) ) {
 50+ $( 'input[name="amount"]' ).val( checkedValue );
 51+ }
 52+ if ( validateAmount() ) {
 53+ if ( validate_form() ) {
 54+ return true;
 55+ }
 56+ }
 57+ return false;
 58+ } );
 59+
 60+} );
Index: trunk/extensions/DonationInterface/gateway_forms/rapidhtml/RapidHtmlResources.php
@@ -208,8 +208,8 @@
209209 */
210210 $wgResourceModules[ 'pfp.form.rapidhtml.TwoStepTwoColumnLetter3' ] = array(
211211 'styles' => 'css/TwoStepTwoColumnLetter3.css',
212 - 'scripts' => '',
213 - 'dependencies' => array(),
 212+ 'scripts' => 'js/TwoStepTwoColumnLetter3.js',
 213+ 'dependencies' => array( 'di.form.core.validate' ),
214214 'localBasePath' => dirname( __FILE__ ).'/../../payflowpro_gateway/forms',
215215 'remoteExtPath' => $wgPayflowRapidHtmlRemoteExtPath,
216216 );

Follow-up revisions

RevisionCommit summaryAuthorDate
r103263MFT r103080, r103130, r103219, r103223, r103229, r103235, r103237, r103238, r...awjrichards23:43, 15 November 2011

Status & tagging log