r103987 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103986‎ | r103987 | r103988 >
Date:00:09, 23 November 2011
Author:khorn
Status:deferred
Tags:
Comment:
Modified paths:
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/css/gc.cc.css (added) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/js/gc.cc.js (added) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/js/gc.js (added) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects.bt.js (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects.js (modified) (history)
  • /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/js/webitects2nd.js (modified) (history)

Diff [purge]

Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/css/gc.cc.css
@@ -0,0 +1,197 @@
 2+table#donation_amount {
 3+ background-color:transparent;
 4+ border:1px solid #AAAAAA;
 5+ border-collapse:collapse;
 6+ width: 394px;
 7+}
 8+table#donation_amount td {
 9+ border:1px solid #AAAAAA;
 10+}
 11+table#donation_amount td.amount_header {
 12+ background-color:#eef2f7;
 13+ font-size:90%;
 14+}
 15+table#donation_amount td.amount_data {
 16+ background-color:#daf2db;
 17+}
 18+h3.cc_header {
 19+ padding-bottom: 0;
 20+ margin-bottom: 0;
 21+ font-weight: normal;
 22+}
 23+div#payflowpro_gateway-donate-addl-info-text {
 24+ font-size: 90%;
 25+ line-height: 120%;
 26+ padding-top: 12px;
 27+}
 28+div#payflowpro_gateway-donate-submessage {
 29+ font-size: 90%;
 30+ line-height: 120%;
 31+}
 32+#payflow-table-donor td.label, #payflow-table-comment td.label, #payflow-table-cc td.label {
 33+ white-space: nowrap;
 34+ display: block;
 35+ padding-right: 1em;
 36+ text-align: right;
 37+ width: 94px;
 38+}
 39+
 40+
 41+.payflow-cc-form-section {
 42+ float: none;
 43+ margin-right: 0em;
 44+ margin-bottom: 1em;
 45+}
 46+
 47+#payflowpro_gateway-cc_form_container {
 48+ width: 100%;
 49+}
 50+
 51+#payflowpro_gateway-cc_form_form {
 52+ width: 475px;
 53+ float: right;
 54+ margin-left: 2em;
 55+ padding-left: 2em;
 56+ border-left: 1px solid #BBBBBB;
 57+}
 58+
 59+#payflowpro_gateway-cc_form_letter {
 60+ height: 100%;
 61+}
 62+
 63+#payflowpro_gateway-cc_form_letter p {
 64+ font-size: 1.125em;
 65+ margin-bottom: 1.2em;
 66+}
 67+
 68+#payflowpro_gateway-personal-info {
 69+ margin-right:0 !important;
 70+}
 71+
 72+#payflowpro_gateway-donate-addl-info-secure-logos {
 73+ float: left;
 74+ margin-right: 2em;
 75+}
 76+
 77+#payflowpro_gateway-cc_form_letter_inside {
 78+ padding-top: .5em;
 79+}
 80+
 81+#payflowpro_gateway-cc_otherways {
 82+ padding-top: .5em;
 83+ display: block;
 84+}
 85+#payflowpro_gateway-donate-addl-info {
 86+ margin-top:2em !important;
 87+ margin-bottom:1em !important;
 88+}
 89+
 90+#appeal {
 91+ background-color:transparent;
 92+ border-color:transparent;
 93+ border-style:solid;
 94+ border-width:1px 0 1px 1px;
 95+ padding:16px 24px 24px;
 96+}
 97+#appeal-head {
 98+ font-size:1.5em;
 99+ line-height:1.125em;
 100+ padding-bottom:0.5em;
 101+ padding-top:0.125em;
 102+}
 103+#appeal-body {
 104+ font-size:1.125em;
 105+ margin-bottom:1em;
 106+ padding:0.2em 0;
 107+}
 108+#donate {
 109+}
 110+#donate-head {
 111+ border:none;
 112+ font-size:1.5em;
 113+ line-height:1.125em;
 114+ padding-bottom:0em;
 115+ padding-top:0.125em;
 116+}
 117+#donate-body {
 118+ font-size:1.125em;
 119+ margin-bottom:1em;
 120+}
 121+
 122+/* Move the form up */
 123+#mw-head-base {
 124+ height: 1em !important;
 125+}
 126+
 127+/* Hiding content border */
 128+table {
 129+ background-color: transparent;
 130+}
 131+div#content {
 132+ background-color: transparent !important;
 133+ background-image: none !important;
 134+}
 135+div#mw-head-base {
 136+ background-image: none !important;
 137+}
 138+#footer {
 139+ background-image: none !important;
 140+}
 141+
 142+/* Hiding stuff we don't need */
 143+h1#firstHeading, div#contentSub {
 144+ display: none;
 145+}
 146+
 147+/* NEW STUFF */
 148+#greenBackground{
 149+ padding:16px 24px;
 150+ width:300px;
 151+ background-color:#CCE7CD;
 152+ border:1px solid #5EAC58;
 153+}
 154+p#informationsharing {
 155+ width: 318px;
 156+ padding: 0 15px;
 157+ line-height: 14px;
 158+ font-size: 11px;
 159+}
 160+ul#moreinfolinks li{
 161+ list-style: none !important;
 162+ list-style-image: none !important;
 163+}
 164+h3.amount_header {
 165+ padding: 0 0 0.4em 0;
 166+ margin-bottom: 0;
 167+ font-weight: normal;
 168+}
 169+
 170+table#payflow-table-donor{
 171+ /*margin-left: 10px;*/
 172+}
 173+
 174+/* Form inputs */
 175+input#fname, input#lname {
 176+ width: 130px;
 177+}
 178+input#street, input#card_num, input#emailAdd {
 179+ width: 271px;
 180+}
 181+input#city {
 182+ width: 135px;
 183+}
 184+input#zip {
 185+ width: 65px;
 186+}
 187+
 188+/* From Webitects */
 189+/* Options */
 190+.form .options-h, .form .options-v { margin: 0; }
 191+.options-h, .options-v { list-style: none; margin: 0 0 1em 0; }
 192+.options-h img, .options-v img { vertical-align: middle; }
 193+.options-h li, .options-v li { background: none; margin-bottom: 0.3em; padding: 0; }
 194+.options-h li { display: inline; line-height: 2.5; margin-right: 0.3em; white-space: nowrap; }
 195+.options-h li select { vertical-align: middle; }
 196+.options-h li:last-child { margin: 0; }
 197+.form .options-v { margin-top: 5px; }
 198+.options-v li { padding-left: 25px; text-indent: -25px; }
