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

Migration of general and library details to ES6 Modules

This commit is contained in:
Cameron 2020-07-09 08:54:47 +01:00
parent 3186955376
commit 613f0024bc
3 changed files with 29 additions and 11 deletions

View file

@ -1,5 +1,13 @@
define(['jQuery', 'loading', 'globalize', 'emby-checkbox', 'emby-textarea', 'emby-input', 'emby-select', 'emby-button'], function ($, loading, globalize) {
'use strict';
import $ from 'jQuery';
import loading from 'loading';
import globalize from 'globalize';
import 'emby-checkbox';
import 'emby-textarea';
import 'emby-input';
import 'emby-select';
import 'emby-button';
/* eslint-disable indent */
function loadPage(page, config, languageOptions, systemInfo) {
page.querySelector('#txtServerName').value = systemInfo.ServerName;
@ -43,7 +51,7 @@ define(['jQuery', 'loading', 'globalize', 'emby-checkbox', 'emby-textarea', 'emb
});
});
}, function () {
require(['alert'], function (alert) {
import('alert').then(({default: alert}) => {
alert(globalize.translate('DefaultErrorMessage'));
});
@ -56,9 +64,9 @@ define(['jQuery', 'loading', 'globalize', 'emby-checkbox', 'emby-textarea', 'emb
var currentBrandingOptions;
var currentLanguage;
var brandingConfigKey = 'branding';
return function (view, params) {
export default function (view, params) {
$('#btnSelectCachePath', view).on('click.selectDirectory', function () {
require(['directorybrowser'], function (directoryBrowser) {
import('directorybrowser').then(({default: directoryBrowser}) => {
var picker = new directoryBrowser();
picker.show({
callback: function (path) {
@ -75,7 +83,7 @@ define(['jQuery', 'loading', 'globalize', 'emby-checkbox', 'emby-textarea', 'emb
});
});
$('#btnSelectMetadataPath', view).on('click.selectDirectory', function () {
require(['directorybrowser'], function (directoryBrowser) {
import('directorybrowser').then(({default: directoryBrowser}) => {
var picker = new directoryBrowser();
picker.show({
path: $('#txtMetadataPath', view).val(),
@ -113,4 +121,5 @@ define(['jQuery', 'loading', 'globalize', 'emby-checkbox', 'emby-textarea', 'emb
});
});
};
});
/* eslint-enable indent */