-// 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].htmlEntities().replace(regexp, '<strong>$1<\/strong>');
-
- if (row[1] === '-1') {
- return '…';
- }
- if (row[1] === '-2') {
- return '<em>aucun camarade trouvé pour '+row[0].htmlEntities()+'<\/em>';
- }
-
- mate = (row[1] > 1) ? 'camarades' : 'camarade';
- return name + '<em> - ' + row[1].htmlEntities() + ' ' + mate + '<\/em>';
- };
-}
-