summaryrefslogtreecommitdiffstats
path: root/tabellio/searchform/docsearch.pt
diff options
context:
space:
mode:
authorFrédéric Péters <fpeters@0d.be>2011-11-11 13:30:06 (GMT)
committerFrédéric Péters <fpeters@0d.be>2011-11-11 15:29:31 (GMT)
commitf0535422bfa9e83425cf7db77b5a54606c8b012b (patch)
treedfb1958881dace2d69f266f46645d545413e61ad /tabellio/searchform/docsearch.pt
parent23f9f9e182a1525748760fd89e53bd5db5c0c791 (diff)
downloadtabellio.searchform-f0535422bfa9e83425cf7db77b5a54606c8b012b.zip
tabellio.searchform-f0535422bfa9e83425cf7db77b5a54606c8b012b.tar.gz
tabellio.searchform-f0535422bfa9e83425cf7db77b5a54606c8b012b.tar.bz2
add polgroups and topics earch
Diffstat (limited to 'tabellio/searchform/docsearch.pt')
-rw-r--r--tabellio/searchform/docsearch.pt14
1 files changed, 9 insertions, 5 deletions
diff --git a/tabellio/searchform/docsearch.pt b/tabellio/searchform/docsearch.pt
index ab9431f..a183fd2 100644
--- a/tabellio/searchform/docsearch.pt
+++ b/tabellio/searchform/docsearch.pt
@@ -126,7 +126,7 @@
<div tal:replace="structure provider:plone.belowcontentbody" />
<script type="text/javascript">
-function update_authors_input(input) {
+function update_input(input) {
var s = '';
jq(input).nextAll('span.labelbox').each(function() {
s = s + ' ' + jq(this).attr('class').split(' ')[1];
@@ -134,7 +134,7 @@ function update_authors_input(input) {
jq(input).attr('value', s);
}
-function author_autocomplete_ready(event, data, formatted) {
+function autocomplete_ready(event, data, formatted) {
(function($) {
var input_box = $(event.target);
// XXX: don't insert item if it's already present
@@ -142,9 +142,9 @@ function author_autocomplete_ready(event, data, formatted) {
$(input_box).before(labelbox);
$(labelbox).click(function() {
$(this).remove();
- update_authors_input(jq(input_box).prevAll('input')[0]);
+ update_input(jq(input_box).prevAll('input')[0]);
});
- update_authors_input(jq(input_box).prevAll('input')[0]);
+ update_input(jq(input_box).prevAll('input')[0]);
$(input_box).attr('value', '');
}(jQuery));
}
@@ -152,7 +152,11 @@ function author_autocomplete_ready(event, data, formatted) {
(function($) {
$().ready(function() {
$('.author-autocomplete').autocomplete('./listAuthors', {
- }).result(author_autocomplete_ready);
+ }).result(autocomplete_ready);
+ $('.polgroup-autocomplete').autocomplete('./listPolgroups', {
+ }).result(autocomplete_ready);
+ $('.topic-autocomplete').autocomplete('./listTopics', {
+ }).result(autocomplete_ready);
});
})(jQuery);
</script>