You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Prowlarr/NzbDrone.Web/Scripts/AutoComplete.js

48 lines
1.4 KiB

jQuery(document).ready(function () {
$.ajaxSetup({
cache: false
});
14 years ago
$('.folderLookup').livequery(function () {
bindFolderAutoComplete(".folderLookup");
});
$('.seriesLookup').livequery(function () {
bindSeriesAutoComplete(".seriesLookup");
});
14 years ago
});
function bindFolderAutoComplete(selector) {
$(selector).each(function (index, element) {
YUI().use("autocomplete", "autocomplete-highlighters", 'autocomplete-filters', function (Y) {
Y.one('body').addClass('yui3-skin-sam');
Y.one(element).plug(Y.Plugin.AutoComplete, {
resultHighlighter: 'startsWith',
resultFilters: 'phraseMatch',
source: '/Directory/GetDirectories/?q={query}'
});
14 years ago
});
});
14 years ago
}
function bindSeriesAutoComplete(selector) {
$(selector).each(function (index, element) {
YUI().use("autocomplete", "autocomplete-highlighters", 'autocomplete-filters', function (Y) {
Y.one('body').addClass('yui3-skin-sam');
Y.one(element).plug(Y.Plugin.AutoComplete, {
resultHighlighter: 'startsWith',
resultFilters: 'phraseMatch',
resultTextLocator: 'Value',
minQueryLength: 3,
queryDelay: 500,
source: '/AddSeries/LookupSeries/?q={query}'
});
});
});
14 years ago
}