From 34c0d6019e9990137f8713f62bcba29ec2157539 Mon Sep 17 00:00:00 2001 From: dkanada Date: Sun, 15 Dec 2019 20:47:47 +0900 Subject: [PATCH] move around half the dashboard controllers to a subdirectory --- .../dashboard.js} | 0 .../general.js} | 0 .../{logpage.js => dashboard/logs.js} | 0 src/controllers/{ => dashboard}/networking.js | 0 .../notifications/notification.js} | 0 .../notifications/notifications.js} | 0 .../plugins/add.js} | 0 .../plugins/available.js} | 0 .../plugins/installed.js} | 0 .../scheduledtasks/scheduledtask.js} | 0 .../scheduledtasks/scheduledtasks.js} | 0 src/scripts/routes.js | 133 +++++++++--------- 12 files changed, 64 insertions(+), 69 deletions(-) rename src/controllers/{dashboardpage.js => dashboard/dashboard.js} (100%) rename src/controllers/{dashboardgeneral.js => dashboard/general.js} (100%) rename src/controllers/{logpage.js => dashboard/logs.js} (100%) rename src/controllers/{ => dashboard}/networking.js (100%) rename src/controllers/{notificationsetting.js => dashboard/notifications/notification.js} (100%) rename src/controllers/{notificationsettings.js => dashboard/notifications/notifications.js} (100%) rename src/controllers/{addpluginpage.js => dashboard/plugins/add.js} (100%) rename src/controllers/{availableplugins.js => dashboard/plugins/available.js} (100%) rename src/controllers/{installedplugins.js => dashboard/plugins/installed.js} (100%) rename src/controllers/{scheduledtaskpage.js => dashboard/scheduledtasks/scheduledtask.js} (100%) rename src/controllers/{scheduledtaskspage.js => dashboard/scheduledtasks/scheduledtasks.js} (100%) diff --git a/src/controllers/dashboardpage.js b/src/controllers/dashboard/dashboard.js similarity index 100% rename from src/controllers/dashboardpage.js rename to src/controllers/dashboard/dashboard.js diff --git a/src/controllers/dashboardgeneral.js b/src/controllers/dashboard/general.js similarity index 100% rename from src/controllers/dashboardgeneral.js rename to src/controllers/dashboard/general.js diff --git a/src/controllers/logpage.js b/src/controllers/dashboard/logs.js similarity index 100% rename from src/controllers/logpage.js rename to src/controllers/dashboard/logs.js diff --git a/src/controllers/networking.js b/src/controllers/dashboard/networking.js similarity index 100% rename from src/controllers/networking.js rename to src/controllers/dashboard/networking.js diff --git a/src/controllers/notificationsetting.js b/src/controllers/dashboard/notifications/notification.js similarity index 100% rename from src/controllers/notificationsetting.js rename to src/controllers/dashboard/notifications/notification.js diff --git a/src/controllers/notificationsettings.js b/src/controllers/dashboard/notifications/notifications.js similarity index 100% rename from src/controllers/notificationsettings.js rename to src/controllers/dashboard/notifications/notifications.js diff --git a/src/controllers/addpluginpage.js b/src/controllers/dashboard/plugins/add.js similarity index 100% rename from src/controllers/addpluginpage.js rename to src/controllers/dashboard/plugins/add.js diff --git a/src/controllers/availableplugins.js b/src/controllers/dashboard/plugins/available.js similarity index 100% rename from src/controllers/availableplugins.js rename to src/controllers/dashboard/plugins/available.js diff --git a/src/controllers/installedplugins.js b/src/controllers/dashboard/plugins/installed.js similarity index 100% rename from src/controllers/installedplugins.js rename to src/controllers/dashboard/plugins/installed.js diff --git a/src/controllers/scheduledtaskpage.js b/src/controllers/dashboard/scheduledtasks/scheduledtask.js similarity index 100% rename from src/controllers/scheduledtaskpage.js rename to src/controllers/dashboard/scheduledtasks/scheduledtask.js diff --git a/src/controllers/scheduledtaskspage.js b/src/controllers/dashboard/scheduledtasks/scheduledtasks.js similarity index 100% rename from src/controllers/scheduledtaskspage.js rename to src/controllers/dashboard/scheduledtasks/scheduledtasks.js diff --git a/src/scripts/routes.js b/src/scripts/routes.js index a72e7e0566..c4e7dbb58a 100644 --- a/src/scripts/routes.js +++ b/src/scripts/routes.js @@ -16,28 +16,14 @@ define([ function defineRoute(newRoute) { var path = newRoute.path; - console.log("Defining route: " + path); + console.log("defining route: " + path); newRoute.dictionary = "core"; Emby.Page.addRoute(path, newRoute); } - console.log("Defining core routes"); + console.log("defining core routes"); - defineRoute({ - path: "/addplugin.html", - autoFocus: false, - roles: "admin", - controller: "addpluginpage" - }); - defineRoute({ - path: "/autoorganizelog.html", - roles: "admin" - }); - defineRoute({ - path: "/channelsettings.html", - autoFocus: false, - roles: "admin" - }); + // authentication defineRoute({ path: "/addserver.html", autoFocus: false, @@ -45,15 +31,51 @@ define([ startup: true, controller: "addserver" }); + defineRoute({ + path: "/forgotpassword.html", + anonymous: true, + startup: true, + controller: "forgotpassword" + }); + defineRoute({ + path: "/forgotpasswordpin.html", + autoFocus: false, + anonymous: true, + startup: true, + controller: "forgotpasswordpin" + }); + + // playback + defineRoute({ + path: "/nowplaying.html", + controller: "nowplayingpage", + autoFocus: false, + transition: "fade", + fullscreen: true, + supportsThemeMedia: true, + enableMediaControl: false + }); + defineRoute({ + path: "/videoosd.html", + transition: "fade", + controller: "videoosd", + autoFocus: false, + type: "video-osd", + supportsThemeMedia: true, + fullscreen: true, + enableMediaControl: false + }); + + // dashboard defineRoute({ path: "/dashboard.html", autoFocus: false, roles: "admin", - controller: "dashboardpage" + controller: "dashboard/dashboard" }); defineRoute({ path: "/dashboardgeneral.html", - controller: "dashboardgeneral", + controller: "dashboard/general", autoFocus: false, roles: "admin" }); @@ -61,7 +83,7 @@ define([ path: "/networking.html", autoFocus: false, roles: "admin", - controller: "networking" + controller: "dashboard/networking" }); defineRoute({ path: "/devices.html", @@ -104,19 +126,6 @@ define([ roles: "admin", controller: "encodingsettings" }); - defineRoute({ - path: "/forgotpassword.html", - anonymous: true, - startup: true, - controller: "forgotpassword" - }); - defineRoute({ - path: "/forgotpasswordpin.html", - autoFocus: false, - anonymous: true, - startup: true, - controller: "forgotpasswordpin" - }); defineRoute({ path: "/home.html", autoFocus: false, @@ -130,11 +139,6 @@ define([ controller: "list", transition: "fade" }); - defineRoute({ - path: "/index.html", - autoFocus: false, - isDefaultRoute: true - }); defineRoute({ path: "/itemdetails.html", controller: "itemdetailpage", @@ -191,7 +195,7 @@ define([ defineRoute({ path: "/log.html", roles: "admin", - controller: "logpage" + controller: "dashboard/logs" }); defineRoute({ path: "/login.html", @@ -269,52 +273,49 @@ define([ path: "/notificationsetting.html", autoFocus: false, roles: "admin", - controller: "notificationsetting" + controller: "dashboard/notifications/notification" }); defineRoute({ path: "/notificationsettings.html", - controller: "notificationsettings", + controller: "dashboard/notifications/notifications", autoFocus: false, roles: "admin" }); - defineRoute({ - path: "/nowplaying.html", - controller: "nowplayingpage", - autoFocus: false, - transition: "fade", - fullscreen: true, - supportsThemeMedia: true, - enableMediaControl: false - }); defineRoute({ path: "/playbackconfiguration.html", autoFocus: false, roles: "admin", controller: "playbackconfiguration" }); + defineRoute({ + path: "/addplugin.html", + autoFocus: false, + roles: "admin", + controller: "dashboard/plugins/add" + }); defineRoute({ path: "/availableplugins.html", autoFocus: false, roles: "admin", - controller: "availableplugins" + controller: "dashboard/plugins/available" }); defineRoute({ path: "/installedplugins.html", autoFocus: false, roles: "admin", - controller: "installedplugins" + controller: "dashboard/plugins/installed" }); defineRoute({ path: "/scheduledtask.html", autoFocus: false, roles: "admin", - controller: "scheduledtaskpage" + controller: "scheduledtasks/scheduledtask" }); defineRoute({ path: "/scheduledtasks.html", autoFocus: false, roles: "admin", - controller: "scheduledtaskspage" + controller: "scheduledtasks/scheduledtasks" }); defineRoute({ path: "/search.html", @@ -345,11 +346,6 @@ define([ roles: "admin", controller: "streamingsettings" }); - defineRoute({ - path: "/support.html", - autoFocus: false, - roles: "admin" - }); defineRoute({ path: "/tv.html", autoFocus: false, @@ -391,6 +387,8 @@ define([ roles: "admin", controller: "userprofilespage" }); + + // startup wizard defineRoute({ path: "/wizardremoteaccess.html", autoFocus: false, @@ -427,16 +425,6 @@ define([ autoFocus: false, anonymous: true }); - defineRoute({ - path: "/videoosd.html", - transition: "fade", - controller: "videoosd", - autoFocus: false, - type: "video-osd", - supportsThemeMedia: true, - fullscreen: true, - enableMediaControl: false - }); defineRoute({ path: "/configurationpage", autoFocus: false, @@ -444,9 +432,16 @@ define([ enableContentQueryString: true, roles: "admin" }); + + // root defineRoute({ path: "/", isDefaultRoute: true, autoFocus: false }); + defineRoute({ + path: "/index.html", + autoFocus: false, + isDefaultRoute: true + }); });