Autocomplete with SQL'statement "%"

Autocomplete with SQL'statement "%"

   When you use the SQL'statement "%" in the autocomplete, The list generated doesn't have the word searched marked in bold, because the autocomplete'function isn't prepared for this.

   I did a adaptation to work with the the SQL'statement "%" that I will show below:

Original Function:

  1.  $.Autocompleter.defaults={inputClass:"ac_input", 
      


  2.    ... 
      


  3.       highlight:function(value,term){  
                    return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"), 
                                        "<strong>$1</strong>"); 
      




  4.       },scroll:true,scrollHeight:180};




Adapted Function:

  1. $.Autocompleter.defaults={inputClass:"ac_input", 


  2.    ... 
      

  3.       highlight:function(value,term){  
  4.                   // Create a array of words searched
  5.                   listTerm = term.split("%");  
                    

  6.                   /* Put in Bold each word searched
  7.                    * found in the list
  8.                    */    
  9.                   for (i=0; i<listTerm.length; i++) { 
  10.                     value = value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+listTerm[i].replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi,"\\$1")+")(?![^<>]*>)(?![^&;]+;)","gi"), 
                                    "<strong>$1</strong>"); 

  11.                   } 




  12.                   return value; 
      

  13.       },scroll:true,scrollHeight:180}; 


    I hope that Plugin'Developer insert this tip in the next version, Thanks.