Revision a97ea1ce
Von Sven Schöling vor fast 9 Jahren hinzugefügt
js/glquicksearch.js | ||
---|---|---|
1 |
$(function() { |
|
2 |
$( "#glquicksearch" ).autocomplete({ |
|
3 |
source: "controller.pl?action=GL/quicksearch", |
|
4 |
minLength: 3, |
|
5 |
select: function(event, ui) { |
|
6 |
var url = ui.item.url; |
|
7 |
if(url != '#') { |
|
8 |
location.href = url; |
|
9 |
} |
|
10 |
}, |
|
11 |
html: false, |
|
12 |
autoFocus: true |
|
13 |
}); |
|
14 |
}); |
js/quicksearch_input.js | ||
---|---|---|
1 |
function on_keydown_quicksearch(event) { |
|
2 |
var key; |
|
3 |
var element = $(this); |
|
4 |
|
|
5 |
if (window.event) |
|
6 |
key = window.event.keyCode; // IE |
|
7 |
else |
|
8 |
key = event.which; // Firefox |
|
9 |
|
|
10 |
if (key != 13) |
|
11 |
return true; |
|
12 |
|
|
13 |
var search_term = $(element); |
|
14 |
var value = search_term.val(); |
|
15 |
if (!value) |
|
16 |
return true; |
|
17 |
|
|
18 |
url = { |
|
19 |
frame_header_contact_search: "ct.pl?action=list_contacts&INPUT_ENCODING=utf-8&filter.status=active&search_term=", |
|
20 |
frame_header_parts_search: "ic.pl?action=generate_report&INPUT_ENCODING=utf-8&searchitems=assembly&all=" |
|
21 |
}[element.attr('id')]; |
|
22 |
|
|
23 |
window.location.href = url + encodeURIComponent(value); |
|
24 |
|
|
25 |
return false; |
|
26 |
} |
|
27 |
$(function(){ |
|
28 |
$('#frame_header_contact_search').keydown(on_keydown_quicksearch); |
|
29 |
$('#frame_header_parts_search').keydown(on_keydown_quicksearch); |
|
30 |
}); |
Auch abrufbar als: Unified diff
TopQuickSearch: zwei nicht mehr benötigte javascripte