mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update components
This commit is contained in:
parent
a4431538c7
commit
b65adf700f
2 changed files with 49 additions and 49 deletions
|
@ -1,5 +1,23 @@
|
|||
define(['loading', 'viewManager', 'skinManager', 'pluginManager', 'backdrop', 'browser', 'pageJs'], function (loading, viewManager, skinManager, pluginManager, backdrop, browser, page) {
|
||||
|
||||
var embyRouter = {
|
||||
showLocalLogin: function (apiClient, serverId, manualLogin) {
|
||||
|
||||
var pageName = manualLogin ? 'manuallogin' : 'login';
|
||||
|
||||
show('/startup/' + pageName + '.html?serverid=' + serverId);
|
||||
},
|
||||
showSelectServer: function () {
|
||||
show('/startup/selectserver.html');
|
||||
},
|
||||
showWelcome: function () {
|
||||
show('/startup/welcome.html');
|
||||
},
|
||||
showSettings: function () {
|
||||
show('/settings/settings.html');
|
||||
}
|
||||
};
|
||||
|
||||
var connectionManager;
|
||||
|
||||
function redirectToLogin() {
|
||||
|
@ -28,28 +46,28 @@ define(['loading', 'viewManager', 'skinManager', 'pluginManager', 'backdrop', 'b
|
|||
result.ApiClient.getPublicUsers().then(function (users) {
|
||||
|
||||
if (users.length) {
|
||||
show('/startup/login.html?serverid=' + result.Servers[0].Id);
|
||||
embyRouter.showLocalLogin(result.ApiClient, result.Servers[0].Id);
|
||||
} else {
|
||||
goToLocalLogin(result.ApiClient, result.Servers[0].Id);
|
||||
embyRouter.showLocalLogin(result.ApiClient, result.Servers[0].Id, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
break;
|
||||
case MediaBrowser.ConnectionState.ServerSelection:
|
||||
{
|
||||
show('/startup/selectserver.html');
|
||||
embyRouter.showSelectServer();
|
||||
}
|
||||
break;
|
||||
case MediaBrowser.ConnectionState.ConnectSignIn:
|
||||
{
|
||||
show('/startup/welcome.html');
|
||||
embyRouter.showWelcome();
|
||||
}
|
||||
break;
|
||||
case MediaBrowser.ConnectionState.ServerUpdateNeeded:
|
||||
{
|
||||
require(['alert'], function (alert) {
|
||||
alert(Globalize.translate('core#ServerUpdateNeeded', '<a href="https://emby.media">https://emby.media</a>')).then(function () {
|
||||
show('/startup/selectserver.html');
|
||||
embyRouter.showSelectServer();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -59,11 +77,6 @@ define(['loading', 'viewManager', 'skinManager', 'pluginManager', 'backdrop', 'b
|
|||
}
|
||||
}
|
||||
|
||||
function goToLocalLogin(apiClient, serverId) {
|
||||
|
||||
show('/startup/manuallogin.html?serverid=' + serverId);
|
||||
}
|
||||
|
||||
var cacheParam = new Date().getTime();
|
||||
function loadContentUrl(ctx, next, route, request) {
|
||||
|
||||
|
@ -71,6 +84,7 @@ define(['loading', 'viewManager', 'skinManager', 'pluginManager', 'backdrop', 'b
|
|||
|
||||
if (url.toLowerCase().indexOf('http') != 0 && url.indexOf('file:') != 0) {
|
||||
|
||||
// Put a slash at the beginning but make sure to avoid a double slash
|
||||
if (url.indexOf('/') != 0) {
|
||||
|
||||
url = '/' + url;
|
||||
|
@ -413,14 +427,6 @@ define(['loading', 'viewManager', 'skinManager', 'pluginManager', 'backdrop', 'b
|
|||
skinManager.getCurrentSkin().setTitle(title);
|
||||
}
|
||||
|
||||
function gotoSettings() {
|
||||
show('/settings/settings.html');
|
||||
}
|
||||
|
||||
function selectServer() {
|
||||
show('/startup/selectserver.html');
|
||||
}
|
||||
|
||||
function showVideoOsd() {
|
||||
var skin = skinManager.getCurrentSkin();
|
||||
|
||||
|
@ -478,33 +484,27 @@ define(['loading', 'viewManager', 'skinManager', 'pluginManager', 'backdrop', 'b
|
|||
|
||||
setBaseRoute();
|
||||
|
||||
return {
|
||||
addRoute: addRoute,
|
||||
param: param,
|
||||
back: back,
|
||||
show: show,
|
||||
start: start,
|
||||
baseUrl: baseUrl,
|
||||
canGoBack: canGoBack,
|
||||
current: current,
|
||||
redirectToLogin: redirectToLogin,
|
||||
goHome: goHome,
|
||||
gotoSettings: gotoSettings,
|
||||
showItem: showItem,
|
||||
setTitle: setTitle,
|
||||
selectServer: selectServer,
|
||||
showVideoOsd: showVideoOsd,
|
||||
setTransparency: setTransparency,
|
||||
getRoutes: getRoutes,
|
||||
|
||||
pushState: pushState,
|
||||
|
||||
TransparencyLevel: {
|
||||
None: 0,
|
||||
Backdrop: 1,
|
||||
Full: 2
|
||||
},
|
||||
enableNativeHistory: enableNativeHistory
|
||||
embyRouter.addRoute = addRoute;
|
||||
embyRouter.param = param;
|
||||
embyRouter.back = back;
|
||||
embyRouter.show = show;
|
||||
embyRouter.start = start;
|
||||
embyRouter.baseUrl = baseUrl;
|
||||
embyRouter.canGoBack = canGoBack;
|
||||
embyRouter.current = current;
|
||||
embyRouter.redirectToLogin = redirectToLogin;
|
||||
embyRouter.goHome = goHome;
|
||||
embyRouter.showItem = showItem;
|
||||
embyRouter.setTitle = setTitle;
|
||||
embyRouter.setTransparency = setTransparency;
|
||||
embyRouter.getRoutes = getRoutes;
|
||||
embyRouter.pushState = pushState;
|
||||
embyRouter.enableNativeHistory = enableNativeHistory;
|
||||
embyRouter.TransparencyLevel = {
|
||||
None: 0,
|
||||
Backdrop: 1,
|
||||
Full: 2
|
||||
};
|
||||
|
||||
return embyRouter;
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue