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

Merge pull request #1718 from MrTimscampi/yaes6

Migrate routes.js and mouseManager to ES6
This commit is contained in:
Anthony Lavado 2020-08-02 08:28:28 -07:00 committed by GitHub
commit ab9398344f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 218 additions and 168 deletions

View file

@ -166,6 +166,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",
@ -269,8 +270,10 @@
"src/scripts/inputManager.js", "src/scripts/inputManager.js",
"src/scripts/keyboardNavigation.js", "src/scripts/keyboardNavigation.js",
"src/scripts/libraryBrowser.js", "src/scripts/libraryBrowser.js",
"src/scripts/mouseManager.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

@ -205,7 +205,7 @@ import 'css!./style';
/* eslint-enable indent */ /* eslint-enable indent */
export default { export default {
serLazyImage: setLazyImage, setLazyImage: setLazyImage,
fillImages: fillImages, fillImages: fillImages,
fillImage: fillImage, fillImage: fillImage,
lazyImage: lazyImage, lazyImage: lazyImage,

View file

@ -1,12 +1,12 @@
define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewContainer'], function (browser, dom, layoutManager) { import 'css!components/viewManager/viewContainer';
'use strict'; /* eslint-disable indent */
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 +14,7 @@ define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewConta
} }
controllerUrl = Dashboard.getConfigurationResourceUrl(controllerUrl); controllerUrl = Dashboard.getConfigurationResourceUrl(controllerUrl);
return getRequirePromise([controllerUrl]).then(function (ControllerFactory) { return import(controllerUrl).then((ControllerFactory) => {
options.controllerFactory = ControllerFactory; options.controllerFactory = ControllerFactory;
}); });
} }
@ -22,94 +22,85 @@ define(['browser', 'dom', 'layoutManager', 'css!components/viewManager/viewConta
return Promise.resolve(); return Promise.resolve();
} }
function getRequirePromise(deps) { export function loadView(options) {
return new Promise(function (resolve, reject) {
require(deps, resolve);
});
}
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 = [];
return new Promise(function (resolve) { return new Promise((resolve) => {
require(modulesToLoad, function () { const currentPage = allPages[pageIndex];
var 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');
view.innerHTML = newView; view.innerHTML = newView;
} }
view.classList.add('mainAnimatedPage'); view.classList.add('mainAnimatedPage');
if (currentPage) { if (currentPage) {
if (newViewInfo.hasScript && window.$) { if (newViewInfo.hasScript && window.$) {
view = $(view).appendTo(mainAnimatedPages)[0]; view = $(view).appendTo(mainAnimatedPages)[0];
mainAnimatedPages.removeChild(currentPage); mainAnimatedPages.removeChild(currentPage);
} else {
mainAnimatedPages.replaceChild(view, currentPage);
}
} else { } else {
if (newViewInfo.hasScript && window.$) { mainAnimatedPages.replaceChild(view, currentPage);
view = $(view).appendTo(mainAnimatedPages)[0]; }
} else { } else {
mainAnimatedPages.appendChild(view); if (newViewInfo.hasScript && window.$) {
} view = $(view).appendTo(mainAnimatedPages)[0];
} else {
mainAnimatedPages.appendChild(view);
}
}
if (options.type) {
view.setAttribute('data-type', options.type);
}
const properties = [];
if (options.fullscreen) {
properties.push('fullscreen');
}
if (properties.length) {
view.setAttribute('data-properties', properties.join(','));
}
allPages[pageIndex] = view;
setControllerClass(view, options).then(() => {
if (onBeforeChange) {
onBeforeChange(view, false, options);
} }
if (options.type) { beforeAnimate(allPages, pageIndex, selected);
view.setAttribute('data-type', options.type); selectedPageIndex = pageIndex;
currentUrls[pageIndex] = options.url;
if (!options.cancel && previousAnimatable) {
afterAnimate(allPages, pageIndex);
} }
var properties = []; if (window.$) {
$.mobile = $.mobile || {};
if (options.fullscreen) { $.mobile.activePage = view;
properties.push('fullscreen');
} }
if (properties.length) { resolve(view);
view.setAttribute('data-properties', properties.join(','));
}
allPages[pageIndex] = view;
setControllerClass(view, options).then(function () {
if (onBeforeChange) {
onBeforeChange(view, false, options);
}
beforeAnimate(allPages, pageIndex, selected);
selectedPageIndex = pageIndex;
currentUrls[pageIndex] = options.url;
if (!options.cancel && previousAnimatable) {
afterAnimate(allPages, pageIndex);
}
if (window.$) {
$.mobile = $.mobile || {};
$.mobile.activePage = view;
}
resolve(view);
});
}); });
}); });
} }
@ -125,28 +116,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 +155,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 +163,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 +219,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 {
loadView: loadView, /* eslint-enable indent */
tryRestoreView: tryRestoreView,
reset: reset, export default {
setOnBeforeChange: setOnBeforeChange loadView: loadView,
}; tryRestoreView: tryRestoreView,
}); reset: reset,
setOnBeforeChange: setOnBeforeChange
};

View file

@ -1,12 +1,15 @@
define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'dom'], function (inputManager, focusManager, browser, layoutManager, events, dom) { import inputManager from 'inputManager';
'use strict'; import focusManager from 'focusManager';
import browser from 'browser';
import layoutManager from 'layoutManager';
import events from 'events';
import dom from 'dom';
/* eslint-disable indent */
browser = browser.default || browser; const self = {};
var self = {}; let lastMouseInputTime = new Date().getTime();
let isMouseIdle;
var lastMouseInputTime = new Date().getTime();
var isMouseIdle;
function mouseIdleTime() { function mouseIdleTime() {
return new Date().getTime() - lastMouseInputTime; return new Date().getTime() - lastMouseInputTime;
@ -17,14 +20,14 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
} }
function removeIdleClasses() { function removeIdleClasses() {
var classList = document.body.classList; const classList = document.body.classList;
classList.remove('mouseIdle'); classList.remove('mouseIdle');
classList.remove('mouseIdle-tv'); classList.remove('mouseIdle-tv');
} }
function addIdleClasses() { function addIdleClasses() {
var classList = document.body.classList; const classList = document.body.classList;
classList.add('mouseIdle'); classList.add('mouseIdle');
@ -33,7 +36,7 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
} }
} }
function showCursor() { export function showCursor() {
if (isMouseIdle) { if (isMouseIdle) {
isMouseIdle = false; isMouseIdle = false;
removeIdleClasses(); removeIdleClasses();
@ -41,7 +44,7 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
} }
} }
function hideCursor() { export function hideCursor() {
if (!isMouseIdle) { if (!isMouseIdle) {
isMouseIdle = true; isMouseIdle = true;
addIdleClasses(); addIdleClasses();
@ -49,17 +52,17 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
} }
} }
var lastPointerMoveData; let lastPointerMoveData;
function onPointerMove(e) { function onPointerMove(e) {
var eventX = e.screenX; const eventX = e.screenX;
var eventY = e.screenY; const eventY = e.screenY;
// if coord don't exist how could it move // if coord don't exist how could it move
if (typeof eventX === 'undefined' && typeof eventY === 'undefined') { if (typeof eventX === 'undefined' && typeof eventY === 'undefined') {
return; return;
} }
var obj = lastPointerMoveData; const obj = lastPointerMoveData;
if (!obj) { if (!obj) {
lastPointerMoveData = { lastPointerMoveData = {
x: eventX, x: eventX,
@ -83,11 +86,11 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
} }
function onPointerEnter(e) { function onPointerEnter(e) {
var pointerType = e.pointerType || (layoutManager.mobile ? 'touch' : 'mouse'); const pointerType = e.pointerType || (layoutManager.mobile ? 'touch' : 'mouse');
if (pointerType === 'mouse') { if (pointerType === 'mouse') {
if (!isMouseIdle) { if (!isMouseIdle) {
var parent = focusManager.focusableParent(e.target); const parent = focusManager.focusableParent(e.target);
if (parent) { if (parent) {
focusManager.focus(parent); focusManager.focus(parent);
} }
@ -117,7 +120,7 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
} }
} }
var mouseInterval; let mouseInterval;
function startMouseInterval() { function startMouseInterval() {
if (!mouseInterval) { if (!mouseInterval) {
mouseInterval = setInterval(onMouseInterval, 5000); mouseInterval = setInterval(onMouseInterval, 5000);
@ -125,7 +128,7 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
} }
function stopMouseInterval() { function stopMouseInterval() {
var interval = mouseInterval; const interval = mouseInterval;
if (interval) { if (interval) {
clearInterval(interval); clearInterval(interval);
@ -169,8 +172,10 @@ define(['inputManager', 'focusManager', 'browser', 'layoutManager', 'events', 'd
events.on(layoutManager, 'modechange', initMouse); events.on(layoutManager, 'modechange', initMouse);
self.hideCursor = hideCursor; /* eslint-enable indent */
self.showCursor = showCursor;
export default {
hideCursor,
showCursor
};
return self;
});

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 */