jellyfin-web/dashboard-ui/scripts/gamesystempage.js

53 lines
1.3 KiB
JavaScript
Raw Normal View History

2013-04-14 20:37:07 -07:00
(function ($, document, LibraryBrowser) {
function reload(page) {
var id = getParameterByName('id');
Dashboard.showLoadingMsg();
ApiClient.getItem(Dashboard.getCurrentUserId(), id).done(function (item) {
var name = item.Name;
$('#itemImage', page).html(LibraryBrowser.getDetailImageHtml(item));
Dashboard.setPageTitle(name);
$('#itemName', page).html(name);
renderDetails(page, item);
Dashboard.hideLoadingMsg();
});
}
function renderDetails(page, item) {
2013-04-21 21:38:03 -07:00
LibraryBrowser.renderOverview($('#itemOverview', page), item);
2013-04-14 20:37:07 -07:00
if (item.CommunityRating) {
$('#itemCommunityRating', page).html(LibraryBrowser.getStarRatingHtml(item)).show().attr('title', item.CommunityRating);
} else {
$('#itemCommunityRating', page).hide();
}
$('#itemMiscInfo', page).html(LibraryBrowser.getMiscInfoHtml(item));
2013-04-23 07:46:27 -07:00
LibraryBrowser.renderGenres($('#itemGenres', page), item, "games");
LibraryBrowser.renderStudios($('#itemStudios', page), item, "games");
2013-04-14 20:37:07 -07:00
renderUserDataIcons(page, item);
LibraryBrowser.renderLinks($('#itemLinks', page), item);
}
function renderUserDataIcons(page, item) {
$('#itemRatings', page).html(LibraryBrowser.getUserDataIconsHtml(item));
}
$(document).on('pageshow', "#gamesystemPage", function () {
reload(this);
});
})(jQuery, document, LibraryBrowser);