/*
 *
 *
 *
 * Copyright (c) 2015 MediaSQ
 * Licensed under the MIT license.
 */
(function ($) {
  'use strict';

  var AT_SIGN_KEY_CODE = 64;

  var MENTIONER_WRAPPER_HOOK_CLASS = 'js-mentioner-wrapper';
  var MENTIONER_DROPDOWN_HOOK_CLASS = 'js-mentioner-dropdown';

  var Mentioner = function($root, settings) {
    this.$root = $root;
    this.mentionables = settings.onDataRequest ? settings.onDataRequest() : [];

    this._buildDOM();
    this._attachEvents();
  };

  Mentioner.prototype._buildDOM = function() {
    var $parent = $( '<div class="' + MENTIONER_WRAPPER_HOOK_CLASS + '"></div>' );
    this.$root.wrap($parent);

    var $dropdown = $( '<div class="' + MENTIONER_DROPDOWN_HOOK_CLASS + '"></div>' );
    this.getParentWrapper().append($dropdown);
  };

  Mentioner.prototype._attachEvents = function() {
    this.$root.on('keypress', this._onRootKeypress.bind(this));
  };

  Mentioner.prototype._onRootKeypress = function(event) {
    if(event.keyCode === AT_SIGN_KEY_CODE) {
      this.showDropdown();
    }
  };

  Mentioner.prototype.getParentWrapper = function() {
    return this.$root.parent();
  };

  Mentioner.prototype.getDropdown = function() {
    return this.getParentWrapper().find('.' + MENTIONER_DROPDOWN_HOOK_CLASS);
  };

  Mentioner.prototype.showDropdown = function() {
    var $dropdown = this.getDropdown().empty();

    this.mentionables.forEach(function(mentionable) {
      var $item = $( '<p>' + mentionable.name + '</p>' );
      $dropdown.append($item);
    });
  };

  $.fn.mentioner = function (settings) {
    settings = settings || {};

    return this.each(function () {
      var $subject = $( this );

      if($subject.data('mentioner') === undefined) {
        $subject.data('mentioner', new Mentioner($subject, settings));
      }
    });
  };
}(jQuery));

@@ -814,24 +814,206 @@
 unction() %7B%0A
+    /*%0A     * Not using Function.prototype.bind because of incompatibilities%0A     * with PhantomJS%0A     *%0A     * Related bug: https://github.com/ariya/phantomjs/issues/10522%0A     */%0A
     this.$ro
@@ -1054,18 +1054,9 @@
 ress
-.bind(this
+(
 ));%0A
@@ -1100,16 +1100,62 @@
 ypress =
+ function() %7B%0A    var that = this;%0A%0A    return
  functio
@@ -1161,24 +1161,26 @@
 on(event) %7B%0A
+  
     if(event
@@ -1218,20 +1218,22 @@
 %7B%0A      
-this
+  that
 .showDro
@@ -1245,17 +1245,26 @@
 ();%0A    
-%7D
+  %7D%0A    %7D;
 %0A  %7D;%0A%0A 

Replace bind by closure for compatibility with PhantomJS