From 57f047a05a310883d534a6b01ac99916586fa584 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 1 Sep 2014 17:15:26 +0100 Subject: [PATCH] Fairly simple move of the call status widget to the header bar (and therefore into the index page rather than the rooms page). --- webclient/app-controller.js | 30 +++++++++++++++++++++++++----- webclient/app.css | 4 ++++ webclient/index.html | 13 +++++++++++++ webclient/room/room-controller.js | 28 +++------------------------- webclient/room/room.html | 11 ----------- 5 files changed, 45 insertions(+), 41 deletions(-) diff --git a/webclient/app-controller.js b/webclient/app-controller.js index 97f799d62..42c45f7c3 100644 --- a/webclient/app-controller.js +++ b/webclient/app-controller.js @@ -21,8 +21,8 @@ limitations under the License. 'use strict'; angular.module('MatrixWebClientController', ['matrixService', 'mPresence', 'eventStreamService']) -.controller('MatrixWebClientController', ['$scope', '$location', '$rootScope', 'matrixService', 'mPresence', 'eventStreamService', - function($scope, $location, $rootScope, matrixService, mPresence, eventStreamService) { +.controller('MatrixWebClientController', ['$scope', '$location', '$rootScope', 'matrixService', 'mPresence', 'eventStreamService', 'matrixPhoneService', + function($scope, $location, $rootScope, matrixService, mPresence, eventStreamService, matrixPhoneService) { // Check current URL to avoid to display the logout button on the login page $scope.location = $location.path(); @@ -88,7 +88,27 @@ angular.module('MatrixWebClientController', ['matrixService', 'mPresence', 'even $scope.updateHeader = function() { $scope.user_id = matrixService.config().user_id; }; - -}]); - + $rootScope.$on(matrixPhoneService.INCOMING_CALL_EVENT, function(ngEvent, call) { + console.trace("incoming call"); + call.onError = $scope.onCallError; + call.onHangup = $scope.onCallHangup; + $rootScope.currentCall = call; + }); + + $scope.answerCall = function() { + $scope.currentCall.answer(); + }; + + $scope.hangupCall = function() { + $scope.currentCall.hangup(); + $scope.currentCall = undefined; + }; + + $rootScope.onCallError = function(errStr) { + $scope.feedback = errStr; + } + + $rootScope.onCallHangup = function() { + } +}]); diff --git a/webclient/app.css b/webclient/app.css index cd1820e15..8685032d7 100755 --- a/webclient/app.css +++ b/webclient/app.css @@ -43,6 +43,10 @@ a:active { color: #000; } height: 32px; } +#callBar { + float: left; +} + #headerContent { color: #ccc; max-width: 1280px; diff --git a/webclient/index.html b/webclient/index.html index bf24e392a..f016dbb87 100644 --- a/webclient/index.html +++ b/webclient/index.html @@ -44,6 +44,19 @@