2011-07-28 01:59:48 +03:00
|
|
|
jQuery(document).ready(function () {
|
|
|
|
$.ajaxSetup({
|
|
|
|
cache: false
|
|
|
|
});
|
2011-06-30 09:15:06 +03:00
|
|
|
|
2011-07-28 01:59:48 +03:00
|
|
|
$('.folderLookup').livequery(function () {
|
|
|
|
bindFolderAutoComplete(".folderLookup");
|
|
|
|
});
|
|
|
|
|
|
|
|
$('.seriesLookup').livequery(function () {
|
|
|
|
bindSeriesAutoComplete(".seriesLookup");
|
|
|
|
});
|
2011-06-30 09:15:06 +03:00
|
|
|
|
2011-07-28 01:59:48 +03:00
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
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}'
|
|
|
|
});
|
2011-06-30 09:15:06 +03:00
|
|
|
});
|
2011-07-28 01:59:48 +03:00
|
|
|
});
|
2011-06-30 09:15:06 +03:00
|
|
|
|
2011-07-28 01:59:48 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
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}'
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2011-06-30 09:15:06 +03:00
|
|
|
}
|