Sha256: df65a6f6189bb83bc41670da37679b87ac479b7a960fb2a862d029a0b9c37ee6

Contents?: true

Size: 624 Bytes

Versions: 32

Compression:

Stored size: 624 Bytes

Contents

var Event = require('./event');

var EventTarget = {
  onopen:     null,
  onmessage:  null,
  onerror:    null,
  onclose:    null,

  addEventListener: function(eventType, listener, useCapture) {
    this.on(eventType, listener);
  },

  removeEventListener: function(eventType, listener, useCapture) {
    this.removeListener(eventType, listener);
  },

  dispatchEvent: function(event) {
    event.target = event.currentTarget = this;
    event.eventPhase = Event.AT_TARGET;

    if (this['on' + event.type])
      this['on' + event.type](event);

    this.emit(event.type, event);
  }
};

module.exports = EventTarget;

Version data entries

32 entries across 27 versions & 12 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js
disco_app-0.18.0 test/dummy/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js
disco_app-0.18.2 test/dummy/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js
tang-0.2.1 spec/tang_app/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js
tang-0.2.0 spec/tang_app/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js
tang-0.1.0 spec/tang_app/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js
tang-0.0.9 spec/tang_app/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js
enju_library-0.3.8 spec/dummy/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js
ilog-0.4.1 node_modules/faye-websocket/lib/faye/websocket/api/event_target.js
ilog-0.4.0 node_modules/faye-websocket/lib/faye/websocket/api/event_target.js
ilog-0.3.3 node_modules/faye-websocket/lib/faye/websocket/api/event_target.js
jester-data-8.0.0 node_modules/faye-websocket/lib/faye/websocket/api/event_target.js
ezii-os-5.2.1 node_modules/faye-websocket/lib/faye/websocket/api/event_target.js
ezii-os-2.0.1 node_modules/faye-websocket/lib/faye/websocket/api/event_target.js
ezii-os-1.1.0 node_modules/faye-websocket/lib/faye/websocket/api/event_target.js
ezii-os-1.0.0 node_modules/faye-websocket/lib/faye/websocket/api/event_target.js
ezii-os-0.0.0.1.0 node_modules/faye-websocket/lib/faye/websocket/api/event_target.js
ezii-os-0.0.0.0.1 node_modules/faye-websocket/lib/faye/websocket/api/event_target.js
blsk-sevcore-0.0.2 blsk_old/bluesky-doc/bluesky-doc/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js
optimacms-0.4.3 spec/dummy/node_modules/faye-websocket/lib/faye/websocket/api/event_target.js