diff --git a/package.json b/package.json index f794b8b6da..c6de5310d0 100644 --- a/package.json +++ b/package.json @@ -211,6 +211,7 @@ "src/controllers/searchpage.js", "src/controllers/livetvtuner.js", "src/controllers/livetvstatus.js", + "src/controllers/livetvguideprovider.js", "src/controllers/livetvsettings.js", "src/controllers/shows/episodes.js", "src/controllers/shows/tvgenres.js", diff --git a/src/controllers/livetvguideprovider.js b/src/controllers/livetvguideprovider.js index 3ec04fd2af..6ab195a088 100644 --- a/src/controllers/livetvguideprovider.js +++ b/src/controllers/livetvguideprovider.js @@ -1,32 +1,30 @@ -define(['events', 'loading', 'globalize'], function (events, loading, globalize) { - 'use strict'; +import events from 'events'; +import loading from 'loading'; +import globalize from 'globalize'; - loading = loading.default || loading; +function onListingsSubmitted() { + Dashboard.navigate('livetvstatus.html'); +} - function onListingsSubmitted() { - Dashboard.navigate('livetvstatus.html'); - } +function init(page, type, providerId) { + const url = 'components/tvproviders/' + type + '.js'; - function init(page, type, providerId) { - var url = 'components/tvproviders/' + type + '.js'; - - require([url], function (factory) { - 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); + import(url).then(({default: factory}) => { + const instance = new factory(page, providerId, {}); + events.on(instance, 'submitted', onListingsSubmitted); + instance.init(); }); +} + +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); });