diff --git a/src/components/polyfills/objectassign.js b/src/components/polyfills/objectassign.js deleted file mode 100644 index 85f55aa144..0000000000 --- a/src/components/polyfills/objectassign.js +++ /dev/null @@ -1,24 +0,0 @@ -if (typeof Object.assign != 'function') { - (function () { - Object.assign = function (target) { - 'use strict'; - if (target === undefined || target === null) { - throw new TypeError('Cannot convert undefined or null to object'); - } - - var output = Object(target); - for (var index = 1; index < arguments.length; index++) { - var source = arguments[index]; - if (source !== undefined && source !== null) { - for (var nextKey in source) { - // eslint-disable-next-line no-prototype-builtins - if (source.hasOwnProperty(nextKey)) { - output[nextKey] = source[nextKey]; - } - } - } - } - return output; - }; - })(); -} diff --git a/src/controllers/apikeys.js b/src/controllers/dashboard/apikeys.js similarity index 100% rename from src/controllers/apikeys.js rename to src/controllers/dashboard/apikeys.js diff --git a/src/controllers/device.js b/src/controllers/dashboard/devices/device.js similarity index 100% rename from src/controllers/device.js rename to src/controllers/dashboard/devices/device.js diff --git a/src/controllers/devices.js b/src/controllers/dashboard/devices/devices.js similarity index 100% rename from src/controllers/devices.js rename to src/controllers/dashboard/devices/devices.js diff --git a/src/controllers/dlnaprofile.js b/src/controllers/dashboard/dlna/dlnaprofile.js similarity index 100% rename from src/controllers/dlnaprofile.js rename to src/controllers/dashboard/dlna/dlnaprofile.js diff --git a/src/controllers/dlnaprofiles.js b/src/controllers/dashboard/dlna/dlnaprofiles.js similarity index 100% rename from src/controllers/dlnaprofiles.js rename to src/controllers/dashboard/dlna/dlnaprofiles.js diff --git a/src/controllers/dlnasettings.js b/src/controllers/dashboard/dlna/dlnasettings.js similarity index 100% rename from src/controllers/dlnasettings.js rename to src/controllers/dashboard/dlna/dlnasettings.js diff --git a/src/controllers/encodingsettings.js b/src/controllers/dashboard/encodingsettings.js similarity index 100% rename from src/controllers/encodingsettings.js rename to src/controllers/dashboard/encodingsettings.js diff --git a/src/controllers/librarydisplay.js b/src/controllers/dashboard/librarydisplay.js similarity index 100% rename from src/controllers/librarydisplay.js rename to src/controllers/dashboard/librarydisplay.js diff --git a/src/controllers/medialibrarypage.js b/src/controllers/dashboard/medialibrarypage.js similarity index 100% rename from src/controllers/medialibrarypage.js rename to src/controllers/dashboard/medialibrarypage.js diff --git a/src/controllers/metadataimagespage.js b/src/controllers/dashboard/metadataimagespage.js similarity index 100% rename from src/controllers/metadataimagespage.js rename to src/controllers/dashboard/metadataimagespage.js diff --git a/src/controllers/metadatanfo.js b/src/controllers/dashboard/metadatanfo.js similarity index 100% rename from src/controllers/metadatanfo.js rename to src/controllers/dashboard/metadatanfo.js diff --git a/src/controllers/playbackconfiguration.js b/src/controllers/dashboard/playbackconfiguration.js similarity index 100% rename from src/controllers/playbackconfiguration.js rename to src/controllers/dashboard/playbackconfiguration.js diff --git a/src/controllers/serveractivity.js b/src/controllers/dashboard/serveractivity.js similarity index 100% rename from src/controllers/serveractivity.js rename to src/controllers/dashboard/serveractivity.js diff --git a/src/controllers/streamingsettings.js b/src/controllers/dashboard/streamingsettings.js similarity index 100% rename from src/controllers/streamingsettings.js rename to src/controllers/dashboard/streamingsettings.js diff --git a/src/components/polyfills/focusPreventScroll.js b/src/legacy/focusPreventScroll.js similarity index 100% rename from src/components/polyfills/focusPreventScroll.js rename to src/legacy/focusPreventScroll.js diff --git a/src/components/navdrawer/navdrawer.css b/src/libraries/navdrawer/navdrawer.css similarity index 100% rename from src/components/navdrawer/navdrawer.css rename to src/libraries/navdrawer/navdrawer.css diff --git a/src/components/navdrawer/navdrawer.js b/src/libraries/navdrawer/navdrawer.js similarity index 100% rename from src/components/navdrawer/navdrawer.js rename to src/libraries/navdrawer/navdrawer.js diff --git a/src/components/screensavermanager.js b/src/libraries/screensavermanager.js similarity index 100% rename from src/components/screensavermanager.js rename to src/libraries/screensavermanager.js diff --git a/src/components/scroller.js b/src/libraries/scroller.js similarity index 100% rename from src/components/scroller.js rename to src/libraries/scroller.js diff --git a/src/components/visibleinviewport.js b/src/libraries/visibleinviewport.js similarity index 100% rename from src/components/visibleinviewport.js rename to src/libraries/visibleinviewport.js diff --git a/src/components/alphanumericshortcuts/alphanumericshortcuts.js b/src/scripts/alphanumericshortcuts.js similarity index 100% rename from src/components/alphanumericshortcuts/alphanumericshortcuts.js rename to src/scripts/alphanumericshortcuts.js diff --git a/src/components/dom.js b/src/scripts/dom.js similarity index 100% rename from src/components/dom.js rename to src/scripts/dom.js diff --git a/src/components/filesystem.js b/src/scripts/filesystem.js similarity index 100% rename from src/components/filesystem.js rename to src/scripts/filesystem.js diff --git a/src/components/input/gamepadtokey.js b/src/scripts/gamepadtokey.js similarity index 100% rename from src/components/input/gamepadtokey.js rename to src/scripts/gamepadtokey.js diff --git a/src/components/input/keyboardnavigation.js b/src/scripts/keyboardnavigation.js similarity index 98% rename from src/components/input/keyboardnavigation.js rename to src/scripts/keyboardnavigation.js index 3c80063f4f..a95b750b1e 100644 --- a/src/components/input/keyboardnavigation.js +++ b/src/scripts/keyboardnavigation.js @@ -155,7 +155,7 @@ export function enable() { function attachGamepadScript(e) { console.log("Gamepad connected! Attaching gamepadtokey.js script"); window.removeEventListener("gamepadconnected", attachGamepadScript); - require(["components/input/gamepadtokey"]); + require(["scripts/gamepadtokey"]); } // No need to check for gamepads manually at load time, the eventhandler will be fired for that diff --git a/src/components/input/mouseManager.js b/src/scripts/mouseManager.js similarity index 100% rename from src/components/input/mouseManager.js rename to src/scripts/mouseManager.js diff --git a/src/scripts/routes.js b/src/scripts/routes.js index 9c3db58a7f..72c67e5b71 100644 --- a/src/scripts/routes.js +++ b/src/scripts/routes.js @@ -23,6 +23,35 @@ define([ console.debug("defining core routes"); + defineRoute({ + path: "/addserver.html", + autoFocus: false, + anonymous: true, + startup: true, + controller: "auth/addserver" + }); + defineRoute({ + path: "/selectserver.html", + autoFocus: false, + anonymous: true, + startup: true, + controller: "auth/selectserver", + type: "selectserver" + }); + defineRoute({ + path: "/forgotpassword.html", + anonymous: true, + startup: true, + controller: "auth/forgotpassword" + }); + defineRoute({ + path: "/forgotpasswordpin.html", + autoFocus: false, + anonymous: true, + startup: true, + controller: "auth/forgotpasswordpin" + }); + defineRoute({ path: "/addplugin.html", autoFocus: false, @@ -41,13 +70,6 @@ define([ transition: "fade", controller: "user/profile" }); - defineRoute({ - path: "/addserver.html", - autoFocus: false, - anonymous: true, - startup: true, - controller: "auth/addserver" - }); defineRoute({ path: "/mypreferencesdisplay.html", autoFocus: false, @@ -95,31 +117,31 @@ define([ path: "/devices.html", autoFocus: false, roles: "admin", - controller: "devices" + controller: "dashboard/devices/devices" }); defineRoute({ path: "/device.html", autoFocus: false, roles: "admin", - controller: "device" + controller: "dashboard/devices/device" }); defineRoute({ path: "/dlnaprofile.html", autoFocus: false, roles: "admin", - controller: "dlnaprofile" + controller: "dashboard/dlna/dlnaprofile" }); defineRoute({ path: "/dlnaprofiles.html", autoFocus: false, roles: "admin", - controller: "dlnaprofiles" + controller: "dashboard/dlna/dlnaprofiles" }); defineRoute({ path: "/dlnasettings.html", autoFocus: false, roles: "admin", - controller: "dlnasettings" + controller: "dashboard/dlna/dlnasettings" }); defineRoute({ path: "/edititemmetadata.html", @@ -130,20 +152,7 @@ define([ path: "/encodingsettings.html", autoFocus: false, roles: "admin", - controller: "encodingsettings" - }); - defineRoute({ - path: "/forgotpassword.html", - anonymous: true, - startup: true, - controller: "auth/forgotpassword" - }); - defineRoute({ - path: "/forgotpasswordpin.html", - autoFocus: false, - anonymous: true, - startup: true, - controller: "auth/forgotpasswordpin" + controller: "dashboard/encodingsettings" }); defineRoute({ path: "/home.html", @@ -158,11 +167,6 @@ define([ controller: "list", transition: "fade" }); - defineRoute({ - path: "/index.html", - autoFocus: false, - isDefaultRoute: true - }); defineRoute({ path: "/itemdetails.html", controller: "itemdetailpage", @@ -173,19 +177,13 @@ define([ path: "/library.html", autoFocus: false, roles: "admin", - controller: "medialibrarypage" + controller: "dashboard/medialibrarypage" }); defineRoute({ path: "/librarydisplay.html", autoFocus: false, roles: "admin", - controller: "librarydisplay" - }); - defineRoute({ - path: "/librarysettings.html", - autoFocus: false, - roles: "admin", - controller: "librarysettings" + controller: "dashboard/librarydisplay" }); defineRoute({ path: "/livetv.html", @@ -233,13 +231,13 @@ define([ path: "/metadataimages.html", autoFocus: false, roles: "admin", - controller: "metadataimagespage" + controller: "dashboard/metadataimagespage" }); defineRoute({ path: "/metadatanfo.html", autoFocus: false, roles: "admin", - controller: "metadatanfo" + controller: "dashboard/metadatanfo" }); defineRoute({ path: "/movies.html", @@ -265,20 +263,11 @@ define([ autoFocus: false, roles: "admin" }); - defineRoute({ - path: "/nowplaying.html", - controller: "playback/nowplaying", - autoFocus: false, - transition: "fade", - fullscreen: true, - supportsThemeMedia: true, - enableMediaControl: false - }); defineRoute({ path: "/playbackconfiguration.html", autoFocus: false, roles: "admin", - controller: "playbackconfiguration" + controller: "dashboard/playbackconfiguration" }); defineRoute({ path: "/availableplugins.html", @@ -308,31 +297,23 @@ define([ path: "/search.html", controller: "searchpage" }); - defineRoute({ - path: "/selectserver.html", - autoFocus: false, - anonymous: true, - startup: true, - controller: "auth/selectserver", - type: "selectserver" - }); defineRoute({ path: "/serveractivity.html", autoFocus: false, roles: "admin", - controller: "serveractivity" + controller: "dashboard/serveractivity" }); defineRoute({ path: "/apikeys.html", autoFocus: false, roles: "admin", - controller: "apikeys" + controller: "dashboard/apikeys" }); defineRoute({ path: "/streamingsettings.html", autoFocus: false, roles: "admin", - controller: "streamingsettings" + controller: "dashboard/streamingsettings" }); defineRoute({ path: "/tv.html", @@ -423,6 +404,15 @@ define([ fullscreen: true, enableMediaControl: false }); + defineRoute({ + path: "/nowplaying.html", + controller: "playback/nowplaying", + autoFocus: false, + transition: "fade", + fullscreen: true, + supportsThemeMedia: true, + enableMediaControl: false + }); defineRoute({ path: "/configurationpage", autoFocus: false, @@ -436,4 +426,9 @@ define([ isDefaultRoute: true, autoFocus: false }); + defineRoute({ + path: "/index.html", + autoFocus: false, + isDefaultRoute: true + }); }); diff --git a/src/scripts/site.js b/src/scripts/site.js index 9641409eba..5558de36e4 100644 --- a/src/scripts/site.js +++ b/src/scripts/site.js @@ -371,8 +371,9 @@ var AppInfo = {}; function initRequireWithBrowser(browser) { var bowerPath = getBowerPath(); var componentsPath = getComponentsPath(); + var scriptsPath = getScriptsPath(); - define("filesystem", [componentsPath + "/filesystem"], returnFirstDependency); + define("filesystem", [scriptsPath + "/filesystem"], returnFirstDependency); if (window.IntersectionObserver && !browser.edge) { define("lazyLoader", [componentsPath + "/lazyloader/lazyloader-intersectionobserver"], returnFirstDependency); @@ -425,9 +426,6 @@ var AppInfo = {}; if (!window.fetch) { promises.push(require(["fetch"])); } - if ("function" != typeof Object.assign) { - promises.push(require(["objectassign"])); - } Promise.all(promises).then(function () { createConnectionManager().then(function () { @@ -657,7 +655,7 @@ var AppInfo = {}; medialibraryeditor: componentsPath + "/medialibraryeditor/medialibraryeditor", imageoptionseditor: componentsPath + "/imageoptionseditor/imageoptionseditor", apphost: componentsPath + "/apphost", - visibleinviewport: componentsPath + "/visibleinviewport", + visibleinviewport: bowerPath + "/visibleinviewport", qualityoptions: componentsPath + "/qualityoptions", focusManager: componentsPath + "/focusManager", itemHelper: componentsPath + "/itemhelper", @@ -762,8 +760,8 @@ var AppInfo = {}; // TODO remove these libraries // all of these have been modified so we need to fix that first - define("scroller", [componentsPath + "/scroller"], returnFirstDependency); - define("navdrawer", [componentsPath + "/navdrawer/navdrawer"], returnFirstDependency); + define("scroller", [bowerPath + "/scroller"], returnFirstDependency); + define("navdrawer", [bowerPath + "/navdrawer/navdrawer"], returnFirstDependency); define("emby-button", [elementsPath + "/emby-button/emby-button"], returnFirstDependency); define("paper-icon-button-light", [elementsPath + "/emby-button/paper-icon-button-light"], returnFirstDependency); @@ -803,7 +801,7 @@ var AppInfo = {}; define("playerSettingsMenu", [componentsPath + "/playback/playersettingsmenu"], returnFirstDependency); define("playMethodHelper", [componentsPath + "/playback/playmethodhelper"], returnFirstDependency); define("brightnessOsd", [componentsPath + "/playback/brightnessosd"], returnFirstDependency); - define("alphaNumericShortcuts", [componentsPath + "/alphanumericshortcuts/alphanumericshortcuts"], returnFirstDependency); + define("alphaNumericShortcuts", [scriptsPath + "/alphanumericshortcuts"], returnFirstDependency); define("multiSelect", [componentsPath + "/multiselect/multiselect"], returnFirstDependency); define("alphaPicker", [componentsPath + "/alphapicker/alphapicker"], returnFirstDependency); define("tabbedView", [componentsPath + "/tabbedview/tabbedview"], returnFirstDependency); @@ -825,7 +823,7 @@ var AppInfo = {}; define("itemContextMenu", [componentsPath + "/itemcontextmenu"], returnFirstDependency); define("imageEditor", [componentsPath + "/imageeditor/imageeditor"], returnFirstDependency); define("imageDownloader", [componentsPath + "/imagedownloader/imagedownloader"], returnFirstDependency); - define("dom", [componentsPath + "/dom"], returnFirstDependency); + define("dom", [scriptsPath + "/dom"], returnFirstDependency); define("playerStats", [componentsPath + "/playerstats/playerstats"], returnFirstDependency); define("searchFields", [componentsPath + "/search/searchfields"], returnFirstDependency); define("searchResults", [componentsPath + "/search/searchresults"], returnFirstDependency); @@ -855,8 +853,7 @@ var AppInfo = {}; return viewManager; }); define("slideshow", [componentsPath + "/slideshow/slideshow"], returnFirstDependency); - define("objectassign", [componentsPath + "/polyfills/objectassign"], returnFirstDependency); - define("focusPreventScroll", [componentsPath + "/polyfills/focusPreventScroll"], returnFirstDependency); + define("focusPreventScroll", ["legacy/focusPreventScroll"], returnFirstDependency); define("userdataButtons", [componentsPath + "/userdatabuttons/userdatabuttons"], returnFirstDependency); define("listView", [componentsPath + "/listview/listview"], returnFirstDependency); define("indicators", [componentsPath + "/indicators/indicators"], returnFirstDependency); @@ -874,8 +871,8 @@ var AppInfo = {}; define("dialogHelper", [componentsPath + "/dialogHelper/dialogHelper"], returnFirstDependency); define("serverNotifications", [componentsPath + "/serverNotifications"], returnFirstDependency); define("skinManager", [componentsPath + "/skinManager"], returnFirstDependency); - define("keyboardnavigation", [componentsPath + "/input/keyboardnavigation"], returnFirstDependency); - define("mouseManager", [componentsPath + "/input/mouseManager"], returnFirstDependency); + define("keyboardnavigation", [scriptsPath + "/keyboardnavigation"], returnFirstDependency); + define("mouseManager", [scriptsPath + "/mouseManager"], returnFirstDependency); define("scrollManager", [componentsPath + "/scrollManager"], returnFirstDependency); define("autoFocuser", [componentsPath + "/autoFocuser"], returnFirstDependency); define("connectionManager", [], function () {