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

31 lines
1 KiB
JavaScript
Raw Normal View History

2020-05-04 12:44:12 +02:00
define(['events', 'loading', 'globalize'], function (events, loading, globalize) {
'use strict';
2018-10-23 01:05:09 +03:00
function onListingsSubmitted() {
2020-05-04 12:44:12 +02:00
Dashboard.navigate('livetvstatus.html');
2018-10-23 01:05:09 +03:00
}
function init(page, type, providerId) {
2020-05-04 12:44:12 +02:00
var url = 'components/tvproviders/' + type + '.js';
require([url], function (factory) {
2018-10-23 01:05:09 +03:00
var instance = new factory(page, providerId, {});
2020-05-04 12:44:12 +02:00
events.on(instance, 'submitted', onListingsSubmitted);
instance.init();
});
2018-10-23 01:05:09 +03:00
}
function loadTemplate(page, type, providerId) {
2020-05-04 12:44:12 +02:00
require(['text!./components/tvproviders/' + type + '.template.html'], function (html) {
2020-07-18 09:21:15 +01:00
page.querySelector('.providerTemplate').innerHTML = globalize.translateHtml(html);
init(page, type, providerId);
});
2018-10-23 01:05:09 +03:00
}
2020-05-04 12:44:12 +02:00
pageIdOn('pageshow', 'liveTvGuideProviderPage', function () {
2018-10-23 01:05:09 +03:00
loading.show();
2020-05-04 12:44:12 +02:00
var providerId = getParameterByName('id');
loadTemplate(this, getParameterByName('type'), providerId);
});
});