r97947 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97946‎ | r97947 | r97948 >
Date:19:09, 23 September 2011
Author:pgehres
Status:ok (Comments)
Tags:
Comment:
Fixes for r97836: jQuery selectors with valid syntax as well as proper path for csshover.min.htc on payments cluster
Modified paths:
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/rapidhtml/html/webitects_1.html (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/rapidhtml/html/webitects_1a.html (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/rapidhtml/html/webitects_2.html (modified) (history)
  • /trunk/extensions/DonationInterface/payflowpro_gateway/forms/rapidhtml/html/webitects_2_3step.html (modified) (history)

Diff [purge]

Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/rapidhtml/html/webitects_2_3step.html
@@ -1,6 +1,6 @@
22 <!-- load styles from original first steps -->
33 <link rel="stylesheet" href="@script_path/extensions/DonationInterface/payflowpro_gateway/forms/rapidhtml/css/lp1.css" />
4 -<!--[if lt IE 7]><style type="text/css">body{behavior:url("/w/skins-1.17/vector/csshover.min.htc")}</style><![endif]-->
 4+<!--[if lt IE 7]><style type="text/css">body{behavior:url("@script_path/skins/vector/csshover.min.htc")}</style><![endif]-->
55 <!-- start Webitects styles -->
66 <link rel="stylesheet" href="@script_path/extensions/DonationInterface/payflowpro_gateway/forms/rapidhtml/css/Webitects.css" />
77 <style type="text/css">
@@ -216,7 +216,7 @@
217217 <input type="hidden" value="@owa_ref" name="owa_ref"/>
218218 </form>
219219 <div id="where-content">
220 - <hr>
 220+ <hr />
221221 <h3>Where your donation goes</h3>
222222 <p><strong>Technology:</strong> Servers, bandwidth, maintenance, development. Wikipedia is the #5 website in the world and it runs on a fraction of what other top websites spend.</p>
223223 <p><strong>People:</strong> The other top 10 website have thousands of employees. We have fewer than 100, making your donation a great investment in a highly-efficient not-for-profit organization.</p>
@@ -342,7 +342,7 @@
343343 if ( validate_cc() ){
344344 // set the hidden expiration date input from the two selects
345345 $('input[name="expiration"]').val(
346 - $("select[name=mos]").val() + $('select[name="year"]').val().substring(2,4)
 346+ $('select[name="mos"]').val() + $('select[name="year"]').val().substring(2,4)
347347 );
348348 document.paypalcontribution.action = "@action";
349349 document.paypalcontribution.submit();
@@ -412,7 +412,7 @@
413413 });
414414 // set the hidden amount input to the value of the selected element
415415 function setAmount(e){
416 - $("input[name=amount]").val( e.val() );
 416+ $('input[name="amount"]').val( e.val() );
417417 }
418418
419419 // show the CVV help image on click
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/rapidhtml/html/webitects_1.html
@@ -1,6 +1,6 @@
22 <!-- load styles from original first steps -->
33 <link rel="stylesheet" href="@script_path/extensions/DonationInterface/payflowpro_gateway/forms/rapidhtml/css/lp1.css" />
4 -<!--[if lt IE 7]><style type="text/css">body{behavior:url("/w/skins-1.17/vector/csshover.min.htc")}</style><![endif]-->
 4+<!--[if lt IE 7]><style type="text/css">body{behavior:url("@script_path/skins/vector/csshover.min.htc")}</style><![endif]-->
55 <!-- start Webitects styles -->
66 <link rel="stylesheet" href="@script_path/extensions/DonationInterface/payflowpro_gateway/forms/rapidhtml/css/Webitects.css" />
77 <style type="text/css">
@@ -247,7 +247,7 @@
248248 $("#accordion").accordion( "activate" , 1 );
249249
250250 //we have clearly selected an amount before, make sure it is shown
251 - showAmount( $("input[name=amount]") );
 251+ showAmount( $('input[name="amount"]') );
252252
253253 // hacks for IE6/IE7
254254 if (jQuery.browser.msie && jQuery.browser.version.substr(0,1)<9){
@@ -266,7 +266,7 @@
267267
268268 $("#cc").click(function(){
269269 if ( validateAmount(document.paypalcontribution) ){
270 - showAmount( $("input[name=amount]") );
 270+ showAmount( $('input[name="amount"]') );
271271 $("#accordion").accordion("activate", 1);
272272 $("#change-amount").show();
273273
@@ -287,7 +287,7 @@
288288 $("#pp").click(function(){
289289 if ( validateAmount(document.paypalcontribution) ){
290290 // set the action to go to PayPal
291 - $("input[name=gateway]").val("paypal");
 291+ $('input[name="gateway"]').val("paypal");
292292 document.paypalcontribution.action = "https://wikimediafoundation.org/wiki/Special:ContributionTracking/en";
293293 $("#loading").html("<img src='@script_path/extensions/DonationInterface/payflowpro_gateway/forms/rapidhtml/images/loading-green.gif' /> Redirecting to PayPal…");
294294 document.paypalcontribution.submit();
@@ -295,12 +295,12 @@
296296 });
297297 $("#submitcreditcard").click(function(){
298298 // set country to US
299 - $("input[name=country]").val("US");
 299+ $('input[name="country"]').val("US");
300300
301301 if ( validate_form(document.paypalcontribution) ){
302302 // set expiration date
303 - $("input[name=expiration]").val(
304 - $("select[name=mos]").val() + $("select[name=year]").val().substring(2,4)
 303+ $('input[name="expiration"]').val(
 304+ $('select[name="mos"]').val() + $('select[name="year"]').val().substring(2,4)
305305 )
306306
307307 document.paypalcontribution.action = "@action";
@@ -315,9 +315,9 @@
316316 function showAmount(e){ $("#selected-amount").html("($" + e.val() + ")"); }
317317
318318 // Set selected amount to amount
319 - $("input[name=amountRadio]").click(function(){ setAmount($(this)); });
 319+ $('input[name="amountRadio"]').click(function(){ setAmount($(this)); });
320320 $("#other-amount").change(function(){ setAmount($(this)); });
321 - function setAmount(e){ $("input[name=amount]").val(e.val()); }
 321+ function setAmount(e){ $('input[name="amount"]').val(e.val()); }
322322
323323 // Security codes
324324 $("#where").click(function(){
@@ -330,20 +330,20 @@
331331 'USD' : 1
332332 };
333333 var error = true;
334 - var amount = $("input[name=amount]").val(); // get the amount
 334+ var amount = $('input[name="amount"]').val(); // get the amount
335335 var otherAmount = amount // create a working copy
336336 otherAmount = otherAmount.replace(/[,.](\d)$/, '\:$10');
337337 otherAmount = otherAmount.replace(/[,.](\d)(\d)$/, '\:$1$2');
338338 otherAmount = otherAmount.replace(/[,.]/g, '');
339339 otherAmount = otherAmount.replace(/:/, '.');
340340 amount = otherAmount; // idk, reset amount to working copy amount
341 - $("input[name=amount]").val(amount); // set the new amount back into the form
 341+ $('input[name="amount"]').val(amount); // set the new amount back into the form
342342
343343 // Check amount is a real number, sets error as true (good) if no issues
344344 error = ( amount == null || isNaN( amount ) || amount.value <= 0 );
345345 // Check amount is at least the minimum
346346 var currency = 'USD'; // hard-coded for these forms and tests
347 - $("input[name=currency]").val(currency);
 347+ $('input[name="currency"]').val(currency);
348348 if ( typeof( minimums[currency] ) == 'undefined' ) {
349349 minimums[currency] = 1;
350350 }
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/rapidhtml/html/webitects_1a.html
@@ -1,6 +1,6 @@
22 <!-- load styles from original first steps -->
33 <link rel="stylesheet" href="@script_path/extensions/DonationInterface/payflowpro_gateway/forms/rapidhtml/css/lp1.css" />
4 -<!--[if lt IE 7]><style type="text/css">body{behavior:url("/w/skins-1.17/vector/csshover.min.htc")}</style><![endif]-->
 4+<!--[if lt IE 7]><style type="text/css">body{behavior:url("@script_path/skins/vector/csshover.min.htc")}</style><![endif]-->
55 <!-- start Webitects styles -->
66 <link rel="stylesheet" href="@script_path/extensions/DonationInterface/payflowpro_gateway/forms/rapidhtml/css/Webitects.css" />
77 <style type="text/css">
@@ -248,7 +248,7 @@
249249 $("#accordion").accordion( "activate" , 1 );
250250
251251 //we have clearly selected an amount before, make sure it is shown
252 - showAmount( $("input[name=amount]") );
 252+ showAmount( $('input[name="amount"]') );
253253
254254 // hacks for IE6/IE7
255255 if (jQuery.browser.msie && jQuery.browser.version.substr(0,1)<9){
@@ -267,7 +267,7 @@
268268
269269 $("#cc").click(function(){
270270 if ( validateAmount(document.paypalcontribution) ){
271 - showAmount( $("input[name=amount]") );
 271+ showAmount( $('input[name="amount"]') );
272272 $("#accordion").accordion("activate", 1);
273273 $("#change-amount").show();
274274
@@ -288,7 +288,7 @@
289289 $("#pp").click(function(){
290290 if ( validateAmount(document.paypalcontribution) ){
291291 // set the action to go to PayPal
292 - $("input[name=gateway]").val("paypal");
 292+ $('input[name="gateway"]').val("paypal");
293293 document.paypalcontribution.action = "https://wikimediafoundation.org/wiki/Special:ContributionTracking/en";
294294 $("#loading").html("<img src='@script_path/extensions/DonationInterface/payflowpro_gateway/forms/rapidhtml/images/loading-green.gif' /> Redirecting to PayPal…");
295295 document.paypalcontribution.submit();
@@ -296,11 +296,11 @@
297297 });
298298 $("#submitcreditcard").click(function(){
299299 // set country to US
300 - $("input[name=country]").val("US");
 300+ $('input[name="country"]').val("US");
301301
302302 if ( validate_form(document.paypalcontribution) ){
303303 // set expiration date
304 - $("input[name=expiration]").val(
 304+ $('input[name="expiration"]').val(
305305 $("select[name=mos]").val() + $("select[name=year]").val().substring(2,4)
306306 )
307307
@@ -316,9 +316,9 @@
317317 function showAmount(e){ $("#selected-amount").html("($" + e.val() + ")"); }
318318
319319 // Set selected amount to amount
320 - $("input[name=amountRadio]").click(function(){ setAmount($(this)); });
 320+ $('input[name="amountRadio"]').click(function(){ setAmount($(this)); });
321321 $("#other-amount").change(function(){ setAmount($(this)); });
322 - function setAmount(e){ $("input[name=amount]").val(e.val()); }
 322+ function setAmount(e){ $('input[name="amount"]').val(e.val()); }
323323
324324 // Security codes
325325 $("#where").click(function(){
@@ -331,20 +331,20 @@
332332 'USD' : 1
333333 };
334334 var error = true;
335 - var amount = $("input[name=amount]").val(); // get the amount
 335+ var amount = $('input[name="amount"]').val(); // get the amount
336336 var otherAmount = amount // create a working copy
337337 otherAmount = otherAmount.replace(/[,.](\d)$/, '\:$10');
338338 otherAmount = otherAmount.replace(/[,.](\d)(\d)$/, '\:$1$2');
339339 otherAmount = otherAmount.replace(/[,.]/g, '');
340340 otherAmount = otherAmount.replace(/:/, '.');
341341 amount = otherAmount; // idk, reset amount to working copy amount
342 - $("input[name=amount]").val(amount); // set the new amount back into the form
 342+ $('input[name="amount"]').val(amount); // set the new amount back into the form
343343
344344 // Check amount is a real number, sets error as true (good) if no issues
345345 error = ( amount == null || isNaN( amount ) || amount.value <= 0 );
346346 // Check amount is at least the minimum
347347 var currency = 'USD'; // hard-coded for these forms and tests
348 - $("input[name=currency]").val(currency);
 348+ $('input[name="currency"]').val(currency);
349349 if ( typeof( minimums[currency] ) == 'undefined' ) {
350350 minimums[currency] = 1;
351351 }
Index: trunk/extensions/DonationInterface/payflowpro_gateway/forms/rapidhtml/html/webitects_2.html
@@ -1,6 +1,6 @@
22 <!-- load styles from original first steps -->
33 <link rel="stylesheet" href="@script_path/extensions/DonationInterface/payflowpro_gateway/forms/rapidhtml/css/lp1.css" />
4 -<!--[if lt IE 7]><style type="text/css">body{behavior:url("/w/skins-1.17/vector/csshover.min.htc")}</style><![endif]-->
 4+<!--[if lt IE 7]><style type="text/css">body{behavior:url("@script_path/skins/vector/csshover.min.htc")}</style><![endif]-->
55 <!-- start Webitects styles -->
66 <link rel="stylesheet" href="@script_path/extensions/DonationInterface/payflowpro_gateway/forms/rapidhtml/css/Webitects.css" />
77 <style type="text/css">
@@ -204,7 +204,7 @@
205205 </div>
206206 </form>
207207 <div id="where-content">
208 - <hr>
 208+ <hr />
209209 <h3>Where your donation goes</h3>
210210 <p><strong>Technology:</strong> Servers, bandwidth, maintenance, development. Wikipedia is the #5 website in the world and it runs on a fraction of what other top websites spend.</p>
211211 <p><strong>People:</strong> The other top 10 website have thousands of employees. We have fewer than 100, making your donation a great investment in a highly-efficient not-for-profit organization.</p>
@@ -255,7 +255,7 @@
256256 }
257257 if( count > 0 ){
258258 // show the second step with the error
259 - showAmount( $("input[name=amount]") );
 259+ showAmount( $('input[name="amount"]') );
260260 // show second step
261261 $(".hideamountclass").slideUp();
262262 $("#step2wrapper").slideDown();
@@ -273,7 +273,7 @@
274274
275275 $("#cc").click(function(){
276276 if ( validateAmount(document.paypalcontribution) ){
277 - showAmount( $("input[name=amount]") );
 277+ showAmount( $('input[name="amount"]') );
278278 // show second step
279279 $(".hideamountclass").slideUp();
280280 $("#step2wrapper").slideDown();
@@ -291,7 +291,7 @@
292292 $("#pp").click(function(){
293293 if ( validateAmount(document.paypalcontribution) ){
294294 // set the action to go to PayPal
295 - $("input[name=gateway]").val("paypal");
 295+ $('input[name="gateway"]').val("paypal");
296296 document.paypalcontribution.action = "https://wikimediafoundation.org/wiki/Special:ContributionTracking/en";
297297 $("#loading").html("<img src='@script_path/extensions/DonationInterface/payflowpro_gateway/forms/rapidhtml/images/loading-white.gif' /> Redirecting to PayPal…");
298298 document.paypalcontribution.submit();
@@ -299,12 +299,12 @@
300300 });
301301 $("#submitcreditcard").click(function(){
302302 // set country to US
303 - $("input[name=country]").val("US");
 303+ $('input[name="country"]').val("US");
304304
305305 if ( validate_form(document.paypalcontribution) ){
306306 // set expiration date
307 - $("input[name=expiration]").val(
308 - $("select[name=mos]").val() + $("select[name=year]").val().substring(2,4)
 307+ $('input[name="expiration"]').val(
 308+ $('select[name="mos"]').val() + $('select[name="year"]').val().substring(2,4)
309309 );
310310
311311 document.paypalcontribution.action = "@action";
@@ -319,9 +319,9 @@
320320 function showAmount(e){ $("#selected-amount").html("($" + e.val() + ")"); }
321321
322322 // Set selected amount to amount
323 - $("input[name=amountRadio]").click(function(){ setAmount($(this)); });
 323+ $('input[name="amountRadio"]').click(function(){ setAmount($(this)); });
324324 $("#other-amount").change(function(){ setAmount($(this)); });
325 - function setAmount(e){ $("input[name=amount]").val(e.val()); }
 325+ function setAmount(e){ $('input[name="amount"]').val(e.val()); }
326326
327327 // Security codes
328328 $("#where").click(function(){
@@ -334,20 +334,20 @@
335335 'USD' : 1
336336 };
337337 var error = true;
338 - var amount = $("input[name=amount]").val(); // get the amount
 338+ var amount = $('input[name="amount"]').val(); // get the amount
339339 var otherAmount = amount // create a working copy
340340 otherAmount = otherAmount.replace(/[,.](\d)$/, '\:$10');
341341 otherAmount = otherAmount.replace(/[,.](\d)(\d)$/, '\:$1$2');
342342 otherAmount = otherAmount.replace(/[,.]/g, '');
343343 otherAmount = otherAmount.replace(/:/, '.');
344344 amount = otherAmount; // idk, reset amount to working copy amount
345 - $("input[name=amount]").val(amount); // set the new amount back into the form
 345+ $('input[name="amount"]').val(amount); // set the new amount back into the form
346346
347347 // Check amount is a real number, sets error as true (good) if no issues
348348 error = ( amount == null || isNaN( amount ) || amount.value <= 0 );
349349 // Check amount is at least the minimum
350350 var currency = 'USD'; // hard-coded for these forms and tests
351 - $("input[name=currency]").val(currency);
 351+ $('input[name="currency"]').val(currency);
352352 if ( typeof( minimums[currency] ) == 'undefined' ) {
353353 minimums[currency] = 1;
354354 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97836Adding back webitects form for this week as well as some fixes for PayPal don...pgehres18:57, 22 September 2011

Comments

#Comment by Kaldari (talk | contribs)   22:33, 23 September 2011

Looks good.

Status & tagging log