mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
remove connect in ui
This commit is contained in:
parent
6b3767c880
commit
d19c8ed72b
60 changed files with 215 additions and 565 deletions
|
@ -32,11 +32,6 @@ function pageIdOn(eventName, id, fn) {
|
|||
})
|
||||
}
|
||||
var Dashboard = {
|
||||
isConnectMode: function() {
|
||||
if (AppInfo.isNativeApp) return !0;
|
||||
var url = window.location.href.toLowerCase();
|
||||
return -1 != url.indexOf("mediabrowser.tv") || -1 != url.indexOf("jellyfin.media")
|
||||
},
|
||||
allowPluginPages: function(pluginId) {
|
||||
var allowedPluginConfigs = ["b0daa30f-2e09-4083-a6ce-459d9fecdd80", "de228f12-e43e-4bd9-9fc0-2830819c3b92", "899c12c7-5b40-4c4e-9afd-afd74a685eb1", "14f5f69e-4c8d-491b-8917-8e90e8317530", "02528C96-F727-44D7-BE87-9EEF040758C3", "dc372f99-4e0e-4c6b-8c18-2b887ca4530c", "830fc68f-b964-4d2f-b139-48e22cd143c", "b9f0c474-e9a8-4292-ae41-eb3c1542f4cd", "7cfbb821-e8fd-40ab-b64e-a7749386a6b2", "4C2FDA1C-FD5E-433A-AD2B-718E0B73E9A9", "cd5a19be-7676-48ef-b64f-a17c98f2b889", "b2ff6a63-303a-4a84-b937-6e12f87e3eb9", "0277E613-3EC0-4360-A3DE-F8AF0AABB5E9", "9464BD84-D30D-4404-B2AD-DFF4E12D5FC5", "9574ac10-bf23-49bc-949f-924f23cfa48f", "66fd72a4-7e8e-4f22-8d1c-022ce4b9b0d5", "4DCB591C-0FA2-4C5D-A7E5-DABE37164C8B", "8e791e2a-058a-4b12-8493-8bf69d92d685", "577f89eb-58a7-4013-be06-9a970ddb1377", "6153FDF0-40CC-4457-8730-3B4A19512BAE", "de228f12-e43e-4bd9-9fc0-2830819c3b92", "6C3B6965-C257-47C2-AA02-64457AE21D91", "2FE79C34-C9DC-4D94-9DF2-2F3F36764414", "0417264b-5a93-4ad0-a1f0-b87569b7cf80", "e711475e-efad-431b-8527-033ba9873a34", "AB95885A-1D0E-445E-BDBF-80C1912C98C5", "F015EA06-B413-47F1-BF15-F049A799658B", "986a7283-205a-4436-862d-23135c067f8a", "8abc6789-fde2-4705-8592-4028806fa343", "2850d40d-9c66-4525-aa46-968e8ef04e97"].map(function(i) {
|
||||
return i.toLowerCase()
|
||||
|
@ -47,7 +42,7 @@ var Dashboard = {
|
|||
return window.ApiClient.getCurrentUser(!1)
|
||||
},
|
||||
serverAddress: function() {
|
||||
if (Dashboard.isConnectMode()) {
|
||||
if (AppInfo.isNativeApp) {
|
||||
var apiClient = window.ApiClient;
|
||||
return apiClient ? apiClient.serverAddress() : null
|
||||
}
|
||||
|
@ -67,15 +62,14 @@ var Dashboard = {
|
|||
},
|
||||
logout: function(logoutWithServer) {
|
||||
function onLogoutDone() {
|
||||
var loginPage;
|
||||
Dashboard.isConnectMode() ? (loginPage = "connectlogin.html", window.ApiClient = null) : loginPage = "login.html", Dashboard.navigate(loginPage)
|
||||
Dashboard.navigate("login.html")
|
||||
}!1 === logoutWithServer ? onLogoutDone() : ConnectionManager.logout().then(onLogoutDone)
|
||||
},
|
||||
getConfigurationPageUrl: function(name) {
|
||||
return Dashboard.isConnectMode() ? "configurationpageext?name=" + encodeURIComponent(name) : "configurationpage?name=" + encodeURIComponent(name)
|
||||
return "configurationpage?name=" + encodeURIComponent(name)
|
||||
},
|
||||
getConfigurationResourceUrl: function(name) {
|
||||
return Dashboard.isConnectMode() ? ApiClient.getUrl("web/ConfigurationPage", {
|
||||
return AppInfo.isNativeApp ? ApiClient.getUrl("web/ConfigurationPage", {
|
||||
name: name
|
||||
}) : Dashboard.getConfigurationPageUrl(name)
|
||||
},
|
||||
|
@ -128,7 +122,7 @@ var Dashboard = {
|
|||
apiClient: apiClient
|
||||
});
|
||||
events.on(dialog, "restarted", function() {
|
||||
Dashboard.isConnectMode() ? apiClient.ensureWebSocket() : window.location.reload(!0)
|
||||
AppInfo.isNativeApp ? apiClient.ensureWebSocket() : window.location.reload(!0)
|
||||
}), dialog.show()
|
||||
})
|
||||
},
|
||||
|
@ -188,7 +182,7 @@ var Dashboard = {
|
|||
capabilities = Dashboard.capabilities(apphost);
|
||||
capabilities.DeviceProfile = deviceProfile;
|
||||
var connectionManager = new ConnectionManager(credentialProviderInstance, apphost.appName(), apphost.appVersion(), apphost.deviceName(), apphost.deviceId(), capabilities, window.devicePixelRatio);
|
||||
if (defineConnectionManager(connectionManager), bindConnectionManagerEvents(connectionManager, events, userSettings), !Dashboard.isConnectMode()) return console.log("loading ApiClient singleton"), getRequirePromise(["apiclient"]).then(function(apiClientFactory) {
|
||||
if (defineConnectionManager(connectionManager), bindConnectionManagerEvents(connectionManager, events, userSettings), !AppInfo.isNativeApp) return console.log("loading ApiClient singleton"), getRequirePromise(["apiclient"]).then(function(apiClientFactory) {
|
||||
console.log("creating ApiClient singleton");
|
||||
var apiClient = new apiClientFactory(Dashboard.serverAddress(), apphost.appName(), apphost.appVersion(), apphost.deviceName(), apphost.deviceId(), window.devicePixelRatio);
|
||||
apiClient.enableAutomaticNetworking = !1, apiClient.manualAddressOnly = !0, connectionManager.addApiClient(apiClient), window.ApiClient = apiClient, localApiClient = apiClient, console.log("loaded ApiClient singleton"), resolve()
|
||||
|
@ -810,15 +804,7 @@ var Dashboard = {
|
|||
supportsThemeMedia: !0,
|
||||
fullscreen: !0,
|
||||
enableMediaControl: !1
|
||||
}), defineRoute(Dashboard.isConnectMode() ? {
|
||||
path: "/configurationpageext",
|
||||
dependencies: [],
|
||||
autoFocus: !1,
|
||||
enableCache: !1,
|
||||
enableContentQueryString: !0,
|
||||
roles: "admin",
|
||||
contentPath: getPluginPageContentPath
|
||||
} : {
|
||||
}), defineRoute({
|
||||
path: "/configurationpage",
|
||||
dependencies: [],
|
||||
autoFocus: !1,
|
||||
|
@ -879,7 +865,7 @@ var Dashboard = {
|
|||
hashbang: !0
|
||||
});
|
||||
var postInitDependencies = [];
|
||||
!enableNativeGamepadKeyMapping() && isGamepadSupported() && postInitDependencies.push("bower_components/emby-webcomponents/input/gamepadtokey"), postInitDependencies.push("bower_components/emby-webcomponents/thememediaplayer"), postInitDependencies.push("scripts/autobackdrops"), "cordova" !== self.appMode && "android" !== self.appMode || (browser.android ? (postInitDependencies.push("cordova/mediasession"), postInitDependencies.push("cordova/chromecast"), postInitDependencies.push("cordova/appshortcuts")) : browser.safari && (postInitDependencies.push("cordova/mediasession"), postInitDependencies.push("cordova/volume"), postInitDependencies.push("cordova/statusbar"), postInitDependencies.push("cordova/backgroundfetch"))), browser.tv || browser.xboxOne || browser.ps4 || postInitDependencies.push("bower_components/emby-webcomponents/nowplayingbar/nowplayingbar"), appHost.supports("remotecontrol") && (postInitDependencies.push("playerSelectionMenu"), postInitDependencies.push("bower_components/emby-webcomponents/playback/remotecontrolautoplay")), appHost.supports("physicalvolumecontrol") && !browser.touch || browser.edge || postInitDependencies.push("bower_components/emby-webcomponents/playback/volumeosd"), navigator.mediaSession && postInitDependencies.push("mediaSession"), postInitDependencies.push("apiInput"), postInitDependencies.push("mouseManager"), browser.tv || browser.xboxOne || (postInitDependencies.push("bower_components/emby-webcomponents/playback/playbackorientation"), registerServiceWorker(), window.Notification && postInitDependencies.push("bower_components/emby-webcomponents/notifications/notifications")), postInitDependencies.push("playerSelectionMenu"), appHost.supports("fullscreenchange") && (browser.edgeUwp || -1 !== navigator.userAgent.toLowerCase().indexOf("electron")) && require(["fullscreen-doubleclick"]), require(postInitDependencies), appHost.supports("sync") && initLocalSyncEvents(), Dashboard.isConnectMode() || window.ApiClient && require(["css!" + ApiClient.getUrl("Branding/Css")])
|
||||
!enableNativeGamepadKeyMapping() && isGamepadSupported() && postInitDependencies.push("bower_components/emby-webcomponents/input/gamepadtokey"), postInitDependencies.push("bower_components/emby-webcomponents/thememediaplayer"), postInitDependencies.push("scripts/autobackdrops"), "cordova" !== self.appMode && "android" !== self.appMode || (browser.android ? (postInitDependencies.push("cordova/mediasession"), postInitDependencies.push("cordova/chromecast"), postInitDependencies.push("cordova/appshortcuts")) : browser.safari && (postInitDependencies.push("cordova/mediasession"), postInitDependencies.push("cordova/volume"), postInitDependencies.push("cordova/statusbar"), postInitDependencies.push("cordova/backgroundfetch"))), browser.tv || browser.xboxOne || browser.ps4 || postInitDependencies.push("bower_components/emby-webcomponents/nowplayingbar/nowplayingbar"), appHost.supports("remotecontrol") && (postInitDependencies.push("playerSelectionMenu"), postInitDependencies.push("bower_components/emby-webcomponents/playback/remotecontrolautoplay")), appHost.supports("physicalvolumecontrol") && !browser.touch || browser.edge || postInitDependencies.push("bower_components/emby-webcomponents/playback/volumeosd"), navigator.mediaSession && postInitDependencies.push("mediaSession"), postInitDependencies.push("apiInput"), postInitDependencies.push("mouseManager"), browser.tv || browser.xboxOne || (postInitDependencies.push("bower_components/emby-webcomponents/playback/playbackorientation"), registerServiceWorker(), window.Notification && postInitDependencies.push("bower_components/emby-webcomponents/notifications/notifications")), postInitDependencies.push("playerSelectionMenu"), appHost.supports("fullscreenchange") && (browser.edgeUwp || -1 !== navigator.userAgent.toLowerCase().indexOf("electron")) && require(["fullscreen-doubleclick"]), require(postInitDependencies), appHost.supports("sync") && initLocalSyncEvents(), AppInfo.isNativeApp || window.ApiClient && require(["css!" + ApiClient.getUrl("Branding/Css")])
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -889,7 +875,8 @@ var Dashboard = {
|
|||
return navigator.serviceWorker.ready
|
||||
}).then(function(reg) {
|
||||
if (reg && reg.sync) return reg.sync.register("emby-sync").then(function() {
|
||||
window.SyncRegistered = Dashboard.isConnectMode()
|
||||
// TODO cvium: the sync serviceworker is a noop?
|
||||
//window.SyncRegistered = Dashboard.isConnectMode()
|
||||
})
|
||||
})
|
||||
} catch (err) {
|
||||
|
@ -1044,11 +1031,9 @@ var Dashboard = {
|
|||
}, appRouter.showVideoOsd = function() {
|
||||
return Dashboard.navigate("videoosd.html")
|
||||
}, appRouter.showSelectServer = function() {
|
||||
Dashboard.isConnectMode() ? Dashboard.navigate("selectserver.html") : Dashboard.navigate("login.html")
|
||||
AppInfo.isNativeApp ? Dashboard.navigate("selectserver.html") : Dashboard.navigate("login.html")
|
||||
}, appRouter.showWelcome = function() {
|
||||
Dashboard.isConnectMode() ? Dashboard.navigate("connectlogin.html?mode=welcome") : Dashboard.navigate("login.html")
|
||||
}, appRouter.showConnectLogin = function() {
|
||||
Dashboard.navigate("connectlogin.html")
|
||||
Dashboard.navigate("login.html")
|
||||
}, appRouter.showSettings = function() {
|
||||
Dashboard.navigate("mypreferencesmenu.html")
|
||||
}, appRouter.showGuide = function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue