mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 19:08:18 -07:00
update startup wizard
This commit is contained in:
parent
12ba3ef851
commit
16a7316a65
@ -2,23 +2,42 @@
|
||||
|
||||
var guideController;
|
||||
|
||||
function init(page, type, providerId) {
|
||||
function init(page, type) {
|
||||
|
||||
var url = 'tvproviders/' + type + '.js';
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
var apiClient = ApiClient;
|
||||
|
||||
apiClient.getJSON(apiClient.getUrl('Startup/Configuration')).done(function (config) {
|
||||
|
||||
var providerId = null;
|
||||
|
||||
if (config.LiveTvGuideProviderType.toLowerCase() == type.toLowerCase()) {
|
||||
if (config.LiveTvGuideProviderId) {
|
||||
providerId = config.LiveTvGuideProviderId;
|
||||
}
|
||||
}
|
||||
|
||||
var url = 'tvproviders/' + type.toLowerCase() + '.js';
|
||||
|
||||
require([url], function (factory) {
|
||||
|
||||
var instance = new factory(page, providerId, {
|
||||
showCancelButton: false,
|
||||
showSubmitButton: false
|
||||
showSubmitButton: false,
|
||||
showConfirmation: false
|
||||
});
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
instance.init();
|
||||
guideController = instance;
|
||||
|
||||
$(guideController).on('submitted', skip);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function loadTemplate(page, type, providerId) {
|
||||
function loadTemplate(page, type) {
|
||||
|
||||
guideController = null;
|
||||
|
||||
@ -33,7 +52,7 @@
|
||||
elem.innerHTML = Globalize.translateDocument(html);
|
||||
$(elem).trigger('create');
|
||||
|
||||
init(page, type, providerId);
|
||||
init(page, type);
|
||||
});
|
||||
}
|
||||
|
||||
@ -55,6 +74,11 @@
|
||||
guideController.submit();
|
||||
}
|
||||
|
||||
function reload(page) {
|
||||
|
||||
$('#selectType', page).trigger('change');
|
||||
}
|
||||
|
||||
$(document).on('pageinitdepends', "#wizardGuidePage", function () {
|
||||
|
||||
var page = this;
|
||||
@ -71,7 +95,7 @@
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#selectType', page).trigger('change');
|
||||
reload(page);
|
||||
});
|
||||
|
||||
})(jQuery, document, window);
|
||||
|
@ -149,9 +149,14 @@
|
||||
|
||||
}).done(function (result) {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
if (options.showConfirmation !== false) {
|
||||
Dashboard.processServerConfigurationUpdateResult();
|
||||
}
|
||||
$(self).trigger('submitted');
|
||||
|
||||
}).fail(function () {
|
||||
Dashboard.hideLoadingMsg();
|
||||
Dashboard.alert({
|
||||
message: Globalize.translate('ErrorSavingTvProvider')
|
||||
});
|
||||
|
@ -21,7 +21,7 @@
|
||||
<div>
|
||||
<label for="selectType">${LabelDataProvider}</label>
|
||||
<select id="selectType" data-mini="true" required="required">
|
||||
<option value="schedulesdirect">Schedules Direct</option>
|
||||
<option value="SchedulesDirect">Schedules Direct</option>
|
||||
</select>
|
||||
</div>
|
||||
<br />
|
||||
|
Loading…
Reference in New Issue
Block a user