mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge branch 'dev' of https://github.com/MediaBrowser/MediaBrowser into dev
This commit is contained in:
commit
bb77192e8c
21 changed files with 404 additions and 151 deletions
|
@ -4,6 +4,10 @@
|
|||
|
||||
var html = '<div class="viewMenuBar ui-bar-b">';
|
||||
|
||||
if ($.browser.safari && $.browser.mobile && window.navigator.standalone) {
|
||||
html += '<a data-rel="back" data-role="none" href="#" class="headerButton headerButtonLeft headerBackButton"><div class="fa fa-arrow-circle-o-left"></div></a>';
|
||||
}
|
||||
|
||||
html += '<button type="button" data-role="none" title="Menu" class="headerButton dashboardMenuButton barsMenuButton headerButtonLeft">';
|
||||
html += '<div class="barMenuInner fa fa-bars">';
|
||||
html += '</div>';
|
||||
|
@ -46,7 +50,7 @@
|
|||
var url = user.imageUrl;
|
||||
|
||||
if (user.supportsImageParams) {
|
||||
url += "&height=" + userButtonHeight;
|
||||
url += "&height=" + (userButtonHeight * Math.max(devicePixelRatio || 1, 2));
|
||||
}
|
||||
|
||||
html += '<img src="' + url + '" style="border-radius: 1000px; height:' + userButtonHeight + 'px;" />';
|
||||
|
@ -68,9 +72,24 @@
|
|||
$('.viewMenuBar').trigger('create');
|
||||
|
||||
$(document).trigger('headercreated');
|
||||
bindMenuEvents();
|
||||
}
|
||||
|
||||
$('.libraryMenuButton').createHoverTouch().on('hovertouch', showLibraryMenu);
|
||||
$('.dashboardMenuButton').createHoverTouch().on('hovertouch', showDashboardMenu);
|
||||
function bindMenuEvents() {
|
||||
|
||||
if ($.browser.mobile) {
|
||||
|
||||
$('.libraryMenuButton').on('mousedown', function () {
|
||||
showLibraryMenu(false);
|
||||
});
|
||||
$('.dashboardMenuButton').on('mousedown', function () {
|
||||
showDashboardMenu(false);
|
||||
});
|
||||
|
||||
} else {
|
||||
$('.libraryMenuButton').createHoverTouch().on('hovertouch', showLibraryMenu);
|
||||
$('.dashboardMenuButton').createHoverTouch().on('hovertouch', showDashboardMenu);
|
||||
}
|
||||
}
|
||||
|
||||
function getItemHref(item, context) {
|
||||
|
@ -102,13 +121,16 @@
|
|||
var page = $.mobile.activePage;
|
||||
var panel;
|
||||
|
||||
panel = getLibraryMenu();
|
||||
updateLibraryNavLinks(page);
|
||||
ConnectionManager.user().done(function (user) {
|
||||
|
||||
$(panel).panel('toggle').off('mouseleave.librarymenu').on('mouseleave.librarymenu', function () {
|
||||
panel = getLibraryMenu(user);
|
||||
updateLibraryNavLinks(page);
|
||||
|
||||
$(this).panel("close");
|
||||
$(panel).panel('toggle').off('mouseleave.librarymenu').on('mouseleave.librarymenu', function () {
|
||||
|
||||
$(this).panel("close");
|
||||
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -229,13 +251,42 @@
|
|||
|
||||
html += '<div data-role="panel" id="libraryPanel" class="libraryPanel" data-position="left" data-display="overlay" data-position-fixed="true" data-theme="b">';
|
||||
|
||||
html += '<div class="sidebarLinks librarySidebarLinks" style="margin-top: 0;margin-left: -1em;margin-right: -1em;">';
|
||||
html += '<div class="sidebarLinks librarySidebarLinks">';
|
||||
|
||||
//var userHref = user.localUser && user.localUser.Policy.EnableUserPreferenceAccess ?
|
||||
// 'mypreferencesdisplay.html?userId=' + user.localUser.Id :
|
||||
// (user.localUser ? 'index.html' : '#');
|
||||
|
||||
//var paddingLeft = user.imageUrl ? 'padding-left:.7em;' : '';
|
||||
//html += '<a style="margin-top:0;' + paddingLeft + 'display:block;color:#fff;text-decoration:none;font-size:16px;font-weight:400!important;background: #000;" href="' + userHref + '">';
|
||||
|
||||
//var imgWidth = 44;
|
||||
|
||||
//if (user.imageUrl) {
|
||||
// var url = user.imageUrl;
|
||||
|
||||
// if (user.supportsImageParams) {
|
||||
// url += "&width=" + (imgWidth * Math.max(devicePixelRatio || 1, 2));
|
||||
// }
|
||||
|
||||
// html += '<img style="max-width:' + imgWidth + 'px;vertical-align:middle;margin-right:.8em;border-radius: 50px;" src="' + url + '" />';
|
||||
//} else {
|
||||
// html += '<span class="fa fa-user sidebarLinkIcon"></span>';
|
||||
//}
|
||||
|
||||
//html += user.name;
|
||||
//html += '</a>';
|
||||
|
||||
var homeHref = ConnectionManager.currentApiClient() ? 'index.html' : 'selectserver.html';
|
||||
|
||||
html += '<a class="lnkMediaFolder sidebarLink homeViewMenu" href="' + homeHref + '">' + Globalize.translate('ButtonHome') + '</a>';
|
||||
html += '<a class="lnkMediaFolder sidebarLink" style="margin-top:.5em;padding-left:1em;display:block;color:#fff;text-decoration:none;" href="' + homeHref + '">';
|
||||
|
||||
html += '<div class="libraryMenuDivider"></div>';
|
||||
html += '<img style="max-width:36px;vertical-align:middle;margin-right:1em;" src="css/images/mblogoicon.png" />';
|
||||
|
||||
html += Globalize.translate('ButtonHome');
|
||||
html += '</a>';
|
||||
|
||||
html += '<div class="libraryMenuDivider" style="margin-top:0;"></div>';
|
||||
|
||||
html += getViewsHtml();
|
||||
html += '</div>';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue