-
- // use same form to send to search or map
- function launch_form(url) {
- var f = document.getElementById('recherche');
- f.action = url;
- f.submit();
- }
-
- // display an autocomplete row : blabla (nb of found matches)
- function format_autocomplete(row) {
- if (row[1] == 1) {
- return row[0];
- }
- return row[0] + ' ('+ row[1] + ')';
+ // display an autocomplete row : blabla (nb of found matches)
+ function make_format_autocomplete(block) {
+ return function(row) {
+ regexp = new RegExp('(' + RegExp.escape(block.value) + ')', 'i');
+ name = row[0].replace(regexp, '<strong>$1</strong>');
+ if (row[1] == 1) {
+ return name;
+ }
+ return name + '<em> - '+ row[1] + ' camarades</em>';
+ };