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

rename web client tab

This commit is contained in:
Luke Pulverenti 2015-05-07 10:04:10 -04:00
parent 6a2085d68b
commit f515eab01b
47 changed files with 287 additions and 174 deletions

View file

@ -89,7 +89,7 @@
html += '<a data-itemid="' + item.Id + '" class="' + cssClass + '" href="' + href + '">';
html += '<div class="cardBox" style="background-color:' + backgroundColor + ';margin:4px;border-radius:4px;">';
html += "<div class='cardText' style='padding:6px 10px;color:#fff;'>";
html += "<div class='cardText' style='padding:7px 10px;color:#fff;'>";
html += '<i class="fa ' + icon + '"></i>';
html += '<span style="margin-left:.7em;">' + item.Name + '</span>';
html += "</div>";

View file

@ -472,7 +472,12 @@
}
if (item.CollectionType == 'channels') {
return 'channelslatest.html';
if (AppInfo.enableLatestChannelItems) {
return 'channelslatest.html';
} else {
return 'channels.html';
}
}
if (context != 'folders') {

View file

@ -919,8 +919,8 @@
function resetImages(page) {
//$('cardImage', page).remove();
$('.cardImage', page).each(resetCardImage);
$('cardImage', page).remove();
//$('.cardImage', page).each(resetCardImage);
}
$(document).on('pageinit', ".libraryPage", function () {

View file

@ -2,10 +2,14 @@
function loadLatest(page, userId, parentId) {
var limit = AppInfo.hasLowImageBandwidth ?
15 :
18;
var options = {
IncludeItemTypes: "Movie",
Limit: 18,
Limit: limit,
Fields: "PrimaryImageAspectRatio,MediaSourceCount,SyncInfo",
ParentId: parentId,
ImageTypeLimit: 1,
@ -24,6 +28,46 @@
});
}
function loadResume(page, userId, parentId) {
var screenWidth = $(window).width();
var options = {
SortBy: "DatePlayed",
SortOrder: "Descending",
IncludeItemTypes: "Movie",
Filters: "IsResumable",
Limit: screenWidth >= 1920 ? 6 : (screenWidth >= 1600 ? 4 : 3),
Recursive: true,
Fields: "PrimaryImageAspectRatio,MediaSourceCount,SyncInfo",
CollapseBoxSetItems: false,
ParentId: parentId,
ImageTypeLimit: 1,
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
};
ApiClient.getItems(userId, options).done(function (result) {
if (result.Items.length) {
$('#resumableSection', page).show();
} else {
$('#resumableSection', page).hide();
}
$('#resumableItems', page).html(LibraryBrowser.getPosterViewHtml({
items: result.Items,
preferThumb: true,
shape: 'backdrop',
overlayText: true,
showTitle: true,
lazy: true
})).lazyChildren().trigger('create');
});
}
function getRecommendationHtml(recommendation) {
var html = '';
@ -62,58 +106,10 @@
return html;
}
$(document).on('pageinit', "#moviesRecommendedPage", function () {
var page = this;
$('.recommendations', page).createCardMenus();
}).on('pagebeforeshow', "#moviesRecommendedPage", function () {
var parentId = LibraryMenu.getTopParentId();
function loadSuggestions(page, userId, parentId) {
var screenWidth = $(window).width();
var page = this;
var userId = Dashboard.getCurrentUserId();
var options = {
SortBy: "DatePlayed",
SortOrder: "Descending",
IncludeItemTypes: "Movie",
Filters: "IsResumable",
Limit: screenWidth >= 1920 ? 6 : (screenWidth >= 1600 ? 4 : 3),
Recursive: true,
Fields: "PrimaryImageAspectRatio,MediaSourceCount,SyncInfo",
CollapseBoxSetItems: false,
ParentId: parentId,
ImageTypeLimit: 1,
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
};
ApiClient.getItems(userId, options).done(function (result) {
if (result.Items.length) {
$('#resumableSection', page).show();
} else {
$('#resumableSection', page).hide();
}
$('#resumableItems', page).html(LibraryBrowser.getPosterViewHtml({
items: result.Items,
preferThumb: true,
shape: 'backdrop',
overlayText: true,
showTitle: true,
lazy: true
})).lazyChildren().trigger('create');
});
loadLatest(page, userId, parentId);
var url = ApiClient.getUrl("Movies/Recommendations", {
userId: userId,
@ -138,6 +134,27 @@
$('.noItemsMessage', page).hide();
$('.recommendations', page).html(html).lazyChildren();
});
}
$(document).on('pageinit', "#moviesRecommendedPage", function () {
var page = this;
$('.recommendations', page).createCardMenus();
}).on('pagebeforeshow', "#moviesRecommendedPage", function () {
var parentId = LibraryMenu.getTopParentId();
var page = this;
var userId = Dashboard.getCurrentUserId();
loadResume(page, userId, parentId);
loadLatest(page, userId, parentId);
if (!AppInfo.hasLowImageBandwidth) {
loadSuggestions(page, userId, parentId);
}
});

View file

@ -1354,12 +1354,12 @@ var Dashboard = {
var isBackdrop = imageType.toLowerCase() == 'backdrop';
if (isBackdrop) {
quality -= 15;
quality -= 10;
}
if (AppInfo.hasLowImageBandwidth) {
quality -= 10;
quality -= 15;
if (isBackdrop) {
quality -= 10;
@ -1487,6 +1487,16 @@ var AppInfo = {};
AppInfo.enableHeadRoom = true;
}
}
if (!AppInfo.hasLowImageBandwidth) {
AppInfo.enableLatestChannelItems = true;
AppInfo.enableStudioTabs = true;
AppInfo.enablePeopleTabs = true;
AppInfo.enableTvEpisodesTab = true;
AppInfo.enableMusicSongsTab = true;
AppInfo.enableMusicArtistsTab = true;
AppInfo.enableHomeLatestTab = true;
}
}
function initializeApiClient(apiClient) {
@ -1559,6 +1569,38 @@ var AppInfo = {};
$(document.body).addClass('largeCardMargin');
}
if (!AppInfo.enableLatestChannelItems) {
$(document.body).addClass('latestChannelItemsDisabled');
}
if (!AppInfo.enableStudioTabs) {
$(document.body).addClass('studioTabDisabled');
}
if (!AppInfo.enablePeopleTabs) {
$(document.body).addClass('peopleTabDisabled');
}
if (!AppInfo.enableTvEpisodesTab) {
$(document.body).addClass('tvEpisodesTabDisabled');
}
if (!AppInfo.enableMusicSongsTab) {
$(document.body).addClass('musicSongsTabDisabled');
}
if (!AppInfo.enableMusicArtistsTab) {
$(document.body).addClass('musicArtistsTabDisabled');
}
if (!AppInfo.enableHomeLatestTab) {
$(document.body).addClass('homeLatestTabDisabled');
}
if (Dashboard.isRunningInCordova()) {
$(document).addClass('nativeApp');
}
var videoPlayerHtml = '<div id="mediaPlayer" data-theme="b" class="ui-bar-b" style="display: none;">';
videoPlayerHtml += '<div class="videoBackdrop">';

View file

@ -8,10 +8,14 @@
var page = this;
var limit = AppInfo.hasLowImageBandwidth ?
20 :
30;
var options = {
IncludeItemTypes: "Episode",
Limit: 30,
Limit: limit,
Fields: "PrimaryImageAspectRatio,SyncInfo",
ParentId: parentId,
ImageTypeLimit: 1,

View file

@ -2,20 +2,9 @@
function reload(page) {
var query = {
Limit: 24,
Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated,SyncInfo",
UserId: Dashboard.getCurrentUserId(),
ExcludeLocationTypes: "Virtual",
ImageTypeLimit: 1,
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
};
query.ParentId = LibraryMenu.getTopParentId();
var context = '';
if (query.ParentId) {
if (LibraryMenu.getTopParentId()) {
$('.scopedLibraryViewNav', page).show();
$('.globalNav', page).hide();
@ -37,9 +26,13 @@
function loadNextUp(page, context) {
var limit = AppInfo.hasLowImageBandwidth ?
18 :
24;
var query = {
Limit: 24,
Limit: limit,
Fields: "PrimaryImageAspectRatio,SeriesInfo,DateCreated,SyncInfo",
UserId: Dashboard.getCurrentUserId(),
ExcludeLocationTypes: "Virtual",

View file

@ -4,9 +4,13 @@
var page = this;
var limit = AppInfo.hasLowImageBandwidth ?
20 :
40;
var query = {
Limit: 40,
Limit: limit,
Fields: "AirTime,UserData,SeriesStudio,SyncInfo",
UserId: Dashboard.getCurrentUserId(),
ImageTypeLimit: 1,