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

migration of usernew and userparentalcontrol to ES6 modules

This commit is contained in:
Cameron 2020-07-09 13:47:35 +01:00
parent ccad334517
commit 84a47081be
3 changed files with 26 additions and 11 deletions

View file

@ -134,6 +134,8 @@
"src/controllers/dashboard/plugins/repositories.js", "src/controllers/dashboard/plugins/repositories.js",
"src/controllers/dashboard/users/useredit.js", "src/controllers/dashboard/users/useredit.js",
"src/controllers/dashboard/users/userlibraryaccess.js", "src/controllers/dashboard/users/userlibraryaccess.js",
"src/controllers/dashboard/users/usernew.js",
"src/controllers/dashboard/users/userparentalcontrol.js",
"src/plugins/bookPlayer/plugin.js", "src/plugins/bookPlayer/plugin.js",
"src/plugins/bookPlayer/tableOfContents.js", "src/plugins/bookPlayer/tableOfContents.js",
"src/plugins/photoPlayer/plugin.js", "src/plugins/photoPlayer/plugin.js",

View file

@ -1,5 +1,9 @@
define(['jQuery', 'loading', 'globalize', 'emby-checkbox'], function ($, loading, globalize) { import $ from 'jQuery';
'use strict'; import loading from 'loading';
import globalize from 'globalize';
import 'emby-checkbox';
/* eslint-disable indent */
function loadMediaFolders(page, mediaFolders) { function loadMediaFolders(page, mediaFolders) {
var html = ''; var html = '';
@ -84,7 +88,7 @@ define(['jQuery', 'loading', 'globalize', 'emby-checkbox'], function ($, loading
Dashboard.navigate('useredit.html?userId=' + user.Id); Dashboard.navigate('useredit.html?userId=' + user.Id);
}); });
}, function (response) { }, function (response) {
require(['toast'], function (toast) { import('toast').then(({default: toast}) => {
toast(globalize.translate('DefaultErrorMessage')); toast(globalize.translate('DefaultErrorMessage'));
}); });
@ -123,4 +127,5 @@ define(['jQuery', 'loading', 'globalize', 'emby-checkbox'], function ($, loading
}).on('pageshow', '#newUserPage', function () { }).on('pageshow', '#newUserPage', function () {
loadData(this); loadData(this);
}); });
});
/* eslint-enable indent */

View file

@ -1,5 +1,13 @@
define(['jQuery', 'datetime', 'loading', 'libraryMenu', 'globalize', 'listViewStyle', 'paper-icon-button-light'], function ($, datetime, loading, libraryMenu, globalize) { import $ from 'jQuery';
'use strict'; import datetime from 'datetime';
import loading from 'loading';
import libraryMenu from 'libraryMenu';
import globalize from 'globalize';
import 'listViewStyle';
import 'paper-icon-button-light';
/* eslint-disable indent */
function populateRatings(allParentalRatings, page) { function populateRatings(allParentalRatings, page) {
var html = ''; var html = '';
@ -158,7 +166,7 @@ define(['jQuery', 'datetime', 'loading', 'libraryMenu', 'globalize', 'listViewSt
function onSaveComplete(page) { function onSaveComplete(page) {
loading.hide(); loading.hide();
require(['toast'], function (toast) { import('toast').then(({default: toast}) => {
toast(globalize.translate('SettingsSaved')); toast(globalize.translate('SettingsSaved'));
}); });
} }
@ -190,8 +198,7 @@ define(['jQuery', 'datetime', 'loading', 'libraryMenu', 'globalize', 'listViewSt
function showSchedulePopup(page, schedule, index) { function showSchedulePopup(page, schedule, index) {
schedule = schedule || {}; schedule = schedule || {};
import('components/accessSchedule/accessSchedule').then(({default: accessschedule}) => {
require(['components/accessSchedule/accessSchedule'], function (accessschedule) {
accessschedule.show({ accessschedule.show({
schedule: schedule schedule: schedule
}).then(function (updatedSchedule) { }).then(function (updatedSchedule) {
@ -224,7 +231,7 @@ define(['jQuery', 'datetime', 'loading', 'libraryMenu', 'globalize', 'listViewSt
} }
function showBlockedTagPopup(page) { function showBlockedTagPopup(page) {
require(['prompt'], function (prompt) { import('prompt').then(({default: prompt}) => {
prompt({ prompt({
label: globalize.translate('LabelTag') label: globalize.translate('LabelTag')
}).then(function (value) { }).then(function (value) {
@ -268,4 +275,5 @@ define(['jQuery', 'datetime', 'loading', 'libraryMenu', 'globalize', 'listViewSt
loadUser(page, responses[0], responses[1]); loadUser(page, responses[0], responses[1]);
}); });
}); });
});
/* eslint-enable indent */