diff --git a/app/assets/javascripts/src/Metamaps.js.erb b/app/assets/javascripts/src/Metamaps.js.erb index e5c00ffd..08eb6cfe 100644 --- a/app/assets/javascripts/src/Metamaps.js.erb +++ b/app/assets/javascripts/src/Metamaps.js.erb @@ -2126,7 +2126,7 @@ Metamaps.Realtime = { var self = Metamaps.Realtime; self.socket.emit('checkForCall', { room: self.room.room, mapid: Metamaps.Active.Map.id }); }, - promptToJoin: function (data) { + promptToJoin: function () { var self = Metamaps.Realtime; var notifyText = 'There\'s a conversation happening, want to join?'; @@ -2224,7 +2224,7 @@ Metamaps.Realtime = { var username = self.mappersOnMap[inviter].name; var notifyText = username + ' is inviting you to the conversation. Join?'; notifyText += ' '; - notifyText += ' '; + notifyText += ' '; Metamaps.GlobalUI.notifyUser(notifyText, true); }, acceptCall: function (userid) { @@ -2246,6 +2246,15 @@ Metamaps.Realtime = { }); Metamaps.GlobalUI.clearNotify(); }, + denyInvite: function (userid) { + var self = Metamaps.Realtime; + self.socket.emit('inviteDenied', { + mapid: Metamaps.Active.Map.id, + invited: Metamaps.Active.Mapper.id, + inviter: userid + }); + Metamaps.GlobalUI.clearNotify(); + }, inviteACall: function (userid) { var self = Metamaps.Realtime; self.socket.emit('inviteACall', { @@ -2263,7 +2272,7 @@ Metamaps.Realtime = { inviter: Metamaps.Active.Mapper.id, invited: userid }); - Metamaps.GlobalUI.notifyUser('Invitation has been sent.'); + self.room.chat.invitationPending(userid); }, callAccepted: function (userid) { var self = Metamaps.Realtime; @@ -2280,6 +2289,13 @@ Metamaps.Realtime = { Metamaps.GlobalUI.notifyUser(username + ' didn\'t accept your invite.'); self.room.chat.invitationAnswered(userid); }, + inviteDenied: function (userid) { + var self = Metamaps.Realtime; + + var username = self.mappersOnMap[userid].name; + Metamaps.GlobalUI.notifyUser(username + ' didn\'t accept your invite.'); + self.room.chat.invitationAnswered(userid); + }, joinCall: function () { var self = Metamaps.Realtime; @@ -2352,6 +2368,7 @@ Metamaps.Realtime = { socket.on(myId + '-' + Metamaps.Active.Map.id + '-invitedToJoin', self.invitedToJoin); // call already in progress socket.on(myId + '-' + Metamaps.Active.Map.id + '-callAccepted', self.callAccepted); socket.on(myId + '-' + Metamaps.Active.Map.id + '-callDenied', self.callDenied); + socket.on(myId + '-' + Metamaps.Active.Map.id + '-inviteDenied', self.inviteDenied); // receive word that there's a conversation in progress socket.on('maps-' + Metamaps.Active.Map.id + '-callInProgress', self.promptToJoin); @@ -2520,24 +2537,12 @@ Metamaps.Realtime = { coords: { x: 0, y: 0 - }, + } }; - var onOff = data.userrealtime ? "On" : "Off"; - var mapperListItem = '
  • '; - mapperListItem += ''; - mapperListItem += data.username; - mapperListItem += '
    '; - mapperListItem += '
  • '; - if (data.userid !== Metamaps.Active.Mapper.id) { - //$('#mapper' + data.userid).remove(); self.room.chat.addParticipant(self.mappersOnMap[data.userid]); + if (data.userinconversation) self.room.chat.mapperJoinedCall(data.userid); // create a div for the collaborators compass self.createCompass(data.username, data.userid, data.userimage, self.mappersOnMap[data.userid].color, !self.status); @@ -2586,6 +2591,7 @@ Metamaps.Realtime = { userimage: Metamaps.Active.Mapper.get("image"), userid: Metamaps.Active.Mapper.id, userrealtime: self.status, + userinconversation: self.inConversation, mapid: Metamaps.Active.Map.id }; socket.emit('updateNewMapperList', update); diff --git a/app/assets/javascripts/src/views/chatView.js.erb b/app/assets/javascripts/src/views/chatView.js.erb index 064cc557..0ba86ee6 100644 --- a/app/assets/javascripts/src/views/chatView.js.erb +++ b/app/assets/javascripts/src/views/chatView.js.erb @@ -235,6 +235,7 @@ Metamaps.Views.chatView = (function () { this.$participants.removeClass('is-participating'); this.$button.removeClass('active'); this.$participants.find('.participant').removeClass('active'); + this.$participants.find('.participant').removeClass('pending'); } chatView.prototype.leaveConversation = function () { diff --git a/app/assets/stylesheets/junto.css.erb b/app/assets/stylesheets/junto.css.erb index 7606532f..ed9b62b5 100644 --- a/app/assets/stylesheets/junto.css.erb +++ b/app/assets/stylesheets/junto.css.erb @@ -1,5 +1,5 @@ .collaborator-video { - z-index: 2; + z-index: 1; position: absolute; width: 150px; height: 150px; @@ -236,7 +236,7 @@ .chat-box .participants .participant .chat-participant-invite-join { display: none; } -.chat-box .participants.is-live .participant:not(.active) .chat-participant-invite-join { +.chat-box .participants.is-live.is-participating .participant:not(.active) .chat-participant-invite-join { display: block; } .chat-box .participants .participant .chat-participant-invite-call, diff --git a/npm-debug.log b/npm-debug.log new file mode 100644 index 00000000..021be352 --- /dev/null +++ b/npm-debug.log @@ -0,0 +1,19 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/bin/nodejs', '/usr/bin/npm', 'install' ] +2 info using npm@1.3.10 +3 info using node@v0.10.25 +4 error install Couldn't read dependencies +5 error Error: ENOENT, open '/vagrant/package.json' +6 error If you need help, you may report this log at: +6 error +6 error or email it to: +6 error +7 error System Linux 3.13.0-66-generic +8 error command "/usr/bin/nodejs" "/usr/bin/npm" "install" +9 error cwd /vagrant +10 error node -v v0.10.25 +11 error npm -v 1.3.10 +12 error path /vagrant/package.json +13 error code ENOENT +14 error errno 34 +15 verbose exit [ 34, true ] diff --git a/realtime/realtime-server.js b/realtime/realtime-server.js index 9326dd4d..6ce9aa44 100644 --- a/realtime/realtime-server.js +++ b/realtime/realtime-server.js @@ -17,6 +17,7 @@ function start() { userid: data.userid, username: data.username, userrealtime: data.userrealtime, + userinconversation: data.userinconversation, userimage: data.userimage }; socket.broadcast.emit(data.userToNotify + '-' + data.mapid + '-UpdateMapperList', existingUser); @@ -25,7 +26,7 @@ function start() { // as a new mapper check whether there's a call in progress to join socket.on('checkForCall', function (data) { var socketsInRoom = io.sockets.clients(data.room); - if (socketsInRoom.length) socket.emit('maps-' + data.mapid + '-callInProgress', socketsInRoom.length); + if (socketsInRoom.length) socket.emit('maps-' + data.mapid + '-callInProgress'); }); // send the invitation to start a call socket.on('inviteACall', function (data) { @@ -43,6 +44,9 @@ function start() { socket.on('callDenied', function (data) { socket.broadcast.emit(data.inviter + '-' + data.mapid + '-callDenied', data.invited); }); + socket.on('inviteDenied', function (data) { + socket.broadcast.emit(data.inviter + '-' + data.mapid + '-inviteDenied', data.invited); + }); socket.on('mapperJoinedCall', function (data) { socket.broadcast.emit('maps-' + data.mapid + '-mapperJoinedCall', data.id); });