\ No newline at end of file
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/css/gc.cc.css
___________________________________________________________________
Added: svn:eol-style
1199 + native
Index: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/js/gc.js
@@ -0,0 +1,89 @@
 2+window.displayCreditCardForm = function() {
 3+ $( '#payment' ).empty();
 4+ // Load wait spinner
 5+ $( '#payment' ).append( '<br/><br/><br/><img alt="loading" src="'+mw.config.get( 'wgScriptPath' )+'/extensions/DonationInterface/gateway_forms/includes/loading-white.gif" />' );
 6+ var language = 'en'; // default value is English
 7+ var matches = document.location.href.match(/uselang=(\w+)/i); // fine the real language
 8+ if ( matches && matches[1] ) {
 9+ language = matches[1];
 10+ }
 11+
 12+ var currencyField = document.getElementById( 'input_currency_code' );
 13+ var currency_code = '';
 14+ if ( currencyField && currencyField.type == 'select-one' ) { // currency is a dropdown select
 15+ currency_code = $( 'select#input_currency_code option:selected' ).val();
 16+ } else {
 17+ currency_code = $( "input[name='currency_code']" ).val();
 18+ }
 19+
 20+ var stateField = document.getElementById( 'state' );
 21+ var state = '';
 22+ if ( stateField && stateField.type == 'select-one' ) { // state is a dropdown select
 23+ state = $( 'select#state option:selected' ).val();
 24+ } else {
 25+ state = $( "input[name='state']" ).val();
 26+ }
 27+
 28+ var countryField = document.getElementById( 'country' );
 29+ var country = '';
 30+ if ( countryField && countryField.type == 'select-one' ) { // country is a dropdown select
 31+ country = $( 'select#country option:selected' ).val();
 32+ } else {
 33+ country = $( "input[name='country']" ).val();
 34+ }
 35+
 36+ var sendData = {
 37+ 'action': 'donate',
 38+ 'gateway': 'globalcollect',
 39+ 'currency_code': currency_code,
 40+ 'amount': $( "input[name='amount']" ).val(),
 41+ 'fname': $( "input[name='fname']" ).val(),
 42+ 'lname': $( "input[name='lname']" ).val(),
 43+ 'street': $( "input[name='street']" ).val(),
 44+ 'city': $( "input[name='city']" ).val(),
 45+ 'state': state,
 46+ 'zip': $( "input[name='zip']" ).val(),
 47+ 'emailAdd': $( "input[name='emailAdd']" ).val(),
 48+ 'country': country,
 49+ 'payment_method': 'cc',
 50+ 'language': language,
 51+ 'card_type': $( "input[name='cardtype']:checked" ).val().toLowerCase(),
 52+ 'contribution_tracking_id': $( "input[name='contribution_tracking_id']" ).val(),
 53+ 'numAttempt': $( "input[name='numAttempt']" ).val(),
 54+ 'utm_source': $( "input[name='utm_source']" ).val(),
 55+ 'utm_campaign': $( "input[name='utm_campaign']" ).val(),
 56+ 'utm_medium': $( "input[name='utm_medium']" ).val(),
 57+ 'format': 'json'
 58+ };
 59+ $.ajax( {
 60+ 'url': mw.util.wikiScript( 'api' ),
 61+ 'data': sendData,
 62+ 'dataType': 'json',
 63+ 'type': 'GET',
 64+ 'success': function( data ) {
 65+ if ( typeof data.error !== 'undefined' ) {
 66+ alert( mw.msg( 'donate_interface-error-msg-general' ) );
 67+ $( "#paymentContinue" ).show(); // Show continue button in 2nd section
 68+ } else if ( typeof data.result !== 'undefined' ) {
 69+ if ( data.result.errors ) {
 70+ var errors = new Array();
 71+ $.each( data.result.errors, function( index, value ) {
 72+ alert( value ); // Show them the error
 73+ $( "#paymentContinue" ).show(); // Show continue button in 2nd section
 74+ } );
 75+ } else {
 76+ if ( data.result.formaction ) {
 77+ $( '#payment' ).empty();
 78+ // Insert the iframe into the form
 79+ $( '#payment' ).append(
 80+ '<iframe src="'+data.result.formaction+'" width="318" height="314" frameborder="0"></iframe>'
 81+ );
 82+ }
 83+ }
 84+ }
 85+ },
 86+ 'error': function( xhr ) {
 87+ alert( mw.msg( 'donate_interface-error-msg-general' ) );
 88+ }
 89+ } );
 90+}
