mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Migrated to es6 module
This commit is contained in:
parent
a609e3e2b4
commit
39a1d94c50
2 changed files with 26 additions and 25 deletions
|
@ -207,6 +207,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/shows/episodes.js",
|
"src/controllers/shows/episodes.js",
|
||||||
"src/controllers/shows/tvgenres.js",
|
"src/controllers/shows/tvgenres.js",
|
||||||
"src/controllers/shows/tvlatest.js",
|
"src/controllers/shows/tvlatest.js",
|
||||||
|
|
|
@ -1,22 +1,23 @@
|
||||||
define(['events', 'loading', 'globalize'], function (events, loading, globalize) {
|
import events from 'events';
|
||||||
'use strict';
|
import loading from 'loading';
|
||||||
|
import globalize from 'globalize';
|
||||||
|
|
||||||
function onListingsSubmitted() {
|
function onListingsSubmitted() {
|
||||||
Dashboard.navigate('livetvstatus.html');
|
Dashboard.navigate('livetvstatus.html');
|
||||||
}
|
}
|
||||||
|
|
||||||
function init(page, type, providerId) {
|
function init(page, type, providerId) {
|
||||||
var url = 'components/tvproviders/' + type + '.js';
|
const url = 'components/tvproviders/' + type + '.js';
|
||||||
|
|
||||||
require([url], function (factory) {
|
import(url).then(({default: factory}) => {
|
||||||
var instance = new factory(page, providerId, {});
|
const instance = new factory(page, providerId, {});
|
||||||
events.on(instance, 'submitted', onListingsSubmitted);
|
events.on(instance, 'submitted', onListingsSubmitted);
|
||||||
instance.init();
|
instance.init();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadTemplate(page, type, providerId) {
|
function loadTemplate(page, type, providerId) {
|
||||||
require(['text!./components/tvproviders/' + type + '.template.html'], function (html) {
|
import('text!./../components/tvproviders/' + type + '.template.html').then(({default: html}) => {
|
||||||
page.querySelector('.providerTemplate').innerHTML = globalize.translateHtml(html);
|
page.querySelector('.providerTemplate').innerHTML = globalize.translateHtml(html);
|
||||||
init(page, type, providerId);
|
init(page, type, providerId);
|
||||||
});
|
});
|
||||||
|
@ -24,7 +25,6 @@ define(['events', 'loading', 'globalize'], function (events, loading, globalize)
|
||||||
|
|
||||||
pageIdOn('pageshow', 'liveTvGuideProviderPage', function () {
|
pageIdOn('pageshow', 'liveTvGuideProviderPage', function () {
|
||||||
loading.show();
|
loading.show();
|
||||||
var providerId = getParameterByName('id');
|
const providerId = getParameterByName('id');
|
||||||
loadTemplate(this, getParameterByName('type'), providerId);
|
loadTemplate(this, getParameterByName('type'), providerId);
|
||||||
});
|
});
|
||||||
});
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue