1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Migrate routes.js to ES6

This commit is contained in:
MrTimscampi 2020-08-01 05:36:36 +02:00
parent 1349914e7e
commit af93c4a798
3 changed files with 142 additions and 90 deletions

View file

@ -163,6 +163,7 @@
"src/components/syncPlay/playbackPermissionManager.js", "src/components/syncPlay/playbackPermissionManager.js",
"src/components/syncPlay/syncPlayManager.js", "src/components/syncPlay/syncPlayManager.js",
"src/components/syncPlay/timeSyncManager.js", "src/components/syncPlay/timeSyncManager.js",
"src/components/viewContainer.js",
"src/controllers/session/addServer/index.js", "src/controllers/session/addServer/index.js",
"src/controllers/session/forgotPassword/index.js", "src/controllers/session/forgotPassword/index.js",
"src/controllers/session/redeemPassword/index.js", "src/controllers/session/redeemPassword/index.js",
@ -267,6 +268,7 @@
"src/scripts/libraryBrowser.js", "src/scripts/libraryBrowser.js",
"src/scripts/multiDownload.js", "src/scripts/multiDownload.js",
"src/scripts/playlists.js", "src/scripts/playlists.js",
"src/scripts/routes.js",
"src/scripts/settings/appSettings.js", "src/scripts/settings/appSettings.js",
"src/scripts/settings/userSettings.js", "src/scripts/settings/userSettings.js",
"src/scripts/settings/webSettings.js", "src/scripts/settings/webSettings.js",

View file