\ No newline at end of file
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/js/gc.js
___________________________________________________________________
Added: svn:eol-style
191 + native
Index: branches/fundraising/deployment/payments_1.17/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: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/js/gc.cc.js
@@ -0,0 +1,63 @@
 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+ var billingErrorString = "";
 11+ var 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+ if ( amountErrorString != "" ) {
 34+ $( "#topError" ).html( amountErrorString );
 35+ } else if ( billingErrorString != "" ) {
 36+ $( "#topError" ).html( billingErrorString );
 37+ } else if ( paymentErrorString != "" ) {
 38+ $( "#topError" ).html( paymentErrorString );
 39+ }
 40+
 41+ $( "#paymentContinueBtn" ).live( "click", function() {
 42+ if ( validate_personal( document.payment ) && validateAmount() ) {
 43+ $( "#payment" ).animate( { height:'314px' }, 1000 );
 44+ displayCreditCardForm();
 45+ // hide the continue button so that people don't get confused with two of them
 46+ $( "#paymentContinue" ).hide();
 47+ }
 48+ } );
 49+
 50+ // Set the cards to progress to step 3
 51+ $( ".cardradio" ).live( "click", function() {
 52+ if ( validate_personal( document.payment ) && validateAmount() ) {
 53+ $( "#payment" ).animate( { height:'314px' }, 1000 );
 54+ displayCreditCardForm();
 55+ // hide the continue button so that people don't get confused with two of them
 56+ $( "#paymentContinue" ).hide();
 57+ }
 58+ else {
 59+ // show the continue button to indicate how to get to step 3 since they
 60+ // have already clicked on a card image
 61+ $( "#paymentContinue" ).show();
 62+ }
 63+ } );
 64+} );
