New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Add support for optional tags auto-complete in the tags plugin #92

pombredanne opened this Issue Feb 15, 2012 · 4 comments


None yet
3 participants

pombredanne commented Feb 15, 2012

It would be great to have the option to get tag autocompletion support . There are jquery ui and jquery plugins for this alright... yet this could be part of the standard tag plugins (and configured optionally with options)
The source of autocompletion list could be so varied so this is likely best as open to the user to provide.


This comment has been minimized.

pombredanne commented Feb 15, 2012

Actually this can be done without changing anything in the plugin but using jquery ui autocomplete this way:

  1. add jquery ui and its css to your page for instance with:

    <link href="lib/vendor/jquery-ui.css" rel="stylesheet" type="text/css" />
    <script src="lib/vendor/jquery-ui.js"></script>
  2. initialize annotator and autocomplete this way for instance for the elemenToAnnotate div, the key being to grab the annotator instance

    jQuery(function ($) {
      $('#elementToAnnotate').annotator().annotator('addPlugin', 'Tags');
      var availableTags = [
        source: availableTags

This comment has been minimized.

anjesh commented Jul 13, 2015

Just wondering if it is possible to use select2 instead of jquery ui autocomplete for the tags.


This comment has been minimized.


tilgovi commented Jul 13, 2015

Probably. If it's not, let us know what we can do to make that possible.


This comment has been minimized.

anjesh commented Jul 14, 2015

I managed to make this work, however i copied the tag plugin from the annotatorjs and created new tags plugin to use select2. Not a good hack, but it works :)
here's the demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment