r102824 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102823‎ | r102824 | r102825 >
Date:23:22, 11 November 2011
Author:kaldari
Status:ok (Comments)
Tags:
Comment:
do javascript check for cookies being disabled
Modified paths:
  • /trunk/extensions/DonationInterface/donationinterface.php (modified) (history)
  • /trunk/extensions/DonationInterface/gateway_common/interface.i18n.php (modified) (history)
  • /trunk/extensions/DonationInterface/modules/validate_input.js (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/donationinterface.php
@@ -610,6 +610,7 @@
611611 'donate_interface-error-msg-cvv',
612612 'donate_interface-error-msg-captcha',
613613 'donate_interface-error-msg-captcha-please',
 614+ 'donate_interface-error-msg-cookies',
614615 'donate_interface-donor-fname',
615616 'donate_interface-donor-lname',
616617 'donate_interface-donor-street',
Index: trunk/extensions/DonationInterface/modules/validate_input.js
@@ -86,8 +86,16 @@
8787 var dotpos = form.emailAdd.value.lastIndexOf(".");
8888
8989 if( apos < 1 || dotpos-apos < 2 ) {
90 - output += mw.msg( 'donate_interface-error-msg-email' );
 90+ output += mw.msg( 'donate_interface-error-msg-email' ) + '.\r\n';
9191 }
 92+
 93+ // Make sure cookies are enabled
 94+ document.cookie = 'wmf_test=1;';
 95+ if ( document.cookie.indexOf( 'wmf_test=1' ) != -1 ) {
 96+ document.cookie = 'wmf_test=; expires=Thu, 01-Jan-70 00:00:01 GMT;'; // unset the cookie
 97+ } else {
 98+ output += mw.msg( 'donate_interface-error-msg-cookies' ); // display error
 99+ }
92100
93101 if( output ) {
94102 alert( output );
@@ -142,8 +150,16 @@
143151 var dotpos = form.emailAdd.value.lastIndexOf(".");
144152
145153 if( apos < 1 || dotpos-apos < 2 ) {
146 - output += mw.msg( 'donate_interface-error-msg-email' );
 154+ output += mw.msg( 'donate_interface-error-msg-email' ) + '.\r\n';
147155 }
 156+
 157+ // Make sure cookies are enabled
 158+ document.cookie = 'wmf_test=1;';
 159+ if ( document.cookie.indexOf( 'wmf_test=1' ) != -1 ) {
 160+ document.cookie = 'wmf_test=; expires=Thu, 01-Jan-70 00:00:01 GMT;'; // unset the cookie
 161+ } else {
 162+ output += mw.msg( 'donate_interface-error-msg-cookies' ); // display error
 163+ }
148164
149165 if( output ) {
150166 alert( output );
Index: trunk/extensions/DonationInterface/gateway_common/interface.i18n.php
@@ -187,6 +187,7 @@
188188 'donate_interface-error-msg-cvv' => 'CVV from the back of your card',
189189 'donate_interface-error-msg-captcha' => "The Captcha value you entered is incorrect. Please try again.",
190190 'donate_interface-error-msg-captcha-please' => "For your credit card security, please type the characters you see above.",
 191+ 'donate_interface-error-msg-cookies' => 'Please enable cookies in your browser.',
191192 'php-response-declined' => 'Your transaction could not be accepted.',
192193 'donate_interface-thankyou' => 'Thank you for your donation!',
193194 'donate_interface-post-transaction' => 'Transaction details',
@@ -619,6 +620,7 @@
620621 'donate_interface-error-msg-cvv' => 'Used in error message regarding the card security code field.',
621622 'donate_interface-error-msg-captcha' => 'Error message if the user inputs the wrong [[w:en:CAPTCHA|CAPTCHA]].',
622623 'donate_interface-error-msg-captcha-please' => 'Message given the user if he/she has to fill out a [[w:en:CAPTCHA|CAPTCHA]] before the donation is fulfilled.',
 624+ 'donate_interface-error-msg-cookies' => "Error message if the user's browser has cookies disabled",
623625 'php-response-declined' => 'Error message if the translaction was declined.',
624626 'donate_interface-thankyou' => 'A thank you for donating.',
625627 'donate_interface-post-transaction' => 'Header for transaction details after the transaction is fulfilled (receipt).',

Follow-up revisions

RevisionCommit summaryAuthorDate
r102842MFT r102576, r102577, r102579, r102581, r102804, r102805, r102812, r102819, r...awjrichards02:20, 12 November 2011
r102929Re-attempting MFT r102576, r102577, r102578, r102579, r102581, r102689, r1027...khorn00:50, 14 November 2011
r106245MFT r102664, r102689, r102736, r102807, r102812, r102824, r102872, r102922, r...awjrichards21:26, 14 December 2011

Comments

#Comment by Khorn (WMF) (talk | contribs)   23:53, 11 November 2011

Worked for me (with the rapidHTML forms, at least).

Status & tagging log