add junto spinner for call in progress

This commit is contained in:
Connor Turland 2015-12-22 17:46:19 -05:00
parent dfc94b4079
commit 64283850e3
5 changed files with 53 additions and 39 deletions

BIN
app/assets/images/junto.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

View file

@ -159,6 +159,7 @@ Metamaps.GlobalUI = {
notifyUser: function (message, leaveOpen) { notifyUser: function (message, leaveOpen) {
var self = Metamaps.GlobalUI; var self = Metamaps.GlobalUI;
function famousReady() {
Metamaps.Famous.toast.surf.setContent(message); Metamaps.Famous.toast.surf.setContent(message);
Metamaps.Famous.toast.show(); Metamaps.Famous.toast.show();
clearTimeout(self.notifyTimeOut); clearTimeout(self.notifyTimeOut);
@ -167,6 +168,18 @@ Metamaps.GlobalUI = {
Metamaps.Famous.toast.hide(); Metamaps.Famous.toast.hide();
}, 8000); }, 8000);
} }
}
// initialize the famous ui
var callFamous = function(){
if (Metamaps.Famous && Metamaps.Famous.toast) {
famousReady();
}
else {
setTimeout(callFamous, 100);
}
}
callFamous();
}, },
clearNotify: function() { clearNotify: function() {
var self = Metamaps.GlobalUI; var self = Metamaps.GlobalUI;

View file

@ -2024,7 +2024,6 @@ Metamaps.Realtime = {
var heightOfVideo = 150; var heightOfVideo = 150;
var padding = 25; var padding = 25;
var top = paddingAboveTop + (self.videosInPosition * heightOfVideo) + padding; var top = paddingAboveTop + (self.videosInPosition * heightOfVideo) + padding;
console.log(top);
var left = 30; var left = 30;
//var right = Math.floor((Math.random() * (468 - 100)) + 1); //var right = Math.floor((Math.random() * (468 - 100)) + 1);
v.setParent($('#wrapper')); v.setParent($('#wrapper'));
@ -2153,12 +2152,13 @@ Metamaps.Realtime = {
inviter: Metamaps.Active.Mapper.id, inviter: Metamaps.Active.Mapper.id,
invited: userid invited: userid
}); });
Metamaps.GlobalUI.notifyUser('Invitation pending...', true);
}, },
callAccepted: function (userid) { callAccepted: function (userid) {
var self = Metamaps.Realtime; var self = Metamaps.Realtime;
var username = self.mappersOnMap[userid].name; var username = self.mappersOnMap[userid].name;
Metamaps.GlobalUI.notifyUser(username + ' liked your suggestion! Video call starting...'); Metamaps.GlobalUI.notifyUser('Conversation starting...');
self.joinCall(); self.joinCall();
}, },
callDenied: function (userid) { callDenied: function (userid) {

View file

@ -215,12 +215,14 @@ Metamaps.Views.chatView = (function () {
this.$conversationInProgress.show(); this.$conversationInProgress.show();
this.$participants.addClass('is-live'); this.$participants.addClass('is-live');
if (participating) this.$conversationInProgress.addClass('is-participating'); if (participating) this.$conversationInProgress.addClass('is-participating');
this.$button.addClass('active');
} }
chatView.prototype.conversationEnded = function () { chatView.prototype.conversationEnded = function () {
this.$conversationInProgress.hide(); this.$conversationInProgress.hide();
this.$participants.removeClass('is-live'); this.$participants.removeClass('is-live');
this.$conversationInProgress.removeClass('is-participating'); this.$conversationInProgress.removeClass('is-participating');
this.$button.removeClass('active');
} }
chatView.prototype.addParticipant = function (participant) { chatView.prototype.addParticipant = function (participant) {

View file

@ -146,7 +146,6 @@ Metamaps.Views.room = (function () {
} }
room.prototype.removeVideo = function (peer) { room.prototype.removeVideo = function (peer) {
console.log('removeVideo', peer);
var id = typeof peer == 'string' ? peer : peer.id; var id = typeof peer == 'string' ? peer : peer.id;
if (this.videos[id]) { if (this.videos[id]) {
this.videos[id].remove(); this.videos[id].remove();