I have own addresses directory which provides API (well documented). Response for a search query to that directory is a JSON. I have tried to replace current RainLoop functionality for autocomplete of contact suggestions but simple I had no luck (due to lack of API documentation).
I have tried to replace _AppUser.prototype.getAutocomplete_ with $.getJSON but that solution is not working. Then I have tried to extend _DoSuggestions_ action and replace Address Book call with my code but that doesn't work either.
Any tips what I have missed during reverse-engineering RainLoop code for proper API calls?
Thanks
Well, I have made half way through.
Now I'm stuck on how to append those suggestions to current suggestions from contacts.
Also is there any way to filter output for suggestions? I need to add data attributes to them.
Thanks
Regarding last part from question above - can someone explain where is located code responsible for rendering an output for
$this->Plugins()->RunHook('ajax.suggestions-post', array(&$aResult, $sQuery, $oAccount, $iLimit));
if ($iLimit < \count($aResult))
{
$aResult = \array_slice($aResult, 0, $iLimit);
}
return $this->DefaultResponse(__FUNCTION__, $aResult);
It is a part of DoSuggestions() function which uses autocomplete from jQuery UI but I'm not able to locate where is functionality to get $aResult bits and split them between "name" bit and an < email > bit for a suggestions which output looks like:
<div id="ui-id-X" tabindex="-1" class="ui-menu-item-wrapper">"Full Name" <[email protected]></div>
Also does quotes to a full name are added by JavaScript or somewhere in PHP code (actions, providers, etc)?
Got it done but providing proper API documentation will save a lot of time.
Most helpful comment
Got it done but providing proper API documentation will save a lot of time.