Палсеич— (lusever) wrote in changelog,
Палсеич—
lusever
changelog

[ljcom] r10231: LJSUP-8014: Credit card payment process ...

Committer: pkornilov
LJSUP-8014: Credit card payment process refactoring
U   trunk/htdocs/js/pay.js
Modified: trunk/htdocs/js/pay.js
===================================================================
--- trunk/htdocs/js/pay.js	2011-03-14 08:45:21 UTC (rev 10230)
+++ trunk/htdocs/js/pay.js	2011-03-14 09:25:32 UTC (rev 10231)
@@ -403,9 +403,22 @@
 						},
 						function(){
 							if (!input.data('is_focus')) {
-								input.closest('li')
-									.find('.b-bubble-lite').hide()
-									.end().find('.b-bubble-warning').show();
+								input.closest('li').find('.b-bubble-lite').hide();
+								var default_value, i;
+								if (input[0].tagName !== 'SELECT') {
+									default_value = input[0].defaultValue;
+								} else {
+									for(i = -1; input[0].options[++i]; ) {
+										if (input[0].options[i].defaultSelected) {
+											default_value = input[0].options[i].value;
+											break;
+										}
+									}
+								}
+								
+								if (input.val() === default_value) {
+									input.closest('li').find('.b-bubble-warning').show();
+								}
 							}
 							input.data('is_hover', false);
 						});
@@ -414,9 +427,23 @@
 				{
 					var input = jQuery(this);
 					if (!input.data('is_hover')) {
-						input.closest('li')
-							.find('.b-bubble-lite').hide()
-							.end().find('.b-bubble-warning').show();
+						input.closest('li').find('.b-bubble-lite').hide();
+						
+						var default_value, i;
+						if (input[0].tagName !== 'SELECT') {
+							default_value = input[0].defaultValue;
+						} else {
+							for(i = -1; input[0].options[++i]; ) {
+								if (input[0].options[i].defaultSelected) {
+									default_value = input[0].options[i].value;
+									break;
+								}
+							}
+						}
+						
+						if (input.val() === default_value) {
+							input.closest('li').find('.b-bubble-warning').show();
+						}
 					}
 					input.data('is_focus', false);
 				});
@@ -424,7 +451,7 @@
 				jQuery([this.name_full, this.email]).input(function()
 				{
 					// keyboard no English
-					if (/[^a-z0-9!@#$%\^&*()_+\-=,.\/<>?;'\\\[\] ]/i.test(this.value)) {
+					if (/[^a-z0-9!@#$%\^&*()_+\-=,.\/<>?;:'\\\[\] :"|]/i.test(this.value)) {
 						jQuery(this).closest('li')
 							.find('.b-bubble-lite').hide()
 							.end().find('.b-bubble-alert').show();
@@ -444,10 +471,12 @@
 					cc_num_ml = Shop.ml_cc_num.replace('%card_type%', val);
 					cc_cvv2_ml = Shop.ml_cc_cvv2.replace('%card_type%', val);
 					jQuery('#cc_num').attr('maxlength', 16);
+					jQuery('#cc_cvv2').attr('maxlength', 3);
 				} else {
 					cc_num_ml = Shop.ml_cc_num_americanexpress;
 					cc_cvv2_ml = Shop.ml_cc_cvv2_americanexpress;
 					jQuery('#cc_num').attr('maxlength', 15);
+					jQuery('#cc_cvv2').attr('maxlength', 4);
 				}
 				
 				jQuery('#bubble_cc_num>span').html(cc_num_ml);

Tags: js, ljcom, lusever
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments