mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Make import paths ES6-compatible
This commit is contained in:
parent
1a635e2f81
commit
bfb8c7c1f6
245 changed files with 2073 additions and 1995 deletions
|
@ -1,5 +1,5 @@
|
|||
import dom from 'dom';
|
||||
import focusManager from 'focusManager';
|
||||
import dom from './dom';
|
||||
import focusManager from '../components/focusManager';
|
||||
|
||||
let inputDisplayElement;
|
||||
let currentDisplayText = '';
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import backdrop from 'backdrop';
|
||||
import * as userSettings from 'userSettings';
|
||||
import libraryMenu from 'libraryMenu';
|
||||
import backdrop from '../components/backdrop/backdrop';
|
||||
import * as userSettings from './settings/userSettings';
|
||||
import libraryMenu from './libraryMenu';
|
||||
|
||||
const cache = {};
|
||||
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
import * as userSettings from 'userSettings';
|
||||
import * as webSettings from 'webSettings';
|
||||
import skinManager from 'skinManager';
|
||||
import events from 'events';
|
||||
import * as userSettings from './settings/userSettings';
|
||||
import * as webSettings from './settings/webSettings';
|
||||
import skinManager from './themeManager';
|
||||
import connectionManager from 'jellyfin-apiclient';
|
||||
import events from 'jellyfin-apiclient';
|
||||
|
||||
// set the default theme when loading
|
||||
skinManager.setTheme(userSettings.theme());
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import events from 'events';
|
||||
import playbackManager from 'playbackManager';
|
||||
import { Events } from 'jellyfin-apiclient';
|
||||
import playbackManager from '../components/playback/playbackmanager';
|
||||
|
||||
export function supported() {
|
||||
return typeof(Storage) !== 'undefined';
|
||||
|
@ -43,5 +43,5 @@ function onOpen() {
|
|||
|
||||
const apiClient = window.connectionManager.currentApiClient();
|
||||
if (apiClient && supported()) {
|
||||
events.on(apiClient, 'websocketopen', onOpen);
|
||||
Events.on(apiClient, 'websocketopen', onOpen);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
|
||||
export function getCurrentUser() {
|
||||
return window.ApiClient.getCurrentUser(false);
|
||||
}
|
||||
|
@ -78,7 +77,7 @@ export function navigate(url, preserveQueryString) {
|
|||
}
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
import('appRouter').then(({default: appRouter}) => {
|
||||
import('../components/appRouter').then((appRouter) => {
|
||||
return appRouter.show(url).then(resolve, reject);
|
||||
});
|
||||
});
|
||||
|
@ -86,28 +85,28 @@ export function navigate(url, preserveQueryString) {
|
|||
|
||||
export function processPluginConfigurationUpdateResult() {
|
||||
Promise.all([
|
||||
import('loading'),
|
||||
import('toast')
|
||||
import('../components/loading/loading'),
|
||||
import('../components/toast/toast')
|
||||
])
|
||||
.then(([{default: loading}, {default: toast}]) => {
|
||||
.then(([loading, toast]) => {
|
||||
loading.hide();
|
||||
toast(Globalize.translate('SettingsSaved'));
|
||||
toast(Globalize.translate('MessageSettingsSaved'));
|
||||
});
|
||||
}
|
||||
|
||||
export function processServerConfigurationUpdateResult(result) {
|
||||
Promise.all([
|
||||
import('loading'),
|
||||
import('toast')
|
||||
import('../components/loading/loading'),
|
||||
import('../components/toast/toast')
|
||||
])
|
||||
.then(([{default: loading}, {default: toast}]) => {
|
||||
.then(([loading, toast]) => {
|
||||
loading.hide();
|
||||
toast(Globalize.translate('SettingsSaved'));
|
||||
toast.default(Globalize.translate('MessageSettingsSaved'));
|
||||
});
|
||||
}
|
||||
|
||||
export function processErrorResponse(response) {
|
||||
import('loading').then(({default: loading}) => {
|
||||
import('../components/loading/loading').then((loading) => {
|
||||
loading.hide();
|
||||
});
|
||||
|
||||
|
@ -125,15 +124,15 @@ export function processErrorResponse(response) {
|
|||
|
||||
export function alert(options) {
|
||||
if (typeof options == 'string') {
|
||||
return void import('toast').then(({default: toast}) => {
|
||||
toast({
|
||||
return void import('../components/toast/toast').then((toast) => {
|
||||
toast.default({
|
||||
text: options
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
import('alert').then(({default: alert}) => {
|
||||
alert({
|
||||
import('../components/alert').then((alert) => {
|
||||
alert.default({
|
||||
title: options.title || Globalize.translate('HeaderAlert'),
|
||||
text: options.message
|
||||
}).then(options.callback || function () {});
|
||||
|
@ -147,7 +146,8 @@ export function capabilities(appHost) {
|
|||
SupportsPersistentIdentifier: window.appMode === 'cordova' || window.appMode === 'android',
|
||||
SupportsMediaControl: true
|
||||
};
|
||||
return Object.assign(capabilities, appHost.getPushTokenInfo());
|
||||
appHost.getPushTokenInfo();
|
||||
return capabilities = Object.assign(capabilities, appHost.getPushTokenInfo());
|
||||
}
|
||||
|
||||
export function selectServer() {
|
||||
|
@ -159,19 +159,19 @@ export function selectServer() {
|
|||
}
|
||||
|
||||
export function hideLoadingMsg() {
|
||||
import('loading').then(({default: loading}) => {
|
||||
import('../components/loading/loading').then(({default: loading}) => {
|
||||
loading.hide();
|
||||
});
|
||||
}
|
||||
|
||||
export function showLoadingMsg() {
|
||||
import('loading').then(({default: loading}) => {
|
||||
import('../components/loading/loading').then(({default: loading}) => {
|
||||
loading.show();
|
||||
});
|
||||
}
|
||||
|
||||
export function confirm(message, title, callback) {
|
||||
import('confirm').then(({default: confirm}) => {
|
||||
import('../components/confirm/confirm').then((confirm) => {
|
||||
confirm(message, title).then(function() {
|
||||
callback(!0);
|
||||
}).catch(function() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import globalize from 'globalize';
|
||||
import globalize from './globalize';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
import confirm from 'confirm';
|
||||
import appRouter from 'appRouter';
|
||||
import globalize from 'globalize';
|
||||
|
||||
import connectionManager from 'jellyfin-apiclient';
|
||||
import confirm from '../components/confirm/confirm';
|
||||
import appRouter from '../components/appRouter';
|
||||
import globalize from './globalize';
|
||||
|
||||
function alertText(options) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
import('alert').then(({default: alert}) => {
|
||||
import('../components/alert').then((alert) => {
|
||||
alert(options).then(resolve, resolve);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { ar, be, bg, ca, cs, da, de, el, enGB, enUS, es, faIR, fi, fr, frCA, he, hi, hr, hu, id, it, ja, kk, ko, lt, ms, nb,
|
||||
nl, pl, ptBR, pt, ro, ru, sk, sl, sv, tr, uk, vi, zhCN, zhTW } from 'date-fns/locale';
|
||||
import globalize from 'globalize';
|
||||
import globalize from './globalize';
|
||||
|
||||
const dateLocales = (locale) => ({
|
||||
'ar': ar,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import $ from 'jQuery';
|
||||
import globalize from 'globalize';
|
||||
import 'material-icons';
|
||||
import 'jquery';
|
||||
import globalize from './globalize';
|
||||
import 'material-design-icons-iconfont';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -303,7 +303,7 @@ import 'material-icons';
|
|||
updateEditorNode(this, item);
|
||||
}).on('pagebeforeshow', '.metadataEditorPage', function () {
|
||||
/* eslint-disable-next-line @babel/no-unused-expressions */
|
||||
import('css!assets/css/metadataeditor.css');
|
||||
import('../assets/css/metadataeditor.css');
|
||||
}).on('pagebeforeshow', '.metadataEditorPage', function () {
|
||||
const page = this;
|
||||
Dashboard.getCurrentUser().then(function (user) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import multiDownload from 'multi-download';
|
||||
import shell from 'shell';
|
||||
import multiDownload from './multiDownload';
|
||||
import shell from './shell';
|
||||
|
||||
export function download(items) {
|
||||
if (!shell.downloadFiles(items)) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as userSettings from 'userSettings';
|
||||
import events from 'events';
|
||||
import * as userSettings from './settings/userSettings';
|
||||
import events from 'jellyfin-apiclient';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import playbackManager from 'playbackManager';
|
||||
import focusManager from 'focusManager';
|
||||
import appRouter from 'appRouter';
|
||||
import dom from 'dom';
|
||||
import appHost from 'apphost';
|
||||
import playbackManager from '../components/playback/playbackmanager';
|
||||
import focusManager from '../components/focusManager';
|
||||
import appRouter from '../components/appRouter';
|
||||
import dom from './dom';
|
||||
import appHost from '../components/apphost';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import listView from 'listView';
|
||||
import cardBuilder from 'cardBuilder';
|
||||
import imageLoader from 'imageLoader';
|
||||
import globalize from 'globalize';
|
||||
import 'emby-itemscontainer';
|
||||
import 'emby-button';
|
||||
import connectionManager from 'jellyfin-apiclient';
|
||||
import listView from '../components/listview/listview';
|
||||
import cardBuilder from '../components/cardbuilder/cardBuilder';
|
||||
import imageLoader from '../components/images/imageLoader';
|
||||
import globalize from './globalize';
|
||||
import '../elements/emby-itemscontainer/emby-itemscontainer';
|
||||
import '../elements/emby-button/emby-button';
|
||||
|
||||
function renderItems(page, item) {
|
||||
const sections = [];
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
* @module components/input/keyboardnavigation
|
||||
*/
|
||||
|
||||
import inputManager from 'inputManager';
|
||||
import layoutManager from 'layoutManager';
|
||||
import inputManager from './inputManager';
|
||||
import layoutManager from '../components/layoutManager';
|
||||
|
||||
/**
|
||||
* Key name mapping.
|
||||
|
@ -156,7 +156,7 @@ function attachGamepadScript(e) {
|
|||
console.log('Gamepad connected! Attaching gamepadtokey.js script');
|
||||
window.removeEventListener('gamepadconnected', attachGamepadScript);
|
||||
/* eslint-disable-next-line @babel/no-unused-expressions */
|
||||
import('scripts/gamepadtokey');
|
||||
import('./gamepadtokey');
|
||||
}
|
||||
|
||||
// No need to check for gamepads manually at load time, the eventhandler will be fired for that
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as userSettings from 'userSettings';
|
||||
import globalize from 'globalize';
|
||||
import * as userSettings from './settings/userSettings';
|
||||
import globalize from './globalize';
|
||||
|
||||
export function getSavedQueryKey(modifier) {
|
||||
return window.location.href.split('#')[0] + (modifier || '');
|
||||
|
@ -55,7 +55,7 @@ export function showLayoutMenu (button, currentLayout, views) {
|
|||
};
|
||||
});
|
||||
|
||||
import('actionsheet').then(({default: actionsheet}) => {
|
||||
import('../components/actionSheet/actionSheet').then(({default: actionsheet}) => {
|
||||
actionsheet.show({
|
||||
items: menuItems,
|
||||
positionTo: button,
|
||||
|
@ -120,8 +120,8 @@ export function getQueryPagingHtml (options) {
|
|||
|
||||
export function showSortMenu (options) {
|
||||
Promise.all([
|
||||
import('dialogHelper'),
|
||||
import('emby-radio')
|
||||
import('../components/dialogHelper/dialogHelper'),
|
||||
import('../elements/emby-radio/emby-radio')
|
||||
]).then(([{default: dialogHelper}]) => {
|
||||
function onSortByChange() {
|
||||
const newValue = this.value;
|
||||
|
|
|
@ -1,20 +1,21 @@
|
|||
import dom from 'dom';
|
||||
import layoutManager from 'layoutManager';
|
||||
import inputManager from 'inputManager';
|
||||
import events from 'events';
|
||||
import viewManager from 'viewManager';
|
||||
import appRouter from 'appRouter';
|
||||
import appHost from 'apphost';
|
||||
import playbackManager from 'playbackManager';
|
||||
import syncPlayManager from 'syncPlayManager';
|
||||
import * as groupSelectionMenu from 'groupSelectionMenu';
|
||||
import browser from 'browser';
|
||||
import globalize from 'globalize';
|
||||
import imageHelper from 'scripts/imagehelper';
|
||||
import 'paper-icon-button-light';
|
||||
import 'material-icons';
|
||||
import 'scrollStyles';
|
||||
import 'flexStyles';
|
||||
import dom from './dom';
|
||||
import layoutManager from '../components/layoutManager';
|
||||
import inputManager from './inputManager';
|
||||
import connectionManager from 'jellyfin-apiclient';
|
||||
import events from 'jellyfin-apiclient';
|
||||
import viewManager from '../components/viewManager/viewManager';
|
||||
import appRouter from '../components/appRouter';
|
||||
import appHost from '../components/apphost';
|
||||
import playbackManager from '../components/playback/playbackmanager';
|
||||
import syncPlayManager from '../components/syncPlay/syncPlayManager';
|
||||
import groupSelectionMenu from '../components/syncPlay/groupSelectionMenu';
|
||||
import browser from './browser';
|
||||
import globalize from './globalize';
|
||||
import imageHelper from './imagehelper';
|
||||
import '../elements/emby-button/paper-icon-button-light';
|
||||
import 'material-design-icons-iconfont';
|
||||
import '../assets/css/scrollstyles.css';
|
||||
import '../assets/css/flexstyles.css';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -67,7 +68,7 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function lazyLoadViewMenuBarImages() {
|
||||
import('imageLoader').then(({default: imageLoader}) => {
|
||||
import('../components/images/imageLoader').then((imageLoader) => {
|
||||
imageLoader.lazyChildren(skinHeader);
|
||||
});
|
||||
}
|
||||
|
@ -220,7 +221,7 @@ import 'flexStyles';
|
|||
function onCastButtonClicked() {
|
||||
const btn = this;
|
||||
|
||||
import('playerSelectionMenu').then(({default: playerSelectionMenu}) => {
|
||||
import('../components/playback/playerSelectionMenu').then((playerSelectionMenu) => {
|
||||
playerSelectionMenu.show(btn);
|
||||
});
|
||||
}
|
||||
|
@ -799,7 +800,7 @@ import 'flexStyles';
|
|||
}
|
||||
|
||||
function initHeadRoom(elem) {
|
||||
import('headroom').then(({default: Headroom}) => {
|
||||
import('headroom.js').then((Headroom) => {
|
||||
const headroom = new Headroom(elem);
|
||||
headroom.init();
|
||||
});
|
||||
|
@ -839,7 +840,7 @@ import 'flexStyles';
|
|||
navDrawerScrollContainer = navDrawerElement.querySelector('.scrollContainer');
|
||||
navDrawerScrollContainer.addEventListener('click', onMainDrawerClick);
|
||||
return new Promise(function (resolve, reject) {
|
||||
import('navdrawer').then(({default: navdrawer}) => {
|
||||
import('../libraries/navdrawer/navdrawer').then((navdrawer) => {
|
||||
navDrawerInstance = new navdrawer(getNavDrawerOptions());
|
||||
|
||||
if (!layoutManager.tv) {
|
||||
|
@ -871,7 +872,7 @@ import 'flexStyles';
|
|||
let requiresUserRefresh = true;
|
||||
|
||||
function setTabs (type, selectedIndex, builder) {
|
||||
import('mainTabsManager').then((mainTabsManager) => {
|
||||
import('../components/maintabsmanager').then((mainTabsManager) => {
|
||||
if (type) {
|
||||
mainTabsManager.setTabs(viewManager.currentView(), selectedIndex, builder, function () {
|
||||
return [];
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import layoutManager from 'layoutManager';
|
||||
import datetime from 'datetime';
|
||||
import cardBuilder from 'cardBuilder';
|
||||
import layoutManager from '../components/layoutManager';
|
||||
import datetime from './datetime';
|
||||
import cardBuilder from '../components/cardbuilder/cardBuilder';
|
||||
|
||||
function enableScrollX() {
|
||||
return !layoutManager.desktop;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import inputManager from 'inputManager';
|
||||
import focusManager from 'focusManager';
|
||||
import browser from 'browser';
|
||||
import layoutManager from 'layoutManager';
|
||||
import events from 'events';
|
||||
import dom from 'dom';
|
||||
import inputManager from './inputManager';
|
||||
import focusManager from '../components/focusManager';
|
||||
import browser from '../scripts/browser';
|
||||
import layoutManager from '../components/layoutManager';
|
||||
import events from 'jellyfin-apiclient';
|
||||
import dom from '../scripts/dom';
|
||||
/* eslint-disable indent */
|
||||
|
||||
const self = {};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import browser from 'browser';
|
||||
import browser from '../scripts/browser';
|
||||
|
||||
function fallback(urls) {
|
||||
let i = 0;
|
||||
|
|
|
@ -1,50 +1,48 @@
|
|||
define(['listView'], function (listView) {
|
||||
'use strict';
|
||||
import listView from '../components/listview/listview';
|
||||
|
||||
function getFetchPlaylistItemsFn(itemId) {
|
||||
return function () {
|
||||
const query = {
|
||||
Fields: 'PrimaryImageAspectRatio,UserData',
|
||||
EnableImageTypes: 'Primary,Backdrop,Banner,Thumb',
|
||||
UserId: ApiClient.getCurrentUserId()
|
||||
};
|
||||
return ApiClient.getJSON(ApiClient.getUrl(`Playlists/${itemId}/Items`, query));
|
||||
function getFetchPlaylistItemsFn(itemId) {
|
||||
return function () {
|
||||
const query = {
|
||||
Fields: 'PrimaryImageAspectRatio,UserData',
|
||||
EnableImageTypes: 'Primary,Backdrop,Banner,Thumb',
|
||||
UserId: ApiClient.getCurrentUserId()
|
||||
};
|
||||
}
|
||||
|
||||
function getItemsHtmlFn(itemId) {
|
||||
return function (items) {
|
||||
return listView.getListViewHtml({
|
||||
items: items,
|
||||
showIndex: false,
|
||||
showRemoveFromPlaylist: true,
|
||||
playFromHere: true,
|
||||
action: 'playallfromhere',
|
||||
smallIcon: true,
|
||||
dragHandle: true,
|
||||
playlistId: itemId
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function init(page, item) {
|
||||
const elem = page.querySelector('#childrenContent .itemsContainer');
|
||||
elem.classList.add('vertical-list');
|
||||
elem.classList.remove('vertical-wrap');
|
||||
elem.enableDragReordering(true);
|
||||
elem.fetchData = getFetchPlaylistItemsFn(item.Id);
|
||||
elem.getItemsHtml = getItemsHtmlFn(item.Id);
|
||||
}
|
||||
|
||||
window.PlaylistViewer = {
|
||||
render: function (page, item) {
|
||||
if (!page.playlistInit) {
|
||||
page.playlistInit = true;
|
||||
init(page, item);
|
||||
}
|
||||
|
||||
page.querySelector('#childrenContent').classList.add('verticalSection-extrabottompadding');
|
||||
page.querySelector('#childrenContent .itemsContainer').refreshItems();
|
||||
}
|
||||
return ApiClient.getJSON(ApiClient.getUrl(`Playlists/${itemId}/Items`, query));
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
function getItemsHtmlFn(itemId) {
|
||||
return function (items) {
|
||||
return listView.getListViewHtml({
|
||||
items: items,
|
||||
showIndex: false,
|
||||
showRemoveFromPlaylist: true,
|
||||
playFromHere: true,
|
||||
action: 'playallfromhere',
|
||||
smallIcon: true,
|
||||
dragHandle: true,
|
||||
playlistId: itemId
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
function init(page, item) {
|
||||
const elem = page.querySelector('#childrenContent .itemsContainer');
|
||||
elem.classList.add('vertical-list');
|
||||
elem.classList.remove('vertical-wrap');
|
||||
elem.enableDragReordering(true);
|
||||
elem.fetchData = getFetchPlaylistItemsFn(item.Id);
|
||||
elem.getItemsHtml = getItemsHtmlFn(item.Id);
|
||||
}
|
||||
|
||||
window.PlaylistViewer = {
|
||||
render: function (page, item) {
|
||||
if (!page.playlistInit) {
|
||||
page.playlistInit = true;
|
||||
init(page, item);
|
||||
}
|
||||
|
||||
page.querySelector('#childrenContent').classList.add('verticalSection-extrabottompadding');
|
||||
page.querySelector('#childrenContent .itemsContainer').refreshItems();
|
||||
}
|
||||
};
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import loading from 'loading';
|
||||
import loading from '../../components/loading/loading';
|
||||
import listView from 'listView';
|
||||
import cardBuilder from 'cardBuilder';
|
||||
import libraryMenu from 'libraryMenu';
|
||||
import libraryBrowser from 'libraryBrowser';
|
||||
import imageLoader from 'imageLoader';
|
||||
import userSettings from 'userSettings';
|
||||
import 'emby-itemscontainer';
|
||||
import * as userSettings from '../scripts/settings/userSettings';
|
||||
import '../../elements/emby-itemscontainer/emby-itemscontainer';
|
||||
|
||||
export default function (view, params) {
|
||||
function getPageData(context) {
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
import 'emby-button';
|
||||
import 'emby-input';
|
||||
import 'scripts/livetvcomponents';
|
||||
import 'paper-icon-button-light';
|
||||
import 'emby-itemscontainer';
|
||||
import 'emby-collapse';
|
||||
import 'emby-select';
|
||||
import 'livetvcss';
|
||||
import 'emby-checkbox';
|
||||
import 'emby-slider';
|
||||
import 'listViewStyle';
|
||||
import 'dashboardcss';
|
||||
import 'detailtablecss';
|
||||
import '../elements/emby-button/emby-button';
|
||||
import '../elements/emby-input/emby-input';
|
||||
import '../scripts/livetvcomponents';
|
||||
import '../elements/emby-button/paper-icon-button-light';
|
||||
import '../elements/emby-itemscontainer/emby-itemscontainer';
|
||||
import '../elements/emby-collapse/emby-collapse';
|
||||
import '../elements/emby-select/emby-select';
|
||||
import '../elements/emby-checkbox/emby-checkbox';
|
||||
import '../elements/emby-slider/emby-slider';
|
||||
import '../assets/css/livetv.css';
|
||||
import '../components/listview/listview.css';
|
||||
import '../assets/css/dashboard.css';
|
||||
import '../assets/css/detailtable.css';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import focusManager from 'focusManager';
|
||||
import dom from 'dom';
|
||||
import 'scrollStyles';
|
||||
import focusManager from '../components/focusManager';
|
||||
import dom from './dom';
|
||||
import '../assets/css/scrollstyles.css';
|
||||
|
||||
function getBoundingClientRect(elem) {
|
||||
// Support: BlackBerry 5, iOS 3 (original iPhone)
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
import playbackManager from 'playbackManager';
|
||||
import syncPlayManager from 'syncPlayManager';
|
||||
import events from 'events';
|
||||
import inputManager from 'inputManager';
|
||||
import focusManager from 'focusManager';
|
||||
import appRouter from 'appRouter';
|
||||
import connectionManager from 'jellyfin-apiclient';
|
||||
import playbackManager from '../components/playback/playbackmanager';
|
||||
import syncPlayManager from '../components/syncPlay/syncPlayManager';
|
||||
import events from 'jellyfin-apiclient';
|
||||
import inputManager from '../scripts/inputManager';
|
||||
import focusManager from '../components/focusManager';
|
||||
import appRouter from '../components/appRouter';
|
||||
|
||||
const serverNotifications = {};
|
||||
|
||||
|
@ -14,11 +15,11 @@ function notifyApp() {
|
|||
function displayMessage(cmd) {
|
||||
const args = cmd.Arguments;
|
||||
if (args.TimeoutMs) {
|
||||
import('toast').then(({default: toast}) => {
|
||||
import('../components/toast/toast').then((toast) => {
|
||||
toast({ title: args.Header, text: args.Text });
|
||||
});
|
||||
} else {
|
||||
import('alert').then(({default: alert}) => {
|
||||
import('../components/alert').then(({default: alert}) => {
|
||||
alert({ title: args.Header, text: args.Text });
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
/* eslint-disable indent */
|
||||
|
||||
import appStorage from 'appStorage';
|
||||
import events from 'events';
|
||||
import { appStorage, events } from 'jellyfin-apiclient';
|
||||
|
||||
function getKey(name, userId) {
|
||||
if (userId) {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import appSettings from 'appSettings';
|
||||
import events from 'events';
|
||||
import appSettings from './appSettings';
|
||||
import events from 'jellyfin-apiclient';
|
||||
|
||||
function onSaveTimeout() {
|
||||
const self = this;
|
||||
|
|
|
@ -3,10 +3,11 @@ import 'regenerator-runtime/runtime';
|
|||
import 'jquery';
|
||||
import 'fast-text-encoding';
|
||||
import 'intersection-observer';
|
||||
import 'classlist-polyfill';
|
||||
import 'classlist.js';
|
||||
import 'whatwg-fetch';
|
||||
import 'resize-observer-polyfill';
|
||||
import 'jellyfin-noto';
|
||||
import 'webcomponents.js';
|
||||
import '../assets/css/site.css';
|
||||
|
||||
// TODO: Move this elsewhere
|
||||
|
@ -91,10 +92,10 @@ function initClient() {
|
|||
|
||||
function createConnectionManager() {
|
||||
return Promise.all([
|
||||
import('jellyfin-apiclient/src/connectionManager'),
|
||||
import('jellyfin-apiclient'),
|
||||
import('../components/apphost'),
|
||||
import('jellyfin-apiclient/src/connectionManager'),
|
||||
import('jellyfin-apiclient/src/events'),
|
||||
import('jellyfin-apiclient'),
|
||||
import('jellyfin-apiclient'),
|
||||
import('./settings/userSettings')
|
||||
])
|
||||
.then(([ConnectionManager, appHost, credentialProvider, events, userSettings]) => {
|
||||
|
@ -114,7 +115,7 @@ function initClient() {
|
|||
console.debug('loading ApiClient singleton');
|
||||
|
||||
return Promise.all([
|
||||
import('jellyfin-apiclient/src/apiClient'),
|
||||
import('jellyfin-apiclient'),
|
||||
import('./clientUtils')
|
||||
])
|
||||
.then(([apiClientFactory, clientUtils]) => {
|
||||
|
@ -165,8 +166,8 @@ function initClient() {
|
|||
});
|
||||
Promise.all([
|
||||
import('./globalize'),
|
||||
import('jellyfin-apiclient/src/connectionManager'),
|
||||
import('jellyfin-apiclient/src/events')
|
||||
import('jellyfin-apiclient'),
|
||||
import('jellyfin-apiclient')
|
||||
])
|
||||
.then((globalize, connectionManager, events) => {
|
||||
events.on(connectionManager, 'localusersignedin', globalize.updateCurrentCulture);
|
||||
|
@ -246,7 +247,7 @@ function initClient() {
|
|||
console.groupEnd('loading installed plugins');
|
||||
import('../components/packageManager')
|
||||
.then((packageManager) => {
|
||||
packageManager.default.init().then(resolve, reject);
|
||||
packageManager.init().then(resolve, reject);
|
||||
});
|
||||
})
|
||||
;
|
||||
|
@ -257,9 +258,9 @@ function initClient() {
|
|||
|
||||
function loadPlugin(url) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
import('pluginManager')
|
||||
import('../components/pluginManager')
|
||||
.then((pluginManager) => {
|
||||
pluginManager.default.loadPlugin(url).then(resolve, reject);
|
||||
pluginManager.loadPlugin(url).then(resolve, reject);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -269,7 +270,7 @@ function initClient() {
|
|||
|
||||
// ensure that appHost is loaded in this point
|
||||
Promise.all([
|
||||
import('jellyfin-apiclient/src/apiClient'),
|
||||
import('jellyfin-apiclient'),
|
||||
import('../components/appRouter')
|
||||
])
|
||||
.then(([appHost, appRouter]) => {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
import events from 'events';
|
||||
import serverNotifications from 'serverNotifications';
|
||||
import globalize from 'globalize';
|
||||
import 'emby-button';
|
||||
import { connectionManager, events } from 'jellyfin-apiclient';
|
||||
import serverNotifications from '../scripts/serverNotifications';
|
||||
import globalize from '../scripts/globalize';
|
||||
import '../elements/emby-button/emby-button';
|
||||
|
||||
export default function (options) {
|
||||
function pollTasks() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import * as webSettings from 'webSettings';
|
||||
import * as webSettings from './settings/webSettings';
|
||||
|
||||
let themeStyleElement = document.querySelector('#cssTheme');
|
||||
let currentThemeId;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import dom from 'dom';
|
||||
import events from 'events';
|
||||
import dom from '../scripts/dom';
|
||||
import events from 'jellyfin-apiclient';
|
||||
|
||||
function getTouches(e) {
|
||||
return e.changedTouches || e.targetTouches || e.touches;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue