mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
update search
This commit is contained in:
parent
11aebfd219
commit
6b85af3c7e
16 changed files with 474 additions and 482 deletions
77
dashboard-ui/scripts/wizardlivetvguide.js
Normal file
77
dashboard-ui/scripts/wizardlivetvguide.js
Normal file
|
@ -0,0 +1,77 @@
|
|||
(function ($, document) {
|
||||
|
||||
var guideController;
|
||||
|
||||
function init(page, type, providerId) {
|
||||
|
||||
var url = 'tvproviders/' + type + '.js';
|
||||
|
||||
require([url], function (factory) {
|
||||
|
||||
var instance = new factory(page, providerId, {
|
||||
showCancelButton: false,
|
||||
showSubmitButton: false
|
||||
});
|
||||
|
||||
instance.init();
|
||||
guideController = instance;
|
||||
});
|
||||
}
|
||||
|
||||
function loadTemplate(page, type, providerId) {
|
||||
|
||||
guideController = null;
|
||||
|
||||
ApiClient.ajax({
|
||||
|
||||
type: 'GET',
|
||||
url: 'tvproviders/' + type + '.template.html'
|
||||
|
||||
}).done(function (html) {
|
||||
|
||||
var elem = page.querySelector('.providerTemplate');
|
||||
elem.innerHTML = Globalize.translateDocument(html);
|
||||
$(elem).trigger('create');
|
||||
|
||||
init(page, type, providerId);
|
||||
});
|
||||
}
|
||||
|
||||
function skip() {
|
||||
var apiClient = ApiClient;
|
||||
|
||||
apiClient.getJSON(apiClient.getUrl('Startup/Info')).done(function (info) {
|
||||
|
||||
if (info.SupportsRunningAsService) {
|
||||
Dashboard.navigate('wizardservice.html');
|
||||
|
||||
} else {
|
||||
Dashboard.navigate('wizardagreement.html');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function next() {
|
||||
guideController.submit();
|
||||
}
|
||||
|
||||
$(document).on('pageinitdepends', "#wizardGuidePage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#selectType', page).on('change', function () {
|
||||
|
||||
loadTemplate(page, this.value);
|
||||
});
|
||||
|
||||
$('.btnSkip', page).on('click', skip);
|
||||
$('.btnNext', page).on('click', next);
|
||||
|
||||
}).on('pageshowready', "#wizardGuidePage", function () {
|
||||
|
||||
var page = this;
|
||||
|
||||
$('#selectType', page).trigger('change');
|
||||
});
|
||||
|
||||
})(jQuery, document, window);
|
Loading…
Add table
Add a link
Reference in a new issue