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
|
@ -3,6 +3,7 @@ import loading from '../../../components/loading/loading';
|
|||
import libraryMenu from '../../../scripts/libraryMenu';
|
||||
import globalize from '../../../scripts/globalize';
|
||||
import Dashboard from '../../../scripts/clientUtils';
|
||||
import toast from '../../../components/toast/toast';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -110,10 +111,7 @@ import Dashboard from '../../../scripts/clientUtils';
|
|||
function onSaveComplete(page, user) {
|
||||
Dashboard.navigate('userprofiles.html');
|
||||
loading.hide();
|
||||
|
||||
import('../../../components/toast/toast').then((toast) => {
|
||||
toast(globalize.translate('SettingsSaved'));
|
||||
});
|
||||
toast(globalize.translate('SettingsSaved'));
|
||||
}
|
||||
|
||||
function saveUser(user, page) {
|
||||
|
|
|
@ -3,6 +3,7 @@ import loading from '../../../components/loading/loading';
|
|||
import libraryMenu from '../../../scripts/libraryMenu';
|
||||
import globalize from '../../../scripts/globalize';
|
||||
import Dashboard from '../../../scripts/clientUtils';
|
||||
import toast from '../../../components/toast/toast';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -92,10 +93,7 @@ import Dashboard from '../../../scripts/clientUtils';
|
|||
|
||||
function onSaveComplete(page) {
|
||||
loading.hide();
|
||||
|
||||
import('../../../components/toast/toast').then((toast) => {
|
||||
toast(globalize.translate('SettingsSaved'));
|
||||
});
|
||||
toast(globalize.translate('SettingsSaved'));
|
||||
}
|
||||
|
||||
function saveUser(user, page) {
|
||||
|
|
|
@ -3,6 +3,7 @@ import loading from '../../../components/loading/loading';
|
|||
import globalize from '../../../scripts/globalize';
|
||||
import '../../../elements/emby-checkbox/emby-checkbox';
|
||||
import Dashboard from '../../../scripts/clientUtils';
|
||||
import toast from '../../../components/toast/toast';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -89,10 +90,7 @@ import Dashboard from '../../../scripts/clientUtils';
|
|||
Dashboard.navigate('useredit.html?userId=' + user.Id);
|
||||
});
|
||||
}, function (response) {
|
||||
import('../../../components/toast/toast').then((toast) => {
|
||||
toast(globalize.translate('ErrorDefault'));
|
||||
});
|
||||
|
||||
toast(globalize.translate('ErrorDefault'));
|
||||
loading.hide();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ import libraryMenu from '../../../scripts/libraryMenu';
|
|||
import globalize from '../../../scripts/globalize';
|
||||
import '../../../components/listview/listview.css';
|
||||
import '../../../elements/emby-button/paper-icon-button-light';
|
||||
import toast from '../../../components/toast/toast';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -162,10 +163,7 @@ import '../../../elements/emby-button/paper-icon-button-light';
|
|||
|
||||
function onSaveComplete(page) {
|
||||
loading.hide();
|
||||
|
||||
import('../../../components/toast/toast').then((toast) => {
|
||||
toast(globalize.translate('SettingsSaved'));
|
||||
});
|
||||
toast(globalize.translate('SettingsSaved'));
|
||||
}
|
||||
|
||||
function saveUser(user, page) {
|
||||
|
|
|
@ -3,6 +3,8 @@ import libraryMenu from '../../../scripts/libraryMenu';
|
|||
import globalize from '../../../scripts/globalize';
|
||||
import '../../../elements/emby-button/emby-button';
|
||||
import Dashboard from '../../../scripts/clientUtils';
|
||||
import toast from '../../../components/toast/toast';
|
||||
import confirm from '../../../components/confirm/confirm';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
|
@ -82,10 +84,7 @@ import Dashboard from '../../../scripts/clientUtils';
|
|||
user.Configuration.EnableLocalPassword = view.querySelector('.chkEnableLocalEasyPassword').checked;
|
||||
ApiClient.updateUserConfiguration(user.Id, user.Configuration).then(function () {
|
||||
loading.hide();
|
||||
|
||||
import('../../../components/toast/toast').then((toast) => {
|
||||
toast(globalize.translate('SettingsSaved'));
|
||||
});
|
||||
toast(globalize.translate('SettingsSaved'));
|
||||
|
||||
loadUser(view, params);
|
||||
});
|
||||
|
@ -105,10 +104,7 @@ import Dashboard from '../../../scripts/clientUtils';
|
|||
|
||||
ApiClient.updateUserPassword(userId, currentPassword, newPassword).then(function () {
|
||||
loading.hide();
|
||||
|
||||
import('../../../components/toast/toast').then((toast) => {
|
||||
toast(globalize.translate('PasswordSaved'));
|
||||
});
|
||||
toast(globalize.translate('PasswordSaved'));
|
||||
|
||||
loadUser(view, params);
|
||||
}, function () {
|
||||
|
@ -124,9 +120,7 @@ import Dashboard from '../../../scripts/clientUtils';
|
|||
const form = this;
|
||||
|
||||
if (form.querySelector('#txtNewPassword').value != form.querySelector('#txtNewPasswordConfirm').value) {
|
||||
import('../../../components/toast/toast').then((toast) => {
|
||||
toast(globalize.translate('PasswordMatchError'));
|
||||
});
|
||||
toast(globalize.translate('PasswordMatchError'));
|
||||
} else {
|
||||
loading.show();
|
||||
savePassword();
|
||||
|
@ -145,18 +139,16 @@ import Dashboard from '../../../scripts/clientUtils';
|
|||
|
||||
function resetPassword() {
|
||||
const msg = globalize.translate('PasswordResetConfirmation');
|
||||
import('../../../components/confirm/confirm').then(({default: confirm}) => {
|
||||
confirm(msg, globalize.translate('ResetPassword')).then(function () {
|
||||
const userId = params.userId;
|
||||
loading.show();
|
||||
ApiClient.resetUserPassword(userId).then(function () {
|
||||
loading.hide();
|
||||
Dashboard.alert({
|
||||
message: globalize.translate('PasswordResetComplete'),
|
||||
title: globalize.translate('ResetPassword')
|
||||
});
|
||||
loadUser(view, params);
|
||||
confirm(msg, globalize.translate('ResetPassword')).then(function () {
|
||||
const userId = params.userId;
|
||||
loading.show();
|
||||
ApiClient.resetUserPassword(userId).then(function () {
|
||||
loading.hide();
|
||||
Dashboard.alert({
|
||||
message: globalize.translate('PasswordResetComplete'),
|
||||
title: globalize.translate('ResetPassword')
|
||||
});
|
||||
loadUser(view, params);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -164,18 +156,16 @@ import Dashboard from '../../../scripts/clientUtils';
|
|||
function resetEasyPassword() {
|
||||
const msg = globalize.translate('PinCodeResetConfirmation');
|
||||
|
||||
import('../../../components/confirm/confirm').then(({default: confirm}) => {
|
||||
confirm(msg, globalize.translate('HeaderPinCodeReset')).then(function () {
|
||||
const userId = params.userId;
|
||||
loading.show();
|
||||
ApiClient.resetEasyPassword(userId).then(function () {
|
||||
loading.hide();
|
||||
Dashboard.alert({
|
||||
message: globalize.translate('PinCodeResetComplete'),
|
||||
title: globalize.translate('HeaderPinCodeReset')
|
||||
});
|
||||
loadUser(view, params);
|
||||
confirm(msg, globalize.translate('HeaderPinCodeReset')).then(function () {
|
||||
const userId = params.userId;
|
||||
loading.show();
|
||||
ApiClient.resetEasyPassword(userId).then(function () {
|
||||
loading.hide();
|
||||
Dashboard.alert({
|
||||
message: globalize.translate('PinCodeResetComplete'),
|
||||
title: globalize.translate('HeaderPinCodeReset')
|
||||
});
|
||||
loadUser(view, params);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -9,23 +9,22 @@ import '../../../elements/emby-button/emby-button';
|
|||
import '../../../components/indicators/indicators.css';
|
||||
import '../../../assets/css/flexstyles.css';
|
||||
import Dashboard from '../../../scripts/clientUtils';
|
||||
import confirm from '../../../components/confirm/confirm';
|
||||
|
||||
/* eslint-disable indent */
|
||||
|
||||
function deleteUser(page, id) {
|
||||
const msg = globalize.translate('DeleteUserConfirmation');
|
||||
|
||||
import('../../../components/confirm/confirm').then(({default: confirm}) => {
|
||||
confirm({
|
||||
title: globalize.translate('DeleteUser'),
|
||||
text: msg,
|
||||
confirmText: globalize.translate('Delete'),
|
||||
primary: 'delete'
|
||||
}).then(function () {
|
||||
loading.show();
|
||||
ApiClient.deleteUser(id).then(function () {
|
||||
loadData(page);
|
||||
});
|
||||
confirm({
|
||||
title: globalize.translate('DeleteUser'),
|
||||
text: msg,
|
||||
confirmText: globalize.translate('Delete'),
|
||||
primary: 'delete'
|
||||
}).then(function () {
|
||||
loading.show();
|
||||
ApiClient.deleteUser(id).then(function () {
|
||||
loadData(page);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue