mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-18 03:18:19 -07:00
102 lines
2.7 KiB
JavaScript
102 lines
2.7 KiB
JavaScript
(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) {
|
|
|
|
if (item.Taglines && item.Taglines.length) {
|
|
$('#itemTagline', page).html(item.Taglines[0]).show();
|
|
} else {
|
|
$('#itemTagline', page).hide();
|
|
}
|
|
|
|
if (item.Overview || item.OverviewHtml) {
|
|
var overview = item.OverviewHtml || item.Overview;
|
|
|
|
$('#itemOverview', page).html(overview).show();
|
|
$('#itemOverview a').each(function () {
|
|
$(this).attr("target", "_blank");
|
|
});
|
|
} else {
|
|
$('#itemOverview', page).hide();
|
|
}
|
|
|
|
if (item.CommunityRating) {
|
|
$('#itemCommunityRating', page).html(LibraryBrowser.getStarRatingHtml(item)).show().attr('title', item.CommunityRating);
|
|
} else {
|
|
$('#itemCommunityRating', page).hide();
|
|
}
|
|
|
|
$('#itemMiscInfo', page).html(LibraryBrowser.getMiscInfoHtml(item));
|
|
|
|
LibraryBrowser.renderGenres($('#itemGenres', page), item);
|
|
LibraryBrowser.renderStudios($('#itemStudios', page), item);
|
|
renderUserDataIcons(page, item);
|
|
LibraryBrowser.renderLinks($('#itemLinks', page), item);
|
|
}
|
|
|
|
function renderUserDataIcons(page, item) {
|
|
$('#itemRatings', page).html(LibraryBrowser.getUserDataIconsHtml(item));
|
|
}
|
|
|
|
function renderMovies(page) {
|
|
|
|
ApiClient.getItems(Dashboard.getCurrentUserId(), {
|
|
|
|
ParentId: getParameterByName('id'),
|
|
SortBy: "SortName"
|
|
|
|
}).done(function (result) {
|
|
|
|
var html = LibraryBrowser.getPosterDetailViewHtml({
|
|
items: result.Items,
|
|
useAverageAspectRatio: true
|
|
});
|
|
|
|
|
|
$('#moviesContent', page).html(html);
|
|
});
|
|
}
|
|
|
|
$(document).on('pageshow', "#boxsetPage", function () {
|
|
|
|
var page = this;
|
|
|
|
reload(page);
|
|
|
|
$('#moviesCollapsible', page).on('expand.lazyload', function () {
|
|
|
|
renderMovies(page);
|
|
|
|
$(this).off('expand.lazyload');
|
|
});
|
|
|
|
}).on('pagehide', "#boxsetPage", function () {
|
|
|
|
var page = this;
|
|
|
|
$('#moviesCollapsible', page).off('expand.lazyload');
|
|
});
|
|
|
|
|
|
})(jQuery, document, LibraryBrowser); |