mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
commit
e33a589a27
14 changed files with 326 additions and 303 deletions
|
@ -100,6 +100,7 @@ module.exports = {
|
||||||
'jQuery': 'readonly',
|
'jQuery': 'readonly',
|
||||||
// Jellyfin globals
|
// Jellyfin globals
|
||||||
'ApiClient': 'writable',
|
'ApiClient': 'writable',
|
||||||
|
'Events': 'writable',
|
||||||
'chrome': 'writable',
|
'chrome': 'writable',
|
||||||
'DlnaProfilePage': 'writable',
|
'DlnaProfilePage': 'writable',
|
||||||
'DashboardPage': 'writable',
|
'DashboardPage': 'writable',
|
||||||
|
@ -115,6 +116,8 @@ module.exports = {
|
||||||
'Loading': 'writable',
|
'Loading': 'writable',
|
||||||
'MetadataEditor': 'writable',
|
'MetadataEditor': 'writable',
|
||||||
'PlaylistViewer': 'writable',
|
'PlaylistViewer': 'writable',
|
||||||
|
'ServerNotifications': 'writable',
|
||||||
|
'TaskButton': 'writable',
|
||||||
'UserParentalControlPage': 'writable',
|
'UserParentalControlPage': 'writable',
|
||||||
'Windows': 'readonly'
|
'Windows': 'readonly'
|
||||||
},
|
},
|
||||||
|
|
|
@ -10,8 +10,6 @@ import '../formdialog.scss';
|
||||||
import '../../elements/emby-button/emby-button';
|
import '../../elements/emby-button/emby-button';
|
||||||
import alert from '../alert';
|
import alert from '../alert';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
|
||||||
|
|
||||||
function getSystemInfo() {
|
function getSystemInfo() {
|
||||||
return systemInfo ? Promise.resolve(systemInfo) : ApiClient.getPublicSystemInfo().then(
|
return systemInfo ? Promise.resolve(systemInfo) : ApiClient.getPublicSystemInfo().then(
|
||||||
info => {
|
info => {
|
||||||
|
@ -243,10 +241,11 @@ import alert from '../alert';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class directoryBrowser {
|
let systemInfo;
|
||||||
constructor() {
|
class DirectoryBrowser {
|
||||||
let currentDialog;
|
currentDialog;
|
||||||
this.show = options => {
|
|
||||||
|
show = options => {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
const fileOptions = {
|
const fileOptions = {
|
||||||
includeDirectories: true
|
includeDirectories: true
|
||||||
|
@ -286,7 +285,7 @@ import alert from '../alert';
|
||||||
dlg.querySelector('.btnCloseDialog').addEventListener('click', () => {
|
dlg.querySelector('.btnCloseDialog').addEventListener('click', () => {
|
||||||
dialogHelper.close(dlg);
|
dialogHelper.close(dlg);
|
||||||
});
|
});
|
||||||
currentDialog = dlg;
|
this.currentDialog = dlg;
|
||||||
dlg.querySelector('#txtDirectoryPickerPath').value = initialPath;
|
dlg.querySelector('#txtDirectoryPickerPath').value = initialPath;
|
||||||
const txtNetworkPath = dlg.querySelector('#txtNetworkPath');
|
const txtNetworkPath = dlg.querySelector('#txtNetworkPath');
|
||||||
if (txtNetworkPath) {
|
if (txtNetworkPath) {
|
||||||
|
@ -298,15 +297,12 @@ import alert from '../alert';
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
this.close = () => {
|
|
||||||
if (currentDialog) {
|
close = () => {
|
||||||
dialogHelper.close(currentDialog);
|
if (this.currentDialog) {
|
||||||
|
dialogHelper.close(this.currentDialog);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
let systemInfo;
|
export default DirectoryBrowser;
|
||||||
|
|
||||||
/* eslint-enable indent */
|
|
||||||
export default directoryBrowser;
|
|
||||||
|
|
|
@ -102,8 +102,8 @@ import template from './mediaLibraryCreator.template.html';
|
||||||
function onAddButtonClick() {
|
function onAddButtonClick() {
|
||||||
const page = dom.parentWithClass(this, 'dlg-librarycreator');
|
const page = dom.parentWithClass(this, 'dlg-librarycreator');
|
||||||
|
|
||||||
import('../directorybrowser/directorybrowser').then(({default: directoryBrowser}) => {
|
import('../directorybrowser/directorybrowser').then(({default: DirectoryBrowser}) => {
|
||||||
const picker = new directoryBrowser();
|
const picker = new DirectoryBrowser();
|
||||||
picker.show({
|
picker.show({
|
||||||
enableNetworkSharePath: true,
|
enableNetworkSharePath: true,
|
||||||
callback: function (path, networkSharePath) {
|
callback: function (path, networkSharePath) {
|
||||||
|
|
|
@ -162,8 +162,8 @@ import template from './mediaLibraryEditor.template.html';
|
||||||
}
|
}
|
||||||
|
|
||||||
function showDirectoryBrowser(context, originalPath, networkPath) {
|
function showDirectoryBrowser(context, originalPath, networkPath) {
|
||||||
import('../directorybrowser/directorybrowser').then(({default: directoryBrowser}) => {
|
import('../directorybrowser/directorybrowser').then(({default: DirectoryBrowser}) => {
|
||||||
const picker = new directoryBrowser();
|
const picker = new DirectoryBrowser();
|
||||||
picker.show({
|
picker.show({
|
||||||
enableNetworkSharePath: true,
|
enableNetworkSharePath: true,
|
||||||
pathReadOnly: originalPath != null,
|
pathReadOnly: originalPath != null,
|
||||||
|
|
|
@ -145,8 +145,8 @@ export default function (page, providerId, options) {
|
||||||
function onSelectPathClick(e) {
|
function onSelectPathClick(e) {
|
||||||
const page = $(e.target).parents('.xmltvForm')[0];
|
const page = $(e.target).parents('.xmltvForm')[0];
|
||||||
|
|
||||||
import('../directorybrowser/directorybrowser').then(({default: directoryBrowser}) => {
|
import('../directorybrowser/directorybrowser').then(({default: DirectoryBrowser}) => {
|
||||||
const picker = new directoryBrowser();
|
const picker = new DirectoryBrowser();
|
||||||
picker.show({
|
picker.show({
|
||||||
includeFiles: true,
|
includeFiles: true,
|
||||||
callback: function (path) {
|
callback: function (path) {
|
||||||
|
|
|
@ -217,8 +217,8 @@ import alert from '../../components/alert';
|
||||||
setDecodingCodecsVisible(page, this.value);
|
setDecodingCodecsVisible(page, this.value);
|
||||||
});
|
});
|
||||||
$('#btnSelectEncoderPath', page).on('click.selectDirectory', function () {
|
$('#btnSelectEncoderPath', page).on('click.selectDirectory', function () {
|
||||||
import('../../components/directorybrowser/directorybrowser').then(({default: directoryBrowser}) => {
|
import('../../components/directorybrowser/directorybrowser').then(({default: DirectoryBrowser}) => {
|
||||||
const picker = new directoryBrowser();
|
const picker = new DirectoryBrowser();
|
||||||
picker.show({
|
picker.show({
|
||||||
includeFiles: true,
|
includeFiles: true,
|
||||||
callback: function (path) {
|
callback: function (path) {
|
||||||
|
@ -232,8 +232,8 @@ import alert from '../../components/alert';
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('#btnSelectTranscodingTempPath', page).on('click.selectDirectory', function () {
|
$('#btnSelectTranscodingTempPath', page).on('click.selectDirectory', function () {
|
||||||
import('../../components/directorybrowser/directorybrowser').then(({default: directoryBrowser}) => {
|
import('../../components/directorybrowser/directorybrowser').then(({default: DirectoryBrowser}) => {
|
||||||
const picker = new directoryBrowser();
|
const picker = new DirectoryBrowser();
|
||||||
picker.show({
|
picker.show({
|
||||||
callback: function (path) {
|
callback: function (path) {
|
||||||
if (path) {
|
if (path) {
|
||||||
|
@ -249,8 +249,8 @@ import alert from '../../components/alert';
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('#btnSelectFallbackFontPath', page).on('click.selectDirectory', function () {
|
$('#btnSelectFallbackFontPath', page).on('click.selectDirectory', function () {
|
||||||
import('../../components/directorybrowser/directorybrowser').then(({default: directoryBrowser}) => {
|
import('../../components/directorybrowser/directorybrowser').then(({default: DirectoryBrowser}) => {
|
||||||
const picker = new directoryBrowser();
|
const picker = new DirectoryBrowser();
|
||||||
picker.show({
|
picker.show({
|
||||||
includeDirectories: true,
|
includeDirectories: true,
|
||||||
callback: function (path) {
|
callback: function (path) {
|
||||||
|
|
|
@ -55,8 +55,8 @@ import alert from '../../components/alert';
|
||||||
const brandingConfigKey = 'branding';
|
const brandingConfigKey = 'branding';
|
||||||
export default function (view) {
|
export default function (view) {
|
||||||
$('#btnSelectCachePath', view).on('click.selectDirectory', function () {
|
$('#btnSelectCachePath', view).on('click.selectDirectory', function () {
|
||||||
import('../../components/directorybrowser/directorybrowser').then(({default: directoryBrowser}) => {
|
import('../../components/directorybrowser/directorybrowser').then(({default: DirectoryBrowser}) => {
|
||||||
const picker = new directoryBrowser();
|
const picker = new DirectoryBrowser();
|
||||||
picker.show({
|
picker.show({
|
||||||
callback: function (path) {
|
callback: function (path) {
|
||||||
if (path) {
|
if (path) {
|
||||||
|
@ -72,8 +72,8 @@ import alert from '../../components/alert';
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('#btnSelectMetadataPath', view).on('click.selectDirectory', function () {
|
$('#btnSelectMetadataPath', view).on('click.selectDirectory', function () {
|
||||||
import('../../components/directorybrowser/directorybrowser').then(({default: directoryBrowser}) => {
|
import('../../components/directorybrowser/directorybrowser').then(({default: DirectoryBrowser}) => {
|
||||||
const picker = new directoryBrowser();
|
const picker = new DirectoryBrowser();
|
||||||
picker.show({
|
picker.show({
|
||||||
path: $('#txtMetadataPath', view).val(),
|
path: $('#txtMetadataPath', view).val(),
|
||||||
networkSharePath: $('#txtMetadataNetworkPath', view).val(),
|
networkSharePath: $('#txtMetadataNetworkPath', view).val(),
|
||||||
|
|
|
@ -181,8 +181,8 @@ import alert from '../../components/alert';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
view.querySelector('#btnSelectCertPath').addEventListener('click', function () {
|
view.querySelector('#btnSelectCertPath').addEventListener('click', function () {
|
||||||
import('../../components/directorybrowser/directorybrowser').then(({default: directoryBrowser}) => {
|
import('../../components/directorybrowser/directorybrowser').then(({default: DirectoryBrowser}) => {
|
||||||
const picker = new directoryBrowser();
|
const picker = new DirectoryBrowser();
|
||||||
picker.show({
|
picker.show({
|
||||||
includeFiles: true,
|
includeFiles: true,
|
||||||
includeDirectories: true,
|
includeDirectories: true,
|
||||||
|
|
|
@ -60,8 +60,8 @@ $(document).on('pageinit', '#liveTvSettingsPage', function () {
|
||||||
const page = this;
|
const page = this;
|
||||||
$('.liveTvSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
|
$('.liveTvSettingsForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||||
$('#btnSelectRecordingPath', page).on('click.selectDirectory', function () {
|
$('#btnSelectRecordingPath', page).on('click.selectDirectory', function () {
|
||||||
import('../components/directorybrowser/directorybrowser').then(({default: directoryBrowser}) => {
|
import('../components/directorybrowser/directorybrowser').then(({default: DirectoryBrowser}) => {
|
||||||
const picker = new directoryBrowser();
|
const picker = new DirectoryBrowser();
|
||||||
picker.show({
|
picker.show({
|
||||||
callback: function (path) {
|
callback: function (path) {
|
||||||
if (path) {
|
if (path) {
|
||||||
|
@ -75,8 +75,8 @@ $(document).on('pageinit', '#liveTvSettingsPage', function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('#btnSelectMovieRecordingPath', page).on('click.selectDirectory', function () {
|
$('#btnSelectMovieRecordingPath', page).on('click.selectDirectory', function () {
|
||||||
import('../components/directorybrowser/directorybrowser').then(({default: directoryBrowser}) => {
|
import('../components/directorybrowser/directorybrowser').then(({default: DirectoryBrowser}) => {
|
||||||
const picker = new directoryBrowser();
|
const picker = new DirectoryBrowser();
|
||||||
picker.show({
|
picker.show({
|
||||||
callback: function (path) {
|
callback: function (path) {
|
||||||
if (path) {
|
if (path) {
|
||||||
|
@ -90,8 +90,8 @@ $(document).on('pageinit', '#liveTvSettingsPage', function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('#btnSelectSeriesRecordingPath', page).on('click.selectDirectory', function () {
|
$('#btnSelectSeriesRecordingPath', page).on('click.selectDirectory', function () {
|
||||||
import('../components/directorybrowser/directorybrowser').then(({default: directoryBrowser}) => {
|
import('../components/directorybrowser/directorybrowser').then(({default: DirectoryBrowser}) => {
|
||||||
const picker = new directoryBrowser();
|
const picker = new DirectoryBrowser();
|
||||||
picker.show({
|
picker.show({
|
||||||
callback: function (path) {
|
callback: function (path) {
|
||||||
if (path) {
|
if (path) {
|
||||||
|
@ -105,8 +105,8 @@ $(document).on('pageinit', '#liveTvSettingsPage', function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('#btnSelectPostProcessorPath', page).on('click.selectDirectory', function () {
|
$('#btnSelectPostProcessorPath', page).on('click.selectDirectory', function () {
|
||||||
import('../components/directorybrowser/directorybrowser').then(({default: directoryBrowser}) => {
|
import('../components/directorybrowser/directorybrowser').then(({default: DirectoryBrowser}) => {
|
||||||
const picker = new directoryBrowser();
|
const picker = new DirectoryBrowser();
|
||||||
picker.show({
|
picker.show({
|
||||||
includeFiles: true,
|
includeFiles: true,
|
||||||
callback: function (path) {
|
callback: function (path) {
|
||||||
|
|
|
@ -212,8 +212,8 @@ export default function (view, params) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
view.querySelector('.btnSelectPath').addEventListener('click', function () {
|
view.querySelector('.btnSelectPath').addEventListener('click', function () {
|
||||||
import('../components/directorybrowser/directorybrowser').then(({default: directorybrowser}) => {
|
import('../components/directorybrowser/directorybrowser').then(({default: DirectoryBrowser}) => {
|
||||||
const picker = new directorybrowser();
|
const picker = new DirectoryBrowser();
|
||||||
picker.show({
|
picker.show({
|
||||||
includeFiles: true,
|
includeFiles: true,
|
||||||
callback: function (path) {
|
callback: function (path) {
|
||||||
|
|
|
@ -6,6 +6,10 @@ import baseAlert from '../components/alert';
|
||||||
import baseConfirm from '../components/confirm/confirm';
|
import baseConfirm from '../components/confirm/confirm';
|
||||||
import globalize from '../scripts/globalize';
|
import globalize from '../scripts/globalize';
|
||||||
import * as webSettings from './settings/webSettings';
|
import * as webSettings from './settings/webSettings';
|
||||||
|
import datetime from '../scripts/datetime';
|
||||||
|
import DirectoryBrowser from '../components/directorybrowser/directorybrowser';
|
||||||
|
import dialogHelper from '../components/dialogHelper/dialogHelper';
|
||||||
|
import itemIdentifier from '../components/itemidentifier/itemidentifier';
|
||||||
|
|
||||||
export function getCurrentUser() {
|
export function getCurrentUser() {
|
||||||
return window.ApiClient.getCurrentUser(false);
|
return window.ApiClient.getCurrentUser(false);
|
||||||
|
@ -94,6 +98,12 @@ export function getPluginUrl(name) {
|
||||||
return 'configurationpage?name=' + encodeURIComponent(name);
|
return 'configurationpage?name=' + encodeURIComponent(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getConfigurationResourceUrl(name) {
|
||||||
|
return ApiClient.getUrl('web/ConfigurationPage', {
|
||||||
|
name: name
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
export function navigate(url, preserveQueryString) {
|
export function navigate(url, preserveQueryString) {
|
||||||
if (!url) {
|
if (!url) {
|
||||||
throw new Error('url cannot be null or empty');
|
throw new Error('url cannot be null or empty');
|
||||||
|
@ -204,6 +214,7 @@ const Dashboard = {
|
||||||
capabilities,
|
capabilities,
|
||||||
confirm,
|
confirm,
|
||||||
getPluginUrl,
|
getPluginUrl,
|
||||||
|
getConfigurationResourceUrl,
|
||||||
getCurrentUser,
|
getCurrentUser,
|
||||||
getCurrentUserId,
|
getCurrentUserId,
|
||||||
hideLoadingMsg,
|
hideLoadingMsg,
|
||||||
|
@ -215,7 +226,11 @@ const Dashboard = {
|
||||||
processServerConfigurationUpdateResult,
|
processServerConfigurationUpdateResult,
|
||||||
selectServer,
|
selectServer,
|
||||||
serverAddress,
|
serverAddress,
|
||||||
showLoadingMsg
|
showLoadingMsg,
|
||||||
|
datetime,
|
||||||
|
DirectoryBrowser,
|
||||||
|
dialogHelper,
|
||||||
|
itemIdentifier
|
||||||
};
|
};
|
||||||
|
|
||||||
// This is used in plugins and templates, so keep it defined for now.
|
// This is used in plugins and templates, so keep it defined for now.
|
||||||
|
|
|
@ -211,4 +211,6 @@ Events.on(ServerConnections, 'apiclientcreated', function (e, newApiClient) {
|
||||||
bindEvents(newApiClient);
|
bindEvents(newApiClient);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
window.ServerNotifications = serverNotifications;
|
||||||
|
|
||||||
export default serverNotifications;
|
export default serverNotifications;
|
||||||
|
|
|
@ -37,6 +37,7 @@ import SyncPlayNoActivePlayer from '../components/syncPlay/ui/players/NoActivePl
|
||||||
import SyncPlayHtmlVideoPlayer from '../components/syncPlay/ui/players/HtmlVideoPlayer';
|
import SyncPlayHtmlVideoPlayer from '../components/syncPlay/ui/players/HtmlVideoPlayer';
|
||||||
import SyncPlayHtmlAudioPlayer from '../components/syncPlay/ui/players/HtmlAudioPlayer';
|
import SyncPlayHtmlAudioPlayer from '../components/syncPlay/ui/players/HtmlAudioPlayer';
|
||||||
import { currentSettings } from './settings/userSettings';
|
import { currentSettings } from './settings/userSettings';
|
||||||
|
import taskButton from '../scripts/taskbutton';
|
||||||
|
|
||||||
// TODO: Move this elsewhere
|
// TODO: Move this elsewhere
|
||||||
window.getWindowLocationSearch = function(win) {
|
window.getWindowLocationSearch = function(win) {
|
||||||
|
@ -83,6 +84,10 @@ function loadCoreDictionary() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
// This is used in plugins
|
||||||
|
window.Events = Events;
|
||||||
|
window.TaskButton = taskButton;
|
||||||
|
|
||||||
serverAddress().then(server => {
|
serverAddress().then(server => {
|
||||||
if (server) {
|
if (server) {
|
||||||
ServerConnections.initApiClient(server);
|
ServerConnections.initApiClient(server);
|
||||||
|
|
|
@ -5,7 +5,7 @@ import globalize from '../scripts/globalize';
|
||||||
import '../elements/emby-button/emby-button';
|
import '../elements/emby-button/emby-button';
|
||||||
import ServerConnections from '../components/ServerConnections';
|
import ServerConnections from '../components/ServerConnections';
|
||||||
|
|
||||||
export default function (options) {
|
function taskbutton(options) {
|
||||||
function pollTasks() {
|
function pollTasks() {
|
||||||
ServerConnections.getApiClient(serverId).getScheduledTasks({
|
ServerConnections.getApiClient(serverId).getScheduledTasks({
|
||||||
IsEnabled: true
|
IsEnabled: true
|
||||||
|
@ -120,3 +120,5 @@ export default function (options) {
|
||||||
Events.on(serverNotifications, 'ScheduledTasksInfo', onScheduledTasksUpdate);
|
Events.on(serverNotifications, 'ScheduledTasksInfo', onScheduledTasksUpdate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default taskbutton;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue