Merge branch 'saas-dev-publishing' of github.com:sourcefabric/airtime into saas-dev-publishing
This commit is contained in:
commit
dc5e81ee9b
|
@ -82,6 +82,7 @@ class IndexController extends Zend_Controller_Action
|
||||||
|
|
||||||
$stationName = Application_Model_Preference::GetStationName();
|
$stationName = Application_Model_Preference::GetStationName();
|
||||||
$this->view->podcastTitle = sprintf(_("%s Podcast"), !empty($stationName) ? $stationName : $CC_CONFIG["stationId"]);
|
$this->view->podcastTitle = sprintf(_("%s Podcast"), !empty($stationName) ? $stationName : $CC_CONFIG["stationId"]);
|
||||||
|
$this->view->emptyPodcastMessage = _("No tracks have been published yet.");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -243,46 +243,52 @@
|
||||||
ready: function () {
|
ready: function () {
|
||||||
|
|
||||||
var episodes = <?php echo $this->episodes ?>;
|
var episodes = <?php echo $this->episodes ?>;
|
||||||
buildJplayerPlaylist(0, episodes);
|
var empty_podcast_message = "<?php echo $this->emptyPodcastMessage ?>";
|
||||||
|
|
||||||
// update current track metadata on player bar
|
if (Object.keys(episodes).length <= 0) {
|
||||||
$("#jquery_jplayer_1").bind(jQuery.jPlayer.event.play, function (event)
|
$(".jp-playlist").append(empty_podcast_message);
|
||||||
{
|
} else {
|
||||||
var current = _playlist_jplayer.current;
|
buildJplayerPlaylist(0, episodes);
|
||||||
$('.current-track span').html(playlist[current].title);
|
|
||||||
});
|
|
||||||
|
|
||||||
// build pagination menu
|
|
||||||
var pages = "<li data-page-index='0'><</li>";
|
|
||||||
$.each(episodes, function(index, value) {
|
|
||||||
var page_number = +index + 1;
|
|
||||||
pages += "<li data-page-index='"+index+"'>"+page_number+"</li>";
|
|
||||||
});
|
|
||||||
var last_index = Object.keys(episodes).length -1;
|
|
||||||
pages += "<li data-page-index='"+last_index+"'>></li>";
|
|
||||||
$("ul.pagination").append(pages);
|
|
||||||
$("ul.pagination").find("li:contains('1')").addClass('current');
|
|
||||||
|
|
||||||
// pagination click
|
// update current track metadata on player bar
|
||||||
$("ul.pagination li").click(function() {
|
$("#jquery_jplayer_1").bind(jQuery.jPlayer.event.play, function (event) {
|
||||||
buildJplayerPlaylist($(this).attr("data-page-index"), episodes);
|
var current = _playlist_jplayer.current;
|
||||||
$(this).siblings().removeClass('current');
|
$('.current-track span').html(playlist[current].title);
|
||||||
if ($(this).text() === "<") {
|
});
|
||||||
$(this).next().addClass("current");
|
|
||||||
} else if ($(this).text() ===">") {
|
|
||||||
$(this).prev().addClass("current");
|
|
||||||
} else {
|
|
||||||
$(this).addClass('current');
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
// build pagination menu
|
||||||
|
var pages = "<li data-page-index='0'><</li>";
|
||||||
|
$.each(episodes, function (index, value) {
|
||||||
|
var page_number = +index + 1;
|
||||||
|
pages += "<li data-page-index='" + index + "'>" + page_number + "</li>";
|
||||||
|
});
|
||||||
|
var last_index = Object.keys(episodes).length - 1;
|
||||||
|
pages += "<li data-page-index='" + last_index + "'>></li>";
|
||||||
|
$("ul.pagination").append(pages);
|
||||||
|
$("ul.pagination").find("li:contains('1')").addClass('current');
|
||||||
|
|
||||||
//turn off player bar when podcast track is played
|
// pagination click
|
||||||
$("a.jp-playlist-item, .jp-play, .podcast_play").click(function() {
|
$("ul.pagination li").click(function () {
|
||||||
if ($("#player_iframe").contents().find('.play').hasClass('pause')) {
|
buildJplayerPlaylist($(this).attr("data-page-index"), episodes);
|
||||||
$("#player_iframe").contents().find('.play').click();
|
$(this).siblings().removeClass('current');
|
||||||
}
|
if ($(this).text() === "<") {
|
||||||
});
|
$(this).next().addClass("current");
|
||||||
|
} else if ($(this).text() === ">") {
|
||||||
|
$(this).prev().addClass("current");
|
||||||
|
} else {
|
||||||
|
$(this).addClass('current');
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
//turn off player bar when podcast track is played
|
||||||
|
$("a.jp-playlist-item, .jp-play, .podcast_play").click(function () {
|
||||||
|
if ($("#player_iframe").contents().find('.play').hasClass('pause')) {
|
||||||
|
$("#player_iframe").contents().find('.play').click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue