Jira kind of autocomplete for text box

I want to implement Jira as an automatic full behavior for one of my home projects. Check out the following screenshot.

enter image description here

I was looking hard for any existing plugin that could deliver it, but could not find anyone.

I tried the following things ( JsFiddle Link ):

  • Add items textareaand input(hidden initially).
  • Bind event keyPresstotextarea
  • Capturing @and displaying a inputfield with a plugin jQuery#autocompletewith a list of users

HTML:

<div class='span12'>
    <textarea id='comments' class='span12'></textarea>
    <input id='users' class='span12 hide' />
</div>

Script:

$(function() {
    var users = [
        "Ram",
        "Ramesh",
        "Rakesh",
        "Rahul",
        "Abhi",
        "Karan"
    ];
    $('#comments').on('keypress', function(e){
      if(e.keyCode === 64) {
        $( "#users" ).removeClass('hide');
        $( "#users" ).autocomplete({
          source: users
        });
      }
    });
});

My questions:

  • How can we call @textto display an autocomplete list using textas selected?
  • , textarea?
+4
2

, , jquery.mentionsInput.

, , AJAX. jQuery underscore.js MSIE 8 .

, , Markdown, @username. , , , , , , , , .

Markdown , .

0

All Articles