tidusjar 8 years ago
commit c235018e98

@ -56,7 +56,9 @@ $(function () {
if (searchTimer) { if (searchTimer) {
clearTimeout(searchTimer); clearTimeout(searchTimer);
} }
searchTimer = setTimeout(movieSearch, 800); searchTimer = setTimeout(function () {
movieSearch();
}.bind(this), 800);
}); });
@ -75,7 +77,9 @@ $(function () {
if (searchTimer) { if (searchTimer) {
clearTimeout(searchTimer); clearTimeout(searchTimer);
} }
searchTimer = setTimeout(tvSearch, 400); searchTimer = setTimeout(function() {
tvSearch();
}.bind(this), 800);
}); });
// Click TV dropdown option // Click TV dropdown option
@ -116,7 +120,9 @@ $(function () {
if (searchTimer) { if (searchTimer) {
clearTimeout(searchTimer); clearTimeout(searchTimer);
} }
searchTimer = setTimeout(musicSearch, 400); searchTimer = setTimeout(function () {
musicSearch();
}.bind(this), 800);
}); });

@ -8,6 +8,21 @@
return s; 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() { $(function() {
$('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="tooltip"]').tooltip();
}); });

@ -82,9 +82,8 @@ namespace PlexRequests.UI.Helpers
$"<link rel=\"stylesheet\" href=\"{startUrl}/font-awesome.css\" type=\"text/css\"/>", $"<link rel=\"stylesheet\" href=\"{startUrl}/font-awesome.css\" type=\"text/css\"/>",
$"<link rel=\"stylesheet\" href=\"{startUrl}/pace.min.css\" type=\"text/css\"/>", $"<link rel=\"stylesheet\" href=\"{startUrl}/pace.min.css\" type=\"text/css\"/>",
$"<link rel=\"stylesheet\" href=\"{startUrl}/awesome-bootstrap-checkbox.css\" type=\"text/css\"/>", $"<link rel=\"stylesheet\" href=\"{startUrl}/awesome-bootstrap-checkbox.css\" type=\"text/css\"/>",
$"<link rel=\"stylesheet\" href=\"{startUrl}/base.css\" type=\"text/css\"/>", $"<link rel=\"stylesheet\" href=\"{startUrl}/base.css?v={Assembly}\" type=\"text/css\"/>",
$"<link rel=\"stylesheet\" href=\"{startUrl}/Themes/{settings.ThemeName}\" type=\"text/css\"/>", $"<link rel=\"stylesheet\" href=\"{startUrl}/Themes/{settings.ThemeName}?v={Assembly}\" type=\"text/css\"/>",
$"<link rel=\"stylesheet\" href=\"{startUrl}/datepicker.min.css\" type=\"text/css\"/>",
$"<link rel=\"stylesheet\" href=\"{startUrl}/tooltip/tooltipster.bundle.min.css\" type=\"text/css\"/>", $"<link rel=\"stylesheet\" href=\"{startUrl}/tooltip/tooltipster.bundle.min.css\" type=\"text/css\"/>",
}; };
@ -95,11 +94,10 @@ namespace PlexRequests.UI.Helpers
$"<script src=\"{startUrl}/handlebars.min.js\"></script>", $"<script src=\"{startUrl}/handlebars.min.js\"></script>",
$"<script src=\"{startUrl}/bootstrap.min.js\"></script>", $"<script src=\"{startUrl}/bootstrap.min.js\"></script>",
$"<script src=\"{startUrl}/bootstrap-notify.min.js\"></script>", $"<script src=\"{startUrl}/bootstrap-notify.min.js\"></script>",
$"<script src=\"{startUrl}/site.js\"></script>", $"<script src=\"{startUrl}/site.js?v={Assembly}\"></script>",
$"<script src=\"{startUrl}/pace.min.js\"></script>", $"<script src=\"{startUrl}/pace.min.js\"></script>",
$"<script src=\"{startUrl}/jquery.mixitup.js\"></script>", $"<script src=\"{startUrl}/jquery.mixitup.js\"></script>",
$"<script src=\"{startUrl}/moment.min.js\"></script>", $"<script src=\"{startUrl}/moment.min.js\"></script>",
$"<script src=\"{startUrl}/bootstrap-datetimepicker.min.js\"></script>",
$"<script src=\"{startUrl}/tooltip/tooltipster.bundle.min.js\"></script>" $"<script src=\"{startUrl}/tooltip/tooltipster.bundle.min.js\"></script>"
}; };
@ -118,6 +116,16 @@ namespace PlexRequests.UI.Helpers
return helper.Raw(sb.ToString()); return helper.Raw(sb.ToString());
} }
public static IHtmlString LoadDateTimePickerAsset(this HtmlHelpers helper)
{
var startUrl = GetBaseUrl();
var sb = new StringBuilder();
sb.AppendLine($"<link rel=\"stylesheet\" href=\"{startUrl}/datepicker.min.css\" type=\"text/css\"/>");
sb.AppendLine($"<script src=\"{startUrl}/bootstrap-datetimepicker.min.js\"></script>");
return helper.Raw(sb.ToString());
}
public static IHtmlString LoadAngularAssets(this HtmlHelpers helper) public static IHtmlString LoadAngularAssets(this HtmlHelpers helper)
{ {
var sb = new StringBuilder(); var sb = new StringBuilder();
@ -135,7 +143,7 @@ namespace PlexRequests.UI.Helpers
var startUrl = $"{content}/Content"; var startUrl = $"{content}/Content";
sb.AppendLine($"<script src=\"{startUrl}/angular.min.js\"></script>"); // Load angular first sb.AppendLine($"<script src=\"{startUrl}/angular.min.js\"></script>"); // Load angular first
sb.AppendLine($"<script src=\"{startUrl}/app/app.js\"></script>"); sb.AppendLine($"<script src=\"{startUrl}/app/app.js?v={Assembly}\"></script>");
return helper.Raw(sb.ToString()); return helper.Raw(sb.ToString());
} }
@ -147,7 +155,7 @@ namespace PlexRequests.UI.Helpers
var content = GetContentUrl(assetLocation); var content = GetContentUrl(assetLocation);
sb.AppendLine($"<script src=\"{content}/Content/search.js\" type=\"text/javascript\"></script>"); sb.AppendLine($"<script src=\"{content}/Content/search.js?v={Assembly}\" type=\"text/javascript\"></script>");
return helper.Raw(sb.ToString()); return helper.Raw(sb.ToString());
} }
@ -159,7 +167,7 @@ namespace PlexRequests.UI.Helpers
var content = GetContentUrl(assetLocation); var content = GetContentUrl(assetLocation);
sb.AppendLine($"<script src=\"{content}/Content/requests.js\" type=\"text/javascript\"></script>"); sb.AppendLine($"<script src=\"{content}/Content/requests.js?v={Assembly}\" type=\"text/javascript\"></script>");
return helper.Raw(sb.ToString()); return helper.Raw(sb.ToString());
} }
@ -171,7 +179,7 @@ namespace PlexRequests.UI.Helpers
var content = GetContentUrl(assetLocation); var content = GetContentUrl(assetLocation);
sb.AppendLine($"<script src=\"{content}/Content/issues.js\" type=\"text/javascript\"></script>"); sb.AppendLine($"<script src=\"{content}/Content/issues.js?v={Assembly}\" type=\"text/javascript\"></script>");
return helper.Raw(sb.ToString()); return helper.Raw(sb.ToString());
} }
@ -183,7 +191,7 @@ namespace PlexRequests.UI.Helpers
var content = GetContentUrl(assetLocation); var content = GetContentUrl(assetLocation);
sb.AppendLine($"<script src=\"{content}/Content/wizard.js\" type=\"text/javascript\"></script>"); sb.AppendLine($"<script src=\"{content}/Content/wizard.js?v={Assembly}\" type=\"text/javascript\"></script>");
return helper.Raw(sb.ToString()); return helper.Raw(sb.ToString());
} }
@ -193,7 +201,7 @@ namespace PlexRequests.UI.Helpers
var assetLocation = GetBaseUrl(); var assetLocation = GetBaseUrl();
var content = GetContentUrl(assetLocation); var content = GetContentUrl(assetLocation);
var asset = $"<script src=\"{content}/Content/issue-details.js\" type=\"text/javascript\"></script>"; var asset = $"<script src=\"{content}/Content/issue-details.js?v={Assembly}\" type=\"text/javascript\"></script>";
return helper.Raw(asset); return helper.Raw(asset);
} }
@ -222,7 +230,7 @@ namespace PlexRequests.UI.Helpers
var assetLocation = GetBaseUrl(); var assetLocation = GetBaseUrl();
var content = GetContentUrl(assetLocation); var content = GetContentUrl(assetLocation);
var asset = $"<script src=\"{content}/Content/analytics.js\" type=\"text/javascript\"></script>"; var asset = $"<script src=\"{content}/Content/analytics.js?v={Assembly}\" type=\"text/javascript\"></script>";
return helper.Raw(asset); return helper.Raw(asset);
} }

@ -1,7 +1,7 @@
@using PlexRequests.UI.Helpers @using PlexRequests.UI.Helpers
@Html.Partial("_Sidebar") @Html.Partial("_Sidebar")
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.LandingPageSettings> @inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<PlexRequests.Core.SettingModels.LandingPageSettings>
@Html.LoadDateTimePickerAsset()
<div class="col-sm-8 col-sm-push-1"> <div class="col-sm-8 col-sm-push-1">
<form class="form-horizontal" method="POST" id="mainForm"> <form class="form-horizontal" method="POST" id="mainForm">
<fieldset> <fieldset>

Loading…
Cancel
Save