114 |
114 |
115 sock.onmessage = function(e) { |
115 sock.onmessage = function(e) { |
116 if(context.logging){ |
116 if(context.logging){ |
117 console.log('Got message: ', e.data); |
117 console.log('Got message: ', e.data); |
118 } |
118 } |
119 var data_json = JSON.parse(e.data) |
119 //var data_json = JSON.parse(e.data); |
120 //showAlert('Annotation bien reçue.', true); |
120 //showAlert('Annotation bien reçue.', true); |
121 console.log('2 message', $scope.annotPile.length); |
121 console.log('2 message', $scope.annotPile.length); |
122 if($scope.annotPile.length>0){ |
122 if($scope.annotPile.length>0){ |
123 var c = $scope.annotPile.shift(); |
123 var c = $scope.annotPile.shift(); |
124 console.log('3 message', c); |
124 //console.log('3 message', c); |
125 var i; |
125 var i; |
126 if(c===false){ |
126 if(c===false){ |
127 //showAlert('Annotation envoyée.', true); |
127 //showAlert('Annotation envoyée.', true); |
128 $scope.sendBtnSuccess = true; |
128 $scope.sendBtnSuccess = true; |
129 i = $interval(function(){ $interval.cancel(i); $scope.sendBtnSuccess = false; }, 2000, 1); |
129 i = $interval(function(){ $interval.cancel(i); $scope.sendBtnSuccess = false; }, 2000, 1); |