messages_autocomplete_init_jsblock

Print inline JS for initializing the messages autocomplete.

Description

messages_autocomplete_init_jsblock(); 

Usage

  1. if ( !function_exists( 'messages_autocomplete_init_jsblock' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-messages/bp-messages-cssjs.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = messages_autocomplete_init_jsblock(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/bp-messages/bp-messages-cssjs.php  
  1. function messages_autocomplete_init_jsblock() { 
  2. ?> 
  3.  
  4. <script type="text/javascript"> 
  5. jQuery(document).ready(function() { 
  6. var acfb = jQuery("ul.first").autoCompletefb({urlLookup: ajaxurl}); 
  7.  
  8. jQuery('#send_message_form').submit( function() { 
  9. var users = document.getElementById('send-to-usernames').className; 
  10. document.getElementById('send-to-usernames').value = String(users); 
  11. }); 
  12. }); 
  13. </script> 
  14.  
  15. <?php