can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[ljcom] r9574: LJSUP-7035: delay of 1 second to display...

Committer: dpetrov
LJSUP-7035: delay of 1 second to display an error of incorrect dialing
U   trunk/htdocs/js/editprofile.js
U   trunk/htdocs/manage/profile/index.bml.text.local
Modified: trunk/htdocs/js/editprofile.js
===================================================================
--- trunk/htdocs/js/editprofile.js	2010-10-01 08:23:10 UTC (rev 9573)
+++ trunk/htdocs/js/editprofile.js	2010-10-01 08:51:09 UTC (rev 9574)
@@ -56,6 +56,7 @@
 			this.verifyTimer = null;
 			this.endpoint = "/tools/endpoints/validate_phone.bml";
 			this.stopVerification = false;
+			this.infoUpdateHandle = null;
 
 			this.verifiedElement = this.table.find('.b-manage-smsn-btn');
 
@@ -199,7 +200,8 @@
 				bt = this.ui.resendBtn,
 				dict = smsNotifyDict || {},
 				bubble = n.find('.i-bubble'),
-				that = this;
+				that = this,
+				delayInfoUpdate = false;
 
 			this.state = Array.prototype.slice.call(arguments);
 
@@ -227,21 +229,33 @@
 				that.skipReqSent = false;
 			}
 
+			function updateInfoBubble(text, event)
+			{
+				if(event.length > 0)
+				{
+					var eventClasses = ['initial', 'badnum', 'correctnum', 'reqsent', 'rateexceed', 'verified', 'wrongcode', 'unsupporteddef', 'smssent'];
+					n.find(".i-manage-smsn-icon").removeClass($.map(eventClasses, function(el){ return "i-manage-smsn-" + el }).join(' '));
+					n.find(".i-manage-smsn-icon").addClass("i-manage-smsn-" + event);
+
+					var msg = smsNotifyDict[text] || text;
+					bubble.find('span').html(msg);
+				}
+			}
+
 			if(this.skipReqSent && event == 'reqsent')
 				return;
-									
-			setBubble(status);
 
 			if(event.length > 0)
 			{
-				var eventClasses = ['initial', 'badnum', 'correctnum', 'reqsent', 'rateexceed', 'verified', 'wrongcode', 'unsupporteddef', 'smssent'];
-				n.find(".i-manage-smsn-icon").removeClass($.map(eventClasses, function(el){ return "i-manage-smsn-" + el }).join(' '));
-				n.find(".i-manage-smsn-icon").addClass("i-manage-smsn-" + event);
 				switch(event)
 				{
-					case 'initial':
+					case 'initial': bt.attr('disabled', true);
+									resetUI();
+									delayInfoUpdate = false;
+									break;
 					case 'badnum':  bt.attr('disabled', true);
 									resetUI();
+									delayInfoUpdate = true;
 									break;
 					case 'correctnum': bt.attr('disabled', false);
 									resetUI();
@@ -270,8 +284,19 @@
 				}
 			}
 
-			var msg = smsNotifyDict[text] || text;
-			bubble.find('span').html(msg);
+			clearTimeout( this.infoUpdateHandle );
+			if( delayInfoUpdate ) {
+				this.infoUpdateHandle = setTimeout( function() {
+					setBubble(status);
+
+					updateInfoBubble( text, event );
+				}, 1000 );
+				delayInfoUpdate = false;
+			}
+			else {
+				setBubble(status);
+				updateInfoBubble( text, event );
+			}
 		}
 	}
 

Modified: trunk/htdocs/manage/profile/index.bml.text.local
===================================================================
--- trunk/htdocs/manage/profile/index.bml.text.local	2010-10-01 08:23:10 UTC (rev 9573)
+++ trunk/htdocs/manage/profile/index.bml.text.local	2010-10-01 08:51:09 UTC (rev 9574)
@@ -33,9 +33,9 @@
 
 .section.textmsg.button.resend=Resend SMS
 
-.section.textmsg.example_us=E.g.: +1800123456
+.section.textmsg.example_us=E.g.: +18001234567
 
-.section.textmsg.example_ru=E.g.: +8903123456
+.section.textmsg.example_ru=E.g.: +79031234567
 
 .section.textmsg.info=Initial SMS
 

Tags: can3p, js, ljcom, local
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