mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fixes #834 - Change view of TV Shows or Interface for plugins
This commit is contained in:
parent
66a2e3ce93
commit
4318490be2
13 changed files with 146 additions and 54 deletions
|
@ -40,7 +40,7 @@
|
|||
|
||||
renderHeader(page, item, context);
|
||||
|
||||
LibraryBrowser.renderName(item, $('.itemName', page));
|
||||
LibraryBrowser.renderName(item, $('.itemName', page), false, context);
|
||||
LibraryBrowser.renderParentName(item, $('.parentName', page));
|
||||
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
|
|
|
@ -493,6 +493,66 @@
|
|||
|
||||
},
|
||||
|
||||
getListViewHtml: function (options) {
|
||||
|
||||
var outerHtml = "";
|
||||
|
||||
outerHtml += '<ul data-role="listview" data-inset="true" class="itemsListview">';
|
||||
|
||||
outerHtml += options.items.map(function (item) {
|
||||
|
||||
var html = '';
|
||||
|
||||
var href = LibraryBrowser.getHref(item, options.context);
|
||||
html += '<li class="ui-li-has-thumb"><a href="' + href + '">';
|
||||
|
||||
var imgUrl;
|
||||
|
||||
if (item.ImageTags.Primary) {
|
||||
|
||||
imgUrl = ApiClient.getScaledImageUrl(item.Id, {
|
||||
width: 80,
|
||||
tag: item.ImageTags.Primary,
|
||||
type: "Primary",
|
||||
index: 0
|
||||
});
|
||||
|
||||
}
|
||||
if (imgUrl) {
|
||||
html += '<div class="listviewImage ui-li-thumb" style="background-image:url(\'' + imgUrl + '\');"></div>';
|
||||
}
|
||||
|
||||
html += '<h3>';
|
||||
html += LibraryBrowser.getPosterViewDisplayName(item);
|
||||
html += '</h3>';
|
||||
|
||||
html += '<p>';
|
||||
html += LibraryBrowser.getMiscInfoHtml(item);
|
||||
html += '</p>';
|
||||
|
||||
html += '<div class="ui-li-aside">';
|
||||
html += LibraryBrowser.getRatingHtml(item, false);
|
||||
html += '</div>';
|
||||
|
||||
if (item.UserData.UnplayedItemCount) {
|
||||
html += '<span class="ui-li-count">' + item.UserData.UnplayedItemCount + '</span>';
|
||||
}
|
||||
html += '</a>';
|
||||
|
||||
html += '<a href="#" data-icon="ellipsis-v">';
|
||||
html += '</a>';
|
||||
|
||||
html += '</li>';
|
||||
|
||||
return html;
|
||||
|
||||
}).join('');
|
||||
|
||||
outerHtml += '</ul>';
|
||||
|
||||
return outerHtml;
|
||||
},
|
||||
|
||||
getPosterViewHtml: function (options) {
|
||||
|
||||
var items = options.items;
|
||||
|
@ -774,7 +834,7 @@
|
|||
|
||||
if (options.showChildCountIndicator && item.ChildCount) {
|
||||
cssClass += ' groupedPosterItem';
|
||||
|
||||
|
||||
if (item.Type == 'Series') {
|
||||
cssClass += ' unplayedGroupings';
|
||||
}
|
||||
|
@ -1212,14 +1272,14 @@
|
|||
|
||||
},
|
||||
|
||||
renderName: function (item, nameElem, linkToElement) {
|
||||
renderName: function (item, nameElem, linkToElement, context) {
|
||||
|
||||
var name = LibraryBrowser.getPosterViewDisplayName(item, false, false);
|
||||
|
||||
Dashboard.setPageTitle(name);
|
||||
|
||||
if (linkToElement) {
|
||||
nameElem.html('<a class="detailPageParentLink" href="' + LibraryBrowser.getHref(item) + '">' + name + '</a>').trigger('create');
|
||||
nameElem.html('<a class="detailPageParentLink" href="' + LibraryBrowser.getHref(item, context) + '">' + name + '</a>').trigger('create');
|
||||
} else {
|
||||
nameElem.html(name);
|
||||
}
|
||||
|
|
|
@ -290,46 +290,6 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
function getGroupingHeaderHtml(item) {
|
||||
|
||||
var itemHtml = '';
|
||||
|
||||
var href = LibraryBrowser.getHref(item);
|
||||
itemHtml += '<li><a href="' + href + '">';
|
||||
|
||||
var imgUrl = "css/images/media/chapterflyout.png";
|
||||
|
||||
if (item.ImageTags.Primary) {
|
||||
|
||||
itemHtml += '<img src="' + imgUrl + '" style="visibility:hidden;" />';
|
||||
imgUrl = ApiClient.getScaledImageUrl(item.Id, {
|
||||
width: 160,
|
||||
tag: item.ImageTags.Primary,
|
||||
type: "Primary",
|
||||
index: 0
|
||||
});
|
||||
itemHtml += '<div class="videoChapterPopupImage" style="background-image:url(\'' + imgUrl + '\');"></div>';
|
||||
|
||||
} else {
|
||||
itemHtml += '<img src="' + imgUrl + '" />';
|
||||
}
|
||||
|
||||
|
||||
itemHtml += '<h3>';
|
||||
itemHtml += LibraryBrowser.getPosterViewDisplayName(item);
|
||||
itemHtml += '</h3>';
|
||||
|
||||
var date = parseISO8601Date(item.DateCreated, { toLocal: true });
|
||||
|
||||
itemHtml += '<p>';
|
||||
itemHtml += Globalize.translate('LabelAddedOnDate').replace('{0}', date.toLocaleDateString());
|
||||
itemHtml += '</p>';
|
||||
|
||||
itemHtml += '</a></li>';
|
||||
|
||||
return itemHtml;
|
||||
}
|
||||
|
||||
function onGroupedPosterItemClick(e) {
|
||||
|
||||
var posterItem = this;
|
||||
|
@ -387,25 +347,23 @@
|
|||
var itemHtml = '';
|
||||
|
||||
href = LibraryBrowser.getHref(latestItem);
|
||||
itemHtml += '<li><a href="' + href + '">';
|
||||
itemHtml += '<li class="ui-li-has-thumb"><a href="' + href + '">';
|
||||
|
||||
var imgUrl = "css/images/media/chapterflyout.png";
|
||||
var imgUrl;
|
||||
|
||||
if (latestItem.ImageTags.Primary) {
|
||||
|
||||
itemHtml += '<img src="' + imgUrl + '" style="visibility:hidden;" />';
|
||||
imgUrl = ApiClient.getScaledImageUrl(latestItem.Id, {
|
||||
width: 160,
|
||||
width: 80,
|
||||
tag: latestItem.ImageTags.Primary,
|
||||
type: "Primary",
|
||||
index: 0
|
||||
});
|
||||
itemHtml += '<div class="videoChapterPopupImage" style="background-image:url(\'' + imgUrl + '\');"></div>';
|
||||
|
||||
} else {
|
||||
itemHtml += '<img src="' + imgUrl + '" />';
|
||||
}
|
||||
|
||||
if (imgUrl) {
|
||||
itemHtml += '<div class="listviewImage ui-li-thumb" style="background-image:url(\'' + imgUrl + '\');"></div>';
|
||||
}
|
||||
|
||||
itemHtml += '<h3>';
|
||||
itemHtml += LibraryBrowser.getPosterViewDisplayName(latestItem);
|
||||
|
|
|
@ -59,9 +59,9 @@
|
|||
$('.dashboardMenuButton').createHoverTouch().on('hovertouch', showDashboardMenu);
|
||||
}
|
||||
|
||||
function getItemHref(item) {
|
||||
function getItemHref(item, context) {
|
||||
|
||||
return LibraryBrowser.getHref(item);
|
||||
return LibraryBrowser.getHref(item, context);
|
||||
}
|
||||
|
||||
function getViewsHtml() {
|
||||
|
|
|
@ -55,6 +55,14 @@
|
|||
});
|
||||
$('.itemsContainer', page).removeClass('timelineItemsContainer');
|
||||
}
|
||||
else if (view == "List") {
|
||||
|
||||
html = LibraryBrowser.getListViewHtml({
|
||||
items: result.Items,
|
||||
context: 'movies'
|
||||
});
|
||||
$('.itemsContainer', page).removeClass('timelineItemsContainer');
|
||||
}
|
||||
else if (view == "Poster") {
|
||||
html = LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
|
|
|
@ -44,6 +44,14 @@
|
|||
});
|
||||
$('.itemsContainer', page).removeClass('timelineItemsContainer');
|
||||
}
|
||||
else if (view == "List") {
|
||||
|
||||
html = LibraryBrowser.getListViewHtml({
|
||||
items: result.Items,
|
||||
context: 'music'
|
||||
});
|
||||
$('.itemsContainer', page).removeClass('timelineItemsContainer');
|
||||
}
|
||||
else if (view == "Timeline") {
|
||||
html = LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
|
|
|
@ -68,6 +68,14 @@
|
|||
});
|
||||
$('.itemsContainer', page).removeClass('timelineItemsContainer');
|
||||
}
|
||||
else if (view == "List") {
|
||||
|
||||
html = LibraryBrowser.getListViewHtml({
|
||||
items: result.Items,
|
||||
context: 'tv'
|
||||
});
|
||||
$('.itemsContainer', page).removeClass('timelineItemsContainer');
|
||||
}
|
||||
else if (view == "Timeline") {
|
||||
|
||||
html = LibraryBrowser.getPosterViewHtml({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue