mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
merge from dev
This commit is contained in:
parent
1c8f02ce0f
commit
33b01d778c
911 changed files with 34157 additions and 57125 deletions
|
@ -7,7 +7,7 @@
|
|||
var apiClient = ApiClient;
|
||||
|
||||
// After saving chapter task, now save server config
|
||||
apiClient.getJSON(apiClient.getUrl('Startup/Configuration')).done(function (config) {
|
||||
apiClient.getJSON(apiClient.getUrl('Startup/Configuration')).then(function (config) {
|
||||
|
||||
config.PreferredMetadataLanguage = $('#selectLanguage', page).val();
|
||||
config.MetadataCountryCode = $('#selectCountry', page).val();
|
||||
|
@ -20,7 +20,7 @@
|
|||
data: config,
|
||||
url: apiClient.getUrl('Startup/Configuration')
|
||||
|
||||
}).done(function () {
|
||||
}).then(function () {
|
||||
|
||||
navigateToNextPage();
|
||||
|
||||
|
@ -29,10 +29,42 @@
|
|||
|
||||
}
|
||||
|
||||
function populateLanguages(select, languages) {
|
||||
|
||||
var html = "";
|
||||
|
||||
html += "<option value=''></option>";
|
||||
|
||||
for (var i = 0, length = languages.length; i < length; i++) {
|
||||
|
||||
var culture = languages[i];
|
||||
|
||||
html += "<option value='" + culture.TwoLetterISOLanguageName + "'>" + culture.DisplayName + "</option>";
|
||||
}
|
||||
|
||||
select.innerHTML = html;
|
||||
}
|
||||
|
||||
function populateCountries (select, allCountries) {
|
||||
|
||||
var html = "";
|
||||
|
||||
html += "<option value=''></option>";
|
||||
|
||||
for (var i = 0, length = allCountries.length; i < length; i++) {
|
||||
|
||||
var culture = allCountries[i];
|
||||
|
||||
html += "<option value='" + culture.TwoLetterISORegionName + "'>" + culture.DisplayName + "</option>";
|
||||
}
|
||||
|
||||
select.innerHTML = html;
|
||||
}
|
||||
|
||||
function reloadData(page, config, cultures, countries) {
|
||||
|
||||
Dashboard.populateLanguages($('#selectLanguage', page), cultures);
|
||||
Dashboard.populateCountries($('#selectCountry', page), countries);
|
||||
populateLanguages(page.querySelector('#selectLanguage'), cultures);
|
||||
populateCountries(page.querySelector('#selectCountry'), countries);
|
||||
|
||||
$('#selectLanguage', page).val(config.PreferredMetadataLanguage);
|
||||
$('#selectCountry', page).val(config.MetadataCountryCode);
|
||||
|
@ -50,9 +82,9 @@
|
|||
var promise2 = apiClient.getCultures();
|
||||
var promise3 = apiClient.getCountries();
|
||||
|
||||
$.when(promise1, promise2, promise3).done(function (response1, response2, response3) {
|
||||
Promise.all([promise1, promise2, promise3]).then(function (responses) {
|
||||
|
||||
reloadData(page, response1[0], response2[0], response3[0]);
|
||||
reloadData(page, responses[0], responses[1], responses[2]);
|
||||
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue