Announcing the At.js module, fantastic autocompletes from within textareas for Drupal!

At.js in action

A dev release is out for At.js, a module implementing the work of iChord which allows for autocompletes within textareas. This type of autocomplete can be seen on Github and Twitter, and now Long text fields within Drupal can have this too.

The module works by creating At.js Listeners (which are Features exportable), editing the Long text field(s) and selecting which listeners should be active on it and finally enabling the listeners on input formats (this last part isn't necessary but recommended).

Aside from neat autocompletes what else is this good for? Well the module is capable of keeping a record of mentions so it's able to tell when new mentions are added via At.js and also when existing ones are removed.

As an example, here's what will feature in Harmony Forum (the reason why we've created a Drupal implementation of At.js). Harmony will have notifications for various things, such as when a user @mentions another user within a post the mentioned user will get a notification like 'User A has mentioned you in their post "post title"'. Pretty cool!

Any entity type can be referenced, searching off of a selected property (e.g. name for the User entity) and properties and field data as able to be used in the autocomplete result template (e.g. user avatars within the autocomplete).

The module provides hooks that let you respond to mentions and removal of mentions and chances to alter the query used to find autocomplete results, alter the results and a chance to change how the link to the entity is displayed via a theming function.

As with anything of this nature bugs are to be expected, we'll be watching the issue queue and submitting bugs to the At.js library. Any testing that could be done we'd be very grateful for!