diff --git a/dashboard-ui/components/dockedtabs/dockedtabs.css b/dashboard-ui/components/dockedtabs/dockedtabs.css index 7ae094c728..4dc65f2ba0 100644 --- a/dashboard-ui/components/dockedtabs/dockedtabs.css +++ b/dashboard-ui/components/dockedtabs/dockedtabs.css @@ -9,7 +9,7 @@ align-items: center; justify-content: center; text-transform: none !important; - font-size: 12px !important; + font-size: 12.4px !important; padding: 0 !important; margin: 0 !important; text-align: center; diff --git a/dashboard-ui/components/dockedtabs/dockedtabs.js b/dashboard-ui/components/dockedtabs/dockedtabs.js index 9112486d9a..9e279dd041 100644 --- a/dashboard-ui/components/dockedtabs/dockedtabs.js +++ b/dashboard-ui/components/dockedtabs/dockedtabs.js @@ -170,6 +170,9 @@ e.preventDefault(); e.stopPropagation(); break; + case 6: + Dashboard.navigate('dashboard.html'); + break; default: break; } @@ -206,7 +209,7 @@ var html = ''; var liveTVButtonClass = appHost.supports('sync') ? ' dockedtab-midsize' : ''; - + html += '
\ \ - \ \ + '; + html += '\ @@ -261,6 +269,12 @@ } else { element.querySelector('.docked-tab-livetv').classList.add('hide'); } + + if (user.Policy.IsAdministrator) { + element.querySelector('.docked-tab-manageserver').classList.remove('hide'); + } else { + element.querySelector('.docked-tab-manageserver').classList.add('hide'); + } } function showUserTabs(user, element) { diff --git a/dashboard-ui/css/librarymenu.css b/dashboard-ui/css/librarymenu.css index 9181ae1919..5929d69cc7 100644 --- a/dashboard-ui/css/librarymenu.css +++ b/dashboard-ui/css/librarymenu.css @@ -91,7 +91,7 @@ .libraryMenuButtonText { text-decoration: none; - font-weight: 400 !important; + font-weight: 500 !important; display: inline-flex; vertical-align: middle; padding-left: 0 !important; @@ -102,7 +102,8 @@ overflow: hidden; text-overflow: ellipsis; align-items: center; - margin-left: 1em; + margin-left: .5em; + font-size: 108%; } .viewMenuBar { @@ -230,13 +231,6 @@ background-color: #1D1D20; } -@media all and (max-width: 360px) { - - .libraryMenuButtonText { - display: none; - } -} - @media all and (max-width: 800px) { /* The sidebar isn't visible at this size, so there's no way to navigate within the editor */ diff --git a/dashboard-ui/devices/ios/ios.css b/dashboard-ui/devices/ios/ios.css index ba80ff2d66..146e33ba91 100644 --- a/dashboard-ui/devices/ios/ios.css +++ b/dashboard-ui/devices/ios/ios.css @@ -76,19 +76,6 @@ h1, h1 a { font-weight: 400; } -.libraryMenuButtonText { - font-weight: 500 !important; - position: absolute; - left: 100px; - right: 100px; - top: 12px; - text-align: center; - font-size: 16px; - margin: 0 auto !important; - padding: 0 !important; - justify-content: center; -} - .noSecondaryNavPage .itemBackdrop { margin-top: 0; } @@ -121,10 +108,6 @@ h1, h1 a { right: 5px !important; } -.searchBackButton { - display: none !important; -} - .txtSearch { padding-bottom: .5em !important; text-indent: 0 !important; diff --git a/dashboard-ui/scripts/loginpage.js b/dashboard-ui/scripts/loginpage.js index 64fe18fbf5..ab07658557 100644 --- a/dashboard-ui/scripts/loginpage.js +++ b/dashboard-ui/scripts/loginpage.js @@ -1,76 +1,44 @@ -define(['appSettings', 'cardStyle', 'emby-checkbox'], function (appSettings) { +define(['appSettings', 'dom', 'connectionManager', 'cardStyle', 'emby-checkbox'], function (appSettings, dom, connectionManager) { - function getApiClient() { + function authenticateUserByName(page, apiClient, username, password) { - var serverId = getParameterByName('serverid'); + Dashboard.showLoadingMsg(); - if (serverId) { - return ConnectionManager.getOrCreateApiClient(serverId); + apiClient.authenticateUserByName(username, password).then(function (result) { - } else { - return ApiClient; - } - } + var user = result.User; - var LoginPage = { + var serverId = getParameterByName('serverid'); - showVisualForm: function (page) { + var newUrl; - page.querySelector('.visualLoginForm').classList.remove('hide'); - page.querySelector('.manualLoginForm').classList.add('hide'); - }, - - getLastSeenText: function (lastActivityDate) { - - if (!lastActivityDate) { - return ""; + if (user.Policy.IsAdministrator && !serverId) { + newUrl = "dashboard.html"; + } else { + newUrl = "home.html"; } - return "Last seen " + humane_date(lastActivityDate); - }, + Dashboard.hideLoadingMsg(); - authenticateUserByName: function (page, apiClient, username, password) { + Dashboard.onServerChanged(user.Id, result.AccessToken, apiClient); + Dashboard.navigate(newUrl); - Dashboard.showLoadingMsg(); + }, function (response) { - apiClient.authenticateUserByName(username, password).then(function (result) { + page.querySelector('#txtManualName').value = ''; + page.querySelector('#txtManualPassword').value = ''; - var user = result.User; + Dashboard.hideLoadingMsg(); - var serverId = getParameterByName('serverid'); - - var newUrl; - - if (user.Policy.IsAdministrator && !serverId) { - newUrl = "dashboard.html"; - } else { - newUrl = "home.html"; - } - - Dashboard.hideLoadingMsg(); - - Dashboard.onServerChanged(user.Id, result.AccessToken, apiClient); - Dashboard.navigate(newUrl); - - }, function (response) { - - page.querySelector('#txtManualName').value = ''; - page.querySelector('#txtManualPassword').value = ''; - - Dashboard.hideLoadingMsg(); - - if (response.status == 401) { - require(['toast'], function (toast) { - toast(Globalize.translate('MessageInvalidUser')); - }); - } else { - showServerConnectionFailure(); - } - }); - - } - - }; + if (response.status == 401) { + require(['toast'], function (toast) { + toast(Globalize.translate('MessageInvalidUser')); + }); + } else { + showServerConnectionFailure(); + } + }); + } function showServerConnectionFailure() { @@ -166,7 +134,7 @@ html += '
' + user.Name + '
'; html += '
'; - var lastSeen = LoginPage.getLastSeenText(user.LastActivityDate); + var lastSeen = getLastSeenText(user.LastActivityDate); if (lastSeen != "") { html += lastSeen; } @@ -183,25 +151,39 @@ context.querySelector('#divUsers').innerHTML = html; } - function parentWithClass(elem, className) { + function getLastSeenText(lastActivityDate) { - while (!elem.classList || !elem.classList.contains(className)) { - elem = elem.parentNode; - - if (!elem) { - return null; - } + if (!lastActivityDate) { + return ""; } - return elem; + return "Last seen " + humane_date(lastActivityDate); } return function (view, params) { var self = this; + function getApiClient() { + + var serverId = params.serverid; + + if (serverId) { + return connectionManager.getOrCreateApiClient(serverId); + + } else { + return ApiClient; + } + } + + function showVisualForm() { + + view.querySelector('.visualLoginForm').classList.remove('hide'); + view.querySelector('.manualLoginForm').classList.add('hide'); + } + view.querySelector('#divUsers').addEventListener('click', function (e) { - var cardContent = parentWithClass(e.target, 'cardContent'); + var cardContent = dom.parentWithClass(e.target, 'cardContent'); if (cardContent) { @@ -215,7 +197,7 @@ showManualForm(context, true); } else if (haspw == 'false') { - LoginPage.authenticateUserByName(context, getApiClient(), name, ''); + authenticateUserByName(context, getApiClient(), name, ''); } else { context.querySelector('#txtManualName').value = name; @@ -230,7 +212,7 @@ appSettings.enableAutoLogin(view.querySelector('.chkRememberLogin').checked); var apiClient = getApiClient(); - LoginPage.authenticateUserByName(view, apiClient, view.querySelector('#txtManualName').value, view.querySelector('#txtManualPassword').value); + authenticateUserByName(view, apiClient, view.querySelector('#txtManualName').value, view.querySelector('#txtManualPassword').value); e.preventDefault(); // Disable default form submission @@ -241,9 +223,7 @@ Dashboard.navigate('forgotpassword.html'); }); - view.querySelector('.btnCancel').addEventListener('click', function () { - LoginPage.showVisualForm(view); - }); + view.querySelector('.btnCancel').addEventListener('click', showVisualForm); view.querySelector('.btnManual').addEventListener('click', function () { view.querySelector('#txtManualName').value = ''; @@ -263,7 +243,7 @@ } else { - LoginPage.showVisualForm(view); + showVisualForm(); loadUserList(view, apiClient, users); }