1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

add library to front page

This commit is contained in:
Luke Pulverenti 2014-05-13 20:46:45 -04:00
parent dc6dbcf469
commit 655c9cb48f
11 changed files with 102 additions and 28 deletions

View file

@ -38,7 +38,7 @@
.libraryPage > .ui-content { .libraryPage > .ui-content {
padding-top: 10px; padding-top: 10px;
padding-bottom: 100px; padding-bottom: 50px;
} }
.libraryPage .currentUsername { .libraryPage .currentUsername {
@ -56,7 +56,7 @@
border-spacing: 0; border-spacing: 0;
border-collapse: collapse; border-collapse: collapse;
margin: 0 auto; margin: 0 auto;
max-width: 1540px; max-width: 650px;
} }
.ehsContent td { .ehsContent td {
@ -65,7 +65,51 @@
} }
.squareEhsContent { .squareEhsContent {
max-width: 750px;
}
@media all and (min-width: 1000px) {
.ehsContent {
max-width: 905px;
}
.squareEhsContent {
max-width: 750px;
}
}
@media all and (min-width: 1200px) {
.ehsContent {
max-width: 925px;
}
.squareEhsContent {
max-width: 900px;
}
}
@media all and (min-width: 1400px) {
.ehsContent {
max-width: 1240px;
}
.squareEhsContent {
max-width: 1240px;
}
}
@media all and (min-width: 1600px) {
.ehsContent {
max-width: 1540px;
}
.squareEhsContent {
max-width: 1420px; max-width: 1420px;
}
} }
.detailPageContent { .detailPageContent {

View file

@ -90,13 +90,13 @@ h2 {
font-size: 1.68em; font-size: 1.68em;
} }
a, a.ui-link { /*a, a.ui-link {
font-weight: normal; font-weight: normal;
} }
.ui-controlgroup a, a.ui-btn { .ui-controlgroup a, a.ui-btn {
font-weight: bold; font-weight: bold;
} }*/
h1 a { h1 a {
text-decoration: none; text-decoration: none;

View file

@ -6,17 +6,16 @@
<body> <body>
<div id="indexPage" data-role="page" class="page type-home libraryPage allLibraryPage noSecondaryNavPage backdropPage" data-theme="b" data-backdroptype="movie,series,game,book"> <div id="indexPage" data-role="page" class="page type-home libraryPage allLibraryPage noSecondaryNavPage backdropPage" data-theme="b" data-backdroptype="movie,series,game,book">
<!-- <div class="libraryViewNav scopedLibraryViewNav">
<a href="#" class="ui-btn-active">${TabHome}</a>
<a href="#">${TabMyLibrary}</a>
<a href="#">${TabFavorites}</a>
</div>-->
<div data-role="content"> <div data-role="content">
<table class="ehsContent"> <table class="ehsContent">
<tr> <tr>
<td> <td>
<h1 class="listHeader">${HeaderMyLibrary}</h1>
<div class="myLibrary">
</div>
<div id="resumableSection" style="display: none;"> <div id="resumableSection" style="display: none;">
<h1 class="listHeader">${HeaderResume}</h1> <h1 class="listHeader">${HeaderResume}</h1>
@ -28,8 +27,6 @@
<div id="recentlyAddedItems"> <div id="recentlyAddedItems">
</div> </div>
<div class="spotlightContainer"></div>
</td> </td>
</tr> </tr>
</table> </table>

View file

@ -32,6 +32,18 @@
DashboardPage.reloadSystemInfo(page); DashboardPage.reloadSystemInfo(page);
DashboardPage.reloadNews(page); DashboardPage.reloadNews(page);
DashboardPage.sessionUpdateTimer = setInterval(DashboardPage.refreshSessionsLocally, 60000);
},
refreshSessionsLocally: function () {
var list = DashboardPage.sessionsList;
if (list) {
console.log('refreshSessionsLocally');
DashboardPage.renderActiveConnections($.mobile.activePage, list);
}
}, },
reloadSystemInfo: function (page) { reloadSystemInfo: function (page) {
@ -122,6 +134,10 @@
$(ApiClient).off("websocketmessage", DashboardPage.onWebSocketMessage).off("websocketopen", DashboardPage.onWebSocketConnectionChange).off("websocketerror", DashboardPage.onWebSocketConnectionChange).off("websocketclose", DashboardPage.onWebSocketConnectionChange); $(ApiClient).off("websocketmessage", DashboardPage.onWebSocketMessage).off("websocketopen", DashboardPage.onWebSocketConnectionChange).off("websocketerror", DashboardPage.onWebSocketConnectionChange).off("websocketclose", DashboardPage.onWebSocketConnectionChange);
DashboardPage.stopInterval(); DashboardPage.stopInterval();
if (DashboardPage.sessionUpdateTimer) {
clearInterval(DashboardPage.sessionUpdateTimer);
}
}, },
startInterval: function () { startInterval: function () {
@ -190,6 +206,8 @@
var html = ''; var html = '';
DashboardPage.sessionsList = sessions;
var parentElement = $('.activeDevices', page); var parentElement = $('.activeDevices', page);
$('.activeSession', parentElement).addClass('deadSession'); $('.activeSession', parentElement).addClass('deadSession');

View file

@ -113,6 +113,24 @@
var options = { var options = {
SortBy: "SortName",
Fields: "PrimaryImageAspectRatio"
};
ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
$('.myLibrary', page).html(LibraryBrowser.getPosterViewHtml({
items: result.Items,
shape: 'smallBackdrop',
showTitle: true,
centerText: true
})).createPosterItemMenus();
});
options = {
SortBy: "DatePlayed", SortBy: "DatePlayed",
SortOrder: "Descending", SortOrder: "Descending",
MediaTypes: "Video", MediaTypes: "Video",
@ -124,7 +142,7 @@
ExcludeLocationTypes: "Virtual" ExcludeLocationTypes: "Virtual"
}; };
var promise1 = ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) { ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
if (result.Items.length) { if (result.Items.length) {
$('#resumableSection', page).show(); $('#resumableSection', page).show();
@ -156,7 +174,7 @@
ExcludeLocationTypes: "Virtual,Remote" ExcludeLocationTypes: "Virtual,Remote"
}; };
var promise2 = ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) { ApiClient.getItems(Dashboard.getCurrentUserId(), options).done(function (result) {
$('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({ $('#recentlyAddedItems', page).html(LibraryBrowser.getPosterViewHtml({
@ -168,9 +186,6 @@
})).createPosterItemMenus(); })).createPosterItemMenus();
}); });
//var allPromise = $.when(promise1, promise2);
//reloadSpotlight(page, allPromise);
}); });
})(jQuery, document, ApiClient); })(jQuery, document, ApiClient);

View file

@ -64,7 +64,7 @@
clearProgressInterval(); clearProgressInterval();
var intervalTime = ApiClient.isWebSocketOpen() ? 2000 : 20000; var intervalTime = ApiClient.isWebSocketOpen() ? 1200 : 20000;
currentProgressInterval = setInterval(function () { currentProgressInterval = setInterval(function () {

View file

@ -13,7 +13,7 @@
SortBy: "DateCreated", SortBy: "DateCreated",
SortOrder: "Descending", SortOrder: "Descending",
IncludeItemTypes: "MusicAlbum", IncludeItemTypes: "MusicAlbum",
Limit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 8 : 5), Limit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 7 : 5),
Recursive: true, Recursive: true,
Fields: "PrimaryImageAspectRatio", Fields: "PrimaryImageAspectRatio",
ParentId: parentId ParentId: parentId
@ -36,7 +36,7 @@
SortBy: "DateCreated", SortBy: "DateCreated",
SortOrder: "Descending", SortOrder: "Descending",
IncludeItemTypes: "Audio", IncludeItemTypes: "Audio",
Limit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 8 : 5), Limit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 7 : 5),
Recursive: true, Recursive: true,
Fields: "PrimaryImageAspectRatio,AudioInfo", Fields: "PrimaryImageAspectRatio,AudioInfo",
ParentId: parentId ParentId: parentId
@ -59,7 +59,7 @@
SortBy: "DatePlayed", SortBy: "DatePlayed",
SortOrder: "Descending", SortOrder: "Descending",
IncludeItemTypes: "Audio", IncludeItemTypes: "Audio",
Limit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 8 : 5), Limit: screenWidth >= 1920 ? 8 : (screenWidth >= 1440 ? 7 : 5),
Recursive: true, Recursive: true,
Fields: "PrimaryImageAspectRatio,AudioInfo", Fields: "PrimaryImageAspectRatio,AudioInfo",
Filters: "IsPlayed", Filters: "IsPlayed",

View file

@ -19,7 +19,7 @@
if (chapter.ImageTag) { if (chapter.ImageTag) {
imgUrl = ApiClient.getImageUrl(itemId, { imgUrl = ApiClient.getImageUrl(itemId, {
maxwidth: 600, width: 800,
tag: chapter.ImageTag, tag: chapter.ImageTag,
type: "Chapter", type: "Chapter",
index: i index: i

View file

@ -197,7 +197,7 @@
if (ApiClient.isWebSocketOpen()) { if (ApiClient.isWebSocketOpen()) {
ApiClient.sendWebSocketMessage("SessionsStart", "100,900"); ApiClient.sendWebSocketMessage("SessionsStart", "100,800");
} }
}; };

View file

@ -12,7 +12,7 @@
SortOrder: "Descending", SortOrder: "Descending",
IncludeItemTypes: "Episode", IncludeItemTypes: "Episode",
Filters: "IsResumable", Filters: "IsResumable",
Limit: screenWidth >= 1920 ? 5 : (screenWidth >= 1440 ? 4 : 3), Limit: screenWidth >= 1920 ? 5 : 4,
Recursive: true, Recursive: true,
Fields: "PrimaryImageAspectRatio,SeriesInfo,UserData", Fields: "PrimaryImageAspectRatio,SeriesInfo,UserData",
ExcludeLocationTypes: "Virtual", ExcludeLocationTypes: "Virtual",

View file

@ -4,7 +4,7 @@
<title>${TitleMediaBrowser}</title> <title>${TitleMediaBrowser}</title>
</head> </head>
<body> <body>
<div id="tvShowsPage" data-role="page" class="page libraryPage" data-theme="b" data-view="tv"> <div id="tvShowsPage" data-role="page" class="page libraryPage backdropPage" data-theme="b" data-view="tv" data-backdroptype="series">
<div class="libraryViewNav scopedLibraryViewNav"> <div class="libraryViewNav scopedLibraryViewNav">
<a href="tvrecommended.html">${TabSuggested}</a> <a href="tvrecommended.html">${TabSuggested}</a>
<a href="tvlatest.html">${TabLatest}</a> <a href="tvlatest.html">${TabLatest}</a>