Browse Source

Merge pull request #341 from leonklingele/room-locking-ui

Add UI to lock/unlock a room
pull/346/head
Simon Eisenmann 9 years ago committed by GitHub
parent
commit
dbf2a522a2
  1. 1
      go/channelling/server/config.go
  2. 1
      server.conf.in
  3. 4
      src/styles/components/_social.scss
  4. 17
      static/js/directives/socialshare.js
  5. 7
      static/js/services/rooms.js
  6. 1
      static/partials/socialshare.html

1
go/channelling/server/config.go

@ -83,6 +83,7 @@ func NewConfig(container phoenix.Container, tokens bool) (*channelling.Config, e @@ -83,6 +83,7 @@ func NewConfig(container phoenix.Container, tokens bool) (*channelling.Config, e
"youtube": true,
"presentation": true,
"contacts": true,
"roomlocking": true,
}
modules := []string{}
for module := range modulesTable {

1
server.conf.in

@ -139,6 +139,7 @@ serverRealm = local @@ -139,6 +139,7 @@ serverRealm = local
;youtube = true
;presentation = true
;contacts = true
;roomlocking = true
[log]
;logfile = /var/log/spreed-webrtc-server.log

4
src/styles/components/_social.scss

@ -20,6 +20,10 @@ @@ -20,6 +20,10 @@
*/
.#{$fa-css-prefix} {
&.pin {
color: $social-email-color;
}
&.link {
color: $social-email-color;
}

17
static/js/directives/socialshare.js

@ -49,6 +49,7 @@ define(['text!partials/socialshare.html'], function(template) { @@ -49,6 +49,7 @@ define(['text!partials/socialshare.html'], function(template) {
replace: true,
link: function($scope, $element, $attr) {
$scope.$on("room.updated", function(ev, room) {
$scope.isRoomLocked = rooms.isLocked();
$scope.roomlink = rooms.link(room);
});
$scope.$on("room.left", function(ev) {
@ -69,6 +70,22 @@ define(['text!partials/socialshare.html'], function(template) { @@ -69,6 +70,22 @@ define(['text!partials/socialshare.html'], function(template) {
if (nw === "link") {
//$window.alert("Room link: " + $scope.roomlink);
alertify.dialog.notify(translation._("Room link"), '<a href="'+$scope.roomlink+'" rel="external" target="_blank">'+$scope.roomlink+'</a>');
} else if (nw === "pin") {
if (!$scope.isRoomLocked) {
// Lock
alertify.dialog.prompt(translation._("Please enter a new Room PIN to lock the room"), function(pin) {
rooms.setPIN(pin);
}, function() {
// Do nothing
});
} else {
// Unlock
alertify.dialog.confirm(translation._("Do you want to unlock the room?"), function() {
rooms.setPIN("");
}, function() {
// Do nothing
});
}
}
}
});

7
static/js/services/rooms.js

@ -260,12 +260,13 @@ define([ @@ -260,12 +260,13 @@ define([
console.log("Failed to set room PIN", error);
return $q.reject(error);
});
},
isLocked: function(room) {
room = room || currentRoom.Name
return roompin.get(room) !== null;
}
};
// NOTE(lcooper): For debugging only, do not use this on production.
$window.setRoomPIN = rooms.setPIN;
return rooms;
}];
});

1
static/partials/socialshare.html

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
<div class="socialshare btn-group" ng-show="roomlink">
<a ng-show="withModule('roomlocking')" title="{{_('Room PIN')}}" class="btn btn-link btn-sm" data-nw="pin"><i class="fa fa-lg pin" ng-class="isRoomLocked ? 'fa-lock' : 'fa-unlock'"></i></a>
<a title="{{_('Room link')}}" target="_blank" rel="external" href="{{roomlink}}" class="btn btn-link btn-sm" data-nw="link"><i class="fa fa-link fa-lg link"></i></a>
<a title="{{_('Invite by Email')}}" class="btn btn-link btn-sm" data-nw="email"><i class="fa fa-envelope fa-lg email"></i></a>
<a title="{{_('Invite with Facebook')}}" class="btn btn-link btn-sm" data-nw="facebook"><i class="fa fa-facebook fa-lg facebook"></i></a>

Loading…
Cancel
Save