14 changed files with 165 additions and 20 deletions
@ -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; |
||||
} |
||||
@ -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"); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
} |
||||
|
||||
}]; |
||||
|
||||
}); |
||||
@ -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> |
||||
|
||||
@ -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> |
||||
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue