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

move wizard and user preference routes to nested folders

This commit is contained in:
dkanada 2020-07-26 15:09:40 +09:00
parent a353812400
commit c0261ee487
30 changed files with 55 additions and 42 deletions

View file

@ -0,0 +1,29 @@
<div id="wizardStartPage" data-role="page" class="page standalonePage wizardPage">
<div class="padded-left padded-right padded-top">
<div class="ui-corner-all ui-shadow wizardContent" style="position:relative;">
<form class="wizardStartForm">
<div>
<h1 style="float:left;">${WelcomeToProject}</h1>
<a is="emby-linkbutton" rel="noopener noreferrer" href="https://docs.jellyfin.org/general/quick-start.html" target="_blank" class="raised raised-alt" style="float:right;margin-top:20px;">
<span>${ButtonQuickStartGuide}</span>
</a>
</div>
<br style="clear:both;" />
<p>${ThisWizardWillGuideYou}</p>
<br />
<div class="selectContainer">
<select is="emby-select" id="selectLocalizationLanguage" label="${LabelPreferredDisplayLanguage}"></select>
</div>
<br />
<div class="wizardNavigation" style="text-align:right;">
<button is="emby-button" type="submit" class="raised button-submit">
<span>${LabelNext}</span>
<span class="material-icons arrow_forward"></span>
</button>
</div>
</form>
</div>
</div>
</div>

View file

@ -0,0 +1,49 @@
import $ from 'jQuery';
import loading from 'loading';
import 'emby-button';
import 'emby-select';
function loadPage(page, config, languageOptions) {
$('#selectLocalizationLanguage', page).html(languageOptions.map(function (l) {
return '<option value="' + l.Value + '">' + l.Name + '</option>';
})).val(config.UICulture);
loading.hide();
}
function save(page) {
loading.show();
const apiClient = ApiClient;
apiClient.getJSON(apiClient.getUrl('Startup/Configuration')).then(function (config) {
config.UICulture = $('#selectLocalizationLanguage', page).val();
apiClient.ajax({
type: 'POST',
data: config,
url: apiClient.getUrl('Startup/Configuration')
}).then(function () {
Dashboard.navigate('wizarduser.html');
});
});
}
function onSubmit() {
save($(this).parents('.page'));
return false;
}
export default function (view, params) {
$('.wizardStartForm', view).on('submit', onSubmit);
view.addEventListener('viewshow', function () {
document.querySelector('.skinHeader').classList.add('noHomeButtonHeader');
loading.show();
const page = this;
const apiClient = ApiClient;
const promise1 = apiClient.getJSON(apiClient.getUrl('Startup/Configuration'));
const promise2 = apiClient.getJSON(apiClient.getUrl('Localization/Options'));
Promise.all([promise1, promise2]).then(function (responses) {
loadPage(page, responses[0], responses[1]);
});
});
view.addEventListener('viewhide', function () {
document.querySelector('.skinHeader').classList.remove('noHomeButtonHeader');
});
}