2013-10-24 10:49:24 -07:00
|
|
|
|
(function ($, document) {
|
|
|
|
|
|
|
|
|
|
$(document).on('pagebeforeshow', "#tvUpcomingPage", function () {
|
|
|
|
|
|
|
|
|
|
var page = this;
|
|
|
|
|
|
2014-05-01 19:54:33 -07:00
|
|
|
|
var parentId = LibraryMenu.getTopParentId();
|
|
|
|
|
|
2013-11-19 10:17:14 -07:00
|
|
|
|
var query = {
|
2013-10-24 10:49:24 -07:00
|
|
|
|
|
2014-03-05 22:17:13 -07:00
|
|
|
|
Limit: 32,
|
|
|
|
|
Fields: "SeriesInfo,UserData",
|
2014-05-01 19:54:33 -07:00
|
|
|
|
UserId: Dashboard.getCurrentUserId(),
|
|
|
|
|
ParentId: parentId
|
2013-10-24 10:49:24 -07:00
|
|
|
|
};
|
|
|
|
|
|
2014-03-05 22:17:13 -07:00
|
|
|
|
$.getJSON(ApiClient.getUrl("Shows/Upcoming", query)).done(function (result) {
|
2013-11-19 10:17:14 -07:00
|
|
|
|
|
2014-03-05 22:17:13 -07:00
|
|
|
|
var items = result.Items;
|
2013-11-19 10:17:14 -07:00
|
|
|
|
|
2014-03-31 14:04:22 -07:00
|
|
|
|
if (items.length) {
|
|
|
|
|
$('.noItemsMessage', page).hide();
|
|
|
|
|
} else {
|
|
|
|
|
$('.noItemsMessage', page).show();
|
2013-10-24 10:49:24 -07:00
|
|
|
|
}
|
2013-11-19 10:17:14 -07:00
|
|
|
|
|
2013-10-24 10:49:24 -07:00
|
|
|
|
$('#upcomingItems', page).html(LibraryBrowser.getPosterViewHtml({
|
2014-03-05 22:17:13 -07:00
|
|
|
|
items: items,
|
2013-10-24 10:49:24 -07:00
|
|
|
|
showLocationTypeIndicator: false,
|
|
|
|
|
shape: "backdrop",
|
|
|
|
|
showTitle: true,
|
|
|
|
|
showPremiereDate: true,
|
|
|
|
|
showPremiereDateIndex: true,
|
|
|
|
|
preferThumb: true
|
2014-03-05 22:17:13 -07:00
|
|
|
|
|
2014-03-15 21:23:58 -07:00
|
|
|
|
})).createPosterItemMenus();
|
2013-10-24 10:49:24 -07:00
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
})(jQuery, document);
|