Add an event listener to the dispatcher

@param {String} event name
@param {gpf.events.Handler} eventsHandler
@gpf:chainable
976326
function _gpfAddEventListener (event, eventsHandler) {
    /*jshint validthis:true*/ // will be invoked as an object method
    var listeners = _gpfAllocateEventDispatcherListeners(this);
    if (undefined === listeners[event]) {
        listeners[event] = [];
    }
    listeners[event].push(eventsHandler);
    return this;
}
3084
static HandlerRegistration capturePageEvent (String name, EventHandler handler) {
    return addEventListener(Document.get(), name, handler, true);
  }
839149
function(handlers) {
				var h;
						
				if (Basic.typeOf(handlers) !== 'array') {
					handlers = [handlers];
				}

				for (var i = 0; i < handlers.length; i++) {
					h = 'on' + handlers[i];
					
					if (Basic.typeOf(this[h]) === 'function') {
						this.addEventListener(handlers[i], this[h]);
					} else if (Basic.typeOf(this[h]) === 'undefined') {
						this[h] = null; // object must have defined event properties, even if it doesn't make use of them
					}
				}
			}
530488
function addListener(obj, eventName, target, method) {
  Ember.assert("You must pass at least an object and event name to Ember.addListener", !!obj && !!eventName);

  if (!method && 'function' === typeof target) {
    method = target;
    target = null;
  }

  var actionSet = actionSetFor(obj, eventName, target, true),
      methodGuid = guidFor(method);

  if (!actionSet[methodGuid]) {
    actionSet[methodGuid] = { target: target, method: method };
  }

  if ('function' === typeof obj.didAddListener) {
    obj.didAddListener(eventName, target, method);
  }
}
911529
function setEventHandler(name, handler, dom, tag) {
  var eventName,
    cb = handleEvent.bind(tag, dom, handler);

  // avoid to bind twice the same event
  // possible fix for #2332
  dom[name] = null;

  // normalize event name
  eventName = name.replace(RE_EVENTS_PREFIX, '');

  // cache the listener into the listeners array
  if (!contains(tag.__.listeners, dom)) { tag.__.listeners.push(dom); }
  if (!dom[RIOT_EVENTS_KEY]) { dom[RIOT_EVENTS_KEY] = {}; }
  if (dom[RIOT_EVENTS_KEY][name]) { dom.removeEventListener(eventName, dom[RIOT_EVENTS_KEY][name]); }

  dom[RIOT_EVENTS_KEY][name] = cb;
  dom.addEventListener(eventName, cb, false);
}
1226032
function _dispatch(events, data) {
    var i,
        j,
        i_end,
        j_end,
        event,
        eventName,
        eArray = Array.isArray(events) ?
                   events :
                   events.split(/ /);

    data = data === undefined ? {} : data;

    for (i = 0, i_end = eArray.length; i !== i_end; i += 1) {
      eventName = eArray[i];

      if (_handlers[eventName]) {
        event = {
          type: eventName,
          data: data || {}
        };

        for (j = 0, j_end = _handlers[eventName].length; j !== j_end; j += 1)
          try {
            _handlers[eventName][j].handler(event);
          } catch (e) {}
      }
    }
  }
734194
function triggerHandler(eventName, event, target) {
              var match = !bubbleSelector;
              var el = bubbleSelector ? target : registeredOn;
              if (bubbleSelector) {
                var selectorFilter = getFilterFunc(bubbleSelector, registeredOn);
                while (el && el != registeredOn && !(match = selectorFilter(el)))
                  el = el['parentNode'];
              }
              return (!match) || (name != eventName) || ((handler.apply($(el), args || [event, index]) && prefix=='?') || prefix == '|');
            }
678128
function (eventName, handler)
  {
    if (!this._events[eventName])
      this._events[eventName] = [];
    this._events[eventName].push (handler);
  }
478237
public function addEventHandler($name, $handler, array $params = []) {
        if (is_string($handler)) {
            $this->eventHandlers[$name] = [
                'handler' => $handler,
                'params' => $params,
            ];
        } else {
            $this->eventHandlers[$name] = $handler;
        }

        return $this;
    }
1317627
function (eventName,handler) {
			var event;
			if (event = this.getEvent(eventName))
			{
				if (!event.addListener(handler))
					this.e.log('Invalid handler sent to event `'+eventName+'` on `'+this.getConfig('id')+'`','warning');
			} else
				this.e.log('Not existent event `'+eventName+'` on `'+this.getConfig('id')+'`','warning');
			return this;
		}
46661
function bindEvent ( namespacedEvent, callback ) {
            scope_Events[namespacedEvent] = scope_Events[namespacedEvent] || [];
            scope_Events[namespacedEvent].push(callback);

            // If the event bound is 'update,' fire it immediately for all handles.
            if ( namespacedEvent.split('.')[0] === 'update' ) {
                scope_Handles.forEach(function(a, index){
                    fireEvent('update', index);
                });
            }
        }
217489
function(events, name, callback, options) {
    if (callback) {
      var handlers = events[name] || (events[name] = []);
      var context = options.context, ctx = options.ctx, listening = options.listening;
      if (listening) listening.count++;

      handlers.push({callback: callback, context: context, ctx: context || ctx, listening: listening});
    }
    return events;
  }
836966
function _gpfEventsTriggerHandler (event, eventsHandler, resolvePromise) {
    var eventHandler = _getEventHandler(event, eventsHandler);
    eventHandler(event);
    if (undefined !== resolvePromise) {
        resolvePromise(event);
    }
}
652975
function addEventListener(event, listener) {
    this._eventListeners[event] = this._eventListeners[event] || [];
    this._eventListeners[event].push(listener);
  }
1343022
function(view, event_name, event_object, targets) {

		this._dispatchCallback(
			view,
			targets,
			this._callHandleEvent,
			{
				event_name: event_name,
				event_object: event_object
			},
			this._global_event_targets
		);

	}
658773
public void setHandler (@Nonnull final EJSEvent eJSEvent, @Nonnull final IHasJSCode aNewHandler)
  {
    ValueEnforcer.notNull (eJSEvent, "JSEvent");
    ValueEnforcer.notNull (aNewHandler, "NewHandler");

    // Set only the new handler and remove any existing handler
    m_aEvents.put (eJSEvent, new CollectingJSCodeProvider ().appendFlattened (aNewHandler));
  }
422414
function addEvent(eventName, {
    onElement,
    withCallback,
    avoidDuplicate = true,
    once = false,
    useCapture = false} = { }, thisArg) {
    let element = onElement || []
    if (utils.isString(element)) {
        element =  document.querySelectorAll(element)
    }
    function handler(event) {
        if (utils.isFunction(withCallback)) {
            withCallback.call(thisArg, event, this)
        }
        if (once) {
            handler.destroy();
        }
    }
    handler.destroy = function() {
        each(element, (el) => {
            const events = getNodeEvents(el, eventName, handler);
            if (events.found) { events.all.splice(events.evt, 1); }
            if (el.removeEventListener) el.removeEventListener(eventName, handler, useCapture)
        })
    }
    each(element, (el) => {
        const events = getNodeEvents(el, eventName, handler);
        if (el.addEventListener && (avoidDuplicate && !events.found) || !avoidDuplicate) {
            el.addEventListener(eventName, handler, useCapture)
            events.all.push({ eventName: eventName, fn: handler});
        }
    })
    return handler
}