From 51f8e2a95c108338dc982ef3403a335c0e5f51ce Mon Sep 17 00:00:00 2001 From: tidusjar Date: Fri, 15 Apr 2016 14:23:32 +0100 Subject: [PATCH] More changes for the urlbase #72 --- PlexRequests.UI/Content/requests.js | 19 +++++----- .../Views/Admin/EmailNotifications.cshtml | 8 +++-- PlexRequests.UI/Views/Admin/Headphones.cshtml | 8 +++-- PlexRequests.UI/Views/Admin/Plex.cshtml | 8 +++-- .../Admin/PushbulletNotifications.cshtml | 8 +++-- .../Views/Admin/PushoverNotifications.cshtml | 7 ++-- PlexRequests.UI/Views/Admin/Settings.cshtml | 29 +++++++++------ PlexRequests.UI/Views/Admin/Sickrage.cshtml | 9 +++-- PlexRequests.UI/Views/Admin/Sonarr.cshtml | 9 +++-- PlexRequests.UI/Views/Requests/Index.cshtml | 35 ++++++++++++------- 10 files changed, 90 insertions(+), 50 deletions(-) diff --git a/PlexRequests.UI/Content/requests.js b/PlexRequests.UI/Content/requests.js index 00763cc48..ebe30fd8b 100644 --- a/PlexRequests.UI/Content/requests.js +++ b/PlexRequests.UI/Content/requests.js @@ -11,6 +11,7 @@ var searchTemplate = Handlebars.compile(searchSource); var albumTemplate = Handlebars.compile(albumSource); var movieTimer = 0; var tvimer = 0; +var base = $('#baseUrl').val(); var mixItUpDefault = { animation: { enable: true }, @@ -94,9 +95,10 @@ $('#approveMovies').click(function (e) { loadingButton(buttonId, "success"); + var url = createBaseUrl(base, '/approval/approveallmovies'); $.ajax({ type: 'post', - url: '/approval/approveallmovies', + url: url, dataType: "json", success: function (response) { if (checkJsonResponse(response)) { @@ -123,10 +125,10 @@ $('#approveTVShows').click(function (e) { } loadingButton(buttonId, "success"); - + var url = createBaseUrl(base, '/approval/approvealltvshows'); $.ajax({ type: 'post', - url: '/approval/approvealltvshows', + url: url, dataType: "json", success: function (response) { if (checkJsonResponse(response)) { @@ -456,7 +458,8 @@ function movieLoad() { } $ml.html(""); - $.ajax("/requests/movies/").success(function (results) { + var url = createBaseUrl(base, '/requests/movies'); + $.ajax(url).success(function (results) { if (results.length > 0) { results.forEach(function (result) { var context = buildRequestContext(result, "movie"); @@ -478,8 +481,8 @@ function tvLoad() { $tvl.mixItUp('destroy'); } $tvl.html(""); - - $.ajax("/requests/tvshows/").success(function (results) { + var url = createBaseUrl(base, '/requests/tvshows'); + $.ajax(url).success(function (results) { if (results.length > 0) { results.forEach(function (result) { var context = buildRequestContext(result, "tv"); @@ -501,8 +504,8 @@ function albumLoad() { $albumL.mixItUp('destroy'); } $albumL.html(""); - - $.ajax("/requests/albums/").success(function (results) { + var url = createBaseUrl(base, '/requests/albums'); + $.ajax(url).success(function (results) { if (results.length > 0) { results.forEach(function (result) { var context = buildRequestContext(result, "album"); diff --git a/PlexRequests.UI/Views/Admin/EmailNotifications.cshtml b/PlexRequests.UI/Views/Admin/EmailNotifications.cshtml index 86f5e2322..45fda1a0e 100644 --- a/PlexRequests.UI/Views/Admin/EmailNotifications.cshtml +++ b/PlexRequests.UI/Views/Admin/EmailNotifications.cshtml @@ -1,4 +1,5 @@ -@Html.Partial("_Sidebar") +@using PlexRequests.UI.Helpers +@Html.Partial("_Sidebar") @{ int port; if (Model.EmailPort == 0) @@ -106,6 +107,7 @@