front_js/pointers/communication/js/client.js
changeset 48 983d7be910c1
parent 41 d2f735d7763f
--- a/front_js/pointers/communication/js/client.js	Mon Jul 09 14:24:42 2012 +0200
+++ b/front_js/pointers/communication/js/client.js	Fri Jul 13 14:57:43 2012 +0200
@@ -21,7 +21,7 @@
  * Un client est défini par une socket, qui permettra de recevoir les données du server websocket du Middleware.
  * On accède aussi à la classe des pointeurs.
 */
-function client(host, port, _pointers)
+function Client(host, port, _pointers)
 {
     this.socket;
     this.pointers = _pointers;
@@ -39,7 +39,7 @@
 /*
  * Création et Initialisation des sockets et listeners permettant d'écouter le server.
 */
-client.prototype.createWebSocket = function(host)
+Client.prototype.createWebSocket = function(host)
 {
     var _this = this;
     
@@ -87,7 +87,7 @@
 /*
  * Traite un message reçu du Middleware.
 */
-client.prototype.processMsg = function(msg)
+Client.prototype.processMsg = function(msg)
 {
     if(typeof msg === 'undefined' || typeof msg.data === 'undefined')
     {
@@ -111,6 +111,8 @@
         {
             this.pointers.mainPointerDisplay(true);
             this.pointers.isMainPointerDisplayed = true;
+			
+			this.pointers.textUpdate();
         }
         
         this.pointerLeftTimeout = setTimeout(function()
@@ -121,6 +123,8 @@
             {
                 _this.pointers.isMainPointerDisplayed = false;
                 _this.pointers.mainPointerDisplay(false);
+				
+				_this.pointers.textUpdate();
             }
         }, this.timePointers);
     }
@@ -140,6 +144,8 @@
         {
             this.pointers.secondPointerDisplay(true);
             this.pointers.isSecondPointerDisplayed = true;
+			
+			this.pointers.textUpdate();
         }
         
         this.pointerRightTimeout = setTimeout(function()
@@ -150,6 +156,8 @@
             {
                 _this.pointers.isSecondPointerDisplayed = false;
                 _this.pointers.secondPointerDisplay(false);
+				
+				_this.pointers.textUpdate();
             }
         }, this.timePointers);
     }
@@ -157,5 +165,6 @@
     if(this.pointerLeft && !this.pointerRight || !this.pointerLeft && this.pointerRight || !this.pointerLeft && !this.pointerRight)
     {
         this.pointers.areBothPointersHere = false;
+		this.pointers.textUpdate();
     }
 }
\ No newline at end of file