1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Make import paths ES6-compatible

This commit is contained in:
MrTimscampi 2020-08-14 08:46:34 +02:00 committed by vitorsemeano
parent 1a635e2f81
commit bfb8c7c1f6
245 changed files with 2073 additions and 1995 deletions

View file

@ -1,7 +1,7 @@
import $ from 'jQuery';
import loading from 'loading';
import libraryMenu from 'libraryMenu';
import globalize from 'globalize';
import 'jquery';
import loading from '../../../components/loading/loading';
import libraryMenu from '../../../scripts/libraryMenu';
import globalize from '../../../scripts/globalize';
/* eslint-disable indent */
@ -110,7 +110,7 @@ import globalize from 'globalize';
Dashboard.navigate('userprofiles.html');
loading.hide();
import('toast').then(({default: toast}) => {
import('../../../components/toast/toast').then((toast) => {
toast(globalize.translate('SettingsSaved'));
});
}

View file

@ -1,7 +1,7 @@
import $ from 'jQuery';
import loading from 'loading';
import libraryMenu from 'libraryMenu';
import globalize from 'globalize';
import 'jquery';
import loading from '../../../components/loading/loading';
import libraryMenu from '../../../scripts/libraryMenu';
import globalize from '../../../scripts/globalize';
/* eslint-disable indent */
@ -92,7 +92,7 @@ import globalize from 'globalize';
function onSaveComplete(page) {
loading.hide();
import('toast').then(({default: toast}) => {
import('../../../components/toast/toast').then((toast) => {
toast(globalize.translate('SettingsSaved'));
});
}

View file

@ -1,7 +1,7 @@
import $ from 'jQuery';
import loading from 'loading';
import globalize from 'globalize';
import 'emby-checkbox';
import 'jquery';
import loading from '../../../components/loading/loading';
import globalize from '../../../scripts/globalize';
import '../../../elements/emby-checkbox/emby-checkbox';
/* eslint-disable indent */
@ -88,7 +88,7 @@ import 'emby-checkbox';
Dashboard.navigate('useredit.html?userId=' + user.Id);
});
}, function (response) {
import('toast').then(({default: toast}) => {
import('../../../components/toast/toast').then((toast) => {
toast(globalize.translate('ErrorDefault'));
});

View file

@ -1,10 +1,10 @@
import $ from 'jQuery';
import datetime from 'datetime';
import loading from 'loading';
import libraryMenu from 'libraryMenu';
import globalize from 'globalize';
import 'listViewStyle';
import 'paper-icon-button-light';
import 'jquery';
import datetime from '../../../scripts/datetime';
import loading from '../../../components/loading/loading';
import libraryMenu from '../../../scripts/libraryMenu';
import globalize from '../../../scripts/globalize';
import '../../../components/listview/listview.css';
import '../../../elements/emby-button/paper-icon-button-light';
/* eslint-disable indent */
@ -163,7 +163,7 @@ import 'paper-icon-button-light';
function onSaveComplete(page) {
loading.hide();
import('toast').then(({default: toast}) => {
import('../../../components/toast/toast').then((toast) => {
toast(globalize.translate('SettingsSaved'));
});
}
@ -195,7 +195,7 @@ import 'paper-icon-button-light';
function showSchedulePopup(page, schedule, index) {
schedule = schedule || {};
import('components/accessSchedule/accessSchedule').then(({default: accessschedule}) => {
import('../../../components/accessSchedule/accessSchedule').then(({default: accessschedule}) => {
accessschedule.show({
schedule: schedule
}).then(function (updatedSchedule) {
@ -228,7 +228,7 @@ import 'paper-icon-button-light';
}
function showBlockedTagPopup(page) {
import('prompt').then(({default: prompt}) => {
import('../../../components/prompt/prompt').then(({default: prompt}) => {
prompt({
label: globalize.translate('LabelTag')
}).then(function (value) {

View file

@ -1,7 +1,7 @@
import loading from 'loading';
import libraryMenu from 'libraryMenu';
import globalize from 'globalize';
import 'emby-button';
import loading from '../../../components/loading/loading';
import libraryMenu from '../../../scripts/libraryMenu';
import globalize from '../../../scripts/globalize';
import '../../../elements/emby-button/emby-button';
/* eslint-disable indent */
@ -52,7 +52,7 @@ import 'emby-button';
page.querySelector('.chkEnableLocalEasyPassword').checked = user.Configuration.EnableLocalPassword;
import('autoFocuser').then(({default: autoFocuser}) => {
import('../../../components/autoFocuser').then(({default: autoFocuser}) => {
autoFocuser.autoFocus(page);
});
});
@ -82,7 +82,7 @@ import 'emby-button';
ApiClient.updateUserConfiguration(user.Id, user.Configuration).then(function () {
loading.hide();
import('toast').then(({default: toast}) => {
import('../../../components/toast/toast').then((toast) => {
toast(globalize.translate('SettingsSaved'));
});
@ -105,7 +105,7 @@ import 'emby-button';
ApiClient.updateUserPassword(userId, currentPassword, newPassword).then(function () {
loading.hide();
import('toast').then(({default: toast}) => {
import('../../../components/toast/toast').then((toast) => {
toast(globalize.translate('PasswordSaved'));
});
@ -123,7 +123,7 @@ import 'emby-button';
const form = this;
if (form.querySelector('#txtNewPassword').value != form.querySelector('#txtNewPasswordConfirm').value) {
import('toast').then(({default: toast}) => {
import('../../../components/toast/toast').then((toast) => {
toast(globalize.translate('PasswordMatchError'));
});
} else {
@ -144,7 +144,7 @@ import 'emby-button';
function resetPassword() {
const msg = globalize.translate('PasswordResetConfirmation');
import('confirm').then(({default: confirm}) => {
import('../../../components/confirm/confirm').then(({default: confirm}) => {
confirm(msg, globalize.translate('ResetPassword')).then(function () {
const userId = params.userId;
loading.show();
@ -163,7 +163,7 @@ import 'emby-button';
function resetEasyPassword() {
const msg = globalize.translate('PinCodeResetConfirmation');
import('confirm').then(({default: confirm}) => {
import('../../../components/confirm/confirm').then(({default: confirm}) => {
confirm(msg, globalize.translate('HeaderPinCodeReset')).then(function () {
const userId = params.userId;
loading.show();

View file

@ -1,20 +1,20 @@
import loading from 'loading';
import dom from 'dom';
import globalize from 'globalize';
import * as datefns from 'date-fns';
import dfnshelper from 'dfnshelper';
import 'paper-icon-button-light';
import 'cardStyle';
import 'emby-button';
import 'indicators';
import 'flexStyles';
import loading from '../../../components/loading/loading';
import dom from '../../../scripts/dom';
import globalize from '../../../scripts/globalize';
import { formatDistanceToNow } from 'date-fns';
import { localeWithSuffix } from '../../../scripts/dfnshelper';
import '../../../elements/emby-button/paper-icon-button-light';
import '../../../components/cardbuilder/card.css';
import '../../../elements/emby-button/emby-button';
import '../../../components/indicators/indicators.css';
import '../../../assets/css/flexstyles.css';
/* eslint-disable indent */
function deleteUser(page, id) {
const msg = globalize.translate('DeleteUserConfirmation');
import('confirm').then(({default: confirm}) => {
import('../../../components/confirm/confirm').then(({default: confirm}) => {
confirm({
title: globalize.translate('DeleteUser'),
text: msg,
@ -55,7 +55,7 @@ import 'flexStyles';
icon: 'delete'
});
import('actionsheet').then(({default: actionsheet}) => {
import('../../../components/actionSheet/actionSheet').then(({default: actionsheet}) => {
actionsheet.show({
items: menuItems,
positionTo: card,
@ -139,7 +139,7 @@ import 'flexStyles';
// how dates are returned by the server when the session is active and show something like 'Active now', instead of past/future sentences
function getLastSeenText(lastActivityDate) {
if (lastActivityDate) {
return globalize.translate('LastSeen', datefns.formatDistanceToNow(Date.parse(lastActivityDate), dfnshelper.localeWithSuffix));
return globalize.translate('LastSeen', formatDistanceToNow(Date.parse(lastActivityDate), localeWithSuffix));
}
return '';