mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
solved imports for alert, toast and confirm
This commit is contained in:
parent
4b42afcd7a
commit
86a9f4e36f
49 changed files with 417 additions and 550 deletions
|
@ -7,6 +7,7 @@ import serverNotifications from '../scripts/serverNotifications';
|
||||||
import '../elements/emby-button/emby-button';
|
import '../elements/emby-button/emby-button';
|
||||||
import './listview/listview.css';
|
import './listview/listview.css';
|
||||||
import ServerConnections from './ServerConnections';
|
import ServerConnections from './ServerConnections';
|
||||||
|
import alert from './alert';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -128,11 +129,9 @@ import ServerConnections from './ServerConnections';
|
||||||
}
|
}
|
||||||
|
|
||||||
function showItemOverview(item) {
|
function showItemOverview(item) {
|
||||||
import('./alert').then((alert) => {
|
|
||||||
alert({
|
alert({
|
||||||
text: item.Overview
|
text: item.Overview
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class ActivityLog {
|
class ActivityLog {
|
||||||
|
|
|
@ -11,6 +11,7 @@ import viewManager from './viewManager/viewManager';
|
||||||
import AppInfo from './AppInfo';
|
import AppInfo from './AppInfo';
|
||||||
import Dashboard from '../scripts/clientUtils';
|
import Dashboard from '../scripts/clientUtils';
|
||||||
import ServerConnections from './ServerConnections';
|
import ServerConnections from './ServerConnections';
|
||||||
|
import alert from './alert';
|
||||||
|
|
||||||
class AppRouter {
|
class AppRouter {
|
||||||
allRoutes = [];
|
allRoutes = [];
|
||||||
|
@ -289,14 +290,12 @@ class AppRouter {
|
||||||
this.showWelcome();
|
this.showWelcome();
|
||||||
break;
|
break;
|
||||||
case 'ServerUpdateNeeded':
|
case 'ServerUpdateNeeded':
|
||||||
import('./alert').then((alert) =>{
|
|
||||||
alert({
|
alert({
|
||||||
text: globalize.translate('ServerUpdateNeeded', 'https://github.com/jellyfin/jellyfin'),
|
text: globalize.translate('ServerUpdateNeeded', 'https://github.com/jellyfin/jellyfin'),
|
||||||
html: globalize.translate('ServerUpdateNeeded', '<a href="https://github.com/jellyfin/jellyfin">https://github.com/jellyfin/jellyfin</a>')
|
html: globalize.translate('ServerUpdateNeeded', '<a href="https://github.com/jellyfin/jellyfin">https://github.com/jellyfin/jellyfin</a>')
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.showSelectServer();
|
this.showSelectServer();
|
||||||
});
|
});
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -410,9 +409,7 @@ class AppRouter {
|
||||||
this.forcedLogoutMsg = null;
|
this.forcedLogoutMsg = null;
|
||||||
|
|
||||||
if (msg) {
|
if (msg) {
|
||||||
import('./alert').then((alert) => {
|
|
||||||
alert(msg);
|
alert(msg);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,15 +2,11 @@ import browser from '../../scripts/browser';
|
||||||
import dialog from '../dialog/dialog';
|
import dialog from '../dialog/dialog';
|
||||||
import globalize from '../../scripts/globalize';
|
import globalize from '../../scripts/globalize';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
|
||||||
export default (() => {
|
|
||||||
function replaceAll(str, find, replace) {
|
function replaceAll(str, find, replace) {
|
||||||
return str.split(find).join(replace);
|
return str.split(find).join(replace);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (browser.tv && window.confirm) {
|
function nativeConfirm(options) {
|
||||||
// Use the native confirm dialog
|
|
||||||
return options => {
|
|
||||||
if (typeof options === 'string') {
|
if (typeof options === 'string') {
|
||||||
options = {
|
options = {
|
||||||
title: '',
|
title: '',
|
||||||
|
@ -26,10 +22,9 @@ export default (() => {
|
||||||
} else {
|
} else {
|
||||||
return Promise.reject();
|
return Promise.reject();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
} else {
|
|
||||||
// Use our own dialog
|
function customConfirm(text, title) {
|
||||||
return (text, title) => {
|
|
||||||
let options;
|
let options;
|
||||||
if (typeof text === 'string') {
|
if (typeof text === 'string') {
|
||||||
options = {
|
options = {
|
||||||
|
@ -63,7 +58,8 @@ export default (() => {
|
||||||
|
|
||||||
return Promise.reject();
|
return Promise.reject();
|
||||||
});
|
});
|
||||||
};
|
|
||||||
}
|
}
|
||||||
})();
|
|
||||||
/* eslint-enable indent */
|
const baseConfirm = browser.tv && window.confirm ? nativeConfirm : customConfirm;
|
||||||
|
|
||||||
|
export default baseConfirm;
|
||||||
|
|
|
@ -8,6 +8,7 @@ import '../../elements/emby-button/paper-icon-button-light';
|
||||||
import './directorybrowser.css';
|
import './directorybrowser.css';
|
||||||
import '../formdialog.css';
|
import '../formdialog.css';
|
||||||
import '../../elements/emby-button/emby-button';
|
import '../../elements/emby-button/emby-button';
|
||||||
|
import alert from '../alert';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -157,9 +158,7 @@ import '../../elements/emby-button/emby-button';
|
||||||
}
|
}
|
||||||
|
|
||||||
function alertTextWithOptions(options) {
|
function alertTextWithOptions(options) {
|
||||||
import('../alert').then((alert) => {
|
|
||||||
alert(options);
|
alert(options);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function validatePath(path, validateWriteable, apiClient) {
|
function validatePath(path, validateWriteable, apiClient) {
|
||||||
|
|
|
@ -14,6 +14,8 @@ import '../../elements/emby-button/emby-button';
|
||||||
import '../../elements/emby-button/paper-icon-button-light';
|
import '../../elements/emby-button/paper-icon-button-light';
|
||||||
import './imageeditor.css';
|
import './imageeditor.css';
|
||||||
import ServerConnections from '../ServerConnections';
|
import ServerConnections from '../ServerConnections';
|
||||||
|
import alert from '../alert';
|
||||||
|
import confirm from '../confirm/confirm';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -200,15 +202,11 @@ import ServerConnections from '../ServerConnections';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
import('../confirm/confirm').then(({default: confirm}) => {
|
|
||||||
confirm({
|
confirm({
|
||||||
|
|
||||||
text: globalize.translate('ConfirmDeleteImage'),
|
text: globalize.translate('ConfirmDeleteImage'),
|
||||||
confirmText: globalize.translate('Delete'),
|
confirmText: globalize.translate('Delete'),
|
||||||
primary: 'delete'
|
primary: 'delete'
|
||||||
|
|
||||||
}).then(afterConfirm);
|
}).then(afterConfirm);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function moveImage(context, apiClient, itemId, type, index, newIndex, focusContext) {
|
function moveImage(context, apiClient, itemId, type, index, newIndex, focusContext) {
|
||||||
|
@ -216,10 +214,8 @@ import ServerConnections from '../ServerConnections';
|
||||||
hasChanges = true;
|
hasChanges = true;
|
||||||
reload(context, null, focusContext);
|
reload(context, null, focusContext);
|
||||||
}, function () {
|
}, function () {
|
||||||
import('../alert').then((alert) => {
|
|
||||||
alert(globalize.translate('ErrorDefault'));
|
alert(globalize.translate('ErrorDefault'));
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderImages(page, item, apiClient, images, imageProviders, elem) {
|
function renderImages(page, item, apiClient, images, imageProviders, elem) {
|
||||||
|
|
|
@ -20,6 +20,7 @@ import '../listview/listview.css';
|
||||||
import '../formdialog.css';
|
import '../formdialog.css';
|
||||||
import '../../assets/css/flexstyles.css';
|
import '../../assets/css/flexstyles.css';
|
||||||
import toast from '../toast/toast';
|
import toast from '../toast/toast';
|
||||||
|
import alert from '../alert';
|
||||||
|
|
||||||
function onAddLibrary() {
|
function onAddLibrary() {
|
||||||
if (isCreating) {
|
if (isCreating) {
|
||||||
|
@ -27,12 +28,10 @@ import toast from '../toast/toast';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pathInfos.length == 0) {
|
if (pathInfos.length == 0) {
|
||||||
import('../alert').then((alert) => {
|
|
||||||
alert({
|
alert({
|
||||||
text: globalize.translate('PleaseAddAtLeastOneFolder'),
|
text: globalize.translate('PleaseAddAtLeastOneFolder'),
|
||||||
type: 'error'
|
type: 'error'
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,7 @@ import '../formdialog.css';
|
||||||
import '../../elements/emby-toggle/emby-toggle';
|
import '../../elements/emby-toggle/emby-toggle';
|
||||||
import '../../assets/css/flexstyles.css';
|
import '../../assets/css/flexstyles.css';
|
||||||
import toast from '../toast/toast';
|
import toast from '../toast/toast';
|
||||||
|
import confirm from '../confirm/confirm';
|
||||||
|
|
||||||
function onEditLibrary() {
|
function onEditLibrary() {
|
||||||
if (isCreating) {
|
if (isCreating) {
|
||||||
|
@ -69,7 +70,6 @@ import toast from '../toast/toast';
|
||||||
const button = btnRemovePath;
|
const button = btnRemovePath;
|
||||||
const virtualFolder = currentOptions.library;
|
const virtualFolder = currentOptions.library;
|
||||||
|
|
||||||
import('../confirm/confirm').then(({default: confirm}) => {
|
|
||||||
confirm({
|
confirm({
|
||||||
title: globalize.translate('HeaderRemoveMediaLocation'),
|
title: globalize.translate('HeaderRemoveMediaLocation'),
|
||||||
text: globalize.translate('MessageConfirmRemoveMediaLocation'),
|
text: globalize.translate('MessageConfirmRemoveMediaLocation'),
|
||||||
|
@ -84,7 +84,6 @@ import toast from '../toast/toast';
|
||||||
toast(globalize.translate('ErrorDefault'));
|
toast(globalize.translate('ErrorDefault'));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onListItemClick(e) {
|
function onListItemClick(e) {
|
||||||
|
|
|
@ -17,6 +17,7 @@ import '../formdialog.css';
|
||||||
import '../../assets/css/clearbutton.css';
|
import '../../assets/css/clearbutton.css';
|
||||||
import '../../assets/css/flexstyles.css';
|
import '../../assets/css/flexstyles.css';
|
||||||
import ServerConnections from '../ServerConnections';
|
import ServerConnections from '../ServerConnections';
|
||||||
|
import toast from '../toast/toast';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -36,9 +37,7 @@ import ServerConnections from '../ServerConnections';
|
||||||
|
|
||||||
function submitUpdatedItem(form, item) {
|
function submitUpdatedItem(form, item) {
|
||||||
function afterContentTypeUpdated() {
|
function afterContentTypeUpdated() {
|
||||||
import('../toast/toast').then(({default: toast}) => {
|
|
||||||
toast(globalize.translate('MessageItemSaved'));
|
toast(globalize.translate('MessageItemSaved'));
|
||||||
});
|
|
||||||
|
|
||||||
loading.hide();
|
loading.hide();
|
||||||
closeDialog(true);
|
closeDialog(true);
|
||||||
|
|
|
@ -5,6 +5,9 @@ import globalize from '../../scripts/globalize';
|
||||||
import dom from '../../scripts/dom';
|
import dom from '../../scripts/dom';
|
||||||
import './multiSelect.css';
|
import './multiSelect.css';
|
||||||
import ServerConnections from '../ServerConnections';
|
import ServerConnections from '../ServerConnections';
|
||||||
|
import alert from '../alert';
|
||||||
|
import playlistEditor from '../playlisteditor/playlisteditor';
|
||||||
|
import confirm from '../confirm/confirm';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -138,11 +141,9 @@ import ServerConnections from '../ServerConnections';
|
||||||
}
|
}
|
||||||
|
|
||||||
function alertText(options) {
|
function alertText(options) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve) => {
|
||||||
import('../alert').then((alert) => {
|
|
||||||
alert(options).then(resolve, resolve);
|
alert(options).then(resolve, resolve);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteItems(apiClient, itemIds) {
|
function deleteItems(apiClient, itemIds) {
|
||||||
|
@ -155,7 +156,6 @@ import ServerConnections from '../ServerConnections';
|
||||||
title = globalize.translate('HeaderDeleteItems');
|
title = globalize.translate('HeaderDeleteItems');
|
||||||
}
|
}
|
||||||
|
|
||||||
import('../confirm/confirm').then((confirm) => {
|
|
||||||
confirm(msg, title).then(() => {
|
confirm(msg, title).then(() => {
|
||||||
const promises = itemIds.map(itemId => {
|
const promises = itemIds.map(itemId => {
|
||||||
apiClient.deleteItem(itemId);
|
apiClient.deleteItem(itemId);
|
||||||
|
@ -166,7 +166,6 @@ import ServerConnections from '../ServerConnections';
|
||||||
});
|
});
|
||||||
}, reject);
|
}, reject);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showMenuForSelectedItems(e) {
|
function showMenuForSelectedItems(e) {
|
||||||
|
@ -318,12 +317,9 @@ import ServerConnections from '../ServerConnections';
|
||||||
|
|
||||||
function combineVersions(apiClient, selection) {
|
function combineVersions(apiClient, selection) {
|
||||||
if (selection.length < 2) {
|
if (selection.length < 2) {
|
||||||
import('../alert').then((alert) => {
|
|
||||||
alert({
|
alert({
|
||||||
|
|
||||||
text: globalize.translate('PleaseSelectTwoItems')
|
text: globalize.translate('PleaseSelectTwoItems')
|
||||||
});
|
});
|
||||||
});
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@ import loading from '../loading/loading';
|
||||||
import { appHost } from '../apphost';
|
import { appHost } from '../apphost';
|
||||||
import * as Screenfull from 'screenfull';
|
import * as Screenfull from 'screenfull';
|
||||||
import ServerConnections from '../ServerConnections';
|
import ServerConnections from '../ServerConnections';
|
||||||
|
import alert from '../alert';
|
||||||
|
|
||||||
function enableLocalPlaylistManagement(player) {
|
function enableLocalPlaylistManagement(player) {
|
||||||
if (player.getPlaylist) {
|
if (player.getPlaylist) {
|
||||||
|
@ -648,12 +649,10 @@ function validatePlaybackInfoResult(instance, result) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function showPlaybackInfoErrorMessage(instance, errorCode) {
|
function showPlaybackInfoErrorMessage(instance, errorCode) {
|
||||||
import('../alert').then(({ default: alert }) => {
|
|
||||||
alert({
|
alert({
|
||||||
text: globalize.translate(errorCode),
|
text: globalize.translate(errorCode),
|
||||||
title: globalize.translate('HeaderPlaybackError')
|
title: globalize.translate('HeaderPlaybackError')
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function normalizePlayOptions(playOptions) {
|
function normalizePlayOptions(playOptions) {
|
||||||
|
|
|
@ -9,6 +9,7 @@ import { Events } from 'jellyfin-apiclient';
|
||||||
import '../../elements/emby-select/emby-select';
|
import '../../elements/emby-select/emby-select';
|
||||||
import '../../elements/emby-checkbox/emby-checkbox';
|
import '../../elements/emby-checkbox/emby-checkbox';
|
||||||
import ServerConnections from '../ServerConnections';
|
import ServerConnections from '../ServerConnections';
|
||||||
|
import toast from '../toast/toast';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -244,9 +245,7 @@ import ServerConnections from '../ServerConnections';
|
||||||
saveUser(context, user, userSettings, apiClient).then(() => {
|
saveUser(context, user, userSettings, apiClient).then(() => {
|
||||||
loading.hide();
|
loading.hide();
|
||||||
if (enableSaveConfirmation) {
|
if (enableSaveConfirmation) {
|
||||||
import('../toast/toast').then((toast) => {
|
|
||||||
toast(globalize.translate('SettingsSaved'));
|
toast(globalize.translate('SettingsSaved'));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Events.trigger(instance, 'saved');
|
Events.trigger(instance, 'saved');
|
||||||
|
|
|
@ -9,6 +9,7 @@ import '../../elements/emby-button/paper-icon-button-light';
|
||||||
import './recordingfields.css';
|
import './recordingfields.css';
|
||||||
import '../../assets/css/flexstyles.css';
|
import '../../assets/css/flexstyles.css';
|
||||||
import ServerConnections from '../ServerConnections';
|
import ServerConnections from '../ServerConnections';
|
||||||
|
import toast from '../toast/toast';
|
||||||
|
|
||||||
/*eslint prefer-const: "error"*/
|
/*eslint prefer-const: "error"*/
|
||||||
|
|
||||||
|
@ -226,9 +227,7 @@ function onRecordChange(e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendToast(msg) {
|
function sendToast(msg) {
|
||||||
import('../toast/toast').then((toast) => {
|
|
||||||
toast(msg);
|
toast(msg);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function onRecordSeriesChange(e) {
|
function onRecordSeriesChange(e) {
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
import globalize from '../../scripts/globalize';
|
import globalize from '../../scripts/globalize';
|
||||||
import loading from '../loading/loading';
|
import loading from '../loading/loading';
|
||||||
import ServerConnections from '../ServerConnections';
|
import ServerConnections from '../ServerConnections';
|
||||||
|
import toast from '../toast/toast';
|
||||||
|
import confirm from '../confirm/confirm';
|
||||||
|
|
||||||
/*eslint prefer-const: "error"*/
|
/*eslint prefer-const: "error"*/
|
||||||
|
|
||||||
|
@ -29,7 +31,6 @@ function changeRecordingToSeries(apiClient, timerId, programId, confirmTimerCanc
|
||||||
|
|
||||||
function cancelTimerWithConfirmation(timerId, serverId) {
|
function cancelTimerWithConfirmation(timerId, serverId) {
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
import('../confirm/confirm').then((confirm) => {
|
|
||||||
confirm.default({
|
confirm.default({
|
||||||
|
|
||||||
text: globalize.translate('MessageConfirmRecordingCancellation'),
|
text: globalize.translate('MessageConfirmRecordingCancellation'),
|
||||||
|
@ -44,12 +45,10 @@ function cancelTimerWithConfirmation(timerId, serverId) {
|
||||||
cancelTimer(apiClient, timerId, true).then(resolve, reject);
|
cancelTimer(apiClient, timerId, true).then(resolve, reject);
|
||||||
}, reject);
|
}, reject);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function cancelSeriesTimerWithConfirmation(timerId, serverId) {
|
function cancelSeriesTimerWithConfirmation(timerId, serverId) {
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
import('../confirm/confirm').then((confirm) => {
|
|
||||||
confirm.default({
|
confirm.default({
|
||||||
|
|
||||||
text: globalize.translate('MessageConfirmRecordingCancellation'),
|
text: globalize.translate('MessageConfirmRecordingCancellation'),
|
||||||
|
@ -62,16 +61,13 @@ function cancelSeriesTimerWithConfirmation(timerId, serverId) {
|
||||||
|
|
||||||
const apiClient = ServerConnections.getApiClient(serverId);
|
const apiClient = ServerConnections.getApiClient(serverId);
|
||||||
apiClient.cancelLiveTvSeriesTimer(timerId).then(function () {
|
apiClient.cancelLiveTvSeriesTimer(timerId).then(function () {
|
||||||
import('../toast/toast').then((toast) => {
|
|
||||||
toast(globalize.translate('SeriesCancelled'));
|
toast(globalize.translate('SeriesCancelled'));
|
||||||
});
|
|
||||||
|
|
||||||
loading.hide();
|
loading.hide();
|
||||||
resolve();
|
resolve();
|
||||||
}, reject);
|
}, reject);
|
||||||
}, reject);
|
}, reject);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function cancelTimer(apiClient, timerId, hideLoading) {
|
function cancelTimer(apiClient, timerId, hideLoading) {
|
||||||
|
@ -99,9 +95,7 @@ function createRecording(apiClient, programId, isSeries) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendToast(msg) {
|
function sendToast(msg) {
|
||||||
import('../toast/toast').then((toast) => {
|
|
||||||
toast(msg);
|
toast(msg);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showMultiCancellationPrompt(serverId, programId, timerId, timerStatus, seriesTimerId) {
|
function showMultiCancellationPrompt(serverId, programId, timerId, timerStatus, seriesTimerId) {
|
||||||
|
@ -151,10 +145,7 @@ function showMultiCancellationPrompt(serverId, programId, timerId, timerStatus,
|
||||||
loading.show();
|
loading.show();
|
||||||
|
|
||||||
apiClient.cancelLiveTvSeriesTimer(seriesTimerId).then(function () {
|
apiClient.cancelLiveTvSeriesTimer(seriesTimerId).then(function () {
|
||||||
import('../toast/toast').then((toast) => {
|
|
||||||
toast(globalize.translate('SeriesCancelled'));
|
toast(globalize.translate('SeriesCancelled'));
|
||||||
});
|
|
||||||
|
|
||||||
loading.hide();
|
loading.hide();
|
||||||
resolve();
|
resolve();
|
||||||
}, reject);
|
}, reject);
|
||||||
|
|
|
@ -11,6 +11,7 @@ import '../../elements/emby-select/emby-select';
|
||||||
import 'material-design-icons-iconfont';
|
import 'material-design-icons-iconfont';
|
||||||
import '../formdialog.css';
|
import '../formdialog.css';
|
||||||
import ServerConnections from '../ServerConnections';
|
import ServerConnections from '../ServerConnections';
|
||||||
|
import toast from '../toast/toast';
|
||||||
|
|
||||||
/*eslint prefer-const: "error"*/
|
/*eslint prefer-const: "error"*/
|
||||||
|
|
||||||
|
@ -86,9 +87,7 @@ function onSubmit(e) {
|
||||||
|
|
||||||
dialogHelper.close(dlg);
|
dialogHelper.close(dlg);
|
||||||
|
|
||||||
import('../toast/toast').then((toast) => {
|
|
||||||
toast(globalize.translate('RefreshQueued'));
|
toast(globalize.translate('RefreshQueued'));
|
||||||
});
|
|
||||||
|
|
||||||
loading.hide();
|
loading.hide();
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ import '../../elements/emby-itemscontainer/emby-itemscontainer';
|
||||||
import './remotecontrol.css';
|
import './remotecontrol.css';
|
||||||
import '../../elements/emby-ratingbutton/emby-ratingbutton';
|
import '../../elements/emby-ratingbutton/emby-ratingbutton';
|
||||||
import ServerConnections from '../ServerConnections';
|
import ServerConnections from '../ServerConnections';
|
||||||
|
import toast from '../toast/toast';
|
||||||
|
|
||||||
/*eslint prefer-const: "error"*/
|
/*eslint prefer-const: "error"*/
|
||||||
|
|
||||||
|
@ -864,9 +865,7 @@ export default function () {
|
||||||
}, currentPlayer);
|
}, currentPlayer);
|
||||||
form.querySelector('input').value = '';
|
form.querySelector('input').value = '';
|
||||||
|
|
||||||
import('../toast/toast').then((toast) => {
|
|
||||||
toast('Message sent.');
|
toast('Message sent.');
|
||||||
});
|
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
@ -883,9 +882,7 @@ export default function () {
|
||||||
}, currentPlayer);
|
}, currentPlayer);
|
||||||
form.querySelector('input').value = '';
|
form.querySelector('input').value = '';
|
||||||
|
|
||||||
import('../toast/toast').then((toast) => {
|
|
||||||
toast('Text sent.');
|
toast('Text sent.');
|
||||||
});
|
|
||||||
|
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
|
@ -15,6 +15,8 @@ import './subtitleeditor.css';
|
||||||
import '../../elements/emby-button/emby-button';
|
import '../../elements/emby-button/emby-button';
|
||||||
import '../../assets/css/flexstyles.css';
|
import '../../assets/css/flexstyles.css';
|
||||||
import ServerConnections from '../ServerConnections';
|
import ServerConnections from '../ServerConnections';
|
||||||
|
import toast from '../toast/toast';
|
||||||
|
import confirm from '../confirm/confirm';
|
||||||
|
|
||||||
let currentItem;
|
let currentItem;
|
||||||
let hasChanges;
|
let hasChanges;
|
||||||
|
@ -31,9 +33,7 @@ function downloadRemoteSubtitles(context, id) {
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
hasChanges = true;
|
hasChanges = true;
|
||||||
|
|
||||||
import('../toast/toast').then((toast) => {
|
|
||||||
toast(globalize.translate('MessageDownloadQueued'));
|
toast(globalize.translate('MessageDownloadQueued'));
|
||||||
});
|
|
||||||
|
|
||||||
focusManager.autoFocus(context);
|
focusManager.autoFocus(context);
|
||||||
});
|
});
|
||||||
|
@ -42,7 +42,6 @@ function downloadRemoteSubtitles(context, id) {
|
||||||
function deleteLocalSubtitle(context, index) {
|
function deleteLocalSubtitle(context, index) {
|
||||||
const msg = globalize.translate('MessageAreYouSureDeleteSubtitles');
|
const msg = globalize.translate('MessageAreYouSureDeleteSubtitles');
|
||||||
|
|
||||||
import('../confirm/confirm').then((confirm) => {
|
|
||||||
confirm({
|
confirm({
|
||||||
|
|
||||||
title: globalize.translate('ConfirmDeletion'),
|
title: globalize.translate('ConfirmDeletion'),
|
||||||
|
@ -68,7 +67,6 @@ function deleteLocalSubtitle(context, index) {
|
||||||
reload(context, apiClient, itemId);
|
reload(context, apiClient, itemId);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function fillSubtitleList(context, item) {
|
function fillSubtitleList(context, item) {
|
||||||
|
|
|
@ -16,6 +16,7 @@ import '../../elements/emby-checkbox/emby-checkbox';
|
||||||
import '../../assets/css/flexstyles.css';
|
import '../../assets/css/flexstyles.css';
|
||||||
import './subtitlesettings.css';
|
import './subtitlesettings.css';
|
||||||
import ServerConnections from '../ServerConnections';
|
import ServerConnections from '../ServerConnections';
|
||||||
|
import toast from '../toast/toast';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Subtitle settings.
|
* Subtitle settings.
|
||||||
|
@ -88,9 +89,7 @@ function save(instance, context, userId, userSettings, apiClient, enableSaveConf
|
||||||
saveUser(context, user, userSettings, instance.appearanceKey, apiClient).then(function () {
|
saveUser(context, user, userSettings, instance.appearanceKey, apiClient).then(function () {
|
||||||
loading.hide();
|
loading.hide();
|
||||||
if (enableSaveConfirmation) {
|
if (enableSaveConfirmation) {
|
||||||
import('../toast/toast').then((toast) => {
|
|
||||||
toast(globalize.translate('SettingsSaved'));
|
toast(globalize.translate('SettingsSaved'));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Events.trigger(instance, 'saved');
|
Events.trigger(instance, 'saved');
|
||||||
|
|
|
@ -3,11 +3,11 @@ import loading from '../../components/loading/loading';
|
||||||
import dom from '../../scripts/dom';
|
import dom from '../../scripts/dom';
|
||||||
import globalize from '../../scripts/globalize';
|
import globalize from '../../scripts/globalize';
|
||||||
import '../../elements/emby-button/emby-button';
|
import '../../elements/emby-button/emby-button';
|
||||||
|
import confirm from '../../components/confirm/confirm';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
function revoke(page, key) {
|
function revoke(page, key) {
|
||||||
import('../../components/confirm/confirm').then(({default: confirm}) => {
|
|
||||||
confirm(globalize.translate('MessageConfirmRevokeApiKey'), globalize.translate('HeaderConfirmRevokeApiKey')).then(function () {
|
confirm(globalize.translate('MessageConfirmRevokeApiKey'), globalize.translate('HeaderConfirmRevokeApiKey')).then(function () {
|
||||||
loading.show();
|
loading.show();
|
||||||
ApiClient.ajax({
|
ApiClient.ajax({
|
||||||
|
@ -17,7 +17,6 @@ import '../../elements/emby-button/emby-button';
|
||||||
loadData(page);
|
loadData(page);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderKeys(page, keys) {
|
function renderKeys(page, keys) {
|
||||||
|
|
|
@ -20,11 +20,12 @@ import '../../elements/emby-itemscontainer/emby-itemscontainer';
|
||||||
import taskButton from '../../scripts/taskbutton';
|
import taskButton from '../../scripts/taskbutton';
|
||||||
import Dashboard from '../../scripts/clientUtils';
|
import Dashboard from '../../scripts/clientUtils';
|
||||||
import ServerConnections from '../../components/ServerConnections';
|
import ServerConnections from '../../components/ServerConnections';
|
||||||
|
import alert from '../../components/alert';
|
||||||
|
import confirm from '../../components/confirm/confirm';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
function showPlaybackInfo(btn, session) {
|
function showPlaybackInfo(btn, session) {
|
||||||
import('../../components/alert').then(({default: alert}) => {
|
|
||||||
let title;
|
let title;
|
||||||
const text = [];
|
const text = [];
|
||||||
const displayPlayMethod = playMethodHelper.getDisplayPlayMethod(session);
|
const displayPlayMethod = playMethodHelper.getDisplayPlayMethod(session);
|
||||||
|
@ -51,7 +52,6 @@ import ServerConnections from '../../components/ServerConnections';
|
||||||
text: text.join('<br/>'),
|
text: text.join('<br/>'),
|
||||||
title: title
|
title: title
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showSendMessageForm(btn, session) {
|
function showSendMessageForm(btn, session) {
|
||||||
|
@ -722,7 +722,6 @@ import ServerConnections from '../../components/ServerConnections';
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
restart: function (btn) {
|
restart: function (btn) {
|
||||||
import('../../components/confirm/confirm').then(({default: confirm}) => {
|
|
||||||
confirm({
|
confirm({
|
||||||
title: globalize.translate('Restart'),
|
title: globalize.translate('Restart'),
|
||||||
text: globalize.translate('MessageConfirmRestart'),
|
text: globalize.translate('MessageConfirmRestart'),
|
||||||
|
@ -734,10 +733,8 @@ import ServerConnections from '../../components/ServerConnections';
|
||||||
page.querySelector('#btnShutdown').disabled = true;
|
page.querySelector('#btnShutdown').disabled = true;
|
||||||
ApiClient.restartServer();
|
ApiClient.restartServer();
|
||||||
});
|
});
|
||||||
});
|
|
||||||
},
|
},
|
||||||
shutdown: function (btn) {
|
shutdown: function (btn) {
|
||||||
import('../../components/confirm/confirm').then(({default: confirm}) => {
|
|
||||||
confirm({
|
confirm({
|
||||||
title: globalize.translate('ButtonShutdown'),
|
title: globalize.translate('ButtonShutdown'),
|
||||||
text: globalize.translate('MessageConfirmShutdown'),
|
text: globalize.translate('MessageConfirmShutdown'),
|
||||||
|
@ -749,7 +746,6 @@ import ServerConnections from '../../components/ServerConnections';
|
||||||
page.querySelector('#btnShutdown').disabled = true;
|
page.querySelector('#btnShutdown').disabled = true;
|
||||||
ApiClient.shutdownServer();
|
ApiClient.shutdownServer();
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
export default function (view, params) {
|
export default function (view, params) {
|
||||||
|
|
|
@ -8,6 +8,7 @@ import '../../../elements/emby-button/emby-button';
|
||||||
import '../../../elements/emby-itemscontainer/emby-itemscontainer';
|
import '../../../elements/emby-itemscontainer/emby-itemscontainer';
|
||||||
import '../../../components/cardbuilder/card.css';
|
import '../../../components/cardbuilder/card.css';
|
||||||
import Dashboard from '../../../scripts/clientUtils';
|
import Dashboard from '../../../scripts/clientUtils';
|
||||||
|
import confirm from '../../../components/confirm/confirm';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -40,7 +41,6 @@ import Dashboard from '../../../scripts/clientUtils';
|
||||||
function deleteDevice(page, id) {
|
function deleteDevice(page, id) {
|
||||||
const msg = globalize.translate('DeleteDeviceConfirmation');
|
const msg = globalize.translate('DeleteDeviceConfirmation');
|
||||||
|
|
||||||
import('../../../components/confirm/confirm').then(({default: confirm}) => {
|
|
||||||
confirm({
|
confirm({
|
||||||
text: msg,
|
text: msg,
|
||||||
title: globalize.translate('HeaderDeleteDevice'),
|
title: globalize.translate('HeaderDeleteDevice'),
|
||||||
|
@ -51,7 +51,6 @@ import Dashboard from '../../../scripts/clientUtils';
|
||||||
await ApiClient.deleteDevice(id);
|
await ApiClient.deleteDevice(id);
|
||||||
loadData(page);
|
loadData(page);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showDeviceMenu(view, btn, deviceId) {
|
function showDeviceMenu(view, btn, deviceId) {
|
||||||
|
|
|
@ -7,6 +7,7 @@ import '../../../elements/emby-input/emby-input';
|
||||||
import '../../../elements/emby-checkbox/emby-checkbox';
|
import '../../../elements/emby-checkbox/emby-checkbox';
|
||||||
import '../../../components/listview/listview.css';
|
import '../../../components/listview/listview.css';
|
||||||
import Dashboard from '../../../scripts/clientUtils';
|
import Dashboard from '../../../scripts/clientUtils';
|
||||||
|
import toast from '../../../components/toast/toast';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -634,9 +635,7 @@ import Dashboard from '../../../scripts/clientUtils';
|
||||||
data: JSON.stringify(profile),
|
data: JSON.stringify(profile),
|
||||||
contentType: 'application/json'
|
contentType: 'application/json'
|
||||||
}).then(function () {
|
}).then(function () {
|
||||||
import('../../../components/toast/toast').then((toast) => {
|
|
||||||
toast('Settings saved.');
|
toast('Settings saved.');
|
||||||
});
|
|
||||||
}, Dashboard.processErrorResponse);
|
}, Dashboard.processErrorResponse);
|
||||||
} else {
|
} else {
|
||||||
ApiClient.ajax({
|
ApiClient.ajax({
|
||||||
|
|
|
@ -4,6 +4,7 @@ import loading from '../../../components/loading/loading';
|
||||||
import libraryMenu from '../../../scripts/libraryMenu';
|
import libraryMenu from '../../../scripts/libraryMenu';
|
||||||
import '../../../components/listview/listview.css';
|
import '../../../components/listview/listview.css';
|
||||||
import '../../../elements/emby-button/emby-button';
|
import '../../../elements/emby-button/emby-button';
|
||||||
|
import confirm from '../../../components/confirm/confirm';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -64,7 +65,6 @@ import '../../../elements/emby-button/emby-button';
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteProfile(page, id) {
|
function deleteProfile(page, id) {
|
||||||
import('../../../components/confirm/confirm').then(({default: confirm}) => {
|
|
||||||
confirm(globalize.translate('MessageConfirmProfileDeletion'), globalize.translate('HeaderConfirmProfileDeletion')).then(function () {
|
confirm(globalize.translate('MessageConfirmProfileDeletion'), globalize.translate('HeaderConfirmProfileDeletion')).then(function () {
|
||||||
loading.show();
|
loading.show();
|
||||||
ApiClient.ajax({
|
ApiClient.ajax({
|
||||||
|
@ -75,7 +75,6 @@ import '../../../elements/emby-button/emby-button';
|
||||||
loadProfiles(page);
|
loadProfiles(page);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTabs() {
|
function getTabs() {
|
||||||
|
|
|
@ -4,6 +4,7 @@ import globalize from '../../scripts/globalize';
|
||||||
import dom from '../../scripts/dom';
|
import dom from '../../scripts/dom';
|
||||||
import libraryMenu from '../../scripts/libraryMenu';
|
import libraryMenu from '../../scripts/libraryMenu';
|
||||||
import Dashboard from '../../scripts/clientUtils';
|
import Dashboard from '../../scripts/clientUtils';
|
||||||
|
import alert from '../../components/alert';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -43,12 +44,7 @@ import Dashboard from '../../scripts/clientUtils';
|
||||||
|
|
||||||
function onSaveEncodingPathFailure(response) {
|
function onSaveEncodingPathFailure(response) {
|
||||||
loading.hide();
|
loading.hide();
|
||||||
let msg = '';
|
alert(globalize.translate('FFmpegSavePathNotFound'));
|
||||||
msg = globalize.translate('FFmpegSavePathNotFound');
|
|
||||||
|
|
||||||
import('../../components/alert').then(({default: alert}) => {
|
|
||||||
alert(msg);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateEncoder(form) {
|
function updateEncoder(form) {
|
||||||
|
@ -102,22 +98,17 @@ import Dashboard from '../../scripts/clientUtils';
|
||||||
ApiClient.updateNamedConfiguration('encoding', config).then(function () {
|
ApiClient.updateNamedConfiguration('encoding', config).then(function () {
|
||||||
updateEncoder(form);
|
updateEncoder(form);
|
||||||
}, function () {
|
}, function () {
|
||||||
import('../../components/alert').then(({default: alert}) => {
|
|
||||||
alert(globalize.translate('ErrorDefault'));
|
alert(globalize.translate('ErrorDefault'));
|
||||||
});
|
|
||||||
|
|
||||||
Dashboard.processServerConfigurationUpdateResult();
|
Dashboard.processServerConfigurationUpdateResult();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
if ($('#selectVideoDecoder', form).val()) {
|
if ($('#selectVideoDecoder', form).val()) {
|
||||||
import('../../components/alert').then(({default: alert}) => {
|
|
||||||
alert({
|
alert({
|
||||||
title: globalize.translate('TitleHardwareAcceleration'),
|
title: globalize.translate('TitleHardwareAcceleration'),
|
||||||
text: globalize.translate('HardwareAccelerationWarning')
|
text: globalize.translate('HardwareAccelerationWarning')
|
||||||
}).then(onDecoderConfirmed);
|
}).then(onDecoderConfirmed);
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
onDecoderConfirmed();
|
onDecoderConfirmed();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import '../../elements/emby-select/emby-select';
|
||||||
import '../../elements/emby-button/emby-button';
|
import '../../elements/emby-button/emby-button';
|
||||||
import AppInfo from '../../components/AppInfo';
|
import AppInfo from '../../components/AppInfo';
|
||||||
import Dashboard from '../../scripts/clientUtils';
|
import Dashboard from '../../scripts/clientUtils';
|
||||||
|
import alert from '../../components/alert';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -53,10 +54,7 @@ import Dashboard from '../../scripts/clientUtils';
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, function () {
|
}, function () {
|
||||||
import('../../components/alert').then(({default: alert}) => {
|
|
||||||
alert(globalize.translate('ErrorDefault'));
|
alert(globalize.translate('ErrorDefault'));
|
||||||
});
|
|
||||||
|
|
||||||
Dashboard.processServerConfigurationUpdateResult();
|
Dashboard.processServerConfigurationUpdateResult();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -8,6 +8,7 @@ import imageHelper from '../../scripts/imagehelper';
|
||||||
import '../../components/cardbuilder/card.css';
|
import '../../components/cardbuilder/card.css';
|
||||||
import '../../elements/emby-itemrefreshindicator/emby-itemrefreshindicator';
|
import '../../elements/emby-itemrefreshindicator/emby-itemrefreshindicator';
|
||||||
import Dashboard from '../../scripts/clientUtils';
|
import Dashboard from '../../scripts/clientUtils';
|
||||||
|
import confirm from '../../components/confirm/confirm';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -47,7 +48,6 @@ import Dashboard from '../../scripts/clientUtils';
|
||||||
msg += virtualFolder.Locations.join('<br/>');
|
msg += virtualFolder.Locations.join('<br/>');
|
||||||
}
|
}
|
||||||
|
|
||||||
import('../../components/confirm/confirm').then((confirm) => {
|
|
||||||
confirm({
|
confirm({
|
||||||
text: msg,
|
text: msg,
|
||||||
title: globalize.translate('HeaderRemoveMediaFolder'),
|
title: globalize.translate('HeaderRemoveMediaFolder'),
|
||||||
|
@ -59,7 +59,6 @@ import Dashboard from '../../scripts/clientUtils';
|
||||||
reloadLibrary(page);
|
reloadLibrary(page);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshVirtualFolder(page, virtualFolder) {
|
function refreshVirtualFolder(page, virtualFolder) {
|
||||||
|
|
|
@ -3,6 +3,7 @@ import loading from '../../components/loading/loading';
|
||||||
import libraryMenu from '../../scripts/libraryMenu';
|
import libraryMenu from '../../scripts/libraryMenu';
|
||||||
import globalize from '../../scripts/globalize';
|
import globalize from '../../scripts/globalize';
|
||||||
import Dashboard from '../../scripts/clientUtils';
|
import Dashboard from '../../scripts/clientUtils';
|
||||||
|
import alert from '../../components/alert';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -39,12 +40,9 @@ import Dashboard from '../../scripts/clientUtils';
|
||||||
function showConfirmMessage(config) {
|
function showConfirmMessage(config) {
|
||||||
const msg = [];
|
const msg = [];
|
||||||
msg.push(globalize.translate('MetadataSettingChangeHelp'));
|
msg.push(globalize.translate('MetadataSettingChangeHelp'));
|
||||||
|
|
||||||
import('../../components/alert').then(({default: alert}) => {
|
|
||||||
alert({
|
alert({
|
||||||
text: msg.join('<br/><br/>')
|
text: msg.join('<br/><br/>')
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTabs() {
|
function getTabs() {
|
||||||
|
|
|
@ -3,6 +3,7 @@ import globalize from '../../scripts/globalize';
|
||||||
import '../../elements/emby-checkbox/emby-checkbox';
|
import '../../elements/emby-checkbox/emby-checkbox';
|
||||||
import '../../elements/emby-select/emby-select';
|
import '../../elements/emby-select/emby-select';
|
||||||
import Dashboard from '../../scripts/clientUtils';
|
import Dashboard from '../../scripts/clientUtils';
|
||||||
|
import alert from '../../components/alert';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -90,10 +91,8 @@ import Dashboard from '../../scripts/clientUtils';
|
||||||
|
|
||||||
function showAlertText(options) {
|
function showAlertText(options) {
|
||||||
return new Promise(function (resolve, reject) {
|
return new Promise(function (resolve, reject) {
|
||||||
import('../../components/alert').then(({default: alert}) => {
|
|
||||||
alert(options).then(resolve, reject);
|
alert(options).then(resolve, reject);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function confirmSelections(localAddress, enableUpnp, callback) {
|
function confirmSelections(localAddress, enableUpnp, callback) {
|
||||||
|
|
|
@ -3,6 +3,8 @@ import loading from '../../../../components/loading/loading';
|
||||||
import globalize from '../../../../scripts/globalize';
|
import globalize from '../../../../scripts/globalize';
|
||||||
import '../../../../elements/emby-button/emby-button';
|
import '../../../../elements/emby-button/emby-button';
|
||||||
import Dashboard from '../../../../scripts/clientUtils';
|
import Dashboard from '../../../../scripts/clientUtils';
|
||||||
|
import alert from '../../../../components/alert';
|
||||||
|
import confirm from '../../../../components/confirm/confirm';
|
||||||
|
|
||||||
function populateHistory(packageInfo, page) {
|
function populateHistory(packageInfo, page) {
|
||||||
let html = '';
|
let html = '';
|
||||||
|
@ -69,9 +71,7 @@ function renderPackage(pkg, installedPlugins, page) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function alertText(options) {
|
function alertText(options) {
|
||||||
import('../../../../components/alert').then(({default: alert}) => {
|
|
||||||
alert(options);
|
alert(options);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function performInstallation(page, name, guid, version) {
|
function performInstallation(page, name, guid, version) {
|
||||||
|
@ -95,13 +95,11 @@ function performInstallation(page, name, guid, version) {
|
||||||
msg += '<br/>';
|
msg += '<br/>';
|
||||||
msg += globalize.translate('PleaseConfirmPluginInstallation');
|
msg += globalize.translate('PleaseConfirmPluginInstallation');
|
||||||
|
|
||||||
import('../../../../components/confirm/confirm').then(({default: confirm}) => {
|
|
||||||
confirm(msg, globalize.translate('HeaderConfirmPluginInstallation')).then(function () {
|
confirm(msg, globalize.translate('HeaderConfirmPluginInstallation')).then(function () {
|
||||||
alertCallback();
|
alertCallback();
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
console.debug('plugin not installed');
|
console.debug('plugin not installed');
|
||||||
});
|
});
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
alertCallback();
|
alertCallback();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,11 +5,11 @@ import globalize from '../../../../scripts/globalize';
|
||||||
import '../../../../components/cardbuilder/card.css';
|
import '../../../../components/cardbuilder/card.css';
|
||||||
import '../../../../elements/emby-button/emby-button';
|
import '../../../../elements/emby-button/emby-button';
|
||||||
import Dashboard from '../../../../scripts/clientUtils';
|
import Dashboard from '../../../../scripts/clientUtils';
|
||||||
|
import confirm from '../../../../components/confirm/confirm';
|
||||||
|
|
||||||
function deletePlugin(page, uniqueid, name) {
|
function deletePlugin(page, uniqueid, name) {
|
||||||
const msg = globalize.translate('UninstallPluginConfirmation', name);
|
const msg = globalize.translate('UninstallPluginConfirmation', name);
|
||||||
|
|
||||||
import('../../../../components/confirm/confirm').then((confirm) => {
|
|
||||||
confirm.default({
|
confirm.default({
|
||||||
title: globalize.translate('HeaderUninstallPlugin'),
|
title: globalize.translate('HeaderUninstallPlugin'),
|
||||||
text: msg,
|
text: msg,
|
||||||
|
@ -21,7 +21,6 @@ function deletePlugin(page, uniqueid, name) {
|
||||||
reloadList(page);
|
reloadList(page);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showNoConfigurationMessage() {
|
function showNoConfigurationMessage() {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import globalize from '../../../scripts/globalize';
|
||||||
import '../../../elements/emby-input/emby-input';
|
import '../../../elements/emby-input/emby-input';
|
||||||
import '../../../elements/emby-button/emby-button';
|
import '../../../elements/emby-button/emby-button';
|
||||||
import '../../../elements/emby-select/emby-select';
|
import '../../../elements/emby-select/emby-select';
|
||||||
|
import confirm from '../../../components/confirm/confirm';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -135,11 +136,9 @@ import '../../../elements/emby-select/emby-select';
|
||||||
$('#popupAddTrigger', view).removeClass('hide');
|
$('#popupAddTrigger', view).removeClass('hide');
|
||||||
},
|
},
|
||||||
confirmDeleteTrigger: function (view, index) {
|
confirmDeleteTrigger: function (view, index) {
|
||||||
import('../../../components/confirm/confirm').then(({default: confirm}) => {
|
|
||||||
confirm(globalize.translate('MessageDeleteTaskTrigger'), globalize.translate('HeaderDeleteTaskTrigger')).then(function () {
|
confirm(globalize.translate('MessageDeleteTaskTrigger'), globalize.translate('HeaderDeleteTaskTrigger')).then(function () {
|
||||||
ScheduledTaskPage.deleteTrigger(view, index);
|
ScheduledTaskPage.deleteTrigger(view, index);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
},
|
},
|
||||||
deleteTrigger: function (view, index) {
|
deleteTrigger: function (view, index) {
|
||||||
loading.show();
|
loading.show();
|
||||||
|
|
|
@ -3,6 +3,7 @@ import loading from '../../../components/loading/loading';
|
||||||
import libraryMenu from '../../../scripts/libraryMenu';
|
import libraryMenu from '../../../scripts/libraryMenu';
|
||||||
import globalize from '../../../scripts/globalize';
|
import globalize from '../../../scripts/globalize';
|
||||||
import Dashboard from '../../../scripts/clientUtils';
|
import Dashboard from '../../../scripts/clientUtils';
|
||||||
|
import toast from '../../../components/toast/toast';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -110,10 +111,7 @@ import Dashboard from '../../../scripts/clientUtils';
|
||||||
function onSaveComplete(page, user) {
|
function onSaveComplete(page, user) {
|
||||||
Dashboard.navigate('userprofiles.html');
|
Dashboard.navigate('userprofiles.html');
|
||||||
loading.hide();
|
loading.hide();
|
||||||
|
|
||||||
import('../../../components/toast/toast').then((toast) => {
|
|
||||||
toast(globalize.translate('SettingsSaved'));
|
toast(globalize.translate('SettingsSaved'));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveUser(user, page) {
|
function saveUser(user, page) {
|
||||||
|
|
|
@ -3,6 +3,7 @@ import loading from '../../../components/loading/loading';
|
||||||
import libraryMenu from '../../../scripts/libraryMenu';
|
import libraryMenu from '../../../scripts/libraryMenu';
|
||||||
import globalize from '../../../scripts/globalize';
|
import globalize from '../../../scripts/globalize';
|
||||||
import Dashboard from '../../../scripts/clientUtils';
|
import Dashboard from '../../../scripts/clientUtils';
|
||||||
|
import toast from '../../../components/toast/toast';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -92,10 +93,7 @@ import Dashboard from '../../../scripts/clientUtils';
|
||||||
|
|
||||||
function onSaveComplete(page) {
|
function onSaveComplete(page) {
|
||||||
loading.hide();
|
loading.hide();
|
||||||
|
|
||||||
import('../../../components/toast/toast').then((toast) => {
|
|
||||||
toast(globalize.translate('SettingsSaved'));
|
toast(globalize.translate('SettingsSaved'));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveUser(user, page) {
|
function saveUser(user, page) {
|
||||||
|
|
|
@ -3,6 +3,7 @@ import loading from '../../../components/loading/loading';
|
||||||
import globalize from '../../../scripts/globalize';
|
import globalize from '../../../scripts/globalize';
|
||||||
import '../../../elements/emby-checkbox/emby-checkbox';
|
import '../../../elements/emby-checkbox/emby-checkbox';
|
||||||
import Dashboard from '../../../scripts/clientUtils';
|
import Dashboard from '../../../scripts/clientUtils';
|
||||||
|
import toast from '../../../components/toast/toast';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -89,10 +90,7 @@ import Dashboard from '../../../scripts/clientUtils';
|
||||||
Dashboard.navigate('useredit.html?userId=' + user.Id);
|
Dashboard.navigate('useredit.html?userId=' + user.Id);
|
||||||
});
|
});
|
||||||
}, function (response) {
|
}, function (response) {
|
||||||
import('../../../components/toast/toast').then((toast) => {
|
|
||||||
toast(globalize.translate('ErrorDefault'));
|
toast(globalize.translate('ErrorDefault'));
|
||||||
});
|
|
||||||
|
|
||||||
loading.hide();
|
loading.hide();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import libraryMenu from '../../../scripts/libraryMenu';
|
||||||
import globalize from '../../../scripts/globalize';
|
import globalize from '../../../scripts/globalize';
|
||||||
import '../../../components/listview/listview.css';
|
import '../../../components/listview/listview.css';
|
||||||
import '../../../elements/emby-button/paper-icon-button-light';
|
import '../../../elements/emby-button/paper-icon-button-light';
|
||||||
|
import toast from '../../../components/toast/toast';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -162,10 +163,7 @@ import '../../../elements/emby-button/paper-icon-button-light';
|
||||||
|
|
||||||
function onSaveComplete(page) {
|
function onSaveComplete(page) {
|
||||||
loading.hide();
|
loading.hide();
|
||||||
|
|
||||||
import('../../../components/toast/toast').then((toast) => {
|
|
||||||
toast(globalize.translate('SettingsSaved'));
|
toast(globalize.translate('SettingsSaved'));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveUser(user, page) {
|
function saveUser(user, page) {
|
||||||
|
|
|
@ -3,6 +3,8 @@ import libraryMenu from '../../../scripts/libraryMenu';
|
||||||
import globalize from '../../../scripts/globalize';
|
import globalize from '../../../scripts/globalize';
|
||||||
import '../../../elements/emby-button/emby-button';
|
import '../../../elements/emby-button/emby-button';
|
||||||
import Dashboard from '../../../scripts/clientUtils';
|
import Dashboard from '../../../scripts/clientUtils';
|
||||||
|
import toast from '../../../components/toast/toast';
|
||||||
|
import confirm from '../../../components/confirm/confirm';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -82,10 +84,7 @@ import Dashboard from '../../../scripts/clientUtils';
|
||||||
user.Configuration.EnableLocalPassword = view.querySelector('.chkEnableLocalEasyPassword').checked;
|
user.Configuration.EnableLocalPassword = view.querySelector('.chkEnableLocalEasyPassword').checked;
|
||||||
ApiClient.updateUserConfiguration(user.Id, user.Configuration).then(function () {
|
ApiClient.updateUserConfiguration(user.Id, user.Configuration).then(function () {
|
||||||
loading.hide();
|
loading.hide();
|
||||||
|
|
||||||
import('../../../components/toast/toast').then((toast) => {
|
|
||||||
toast(globalize.translate('SettingsSaved'));
|
toast(globalize.translate('SettingsSaved'));
|
||||||
});
|
|
||||||
|
|
||||||
loadUser(view, params);
|
loadUser(view, params);
|
||||||
});
|
});
|
||||||
|
@ -105,10 +104,7 @@ import Dashboard from '../../../scripts/clientUtils';
|
||||||
|
|
||||||
ApiClient.updateUserPassword(userId, currentPassword, newPassword).then(function () {
|
ApiClient.updateUserPassword(userId, currentPassword, newPassword).then(function () {
|
||||||
loading.hide();
|
loading.hide();
|
||||||
|
|
||||||
import('../../../components/toast/toast').then((toast) => {
|
|
||||||
toast(globalize.translate('PasswordSaved'));
|
toast(globalize.translate('PasswordSaved'));
|
||||||
});
|
|
||||||
|
|
||||||
loadUser(view, params);
|
loadUser(view, params);
|
||||||
}, function () {
|
}, function () {
|
||||||
|
@ -124,9 +120,7 @@ import Dashboard from '../../../scripts/clientUtils';
|
||||||
const form = this;
|
const form = this;
|
||||||
|
|
||||||
if (form.querySelector('#txtNewPassword').value != form.querySelector('#txtNewPasswordConfirm').value) {
|
if (form.querySelector('#txtNewPassword').value != form.querySelector('#txtNewPasswordConfirm').value) {
|
||||||
import('../../../components/toast/toast').then((toast) => {
|
|
||||||
toast(globalize.translate('PasswordMatchError'));
|
toast(globalize.translate('PasswordMatchError'));
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
loading.show();
|
loading.show();
|
||||||
savePassword();
|
savePassword();
|
||||||
|
@ -145,7 +139,6 @@ import Dashboard from '../../../scripts/clientUtils';
|
||||||
|
|
||||||
function resetPassword() {
|
function resetPassword() {
|
||||||
const msg = globalize.translate('PasswordResetConfirmation');
|
const msg = globalize.translate('PasswordResetConfirmation');
|
||||||
import('../../../components/confirm/confirm').then(({default: confirm}) => {
|
|
||||||
confirm(msg, globalize.translate('ResetPassword')).then(function () {
|
confirm(msg, globalize.translate('ResetPassword')).then(function () {
|
||||||
const userId = params.userId;
|
const userId = params.userId;
|
||||||
loading.show();
|
loading.show();
|
||||||
|
@ -158,13 +151,11 @@ import Dashboard from '../../../scripts/clientUtils';
|
||||||
loadUser(view, params);
|
loadUser(view, params);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function resetEasyPassword() {
|
function resetEasyPassword() {
|
||||||
const msg = globalize.translate('PinCodeResetConfirmation');
|
const msg = globalize.translate('PinCodeResetConfirmation');
|
||||||
|
|
||||||
import('../../../components/confirm/confirm').then(({default: confirm}) => {
|
|
||||||
confirm(msg, globalize.translate('HeaderPinCodeReset')).then(function () {
|
confirm(msg, globalize.translate('HeaderPinCodeReset')).then(function () {
|
||||||
const userId = params.userId;
|
const userId = params.userId;
|
||||||
loading.show();
|
loading.show();
|
||||||
|
@ -177,7 +168,6 @@ import Dashboard from '../../../scripts/clientUtils';
|
||||||
loadUser(view, params);
|
loadUser(view, params);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
view.querySelector('.updatePasswordForm').addEventListener('submit', onSubmit);
|
view.querySelector('.updatePasswordForm').addEventListener('submit', onSubmit);
|
||||||
|
|
|
@ -9,13 +9,13 @@ import '../../../elements/emby-button/emby-button';
|
||||||
import '../../../components/indicators/indicators.css';
|
import '../../../components/indicators/indicators.css';
|
||||||
import '../../../assets/css/flexstyles.css';
|
import '../../../assets/css/flexstyles.css';
|
||||||
import Dashboard from '../../../scripts/clientUtils';
|
import Dashboard from '../../../scripts/clientUtils';
|
||||||
|
import confirm from '../../../components/confirm/confirm';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
function deleteUser(page, id) {
|
function deleteUser(page, id) {
|
||||||
const msg = globalize.translate('DeleteUserConfirmation');
|
const msg = globalize.translate('DeleteUserConfirmation');
|
||||||
|
|
||||||
import('../../../components/confirm/confirm').then(({default: confirm}) => {
|
|
||||||
confirm({
|
confirm({
|
||||||
title: globalize.translate('DeleteUser'),
|
title: globalize.translate('DeleteUser'),
|
||||||
text: msg,
|
text: msg,
|
||||||
|
@ -27,7 +27,6 @@ import Dashboard from '../../../scripts/clientUtils';
|
||||||
loadData(page);
|
loadData(page);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showUserMenu(elem) {
|
function showUserMenu(elem) {
|
||||||
|
|
|
@ -29,6 +29,7 @@ import '../../elements/emby-select/emby-select';
|
||||||
import itemShortcuts from '../../components/shortcuts';
|
import itemShortcuts from '../../components/shortcuts';
|
||||||
import Dashboard from '../../scripts/clientUtils';
|
import Dashboard from '../../scripts/clientUtils';
|
||||||
import ServerConnections from '../../components/ServerConnections';
|
import ServerConnections from '../../components/ServerConnections';
|
||||||
|
import confirm from '../../components/confirm/confirm';
|
||||||
|
|
||||||
function getPromise(apiClient, params) {
|
function getPromise(apiClient, params) {
|
||||||
const id = params.id;
|
const id = params.id;
|
||||||
|
@ -1869,7 +1870,6 @@ export default function (view, params) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function splitVersions(instance, page, apiClient, params) {
|
function splitVersions(instance, page, apiClient, params) {
|
||||||
import('../../components/confirm/confirm').then(({ default: confirm }) => {
|
|
||||||
confirm('Are you sure you wish to split the media sources into separate items?', 'Split Media Apart').then(function () {
|
confirm('Are you sure you wish to split the media sources into separate items?', 'Split Media Apart').then(function () {
|
||||||
loading.show();
|
loading.show();
|
||||||
apiClient.ajax({
|
apiClient.ajax({
|
||||||
|
@ -1880,7 +1880,6 @@ export default function (view, params) {
|
||||||
reload(instance, page, params);
|
reload(instance, page, params);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPlayOptions(startPosition) {
|
function getPlayOptions(startPosition) {
|
||||||
|
|
|
@ -3,6 +3,7 @@ import loading from '../components/loading/loading';
|
||||||
import globalize from '../scripts/globalize';
|
import globalize from '../scripts/globalize';
|
||||||
import '../elements/emby-button/emby-button';
|
import '../elements/emby-button/emby-button';
|
||||||
import Dashboard from '../scripts/clientUtils';
|
import Dashboard from '../scripts/clientUtils';
|
||||||
|
import alert from '../components/alert';
|
||||||
|
|
||||||
function loadPage(page, config) {
|
function loadPage(page, config) {
|
||||||
$('.liveTvSettingsForm', page).show();
|
$('.liveTvSettingsForm', page).show();
|
||||||
|
@ -51,9 +52,7 @@ function showSaveMessage(recordingPathChanged) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (msg) {
|
if (msg) {
|
||||||
import('../components/alert').then(({default: alert}) => {
|
|
||||||
alert(msg);
|
alert(msg);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ import '../components/cardbuilder/card.css';
|
||||||
import 'material-design-icons-iconfont';
|
import 'material-design-icons-iconfont';
|
||||||
import '../elements/emby-button/emby-button';
|
import '../elements/emby-button/emby-button';
|
||||||
import Dashboard from '../scripts/clientUtils';
|
import Dashboard from '../scripts/clientUtils';
|
||||||
|
import confirm from '../components/confirm/confirm';
|
||||||
|
|
||||||
const enableFocusTransform = !browser.slow && !browser.edge;
|
const enableFocusTransform = !browser.slow && !browser.edge;
|
||||||
|
|
||||||
|
@ -57,7 +58,6 @@ function renderDevices(page, devices) {
|
||||||
function deleteDevice(page, id) {
|
function deleteDevice(page, id) {
|
||||||
const message = globalize.translate('MessageConfirmDeleteTunerDevice');
|
const message = globalize.translate('MessageConfirmDeleteTunerDevice');
|
||||||
|
|
||||||
import('../components/confirm/confirm').then(({default: confirm}) => {
|
|
||||||
confirm(message, globalize.translate('HeaderDeleteDevice')).then(function () {
|
confirm(message, globalize.translate('HeaderDeleteDevice')).then(function () {
|
||||||
loading.show();
|
loading.show();
|
||||||
ApiClient.ajax({
|
ApiClient.ajax({
|
||||||
|
@ -69,7 +69,6 @@ function deleteDevice(page, id) {
|
||||||
reload(page);
|
reload(page);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function reload(page) {
|
function reload(page) {
|
||||||
|
@ -175,7 +174,6 @@ function mapChannels(page, providerId) {
|
||||||
function deleteProvider(page, id) {
|
function deleteProvider(page, id) {
|
||||||
const message = globalize.translate('MessageConfirmDeleteGuideProvider');
|
const message = globalize.translate('MessageConfirmDeleteGuideProvider');
|
||||||
|
|
||||||
import('../components/confirm/confirm').then(({default: confirm}) => {
|
|
||||||
confirm(message, globalize.translate('HeaderDeleteProvider')).then(function () {
|
confirm(message, globalize.translate('HeaderDeleteProvider')).then(function () {
|
||||||
loading.show();
|
loading.show();
|
||||||
ApiClient.ajax({
|
ApiClient.ajax({
|
||||||
|
@ -189,7 +187,6 @@ function deleteProvider(page, id) {
|
||||||
reload(page);
|
reload(page);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function getTunerName(providerId) {
|
function getTunerName(providerId) {
|
||||||
|
|
|
@ -10,6 +10,7 @@ import '../../../components/cardbuilder/card.css';
|
||||||
import '../../../elements/emby-checkbox/emby-checkbox';
|
import '../../../elements/emby-checkbox/emby-checkbox';
|
||||||
import Dashboard from '../../../scripts/clientUtils';
|
import Dashboard from '../../../scripts/clientUtils';
|
||||||
import ServerConnections from '../../../components/ServerConnections';
|
import ServerConnections from '../../../components/ServerConnections';
|
||||||
|
import toast from '../../../components/toast/toast';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -29,10 +30,8 @@ import ServerConnections from '../../../components/ServerConnections';
|
||||||
|
|
||||||
const UnauthorizedOrForbidden = [401, 403];
|
const UnauthorizedOrForbidden = [401, 403];
|
||||||
if (UnauthorizedOrForbidden.includes(response.status)) {
|
if (UnauthorizedOrForbidden.includes(response.status)) {
|
||||||
import('../../../components/toast/toast').then((toast) => {
|
|
||||||
const messageKey = response.status === 401 ? 'MessageInvalidUser' : 'MessageUnauthorizedUser';
|
const messageKey = response.status === 401 ? 'MessageInvalidUser' : 'MessageUnauthorizedUser';
|
||||||
toast(globalize.translate(messageKey));
|
toast(globalize.translate(messageKey));
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
Dashboard.alert({
|
Dashboard.alert({
|
||||||
message: globalize.translate('MessageUnableToConnectToServer'),
|
message: globalize.translate('MessageUnableToConnectToServer'),
|
||||||
|
|
|
@ -16,6 +16,7 @@ import '../../../components/cardbuilder/card.css';
|
||||||
import '../../../elements/emby-button/emby-button';
|
import '../../../elements/emby-button/emby-button';
|
||||||
import Dashboard from '../../../scripts/clientUtils';
|
import Dashboard from '../../../scripts/clientUtils';
|
||||||
import ServerConnections from '../../../components/ServerConnections';
|
import ServerConnections from '../../../components/ServerConnections';
|
||||||
|
import alert from '../../../components/alert';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -102,9 +103,7 @@ import ServerConnections from '../../../components/ServerConnections';
|
||||||
}
|
}
|
||||||
|
|
||||||
function alertTextWithOptions(options) {
|
function alertTextWithOptions(options) {
|
||||||
import('../../../components/alert').then(({default: alert}) => {
|
|
||||||
alert(options);
|
alert(options);
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showServerConnectionFailure() {
|
function showServerConnectionFailure() {
|
||||||
|
|
|
@ -5,6 +5,8 @@ import { appHost } from '../../../components/apphost';
|
||||||
import globalize from '../../../scripts/globalize';
|
import globalize from '../../../scripts/globalize';
|
||||||
import '../../../elements/emby-button/emby-button';
|
import '../../../elements/emby-button/emby-button';
|
||||||
import Dashboard from '../../../scripts/clientUtils';
|
import Dashboard from '../../../scripts/clientUtils';
|
||||||
|
import toast from '../../../components/toast/toast';
|
||||||
|
import confirm from '../../../components/confirm/confirm';
|
||||||
|
|
||||||
function reloadUser(page) {
|
function reloadUser(page) {
|
||||||
const userId = getParameterByName('userId');
|
const userId = getParameterByName('userId');
|
||||||
|
@ -41,26 +43,20 @@ function onFileReaderError(evt) {
|
||||||
loading.hide();
|
loading.hide();
|
||||||
switch (evt.target.error.code) {
|
switch (evt.target.error.code) {
|
||||||
case evt.target.error.NOT_FOUND_ERR:
|
case evt.target.error.NOT_FOUND_ERR:
|
||||||
import('../../../components/toast/toast').then((toast) => {
|
|
||||||
toast(globalize.translate('FileNotFound'));
|
toast(globalize.translate('FileNotFound'));
|
||||||
});
|
|
||||||
break;
|
break;
|
||||||
case evt.target.error.ABORT_ERR:
|
case evt.target.error.ABORT_ERR:
|
||||||
onFileReaderAbort();
|
onFileReaderAbort();
|
||||||
break;
|
break;
|
||||||
case evt.target.error.NOT_READABLE_ERR:
|
case evt.target.error.NOT_READABLE_ERR:
|
||||||
default:
|
default:
|
||||||
import('../../../components/toast/toast').then((toast) => {
|
|
||||||
toast(globalize.translate('FileReadError'));
|
toast(globalize.translate('FileReadError'));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onFileReaderAbort(evt) {
|
function onFileReaderAbort(evt) {
|
||||||
loading.hide();
|
loading.hide();
|
||||||
import('../../../components/toast/toast').then((toast) => {
|
|
||||||
toast(globalize.translate('FileReadCancelled'));
|
toast(globalize.translate('FileReadCancelled'));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setFiles(page, files) {
|
function setFiles(page, files) {
|
||||||
|
@ -90,7 +86,6 @@ export default function (view, params) {
|
||||||
reloadUser(view);
|
reloadUser(view);
|
||||||
new UserPasswordPage(view, params);
|
new UserPasswordPage(view, params);
|
||||||
view.querySelector('#btnDeleteImage').addEventListener('click', function () {
|
view.querySelector('#btnDeleteImage').addEventListener('click', function () {
|
||||||
import('../../../components/confirm/confirm').then(({default: confirm}) => {
|
|
||||||
confirm(globalize.translate('DeleteImageConfirmation'), globalize.translate('DeleteImage')).then(function () {
|
confirm(globalize.translate('DeleteImageConfirmation'), globalize.translate('DeleteImage')).then(function () {
|
||||||
loading.show();
|
loading.show();
|
||||||
const userId = getParameterByName('userId');
|
const userId = getParameterByName('userId');
|
||||||
|
@ -100,7 +95,6 @@ export default function (view, params) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
view.querySelector('#btnAddImage').addEventListener('click', function (evt) {
|
view.querySelector('#btnAddImage').addEventListener('click', function (evt) {
|
||||||
view.querySelector('#uploadImage').click();
|
view.querySelector('#uploadImage').click();
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,6 +4,7 @@ import '../../../assets/css/dashboard.css';
|
||||||
import '../../../elements/emby-input/emby-input';
|
import '../../../elements/emby-input/emby-input';
|
||||||
import '../../../elements/emby-button/emby-button';
|
import '../../../elements/emby-button/emby-button';
|
||||||
import Dashboard from '../../../scripts/clientUtils';
|
import Dashboard from '../../../scripts/clientUtils';
|
||||||
|
import toast from '../../../components/toast/toast';
|
||||||
|
|
||||||
function getApiClient() {
|
function getApiClient() {
|
||||||
return ApiClient;
|
return ApiClient;
|
||||||
|
@ -37,9 +38,7 @@ function onSubmit(e) {
|
||||||
const form = this;
|
const form = this;
|
||||||
|
|
||||||
if (form.querySelector('#txtManualPassword').value != form.querySelector('#txtPasswordConfirm').value) {
|
if (form.querySelector('#txtManualPassword').value != form.querySelector('#txtPasswordConfirm').value) {
|
||||||
import('../../../components/toast/toast').then((toast) => {
|
|
||||||
toast(globalize.translate('PasswordMatchError'));
|
toast(globalize.translate('PasswordMatchError'));
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
submit(form);
|
submit(form);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import globalize from '../../scripts/globalize';
|
||||||
import { Events } from 'jellyfin-apiclient';
|
import { Events } from 'jellyfin-apiclient';
|
||||||
import castSenderApiLoader from '../../components/castSenderApi';
|
import castSenderApiLoader from '../../components/castSenderApi';
|
||||||
import ServerConnections from '../../components/ServerConnections';
|
import ServerConnections from '../../components/ServerConnections';
|
||||||
|
import alert from '../../components/alert';
|
||||||
|
|
||||||
// Based on https://github.com/googlecast/CastVideos-chrome/blob/master/CastVideos.js
|
// Based on https://github.com/googlecast/CastVideos-chrome/blob/master/CastVideos.js
|
||||||
|
|
||||||
|
@ -440,11 +441,9 @@ class CastPlayer {
|
||||||
}
|
}
|
||||||
|
|
||||||
function alertText(text, title) {
|
function alertText(text, title) {
|
||||||
import('../../components/alert').then(({default: alert}) => {
|
|
||||||
alert({
|
alert({
|
||||||
text: text,
|
text,
|
||||||
title: title
|
title
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import globalize from '../../scripts/globalize';
|
import globalize from '../../scripts/globalize';
|
||||||
import * as userSettings from '../../scripts/settings/userSettings';
|
import * as userSettings from '../../scripts/settings/userSettings';
|
||||||
import { appHost } from '../../components/apphost';
|
import { appHost } from '../../components/apphost';
|
||||||
|
import alert from '../../components/alert';
|
||||||
|
|
||||||
// TODO: Replace with date-fns
|
// TODO: Replace with date-fns
|
||||||
// https://stackoverflow.com/questions/6117814/get-week-of-year-in-javascript-like-in-php
|
// https://stackoverflow.com/questions/6117814/get-week-of-year-in-javascript-like-in-php
|
||||||
|
@ -26,13 +27,8 @@ function showMessage(text, userSettingsKey, appHostFeature) {
|
||||||
return Promise.resolve();
|
return Promise.resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise(function (resolve, reject) {
|
|
||||||
userSettings.set(userSettingsKey, '1', false);
|
userSettings.set(userSettingsKey, '1', false);
|
||||||
|
return alert(text);
|
||||||
import('../../components/alert').then(({default: alert}) => {
|
|
||||||
return alert(text).then(resolve, resolve);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function showBlurayMessage() {
|
function showBlurayMessage() {
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
import globalize from '../../scripts/globalize';
|
import globalize from '../../scripts/globalize';
|
||||||
import ServerConnections from '../../components/ServerConnections';
|
import ServerConnections from '../../components/ServerConnections';
|
||||||
|
import alert from '../../components/alert';
|
||||||
|
|
||||||
function showErrorMessage() {
|
function showErrorMessage() {
|
||||||
return import('../../components/alert').then(({default: alert}) => {
|
|
||||||
return alert(globalize.translate('MessagePlayAccessRestricted'));
|
return alert(globalize.translate('MessagePlayAccessRestricted'));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class PlayAccessValidation {
|
class PlayAccessValidation {
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
import AppInfo from '../components/AppInfo';
|
import AppInfo from '../components/AppInfo';
|
||||||
import ServerConnections from '../components/ServerConnections';
|
import ServerConnections from '../components/ServerConnections';
|
||||||
|
import toast from '../components/toast/toast';
|
||||||
|
import loading from '../components/loading/loading';
|
||||||
|
import { appRouter } from '../components/appRouter';
|
||||||
|
import baseAlert from '../components/alert';
|
||||||
|
import baseConfirm from '../components/confirm/confirm';
|
||||||
|
|
||||||
export function getCurrentUser() {
|
export function getCurrentUser() {
|
||||||
return window.ApiClient.getCurrentUser(false);
|
return window.ApiClient.getCurrentUser(false);
|
||||||
|
@ -78,39 +83,21 @@ export function navigate(url, preserveQueryString) {
|
||||||
url += queryString;
|
url += queryString;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise(function (resolve, reject) {
|
return appRouter.show(url);
|
||||||
import('../components/appRouter').then(({ appRouter }) => {
|
|
||||||
return appRouter.show(url).then(resolve, reject);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function processPluginConfigurationUpdateResult() {
|
export function processPluginConfigurationUpdateResult() {
|
||||||
Promise.all([
|
|
||||||
import('../components/loading/loading'),
|
|
||||||
import('../components/toast/toast')
|
|
||||||
])
|
|
||||||
.then(([loading, toast]) => {
|
|
||||||
loading.hide();
|
loading.hide();
|
||||||
toast(Globalize.translate('MessageSettingsSaved'));
|
toast(Globalize.translate('MessageSettingsSaved'));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function processServerConfigurationUpdateResult(result) {
|
export function processServerConfigurationUpdateResult(result) {
|
||||||
Promise.all([
|
|
||||||
import('../components/loading/loading'),
|
|
||||||
import('../components/toast/toast')
|
|
||||||
])
|
|
||||||
.then(([loading, toast]) => {
|
|
||||||
loading.hide();
|
loading.hide();
|
||||||
toast.default(Globalize.translate('MessageSettingsSaved'));
|
toast.default(Globalize.translate('MessageSettingsSaved'));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function processErrorResponse(response) {
|
export function processErrorResponse(response) {
|
||||||
import('../components/loading/loading').then((loading) => {
|
|
||||||
loading.hide();
|
loading.hide();
|
||||||
});
|
|
||||||
|
|
||||||
let status = '' + response.status;
|
let status = '' + response.status;
|
||||||
|
|
||||||
|
@ -126,19 +113,15 @@ export function processErrorResponse(response) {
|
||||||
|
|
||||||
export function alert(options) {
|
export function alert(options) {
|
||||||
if (typeof options == 'string') {
|
if (typeof options == 'string') {
|
||||||
return void import('../components/toast/toast').then((toast) => {
|
|
||||||
toast.default({
|
toast.default({
|
||||||
text: options
|
text: options
|
||||||
});
|
});
|
||||||
});
|
} else {
|
||||||
}
|
baseAlert.default({
|
||||||
|
|
||||||
import('../components/alert').then((alert) => {
|
|
||||||
alert.default({
|
|
||||||
title: options.title || Globalize.translate('HeaderAlert'),
|
title: options.title || Globalize.translate('HeaderAlert'),
|
||||||
text: options.message
|
text: options.message
|
||||||
}).then(options.callback || function () {});
|
}).then(options.callback || function () {});
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function capabilities(appHost) {
|
export function capabilities(appHost) {
|
||||||
|
@ -161,25 +144,19 @@ export function selectServer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function hideLoadingMsg() {
|
export function hideLoadingMsg() {
|
||||||
import('../components/loading/loading').then(({default: loading}) => {
|
|
||||||
loading.hide();
|
loading.hide();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function showLoadingMsg() {
|
export function showLoadingMsg() {
|
||||||
import('../components/loading/loading').then(({default: loading}) => {
|
|
||||||
loading.show();
|
loading.show();
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function confirm(message, title, callback) {
|
export function confirm(message, title, callback) {
|
||||||
import('../components/confirm/confirm').then((confirm) => {
|
baseConfirm(message, title).then(function() {
|
||||||
confirm(message, title).then(function() {
|
|
||||||
callback(!0);
|
callback(!0);
|
||||||
}).catch(function() {
|
}).catch(function() {
|
||||||
callback(!1);
|
callback(!1);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const Dashboard = {
|
const Dashboard = {
|
||||||
|
|
|
@ -3,13 +3,10 @@ import confirm from '../components/confirm/confirm';
|
||||||
import { appRouter } from '../components/appRouter';
|
import { appRouter } from '../components/appRouter';
|
||||||
import globalize from './globalize';
|
import globalize from './globalize';
|
||||||
import ServerConnections from '../components/ServerConnections';
|
import ServerConnections from '../components/ServerConnections';
|
||||||
|
import alert from '../components/alert';
|
||||||
|
|
||||||
function alertText(options) {
|
function alertText(options) {
|
||||||
return new Promise(function (resolve, reject) {
|
return alert(options);
|
||||||
import('../components/alert').then((alert) => {
|
|
||||||
alert(options).then(resolve, resolve);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function deleteItem(options) {
|
export function deleteItem(options) {
|
||||||
|
|
|
@ -5,6 +5,8 @@ import inputManager from '../scripts/inputManager';
|
||||||
import focusManager from '../components/focusManager';
|
import focusManager from '../components/focusManager';
|
||||||
import { appRouter } from '../components/appRouter';
|
import { appRouter } from '../components/appRouter';
|
||||||
import ServerConnections from '../components/ServerConnections';
|
import ServerConnections from '../components/ServerConnections';
|
||||||
|
import toast from '../components/toast/toast';
|
||||||
|
import alert from '../components/alert';
|
||||||
|
|
||||||
const serverNotifications = {};
|
const serverNotifications = {};
|
||||||
|
|
||||||
|
@ -15,13 +17,9 @@ function notifyApp() {
|
||||||
function displayMessage(cmd) {
|
function displayMessage(cmd) {
|
||||||
const args = cmd.Arguments;
|
const args = cmd.Arguments;
|
||||||
if (args.TimeoutMs) {
|
if (args.TimeoutMs) {
|
||||||
import('../components/toast/toast').then((toast) => {
|
|
||||||
toast({ title: args.Header, text: args.Text });
|
toast({ title: args.Header, text: args.Text });
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
import('../components/alert').then(({default: alert}) => {
|
|
||||||
alert({ title: args.Header, text: args.Text });
|
alert({ title: args.Header, text: args.Text });
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue