r99568 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99567‎ | r99568 | r99569 >
Date:21:06, 11 October 2011
Author:awjrichards
Status:ok (Comments)
Tags:fundraising 
Comment:
This time /really/ made TwoStepTwoColumn3 form RL friendly, fixed field names in placeholder setting js; now loading validation module in TwoStepTwoColumn3
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumn.php (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumnLetter3.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumn.php
@@ -14,8 +14,6 @@
1515 public function loadPlaceholders() {
1616 global $wgOut;
1717 $wgOut->addModules( 'pfp.form.core.placeholders' );
18 - //$placeholder_resources = '<script type="text/javascript">mw.loader.load("pfp.form.core.placeholders");</script>';
19 - //$wgOut->addHtml( $placeholder_resources );
2018 }
2119
2220 /**
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/TwoStepTwoColumnLetter3.php
@@ -8,7 +8,7 @@
99 if ( !strlen( $this->getStylePath() ) ) {
1010 $this->setStylePath( $wgScriptPath . '/extensions/DonationInterface/payflowpro_gateway/forms/css/TwoStepTwoColumnLetter3.css' );
1111 }
12 -
 12+ $this->loadvalidateJs();
1313 parent::__construct( $form_data, $form_errors );
1414 }
1515
@@ -23,40 +23,34 @@
2424 $email = wfMsg( 'payflowpro_gateway-donor-email' );
2525 $js = <<<EOT
2626 <script type="text/javascript">
27 -//function loadPlaceholders() {
28 -window.loadPlaceholders = function() {
29 - var fname = document.getElementById('fname');
30 - var lname = document.getElementById('lname');
31 - var street = document.getElementById('street');
32 - var city = document.getElementById('city');
33 - var zip = document.getElementById('zip');
34 - var email = document.getElementById('emailAdd');
35 - if (fname.value == '') {
36 - fname.style.color = '#999999';
37 - fname.value = '$first';
38 - }
39 - if (lname.value == '') {
40 - lname.style.color = '#999999';
41 - lname.value = '$last';
42 - }
43 - if (street.value == '') {
44 - street.style.color = '#999999';
45 - street.value = '$street';
46 - }
47 - if (city.value == '') {
48 - city.style.color = '#999999';
49 - city.value = '$city';
50 - }
51 - if (zip.value == '') {
52 - zip.style.color = '#999999';
53 - zip.value = '$zip';
54 - }
55 - if (email.value == '') {
56 - email.style.color = '#999999';
57 - email.value = '$email';
58 - }
59 -}
60 -addEvent( window, 'load', loadPlaceholders );
 27+( function( $ ) {
 28+ $(document).ready(function() {
 29+ if ( $( '#fname' ).val() == '') {
 30+ $( '#fname' ).css( 'color', '#999999' );
 31+ $( '#fname' ).val( '$first' );
 32+ }
 33+ if ( $( '#lname' ).val() == '') {
 34+ $( '#lname' ).css( 'color', '#999999' );
 35+ $( '#lname' ).val( '$last' );
 36+ }
 37+ if ( $( '#street' ).val() == '') {
 38+ $( '#street' ).css( 'color', '#999999' );
 39+ $( '#street' ).val( '$street' );
 40+ }
 41+ if ( $( '#city' ).val() == '' ) {
 42+ $( '#city' ).css( 'color', '#999999' );
 43+ $( '#city' ).val( '$city' );
 44+ }
 45+ if ( $( '#zip' ).val() =='') {
 46+ $( '#zip' ).css( 'color', '#999999' );
 47+ $( '#zip' ).val( '$zip' );
 48+ }
 49+ if ( $( '#emailAdd' ).val() == '') {
 50+ $( '#emailAdd' ).css( 'color', '#999999' );
 51+ $( '#emailAdd' ).val( '$email' );
 52+ }
 53+ });
 54+})(jQuery);
6155
6256 //function formCheck( ccform ) {
6357 window.formCheck = function( ccform ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r99569MFT r99568awjrichards21:07, 11 October 2011
r100937Followup r99568; removed ->loadvalidateJs() - was misspelled and that JS gets...awjrichards02:35, 27 October 2011

Comments

#Comment by Kaldari (talk | contribs)   01:11, 22 October 2011

This looks much better, except that loadValidateJs() is misspelled :)

#Comment by Awjrichards (talk | contribs)   02:35, 27 October 2011

Fixed in r100937

Status & tagging log