mirror of
https://github.com/jellyfin/jellyfin-web.git
synced 2024-11-17 10:58:20 -07:00
Merge pull request #1724 from matjaz321/migration-of-livetvguideprovider-to-es6-module
Migrated `livetvguideprovider.js` to es6 module
This commit is contained in:
commit
34b62119a9
@ -211,6 +211,7 @@
|
|||||||
"src/controllers/searchpage.js",
|
"src/controllers/searchpage.js",
|
||||||
"src/controllers/livetvtuner.js",
|
"src/controllers/livetvtuner.js",
|
||||||
"src/controllers/livetvstatus.js",
|
"src/controllers/livetvstatus.js",
|
||||||
|
"src/controllers/livetvguideprovider.js",
|
||||||
"src/controllers/livetvsettings.js",
|
"src/controllers/livetvsettings.js",
|
||||||
"src/controllers/shows/episodes.js",
|
"src/controllers/shows/episodes.js",
|
||||||
"src/controllers/shows/tvgenres.js",
|
"src/controllers/shows/tvgenres.js",
|
||||||
|
@ -1,32 +1,30 @@
|
|||||||
define(['events', 'loading', 'globalize'], function (events, loading, globalize) {
|
import events from 'events';
|
||||||
'use strict';
|
import loading from 'loading';
|
||||||
|
import globalize from 'globalize';
|
||||||
|
|
||||||
loading = loading.default || loading;
|
function onListingsSubmitted() {
|
||||||
|
Dashboard.navigate('livetvstatus.html');
|
||||||
|
}
|
||||||
|
|
||||||
function onListingsSubmitted() {
|
function init(page, type, providerId) {
|
||||||
Dashboard.navigate('livetvstatus.html');
|
const url = 'components/tvproviders/' + type + '.js';
|
||||||
}
|
|
||||||
|
|
||||||
function init(page, type, providerId) {
|
import(url).then(({default: factory}) => {
|
||||||
var url = 'components/tvproviders/' + type + '.js';
|
const instance = new factory(page, providerId, {});
|
||||||
|
events.on(instance, 'submitted', onListingsSubmitted);
|
||||||
require([url], function (factory) {
|
instance.init();
|
||||||
var instance = new factory(page, providerId, {});
|
|
||||||
events.on(instance, 'submitted', onListingsSubmitted);
|
|
||||||
instance.init();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function loadTemplate(page, type, providerId) {
|
|
||||||
require(['text!./components/tvproviders/' + type + '.template.html'], function (html) {
|
|
||||||
page.querySelector('.providerTemplate').innerHTML = globalize.translateHtml(html);
|
|
||||||
init(page, type, providerId);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
pageIdOn('pageshow', 'liveTvGuideProviderPage', function () {
|
|
||||||
loading.show();
|
|
||||||
var providerId = getParameterByName('id');
|
|
||||||
loadTemplate(this, getParameterByName('type'), providerId);
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function loadTemplate(page, type, providerId) {
|
||||||
|
import('text!./../components/tvproviders/' + type + '.template.html').then(({default: html}) => {
|
||||||
|
page.querySelector('.providerTemplate').innerHTML = globalize.translateHtml(html);
|
||||||
|
init(page, type, providerId);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
pageIdOn('pageshow', 'liveTvGuideProviderPage', function () {
|
||||||
|
loading.show();
|
||||||
|
const providerId = getParameterByName('id');
|
||||||
|
loadTemplate(this, getParameterByName('type'), providerId);
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user