mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
added favorites page to the tv section
This commit is contained in:
parent
78a6d736ba
commit
882bc426ad
10 changed files with 201 additions and 0 deletions
51
dashboard-ui/favoritetv.html
Normal file
51
dashboard-ui/favoritetv.html
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Media Browser</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="favoriteTvPage" data-role="page" class="page libraryPage" data-theme="a" data-view="tvshows">
|
||||||
|
<div class="libraryViewNav">
|
||||||
|
<a href="tvrecommended.html">Suggested</a>
|
||||||
|
<a href="tvnextup.html">Next up</a>
|
||||||
|
<a href="tvshows.html">Shows</a>
|
||||||
|
<a href="tvgenres.html">Genres</a>
|
||||||
|
<a href="tvpeople.html">Actors</a>
|
||||||
|
<a href="tvstudios.html">Networks</a>
|
||||||
|
<a href="favoritetv.html" class="ui-btn-active">Favorites</a>
|
||||||
|
</div>
|
||||||
|
<div class="alphabetPicker">
|
||||||
|
</div>
|
||||||
|
<div data-role="content">
|
||||||
|
<div style="text-align: center;">
|
||||||
|
<div data-role="controlgroup" data-type="horizontal" class="favoriteTypes" data-mini="true">
|
||||||
|
<a href="#" data-role="button" class="btnFavoriteType btnFavoriteSeries ui-btn-active">Series</a>
|
||||||
|
<a href="#" data-role="button" class="btnFavoriteType btnFavoriteSeasons">Seasons</a>
|
||||||
|
<a href="#" data-role="button" class="btnFavoriteType btnFavoriteEpisodes">Episodes</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="viewSettings">
|
||||||
|
<div class="viewControls">
|
||||||
|
<button data-mini="true" data-icon="filter" data-inline="true" onclick="$('#filterPanel', $.mobile.activePage).panel( 'toggle' );">Filter</button>
|
||||||
|
</div>
|
||||||
|
<div class="listTopPaging">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="items" class="itemsContainer"></div>
|
||||||
|
</div>
|
||||||
|
<div data-role="panel" id="filterPanel" data-position="right" data-display="overlay" data-theme="b" data-position-fixed="true">
|
||||||
|
<form>
|
||||||
|
<fieldset data-role="controlgroup">
|
||||||
|
<legend>
|
||||||
|
<strong>Filters:</strong>
|
||||||
|
</legend>
|
||||||
|
<input type="checkbox" name="chkIncludeLikes" id="chkIncludeLikes" data-theme="c" data-mini="true">
|
||||||
|
<label for="chkIncludeLikes">Includes likes</label>
|
||||||
|
|
||||||
|
</fieldset>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -46,6 +46,7 @@
|
||||||
<a href="tvgenres.html" class="ui-btn-active">Genres</a>
|
<a href="tvgenres.html" class="ui-btn-active">Genres</a>
|
||||||
<a href="tvpeople.html">Actors</a>
|
<a href="tvpeople.html">Actors</a>
|
||||||
<a href="tvstudios.html">Networks</a>
|
<a href="tvstudios.html">Networks</a>
|
||||||
|
<a href="favoritetv.html">Favorites</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="tvPeopleTabs" class="itemTabs" style="display: none;">
|
<div id="tvPeopleTabs" class="itemTabs" style="display: none;">
|
||||||
|
@ -56,6 +57,7 @@
|
||||||
<a href="tvgenres.html">Genres</a>
|
<a href="tvgenres.html">Genres</a>
|
||||||
<a href="tvpeople.html" class="ui-btn-active">Actors</a>
|
<a href="tvpeople.html" class="ui-btn-active">Actors</a>
|
||||||
<a href="tvstudios.html">Networks</a>
|
<a href="tvstudios.html">Networks</a>
|
||||||
|
<a href="favoritetv.html">Favorites</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="tvStudioTabs" class="itemTabs" style="display: none;">
|
<div id="tvStudioTabs" class="itemTabs" style="display: none;">
|
||||||
|
@ -66,6 +68,7 @@
|
||||||
<a href="tvgenres.html">Genres</a>
|
<a href="tvgenres.html">Genres</a>
|
||||||
<a href="tvpeople.html">Actors</a>
|
<a href="tvpeople.html">Actors</a>
|
||||||
<a href="tvstudios.html" class="ui-btn-active">Networks</a>
|
<a href="tvstudios.html" class="ui-btn-active">Networks</a>
|
||||||
|
<a href="favoritetv.html">Favorites</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="musicGenreTabs" class="itemTabs" style="display: none;">
|
<div id="musicGenreTabs" class="itemTabs" style="display: none;">
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
<a href="tvgenres.html">Genres</a>
|
<a href="tvgenres.html">Genres</a>
|
||||||
<a href="tvpeople.html">Actors</a>
|
<a href="tvpeople.html">Actors</a>
|
||||||
<a href="tvstudios.html">Networks</a>
|
<a href="tvstudios.html">Networks</a>
|
||||||
|
<a href="favoritetv.html">Favorites</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="songTabs" class="itemTabs" style="display: none;">
|
<div id="songTabs" class="itemTabs" style="display: none;">
|
||||||
|
|
140
dashboard-ui/scripts/favoritetv.js
Normal file
140
dashboard-ui/scripts/favoritetv.js
Normal file
|
@ -0,0 +1,140 @@
|
||||||
|
(function ($, document) {
|
||||||
|
|
||||||
|
var shape = "poster";
|
||||||
|
|
||||||
|
// The base query options
|
||||||
|
var query = {
|
||||||
|
|
||||||
|
SortBy: "SortName",
|
||||||
|
SortOrder: "Ascending",
|
||||||
|
IncludeItemTypes: "Series",
|
||||||
|
Recursive: true,
|
||||||
|
Fields: "DisplayMediaType,SeriesInfo,ItemCounts,DateCreated,UserData",
|
||||||
|
StartIndex: 0,
|
||||||
|
Filters: "IsFavorite"
|
||||||
|
};
|
||||||
|
|
||||||
|
function reloadItems(page) {
|
||||||
|
|
||||||
|
Dashboard.showLoadingMsg();
|
||||||
|
|
||||||
|
ApiClient.getItems(Dashboard.getCurrentUserId(), query).done(function (result) {
|
||||||
|
|
||||||
|
// Scroll back up so they can see the results from the beginning
|
||||||
|
$(document).scrollTop(0);
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
|
||||||
|
$('.listTopPaging', page).html(LibraryBrowser.getPagingHtml(query, result.TotalRecordCount, true)).trigger('create');
|
||||||
|
|
||||||
|
html += LibraryBrowser.getPosterDetailViewHtml({
|
||||||
|
items: result.Items,
|
||||||
|
context: "tv",
|
||||||
|
shape: shape
|
||||||
|
});
|
||||||
|
|
||||||
|
html += LibraryBrowser.getPagingHtml(query, result.TotalRecordCount);
|
||||||
|
|
||||||
|
$('#items', page).html(html).trigger('create');
|
||||||
|
|
||||||
|
$('.selectPage', page).on('change', function () {
|
||||||
|
query.StartIndex = (parseInt(this.value) - 1) * query.Limit;
|
||||||
|
reloadItems(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.btnNextPage', page).on('click', function () {
|
||||||
|
query.StartIndex += query.Limit;
|
||||||
|
reloadItems(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.btnPreviousPage', page).on('click', function () {
|
||||||
|
query.StartIndex -= query.Limit;
|
||||||
|
reloadItems(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.selectPageSize', page).on('change', function () {
|
||||||
|
query.Limit = parseInt(this.value);
|
||||||
|
query.StartIndex = 0;
|
||||||
|
reloadItems(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
Dashboard.hideLoadingMsg();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).on('pageinit', "#favoriteTvPage", function () {
|
||||||
|
|
||||||
|
var page = this;
|
||||||
|
|
||||||
|
$('.btnFavoriteType', page).on('click', function () {
|
||||||
|
|
||||||
|
$('.favoriteTypes .ui-btn-active', page).removeClass('ui-btn-active');
|
||||||
|
$(this).addClass('ui-btn-active');
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.btnFavoriteSeries', page).on('click', function () {
|
||||||
|
|
||||||
|
shape = "poster";
|
||||||
|
query.IncludeItemTypes = "Series";
|
||||||
|
reloadItems(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.btnFavoriteSeasons', page).on('click', function () {
|
||||||
|
|
||||||
|
shape = "poster";
|
||||||
|
query.IncludeItemTypes = "Season";
|
||||||
|
reloadItems(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.btnFavoriteEpisodes', page).on('click', function () {
|
||||||
|
|
||||||
|
shape = "backdrop";
|
||||||
|
query.IncludeItemTypes = "Episode";
|
||||||
|
reloadItems(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.btnFavoriteSeries', page).on('click', function () {
|
||||||
|
|
||||||
|
query.IncludeItemTypes = "Series";
|
||||||
|
reloadItems(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#chkIncludeLikes', page).on('change', function () {
|
||||||
|
|
||||||
|
query.Filters = this.checked ? "IsFavoriteOrLikes" : "IsFavorite";
|
||||||
|
reloadItems(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.alphabetPicker', page).on('alphaselect', function (e, character) {
|
||||||
|
|
||||||
|
query.NameStartsWithOrGreater = character;
|
||||||
|
query.StartIndex = 0;
|
||||||
|
|
||||||
|
reloadItems(page);
|
||||||
|
|
||||||
|
}).on('alphaclear', function (e) {
|
||||||
|
|
||||||
|
query.NameStartsWithOrGreater = '';
|
||||||
|
|
||||||
|
reloadItems(page);
|
||||||
|
});
|
||||||
|
|
||||||
|
}).on('pagebeforeshow', "#favoriteTvPage", function () {
|
||||||
|
|
||||||
|
var limit = LibraryBrowser.getDefaultPageSize();
|
||||||
|
|
||||||
|
// If the default page size has changed, the start index will have to be reset
|
||||||
|
if (limit != query.Limit) {
|
||||||
|
query.Limit = limit;
|
||||||
|
query.StartIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
reloadItems(this);
|
||||||
|
|
||||||
|
}).on('pageshow', "#favoriteTvPage", function () {
|
||||||
|
|
||||||
|
$('.alphabetPicker', this).alphaValue(query.NameStartsWith);
|
||||||
|
});
|
||||||
|
|
||||||
|
})(jQuery, document);
|
|
@ -12,6 +12,7 @@
|
||||||
<a href="tvgenres.html" class="ui-btn-active">Genres</a>
|
<a href="tvgenres.html" class="ui-btn-active">Genres</a>
|
||||||
<a href="tvpeople.html">Actors</a>
|
<a href="tvpeople.html">Actors</a>
|
||||||
<a href="tvstudios.html">Networks</a>
|
<a href="tvstudios.html">Networks</a>
|
||||||
|
<a href="favoritetv.html">Favorites</a>
|
||||||
</div>
|
</div>
|
||||||
<div data-role="content">
|
<div data-role="content">
|
||||||
<div class="viewSettings">
|
<div class="viewSettings">
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
<a href="tvgenres.html">Genres</a>
|
<a href="tvgenres.html">Genres</a>
|
||||||
<a href="tvpeople.html">Actors</a>
|
<a href="tvpeople.html">Actors</a>
|
||||||
<a href="tvstudios.html">Networks</a>
|
<a href="tvstudios.html">Networks</a>
|
||||||
|
<a href="favoritetv.html">Favorites</a>
|
||||||
</div>
|
</div>
|
||||||
<div data-role="content">
|
<div data-role="content">
|
||||||
<div class="ehsContent">
|
<div class="ehsContent">
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
<a href="tvgenres.html">Genres</a>
|
<a href="tvgenres.html">Genres</a>
|
||||||
<a href="tvpeople.html" class="ui-btn-active">Actors</a>
|
<a href="tvpeople.html" class="ui-btn-active">Actors</a>
|
||||||
<a href="tvstudios.html">Networks</a>
|
<a href="tvstudios.html">Networks</a>
|
||||||
|
<a href="favoritetv.html">Favorites</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="alphabetPicker">
|
<div class="alphabetPicker">
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
<a href="tvgenres.html">Genres</a>
|
<a href="tvgenres.html">Genres</a>
|
||||||
<a href="tvpeople.html">Actors</a>
|
<a href="tvpeople.html">Actors</a>
|
||||||
<a href="tvstudios.html">Networks</a>
|
<a href="tvstudios.html">Networks</a>
|
||||||
|
<a href="favoritetv.html">Favorites</a>
|
||||||
</div>
|
</div>
|
||||||
<div data-role="content">
|
<div data-role="content">
|
||||||
<table class="ehsContent">
|
<table class="ehsContent">
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
<a href="tvgenres.html">Genres</a>
|
<a href="tvgenres.html">Genres</a>
|
||||||
<a href="tvpeople.html">Actors</a>
|
<a href="tvpeople.html">Actors</a>
|
||||||
<a href="tvstudios.html">Networks</a>
|
<a href="tvstudios.html">Networks</a>
|
||||||
|
<a href="favoritetv.html">Favorites</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="alphabetPicker">
|
<div class="alphabetPicker">
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12,6 +12,7 @@
|
||||||
<a href="tvgenres.html">Genres</a>
|
<a href="tvgenres.html">Genres</a>
|
||||||
<a href="tvpeople.html">Actors</a>
|
<a href="tvpeople.html">Actors</a>
|
||||||
<a href="tvstudios.html" class="ui-btn-active">Networks</a>
|
<a href="tvstudios.html" class="ui-btn-active">Networks</a>
|
||||||
|
<a href="favoritetv.html">Favorites</a>
|
||||||
</div>
|
</div>
|
||||||
<div data-role="content">
|
<div data-role="content">
|
||||||
<div class="viewSettings">
|
<div class="viewSettings">
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue