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.1 KiB
JavaScript
Raw Normal View History

2020-08-14 08:46:34 +02:00
import loading from '../components/loading/loading';
import globalize from '../scripts/globalize';
2022-04-10 02:22:13 -04:00
import Dashboard, { pageIdOn } from '../utils/dashboard';
2022-04-05 15:58:12 -04:00
import { getParameterByName } from '../utils/url.ts';
import Events from '../utils/events.ts';
2018-10-23 01:05:09 +03:00
2020-08-01 14:52:15 +02:00
function onListingsSubmitted() {
Dashboard.navigate('livetvstatus.html');
}
2018-10-23 01:05:09 +03:00
2020-08-01 14:52:15 +02:00
function init(page, type, providerId) {
2023-07-06 11:49:55 -04:00
import(`../components/tvproviders/${type}`).then(({ default: ProviderFactory }) => {
const instance = new ProviderFactory(page, providerId, {});
2020-09-08 02:05:02 -04:00
Events.on(instance, 'submitted', onListingsSubmitted);
2020-08-01 14:52:15 +02:00
instance.init();
});
}
2020-08-01 14:52:15 +02:00
function loadTemplate(page, type, providerId) {
2023-03-29 00:38:22 -04:00
import(`../components/tvproviders/${type}.template.html`).then(({ default: html }) => {
2020-08-01 14:52:15 +02:00
page.querySelector('.providerTemplate').innerHTML = globalize.translateHtml(html);
init(page, type, providerId);
});
2020-08-01 14:52:15 +02:00
}
pageIdOn('pageshow', 'liveTvGuideProviderPage', function () {
loading.show();
const providerId = getParameterByName('id');
loadTemplate(this, getParameterByName('type'), providerId);
});