mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix suggestions and cleanup
This commit is contained in:
parent
21152040ec
commit
feb49dd429
12 changed files with 18 additions and 39 deletions
|
@ -141,23 +141,6 @@ function supportsFullscreen() {
|
|||
return (element.requestFullscreen || element.mozRequestFullScreen || element.webkitRequestFullscreen || element.msRequestFullscreen) || document.createElement('video').webkitEnterFullscreen;
|
||||
}
|
||||
|
||||
function getSyncProfile() {
|
||||
return new Promise(function (resolve) {
|
||||
require(['browserdeviceprofile', 'appSettings'], function (profileBuilder, appSettings) {
|
||||
let profile;
|
||||
|
||||
if (window.NativeShell) {
|
||||
profile = window.NativeShell.AppHost.getSyncProfile(profileBuilder, appSettings);
|
||||
} else {
|
||||
profile = profileBuilder();
|
||||
profile.MaxStaticMusicBitrate = appSettings.maxStaticMusicBitrate();
|
||||
}
|
||||
|
||||
resolve(profile);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function getDefaultLayout() {
|
||||
return 'desktop';
|
||||
}
|
||||
|
@ -271,7 +254,7 @@ const supportedFeatures = function () {
|
|||
features.push('targetblank');
|
||||
features.push('screensaver');
|
||||
|
||||
webSettings.enableMultiServer().then(enabled => {
|
||||
webSettings.getMultiServer().then(enabled => {
|
||||
if (enabled) features.push('multiserver');
|
||||
});
|
||||
|
||||
|
@ -323,7 +306,7 @@ function askForExit() {
|
|||
return;
|
||||
}
|
||||
|
||||
require(['actionsheet'], function (actionsheet) {
|
||||
import('actionsheet').then(({default: actionsheet}) => {
|
||||
exitPromise = actionsheet.show({
|
||||
title: globalize.translate('MessageConfirmAppExit'),
|
||||
items: [
|
||||
|
@ -367,7 +350,6 @@ const appHost = {
|
|||
return supportedFeatures.indexOf(command.toLowerCase()) !== -1;
|
||||
},
|
||||
preferVisualCards: browser.android || browser.chrome,
|
||||
getSyncProfile: getSyncProfile,
|
||||
getDefaultLayout: function () {
|
||||
if (window.NativeShell) {
|
||||
return window.NativeShell.AppHost.getDefaultLayout();
|
||||
|
|
|
@ -75,13 +75,13 @@ import 'emby-button';
|
|||
context.querySelector('.languageSection').classList.add('hide');
|
||||
}
|
||||
|
||||
if (appHost.default.supports('displaymode')) {
|
||||
if (appHost.supports('displaymode')) {
|
||||
context.querySelector('.fldDisplayMode').classList.remove('hide');
|
||||
} else {
|
||||
context.querySelector('.fldDisplayMode').classList.add('hide');
|
||||
}
|
||||
|
||||
if (appHost.default.supports('externallinks')) {
|
||||
if (appHost.supports('externallinks')) {
|
||||
context.querySelector('.learnHowToContributeContainer').classList.remove('hide');
|
||||
} else {
|
||||
context.querySelector('.learnHowToContributeContainer').classList.add('hide');
|
||||
|
@ -136,7 +136,7 @@ import 'emby-button';
|
|||
function saveUser(context, user, userSettingsInstance, apiClient) {
|
||||
user.Configuration.DisplayMissingEpisodes = context.querySelector('.chkDisplayMissingEpisodes').checked;
|
||||
|
||||
if (appHost.default.supports('displaylanguage')) {
|
||||
if (appHost.supports('displaylanguage')) {
|
||||
userSettingsInstance.language(context.querySelector('#selectLanguage').value);
|
||||
}
|
||||
|
||||
|
|
|
@ -208,7 +208,7 @@ import 'cardStyle';
|
|||
html += '<div class="cardPadder-' + shape + '"></div>';
|
||||
html += '<div class="cardContent">';
|
||||
|
||||
if (layoutManager.tv || !appHost.default.supports('externallinks')) {
|
||||
if (layoutManager.tv || !appHost.supports('externallinks')) {
|
||||
html += '<div class="cardImageContainer lazy" data-src="' + getDisplayUrl(image.Url, apiClient) + '" style="background-position:center center;background-size:contain;"></div>';
|
||||
} else {
|
||||
html += '<a is="emby-linkbutton" target="_blank" href="' + getDisplayUrl(image.Url, apiClient) + '" class="button-link cardImageContainer lazy" data-src="' + getDisplayUrl(image.Url, apiClient) + '" style="background-position:center center;background-size:contain"></a>';
|
||||
|
|
|
@ -158,7 +158,7 @@ import actionsheet from 'actionsheet';
|
|||
}
|
||||
|
||||
// Books are promoted to major download Button and therefor excluded in the context menu
|
||||
if ((item.CanDownload && appHost.default.supports('filedownload')) && item.Type !== 'Book') {
|
||||
if ((item.CanDownload && appHost.supports('filedownload')) && item.Type !== 'Book') {
|
||||
commands.push({
|
||||
name: globalize.translate('Download'),
|
||||
id: 'download',
|
||||
|
|
|
@ -415,7 +415,7 @@ import 'emby-ratingbutton';
|
|||
showVolumeSlider = false;
|
||||
}
|
||||
|
||||
if (currentPlayer.isLocalPlayer && appHost.default.supports('physicalvolumecontrol')) {
|
||||
if (currentPlayer.isLocalPlayer && appHost.supports('physicalvolumecontrol')) {
|
||||
showMuteButton = false;
|
||||
showVolumeSlider = false;
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ export function show(button) {
|
|||
|
||||
// Unfortunately we can't allow the url to change or chromecast will throw a security error
|
||||
// Might be able to solve this in the future by moving the dialogs to hashbangs
|
||||
if (!(!browser.chrome && !browser.edgeChromium || appHost.default.supports('castmenuhashchange'))) {
|
||||
if (!(!browser.chrome && !browser.edgeChromium || appHost.supports('castmenuhashchange'))) {
|
||||
menuOptions.enableHistory = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ import 'emby-checkbox';
|
|||
context.querySelector('.videoQualitySection').classList.add('hide');
|
||||
}
|
||||
|
||||
if (appHost.default.supports('multiserver')) {
|
||||
if (appHost.supports('multiserver')) {
|
||||
context.querySelector('.fldVideoInNetworkQuality').classList.remove('hide');
|
||||
context.querySelector('.fldVideoInternetQuality').classList.remove('hide');
|
||||
|
||||
|
@ -162,7 +162,7 @@ import 'emby-checkbox';
|
|||
}
|
||||
});
|
||||
|
||||
if (appHost.default.supports('externalplayerintent') && userId === loggedInUserId) {
|
||||
if (appHost.supports('externalplayerintent') && userId === loggedInUserId) {
|
||||
context.querySelector('.fldExternalPlayer').classList.remove('hide');
|
||||
} else {
|
||||
context.querySelector('.fldExternalPlayer').classList.add('hide');
|
||||
|
@ -171,7 +171,7 @@ import 'emby-checkbox';
|
|||
if (userId === loggedInUserId && (user.Policy.EnableVideoPlaybackTranscoding || user.Policy.EnableAudioPlaybackTranscoding)) {
|
||||
context.querySelector('.qualitySections').classList.remove('hide');
|
||||
|
||||
if (appHost.default.supports('chromecast') && user.Policy.EnableVideoPlaybackTranscoding) {
|
||||
if (appHost.supports('chromecast') && user.Policy.EnableVideoPlaybackTranscoding) {
|
||||
context.querySelector('.fldChromecastQuality').classList.remove('hide');
|
||||
} else {
|
||||
context.querySelector('.fldChromecastQuality').classList.add('hide');
|
||||
|
|
|
@ -136,7 +136,7 @@ function embed(options, self) {
|
|||
options.element.querySelector('.btnSave').classList.remove('hide');
|
||||
}
|
||||
|
||||
if (appHost.default.supports('subtitleappearancesettings')) {
|
||||
if (appHost.supports('subtitleappearancesettings')) {
|
||||
options.element.querySelector('.subtitleAppearanceSection').classList.remove('hide');
|
||||
}
|
||||
|
||||
|
|
|
@ -896,7 +896,7 @@ import 'css!assets/css/videoosd';
|
|||
showVolumeSlider = false;
|
||||
}
|
||||
|
||||
if (player.isLocalPlayer && appHost.default.supports('physicalvolumecontrol')) {
|
||||
if (player.isLocalPlayer && appHost.supports('physicalvolumecontrol')) {
|
||||
showMuteButton = false;
|
||||
showVolumeSlider = false;
|
||||
}
|
||||
|
|
|
@ -199,7 +199,7 @@ import 'emby-checkbox';
|
|||
loading.show();
|
||||
libraryMenu.setTransparentMenu(true);
|
||||
|
||||
if (!appHost.default.supports('multiserver')) {
|
||||
if (!appHost.supports('multiserver')) {
|
||||
view.querySelector('.btnSelectServer').classList.add('hide');
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ import appHost from 'apphost';
|
|||
'back': () => {
|
||||
if (appRouter.canGoBack()) {
|
||||
appRouter.back();
|
||||
} else if (appHost.default.supports('exit')) {
|
||||
} else if (appHost.supports('exit')) {
|
||||
appHost.exit();
|
||||
}
|
||||
},
|
||||
|
|
|
@ -273,14 +273,11 @@ function initClient() {
|
|||
function createConnectionManager() {
|
||||
return require(['connectionManagerFactory', 'apphost', 'credentialprovider', 'events', 'userSettings'], function (ConnectionManager, appHost, credentialProvider, events, userSettings) {
|
||||
var credentialProviderInstance = new credentialProvider();
|
||||
var promises = [appHost.default.getSyncProfile(), appHost.default.init()];
|
||||
var promises = [appHost.default.init()];
|
||||
|
||||
return Promise.all(promises).then(function (responses) {
|
||||
var deviceProfile = responses[0];
|
||||
var capabilities = Dashboard.capabilities(appHost);
|
||||
|
||||
capabilities.DeviceProfile = deviceProfile;
|
||||
|
||||
var connectionManager = new ConnectionManager(credentialProviderInstance, appHost.default.appName(), appHost.default.appVersion(), appHost.default.deviceName(), appHost.default.deviceId(), capabilities);
|
||||
|
||||
defineConnectionManager(connectionManager);
|
||||
|
@ -481,7 +478,7 @@ function initClient() {
|
|||
require(['webSettings'], function (webSettings) {
|
||||
webSettings.getPlugins().then(function (list) {
|
||||
// these two plugins are dependent on features
|
||||
if (!appHost.supports('remotecontrol')) {
|
||||
if (!appHost.default.supports('remotecontrol')) {
|
||||
list.splice(list.indexOf('sessionPlayer'), 1);
|
||||
|
||||
if (!browser.chrome && !browser.opera) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue