2013-11-20 16:08:12 -05:00
|
|
|
|
(function ($, document, apiClient) {
|
|
|
|
|
|
|
|
|
|
function getChannelsHtml(channels) {
|
|
|
|
|
|
2014-01-07 13:39:35 -05:00
|
|
|
|
return LibraryBrowser.getPosterViewHtml({
|
|
|
|
|
items: channels,
|
|
|
|
|
useAverageAspectRatio: true,
|
|
|
|
|
shape: "backdrop",
|
|
|
|
|
centerText: true
|
|
|
|
|
});
|
2013-11-20 16:08:12 -05:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function renderChannels(page, channels) {
|
|
|
|
|
|
|
|
|
|
$('#items', page).html(getChannelsHtml(channels)).trigger('create');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$(document).on('pagebeforeshow', "#liveTvChannelsPage", function () {
|
|
|
|
|
|
|
|
|
|
var page = this;
|
|
|
|
|
|
2013-11-25 21:53:48 -05:00
|
|
|
|
apiClient.getLiveTvChannels({
|
|
|
|
|
|
|
|
|
|
userId: Dashboard.getCurrentUserId()
|
|
|
|
|
|
|
|
|
|
}).done(function (result) {
|
2013-11-20 16:08:12 -05:00
|
|
|
|
|
2013-11-25 15:39:23 -05:00
|
|
|
|
renderChannels(page, result.Items);
|
2013-11-20 16:08:12 -05:00
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
})(jQuery, document, ApiClient);
|