\ No newline at end of file
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms/js/gc.cc.js
___________________________________________________________________
Added: svn:eol-style
165 + native
Index: branches/fundraising/deployment/payments_1.17/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: branches/fundraising/deployment/payments_1.17/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
Property changes on: branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms
___________________________________________________________________
Added: svn:mergeinfo
159166 Merged /trunk/extensions/DonationInterface/globalcollect_gateway/forms:r75657-77440,77442-79147,79149-79286,79288-79296,79298-79299,79301-79303,79305-86440,90286,92825,96120-96121,96125,97945-99042,99045-99408,99503,99555,99568,99570-101026,101056,101060,101063-101064,101071-101074,101076,101099,101109,101112,101163,101180,101192,101200,101205,101207,101217,101230,101232,101236,101335,101382,101399,101441,101501-101504,101512,101541,101547,101549,101553-101555,101557,101559,101561,101563,101576,101578-101579,101631,101633,101638,101669,101676,101679,101689,101700,101706,101719,101740,101747,101757,101764,101778-101779,101781,101785-101789,101798,101823,101826,101837,101846,101852,101870-101872,101878,101882,101890,101892,101910,101917,101929,101947,101949-101951,101955-101960,101962,101964-101966,101996,102003,102011-102012,102030,102032-102033,102047,102050-102052,102054,102056,102058,102065,102076,102081,102085-102087,102118,102120,102123-102127,102130,102134,102140,102147,102151-102152,102155-102156,102186,102188-102242,102252,102258-102261,102263,102267,102269,102307-102309,102313,102318,102332,102341-102342,102345,102364,102419,102424-102425,102445,102463,102467-102468,102470,102476,102479-102480,102549-102550,102576-102581,102590,102594,102596,102611,102639,102664,102682,102689,102698,102700-102703,102707,102711-102712,102714,102729,102733,102736,102740,102752,102763,102805,102807,102809,102812,102819-102824,102826,102830-102831,102833,102835,102841,102872,102878,102915,102921-102923,102926-102928,102932,102936,102938,102942-102943,102946,102953,102960-102961,103009,103023,103026-103027,103032,103036-103038,103040,103044,103050,103058,103067,103077,103080,103130,103219,103223,103229,103235,103237-103239,103243,103245,103247,103253,103255,103259,103261-103262,103264,103275,103278,103284,103289-103291,103325,103371,103397,103399,103401,103421,103434-103435,103481,103519,103537,103541,103548,103591,103607,103680,103784,103871,103960,103963,103972,103983
160167 Merged /branches/fundraising/deployment/payments_1.17/extensions/DonationInterface/globalcollect_gateway/forms:r99568

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r103871add webmoney formjamesur23:48, 21 November 2011
r103960Adding new GC credit card formpgehres21:40, 22 November 2011
r103963A few minor fixes to the new gc form. FU r103960pgehres21:53, 22 November 2011
r103972Removing calls to now-unused functions FU r103960pgehres22:52, 22 November 2011
r103983Fixes for ew-webmoneypgehres23:51, 22 November 2011

Status & tagging log