mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-05 18:42:42 +01:00
Local search updates.
This commit is contained in:
parent
1aa295b2ca
commit
7c529b03b4
@ -378,6 +378,7 @@
|
|||||||
<Content Include="Scripts\NzbDrone\addSeries.js" />
|
<Content Include="Scripts\NzbDrone\addSeries.js" />
|
||||||
<Content Include="Scripts\NzbDrone\AutoComplete.js" />
|
<Content Include="Scripts\NzbDrone\AutoComplete.js" />
|
||||||
<Content Include="Scripts\NzbDrone\episodeSearch.js" />
|
<Content Include="Scripts\NzbDrone\episodeSearch.js" />
|
||||||
|
<Content Include="Scripts\NzbDrone\LocalSearch.js" />
|
||||||
<Content Include="Scripts\NzbDrone\Notification.js" />
|
<Content Include="Scripts\NzbDrone\Notification.js" />
|
||||||
<Content Include="Scripts\NzbDrone\seriesDetails.js" />
|
<Content Include="Scripts\NzbDrone\seriesDetails.js" />
|
||||||
<Content Include="Scripts\NzbDrone\settingsForm.js" />
|
<Content Include="Scripts\NzbDrone\settingsForm.js" />
|
||||||
|
@ -8,12 +8,8 @@
|
|||||||
$(document).bind('keydown', 'ctrl+shift+f', function () {
|
$(document).bind('keydown', 'ctrl+shift+f', function () {
|
||||||
$('#localSeriesLookup').focus();
|
$('#localSeriesLookup').focus();
|
||||||
});
|
});
|
||||||
$(document).bind('keyup', 's', function () {
|
|
||||||
$('#localSeriesLookup').focus();
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
//
|
|
||||||
$('.folderLookup:not(.ui-autocomplete-input), .seriesLookup:not(.ui-autocomplete-input), .localSeriesLookup:not(.ui-autocomplete-input)').live('focus', function (event) {
|
$('.folderLookup:not(.ui-autocomplete-input), .seriesLookup:not(.ui-autocomplete-input), .localSeriesLookup:not(.ui-autocomplete-input)').live('focus', function (event) {
|
||||||
bindAutoCompletes();
|
bindAutoCompletes();
|
||||||
});
|
});
|
||||||
@ -21,7 +17,6 @@ $('.folderLookup:not(.ui-autocomplete-input), .seriesLookup:not(.ui-autocomplete
|
|||||||
function bindAutoCompletes() {
|
function bindAutoCompletes() {
|
||||||
bindFolderAutoComplete(".folderLookup");
|
bindFolderAutoComplete(".folderLookup");
|
||||||
bindSeriesAutoComplete(".seriesLookup");
|
bindSeriesAutoComplete(".seriesLookup");
|
||||||
bindLocalSeriesAutoComplete("#localSeriesLookup");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function bindFolderAutoComplete(selector) {
|
function bindFolderAutoComplete(selector) {
|
||||||
@ -68,25 +63,3 @@ function bindSeriesAutoComplete(selector) {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function bindLocalSeriesAutoComplete(selector) {
|
|
||||||
|
|
||||||
$(selector).each(function (index, element) {
|
|
||||||
$(element).watermark('Search...');
|
|
||||||
$(element).autocomplete({
|
|
||||||
source: "/Series/LocalSearch",
|
|
||||||
minLength: 1,
|
|
||||||
delay: 100,
|
|
||||||
autoFocus:true,
|
|
||||||
select: function (event, ui) {
|
|
||||||
window.location = "../Series/Details?seriesId=" + ui.item.Id;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.data("autocomplete")._renderItem = function (ul, item) {
|
|
||||||
return $("<li></li>")
|
|
||||||
.data("item.autocomplete", item)
|
|
||||||
.append("<a><strong>" + item.Title + "</strong><br>" + "</a>")
|
|
||||||
.appendTo(ul);
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
41
NzbDrone.Web/Scripts/NzbDrone/LocalSearch.js
Normal file
41
NzbDrone.Web/Scripts/NzbDrone/LocalSearch.js
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
jQuery(document).ready(function () {
|
||||||
|
$.ajaxSetup({
|
||||||
|
cache: false
|
||||||
|
});
|
||||||
|
|
||||||
|
var selector = '#localSeriesLookup';
|
||||||
|
|
||||||
|
$(document).bind('keydown', 'ctrl+shift+f', function () {
|
||||||
|
$(selector).focus();
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).bind('keyup', 's', function () {
|
||||||
|
$(selector).focus();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$(selector).each(function (index, element) {
|
||||||
|
$(element).blur(function () {
|
||||||
|
$(element).val("");
|
||||||
|
});
|
||||||
|
|
||||||
|
$(element).watermark('Search...');
|
||||||
|
|
||||||
|
$(element).autocomplete({
|
||||||
|
source: "/Series/LocalSearch",
|
||||||
|
minLength: 1,
|
||||||
|
delay: 200,
|
||||||
|
autoFocus: true,
|
||||||
|
select: function (event, ui) {
|
||||||
|
window.location = "../Series/Details?seriesId=" + ui.item.Id;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
.data("autocomplete")._renderItem = function (ul, item) {
|
||||||
|
return $("<li></li>")
|
||||||
|
.data("item.autocomplete", item)
|
||||||
|
.append("<a>" + item.Title + "<br>" + "</a>")
|
||||||
|
.appendTo(ul);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
});
|
@ -2,9 +2,13 @@
|
|||||||
@section TitleContent{
|
@section TitleContent{
|
||||||
Add Series
|
Add Series
|
||||||
}
|
}
|
||||||
|
@section Scripts
|
||||||
|
{
|
||||||
|
<script type="text/javascript" src="../../Scripts/NzbDrone/addSeries.js"></script>
|
||||||
|
}
|
||||||
@section MainContent{
|
@section MainContent{
|
||||||
<h2>Add New Series</h2>
|
<h2>
|
||||||
|
Add New Series</h2>
|
||||||
<div id="addNewSeries">
|
<div id="addNewSeries">
|
||||||
@{ Html.RenderAction("AddNew", "AddSeries"); }
|
@{ Html.RenderAction("AddNew", "AddSeries"); }
|
||||||
</div>
|
</div>
|
||||||
|
@ -48,7 +48,6 @@
|
|||||||
<span id="msgText">background notification</span>
|
<span id="msgText">background notification</span>
|
||||||
</div>
|
</div>
|
||||||
@(Html.Telerik().ScriptRegistrar().jQuery(true))
|
@(Html.Telerik().ScriptRegistrar().jQuery(true))
|
||||||
@* <script type="text/javascript" src="../../Scripts/jquery-1.7.1.min.js"></script>*@
|
|
||||||
<script type="text/javascript" src="../../Scripts/jquery-ui-1.8.16.min.js"></script>
|
<script type="text/javascript" src="../../Scripts/jquery-ui-1.8.16.min.js"></script>
|
||||||
<script type="text/javascript" src="../../Scripts/MicrosoftAjax.js"></script>
|
<script type="text/javascript" src="../../Scripts/MicrosoftAjax.js"></script>
|
||||||
<script type="text/javascript" src="../../Scripts/MicrosoftMvcAjax.js"></script>
|
<script type="text/javascript" src="../../Scripts/MicrosoftMvcAjax.js"></script>
|
||||||
@ -60,7 +59,7 @@
|
|||||||
<script type="text/javascript" src="../../Scripts/doTimeout.js"></script>
|
<script type="text/javascript" src="../../Scripts/doTimeout.js"></script>
|
||||||
<script type="text/javascript" src="../../Scripts/NzbDrone/episodeSearch.js"></script>
|
<script type="text/javascript" src="../../Scripts/NzbDrone/episodeSearch.js"></script>
|
||||||
<script type="text/javascript" src="../../Scripts/NzbDrone/AutoComplete.js"></script>
|
<script type="text/javascript" src="../../Scripts/NzbDrone/AutoComplete.js"></script>
|
||||||
<script type="text/javascript" src="../../Scripts/NzbDrone/addSeries.js"></script>
|
<script type="text/javascript" src="../../Scripts/NzbDrone/LocalSearch.js"></script>
|
||||||
<script type="text/javascript" src="../../Scripts/NzbDrone/Notification.js"></script>
|
<script type="text/javascript" src="../../Scripts/NzbDrone/Notification.js"></script>
|
||||||
@RenderSection("Scripts", required: false)
|
@RenderSection("Scripts", required: false)
|
||||||
@if (EnviromentProvider.IsProduction)
|
@if (EnviromentProvider.IsProduction)
|
||||||
|
Loading…
Reference in New Issue
Block a user