Chat-Panel

This commit is contained in:
MaZderMind 2015-03-01 12:02:11 +01:00
parent 810f165a10
commit 787b5b657f
8 changed files with 81 additions and 42 deletions

View file

@ -45,8 +45,8 @@
}
.recordings a {
font-size: 72px;
line-height: 52px;
font-size: @jumbo-font-size;
line-height: @jumbo-line-height;
display: block;
text-align: center;

View file

@ -3,6 +3,9 @@
border-bottom: 1px solid #ddd;
border-right: 1px solid #ddd;
}
.player-wrap.tab-content {
padding: 40px 0;
}
@ -25,17 +28,25 @@
margin: 0 auto;
}
.functions-wrap {
h3 { margin-top: 0; }
.functions-wrap #switcher {
.row {
margin-bottom: 36px;
&:last-child {
margin-bottom: 0;
}
margin-bottom: @padding-large-vertical;
}
.btn-group {
margin-bottom: @padding-base-horizontal;
margin-bottom: @padding-base-vertical;
}
}
.functions-wrap .chat {
text-align: center;
overflow: hidden;
> div {
margin: 25px;
> a {
font-size: @jumbo-font-size;
}
}
}

View file

@ -5,6 +5,9 @@
@img: '../img/';
@jumbo-font-size: 52px;
@jumbo-line-height: 45px;
// website configuration styles
.navbar {

View file

@ -183,26 +183,6 @@ $(function() {
$(window).on('hashchange', setTabToHash).trigger('hashchange');
});
// click-to-irc
$(function() {
$('.click-to-irc').on('click', function(e) {
if($(this).hasClass('activating'))
return;
if($(e.target).hasClass('irclink'))
return;
var
$irc = $(this).addClass('activating'),
$iframe = $(this).find('iframe');
$iframe.on('load', function() {
$irc.addClass('active');
}).attr('src', $iframe.data('src'));
});
});
// programm-timeline
$(function() {
var

View file

@ -184,6 +184,45 @@ function room_has_hls($room)
return count(array_intersect(array('hls-hd', 'hls-sd'), $formats)) > 0;
}
function room_has_irc($room)
{
return get("ROOMS.$room.IRC") && has("IRC");
}
function room_has_twitter($room)
{
return get("ROOMS.$room.TWITTER") && has("TWITTER");
}
function room_has_chat($room)
{
return room_has_irc($room) || room_has_twitter($room);
}
function room_get_irc_url($room)
{
$cfg = get("ROOMS.$room.IRC_CONFIG", get("IRC"));
return sprintf($cfg['URL'], rawurlencode($room));
}
function room_get_irc_display($room)
{
$cfg = get("ROOMS.$room.IRC_CONFIG", get("IRC"));
return sprintf($cfg['DISPLAY'], $room);
}
function room_get_twitter_hashtag($room)
{
$cfg = get("ROOMS.$room.TWITTER_CONFIG", get("TWITTER"));
return sprintf($cfg['TEXT'], $room);
}
function room_get_twitter_display($room)
{
$cfg = get("ROOMS.$room.TWITTER_CONFIG", get("TWITTER"));
return sprintf($cfg['DISPLAY'], $room);
}
function startswith($needle, $haystack)
{
return substr($haystack, 0, strlen($needle)) == $needle;

View file

@ -0,0 +1,16 @@
<div class="chat">
<? if(room_has_irc($room)): ?>
<div>
<a class="btn btn-primary irclink" href="<?=h(room_get_irc_url($room))?>">
<span class="fa fa-comment"></span> <?=h(room_get_irc_display($room))?>
</a>
</div>
<? endif ?>
<? if(room_has_twitter($room)): ?>
<div>
<a class="btn btn-success twitterlink" href="https://twitter.com/intent/tweet?text=<?=h(rawurlencode(room_get_twitter_hashtag($room)))?>" target="_blank">
<span class="fa fa-twitter"></span> <?=h(room_get_twitter_display($room))?>
</a>
</div>
<? endif ?>
</div>

View file

@ -1,10 +0,0 @@
<div class="click-to-irc">
<div class="activator">
Click to Activate
<br />
<a class="irclink" href="irc://irc.hackint.eu:6667/<?=h(urlencode(irc_channel($room)))?>">#<?=h(irc_channel($room))?> @ hackint</a>
<br />
<a class="twitterlink" href="https://twitter.com/intent/tweet?text=<?=h(urlencode(twitter_hashtag($room)))?>" target="_blank"><?=h(twitter_hashtag($room))?> @ twitter</a>
</div>
<iframe data-src="http://evility.net/cgiirc/irc.cgi?chan=<?=h(rawurlencode('#'.irc_channel($room)))?>" width="1020" height="372" border="0"></iframe>
</div>

View file

@ -27,7 +27,7 @@
<li class="active">
<a href="#switcher" role="tab" data-toggle="tab">Formats</a>
</li>
<? if((get("ROOMS.$room.IRC") && has("IRC")) || (get("ROOMS.$room.TWITTER") && has("TWITTER"))): ?>
<? if(room_has_chat($room)): ?>
<li>
<a href="#chat" role="tab" data-toggle="tab">Chat</a>
</li>
@ -48,7 +48,7 @@
<div role="tabpanel" class="tab-pane active" id="switcher">
<? include("$assemblies/switcher/$tab.phtml") ?>
</div>
<? if((get("ROOMS.$room.IRC") && has("IRC")) || (get("ROOMS.$room.TWITTER") && has("TWITTER"))): ?>
<? if(room_has_chat($room)): ?>
<div role="tabpanel" class="tab-pane" id="chat">
<? include("$assemblies/chat.phtml") ?>
</div>