aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaZderMind2015-03-01 12:02:11 +0100
committerMaZderMind2015-03-01 12:02:11 +0100
commit787b5b657f6fa3251f8b0b4a770784f0ddaed407 (patch)
treef73c41e3107adfa617ae585efe0ce016094dc2e5
parent810f165a10910a0497503bc4bb79f03c14332120 (diff)
Chat-Panel
-rw-r--r--assets/css/_overview.less4
-rw-r--r--assets/css/_room.less27
-rw-r--r--assets/css/_structure.less3
-rw-r--r--assets/js/lustiges-script.js20
-rw-r--r--lib/helper.php39
-rw-r--r--template/assemblies/chat.phtml16
-rw-r--r--template/assemblies/irc.phtml10
-rw-r--r--template/room.phtml4
8 files changed, 81 insertions, 42 deletions
diff --git a/assets/css/_overview.less b/assets/css/_overview.less
index 1b9e3bb..c5d6ea4 100644
--- a/assets/css/_overview.less
+++ b/assets/css/_overview.less
@@ -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;
diff --git a/assets/css/_room.less b/assets/css/_room.less
index 911b4e3..91e71c0 100644
--- a/assets/css/_room.less
+++ b/assets/css/_room.less
@@ -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;
+ }
}
}
diff --git a/assets/css/_structure.less b/assets/css/_structure.less
index ae4dcca..1f38fbf 100644
--- a/assets/css/_structure.less
+++ b/assets/css/_structure.less
@@ -5,6 +5,9 @@
@img: '../img/';
+@jumbo-font-size: 52px;
+@jumbo-line-height: 45px;
+
// website configuration styles
.navbar {
diff --git a/assets/js/lustiges-script.js b/assets/js/lustiges-script.js
index ffd1e95..6d1d8c5 100644
--- a/assets/js/lustiges-script.js
+++ b/assets/js/lustiges-script.js
@@ -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
diff --git a/lib/helper.php b/lib/helper.php
index 647d657..fdd472e 100644
--- a/lib/helper.php
+++ b/lib/helper.php
@@ -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;
diff --git a/template/assemblies/chat.phtml b/template/assemblies/chat.phtml
new file mode 100644
index 0000000..e3aab6c
--- /dev/null
+++ b/template/assemblies/chat.phtml
@@ -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>
diff --git a/template/assemblies/irc.phtml b/template/assemblies/irc.phtml
deleted file mode 100644
index abca8ac..0000000
--- a/template/assemblies/irc.phtml
+++ /dev/null
@@ -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>
diff --git a/template/room.phtml b/template/room.phtml
index aa489fc..3a186df 100644
--- a/template/room.phtml
+++ b/template/room.phtml
@@ -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>