diff --git a/html/main.html b/html/main.html
index 3dccb6e3..e08d9c9f 100644
--- a/html/main.html
+++ b/html/main.html
@@ -18,6 +18,7 @@
<%template "logo" .%>
+
diff --git a/src/styles/components/_buddycondensed.scss b/src/styles/components/_buddycondensed.scss
new file mode 100644
index 00000000..ce8322c5
--- /dev/null
+++ b/src/styles/components/_buddycondensed.scss
@@ -0,0 +1,40 @@
+/*
+ * 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 .
+ *
+ */
+
+.buddycondensed {
+ display: table-cell;
+ width: 380px;
+ &.buddy {
+ background: none;
+ border-bottom: none;
+ min-height: 50px;
+ padding-left: 20px;
+ vertical-align: bottom;
+ .buddyPicture {
+ margin: 2px;
+ }
+ }
+ .more {
+ padding-left: 10px;
+ font-weight: bold;
+ }
+}
+
diff --git a/src/styles/main.scss b/src/styles/main.scss
index a260a449..c1cca9ec 100644
--- a/src/styles/main.scss
+++ b/src/styles/main.scss
@@ -38,6 +38,7 @@
@import "components/rightslide";
@import "components/bar";
@import "components/buddylist";
+@import "components/buddycondensed";
@import "components/buddypicturecapture";
@import "components/buddypictureupload";
@import "components/settings";
diff --git a/static/js/directives/buddycondensed.js b/static/js/directives/buddycondensed.js
new file mode 100644
index 00000000..743dd5f0
--- /dev/null
+++ b/static/js/directives/buddycondensed.js
@@ -0,0 +1,96 @@
+/*
+ * 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 .
+ *
+ */
+define(['angular', 'text!partials/buddycondensed.html'], function(angular, template) {
+
+ // buddycondensed
+ return ["mediaStream", function(mediaStream) {
+
+ var controller = ['$scope', '$element', 'mediaStream', 'buddyList', 'buddyPicture', 'contacts', function($scope, $element, mediaStream, buddyList, buddyPicture, contacts) {
+ var buddycondensed = [];
+ var joined = function(buddy) {
+ buddycondensed.push(buddy);
+ };
+ var left = function(id) {
+ for (var i in buddycondensed) {
+ if(buddycondensed[i].Id === id) {
+ buddycondensed.splice(i,1);
+ break;
+ }
+ }
+ $scope.$apply();
+ };
+ var contactadded = function(data) {
+ // replace session data with contact data
+ console.log('contactadded', data);
+ var hasSession = false;
+ for (var i in buddycondensed) {
+ if(buddycondensed[i].Userid === data.Userid) {
+ buddycondensed[i] = angular.extend(buddycondensed[i], data);
+ hasSession = true;
+ break;
+ }
+ }
+ if(!hasSession) {
+ joined(data);
+ }
+ $scope.$apply();
+ };
+ $scope.list = function() {
+ return buddycondensed;
+ };
+ $scope.maxBuddiesToShow = 5;
+ contacts.e.on("contactadded", function(event, data) {
+ contactadded(data);
+ });
+ mediaStream.api.e.on("received.userleftorjoined", function(event, dataType, data) {
+ console.log("received.userleftorjoined", data.Id);
+ if (dataType === "Left") {
+ left(data.Id);
+ } else {
+ joined(data);
+ }
+ });
+ mediaStream.api.e.on("received.users", function(event, data) {
+ console.log("received.users", data);
+ var selfId = $scope.id;
+ data.forEach(function(x) {
+ if (x.Id !== selfId) {
+ joined(x);
+ }
+ });
+ $scope.$apply();
+ });
+ }];
+
+ var link = function($scope, elem, attrs, ctrl) {};
+
+ return {
+ restrict: 'E',
+ scope: true,
+ replace: true,
+ link: link,
+ controller: controller,
+ template: template
+ };
+
+ }];
+
+});
diff --git a/static/js/directives/directives.js b/static/js/directives/directives.js
index 5c60c194..87fde716 100644
--- a/static/js/directives/directives.js
+++ b/static/js/directives/directives.js
@@ -44,7 +44,8 @@ define([
'directives/presentation',
'directives/youtubevideo',
'directives/bfi',
- 'directives/title'], function(_, onEnter, onEscape, statusMessage, buddyList, buddyPictureCapture, buddyPictureUpload, settings, chat, audioVideo, usability, audioLevel, fileInfo, screenshare, roomBar, socialShare, page, contactRequest, defaultDialog, pdfcanvas, odfcanvas, presentation, youtubevideo, bfi, title) {
+ 'directives/title',
+ 'directives/buddycondensed'], function(_, onEnter, onEscape, statusMessage, buddyList, buddyPictureCapture, buddyPictureUpload, settings, chat, audioVideo, usability, audioLevel, fileInfo, screenshare, roomBar, socialShare, page, contactRequest, defaultDialog, pdfcanvas, odfcanvas, presentation, youtubevideo, bfi, title, buddycondensed) {
var directives = {
onEnter: onEnter,
@@ -70,7 +71,11 @@ define([
presentation: presentation,
youtubevideo: youtubevideo,
bfi: bfi,
+<<<<<<< HEAD
title: title
+=======
+ buddycondensed: buddycondensed
+>>>>>>> 4177988... Add buddycondensed directive and css.
};
var initialize = function(angModule) {
diff --git a/static/partials/buddycondensed.html b/static/partials/buddycondensed.html
new file mode 100644
index 00000000..655c7ba4
--- /dev/null
+++ b/static/partials/buddycondensed.html
@@ -0,0 +1,6 @@
+
+
+
+
+ + {{list().length - maxBuddiesToShow}} {{_("more")}}
+