mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update variable declerations
This commit is contained in:
parent
613f0024bc
commit
dfcf0d5d6b
5 changed files with 31 additions and 32 deletions
|
@ -24,7 +24,7 @@ import 'emby-button';
|
||||||
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
loading.show();
|
loading.show();
|
||||||
var form = this;
|
const form = this;
|
||||||
$(form).parents('.page');
|
$(form).parents('.page');
|
||||||
ApiClient.getServerConfiguration().then(function (config) {
|
ApiClient.getServerConfiguration().then(function (config) {
|
||||||
config.ServerName = $('#txtServerName', form).val();
|
config.ServerName = $('#txtServerName', form).val();
|
||||||
|
@ -32,7 +32,7 @@ import 'emby-button';
|
||||||
config.CachePath = form.querySelector('#txtCachePath').value;
|
config.CachePath = form.querySelector('#txtCachePath').value;
|
||||||
config.MetadataPath = $('#txtMetadataPath', form).val();
|
config.MetadataPath = $('#txtMetadataPath', form).val();
|
||||||
config.MetadataNetworkPath = $('#txtMetadataNetworkPath', form).val();
|
config.MetadataNetworkPath = $('#txtMetadataNetworkPath', form).val();
|
||||||
var requiresReload = config.UICulture !== currentLanguage;
|
let requiresReload = config.UICulture !== currentLanguage;
|
||||||
ApiClient.updateServerConfiguration(config).then(function() {
|
ApiClient.updateServerConfiguration(config).then(function() {
|
||||||
ApiClient.getNamedConfiguration(brandingConfigKey).then(function(brandingConfig) {
|
ApiClient.getNamedConfiguration(brandingConfigKey).then(function(brandingConfig) {
|
||||||
brandingConfig.LoginDisclaimer = form.querySelector('#txtLoginDisclaimer').value;
|
brandingConfig.LoginDisclaimer = form.querySelector('#txtLoginDisclaimer').value;
|
||||||
|
@ -61,13 +61,13 @@ import 'emby-button';
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var currentBrandingOptions;
|
let currentBrandingOptions;
|
||||||
var currentLanguage;
|
let currentLanguage;
|
||||||
var brandingConfigKey = 'branding';
|
const brandingConfigKey = 'branding';
|
||||||
export default function (view, params) {
|
export default function (view, params) {
|
||||||
$('#btnSelectCachePath', view).on('click.selectDirectory', function () {
|
$('#btnSelectCachePath', view).on('click.selectDirectory', function () {
|
||||||
import('directorybrowser').then(({default: directoryBrowser}) => {
|
import('directorybrowser').then(({default: directoryBrowser}) => {
|
||||||
var picker = new directoryBrowser();
|
const picker = new directoryBrowser();
|
||||||
picker.show({
|
picker.show({
|
||||||
callback: function (path) {
|
callback: function (path) {
|
||||||
if (path) {
|
if (path) {
|
||||||
|
@ -84,7 +84,7 @@ import 'emby-button';
|
||||||
});
|
});
|
||||||
$('#btnSelectMetadataPath', view).on('click.selectDirectory', function () {
|
$('#btnSelectMetadataPath', view).on('click.selectDirectory', function () {
|
||||||
import('directorybrowser').then(({default: directoryBrowser}) => {
|
import('directorybrowser').then(({default: directoryBrowser}) => {
|
||||||
var picker = new directoryBrowser();
|
const picker = new directoryBrowser();
|
||||||
picker.show({
|
picker.show({
|
||||||
path: $('#txtMetadataPath', view).val(),
|
path: $('#txtMetadataPath', view).val(),
|
||||||
networkSharePath: $('#txtMetadataNetworkPath', view).val(),
|
networkSharePath: $('#txtMetadataNetworkPath', view).val(),
|
||||||
|
@ -108,9 +108,9 @@ import 'emby-button';
|
||||||
});
|
});
|
||||||
$('.dashboardGeneralForm', view).off('submit', onSubmit).on('submit', onSubmit);
|
$('.dashboardGeneralForm', view).off('submit', onSubmit).on('submit', onSubmit);
|
||||||
view.addEventListener('viewshow', function () {
|
view.addEventListener('viewshow', function () {
|
||||||
var promiseConfig = ApiClient.getServerConfiguration();
|
const promiseConfig = ApiClient.getServerConfiguration();
|
||||||
var promiseLanguageOptions = ApiClient.getJSON(ApiClient.getUrl('Localization/Options'));
|
const promiseLanguageOptions = ApiClient.getJSON(ApiClient.getUrl('Localization/Options'));
|
||||||
var promiseSystemInfo = ApiClient.getSystemInfo();
|
const promiseSystemInfo = ApiClient.getSystemInfo();
|
||||||
Promise.all([promiseConfig, promiseLanguageOptions, promiseSystemInfo]).then(function (responses) {
|
Promise.all([promiseConfig, promiseLanguageOptions, promiseSystemInfo]).then(function (responses) {
|
||||||
loadPage(view, responses[0], responses[1], responses[2]);
|
loadPage(view, responses[0], responses[1], responses[2]);
|
||||||
});
|
});
|
||||||
|
@ -120,6 +120,6 @@ import 'emby-button';
|
||||||
view.querySelector('#txtCustomCss').value = config.CustomCss || '';
|
view.querySelector('#txtCustomCss').value = config.CustomCss || '';
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
/* eslint-enable indent */
|
/* eslint-enable indent */
|
||||||
|
|
|
@ -3,7 +3,6 @@ import loading from 'loading';
|
||||||
import libraryMenu from 'libraryMenu';
|
import libraryMenu from 'libraryMenu';
|
||||||
import 'emby-checkbox';
|
import 'emby-checkbox';
|
||||||
import 'emby-button';
|
import 'emby-button';
|
||||||
import 'emby-button';
|
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
|
@ -39,7 +38,7 @@ import 'emby-button';
|
||||||
|
|
||||||
view.querySelector('form').addEventListener('submit', function(e) {
|
view.querySelector('form').addEventListener('submit', function(e) {
|
||||||
loading.show();
|
loading.show();
|
||||||
var form = this;
|
const form = this;
|
||||||
ApiClient.getServerConfiguration().then(function(config) {
|
ApiClient.getServerConfiguration().then(function(config) {
|
||||||
config.EnableFolderView = form.querySelector('.chkFolderView').checked;
|
config.EnableFolderView = form.querySelector('.chkFolderView').checked;
|
||||||
config.EnableGroupingIntoCollections = form.querySelector('.chkGroupMoviesIntoCollections').checked;
|
config.EnableGroupingIntoCollections = form.querySelector('.chkGroupMoviesIntoCollections').checked;
|
||||||
|
@ -69,6 +68,6 @@ import 'emby-button';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
/* eslint-enable indent */
|
/* eslint-enable indent */
|
||||||
|
|
|
@ -9,10 +9,10 @@ import 'listViewStyle';
|
||||||
|
|
||||||
function populateLanguages(select) {
|
function populateLanguages(select) {
|
||||||
return ApiClient.getCultures().then(function(languages) {
|
return ApiClient.getCultures().then(function(languages) {
|
||||||
var html = '';
|
let html = '';
|
||||||
html += "<option value=''></option>";
|
html += "<option value=''></option>";
|
||||||
for (var i = 0, length = languages.length; i < length; i++) {
|
for (let i = 0, length = languages.length; i < length; i++) {
|
||||||
var culture = languages[i];
|
const culture = languages[i];
|
||||||
html += "<option value='" + culture.TwoLetterISOLanguageName + "'>" + culture.DisplayName + '</option>';
|
html += "<option value='" + culture.TwoLetterISOLanguageName + "'>" + culture.DisplayName + '</option>';
|
||||||
}
|
}
|
||||||
select.innerHTML = html;
|
select.innerHTML = html;
|
||||||
|
@ -21,10 +21,10 @@ import 'listViewStyle';
|
||||||
|
|
||||||
function populateCountries(select) {
|
function populateCountries(select) {
|
||||||
return ApiClient.getCountries().then(function(allCountries) {
|
return ApiClient.getCountries().then(function(allCountries) {
|
||||||
var html = '';
|
let html = '';
|
||||||
html += "<option value=''></option>";
|
html += "<option value=''></option>";
|
||||||
for (var i = 0, length = allCountries.length; i < length; i++) {
|
for (let i = 0, length = allCountries.length; i < length; i++) {
|
||||||
var culture = allCountries[i];
|
const culture = allCountries[i];
|
||||||
html += "<option value='" + culture.TwoLetterISORegionName + "'>" + culture.DisplayName + '</option>';
|
html += "<option value='" + culture.TwoLetterISORegionName + "'>" + culture.DisplayName + '</option>';
|
||||||
}
|
}
|
||||||
select.innerHTML = html;
|
select.innerHTML = html;
|
||||||
|
@ -32,9 +32,9 @@ import 'listViewStyle';
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadPage(page) {
|
function loadPage(page) {
|
||||||
var promises = [ApiClient.getServerConfiguration(), populateLanguages(page.querySelector('#selectLanguage')), populateCountries(page.querySelector('#selectCountry'))];
|
const promises = [ApiClient.getServerConfiguration(), populateLanguages(page.querySelector('#selectLanguage')), populateCountries(page.querySelector('#selectCountry'))];
|
||||||
Promise.all(promises).then(function(responses) {
|
Promise.all(promises).then(function(responses) {
|
||||||
var config = responses[0];
|
const config = responses[0];
|
||||||
page.querySelector('#selectLanguage').value = config.PreferredMetadataLanguage || '';
|
page.querySelector('#selectLanguage').value = config.PreferredMetadataLanguage || '';
|
||||||
page.querySelector('#selectCountry').value = config.MetadataCountryCode || '';
|
page.querySelector('#selectCountry').value = config.MetadataCountryCode || '';
|
||||||
loading.hide();
|
loading.hide();
|
||||||
|
@ -42,7 +42,7 @@ import 'listViewStyle';
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
var form = this;
|
const form = this;
|
||||||
return loading.show(), ApiClient.getServerConfiguration().then(function(config) {
|
return loading.show(), ApiClient.getServerConfiguration().then(function(config) {
|
||||||
config.PreferredMetadataLanguage = form.querySelector('#selectLanguage').value;
|
config.PreferredMetadataLanguage = form.querySelector('#selectLanguage').value;
|
||||||
config.MetadataCountryCode = form.querySelector('#selectCountry').value;
|
config.MetadataCountryCode = form.querySelector('#selectCountry').value;
|
||||||
|
|
|
@ -6,7 +6,7 @@ import globalize from 'globalize';
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
function loadPage(page, config, users) {
|
function loadPage(page, config, users) {
|
||||||
var html = '<option value="" selected="selected">' + globalize.translate('OptionNone') + '</option>';
|
let html = '<option value="" selected="selected">' + globalize.translate('OptionNone') + '</option>';
|
||||||
html += users.map(function (user) {
|
html += users.map(function (user) {
|
||||||
return '<option value="' + user.Id + '">' + user.Name + '</option>';
|
return '<option value="' + user.Id + '">' + user.Name + '</option>';
|
||||||
}).join('');
|
}).join('');
|
||||||
|
@ -20,7 +20,7 @@ import globalize from 'globalize';
|
||||||
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
loading.show();
|
loading.show();
|
||||||
var form = this;
|
const form = this;
|
||||||
ApiClient.getNamedConfiguration(metadataKey).then(function (config) {
|
ApiClient.getNamedConfiguration(metadataKey).then(function (config) {
|
||||||
config.UserId = $('#selectUser', form).val() || null;
|
config.UserId = $('#selectUser', form).val() || null;
|
||||||
config.ReleaseDateFormat = $('#selectReleaseDateFormat', form).val();
|
config.ReleaseDateFormat = $('#selectReleaseDateFormat', form).val();
|
||||||
|
@ -36,7 +36,7 @@ import globalize from 'globalize';
|
||||||
}
|
}
|
||||||
|
|
||||||
function showConfirmMessage(config) {
|
function showConfirmMessage(config) {
|
||||||
var msg = [];
|
const msg = [];
|
||||||
msg.push(globalize.translate('MetadataSettingChangeHelp'));
|
msg.push(globalize.translate('MetadataSettingChangeHelp'));
|
||||||
|
|
||||||
import('alert').then(({default: alert}) => {
|
import('alert').then(({default: alert}) => {
|
||||||
|
@ -62,15 +62,15 @@ import globalize from 'globalize';
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
var metadataKey = 'xbmcmetadata';
|
const metadataKey = 'xbmcmetadata';
|
||||||
$(document).on('pageinit', '#metadataNfoPage', function () {
|
$(document).on('pageinit', '#metadataNfoPage', function () {
|
||||||
$('.metadataNfoForm').off('submit', onSubmit).on('submit', onSubmit);
|
$('.metadataNfoForm').off('submit', onSubmit).on('submit', onSubmit);
|
||||||
}).on('pageshow', '#metadataNfoPage', function () {
|
}).on('pageshow', '#metadataNfoPage', function () {
|
||||||
libraryMenu.setTabs('metadata', 3, getTabs);
|
libraryMenu.setTabs('metadata', 3, getTabs);
|
||||||
loading.show();
|
loading.show();
|
||||||
var page = this;
|
const page = this;
|
||||||
var promise1 = ApiClient.getUsers();
|
const promise1 = ApiClient.getUsers();
|
||||||
var promise2 = ApiClient.getNamedConfiguration(metadataKey);
|
const promise2 = ApiClient.getNamedConfiguration(metadataKey);
|
||||||
Promise.all([promise1, promise2]).then(function (responses) {
|
Promise.all([promise1, promise2]).then(function (responses) {
|
||||||
loadPage(page, responses[1], responses[0]);
|
loadPage(page, responses[1], responses[0]);
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,7 +12,7 @@ import globalize from 'globalize';
|
||||||
|
|
||||||
function onSubmit() {
|
function onSubmit() {
|
||||||
loading.show();
|
loading.show();
|
||||||
var form = this;
|
const form = this;
|
||||||
ApiClient.getServerConfiguration().then(function (config) {
|
ApiClient.getServerConfiguration().then(function (config) {
|
||||||
config.RemoteClientBitrateLimit = parseInt(1e6 * parseFloat($('#txtRemoteClientBitrateLimit', form).val() || '0'));
|
config.RemoteClientBitrateLimit = parseInt(1e6 * parseFloat($('#txtRemoteClientBitrateLimit', form).val() || '0'));
|
||||||
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
|
ApiClient.updateServerConfiguration(config).then(Dashboard.processServerConfigurationUpdateResult);
|
||||||
|
@ -39,7 +39,7 @@ import globalize from 'globalize';
|
||||||
}).on('pageshow', '#streamingSettingsPage', function () {
|
}).on('pageshow', '#streamingSettingsPage', function () {
|
||||||
loading.show();
|
loading.show();
|
||||||
libraryMenu.setTabs('playback', 2, getTabs);
|
libraryMenu.setTabs('playback', 2, getTabs);
|
||||||
var page = this;
|
const page = this;
|
||||||
ApiClient.getServerConfiguration().then(function (config) {
|
ApiClient.getServerConfiguration().then(function (config) {
|
||||||
loadPage(page, config);
|
loadPage(page, config);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue