mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
remove most of Dashboard global window usage
This commit is contained in:
parent
4e88835382
commit
923d53bb71
58 changed files with 65 additions and 26 deletions
|
@ -182,9 +182,7 @@ export function confirm(message, title, callback) {
|
|||
});
|
||||
}
|
||||
|
||||
// This is used in plugins and templates, so keep it defined for now.
|
||||
// TODO: Remove once plugins don't need it
|
||||
window.Dashboard = {
|
||||
const Dashboard = {
|
||||
alert,
|
||||
capabilities,
|
||||
confirm,
|
||||
|
@ -203,21 +201,8 @@ window.Dashboard = {
|
|||
showLoadingMsg
|
||||
};
|
||||
|
||||
export default {
|
||||
alert,
|
||||
capabilities,
|
||||
confirm,
|
||||
getPluginUrl,
|
||||
getCurrentUser,
|
||||
getCurrentUserId,
|
||||
hideLoadingMsg,
|
||||
logout,
|
||||
navigate,
|
||||
onServerChanged,
|
||||
processErrorResponse,
|
||||
processPluginConfigurationUpdateResult,
|
||||
processServerConfigurationUpdateResult,
|
||||
selectServer,
|
||||
serverAddress,
|
||||
showLoadingMsg
|
||||
};
|
||||
// This is used in plugins and templates, so keep it defined for now.
|
||||
// TODO: Remove once plugins don't need it
|
||||
window.Dashboard = Dashboard;
|
||||
|
||||
export default Dashboard;
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import 'jquery';
|
||||
import globalize from './globalize';
|
||||
import 'material-design-icons-iconfont';
|
||||
import Dashboard from './clientUtils';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ import '../elements/emby-button/paper-icon-button-light';
|
|||
import 'material-design-icons-iconfont';
|
||||
import '../assets/css/scrollstyles.css';
|
||||
import '../assets/css/flexstyles.css';
|
||||
import Dashboard from './clientUtils';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ import libraryBrowser from 'libraryBrowser';
|
|||
import imageLoader from 'imageLoader';
|
||||
import * as userSettings from '../scripts/settings/userSettings';
|
||||
import '../../elements/emby-itemscontainer/emby-itemscontainer';
|
||||
import Dashboard from './clientUtils';
|
||||
|
||||
export default function (view, params) {
|
||||
function getPageData(context) {
|
||||
|
|
|
@ -9,6 +9,7 @@ import 'resize-observer-polyfill';
|
|||
import 'jellyfin-noto';
|
||||
import '../assets/css/site.css';
|
||||
import AppInfo from '../components/AppInfo';
|
||||
import Dashboard from './clientUtils';
|
||||
|
||||
// TODO: Move this elsewhere
|
||||
window.getWindowLocationSearch = function(win) {
|
||||
|
@ -115,10 +116,9 @@ function initClient() {
|
|||
console.debug('loading ApiClient singleton');
|
||||
|
||||
return Promise.all([
|
||||
import('jellyfin-apiclient'),
|
||||
import('./clientUtils')
|
||||
import('jellyfin-apiclient')
|
||||
])
|
||||
.then(([{ ApiClient }, clientUtils]) => {
|
||||
.then(([{ ApiClient }]) => {
|
||||
console.debug('creating ApiClient singleton');
|
||||
|
||||
var apiClient = new ApiClient(Dashboard.serverAddress(), appHost.appName(), appHost.appVersion(), appHost.deviceName(), appHost.deviceId());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue