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

Merge pull request #1781 from Camc314/migrate-to-ES6-69

Migration of chromecastPlayer to ES6 Modules and remove a few final requires
This commit is contained in:
Bond-009 2020-08-09 11:56:18 +02:00 committed by GitHub
commit 784f9fcc32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 391 additions and 388 deletions

View file

@ -161,6 +161,7 @@
"src/components/remotecontrol/remotecontrol.js", "src/components/remotecontrol/remotecontrol.js",
"src/components/sanatizefilename.js", "src/components/sanatizefilename.js",
"src/components/scrollManager.js", "src/components/scrollManager.js",
"src/plugins/chromecastPlayer/plugin.js",
"src/components/slideshow/slideshow.js", "src/components/slideshow/slideshow.js",
"src/components/sortmenu/sortmenu.js", "src/components/sortmenu/sortmenu.js",
"src/plugins/htmlVideoPlayer/plugin.js", "src/plugins/htmlVideoPlayer/plugin.js",

View file

@ -8,7 +8,6 @@ import browser from 'browser';
import layoutManager from 'layoutManager'; import layoutManager from 'layoutManager';
import scrollHelper from 'scrollHelper'; import scrollHelper from 'scrollHelper';
import globalize from 'globalize'; import globalize from 'globalize';
import require from 'require';
import 'emby-checkbox'; import 'emby-checkbox';
import 'paper-icon-button-light'; import 'paper-icon-button-light';
import 'emby-button'; import 'emby-button';
@ -317,7 +316,7 @@ import 'cardStyle';
function showEditor(itemId, serverId, itemType) { function showEditor(itemId, serverId, itemType) {
loading.show(); loading.show();
require(['text!./imageDownloader.template.html'], function (template) { import('text!./imageDownloader.template.html').then(({default: template}) => {
const apiClient = connectionManager.getApiClient(serverId); const apiClient = connectionManager.getApiClient(serverId);
currentItemId = itemId; currentItemId = itemId;

View file

@ -6,7 +6,6 @@ import loading from 'loading';
import focusManager from 'focusManager'; import focusManager from 'focusManager';
import connectionManager from 'connectionManager'; import connectionManager from 'connectionManager';
import globalize from 'globalize'; import globalize from 'globalize';
import require from 'require';
import shell from 'shell'; import shell from 'shell';
import 'emby-checkbox'; import 'emby-checkbox';
import 'emby-input'; import 'emby-input';
@ -37,7 +36,7 @@ import 'flexStyles';
function submitUpdatedItem(form, item) { function submitUpdatedItem(form, item) {
function afterContentTypeUpdated() { function afterContentTypeUpdated() {
require(['toast'], function (toast) { import('toast').then(({default: toast}) => {
toast(globalize.translate('MessageItemSaved')); toast(globalize.translate('MessageItemSaved'));
}); });
@ -227,7 +226,7 @@ import 'flexStyles';
} }
function editPerson(context, person, index) { function editPerson(context, person, index) {
require(['personEditor'], function (personEditor) { import('personEditor').then(({default: personEditor}) => {
personEditor.show(person).then(function (updatedPerson) { personEditor.show(person).then(function (updatedPerson) {
const isNew = index === -1; const isNew = index === -1;
@ -246,14 +245,14 @@ import 'flexStyles';
if (parentId) { if (parentId) {
reload(context, parentId, item.ServerId); reload(context, parentId, item.ServerId);
} else { } else {
require(['appRouter'], function (appRouter) { import('appRouter').then(({default: appRouter}) => {
appRouter.goHome(); appRouter.goHome();
}); });
} }
} }
function showMoreMenu(context, button, user) { function showMoreMenu(context, button, user) {
require(['itemContextMenu'], function (itemContextMenu) { import('itemContextMenu').then(({default: itemContextMenu}) => {
var item = currentItem; var item = currentItem;
itemContextMenu.show({ itemContextMenu.show({

File diff suppressed because it is too large Load diff

View file

@ -119,7 +119,10 @@ export function getQueryPagingHtml (options) {
} }
export function showSortMenu (options) { export function showSortMenu (options) {
require(['dialogHelper', 'emby-radio'], function (dialogHelper) { Promise.all([
import('dialogHelper'),
import('emby-radio')
]).then(([{default: dialogHelper}]) => {
function onSortByChange() { function onSortByChange() {
var newValue = this.value; var newValue = this.value;