Built motion from commit c671bd6.|0.0.103
[motion.git] / server / components / xchatty / xchatty.js
index 9f2beb4..e9ae0a5 100644 (file)
@@ -75,7 +75,11 @@ var xChatty = {
         "DownloadTranscript": "Download Transcript",
         "RatingMessage": "{{& RatingMessage}}",
         "RatingSendText": "{{RatingSend}}",
-        "RatingSkipText": "{{RatingSkip}}"
+        "RatingSkipText": "{{RatingSkip}}",
+        "MessageAgentsBusy": "{{& MessageAgentsBusy}}",
+        "EmailTitle": "{{EmailTitle}}",
+        "NameTitle": "{{NameTitle}}",
+        "MessageTitle": "{{MessageTitle}}"
     },
     init: function() {
         jQuery(".xc_chat_container").css('margin-bottom', '-50px');
@@ -531,6 +535,7 @@ var xChatty = {
         e.preventDefault();
         if (xChatty.config.processingSignUp)
             return false;
+        xChatty.config.processingSignUp = true;
         var validationErrors = {};
         var signupForm = jQuery(".xc_form_signup");
         jQuery('.xc_form_signup :input').each(function () {
@@ -554,6 +559,7 @@ var xChatty = {
         // }
         if (Object.keys(validationErrors).length > 0) {
           xChatty.renderNotifications(validationErrors,true);
+          xChatty.config.processingSignUp = false;
           return;
         }
         var now = new Date();
@@ -599,6 +605,7 @@ var xChatty = {
                 }
             },
             error: function(err) {
+              xChatty.config.processingSignUp = false;
               var error = {
                 'message': 'Service temporarily unavailable. We back as soon as possible!'
               };
@@ -780,7 +787,7 @@ var xChatty = {
                 if (!wasSignedUp && xChatty.config.processingSignUp && result.is_unserved) {
                   xChatty.config.processingSignUp = false;
                   var error = {
-                    'message': 'In this moment all agents are busy. Try again!'
+                    'message': xChatty.Lang.MessageAgentsBusy
                   };
                   xChatty.renderErrors(error, true);
                   xChatty.setHeaderText();