Browse Source

Implemented social links for email, facebook, twitter, google plus and xing.

pull/3/head
Simon Eisenmann 12 years ago
parent
commit
c489ab07e0
  1. 22
      src/i18n/messages-de.po
  2. 20
      src/i18n/messages.pot
  3. 13
      src/styles/components/_roombar.scss
  4. 15
      src/styles/components/_social.scss
  5. 1
      src/styles/main.scss
  6. 12
      static/js/controllers/mediastreamcontroller.js
  7. 2
      static/js/controllers/roomchangecontroller.js
  8. 8
      static/js/directives/directives.js
  9. 66
      static/js/directives/socialshare.js
  10. 2
      static/js/services/mediastream.js
  11. 13
      static/partials/roombar.html
  12. 7
      static/partials/socialshare.html
  13. 2
      static/partials/usability.html
  14. 2
      static/translation/messages-de.json

22
src/i18n/messages-de.po

@ -8,8 +8,8 @@ msgid "" @@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Spreed Speak Freely\n"
"Report-Msgid-Bugs-To: simon@struktur.de\n"
"POT-Creation-Date: 2014-03-03 15:01+0100\n"
"PO-Revision-Date: 2014-03-03 15:03+0100\n"
"POT-Creation-Date: 2014-03-03 19:00+0100\n"
"PO-Revision-Date: 2014-03-03 19:00+0100\n"
"Last-Translator: Simon Eisenmann <simon@struktur.de>\n"
"Language-Team: de <LL@li.org>\n"
"Plural-Forms: nplurals=1; plural=0\n"
@ -210,6 +210,21 @@ msgstr "Einstellungen merken" @@ -210,6 +210,21 @@ msgstr "Einstellungen merken"
msgid "Apply"
msgstr "Übernehmen"
msgid "Share by Email"
msgstr "Per E-Mail teilen"
msgid "Share on Facebook"
msgstr "Auf Facebook teilen"
msgid "Share on Twitter"
msgstr "Auf Twitter teilen"
msgid "Share on Google Plus"
msgstr "Auf Google Plus teilen"
msgid "Share on XING"
msgstr "Auf XING teilen"
msgid "Initializing"
msgstr "Initialisiere"
@ -388,6 +403,9 @@ msgstr "Gruppen-Chat" @@ -388,6 +403,9 @@ msgstr "Gruppen-Chat"
msgid "Your browser does not support file transfer."
msgstr "Mit Ihrem Browser können keine Dateien übertragen werden."
msgid "Meet with me here:"
msgstr "Meeting:"
msgid "Error"
msgstr "Fehler"

20
src/i18n/messages.pot

@ -9,7 +9,7 @@ msgid "" @@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Spreed Speak Freely 1.0\n"
"Report-Msgid-Bugs-To: simon@struktur.de\n"
"POT-Creation-Date: 2014-03-03 15:01+0100\n"
"POT-Creation-Date: 2014-03-03 19:00+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -210,6 +210,21 @@ msgstr "" @@ -210,6 +210,21 @@ msgstr ""
msgid "Apply"
msgstr ""
msgid "Share by Email"
msgstr ""
msgid "Share on Facebook"
msgstr ""
msgid "Share on Twitter"
msgstr ""
msgid "Share on Google Plus"
msgstr ""
msgid "Share on XING"
msgstr ""
msgid "Initializing"
msgstr ""
@ -382,6 +397,9 @@ msgstr "" @@ -382,6 +397,9 @@ msgstr ""
msgid "Your browser does not support file transfer."
msgstr ""
msgid "Meet with me here:"
msgstr ""
msgid "Error"
msgstr ""

13
src/styles/components/_roombar.scss

