summaryrefslogtreecommitdiff
path: root/templates/themes
diff options
context:
space:
mode:
authorBenjamin Southall <applemansigloo@gmail.com>2017-04-25 00:04:36 +0900
committerBenjamin Southall <applemansigloo@gmail.com>2017-04-25 00:04:36 +0900
commit501f2694ffc48968abbf75309522af4171805935 (patch)
tree32ac2a8617279feb56661686259dacb7f3db473f /templates/themes
parent03f814cfcbae2c136e69906a89db7f59c89c6db8 (diff)
Updates to Radio theme / extension in order to have MP3, OGG playlists and Audio sources as configurable.
Diffstat (limited to 'templates/themes')
-rw-r--r--templates/themes/radio/info.php22
-rw-r--r--templates/themes/radio/radio.html24
2 files changed, 32 insertions, 14 deletions
diff --git a/templates/themes/radio/info.php b/templates/themes/radio/info.php
index 2ae31fbd..06dffd86 100644
--- a/templates/themes/radio/info.php
+++ b/templates/themes/radio/info.php
@@ -22,7 +22,27 @@ $theme = array(
array('title' => 'Radio Status URL',
'name' => 'radiostatus',
'type' => 'text',
- 'default' => '/radio_assets/status.xsl')),
+ 'default' => '/radio_assets/status.xsl'),
+ array('title' => 'Radio MP3 Playlist',
+ 'name' => 'radiomp3playlist',
+ 'type' => 'text',
+ 'default' => ''),
+
+ array('title' => 'Radio OGG Playlist',
+ 'name' => 'radiooggplaylist',
+ 'type' => 'text',
+ 'default' => ''),
+
+ array('title' => 'Radio MP3 Source',
+ 'name' => 'radiomp3source',
+ 'type' => 'text',
+ 'default' => ''),
+
+ array('title' => 'Radio OGG Source',
+ 'name' => 'radiooggsource',
+ 'type' => 'text',
+ 'default' => ''),
+ ),
'build_function' => 'radio_build');
?>
diff --git a/templates/themes/radio/radio.html b/templates/themes/radio/radio.html
index 1ba81104..d753dc29 100644
--- a/templates/themes/radio/radio.html
+++ b/templates/themes/radio/radio.html
@@ -9,7 +9,7 @@
<link rel="stylesheet" media="screen" href="/stylesheets/style.css"/>
<link rel="stylesheet" media="screen" href="/stylesheets/cyberpunk.css"/>
<link rel="stylesheet" href="/stylesheets/font-awesome/css/font-awesome.min.css">
-<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
+<script src="https://lainchan.org/js/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
check_status();
@@ -19,13 +19,11 @@ $(document).ready(function(){
function check_status(){
$.get("{{ settings.radiostatus }}", function(data){
var el = $( '<div></div>' );
-el.html(data);
-var sd = el.find(".streamdata");
-
-$(".nowplaying").text("Now playing: " + sd[16].textContent);
-
-$(".currentlisteners").text("Current listeners: " + sd[13].textContent); });
-}
+el.html(data.getElementsByTagName('html')[0].innerHTML);
+ var sd = el.find(".streamstats");
+ $(".nowplaying").text("Now playing: " + sd[5].textContent);
+ $(".currentlisteners").text("Current listeners: " + (parseInt(sd[2].textContent) + parseInt(sd[8].textContent)));
+});}
</script>
</head>
<body style=" background: url(/bg.php) no-repeat center center fixed;
@@ -51,7 +49,7 @@ $(".currentlisteners").text("Current listeners: " + sd[13].textContent); });
<p>Welcome to lainchan's radio stream.
</p>
- <noscript><p>Radio statistics will be not be updated without JavaScript, please visit https://lainchan.org/radio_assets/status.xsl to see them directly.</p></noscript>
+ <noscript><p>Radio statistics will be not be updated without JavaScript, please visit {{ settings.radiostatus }} to see them directly.</p></noscript>
<p class="nowplaying"> Now playing:
</p>
@@ -60,15 +58,15 @@ $(".currentlisteners").text("Current listeners: " + sd[13].textContent); });
<ul>
- <li><a href="https://lainchan.org/static/lain.ogg.m3u">Vorbis M3U Playlist</a></li>
- <li><a href="https://lainchan.org/static/lain.mp3.m3u">MP3 M3U Playlist</a></li>
+ <li><a href="{{ settings.radiooggplaylist }}">Vorbis M3U Playlist</a></li>
+ <li><a href="{{ settings.radiomp3playlist }}">MP3 M3U Playlist</a></li>
XSPF considered harmful.
</ul>
<audio controls preload="none" style="margin: 0 5% 20px 5%; width: 90%; box-shadow: 0px 0px 5px black;">
- <source src="https://lainchan.org/radio_assets/lain.ogg" type="audio/ogg">
- <source src="https://lainchan.org/radio_assets/lain" type="audio/mpeg">
+ <source src="{{ settings.radiooggsource }}" type="audio/ogg">
+ <source src="{{ settings.radiomp3source }}" type="audio/mpeg">
<em>Your browser lacks support for OGG Vorbis files. Please open the M3U file or XSPF file in a multimedia player.</em>
</audio>
</div>