Commit 8190defe authored by Simon Daron's avatar Simon Daron

MEP archives

parent 5683d147
......@@ -115,7 +115,7 @@ button.check, a.check {
-moz-border-radius: 0.2em;
-webkit-border-radius: 0.2em;
}
#Nav .check{background:#222;}
#Nav .icon-check{background:#222;}
button.check:before, a.check:before {
display:inline-block;
width:1.5em;
......
......@@ -97,6 +97,65 @@ $(function() {
/****************************************************/
/**** AUDIOPLAYER ****/
/****************************************************/
var timer = null,
interval = 5000;
$('#WhatsOnAir').on('load',function(){
var WhatsOnAir = $(this);
$.getJSON('/onair.json', function(onair) {
WhatsOnAir.fadeOut();
if(onair.data.episode || onair.data.emission){
var onairContainer = $('<span>');
if(onair.data.emission){
$('<a>',{href:onair.data.emission.url,html:onair.data.emission.title}).appendTo(onairContainer).ajaxifyClick();
}
if(onair.data.episode){
$('<a>',{href:onair.data.episode.url,html:onair.data.episode.title}).appendTo(onairContainer).ajaxifyClick();
}
WhatsOnAir.empty().append(onairContainer);
} else if (onair.data.nonstop) {
result = onair.data.nonstop.title;
WhatsOnAir.html('<span>' + result + '</span>');
}
else{WhatsOnAir.html('<span>Unknown (Probably Non-Stop)</span>');}
WhatsOnAir.fadeIn();
});
});
$('#RefreshWhatsOnAir').on('activate',function(e){
$(this).addClass('spinning');
$('#WhatsOnAir').addClass('active');
$('#WhatsOnAir').trigger('load');
timer = setInterval( "$('#WhatsOnAir').trigger('load');", interval);
}).on('deactivate',function(e){
$(this).removeClass('spinning');
$('#WhatsOnAir').removeClass('active');
clearInterval(timer);
}).on('click',function(e){
$(this).toggleClass('spinning');
if($(this).is('.spinning')){
$(this).trigger('activate');
}else{$(this).trigger('deactivate');}
return false;
}).trigger('activate');
$("#DirectStreamPanikControler").on('click',function(e) {
e.preventDefault();
var stream = $('#DirectStreamPanik').get(0);
if (stream.paused == false){
stream.pause();
}else{
stream.play();
}
return false;
});
$('#DirectStreamPanik').on('play',function(){
$('audio:not(#DirectStreamPanik)').each(function(){this.pause();});
$('#streamSymbol').removeClass('icon-volume-up').addClass('icon-pause');
$('#RefreshWhatsOnAir').trigger('activate');
}).on('pause',function(){
//$('audio:not(#DirectStreamPanik)').each(function(){this.pause();});
$('#streamSymbol').addClass('icon-volume-up').removeClass('icon-pause');
$('#RefreshWhatsOnAir').trigger('deactivate');
});
if($('#player-container').offset()){
var topPosition = 0;
topPosition = $('#player-container').offset().top;
......
......@@ -18,6 +18,15 @@
<div class="big error padded center">Sorry, no result with your query!</div>
{% endif %}
{% if search_query and episodes or episodes.count <= 24 %}
<ul class="custom columns list">
{% for episode in episodes %}
<li class="item {% if episode.emission.categories.all.count = 0 %}nocat{% endif %} {% for category in episode.emission.categories.all %} {{ category|slugify }}{% endfor %}">
{% episode_resume model="inline" klass="standalone"%}
</li>
{% endfor %}
</ul>
{% else %}
<div id="Emission-container" class="emission padded">
{% if episodes %}
{% with episodes as episodes %}
......@@ -42,5 +51,6 @@
{% endwith %}
{% endif %}
</div>
{% endif %}
</div>
{% endblock %}
......@@ -37,64 +37,5 @@
<div id="playlistLabel" class="label button">Playlist&nbsp;<span class="icon-list" title="Show/Hide playlist"></span></div>
</div>
</div>
<script type="text/javascript">
$(function() {
var timer = null,
interval = 5000;
$('#WhatsOnAir').on('load',function(){
var WhatsOnAir = $(this);
$.getJSON('/onair.json', function(onair) {
WhatsOnAir.fadeOut();
if(onair.data.episode || onair.data.emission){
var result = '';
result = result + ($.type(onair.data.emission) == 'object'?'<span>'+onair.data.emission.title+'</span>':'');
result = result + ($.type(onair.data.episode) == 'object'?'&nbsp;|&nbsp;<span>'+onair.data.episode.title+'</span>':'');
//var container = $('<a>',{class:"intercepted",href:onair.data.emission.url,html:result});
WhatsOnAir.html(result);
} else if (onair.data.nonstop) {
result = onair.data.nonstop.title;
WhatsOnAir.html('<span>' + result + '</span>');
}
else{WhatsOnAir.html('<span>Unknown (Probably Non-Stop)</span>');}
WhatsOnAir.fadeIn();
});
});
$('#RefreshWhatsOnAir').on('activate',function(e){
$(this).addClass('spinning');
$('#WhatsOnAir').addClass('active');
$('#WhatsOnAir').trigger('load');
timer = setInterval( "$('#WhatsOnAir').trigger('load');", interval);
}).on('deactivate',function(e){
$(this).removeClass('spinning');
$('#WhatsOnAir').removeClass('active');
clearInterval(timer);
}).on('click',function(e){
$(this).toggleClass('spinning');
if($(this).is('.spinning')){
$(this).trigger('activate');
}else{$(this).trigger('deactivate');}
return false;
}).trigger('activate');
$("#DirectStreamPanikControler").on('click',function(e) {
e.preventDefault();
var stream = $('#DirectStreamPanik').get(0);
if (stream.paused == false){
stream.pause();
}else{
stream.play();
}
return false;
});
$('#DirectStreamPanik').on('play',function(){
$('audio:not(#DirectStreamPanik)').each(function(){this.pause();});
$('#streamSymbol').removeClass('icon-volume-up').addClass('icon-pause');
$('#RefreshWhatsOnAir').trigger('activate');
}).on('pause',function(){
//$('audio:not(#DirectStreamPanik)').each(function(){this.pause();});
$('#streamSymbol').addClass('icon-volume-up').removeClass('icon-pause');
$('#RefreshWhatsOnAir').trigger('deactivate');
});
});
</script>
</div>
</div>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment