Browse Source

Update variable names and positioning.

pull/151/head
Evan Theurer 12 years ago
parent
commit
3e6c343dc3
  1. 10
      static/js/directives/chat.js
  2. 4
      static/partials/chatroom.html

10
static/js/directives/chat.js

@ -195,9 +195,9 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro @@ -195,9 +195,9 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
var options = $.extend({}, opts);
var subscope = controller.rooms[id];
var index = controller.visibleRooms.length;
var buddy = buddyData.lookup(id);
if (!subscope) {
console.log("Create new chatroom", [id]);
var buddy = buddyData.lookup(id);
if (settings.group) {
controller.visibleRooms.unshift(id);
} else {
@ -217,9 +217,9 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro @@ -217,9 +217,9 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
subscope.p2pstate = false;
subscope.active = false;
subscope.pending = 0;
subscope.isuser = !!(buddy && buddy.session && buddy.session.Userid);
subscope.iscontact = !!(buddy && buddy.contact);
subscope.canAddContact = !subscope.isgroupchat && subscope.isuser;
subscope.isUser = !!(buddy && buddy.session && buddy.session.Userid);
subscope.isContact = !!(buddy && buddy.contact);
subscope.canAddContact = !subscope.isgroupchat && subscope.isUser;
if (!subscope.isgroupchat) {
buddyData.push(id);
}
@ -345,7 +345,7 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro @@ -345,7 +345,7 @@ define(['jquery', 'underscore', 'text!partials/chat.html', 'text!partials/chatro
contacts.remove(buddy.contact.Userid);
};
subscope.updateContactStatus = function(event, data) {
subscope.iscontact = event.type === "contactadded";
subscope.isContact = event.type === "contactadded";
};
contacts.e.on("contactadded", subscope.updateContactStatus);
contacts.e.on("contactremoved", subscope.updateContactStatus);

4
static/partials/chatroom.html

@ -5,8 +5,8 @@ @@ -5,8 +5,8 @@
<button ng-if="!isgroupchat" class="btn btn-sm btn-default" title="{{_('Start video call')}}" ng-click="doCall()"><i class="fa fa-phone fa-fw"></i></button>
<button class="btn btn-sm btn-default btn-fileupload" title="{{_('Upload files')}}"><i class="fa fa-upload fa-fw"></i></button>
<button class="btn btn-sm btn-default btn-locationshare" title="{{_('Share my location')}}" ng-click="shareGeolocation()"><i class="fa fa-location-arrow fa-fw"></i></button>
<button ng-if="canAddContact && !iscontact" class="btn btn-sm btn-primary" title="{{_('Add to contacts')}}" ng-click="addContact()"><i class="fa fa-star-o"></i></button>
<button ng-if="canAddContact && iscontact" class="btn btn-sm btn-primary" title="{{_('Remove from contacts')}}" ng-click="removeContact()"><i class="fa fa-star"></i></button>
<button ng-if="canAddContact && !isContact" class="btn btn-sm btn-primary" title="{{_('Add to contacts')}}" ng-click="addContact()"><i class="fa fa-star-o"></i></button>
<button ng-if="canAddContact && isContact" class="btn btn-sm btn-primary" title="{{_('Remove from contacts')}}" ng-click="removeContact()"><i class="fa fa-star"></i></button>
</div>
<div class="btn-group pull-right">
<button class="btn btn-sm btn-default" title="{{_('Clear chat')}}" ng-click="doClear()"><i class="fa fa-eraser fa-fw"></i></button>

Loading…
Cancel
Save