text: /**
   * React EventListener.listen
   *
   * Copyright 2013-2014 Facebook, Inc.
   * @licence https://github.com/facebook/react/blob/0.11-stable/LICENSE
   *
   * This file contains a modified version of:
   *  https://github.com/facebook/react/blob/0.11-stable/src/vendor/stubs/EventListener.js
   *
   * TODO: remove in favour of solution provided by:
   *  https://github.com/facebook/react/issues/285
   */
  
  /**
   * Does not take into account specific nature of platform.
   */
  var EventListener = {
    /**
     * Listen to DOM events during the bubble phase.
     *
     * @param {DOMEventTarget} target DOM element to register listener on.
     * @param {string} eventType Event type, e.g. 'click' or 'mouseover'.
     * @param {function} callback Callback function.
     * @return {object} Object with a `remove` method.
     */
    listen: function(target, eventType, callback) {
      if (target.addEventListener) {
        target.addEventListener(eventType, callback, false);
        return {
          remove: function() {
            target.removeEventListener(eventType, callback, false);
          }
        };
      } else if (target.attachEvent) {
        target.attachEvent('on' + eventType, callback);
        return {
          remove: function() {
            target.detachEvent('on' + eventType, callback);
          }
        };
      }
    }
  };
  
  webchooser.component.EventListener = EventListener;