mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
commit
09856cc8c1
115 changed files with 324 additions and 366 deletions
|
@ -138,19 +138,19 @@ function supportsCssAnimation(allowPrefix) {
|
|||
const uaMatch = function (ua) {
|
||||
ua = ua.toLowerCase();
|
||||
|
||||
const match = /(edg)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(edga)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(edgios)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(edge)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(opera)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(opr)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(chrome)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(safari)[ \/]([\w.]+)/.exec(ua) ||
|
||||
/(firefox)[ \/]([\w.]+)/.exec(ua) ||
|
||||
const match = /(edg)[ /]([\w.]+)/.exec(ua) ||
|
||||
/(edga)[ /]([\w.]+)/.exec(ua) ||
|
||||
/(edgios)[ /]([\w.]+)/.exec(ua) ||
|
||||
/(edge)[ /]([\w.]+)/.exec(ua) ||
|
||||
/(opera)[ /]([\w.]+)/.exec(ua) ||
|
||||
/(opr)[ /]([\w.]+)/.exec(ua) ||
|
||||
/(chrome)[ /]([\w.]+)/.exec(ua) ||
|
||||
/(safari)[ /]([\w.]+)/.exec(ua) ||
|
||||
/(firefox)[ /]([\w.]+)/.exec(ua) ||
|
||||
ua.indexOf('compatible') < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) ||
|
||||
[];
|
||||
|
||||
const versionMatch = /(version)[ \/]([\w.]+)/.exec(ua);
|
||||
const versionMatch = /(version)[ /]([\w.]+)/.exec(ua);
|
||||
|
||||
let platform_match = /(ipad)/.exec(ua) ||
|
||||
/(iphone)/.exec(ua) ||
|
||||
|
|
|
@ -19,12 +19,6 @@ export async function serverAddress() {
|
|||
return Promise.resolve(apiClient.serverAddress());
|
||||
}
|
||||
|
||||
const current = await ServerConnections.getAvailableServers().then(servers => {
|
||||
if (servers.length !== 0) {
|
||||
return Promise.resolve(servers[0].ManualAddress);
|
||||
}
|
||||
});
|
||||
|
||||
// TODO this makes things faster but it also blocks the wizard in some scenarios
|
||||
// if (current) return Promise.resolve(current);
|
||||
|
||||
|
@ -50,7 +44,7 @@ export async function serverAddress() {
|
|||
url: url,
|
||||
response: resp
|
||||
};
|
||||
}).catch(error => {
|
||||
}).catch(() => {
|
||||
return Promise.resolve();
|
||||
});
|
||||
});
|
||||
|
@ -117,7 +111,7 @@ export function processPluginConfigurationUpdateResult() {
|
|||
toast(globalize.translate('SettingsSaved'));
|
||||
}
|
||||
|
||||
export function processServerConfigurationUpdateResult(result) {
|
||||
export function processServerConfigurationUpdateResult() {
|
||||
loading.hide();
|
||||
toast(globalize.translate('SettingsSaved'));
|
||||
}
|
||||
|
|
|
@ -365,7 +365,7 @@ function isGamepadConnected() {
|
|||
return false;
|
||||
}
|
||||
|
||||
function onFocusOrGamepadAttach(e) {
|
||||
function onFocusOrGamepadAttach() {
|
||||
/* eslint-disable-next-line compat/compat */
|
||||
if (isGamepadConnected() && document.hasFocus()) {
|
||||
console.log('Gamepad connected! Starting input loop');
|
||||
|
@ -373,7 +373,7 @@ function onFocusOrGamepadAttach(e) {
|
|||
}
|
||||
}
|
||||
|
||||
function onFocusOrGamepadDetach(e) {
|
||||
function onFocusOrGamepadDetach() {
|
||||
/* eslint-disable-next-line compat/compat */
|
||||
if (!isGamepadConnected() || !document.hasFocus()) {
|
||||
console.log('Gamepad disconnected! No other gamepads are connected, stopping input loop');
|
||||
|
|
|
@ -155,7 +155,7 @@ import { Events } from 'jellyfin-apiclient';
|
|||
});
|
||||
}
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
return new Promise(function (resolve) {
|
||||
if (!filtered.length) {
|
||||
resolve();
|
||||
return;
|
||||
|
|
|
@ -152,7 +152,7 @@ export function enable() {
|
|||
|
||||
// Gamepad initialisation. No script is required if no gamepads are present at init time, saving a bit of resources.
|
||||
// Whenever the gamepad is connected, we hand all the control of the gamepad to gamepadtokey.js by removing the event handler
|
||||
function attachGamepadScript(e) {
|
||||
function attachGamepadScript() {
|
||||
console.log('Gamepad connected! Attaching gamepadtokey.js script');
|
||||
window.removeEventListener('gamepadconnected', attachGamepadScript);
|
||||
/* eslint-disable-next-line @babel/no-unused-expressions */
|
||||
|
|
|
@ -164,7 +164,7 @@ import Headroom from 'headroom.js';
|
|||
inputManager.handleCommand('search');
|
||||
}
|
||||
|
||||
function onHeaderUserButtonClick(e) {
|
||||
function onHeaderUserButtonClick() {
|
||||
Dashboard.navigate('mypreferencesmenu.html');
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ import Headroom from 'headroom.js';
|
|||
Events.on(playbackManager, 'playbackstop', onPlaybackStop);
|
||||
}
|
||||
|
||||
function onPlaybackStart(e) {
|
||||
function onPlaybackStart() {
|
||||
if (playbackManager.isPlayingAudio() && layoutManager.tv) {
|
||||
headerAudioPlayerButton.classList.remove('hide');
|
||||
} else {
|
||||
|
@ -243,7 +243,7 @@ import Headroom from 'headroom.js';
|
|||
}
|
||||
}
|
||||
|
||||
function onSyncPlaySyncing(event, is_syncing, syncMethod) {
|
||||
function onSyncPlaySyncing(event, is_syncing) {
|
||||
const icon = headerSyncButton.querySelector('span');
|
||||
icon.classList.remove('sync', 'sync_disabled', 'sync_problem');
|
||||
if (is_syncing) {
|
||||
|
@ -281,7 +281,7 @@ import Headroom from 'headroom.js';
|
|||
navDrawerInstance.close();
|
||||
}
|
||||
|
||||
function onMainDrawerSelect(e) {
|
||||
function onMainDrawerSelect() {
|
||||
if (navDrawerInstance.isVisible) {
|
||||
onMainDrawerOpened();
|
||||
} else {
|
||||
|
@ -289,7 +289,7 @@ import Headroom from 'headroom.js';
|
|||
}
|
||||
}
|
||||
|
||||
function refreshLibraryInfoInDrawer(user, drawer) {
|
||||
function refreshLibraryInfoInDrawer(user) {
|
||||
let html = '';
|
||||
html += '<div style="height:.5em;"></div>';
|
||||
html += '<a is="emby-linkbutton" class="navMenuOption lnkMediaFolder" href="#!/home.html"><span class="material-icons navMenuOptionIcon home"></span><span class="navMenuOptionText">' + globalize.translate('Home') + '</span></a>';
|
||||
|
@ -538,7 +538,7 @@ import Headroom from 'headroom.js';
|
|||
}
|
||||
|
||||
function getToolsMenuLinks(apiClient) {
|
||||
return apiClient.getJSON(apiClient.getUrl('web/configurationpages') + '?pageType=PluginConfiguration&EnableInMainMenu=true').then(createToolsMenuList, function (err) {
|
||||
return apiClient.getJSON(apiClient.getUrl('web/configurationpages') + '?pageType=PluginConfiguration&EnableInMainMenu=true').then(createToolsMenuList, function () {
|
||||
return createToolsMenuList([]);
|
||||
});
|
||||
}
|
||||
|
@ -862,7 +862,7 @@ import Headroom from 'headroom.js';
|
|||
navDrawerElement = document.querySelector('.mainDrawer');
|
||||
navDrawerScrollContainer = navDrawerElement.querySelector('.scrollContainer');
|
||||
navDrawerScrollContainer.addEventListener('click', onMainDrawerClick);
|
||||
return new Promise(function (resolve, reject) {
|
||||
return new Promise(function (resolve) {
|
||||
import('../libraries/navdrawer/navdrawer').then(({ NavigationDrawer }) => {
|
||||
navDrawerInstance = new NavigationDrawer(getNavDrawerOptions());
|
||||
|
||||
|
@ -955,7 +955,7 @@ import Headroom from 'headroom.js';
|
|||
}
|
||||
|
||||
let currentPageType;
|
||||
pageClassOn('pagebeforeshow', 'page', function (e) {
|
||||
pageClassOn('pagebeforeshow', 'page', function () {
|
||||
if (!this.classList.contains('withTabs')) {
|
||||
LibraryMenu.setTabs(null);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ import * as userSettings from './settings/userSettings';
|
|||
import '../elements/emby-itemscontainer/emby-itemscontainer';
|
||||
import Dashboard from './clientUtils';
|
||||
|
||||
export default function (view, params) {
|
||||
export default function (view) {
|
||||
function getPageData(context) {
|
||||
const key = getSavedQueryKey(context);
|
||||
let pageData = data[key];
|
||||
|
|
|
@ -55,7 +55,7 @@ window.getWindowLocationSearch = function(win) {
|
|||
|
||||
// TODO: Move this elsewhere
|
||||
window.getParameterByName = function(name, url) {
|
||||
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
|
||||
name = name.replace(/[[]/, '\\[').replace(/[\]]/, '\\]');
|
||||
const regexS = '[\\?&]' + name + '=([^&#]*)';
|
||||
const regex = new RegExp(regexS, 'i');
|
||||
const results = regex.exec(url || getWindowLocationSearch());
|
||||
|
|
|
@ -37,7 +37,7 @@ function getThemeStylesheetInfo(id) {
|
|||
}
|
||||
|
||||
function setTheme(id) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
return new Promise(function (resolve) {
|
||||
if (currentThemeId && currentThemeId === id) {
|
||||
resolve();
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue