mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update xbox one profile
This commit is contained in:
parent
f515eab01b
commit
b28e9b73bb
24 changed files with 624 additions and 532 deletions
|
@ -123,9 +123,13 @@
|
|||
|
||||
function loadRecentlyAdded(elem, user, context) {
|
||||
|
||||
var limit = AppInfo.hasLowImageBandwidth ?
|
||||
16 :
|
||||
24;
|
||||
|
||||
var options = {
|
||||
|
||||
Limit: 24,
|
||||
Limit: limit,
|
||||
Fields: "PrimaryImageAspectRatio,SyncInfo",
|
||||
ImageTypeLimit: 1,
|
||||
EnableImageTypes: "Primary,Backdrop,Banner,Thumb"
|
||||
|
|
|
@ -71,6 +71,8 @@
|
|||
|
||||
html += '</div>';
|
||||
|
||||
html = normalizeLinksHtml(html);
|
||||
|
||||
$(document.body).prepend(html);
|
||||
$('.viewMenuBar').trigger('create');
|
||||
|
||||
|
@ -78,6 +80,18 @@
|
|||
bindMenuEvents();
|
||||
}
|
||||
|
||||
function replaceAll(str, find, replace) {
|
||||
return str.replace(new RegExp(find, 'g'), replace);
|
||||
}
|
||||
|
||||
function normalizeLinksHtml(html) {
|
||||
|
||||
if (AppInfo.resetOnLibraryChange) {
|
||||
html = replaceAll(html, '<a ', '<a data-ajax="false"');
|
||||
}
|
||||
return html;
|
||||
}
|
||||
|
||||
function bindMenuEvents() {
|
||||
|
||||
if (AppInfo.isTouchPreferred) {
|
||||
|
@ -99,6 +113,15 @@
|
|||
initHeadRoom(viewMenuBar);
|
||||
}
|
||||
|
||||
function updateViewMenuBarHeadroom(page, viewMenuBar) {
|
||||
|
||||
if ($(page).hasClass('libraryPage')) {
|
||||
viewMenuBar.removeClass('headroomDisabled');
|
||||
} else {
|
||||
viewMenuBar.addClass('headroomDisabled');
|
||||
}
|
||||
}
|
||||
|
||||
function getItemHref(item, context) {
|
||||
|
||||
return LibraryBrowser.getHref(item, context);
|
||||
|
@ -114,7 +137,7 @@
|
|||
html += '<div class="libraryMenuDivider"></div>';
|
||||
html += '<div class="adminMenuOptions">';
|
||||
|
||||
html += '<a class="sidebarLink lnkMediaFolder" data-itemid="dashboard" href="dashboard.html"><span class="fa fa-cog sidebarLinkIcon"></span>' + Globalize.translate('ButtonDashboard') + '</a>';
|
||||
html += '<a class="sidebarLink lnkMediaFolder" data-itemid="dashboard" data-rel="none" href="dashboard.html"><span class="fa fa-cog sidebarLinkIcon"></span>' + Globalize.translate('ButtonDashboard') + '</a>';
|
||||
html += '<a class="sidebarLink lnkMediaFolder editorViewMenu" data-itemid="editor" href="edititemmetadata.html"><span class="fa fa-edit sidebarLinkIcon"></span>' + Globalize.translate('ButtonMetadataManager') + '</a>';
|
||||
html += '<a class="sidebarLink lnkMediaFolder" data-itemid="reports" href="reports.html"><span class="fa fa-bar-chart sidebarLinkIcon"></span>' + Globalize.translate('ButtonReports') + '</a>';
|
||||
html += '</div>';
|
||||
|
@ -218,6 +241,8 @@
|
|||
|
||||
}).join('');
|
||||
|
||||
html = normalizeLinksHtml(html);
|
||||
|
||||
var elem = $('.libraryMenuOptions').html(html);
|
||||
|
||||
$('.sidebarLink', elem).on('click', function () {
|
||||
|
@ -308,6 +333,7 @@
|
|||
}
|
||||
|
||||
html += getViewsHtml();
|
||||
html = normalizeLinksHtml(html);
|
||||
html += '</div>';
|
||||
|
||||
html += '</div>';
|
||||
|
@ -492,11 +518,13 @@
|
|||
}).on('pagebeforeshow', ".page:not(.standalonePage)", function () {
|
||||
|
||||
var page = this;
|
||||
var viewMenuBar = $('.viewMenuBar');
|
||||
if (!$('.viewMenuBar').length) {
|
||||
|
||||
ConnectionManager.user().done(function (user) {
|
||||
|
||||
renderHeader(user);
|
||||
updateViewMenuBarHeadroom(page, $('.viewMenuBar'));
|
||||
|
||||
updateCastIcon();
|
||||
|
||||
|
@ -506,6 +534,7 @@
|
|||
} else {
|
||||
updateContextText(page);
|
||||
updateLibraryNavLinks(page);
|
||||
updateViewMenuBarHeadroom(page, viewMenuBar);
|
||||
}
|
||||
|
||||
var jpage = $(page);
|
||||
|
@ -519,14 +548,20 @@
|
|||
$(document.body).removeClass('dashboardDocument').removeClass('libraryDocument');
|
||||
}
|
||||
|
||||
}).on('pagebeforeshow', ".page", function () {
|
||||
}).on('pagebeforeshow', ".libraryPage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
if ($(page).hasClass('standalonePage')) {
|
||||
$('.viewMenuBar').hide();
|
||||
if (AppInfo.enableBottomTabs) {
|
||||
$('.libraryViewNav', page).addClass('bottomLibraryViewNav');
|
||||
$(page).addClass('noSecondaryNavPage');
|
||||
} else {
|
||||
$('.viewMenuBar').show();
|
||||
|
||||
$('.libraryViewNav', page).each(function () {
|
||||
|
||||
initHeadRoom(this);
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}).on('pageshow', ".libraryPage", function () {
|
||||
|
@ -541,12 +576,6 @@
|
|||
// Scroll back up so in case vertical scroll was messed with
|
||||
$(document).scrollTop(0);
|
||||
}
|
||||
|
||||
$('.libraryViewNav', page).each(function () {
|
||||
|
||||
initHeadRoom(this);
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
function initHeadRoom(elem) {
|
||||
|
|
|
@ -100,6 +100,12 @@
|
|||
});
|
||||
|
||||
$('.fldEnableBackdrops', page).show();
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
$('.homePageConfigurationSection', page).hide();
|
||||
} else {
|
||||
$('.homePageConfigurationSection', page).show();
|
||||
}
|
||||
});
|
||||
|
||||
window.WebClientPreferencesPage = {
|
||||
|
|
|
@ -108,9 +108,7 @@ var Dashboard = {
|
|||
|
||||
if (!Dashboard.getUserPromise) {
|
||||
|
||||
var userId = Dashboard.getCurrentUserId();
|
||||
|
||||
Dashboard.getUserPromise = ConnectionManager.currentApiClient().getUser(userId).fail(Dashboard.logout);
|
||||
Dashboard.getUserPromise = ConnectionManager.currentApiClient().getCurrentUser().fail(Dashboard.logout);
|
||||
}
|
||||
|
||||
return Dashboard.getUserPromise;
|
||||
|
@ -368,7 +366,7 @@ var Dashboard = {
|
|||
|
||||
showFooterNotification: function (options) {
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
if (!AppInfo.enableFooterNotifications) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -376,7 +374,7 @@ var Dashboard = {
|
|||
|
||||
options.id = options.id || "notification" + new Date().getTime() + parseInt(Math.random());
|
||||
|
||||
var footer = $("#footer").css("top", "initial").show();
|
||||
var footer = $(".footer").css("top", "initial").show();
|
||||
|
||||
var parentElem = $('#footerNotifications', footer);
|
||||
|
||||
|
@ -572,10 +570,14 @@ var Dashboard = {
|
|||
refreshSystemInfoFromServer: function () {
|
||||
|
||||
if (Dashboard.getAccessToken()) {
|
||||
ApiClient.getSystemInfo().done(function (info) {
|
||||
if (AppInfo.enableFooterNotifications) {
|
||||
ApiClient.getSystemInfo().done(function (info) {
|
||||
|
||||
Dashboard.updateSystemInfo(info);
|
||||
});
|
||||
Dashboard.updateSystemInfo(info);
|
||||
});
|
||||
} else {
|
||||
Dashboard.ensureWebSocket();
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -702,7 +704,6 @@ var Dashboard = {
|
|||
|
||||
resetPluginSecurityInfo: function () {
|
||||
Dashboard.getPluginSecurityInfoPromise = null;
|
||||
Dashboard.validateCurrentUser();
|
||||
},
|
||||
|
||||
ensureHeader: function (page) {
|
||||
|
@ -922,7 +923,10 @@ var Dashboard = {
|
|||
}
|
||||
|
||||
ApiClient.openWebSocket();
|
||||
ApiClient.reportCapabilities(Dashboard.capabilities());
|
||||
|
||||
if (!Dashboard.isConnectMode()) {
|
||||
ApiClient.reportCapabilities(Dashboard.capabilities());
|
||||
}
|
||||
},
|
||||
|
||||
processGeneralCommand: function (cmd) {
|
||||
|
@ -1480,6 +1484,11 @@ var AppInfo = {};
|
|||
if ($.browser.mobile) {
|
||||
AppInfo.hasLowImageBandwidth = true;
|
||||
}
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
AppInfo.enableBottomTabs = true;
|
||||
AppInfo.resetOnLibraryChange = true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
|
@ -1496,6 +1505,11 @@ var AppInfo = {};
|
|||
AppInfo.enableMusicSongsTab = true;
|
||||
AppInfo.enableMusicArtistsTab = true;
|
||||
AppInfo.enableHomeLatestTab = true;
|
||||
AppInfo.enableMovieTrailersTab = true;
|
||||
}
|
||||
|
||||
if (!Dashboard.isRunningInCordova()) {
|
||||
AppInfo.enableFooterNotifications = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1557,7 +1571,9 @@ var AppInfo = {};
|
|||
if (window.ApiClient) {
|
||||
ApiClient.getDefaultImageQuality = Dashboard.getDefaultImageQuality;
|
||||
|
||||
Dashboard.importCss(ApiClient.getUrl('Branding/Css'));
|
||||
if (!Dashboard.isRunningInCordova()) {
|
||||
Dashboard.importCss(ApiClient.getUrl('Branding/Css'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1597,6 +1613,10 @@ var AppInfo = {};
|
|||
$(document.body).addClass('homeLatestTabDisabled');
|
||||
}
|
||||
|
||||
if (!AppInfo.enableMovieTrailersTab) {
|
||||
$(document.body).addClass('movieTrailersTabDisabled');
|
||||
}
|
||||
|
||||
if (Dashboard.isRunningInCordova()) {
|
||||
$(document).addClass('nativeApp');
|
||||
}
|
||||
|
@ -1674,14 +1694,14 @@ var AppInfo = {};
|
|||
var mediaPlayerElem = $('#mediaPlayer', document.body);
|
||||
mediaPlayerElem.trigger('create');
|
||||
|
||||
var footerHtml = '<div id="footer" data-theme="b" class="ui-bar-b">';
|
||||
var footerHtml = '<div id="footer" class="footer" data-theme="b" class="ui-bar-b">';
|
||||
|
||||
footerHtml += '<div id="footerNotifications"></div>';
|
||||
footerHtml += '</div>';
|
||||
|
||||
$(document.body).append(footerHtml);
|
||||
|
||||
var footerElem = $('#footer', document.body);
|
||||
var footerElem = $('.footer', document.body);
|
||||
footerElem.trigger('create');
|
||||
|
||||
$(window).on("beforeunload", function () {
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
function loadNextUp(page, context) {
|
||||
|
||||
var limit = AppInfo.hasLowImageBandwidth ?
|
||||
18 :
|
||||
16 :
|
||||
24;
|
||||
|
||||
var query = {
|
||||
|
@ -69,13 +69,17 @@
|
|||
|
||||
var parentId = LibraryMenu.getTopParentId();
|
||||
|
||||
var limit = AppInfo.hasLowImageBandwidth ?
|
||||
4 :
|
||||
6;
|
||||
|
||||
var options = {
|
||||
|
||||
SortBy: "DatePlayed",
|
||||
SortOrder: "Descending",
|
||||
IncludeItemTypes: "Episode",
|
||||
Filters: "IsResumable",
|
||||
Limit: 6,
|
||||
Limit: limit,
|
||||
Recursive: true,
|
||||
Fields: "PrimaryImageAspectRatio,SeriesInfo,UserData,SyncInfo",
|
||||
ExcludeLocationTypes: "Virtual",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue