mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update translations
This commit is contained in:
parent
9e470c9f94
commit
7e55abc130
5 changed files with 144 additions and 96 deletions
|
@ -338,15 +338,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@media all and (min-width: 700px) {
|
@media all and (min-width: 700px) {
|
||||||
.backdropCard {
|
|
||||||
width: 33.3%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bannerCard {
|
.bannerCard {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media all and (min-width: 770px) {
|
||||||
|
.backdropCard {
|
||||||
|
width: 33.3%;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media all and (min-width: 800px) {
|
@media all and (min-width: 800px) {
|
||||||
|
|
||||||
.squareCard {
|
.squareCard {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
(function (window, document, $, devicePixelRatio) {
|
(function (window, document, $, devicePixelRatio) {
|
||||||
|
|
||||||
function renderHeader(user) {
|
function renderHeader() {
|
||||||
|
|
||||||
var html = '<div class="viewMenuBar ui-bar-b">';
|
var html = '<div class="viewMenuBar ui-bar-b">';
|
||||||
|
|
||||||
|
@ -22,29 +22,61 @@
|
||||||
|
|
||||||
html += '<div class="viewMenuSecondary">';
|
html += '<div class="viewMenuSecondary">';
|
||||||
|
|
||||||
var btnCastVisible = user.localUser ? '' : 'visibility:hidden;';
|
|
||||||
|
|
||||||
if (!AppInfo.enableHeaderImages) {
|
if (!AppInfo.enableHeaderImages) {
|
||||||
html += '<button id="btnCast" class="btnCast btnCastIcon btnDefaultCast headerButton headerButtonRight" type="button" data-role="none" style="' + btnCastVisible + '">';
|
html += '<button id="btnCast" class="btnCast btnCastIcon btnDefaultCast headerButton headerButtonRight" type="button" data-role="none" style="display:none;">';
|
||||||
html += '<div class="headerSelectedPlayer"></div><i class="fa fa-wifi"></i>';
|
html += '<div class="headerSelectedPlayer"></div><i class="fa fa-wifi"></i>';
|
||||||
html += '</button>';
|
html += '</button>';
|
||||||
} else {
|
} else {
|
||||||
html += '<button id="btnCast" class="btnCast btnDefaultCast headerButton headerButtonRight" type="button" data-role="none" style="' + btnCastVisible + '"><div class="headerSelectedPlayer"></div><div class="btnCastImage"></div></button>';
|
html += '<button id="btnCast" class="btnCast btnDefaultCast headerButton headerButtonRight" type="button" data-role="none" style="display:none;"><div class="headerSelectedPlayer"></div><div class="btnCastImage"></div></button>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
html += '<button onclick="Search.showSearchPanel($.mobile.activePage);" type="button" data-role="none" class="headerButton headerButtonRight headerSearchButton" style="display:none;"><div class="fa fa-search" style="font-size:21px;"></div></button>';
|
||||||
|
|
||||||
|
html += '<div class="viewMenuSearch hide"><form class="viewMenuSearchForm">';
|
||||||
|
html += '<input type="text" data-role="none" data-type="search" class="headerSearchInput" autocomplete="off" spellcheck="off" />';
|
||||||
|
html += '<div class="searchInputIcon fa fa-search"></div>';
|
||||||
|
html += '<button data-role="none" type="button" data-iconpos="notext" class="imageButton btnCloseSearch"><i class="fa fa-close"></i></button>';
|
||||||
|
html += '</form></div>';
|
||||||
|
|
||||||
|
html += '<button class="headerButton headerButtonRight headerUserButton" type="button" data-role="none" onclick="Dashboard.showUserFlyout(this);">';
|
||||||
|
|
||||||
|
html += '<div class="fa fa-user"></div>';
|
||||||
|
|
||||||
|
html += '</button>';
|
||||||
|
|
||||||
|
html += '<a href="dashboard.html" class="headerButton headerButtonRight dashboardEntryHeaderButton" style="display:none;"><div class="fa fa-cog"></div></a>';
|
||||||
|
|
||||||
|
html += '</div>';
|
||||||
|
|
||||||
|
html += '</div>';
|
||||||
|
|
||||||
|
$(document.body).prepend(html);
|
||||||
|
$('.viewMenuBar').trigger('create').lazyChildren();
|
||||||
|
|
||||||
|
$(document).trigger('headercreated');
|
||||||
|
bindMenuEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
function addUserToHeader(user) {
|
||||||
|
|
||||||
|
var header = $('.viewMenuBar');
|
||||||
|
|
||||||
if (user.localUser) {
|
if (user.localUser) {
|
||||||
html += '<button onclick="Search.showSearchPanel($.mobile.activePage);" type="button" data-role="none" class="headerButton headerButtonRight headerSearchButton"><div class="fa fa-search" style="font-size:21px;"></div></button>';
|
$('.btnCast', header).show();
|
||||||
|
$('.headerSearchButton', header).show();
|
||||||
html += '<div class="viewMenuSearch hide"><form class="viewMenuSearchForm">';
|
} else {
|
||||||
html += '<input type="text" data-role="none" data-type="search" class="headerSearchInput" autocomplete="off" spellcheck="off" />';
|
$('.btnCast', header).hide();
|
||||||
html += '<div class="searchInputIcon fa fa-search"></div>';
|
$('.headerSearchButton', header).hide();
|
||||||
html += '<button data-role="none" type="button" data-iconpos="notext" class="imageButton btnCloseSearch"><i class="fa fa-close"></i></button>';
|
|
||||||
html += '</form></div>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.name) {
|
if (user.canManageServer) {
|
||||||
|
$('.dashboardEntryHeaderButton', header).show();
|
||||||
|
} else {
|
||||||
|
$('.dashboardEntryHeaderButton', header).hide();
|
||||||
|
}
|
||||||
|
|
||||||
html += '<button class="headerButton headerButtonRight headerUserButton" type="button" data-role="none" onclick="Dashboard.showUserFlyout(this);">';
|
var userButtonHtml = '';
|
||||||
|
if (user.name) {
|
||||||
|
|
||||||
if (user.imageUrl && AppInfo.enableUserImage) {
|
if (user.imageUrl && AppInfo.enableUserImage) {
|
||||||
|
|
||||||
|
@ -56,27 +88,12 @@
|
||||||
url += "&height=" + (userButtonHeight * Math.max(devicePixelRatio || 1, 2));
|
url += "&height=" + (userButtonHeight * Math.max(devicePixelRatio || 1, 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
html += '<div class="lazy headerUserImage" data-src="' + url + '" style="width:' + userButtonHeight + 'px;height:' + userButtonHeight + 'px;"></div>';
|
userButtonHtml += '<div class="lazy headerUserImage" data-src="' + url + '" style="width:' + userButtonHeight + 'px;height:' + userButtonHeight + 'px;"></div>';
|
||||||
} else {
|
} else {
|
||||||
html += '<div class="fa fa-user"></div>';
|
userButtonHtml += '<div class="fa fa-user"></div>';
|
||||||
}
|
}
|
||||||
|
$('.headerUserButton', header).html(userButtonHtml).lazyChildren();
|
||||||
html += '</button>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.canManageServer) {
|
|
||||||
html += '<a href="dashboard.html" class="headerButton headerButtonRight dashboardEntryHeaderButton"><div class="fa fa-cog"></div></a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
html += '</div>';
|
|
||||||
|
|
||||||
html += '</div>';
|
|
||||||
|
|
||||||
$(document.body).prepend(html);
|
|
||||||
$('.viewMenuBar').trigger('create').lazyChildren();
|
|
||||||
|
|
||||||
$(document).trigger('headercreated');
|
|
||||||
bindMenuEvents();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function bindMenuEvents() {
|
function bindMenuEvents() {
|
||||||
|
@ -505,17 +522,17 @@
|
||||||
var viewMenuBar = $('.viewMenuBar');
|
var viewMenuBar = $('.viewMenuBar');
|
||||||
if (!$('.viewMenuBar').length) {
|
if (!$('.viewMenuBar').length) {
|
||||||
|
|
||||||
ConnectionManager.user(window.ApiClient).done(function (user) {
|
renderHeader();
|
||||||
|
updateViewMenuBarHeadroom(page, $('.viewMenuBar'));
|
||||||
|
|
||||||
renderHeader(user);
|
updateCastIcon();
|
||||||
updateViewMenuBarHeadroom(page, $('.viewMenuBar'));
|
|
||||||
|
|
||||||
updateCastIcon();
|
updateLibraryNavLinks(page);
|
||||||
|
updateContextText(page);
|
||||||
|
requiresViewMenuRefresh = false;
|
||||||
|
|
||||||
|
ConnectionManager.user(window.ApiClient).done(addUserToHeader);
|
||||||
|
|
||||||
updateLibraryNavLinks(page);
|
|
||||||
updateContextText(page);
|
|
||||||
requiresViewMenuRefresh = false;
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
updateContextText(page);
|
updateContextText(page);
|
||||||
updateLibraryNavLinks(page);
|
updateLibraryNavLinks(page);
|
||||||
|
|
|
@ -633,50 +633,62 @@ var Dashboard = {
|
||||||
|
|
||||||
showUserFlyout: function (context) {
|
showUserFlyout: function (context) {
|
||||||
|
|
||||||
ConnectionManager.user(window.ApiClient).done(function (user) {
|
var html = '<div data-role="panel" data-position="right" data-display="overlay" id="userFlyout" data-position-fixed="true" data-theme="a">';
|
||||||
|
|
||||||
var html = '<div data-role="panel" data-position="right" data-display="overlay" id="userFlyout" data-position-fixed="true" data-theme="a">';
|
html += '<h3 class="userHeader">';
|
||||||
|
|
||||||
html += '<h3>';
|
html += '</h3>';
|
||||||
|
|
||||||
var imgWidth = 48;
|
html += '<form>';
|
||||||
|
|
||||||
if (user.imageUrl && AppInfo.enableUserImage) {
|
html += '<p class="preferencesContainer"></p>';
|
||||||
var url = user.imageUrl;
|
|
||||||
|
|
||||||
if (user.supportsImageParams) {
|
if (Dashboard.isConnectMode()) {
|
||||||
url += "&width=" + (imgWidth * Math.max(window.devicePixelRatio || 1, 2));
|
html += '<p><a data-mini="true" data-role="button" href="selectserver.html" data-icon="cloud">' + Globalize.translate('ButtonSelectServer') + '</button></a>';
|
||||||
}
|
}
|
||||||
|
|
||||||
html += '<div class="lazy" data-src="' + url + '" style="width:' + imgWidth + 'px;height:' + imgWidth + 'px;background-size:contain;background-repeat:no-repeat;background-position:center center;border-radius:1000px;vertical-align:middle;margin-right:.8em;display:inline-block;"></div>';
|
html += '<p><button data-mini="true" type="button" onclick="Dashboard.logout();" data-icon="lock">' + Globalize.translate('ButtonSignOut') + '</button></p>';
|
||||||
}
|
|
||||||
html += user.name;
|
|
||||||
html += '</h3>';
|
|
||||||
|
|
||||||
html += '<form>';
|
html += '</form>';
|
||||||
|
html += '</div>';
|
||||||
|
|
||||||
var isConnectMode = Dashboard.isConnectMode();
|
$(document.body).append(html);
|
||||||
|
|
||||||
if (user.localUser && user.localUser.Policy.EnableUserPreferenceAccess) {
|
var elem = $('#userFlyout').panel({}).lazyChildren().trigger('create').panel("open").on("panelclose", function () {
|
||||||
html += '<p><a data-mini="true" data-role="button" href="mypreferencesdisplay.html?userId=' + user.localUser.Id + '" data-icon="gear">' + Globalize.translate('ButtonMyPreferences') + '</button></a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isConnectMode) {
|
$(this).off("panelclose").remove();
|
||||||
html += '<p><a data-mini="true" data-role="button" href="selectserver.html" data-icon="cloud">' + Globalize.translate('ButtonSelectServer') + '</button></a>';
|
|
||||||
}
|
|
||||||
|
|
||||||
html += '<p><button data-mini="true" type="button" onclick="Dashboard.logout();" data-icon="lock">' + Globalize.translate('ButtonSignOut') + '</button></p>';
|
|
||||||
|
|
||||||
html += '</form>';
|
|
||||||
html += '</div>';
|
|
||||||
|
|
||||||
$(document.body).append(html);
|
|
||||||
|
|
||||||
var elem = $('#userFlyout').panel({}).lazyChildren().trigger('create').panel("open").on("panelclose", function () {
|
|
||||||
|
|
||||||
$(this).off("panelclose").remove();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
ConnectionManager.user(window.ApiClient).done(function (user) {
|
||||||
|
Dashboard.updateUserFlyout(elem, user);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
updateUserFlyout: function (elem, user) {
|
||||||
|
|
||||||
|
var html = '';
|
||||||
|
var imgWidth = 48;
|
||||||
|
|
||||||
|
if (user.imageUrl && AppInfo.enableUserImage) {
|
||||||
|
var url = user.imageUrl;
|
||||||
|
|
||||||
|
if (user.supportsImageParams) {
|
||||||
|
url += "&width=" + (imgWidth * Math.max(window.devicePixelRatio || 1, 2));
|
||||||
|
}
|
||||||
|
|
||||||
|
html += '<div class="lazy" data-src="' + url + '" style="width:' + imgWidth + 'px;height:' + imgWidth + 'px;background-size:contain;background-repeat:no-repeat;background-position:center center;border-radius:1000px;vertical-align:middle;margin-right:.8em;display:inline-block;"></div>';
|
||||||
|
}
|
||||||
|
html += user.name;
|
||||||
|
|
||||||
|
$('.userHeader', elem).html(html).lazyChildren();
|
||||||
|
|
||||||
|
html = '';
|
||||||
|
|
||||||
|
if (user.localUser && user.localUser.Policy.EnableUserPreferenceAccess) {
|
||||||
|
html += '<p><a data-mini="true" data-role="button" href="mypreferencesdisplay.html?userId=' + user.localUser.Id + '" data-icon="gear">' + Globalize.translate('ButtonMyPreferences') + '</button></a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
$('.preferencesContainer', elem).html(html).trigger('create');
|
||||||
},
|
},
|
||||||
|
|
||||||
getPluginSecurityInfo: function () {
|
getPluginSecurityInfo: function () {
|
||||||
|
@ -1568,38 +1580,33 @@ var AppInfo = {};
|
||||||
|
|
||||||
window.ConnectionManager = new MediaBrowser.ConnectionManager(Logger, credentialProvider, appInfo.appName, appInfo.appVersion, appInfo.deviceName, appInfo.deviceId, capabilities);
|
window.ConnectionManager = new MediaBrowser.ConnectionManager(Logger, credentialProvider, appInfo.appName, appInfo.appVersion, appInfo.deviceName, appInfo.deviceId, capabilities);
|
||||||
|
|
||||||
$(ConnectionManager).on('apiclientcreated', function (e, apiClient) {
|
$(ConnectionManager).on('apiclientcreated', function (e, newApiClient) {
|
||||||
|
|
||||||
initializeApiClient(apiClient);
|
initializeApiClient(newApiClient);
|
||||||
});
|
});
|
||||||
|
|
||||||
var lastApiClient = ConnectionManager.getLastUsedApiClient();
|
var apiClient;
|
||||||
|
|
||||||
if (Dashboard.isConnectMode()) {
|
if (Dashboard.isConnectMode()) {
|
||||||
|
|
||||||
|
apiClient = ConnectionManager.getLastUsedApiClient();
|
||||||
|
|
||||||
if (!Dashboard.isServerlessPage()) {
|
if (!Dashboard.isServerlessPage()) {
|
||||||
|
|
||||||
if (lastApiClient && lastApiClient.serverAddress() && lastApiClient.getCurrentUserId() && lastApiClient.accessToken()) {
|
if (apiClient && apiClient.serverAddress() && apiClient.getCurrentUserId() && apiClient.accessToken()) {
|
||||||
|
|
||||||
window.ApiClient = lastApiClient;
|
|
||||||
|
|
||||||
initializeApiClient(lastApiClient);
|
|
||||||
|
|
||||||
//ConnectionManager.addApiClient(lastApiClient, true).fail(Dashboard.logout);
|
|
||||||
|
|
||||||
|
initializeApiClient(apiClient);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (!lastApiClient) {
|
apiClient = new MediaBrowser.ApiClient(Logger, Dashboard.serverAddress(), appInfo.appName, appInfo.appVersion, appInfo.deviceName, appInfo.deviceId);
|
||||||
lastApiClient = new MediaBrowser.ApiClient(Logger, Dashboard.serverAddress(), appInfo.appName, appInfo.appVersion, appInfo.deviceName, appInfo.deviceId);
|
ConnectionManager.addApiClient(apiClient);
|
||||||
ConnectionManager.addApiClient(lastApiClient);
|
|
||||||
}
|
|
||||||
|
|
||||||
window.ApiClient = lastApiClient;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.ApiClient = apiClient;
|
||||||
|
|
||||||
if (window.ApiClient) {
|
if (window.ApiClient) {
|
||||||
ApiClient.getDefaultImageQuality = Dashboard.getDefaultImageQuality;
|
ApiClient.getDefaultImageQuality = Dashboard.getDefaultImageQuality;
|
||||||
ApiClient.normalizeImageOptions = Dashboard.normalizeImageOptions;
|
ApiClient.normalizeImageOptions = Dashboard.normalizeImageOptions;
|
||||||
|
|
|
@ -365,7 +365,7 @@
|
||||||
|
|
||||||
var apiClient = window.ApiClient;
|
var apiClient = window.ApiClient;
|
||||||
|
|
||||||
if (!apiClient) {
|
if (!apiClient || !apiClient.getCurrentUserId()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@
|
||||||
onCategorySyncButtonClick(page, this);
|
onCategorySyncButtonClick(page, this);
|
||||||
});
|
});
|
||||||
|
|
||||||
}).on('pagebeforeshowready', ".libraryPage", function () {
|
}).on('pageshowready', ".libraryPage", function () {
|
||||||
|
|
||||||
var page = this;
|
var page = this;
|
||||||
|
|
||||||
|
|
|
@ -122,6 +122,19 @@
|
||||||
|
|
||||||
apiClients.push(apiClient);
|
apiClients.push(apiClient);
|
||||||
|
|
||||||
|
var existingServer = credentialProvider.credentials().servers.filter(function (s) {
|
||||||
|
|
||||||
|
return stringEqualsIgnoreCase(s.ManualAddress, apiClient.serverAddress());
|
||||||
|
|
||||||
|
})[0];
|
||||||
|
|
||||||
|
if (existingServer) {
|
||||||
|
|
||||||
|
existingServer.DateLastAccessed = new Date().getTime();
|
||||||
|
existingServer.LastConnectionMode = MediaBrowser.ConnectionMode.Manual;
|
||||||
|
apiClient.serverInfo(existingServer);
|
||||||
|
}
|
||||||
|
|
||||||
Events.on(apiClient, 'authenticated', function (e, result) {
|
Events.on(apiClient, 'authenticated', function (e, result) {
|
||||||
onAuthenticated(this, result, {}, true);
|
onAuthenticated(this, result, {}, true);
|
||||||
});
|
});
|
||||||
|
@ -130,7 +143,9 @@
|
||||||
|
|
||||||
return apiClient.getPublicSystemInfo().done(function (systemInfo) {
|
return apiClient.getPublicSystemInfo().done(function (systemInfo) {
|
||||||
|
|
||||||
var server = credentialProvider.credentials().servers.filter(function (s) {
|
var credentials = credentialProvider.credentials();
|
||||||
|
|
||||||
|
var server = credentials.servers.filter(function (s) {
|
||||||
|
|
||||||
return s.Id == systemInfo.Id;
|
return s.Id == systemInfo.Id;
|
||||||
|
|
||||||
|
@ -138,7 +153,14 @@
|
||||||
|
|
||||||
updateServerInfo(server, systemInfo);
|
updateServerInfo(server, systemInfo);
|
||||||
|
|
||||||
|
server.DateLastAccessed = new Date().getTime();
|
||||||
|
server.LastConnectionMode = MediaBrowser.ConnectionMode.Manual;
|
||||||
|
server.ManualAddress = apiClient.serverAddress();
|
||||||
|
|
||||||
apiClient.serverInfo(server);
|
apiClient.serverInfo(server);
|
||||||
|
|
||||||
|
credentialProvider.addOrUpdateServer(credentials.servers, server);
|
||||||
|
credentialProvider.credentials(credentials);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue