From 58e5c44db2f3343c491495d7077f13450db4e324 Mon Sep 17 00:00:00 2001 From: manzerbredes Date: Sun, 31 Jan 2016 11:47:13 +0100 Subject: [PATCH] Make status bar dynamic ! --- client/index.html | 8 +++++++- client/js/controllers/status.js | 18 ++++++++++++++---- client/js/requests/identity.js | 15 +++++++++++++++ 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a/client/index.html b/client/index.html index 0c02623..c2d1862 100644 --- a/client/index.html +++ b/client/index.html @@ -62,8 +62,14 @@ - + + + + + + + diff --git a/client/js/controllers/status.js b/client/js/controllers/status.js index 3534912..0767202 100644 --- a/client/js/controllers/status.js +++ b/client/js/controllers/status.js @@ -4,9 +4,19 @@ -mainApp.controller('statusCtrl', function ($scope) +mainApp.controller('statusCtrl', function ($scope,$interval) { - $scope.username="User 1"; - $scope.connection="Online"; - $scope.lastconnection="1 Septembre"; + + // Update status every 2 seconds + $interval(function(){ + var status=identity.fetchStatus(); + $scope.connection=status[0]; + $scope.username=status[1]; + $scope.lastconnection=status[2]; + }, 2000); + + + + + }); \ No newline at end of file diff --git a/client/js/requests/identity.js b/client/js/requests/identity.js index e69de29..369ce85 100644 --- a/client/js/requests/identity.js +++ b/client/js/requests/identity.js @@ -0,0 +1,15 @@ + + +// Make Namespace +var identity = {} ; + + + +// Fetch Status +identity.fetchStatus = function(){ + + // TODO + + return new Array("1", "user1", "25/02/2016"); + +} \ No newline at end of file