diff --git a/PlexRequests.UI/Content/search.js b/PlexRequests.UI/Content/search.js index 37b41a95e..bf5eea9db 100644 --- a/PlexRequests.UI/Content/search.js +++ b/PlexRequests.UI/Content/search.js @@ -56,7 +56,9 @@ $(function () { if (searchTimer) { clearTimeout(searchTimer); } - searchTimer = setTimeout(movieSearch, 800); + searchTimer = setTimeout(function () { + movieSearch(); + }.bind(this), 800); }); @@ -75,7 +77,9 @@ $(function () { if (searchTimer) { clearTimeout(searchTimer); } - searchTimer = setTimeout(tvSearch, 400); + searchTimer = setTimeout(function() { + tvSearch(); + }.bind(this), 800); }); // Click TV dropdown option @@ -116,7 +120,9 @@ $(function () { if (searchTimer) { clearTimeout(searchTimer); } - searchTimer = setTimeout(musicSearch, 400); + searchTimer = setTimeout(function () { + musicSearch(); + }.bind(this), 800); }); diff --git a/PlexRequests.UI/Content/site.js b/PlexRequests.UI/Content/site.js index 85cae41f8..70639cf3e 100644 --- a/PlexRequests.UI/Content/site.js +++ b/PlexRequests.UI/Content/site.js @@ -8,6 +8,21 @@ return s; } +Function.prototype.bind = function (parent) { + var f = this; + var args = []; + + for (var a = 1; a < arguments.length; a++) { + args[args.length] = arguments[a]; + } + + var temp = function () { + return f.apply(parent, args); + } + + return (temp); +} + $(function() { $('[data-toggle="tooltip"]').tooltip(); }); diff --git a/PlexRequests.UI/Helpers/BaseUrlHelper.cs b/PlexRequests.UI/Helpers/BaseUrlHelper.cs index 625d71380..ee821f7ac 100644 --- a/PlexRequests.UI/Helpers/BaseUrlHelper.cs +++ b/PlexRequests.UI/Helpers/BaseUrlHelper.cs @@ -82,9 +82,8 @@ namespace PlexRequests.UI.Helpers $"", $"", $"", - $"", - $"", - $"", + $"", + $"", $"", }; @@ -95,11 +94,10 @@ namespace PlexRequests.UI.Helpers $"", $"", $"", - $"", + $"", $"", $"", $"", - $"", $"" }; @@ -118,6 +116,16 @@ namespace PlexRequests.UI.Helpers return helper.Raw(sb.ToString()); } + public static IHtmlString LoadDateTimePickerAsset(this HtmlHelpers helper) + { + var startUrl = GetBaseUrl(); + + var sb = new StringBuilder(); + sb.AppendLine($""); + sb.AppendLine($""); + + return helper.Raw(sb.ToString()); + } public static IHtmlString LoadAngularAssets(this HtmlHelpers helper) { var sb = new StringBuilder(); @@ -135,7 +143,7 @@ namespace PlexRequests.UI.Helpers var startUrl = $"{content}/Content"; sb.AppendLine($""); // Load angular first - sb.AppendLine($""); + sb.AppendLine($""); return helper.Raw(sb.ToString()); } @@ -147,7 +155,7 @@ namespace PlexRequests.UI.Helpers var content = GetContentUrl(assetLocation); - sb.AppendLine($""); + sb.AppendLine($""); return helper.Raw(sb.ToString()); } @@ -159,7 +167,7 @@ namespace PlexRequests.UI.Helpers var content = GetContentUrl(assetLocation); - sb.AppendLine($""); + sb.AppendLine($""); return helper.Raw(sb.ToString()); } @@ -171,7 +179,7 @@ namespace PlexRequests.UI.Helpers var content = GetContentUrl(assetLocation); - sb.AppendLine($""); + sb.AppendLine($""); return helper.Raw(sb.ToString()); } @@ -183,7 +191,7 @@ namespace PlexRequests.UI.Helpers var content = GetContentUrl(assetLocation); - sb.AppendLine($""); + sb.AppendLine($""); return helper.Raw(sb.ToString()); } @@ -193,7 +201,7 @@ namespace PlexRequests.UI.Helpers var assetLocation = GetBaseUrl(); var content = GetContentUrl(assetLocation); - var asset = $""; + var asset = $""; return helper.Raw(asset); } @@ -222,7 +230,7 @@ namespace PlexRequests.UI.Helpers var assetLocation = GetBaseUrl(); var content = GetContentUrl(assetLocation); - var asset = $""; + var asset = $""; return helper.Raw(asset); } diff --git a/PlexRequests.UI/Views/Admin/LandingPage.cshtml b/PlexRequests.UI/Views/Admin/LandingPage.cshtml index 9f6dcec6f..38d3cc6fa 100644 --- a/PlexRequests.UI/Views/Admin/LandingPage.cshtml +++ b/PlexRequests.UI/Views/Admin/LandingPage.cshtml @@ -1,7 +1,7 @@ @using PlexRequests.UI.Helpers @Html.Partial("_Sidebar") @inherits Nancy.ViewEngines.Razor.NancyRazorViewBase - +@Html.LoadDateTimePickerAsset()