@ -1,12 +1,11 @@
define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewContainer'], function (browser, dom, layoutManager) { /* eslint-disable indent */
'use strict';
function setControllerClass(view, options) { function setControllerClass(view, options) {
if (options.controllerFactory) { if (options.controllerFactory) {
return Promise.resolve(); return Promise.resolve();
} }
var controllerUrl = view.getAttribute('data-controller'); let controllerUrl = view.getAttribute('data-controller');
if (controllerUrl) { if (controllerUrl) {
if (controllerUrl.indexOf('__plugin/') === 0) { if (controllerUrl.indexOf('__plugin/') === 0) {
@ -14,7 +13,7 @@ define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewConta
} }
controllerUrl = Dashboard.getConfigurationResourceUrl(controllerUrl); controllerUrl = Dashboard.getConfigurationResourceUrl(controllerUrl);
return getRequirePromise([controllerUrl]).then(function (ControllerFactory) { return getRequirePromise([controllerUrl]).then((ControllerFactory) => {
options.controllerFactory = ControllerFactory; options.controllerFactory = ControllerFactory;
}); });
} }
@ -23,35 +22,35 @@ define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewConta
} }
function getRequirePromise(deps) { function getRequirePromise(deps) {
return new Promise(function (resolve, reject) { return new Promise((resolve, reject) => {
require(deps, resolve); require(deps, resolve);
}); });
} }
function loadView(options) { export function loadView(options) {
if (!options.cancel) { if (!options.cancel) {
var selected = selectedPageIndex; const selected = selectedPageIndex;
var previousAnimatable = selected === -1 ? null : allPages[selected]; const previousAnimatable = selected === -1 ? null : allPages[selected];
var pageIndex = selected + 1; let pageIndex = selected + 1;
if (pageIndex >= pageContainerCount) { if (pageIndex >= pageContainerCount) {
pageIndex = 0; pageIndex = 0;
} }
var isPluginpage = options.url.toLowerCase().indexOf('/configurationpage') !== -1; const isPluginpage = options.url.toLowerCase().indexOf('/configurationpage') !== -1;
var newViewInfo = normalizeNewView(options, isPluginpage); const newViewInfo = normalizeNewView(options, isPluginpage);
var newView = newViewInfo.elem; const newView = newViewInfo.elem;
var modulesToLoad = []; const modulesToLoad = [];
return new Promise(function (resolve) { return new Promise((resolve) => {
require(modulesToLoad, function () { require(modulesToLoad, () => {
var currentPage = allPages[pageIndex]; const currentPage = allPages[pageIndex];
if (currentPage) { if (currentPage) {
triggerDestroy(currentPage); triggerDestroy(currentPage);
} }
var view = newView; let view = newView;
if (typeof view == 'string') { if (typeof view == 'string') {
view = document.createElement('div'); view = document.createElement('div');
@ -79,7 +78,7 @@ define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewConta
view.setAttribute('data-type', options.type); view.setAttribute('data-type', options.type);
} }
var properties = []; const properties = [];
if (options.fullscreen) { if (options.fullscreen) {
properties.push('fullscreen'); properties.push('fullscreen');
@ -90,7 +89,7 @@ define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewConta
} }
allPages[pageIndex] = view; allPages[pageIndex] = view;
setControllerClass(view, options).then(function () { setControllerClass(view, options).then(() => {
if (onBeforeChange) { if (onBeforeChange) {
onBeforeChange(view, false, options); onBeforeChange(view, false, options);
} }
@ -125,28 +124,28 @@ define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewConta
html = replaceAll(html, '<\/script>--\x3e', '<\/script>'); html = replaceAll(html, '<\/script>--\x3e', '<\/script>');
} }
var wrapper = document.createElement('div'); const wrapper = document.createElement('div');
wrapper.innerHTML = html; wrapper.innerHTML = html;
return wrapper.querySelector('div[data-role="page"]'); return wrapper.querySelector('div[data-role="page"]');
} }
function normalizeNewView(options, isPluginpage) { function normalizeNewView(options, isPluginpage) {
var viewHtml = options.view; const viewHtml = options.view;
if (viewHtml.indexOf('data-role="page"') === -1) { if (viewHtml.indexOf('data-role="page"') === -1) {
return viewHtml; return viewHtml;
} }
var hasScript = viewHtml.indexOf('<script') !== -1; let hasScript = viewHtml.indexOf('<script') !== -1;
var elem = parseHtml(viewHtml, hasScript); const elem = parseHtml(viewHtml, hasScript);
if (hasScript) { if (hasScript) {
hasScript = elem.querySelector('script') != null; hasScript = elem.querySelector('script') != null;
} }
var hasjQuery = false; let hasjQuery = false;
var hasjQuerySelect = false; let hasjQuerySelect = false;
var hasjQueryChecked = false; let hasjQueryChecked = false;
if (isPluginpage) { if (isPluginpage) {
hasjQuery = viewHtml.indexOf('jQuery') != -1 || viewHtml.indexOf('$(') != -1 || viewHtml.indexOf('$.') != -1; hasjQuery = viewHtml.indexOf('jQuery') != -1 || viewHtml.indexOf('$(') != -1 || viewHtml.indexOf('$.') != -1;
@ -164,7 +163,7 @@ define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewConta
} }
function beforeAnimate(allPages, newPageIndex, oldPageIndex) { function beforeAnimate(allPages, newPageIndex, oldPageIndex) {
for (var index = 0, length = allPages.length; index < length; index++) { for (let index = 0, length = allPages.length; index < length; index++) {
if (newPageIndex !== index && oldPageIndex !== index) { if (newPageIndex !== index && oldPageIndex !== index) {
allPages[index].classList.add('hide'); allPages[index].classList.add('hide');
} }
@ -172,33 +171,33 @@ define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewConta
} }
function afterAnimate(allPages, newPageIndex) { function afterAnimate(allPages, newPageIndex) {
for (var index = 0, length = allPages.length; index < length; index++) { for (let index = 0, length = allPages.length; index < length; index++) {
if (newPageIndex !== index) { if (newPageIndex !== index) {
allPages[index].classList.add('hide'); allPages[index].classList.add('hide');
} }
} }
} }
function setOnBeforeChange(fn) { export function setOnBeforeChange(fn) {
onBeforeChange = fn; onBeforeChange = fn;
} }
function tryRestoreView(options) { export function tryRestoreView(options) {
var url = options.url; const url = options.url;
var index = currentUrls.indexOf(url); const index = currentUrls.indexOf(url);
if (index !== -1) { if (index !== -1) {
var animatable = allPages[index]; const animatable = allPages[index];
var view = animatable; const view = animatable;
if (view) { if (view) {
if (options.cancel) { if (options.cancel) {
return; return;
} }
var selected = selectedPageIndex; const selected = selectedPageIndex;
var previousAnimatable = selected === -1 ? null : allPages[selected]; const previousAnimatable = selected === -1 ? null : allPages[selected];
return setControllerClass(view, options).then(function () { return setControllerClass(view, options).then(() => {
if (onBeforeChange) { if (onBeforeChange) {
onBeforeChange(view, true, options); onBeforeChange(view, true, options);
} }
@ -228,25 +227,28 @@ define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewConta
view.dispatchEvent(new CustomEvent('viewdestroy', {})); view.dispatchEvent(new CustomEvent('viewdestroy', {}));
} }
function reset() { export function reset() {
allPages = []; allPages = [];
currentUrls = []; currentUrls = [];
mainAnimatedPages.innerHTML = ''; mainAnimatedPages.innerHTML = '';
selectedPageIndex = -1; selectedPageIndex = -1;
} }
var onBeforeChange; let onBeforeChange;
var mainAnimatedPages = document.querySelector('.mainAnimatedPages'); const mainAnimatedPages = document.querySelector('.mainAnimatedPages');
var allPages = []; let allPages = [];
var currentUrls = []; let currentUrls = [];
var pageContainerCount = 3; const pageContainerCount = 3;
var selectedPageIndex = -1; let selectedPageIndex = -1;
reset(); reset();
mainAnimatedPages.classList.remove('hide'); mainAnimatedPages.classList.remove('hide');
return {
/* eslint-enable indent */
export default {
loadView: loadView, loadView: loadView,
tryRestoreView: tryRestoreView, tryRestoreView: tryRestoreView,
reset: reset, reset: reset,
setOnBeforeChange: setOnBeforeChange setOnBeforeChange: setOnBeforeChange
}; };
});

View file

@ -1,18 +1,21 @@
define([ import 'emby-button';
'jQuery', import 'emby-input';
'emby-button', import 'scripts/livetvcomponents';
'emby-input', import 'paper-icon-button-light';
'scripts/livetvcomponents', import 'emby-itemscontainer';
'paper-icon-button-light', import 'emby-collapse';
'emby-itemscontainer', import 'emby-select';
'emby-collapse', import 'livetvcss';
'emby-select', import 'emby-checkbox';
'livetvcss', import 'emby-slider';
'emby-checkbox', import 'listViewStyle';
'emby-slider', import 'dashboardcss';
'listViewStyle', import 'detailtablecss';
'dashboardcss',
'detailtablecss'], function () { /* eslint-disable indent */
console.groupCollapsed('defining core routes');
function defineRoute(newRoute) { function defineRoute(newRoute) {
var path = newRoute.alias ? newRoute.alias : newRoute.path; var path = newRoute.alias ? newRoute.alias : newRoute.path;
console.debug('defining route: ' + path); console.debug('defining route: ' + path);
@ -20,8 +23,6 @@ define([
Emby.Page.addRoute(path, newRoute); Emby.Page.addRoute(path, newRoute);
} }
console.debug('defining core routes');
defineRoute({ defineRoute({
alias: '/addserver.html', alias: '/addserver.html',
path: '/controllers/session/addServer/index.html', path: '/controllers/session/addServer/index.html',
@ -30,6 +31,7 @@ define([
startup: true, startup: true,
controller: 'session/addServer/index' controller: 'session/addServer/index'
}); });
defineRoute({ defineRoute({
alias: '/selectserver.html', alias: '/selectserver.html',
path: '/controllers/session/selectServer/index.html', path: '/controllers/session/selectServer/index.html',
@ -39,6 +41,7 @@ define([
controller: 'session/selectServer/index', controller: 'session/selectServer/index',
type: 'selectserver' type: 'selectserver'
}); });
defineRoute({ defineRoute({
alias: '/login.html', alias: '/login.html',
path: '/controllers/session/login/index.html', path: '/controllers/session/login/index.html',
@ -48,6 +51,7 @@ define([
controller: 'session/login/index', controller: 'session/login/index',
type: 'login' type: 'login'
}); });
defineRoute({ defineRoute({
alias: '/forgotpassword.html', alias: '/forgotpassword.html',
path: '/controllers/session/forgotPassword/index.html', path: '/controllers/session/forgotPassword/index.html',
@ -55,6 +59,7 @@ define([
startup: true, startup: true,
controller: 'session/forgotPassword/index' controller: 'session/forgotPassword/index'
}); });
defineRoute({ defineRoute({
alias: '/forgotpasswordpin.html', alias: '/forgotpasswordpin.html',
path: '/controllers/session/redeemPassword/index.html', path: '/controllers/session/redeemPassword/index.html',
@ -68,42 +73,41 @@ define([
alias: '/mypreferencesmenu.html', alias: '/mypreferencesmenu.html',
path: '/controllers/user/menu/index.html', path: '/controllers/user/menu/index.html',
autoFocus: false, autoFocus: false,
transition: 'fade',
controller: 'user/menu/index' controller: 'user/menu/index'
}); });
defineRoute({ defineRoute({
alias: '/myprofile.html', alias: '/myprofile.html',
path: '/controllers/user/profile/index.html', path: '/controllers/user/profile/index.html',
autoFocus: false, autoFocus: false,
transition: 'fade',
controller: 'user/profile/index' controller: 'user/profile/index'
}); });
defineRoute({ defineRoute({
alias: '/mypreferencesdisplay.html', alias: '/mypreferencesdisplay.html',
path: '/controllers/user/display/index.html', path: '/controllers/user/display/index.html',
autoFocus: false, autoFocus: false,
transition: 'fade',
controller: 'user/display/index' controller: 'user/display/index'
}); });
defineRoute({ defineRoute({
alias: '/mypreferenceshome.html', alias: '/mypreferenceshome.html',
path: '/controllers/user/home/index.html', path: '/controllers/user/home/index.html',
autoFocus: false, autoFocus: false,
transition: 'fade',
controller: 'user/home/index' controller: 'user/home/index'
}); });
defineRoute({ defineRoute({
alias: '/mypreferencesplayback.html', alias: '/mypreferencesplayback.html',
path: '/controllers/user/playback/index.html', path: '/controllers/user/playback/index.html',
autoFocus: false, autoFocus: false,
transition: 'fade',
controller: 'user/playback/index' controller: 'user/playback/index'
}); });
defineRoute({ defineRoute({
alias: '/mypreferencessubtitles.html', alias: '/mypreferencessubtitles.html',
path: '/controllers/user/subtitles/index.html', path: '/controllers/user/subtitles/index.html',
autoFocus: false, autoFocus: false,
transition: 'fade',
controller: 'user/subtitles/index' controller: 'user/subtitles/index'
}); });
@ -113,42 +117,49 @@ define([
roles: 'admin', roles: 'admin',
controller: 'dashboard/dashboard' controller: 'dashboard/dashboard'
}); });
defineRoute({ defineRoute({
path: '/dashboardgeneral.html', path: '/dashboardgeneral.html',
controller: 'dashboard/general', controller: 'dashboard/general',
autoFocus: false, autoFocus: false,
roles: 'admin' roles: 'admin'
}); });
defineRoute({ defineRoute({
path: '/networking.html', path: '/networking.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/networking' controller: 'dashboard/networking'
}); });
defineRoute({ defineRoute({
path: '/devices.html', path: '/devices.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/devices/devices' controller: 'dashboard/devices/devices'
}); });
defineRoute({ defineRoute({
path: '/device.html', path: '/device.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/devices/device' controller: 'dashboard/devices/device'
}); });
defineRoute({ defineRoute({
path: '/dlnaprofile.html', path: '/dlnaprofile.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/dlna/profile' controller: 'dashboard/dlna/profile'
}); });
defineRoute({ defineRoute({
path: '/dlnaprofiles.html', path: '/dlnaprofiles.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/dlna/profiles' controller: 'dashboard/dlna/profiles'
}); });
defineRoute({ defineRoute({
alias: '/addplugin.html', alias: '/addplugin.html',
path: '/controllers/dashboard/plugins/add/index.html', path: '/controllers/dashboard/plugins/add/index.html',
@ -156,52 +167,61 @@ define([
roles: 'admin', roles: 'admin',
controller: 'dashboard/plugins/add/index' controller: 'dashboard/plugins/add/index'
}); });
defineRoute({ defineRoute({
path: '/library.html', path: '/library.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/mediaLibrary' controller: 'dashboard/mediaLibrary'
}); });
defineRoute({ defineRoute({
path: '/librarydisplay.html', path: '/librarydisplay.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/librarydisplay' controller: 'dashboard/librarydisplay'
}); });
defineRoute({ defineRoute({
path: '/dlnasettings.html', path: '/dlnasettings.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/dlna/settings' controller: 'dashboard/dlna/settings'
}); });
defineRoute({ defineRoute({
path: '/edititemmetadata.html', path: '/edititemmetadata.html',
controller: 'edititemmetadata', controller: 'edititemmetadata',
autoFocus: false autoFocus: false
}); });
defineRoute({ defineRoute({
path: '/encodingsettings.html', path: '/encodingsettings.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/encodingsettings' controller: 'dashboard/encodingsettings'
}); });
defineRoute({ defineRoute({
path: '/log.html', path: '/log.html',
roles: 'admin', roles: 'admin',
controller: 'dashboard/logs' controller: 'dashboard/logs'
}); });
defineRoute({ defineRoute({
path: '/metadataimages.html', path: '/metadataimages.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/metadataImages' controller: 'dashboard/metadataImages'
}); });
defineRoute({ defineRoute({
path: '/metadatanfo.html', path: '/metadatanfo.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/metadatanfo' controller: 'dashboard/metadatanfo'
}); });
defineRoute({ defineRoute({
alias: '/notificationsetting.html', alias: '/notificationsetting.html',
path: '/controllers/dashboard/notifications/notification/index.html', path: '/controllers/dashboard/notifications/notification/index.html',
@ -209,6 +229,7 @@ define([
roles: 'admin', roles: 'admin',
controller: 'dashboard/notifications/notification/index' controller: 'dashboard/notifications/notification/index'
}); });
defineRoute({ defineRoute({
alias: '/notificationsettings.html', alias: '/notificationsettings.html',
path: '/controllers/dashboard/notifications/notifications/index.html', path: '/controllers/dashboard/notifications/notifications/index.html',
@ -216,12 +237,14 @@ define([
autoFocus: false, autoFocus: false,
roles: 'admin' roles: 'admin'
}); });
defineRoute({ defineRoute({
path: '/playbackconfiguration.html', path: '/playbackconfiguration.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/playback' controller: 'dashboard/playback'
}); });
defineRoute({ defineRoute({
alias: '/availableplugins.html', alias: '/availableplugins.html',
path: '/controllers/dashboard/plugins/available/index.html', path: '/controllers/dashboard/plugins/available/index.html',
@ -229,6 +252,7 @@ define([
roles: 'admin', roles: 'admin',
controller: 'dashboard/plugins/available/index' controller: 'dashboard/plugins/available/index'
}); });
defineRoute({ defineRoute({
alias: '/repositories.html', alias: '/repositories.html',
path: '/controllers/dashboard/plugins/repositories/index.html', path: '/controllers/dashboard/plugins/repositories/index.html',
@ -241,67 +265,72 @@ define([
path: '/home.html', path: '/home.html',
autoFocus: false, autoFocus: false,
controller: 'home', controller: 'home',
transition: 'fade',
type: 'home' type: 'home'
}); });
defineRoute({ defineRoute({
path: '/search.html', path: '/search.html',
controller: 'searchpage' controller: 'searchpage'
}); });
defineRoute({ defineRoute({
path: '/list.html', path: '/list.html',
autoFocus: false, autoFocus: false,
controller: 'list', controller: 'list'
transition: 'fade'
}); });
defineRoute({ defineRoute({
alias: '/details', alias: '/details',
path: '/controllers/itemDetails/index.html', path: '/controllers/itemDetails/index.html',
controller: 'itemDetails/index', controller: 'itemDetails/index',
autoFocus: false, autoFocus: false
transition: 'fade'
}); });
defineRoute({ defineRoute({
path: '/livetv.html', path: '/livetv.html',
controller: 'livetv/livetvsuggested', controller: 'livetv/livetvsuggested',
autoFocus: false, autoFocus: false
transition: 'fade'
}); });
defineRoute({ defineRoute({
path: '/livetvguideprovider.html', path: '/livetvguideprovider.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'livetvguideprovider' controller: 'livetvguideprovider'
}); });
defineRoute({ defineRoute({
path: '/livetvsettings.html', path: '/livetvsettings.html',
autoFocus: false, autoFocus: false,
controller: 'livetvsettings' controller: 'livetvsettings'
}); });
defineRoute({ defineRoute({
path: '/livetvstatus.html', path: '/livetvstatus.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'livetvstatus' controller: 'livetvstatus'
}); });
defineRoute({ defineRoute({
path: '/livetvtuner.html', path: '/livetvtuner.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'livetvtuner' controller: 'livetvtuner'
}); });
defineRoute({ defineRoute({
path: '/movies.html', path: '/movies.html',
autoFocus: false, autoFocus: false,
controller: 'movies/moviesrecommended', controller: 'movies/moviesrecommended'
transition: 'fade'
}); });
defineRoute({ defineRoute({
path: '/music.html', path: '/music.html',
controller: 'music/musicrecommended', controller: 'music/musicrecommended',
autoFocus: false, autoFocus: false
transition: 'fade'
}); });
defineRoute({ defineRoute({
alias: '/installedplugins.html', alias: '/installedplugins.html',
path: '/controllers/dashboard/plugins/installed/index.html', path: '/controllers/dashboard/plugins/installed/index.html',
@ -309,41 +338,46 @@ define([
roles: 'admin', roles: 'admin',
controller: 'dashboard/plugins/installed/index' controller: 'dashboard/plugins/installed/index'
}); });
defineRoute({ defineRoute({
path: '/scheduledtask.html', path: '/scheduledtask.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/scheduledtasks/scheduledtask' controller: 'dashboard/scheduledtasks/scheduledtask'
}); });
defineRoute({ defineRoute({
path: '/scheduledtasks.html', path: '/scheduledtasks.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/scheduledtasks/scheduledtasks' controller: 'dashboard/scheduledtasks/scheduledtasks'
}); });
defineRoute({ defineRoute({
path: '/serveractivity.html', path: '/serveractivity.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/serveractivity' controller: 'dashboard/serveractivity'
}); });
defineRoute({ defineRoute({
path: '/apikeys.html', path: '/apikeys.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/apikeys' controller: 'dashboard/apikeys'
}); });
defineRoute({ defineRoute({
path: '/streamingsettings.html', path: '/streamingsettings.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/streaming' controller: 'dashboard/streaming'
}); });
defineRoute({ defineRoute({
path: '/tv.html', path: '/tv.html',
autoFocus: false, autoFocus: false,
controller: 'shows/tvrecommended', controller: 'shows/tvrecommended'
transition: 'fade'
}); });
defineRoute({ defineRoute({
@ -352,29 +386,34 @@ define([
roles: 'admin', roles: 'admin',
controller: 'dashboard/users/useredit' controller: 'dashboard/users/useredit'
}); });
defineRoute({ defineRoute({
path: '/userlibraryaccess.html', path: '/userlibraryaccess.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/users/userlibraryaccess' controller: 'dashboard/users/userlibraryaccess'
}); });
defineRoute({ defineRoute({
path: '/usernew.html', path: '/usernew.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/users/usernew' controller: 'dashboard/users/usernew'
}); });
defineRoute({ defineRoute({
path: '/userparentalcontrol.html', path: '/userparentalcontrol.html',
autoFocus: false, autoFocus: false,
roles: 'admin', roles: 'admin',
controller: 'dashboard/users/userparentalcontrol' controller: 'dashboard/users/userparentalcontrol'
}); });
defineRoute({ defineRoute({
path: '/userpassword.html', path: '/userpassword.html',
autoFocus: false, autoFocus: false,
controller: 'dashboard/users/userpasswordpage' controller: 'dashboard/users/userpasswordpage'
}); });
defineRoute({ defineRoute({
path: '/userprofiles.html', path: '/userprofiles.html',
autoFocus: false, autoFocus: false,
@ -389,6 +428,7 @@ define([
anonymous: true, anonymous: true,
controller: 'wizard/remote/index' controller: 'wizard/remote/index'
}); });
defineRoute({ defineRoute({
alias: '/wizardfinish.html', alias: '/wizardfinish.html',
path: '/controllers/wizard/finish/index.html', path: '/controllers/wizard/finish/index.html',
@ -396,12 +436,14 @@ define([
anonymous: true, anonymous: true,
controller: 'wizard/finish/index' controller: 'wizard/finish/index'
}); });
defineRoute({ defineRoute({
path: '/wizardlibrary.html', path: '/wizardlibrary.html',
autoFocus: false, autoFocus: false,
anonymous: true, anonymous: true,
controller: 'dashboard/mediaLibrary' controller: 'dashboard/mediaLibrary'
}); });
defineRoute({ defineRoute({
alias: '/wizardsettings.html', alias: '/wizardsettings.html',
path: '/controllers/wizard/settings/index.html', path: '/controllers/wizard/settings/index.html',
@ -409,6 +451,7 @@ define([
anonymous: true, anonymous: true,
controller: 'wizard/settings/index' controller: 'wizard/settings/index'
}); });
defineRoute({ defineRoute({
alias: '/wizardstart.html', alias: '/wizardstart.html',
path: '/controllers/wizard/start/index.html', path: '/controllers/wizard/start/index.html',
@ -416,6 +459,7 @@ define([
anonymous: true, anonymous: true,
controller: 'wizard/start/index' controller: 'wizard/start/index'
}); });
defineRoute({ defineRoute({
alias: '/wizarduser.html', alias: '/wizarduser.html',
path: '/controllers/wizard/user/index.html', path: '/controllers/wizard/user/index.html',
@ -427,7 +471,6 @@ define([
defineRoute({ defineRoute({
alias: '/video', alias: '/video',
path: '/controllers/playback/video/index.html', path: '/controllers/playback/video/index.html',
transition: 'fade',
controller: 'playback/video/index', controller: 'playback/video/index',
autoFocus: false, autoFocus: false,
type: 'video-osd', type: 'video-osd',
@ -435,16 +478,17 @@ define([
fullscreen: true, fullscreen: true,
enableMediaControl: false enableMediaControl: false
}); });
defineRoute({ defineRoute({
alias: '/queue', alias: '/queue',
path: '/controllers/playback/queue/index.html', path: '/controllers/playback/queue/index.html',
controller: 'playback/queue/index', controller: 'playback/queue/index',
autoFocus: false, autoFocus: false,
transition: 'fade',
fullscreen: true, fullscreen: true,
supportsThemeMedia: true, supportsThemeMedia: true,
enableMediaControl: false enableMediaControl: false
}); });
defineRoute({ defineRoute({
path: '/configurationpage', path: '/configurationpage',
autoFocus: false, autoFocus: false,
@ -458,9 +502,13 @@ define([
isDefaultRoute: true, isDefaultRoute: true,
autoFocus: false autoFocus: false
}); });
defineRoute({ defineRoute({
path: '/index.html', path: '/index.html',
autoFocus: false, autoFocus: false,
isDefaultRoute: true isDefaultRoute: true
}); });
});
console.groupEnd('defining core routes');
/* eslint-enable indent */