r99278 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99277‎ | r99278 | r99279 >
Date:22:56, 7 October 2011
Author:kaldari
Status:ok
Tags:fundraising 
Comment:
fixing linebreak double escaping, using some jQuery for the placeholder code, and removing position top param for module that doesnt need to be loaded in head
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/form_placeholders.js (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/form_placeholders.js
@@ -1,16 +1,13 @@
22 //<![CDATA[
33 ( function( $ ) {
44 $(document).ready(function() {
5 - var fname = document.getElementById('fname');
6 - var lname = document.getElementById('lname');
7 - var amountOther = document.getElementById('amountOther');
8 - if (fname.value == '') {
9 - fname.style.color = '#999999';
10 - fname.value = mw.msg( 'payflowpro_gateway-donor-fname' );
 5+ if ( $( '#fname' ).val() == '') {
 6+ $( '#fname' ).css( 'color', '#999999' );
 7+ $( '#fname' ).val( mw.msg( 'payflowpro_gateway-donor-fname' ) );
118 }
12 - if (lname.value == '') {
13 - lname.style.color = '#999999';
14 - lname.value = mw.msg( 'payflowpro_gateway-donor-lname' );
 9+ if ( $( '#lname' ).val() == '') {
 10+ $( '#lname' ).css( 'color', '#999999' );
 11+ $( '#lname' ).val( mw.msg( 'payflowpro_gateway-donor-lname' ) );
1512 }
1613 });
1714 })(jQuery);
@@ -27,19 +24,19 @@
2825 for( i = 0; i < numFields; i++ ) {
2926 if( document.getElementById( fields[i] ).value == '' ) {
3027 currField = window['payflowproGatewayErrorMsg'+ msg[i]];
31 - output += payflowproGatewayErrorMsgJs + ' ' + currField + '.\\r\\n';
 28+ output += payflowproGatewayErrorMsgJs + ' ' + currField + '.\r\n';
3229 }
3330 }
3431
3532 if (document.getElementById('fname').value == '$first') {
36 - output += payflowproGatewayErrorMsgJs + ' first name.\\r\\n';
 33+ output += payflowproGatewayErrorMsgJs + ' first name.\r\n';
3734 }
3835 if (document.getElementById('lname').value == '$last') {
39 - output += payflowproGatewayErrorMsgJs + ' last name.\\r\\n';
 36+ output += payflowproGatewayErrorMsgJs + ' last name.\r\n';
4037 }
4138 var countryField = document.getElementById( 'country' );
4239 if( countryField.options[countryField.selectedIndex].value == '' ) {
43 - output += payflowproGatewayErrorMsgJs + ' ' + window['payflowproGatewayErrorMsgCountry'] + '.\\r\\n';
 40+ output += payflowproGatewayErrorMsgJs + ' ' + window['payflowproGatewayErrorMsgCountry'] + '.\r\n';
4441 }
4542
4643 // validate email address
Index: trunk/extensions/DonationInterface/payflowpro_gateway/payflowpro_gateway.php
@@ -180,7 +180,6 @@
181181
182182 // form placeholders
183183 $wgResourceModules[ 'pfp.form.core.placeholders' ] = array(
184 - 'position' => 'top',
185184 'scripts' => 'form_placeholders.js',
186185 'dependencies' => 'pfp.form.core.validate',
187186 'messages' => array(

Follow-up revisions

RevisionCommit summaryAuthorDate
r100238Merging the fundraising branch of DonationInterface back into trunk....khorn16:57, 19 October 2011

Status & tagging log