@ -35,6 +35,10 @@ @@ -35,6 +35,10 @@
padding:4px 4px 4px 30px;
vertical-align:middle;
}
#roombar .roombarcontent {
display:inline-block;
margin-left:.5em;
}
.roombarbutton {
font-size:20px;
vertical-align:middle;
@ -47,14 +51,17 @@ @@ -47,14 +51,17 @@
z-index:15;
opacity:0.7;
}
.roombarcontent {
display:inline-block;
max-width:300px;
.roombarcontent .input-group {
max-width:160px;
}
.roombarcontent > * {
padding-right:.5em;
}
.roombar .roomlabellabel {
display:none;
opacity: 0.7;
text-align:left;
margin-left:0.5em;
}
#roombar .roombar.notvisible {
.roombarcontent {

15
src/styles/components/_social.scss

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
i.email, span.email {
color: #aaa;
}
i.facebook, span.facebook {
color: #45619d;
}
i.twitter, span.twitter {
color: #00aced;
}
i.google, span.google {
color: #dd4b39;
}
i.xing, span.xing {
color: #fff;
}

1
src/styles/main.scss

@ -41,5 +41,6 @@ @@ -41,5 +41,6 @@
@import "components/audiovideo";
@import "components/screenshare";
@import "components/roombar";
@import "components/social";
@import "shame";

12
static/js/controllers/mediastreamcontroller.js

@ -301,9 +301,17 @@ define(['underscore', 'bigscreen', 'moment', 'webrtc.adapter', 'webrtc.ice'], fu @@ -301,9 +301,17 @@ define(['underscore', 'bigscreen', 'moment', 'webrtc.adapter', 'webrtc.ice'], fu
};
$scope.manualReloadApp = function() {
$scope.manualReloadApp = function(url) {
manualUnload = true;
$window.location.reload(true);
if (url) {
$window.location.href = url;
$timeout(function() {
manualUnload = false;
}, 0);
} else {
$window.location.reload(true);
}
};
$scope.$watch("cameraMute", function(cameraMute) {

2
static/js/controllers/roomchangecontroller.js

@ -66,7 +66,7 @@ define([], function() { @@ -66,7 +66,7 @@ define([], function() {
ctrl.getRoom(function(roomdata) {
console.info("Retrieved room data", roomdata);
$scope.roomdata = roomdata;
roomdata.link = mediaStream.url.room(roomdata.name);
roomdata.link = $scope.roomlink = mediaStream.url.room(roomdata.name);
});
}
}, 100);

8
static/js/directives/directives.js

@ -32,8 +32,9 @@ define([ @@ -32,8 +32,9 @@ define([
'directives/audiolevel',
'directives/fileinfo',
'directives/screenshare',
'directives/roombar'
], function(_, onEnter, onEscape, statusMessage, buddyList, settings, chat, audioVideo, usability, audioLevel, fileInfo, screenshare, roomBar) {
'directives/roombar',
'directives/socialshare'
], function(_, onEnter, onEscape, statusMessage, buddyList, settings, chat, audioVideo, usability, audioLevel, fileInfo, screenshare, roomBar, socialShare) {
var directives = {
onEnter: onEnter,
@ -47,7 +48,8 @@ define([ @@ -47,7 +48,8 @@ define([
audioLevel: audioLevel,
fileInfo: fileInfo,
screenshare: screenshare,
roomBar: roomBar
roomBar: roomBar,
socialShare: socialShare
};
var initialize = function (angModule) {

66
static/js/directives/socialshare.js

@ -0,0 +1,66 @@ @@ -0,0 +1,66 @@
/*
* Spreed Speak Freely.
* Copyright (C) 2013-2014 struktur AG
*
* This file is part of Spreed Speak Freely.
*
* 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(['jquery', 'text!partials/socialshare.html'], function($, template) {
var urls = {
email: "mailto:?subject=_TEXT_%20_URL_",
facebook: "https://www.facebook.com/sharer.php?u=_URL_&t=_TEXT_",
twitter: "https://twitter.com/share?url=_URL_&text=_TEXT_&via=_SITE_",
google: "https://plus.google.com/share?url=_URL_",
xing: "https://www.xing.com/app/user?op=share;url=_URL_"
};
// socialShare
return ["$window", "translation", function($window, translation) {
var title = $window.encodeURIComponent($window.document.title);
var makeUrl = function(nw, target) {
var url = urls[nw];
if (url) {
url = url.replace(/_URL_/, $window.encodeURIComponent(target)).replace(/_TEXT_/, $window.encodeURIComponent(translation._("Meet with me here:"))).replace(/_SITE_/, title);
}
return url;
};
return {
scope: true,
restrict: "E",
template: template,
replace: true,
link: function($scope, $element, $attr) {
$element.on("click", "a", function(event) {
var nw = $(event.currentTarget).data("nw");
var url = makeUrl(nw, $scope.roomlink);
if (url) {
if (nw==="email") {
// Hack our way to disable unload popup for mail links.
$scope.manualReloadApp(url);
} else {
$window.open(url, "social_"+nw, "menubar=no,toolbar=no,resizable=yes,width=600,height=600,scrollbars=yes");
}
}
});
}
}
}];
});

2
static/js/services/mediastream.js

@ -132,7 +132,7 @@ define([ @@ -132,7 +132,7 @@ define([
connector.room(room);
}
$rootScope.roomid = room;
$rootScope.roomlink = mediaStream.url.room(room);
$rootScope.roomlink = room ? mediaStream.url.room(room) : null;
});
$rootScope.$on("roomStatus", function(event, status) {

13
static/partials/roombar.html

@ -1,14 +1,15 @@ @@ -1,14 +1,15 @@
<div class="roombar form-horizontal" ng-class="{notvisible: hideRoomBar}">
<a class="roombarbutton" ng-model="hideRoomBar" btn-checkbox btn-checkbox-true="0" btn-checkbox-false="1" title="{{_('Change room')}}"><i class="fa fa-th"></i></a>
<form name="roombarform" class="roombarcontent form-group">
<div class="roomlabelinput">
<label class="col-xs-2 control-label hidden-xs">{{_('Room')}}</label>
<div class="col-xs-8">
<div class="input-group">
<input class="form-control" ng-model="newroomid" ng-keyup="hitEnter($event)" type="text" placeholder="{{_('Main')}}"></input><span ng-if="roomid && roombarform.$pristine" class="input-group-btn"><a class="btn btn-default" title="{{_('Leave room')}}" ng-click="exit()"><i class="fa fa-eraser"></i></a></span><span ng-if="!roomid || !roombarform.$pristine" class="input-group-btn"><a class="btn btn-default" title="{{_('Change room')}}" ng-click="save()"><i class="fa fa-arrow-right"></i></a></span>
</div>
<label class="pull-left control-label hidden-xs">{{_('Room')}}</label>
<div class="pull-left">
<div class="input-group">
<input class="form-control" ng-model="newroomid" ng-keyup="hitEnter($event)" type="text" placeholder="{{_('Main')}}"></input><span ng-if="roomid && roombarform.$pristine" class="input-group-btn"><a class="btn btn-default" title="{{_('Leave room')}}" ng-click="exit()"><i class="fa fa-eraser"></i></a></span><span ng-if="!roomid || !roombarform.$pristine" class="input-group-btn"><a class="btn btn-default" title="{{_('Change room')}}" ng-click="save()"><i class="fa fa-arrow-right"></i></a></span>
</div>
</div>
<div class="pull-left">
<social-share/>
</div>
</form>
<label class="control-label roomlabellabel" title="{{_('Current room')}}">{{roomid}}</label>
</div>

7
static/partials/socialshare.html

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
<div class="socialshare btn-group" ng-show="roomlink">
<a title="{{_('Share by Email')}}" class="btn btn-link" data-nw="email"><i class="fa fa-envelope fa-lg email"></i></a>
<a title="{{_('Share on Facebook')}}" class="btn btn-link" data-nw="facebook"><i class="fa fa-facebook fa-lg facebook"></i></a>
<a title="{{_('Share on Twitter')}}" class="btn btn-link" data-nw="twitter"><i class="fa fa-twitter fa-lg twitter"></i></a>
<a title="{{_('Share on Google Plus')}}" class="btn btn-link" data-nw="google"><i class="fa fa-google-plus fa-lg google"></i></a>
<a title="{{_('Share on XING')}}" class="btn btn-link" data-nw="xing"><i class="fa fa-xing fa-lg xing"></i></a>
</div>

2
static/partials/usability.html

@ -18,6 +18,7 @@ @@ -18,6 +18,7 @@
<li><i class="fa-li fa fa-repeat"></i>{{_("You can use and re-use this room as many times as you want.")}}</li>
</ul>
</small>
<social-share/>
</div>
</div>
<div ng-switch-when="noroom" ng-controller="RoomchangeController">
@ -38,6 +39,7 @@ @@ -38,6 +39,7 @@
<li><i class="fa-li fa fa-repeat"></i>{{_("You can use and re-use this room as many times as you want.")}}</li>
</ul>
</small>
<social-share/>
</div>
<div ng-switch-when="usermedia"><i><i class="fa fa-hand-o-up fa-4x pull-right"></i>{{_("Please allow access to your camera and microphone.")}}</i></div>
<div ng-switch-when="denied"><i><i class="fa fa-exclamation-triangle fa-4x pull-right"></i>{{_("Camera / microphone access required.")}}</i></div>

2
static/translation/messages-de.json

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save