8 changed files with 138 additions and 114 deletions
File diff suppressed because one or more lines are too long
@ -0,0 +1,69 @@
@@ -0,0 +1,69 @@
|
||||
/* |
||||
* Spreed WebRTC. |
||||
* Copyright (C) 2013-2014 struktur AG |
||||
* |
||||
* This file is part of Spreed WebRTC. |
||||
* |
||||
* This program is free software: you can redistribute it and/or modify |
||||
* it under the terms of the GNU Affero General Public License as published by |
||||
* the Free Software Foundation, either version 3 of the License, or |
||||
* (at your option) any later version. |
||||
* |
||||
* This program is distributed in the hope that it will be useful, |
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
||||
* GNU Affero General Public License for more details. |
||||
* |
||||
* You should have received a copy of the GNU Affero General Public License |
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
* |
||||
*/ |
||||
|
||||
define(['underscore'], function(underscore) { |
||||
|
||||
// buddyPicture
|
||||
return ["mediaStream", "$window", function(mediaStream, $window) { |
||||
|
||||
var buddyPicture = { |
||||
|
||||
update: function(data, url) { |
||||
|
||||
if (typeof(url) !== "undefined") { |
||||
data.buddyPicture = url; |
||||
} else { |
||||
url = data.buddyPicture; |
||||
} |
||||
if (!url) { |
||||
return; |
||||
} |
||||
|
||||
if (url.indexOf("img:") === 0) { |
||||
data.buddyPicture = data.buddyPictureLocalUrl = mediaStream.url.buddy(url.substr(4)); |
||||
} |
||||
|
||||
}, |
||||
|
||||
toString: function(img, mime_type) { |
||||
|
||||
if (img) { |
||||
if (typeof(mime_type) === "undefined") { |
||||
mime_type = "image/jpeg"; |
||||
} |
||||
var canvas = $window.document.createElement("canvas"); |
||||
canvas.width = img.width; |
||||
canvas.height = img.height; |
||||
var ctx = canvas.getContext("2d"); |
||||
ctx.drawImage(img, 0, 0); |
||||
return canvas.toDataURL(mime_type); |
||||
} |
||||
return null; |
||||
|
||||
} |
||||
|
||||
}; |
||||
|
||||
return buddyPicture; |
||||
|
||||
}]; |
||||
|
||||
}); |
@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
|
||||
<div class="buddy" ng-class="{'contact': contact, 'withSubline': display.subline || session.Userid}"> |
||||
<div class="buddyPicture"><i class="fa fa-user fa-3x"/><img ng-show="display.buddyPicture" alt ng-src="{{display.buddyPicture}}" width="46" height="46"/></div> |
||||
<div class="buddyPicture"><i class="fa fa-user"/><img ng-show="display.buddyPicture" alt ng-src="{{display.buddyPicture}}"/></div> |
||||
<div class="buddy1">{{session.Id|displayName}}</div> |
||||
<div class="buddy2"><span ng-show="session.Userid"><i class="fa contact" data-action="contact"></i><span ng-show="session.count"> ({{session.count}})</span></span> <span title="{{display.sublineFull}}">{{display.subline}}</span></div> |
||||
</div> |
||||
|
@ -1,11 +1,18 @@
@@ -1,11 +1,18 @@
|
||||
<div class="buddyhover"> |
||||
<div class="buddyactions active"> |
||||
<a class="btn btn-info" data-action="call" title="{{_('Start video call')}}"><i class="fa fa-phone fa-fw"></i></a> |
||||
<a class="btn btn-info" data-action="chat" title="{{_('Start chat')}}"><i class="fa fa-comments-o fa-fw"></i></a> |
||||
<a class="btn btn-info" data-action="call" title="{{_('Start video call')}}"><i class="fa fa-phone"></i></a> |
||||
<a class="btn btn-info" data-action="chat" title="{{_('Start chat')}}"><i class="fa fa-comments-o"></i></a> |
||||
</div> |
||||
<div class="buddysessions" ng-if="session.count>1"> |
||||
<ul> |
||||
<li ng-repeat="(id, s) in session.sessions" ng-class="{currentsession: s.Id === session.Id}"><span class="btn-group"><a class="btn btn-sm btn-default buddy3" ng-click="$event.stopPropagation()"><span>{{s.Status.displayName}}<span ng-show="s.Status.message">, {{s.Status.message}}</span></span></a><a class="btn btn-sm btn-default" title="{{_('Start video call')}}" ng-click="doCall(s.Id); $event.stopPropagation()"><i class="fa fa-eye"></i></a><a class="btn btn-sm btn-default" title="{{_('Start chat')}}" ng-click="doChat(s.Id); $event.stopPropagation()"><i class="fa fa-comments-o"></i></a></span></li> |
||||
<li ng-repeat="(id, s) in session.sessions" ng-class="{currentsession: s.Id === session.Id}"> |
||||
<span> |
||||
<div class="buddyPicture buddyPictureSmall"><i class="fa fa-user"/><img ng-show="s.Status.buddyPicture" alt ng-src="{{s.Id|buddyImageSrc:s.Status}}"/></div> |
||||
<div class="buddy3" title="{{s.Status.message}}">{{s.Status.displayName}}<span ng-show="s.Status.message">, {{s.Status.message}}</span></div> |
||||
<a class="btn btn-sm btn-default" title="{{_('Start video call')}}" ng-click="doCall(s.Id); $event.stopPropagation()"><i class="fa fa-phone"></i></a> |
||||
<a class="btn btn-sm btn-default" title="{{_('Start chat')}}" ng-click="doChat(s.Id); $event.stopPropagation()"><i class="fa fa-comments-o"></i></a> |
||||
</span> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
|
Loading…
Reference in new issue