diff --git a/src/controllers/livetvsettings.js b/src/controllers/livetvsettings.js index 2a325038617..4bc7d11283e 100644 --- a/src/controllers/livetvsettings.js +++ b/src/controllers/livetvsettings.js @@ -56,75 +56,73 @@ function showSaveMessage(recordingPathChanged) { } } -export default function () { - $(document).on('pageinit', '#liveTvSettingsPage', function () { - const page = this; - $('.liveTvSettingsForm').off('submit', onSubmit).on('submit', onSubmit); - $('#btnSelectRecordingPath', page).on('click.selectDirectory', function () { - import('../components/directorybrowser/directorybrowser').then(({default: directoryBrowser}) => { - const picker = new directoryBrowser(); - picker.show({ - callback: function (path) { - if (path) { - $('#txtRecordingPath', page).val(path); - } +$(document).on('pageinit', '#liveTvSettingsPage', function () { + const page = this; + $('.liveTvSettingsForm').off('submit', onSubmit).on('submit', onSubmit); + $('#btnSelectRecordingPath', page).on('click.selectDirectory', function () { + import('../components/directorybrowser/directorybrowser').then(({default: directoryBrowser}) => { + const picker = new directoryBrowser(); + picker.show({ + callback: function (path) { + if (path) { + $('#txtRecordingPath', page).val(path); + } - picker.close(); - }, - validateWriteable: true - }); + picker.close(); + }, + validateWriteable: true }); }); - $('#btnSelectMovieRecordingPath', page).on('click.selectDirectory', function () { - import('../components/directorybrowser/directorybrowser').then(({default: directoryBrowser}) => { - const picker = new directoryBrowser(); - picker.show({ - callback: function (path) { - if (path) { - $('#txtMovieRecordingPath', page).val(path); - } + }); + $('#btnSelectMovieRecordingPath', page).on('click.selectDirectory', function () { + import('../components/directorybrowser/directorybrowser').then(({default: directoryBrowser}) => { + const picker = new directoryBrowser(); + picker.show({ + callback: function (path) { + if (path) { + $('#txtMovieRecordingPath', page).val(path); + } - picker.close(); - }, - validateWriteable: true - }); + picker.close(); + }, + validateWriteable: true }); }); - $('#btnSelectSeriesRecordingPath', page).on('click.selectDirectory', function () { - import('../components/directorybrowser/directorybrowser').then(({default: directoryBrowser}) => { - const picker = new directoryBrowser(); - picker.show({ - callback: function (path) { - if (path) { - $('#txtSeriesRecordingPath', page).val(path); - } + }); + $('#btnSelectSeriesRecordingPath', page).on('click.selectDirectory', function () { + import('../components/directorybrowser/directorybrowser').then(({default: directoryBrowser}) => { + const picker = new directoryBrowser(); + picker.show({ + callback: function (path) { + if (path) { + $('#txtSeriesRecordingPath', page).val(path); + } - picker.close(); - }, - validateWriteable: true - }); + picker.close(); + }, + validateWriteable: true }); }); - $('#btnSelectPostProcessorPath', page).on('click.selectDirectory', function () { - import('../components/directorybrowser/directorybrowser').then(({default: directoryBrowser}) => { - const picker = new directoryBrowser(); - picker.show({ - includeFiles: true, - callback: function (path) { - if (path) { - $('#txtPostProcessor', page).val(path); - } - - picker.close(); + }); + $('#btnSelectPostProcessorPath', page).on('click.selectDirectory', function () { + import('../components/directorybrowser/directorybrowser').then(({default: directoryBrowser}) => { + const picker = new directoryBrowser(); + picker.show({ + includeFiles: true, + callback: function (path) { + if (path) { + $('#txtPostProcessor', page).val(path); } - }); + + picker.close(); + } }); }); - }).on('pageshow', '#liveTvSettingsPage', function () { - loading.show(); - const page = this; - ApiClient.getNamedConfiguration('livetv').then(function (config) { - loadPage(page, config); - }); }); -} +}).on('pageshow', '#liveTvSettingsPage', function () { + loading.show(); + const page = this; + ApiClient.getNamedConfiguration('livetv').then(function (config) { + loadPage(page, config); + }); +}); diff --git a/src/controllers/livetvstatus.js b/src/controllers/livetvstatus.js index 9143d8b87c8..26df1e4b311 100644 --- a/src/controllers/livetvstatus.js +++ b/src/controllers/livetvstatus.js @@ -293,36 +293,34 @@ function onDevicesListClick(e) { } } -export default function () { - $(document).on('pageinit', '#liveTvStatusPage', function () { - const page = this; - $('.btnAddDevice', page).on('click', function () { - addDevice(this); - }); - $('.formAddDevice', page).on('submit', function () { - submitAddDeviceForm(page); - return false; - }); - $('.btnAddProvider', page).on('click', function () { - addProvider(this); - }); - page.querySelector('.devicesList').addEventListener('click', onDevicesListClick); - }).on('pageshow', '#liveTvStatusPage', function () { - const page = this; - reload(page); - taskButton({ - mode: 'on', - progressElem: page.querySelector('.refreshGuideProgress'), - taskKey: 'RefreshGuide', - button: page.querySelector('.btnRefresh') - }); - }).on('pagehide', '#liveTvStatusPage', function () { - const page = this; - taskButton({ - mode: 'off', - progressElem: page.querySelector('.refreshGuideProgress'), - taskKey: 'RefreshGuide', - button: page.querySelector('.btnRefresh') - }); +$(document).on('pageinit', '#liveTvStatusPage', function () { + const page = this; + $('.btnAddDevice', page).on('click', function () { + addDevice(this); }); -} + $('.formAddDevice', page).on('submit', function () { + submitAddDeviceForm(page); + return false; + }); + $('.btnAddProvider', page).on('click', function () { + addProvider(this); + }); + page.querySelector('.devicesList').addEventListener('click', onDevicesListClick); +}).on('pageshow', '#liveTvStatusPage', function () { + const page = this; + reload(page); + taskButton({ + mode: 'on', + progressElem: page.querySelector('.refreshGuideProgress'), + taskKey: 'RefreshGuide', + button: page.querySelector('.btnRefresh') + }); +}).on('pagehide', '#liveTvStatusPage', function () { + const page = this; + taskButton({ + mode: 'off', + progressElem: page.querySelector('.refreshGuideProgress'), + taskKey: 'RefreshGuide', + button: page.querySelector('.btnRefresh') + }); +});