mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add library folder option to home page
This commit is contained in:
parent
1987dfe628
commit
9029ce93d3
14 changed files with 94 additions and 17 deletions
|
@ -7,6 +7,7 @@
|
||||||
<div id="episodesPage" data-role="page" class="page libraryPage" data-theme="b">
|
<div id="episodesPage" data-role="page" class="page libraryPage" data-theme="b">
|
||||||
|
|
||||||
<div class="libraryViewNav scopedLibraryViewNav">
|
<div class="libraryViewNav scopedLibraryViewNav">
|
||||||
|
<a href="tvrecommended.html">${TabSuggested}</a>
|
||||||
<a href="tvlatest.html">${TabLatest}</a>
|
<a href="tvlatest.html">${TabLatest}</a>
|
||||||
<a href="tvshows.html">${TabShows}</a>
|
<a href="tvshows.html">${TabShows}</a>
|
||||||
<a href="#" class="ui-btn-active">${TabEpisodes}</a>
|
<a href="#" class="ui-btn-active">${TabEpisodes}</a>
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="tvGenreTabs" class="itemTabs" style="display: none;">
|
<div id="tvGenreTabs" class="itemTabs" style="display: none;">
|
||||||
<div class="libraryViewNav scopedLibraryViewNav">
|
<div class="libraryViewNav scopedLibraryViewNav">
|
||||||
|
<a href="tvrecommended.html">${TabSuggested}</a>
|
||||||
<a href="tvlatest.html">${TabLatest}</a>
|
<a href="tvlatest.html">${TabLatest}</a>
|
||||||
<a href="tvshows.html">${TabShows}</a>
|
<a href="tvshows.html">${TabShows}</a>
|
||||||
<a href="episodes.html">${TabEpisodes}</a>
|
<a href="episodes.html">${TabEpisodes}</a>
|
||||||
|
@ -47,6 +48,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="tvPeopleTabs" class="itemTabs" style="display: none;">
|
<div id="tvPeopleTabs" class="itemTabs" style="display: none;">
|
||||||
<div class="libraryViewNav scopedLibraryViewNav">
|
<div class="libraryViewNav scopedLibraryViewNav">
|
||||||
|
<a href="tvrecommended.html">${TabSuggested}</a>
|
||||||
<a href="tvlatest.html">${TabLatest}</a>
|
<a href="tvlatest.html">${TabLatest}</a>
|
||||||
<a href="tvshows.html">${TabShows}</a>
|
<a href="tvshows.html">${TabShows}</a>
|
||||||
<a href="episodes.html">${TabEpisodes}</a>
|
<a href="episodes.html">${TabEpisodes}</a>
|
||||||
|
@ -57,6 +59,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="tvStudioTabs" class="itemTabs" style="display: none;">
|
<div id="tvStudioTabs" class="itemTabs" style="display: none;">
|
||||||
<div class="libraryViewNav scopedLibraryViewNav">
|
<div class="libraryViewNav scopedLibraryViewNav">
|
||||||
|
<a href="tvrecommended.html">${TabSuggested}</a>
|
||||||
<a href="tvlatest.html">${TabLatest}</a>
|
<a href="tvlatest.html">${TabLatest}</a>
|
||||||
<a href="tvshows.html">${TabShows}</a>
|
<a href="tvshows.html">${TabShows}</a>
|
||||||
<a href="episodes.html">${TabEpisodes}</a>
|
<a href="episodes.html">${TabEpisodes}</a>
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div id="tvShowsTabs" class="itemTabs" style="display: none;">
|
<div id="tvShowsTabs" class="itemTabs" style="display: none;">
|
||||||
<div class="libraryViewNav scopedLibraryViewNav">
|
<div class="libraryViewNav scopedLibraryViewNav">
|
||||||
|
<a href="tvrecommended.html">${TabSuggested}</a>
|
||||||
<a href="tvlatest.html">${TabLatest}</a>
|
<a href="tvlatest.html">${TabLatest}</a>
|
||||||
<a href="tvshows.html" class="ui-btn-active">${TabShows}</a>
|
<a href="tvshows.html" class="ui-btn-active">${TabShows}</a>
|
||||||
<a href="episodes.html">${TabEpisodes}</a>
|
<a href="episodes.html">${TabEpisodes}</a>
|
||||||
|
|
|
@ -27,9 +27,10 @@
|
||||||
<select id="selectHomeSection1" data-mini="true">
|
<select id="selectHomeSection1" data-mini="true">
|
||||||
<option value="">${OptionAuto}</option>
|
<option value="">${OptionAuto}</option>
|
||||||
<option value="latestmedia">${OptionLatestMedia}</option>
|
<option value="latestmedia">${OptionLatestMedia}</option>
|
||||||
<option value="librarybuttons">${OptionLibraryButtons}</option>
|
<option value="librarytiles">${OptionMyLibrary}</option>
|
||||||
<option value="librarytiles">${OptionLibraryTiles}</option>
|
<option value="smalllibrarytiles">${OptionMyLibrarySmall}</option>
|
||||||
<option value="smalllibrarytiles">${OptionSmallLibraryTiles}</option>
|
<option value="librarybuttons">${OptionMyLibraryButtons}</option>
|
||||||
|
<option value="folders">${OptionLibraryFolders}</option>
|
||||||
<option value="resume">${OptionResumablemedia}</option>
|
<option value="resume">${OptionResumablemedia}</option>
|
||||||
</select>
|
</select>
|
||||||
</li>
|
</li>
|
||||||
|
@ -38,9 +39,10 @@
|
||||||
<select id="selectHomeSection2" data-mini="true">
|
<select id="selectHomeSection2" data-mini="true">
|
||||||
<option value="">${OptionAuto}</option>
|
<option value="">${OptionAuto}</option>
|
||||||
<option value="latestmedia">${OptionLatestMedia}</option>
|
<option value="latestmedia">${OptionLatestMedia}</option>
|
||||||
<option value="librarybuttons">${OptionLibraryButtons}</option>
|
<option value="librarytiles">${OptionMyLibrary}</option>
|
||||||
<option value="librarytiles">${OptionLibraryTiles}</option>
|
<option value="smalllibrarytiles">${OptionMyLibrarySmall}</option>
|
||||||
<option value="smalllibrarytiles">${OptionSmallLibraryTiles}</option>
|
<option value="librarybuttons">${OptionMyLibraryButtons}</option>
|
||||||
|
<option value="folders">${OptionLibraryFolders}</option>
|
||||||
<option value="resume">${OptionResumablemedia}</option>
|
<option value="resume">${OptionResumablemedia}</option>
|
||||||
<option value="none">${OptionNone}</option>
|
<option value="none">${OptionNone}</option>
|
||||||
</select>
|
</select>
|
||||||
|
@ -50,9 +52,10 @@
|
||||||
<select id="selectHomeSection3" data-mini="true">
|
<select id="selectHomeSection3" data-mini="true">
|
||||||
<option value="">${OptionAuto}</option>
|
<option value="">${OptionAuto}</option>
|
||||||
<option value="latestmedia">${OptionLatestMedia}</option>
|
<option value="latestmedia">${OptionLatestMedia}</option>
|
||||||
<option value="librarybuttons">${OptionLibraryButtons}</option>
|
<option value="librarytiles">${OptionMyLibrary}</option>
|
||||||
<option value="librarytiles">${OptionLibraryTiles}</option>
|
<option value="smalllibrarytiles">${OptionMyLibrarySmall}</option>
|
||||||
<option value="smalllibrarytiles">${OptionSmallLibraryTiles}</option>
|
<option value="librarybuttons">${OptionMyLibraryButtons}</option>
|
||||||
|
<option value="folders">${OptionLibraryFolders}</option>
|
||||||
<option value="resume">${OptionResumablemedia}</option>
|
<option value="resume">${OptionResumablemedia}</option>
|
||||||
<option value="none">${OptionNone}</option>
|
<option value="none">${OptionNone}</option>
|
||||||
</select>
|
</select>
|
||||||
|
|
|
@ -103,7 +103,7 @@
|
||||||
switch (index) {
|
switch (index) {
|
||||||
|
|
||||||
case 0:
|
case 0:
|
||||||
return 'librarybuttons';
|
return 'smalllibrarytiles';
|
||||||
case 1:
|
case 1:
|
||||||
return 'resume';
|
return 'resume';
|
||||||
case 2:
|
case 2:
|
||||||
|
@ -179,14 +179,16 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadLibraryTiles(elem, userId, shape) {
|
function loadLibraryTiles(elem, userId, shape, index) {
|
||||||
|
|
||||||
getUserViews(userId).done(function (items) {
|
getUserViews(userId).done(function (items) {
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
if (items.length) {
|
if (items.length) {
|
||||||
|
|
||||||
html += '<h1 class="listHeader">' + Globalize.translate('HeaderMyLibrary') + '</h1>';
|
html += '<h1 class="listHeader">' + Globalize.translate('HeaderMyLibrary') + '</h1>';
|
||||||
|
|
||||||
html += '<div>';
|
html += '<div>';
|
||||||
html += LibraryBrowser.getPosterViewHtml({
|
html += LibraryBrowser.getPosterViewHtml({
|
||||||
items: items,
|
items: items,
|
||||||
|
@ -205,6 +207,42 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function loadLibraryFolders(elem, userId, shape, index) {
|
||||||
|
|
||||||
|
ApiClient.getItems(userId, {
|
||||||
|
|
||||||
|
SortBy: "SortName"
|
||||||
|
|
||||||
|
}).done(function (result) {
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
var items = result.Items;
|
||||||
|
|
||||||
|
for (var i = 0, length = items.length; i < length; i++) {
|
||||||
|
items[i].url = 'itemlist.html?parentid=' + items[i].Id;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (items.length) {
|
||||||
|
|
||||||
|
html += '<h1 class="listHeader">' + Globalize.translate('HeaderLibraryFolders') + '</h1>';
|
||||||
|
|
||||||
|
html += '<div>';
|
||||||
|
html += LibraryBrowser.getPosterViewHtml({
|
||||||
|
items: items,
|
||||||
|
shape: shape,
|
||||||
|
showTitle: true,
|
||||||
|
centerText: true,
|
||||||
|
lazy: true
|
||||||
|
});
|
||||||
|
html += '</div>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$(elem).html(html).trigger('create').createPosterItemMenus();
|
||||||
|
|
||||||
|
handleLibraryLinkNavigations(elem);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function loadResume(elem, userId) {
|
function loadResume(elem, userId) {
|
||||||
|
|
||||||
var screenWidth = $(window).width();
|
var screenWidth = $(window).width();
|
||||||
|
@ -256,10 +294,10 @@
|
||||||
loadRecentlyAdded(elem, userId);
|
loadRecentlyAdded(elem, userId);
|
||||||
}
|
}
|
||||||
else if (section == 'librarytiles') {
|
else if (section == 'librarytiles') {
|
||||||
loadLibraryTiles(elem, userId, 'backdrop');
|
loadLibraryTiles(elem, userId, 'backdrop', index);
|
||||||
}
|
}
|
||||||
else if (section == 'smalllibrarytiles') {
|
else if (section == 'smalllibrarytiles') {
|
||||||
loadLibraryTiles(elem, userId, 'smallBackdrop');
|
loadLibraryTiles(elem, userId, 'smallBackdrop', index);
|
||||||
}
|
}
|
||||||
else if (section == 'resume') {
|
else if (section == 'resume') {
|
||||||
loadResume(elem, userId);
|
loadResume(elem, userId);
|
||||||
|
@ -267,6 +305,9 @@
|
||||||
else if (section == 'librarybuttons') {
|
else if (section == 'librarybuttons') {
|
||||||
loadlibraryButtons(elem, userId, index);
|
loadlibraryButtons(elem, userId, index);
|
||||||
|
|
||||||
|
} else if (section == 'folders') {
|
||||||
|
loadLibraryFolders(elem, userId, 'backdrop', index);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
elem.empty();
|
elem.empty();
|
||||||
|
|
|
@ -390,7 +390,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.CollectionType == 'tvshows') {
|
if (item.CollectionType == 'tvshows') {
|
||||||
return 'tvlatest.html?topParentId=' + item.Id;
|
return 'tvrecommended.html?topParentId=' + item.Id;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.CollectionType == 'music') {
|
if (item.CollectionType == 'music') {
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
var screenWidth = $(window).width();
|
var screenWidth = $(window).width();
|
||||||
|
|
||||||
var options = {
|
var query = {
|
||||||
|
|
||||||
Limit: 24,
|
Limit: 24,
|
||||||
Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated",
|
Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated",
|
||||||
|
@ -12,7 +12,19 @@
|
||||||
ExcludeLocationTypes: "Virtual"
|
ExcludeLocationTypes: "Virtual"
|
||||||
};
|
};
|
||||||
|
|
||||||
ApiClient.getNextUpEpisodes(options).done(function (result) {
|
query.ParentId = LibraryMenu.getTopParentId();
|
||||||
|
|
||||||
|
if (query.ParentId) {
|
||||||
|
|
||||||
|
$('.scopedLibraryViewNav', page).show();
|
||||||
|
$('.globalNav', page).hide();
|
||||||
|
|
||||||
|
} else {
|
||||||
|
$('.scopedLibraryViewNav', page).hide();
|
||||||
|
$('.globalNav', page).show();
|
||||||
|
}
|
||||||
|
|
||||||
|
ApiClient.getNextUpEpisodes(query).done(function (result) {
|
||||||
|
|
||||||
if (result.Items.length) {
|
if (result.Items.length) {
|
||||||
$('.noNextUpItems', page).hide();
|
$('.noNextUpItems', page).hide();
|
||||||
|
|
|
@ -11,6 +11,8 @@
|
||||||
UserId: Dashboard.getCurrentUserId()
|
UserId: Dashboard.getCurrentUserId()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
query.ParentId = LibraryMenu.getTopParentId();
|
||||||
|
|
||||||
$.getJSON(ApiClient.getUrl("Shows/Upcoming", query)).done(function (result) {
|
$.getJSON(ApiClient.getUrl("Shows/Upcoming", query)).done(function (result) {
|
||||||
|
|
||||||
var items = result.Items;
|
var items = result.Items;
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
<body>
|
<body>
|
||||||
<div id="tvGenresPage" data-role="page" class="page libraryPage" data-theme="b">
|
<div id="tvGenresPage" data-role="page" class="page libraryPage" data-theme="b">
|
||||||
<div class="libraryViewNav scopedLibraryViewNav">
|
<div class="libraryViewNav scopedLibraryViewNav">
|
||||||
|
<a href="tvrecommended.html">${TabSuggested}</a>
|
||||||
<a href="tvlatest.html">${TabLatest}</a>
|
<a href="tvlatest.html">${TabLatest}</a>
|
||||||
<a href="tvshows.html">${TabShows}</a>
|
<a href="tvshows.html">${TabShows}</a>
|
||||||
<a href="episodes.html">${TabEpisodes}</a>
|
<a href="episodes.html">${TabEpisodes}</a>
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
<body>
|
<body>
|
||||||
<div id="tvNextUpPage" data-role="page" class="page libraryPage backdropPage" data-backdroptype="series" data-theme="b">
|
<div id="tvNextUpPage" data-role="page" class="page libraryPage backdropPage" data-backdroptype="series" data-theme="b">
|
||||||
<div class="libraryViewNav scopedLibraryViewNav">
|
<div class="libraryViewNav scopedLibraryViewNav">
|
||||||
|
<a href="tvrecommended.html">${TabSuggested}</a>
|
||||||
<a href="#" class="ui-btn-active">${TabLatest}</a>
|
<a href="#" class="ui-btn-active">${TabLatest}</a>
|
||||||
<a href="tvshows.html">${TabShows}</a>
|
<a href="tvshows.html">${TabShows}</a>
|
||||||
<a href="episodes.html">${TabEpisodes}</a>
|
<a href="episodes.html">${TabEpisodes}</a>
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
<body>
|
<body>
|
||||||
<div id="tvPeoplePage" data-role="page" class="page libraryPage" data-theme="b">
|
<div id="tvPeoplePage" data-role="page" class="page libraryPage" data-theme="b">
|
||||||
<div class="libraryViewNav scopedLibraryViewNav">
|
<div class="libraryViewNav scopedLibraryViewNav">
|
||||||
|
<a href="tvrecommended.html">${TabSuggested}</a>
|
||||||
<a href="tvlatest.html">${TabLatest}</a>
|
<a href="tvlatest.html">${TabLatest}</a>
|
||||||
<a href="tvshows.html">${TabShows}</a>
|
<a href="tvshows.html">${TabShows}</a>
|
||||||
<a href="episodes.html">${TabEpisodes}</a>
|
<a href="episodes.html">${TabEpisodes}</a>
|
||||||
|
|
|
@ -6,12 +6,21 @@
|
||||||
<body>
|
<body>
|
||||||
<div id="tvRecommendedPage" data-role="page" class="page libraryPage backdropPage" data-backdroptype="series" data-theme="b">
|
<div id="tvRecommendedPage" data-role="page" class="page libraryPage backdropPage" data-backdroptype="series" data-theme="b">
|
||||||
|
|
||||||
<div class="libraryViewNav scopedLibraryViewNav">
|
<div class="libraryViewNav globalNav" style="display: none;">
|
||||||
<a href="index.html">${TabHome}</a>
|
<a href="index.html">${TabHome}</a>
|
||||||
<a href="#" class="ui-btn-active">${TabNextUp}</a>
|
<a href="#" class="ui-btn-active">${TabNextUp}</a>
|
||||||
<a href="favorites.html">${TabFavorites}</a>
|
<a href="favorites.html">${TabFavorites}</a>
|
||||||
<a href="tvupcoming.html">${TabUpcoming}</a>
|
<a href="tvupcoming.html">${TabUpcoming}</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="libraryViewNav scopedLibraryViewNav" style="display: none;">
|
||||||
|
<a href="tvrecommended.html" class="ui-btn-active">${TabSuggested}</a>
|
||||||
|
<a href="tvlatest.html">${TabLatest}</a>
|
||||||
|
<a href="tvshows.html">${TabShows}</a>
|
||||||
|
<a href="episodes.html">${TabEpisodes}</a>
|
||||||
|
<a href="tvgenres.html">${TabGenres}</a>
|
||||||
|
<a href="tvpeople.html">${TabPeople}</a>
|
||||||
|
<a href="tvstudios.html">${TabNetworks}</a>
|
||||||
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<div data-role="content">
|
<div data-role="content">
|
||||||
<table class="ehsContent homeEhsContent" style="text-align: center;">
|
<table class="ehsContent homeEhsContent" style="text-align: center;">
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
<body>
|
<body>
|
||||||
<div id="tvShowsPage" data-role="page" class="page libraryPage" data-theme="b">
|
<div id="tvShowsPage" data-role="page" class="page libraryPage" data-theme="b">
|
||||||
<div class="libraryViewNav scopedLibraryViewNav">
|
<div class="libraryViewNav scopedLibraryViewNav">
|
||||||
|
<a href="tvrecommended.html">${TabSuggested}</a>
|
||||||
<a href="tvlatest.html">${TabLatest}</a>
|
<a href="tvlatest.html">${TabLatest}</a>
|
||||||
<a href="#" class="ui-btn-active">${TabShows}</a>
|
<a href="#" class="ui-btn-active">${TabShows}</a>
|
||||||
<a href="episodes.html">${TabEpisodes}</a>
|
<a href="episodes.html">${TabEpisodes}</a>
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
<body>
|
<body>
|
||||||
<div id="tvStudiosPage" data-role="page" class="page libraryPage" data-theme="b">
|
<div id="tvStudiosPage" data-role="page" class="page libraryPage" data-theme="b">
|
||||||
<div class="libraryViewNav scopedLibraryViewNav">
|
<div class="libraryViewNav scopedLibraryViewNav">
|
||||||
|
<a href="tvrecommended.html">${TabSuggested}</a>
|
||||||
<a href="tvlatest.html">${TabLatest}</a>
|
<a href="tvlatest.html">${TabLatest}</a>
|
||||||
<a href="tvshows.html">${TabShows}</a>
|
<a href="tvshows.html">${TabShows}</a>
|
||||||
<a href="episodes.html">${TabEpisodes}</a>
|
<a href="episodes.html">${TabEpisodes}</a>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue