Setup loads of event listeners.
346024
function() {
			var that = this,
				add = function(target, events, capture) {
					events.split(' ').forEach(function(type) {
						target.addEventListener(type, that, capture);
					});
				};
			add(document, 'DOMContentLoaded');
			add(document, 'click mousedown mouseup', true);
			add(window, 'load hashchange');
			if (!gui.hosted) {
				add(window, 'resize orientationchange');
			}
			if (!(window.chrome && chrome.app && chrome.runtime)) {
				add(window, 'unload');
			}
			
			/*
			if (document.readyState === "complete") { // TODO: IE cornercase?
				if (!this._loaded) {
					this._ondom();
					this._onload();
				}
			}
			*/
		}
999873
protected void setupListeners() {
		addDrawingListener(new DrawingListener() {
			private long time;

			@Override
			public void onDrawingStart() {
				this.time = System.currentTimeMillis();
				getCorner().setColor(Color.ORANGERED);
			}

			@Override
			public void onDrawingEnd() {
				getCorner().setColor(null);
				final long duration = System.currentTimeMillis() - this.time;
				getLogger().fine("Rendering duration: " + Duration.millis(duration).toString()); //$NON-NLS-1$
			}
		});
	}
194195
protected function bindEvents(): void
    {
        $userConfig = $this->app['config'][static::$abstract];

        $handler = new EventHandler($this->app->events, $userConfig);

        $handler->subscribe();

        $handler->subscribeQueueEvents($this->app->queue);

        if (isset($userConfig['send_default_pii']) && $userConfig['send_default_pii'] !== false) {
            $handler->subscribeAuthEvents();
        }
    }
45262
def _register_event_listeners(self, cls):
        
        event.listen(cls, 'after_insert', self._new_listener)
        event.listen(cls, 'after_update', self._update_listener)
        event.listen(cls, 'after_delete', self._delete_listener)
810077
protected synchronized void setup() {
		registerAttributes(logAttributeInfo, log);
		for(XTrace trace : log) {
			numberOfTraces++;
			registerAttributes(traceAttributeInfo, trace);
			XTimeBoundsImpl traceBounds = new XTimeBoundsImpl();
			for(XEvent event : trace) {
				registerAttributes(eventAttributeInfo, event);
				for(XEventClasses classes : this.eventClasses.values()) {
					classes.register(event);
				}
				traceBounds.register(event);
				numberOfEvents++;
			}
			this.traceBoundaries.put(trace, traceBounds);
			this.logBoundaries.register(traceBounds);
		}
		// harmonize event class indices
		for(XEventClasses classes : this.eventClasses.values()) {
			classes.harmonizeIndices();
		}
	}
1275802
function setup() {
  if(Hammer.READY) {
    return;
  }

  // find what eventtypes we add listeners to
  Event.determineEventTypes();

  // Register all gestures inside Hammer.gestures
  Utils.each(Hammer.gestures, function(gesture){
    Detection.register(gesture);
  });

  // Add touch events on the document
  Event.onTouch(Hammer.DOCUMENT, EVENT_MOVE, Detection.detect);
  Event.onTouch(Hammer.DOCUMENT, EVENT_END, Detection.detect);

  // Hammer is ready...!
  Hammer.READY = true;
}
749140
private void registerListeners() {
    protocol.registerExecuteHandler(this::execute);
    protocol.registerBackupHandler(this::backup);
    protocol.registerRestoreHandler(this::restore);
    protocol.registerCloseHandler(this::close);
    protocol.registerMetadataHandler(this::metadata);
  }
759790
public static function loadListeners()
    {
        $manager = self::instance();
        $plugins = Plugin::loaded();

        foreach ($plugins as $plugin) {
            $events = Plugin::getData($plugin, 'events')->getArrayCopy();
            foreach ($events as $name => $config) {
                if (is_numeric($name)) {
                    $name   = $config;
                    $config = [];
                }

                $class  = App::className($name, 'Event');
                $config = (array) $config;

                if ($class !== false) {
                    $listener = new $class($config);
                    $manager->on($listener, $config);
                }
            }
        }
    }
659856
function loadedListener() {
            var readyState = script.readyState;
            if (
                typeof readyState === 'undefined'
                || /^(loaded|complete)$/.test( readyState )
            ) {
                script.onload = script.onreadystatechange = null;
                script = null;

                completePreDefine( moduleId );
            }
        }
1273630
function registerListeners(scope, listeners) {
        var fns = [];

        for (var name in listeners) {
            if (listeners.hasOwnProperty(name) && listeners[name]) {
                fns.push(eventBus.on(name, $injector.invoke(listeners[name])));
            }
        }

        // make sure handlers are destroyed along with scope
        scope.$on('$destroy', function () {
            for (var i = 0; i < fns.length; i++) {
                fns[i]();
            }
        });
    }
378550
public function attachDefaultListeners()
    {
        $em = $this->getEventManager();
        $em->attach(WorkflowDispatchEventInterface::LOAD_METADATA_EVENT, [$this, 'onLoadMetadataHandler']);
        $em->attach(WorkflowDispatchEventInterface::PREPARE_DATA_EVENT, [$this, 'onPrepareDataHandler']);
        $em->attach(WorkflowDispatchEventInterface::CHECK_RUN_WORKFLOW_EVENT, [$this, 'onCheckRunWorkflowHandler']);
        $em->attach(WorkflowDispatchEventInterface::RUN_WORKFLOW_EVENT, [$this, 'onRunWorkflowHandler']);
    }
343467
function () {

        var i = this.c.length, j, c;
        while( i-- ){
            c = this.c[i];
            if( c !== undefined ){
                if( c.events !== undefined ){
                    j = c.events.length;
                    while( j-- ) c.addEventListener( c.events[j], this, false );
                }
            }
        }

    }
573530
protected function loadEventListeners()
    {
        $coreListeners = [
            \Raideer\Tweech\Listeners\IrcMessageListener::class,
            \Raideer\Tweech\Listeners\ChatMessageListener::class,
        ];

        $this['client']->registerEventListener($coreListeners);
    }
229819
function _addListeners() {
        if (_automaticSort && _currentSort && _currentSort.getEvents()) {
            MainViewManager
                .on(_currentSort.getEvents(), function () {
                    _currentSort.sort();
                })
                .on("_workingSetDisableAutoSort.sort", function () {
                    setAutomatic(false);
                });
        }
    }
221152
function setup() {
    primus.streams = {};

    for (var event in primus.reserved.events) {
      if ('data' === event) continue;

      primus.on(event, listen(event));
    }
  }
1322172
public function registerEvents()
    {
        if (!empty($this->clientEvents)) {
            $js = [];
            foreach ($this->clientEvents as $event => $handle) {
                $js[] = "jQuery('#{$this->options['id']}').on('{$event}',{$handle});";
            }
            $this->getView()->registerJs(implode(PHP_EOL, $js));
        }
    }
1334151
private void bindEvents() {
		visibilityToggle.addClickHandler(new ClickHandler() {

			public void onClick(ClickEvent event) {
				if (visibilityToggle.isEnabled()) {
					layer.setMarkedAsVisible(!layer.isMarkedAsVisible());
					visibilityToggle.setEnabled(true); // Works because JavaScript is single threaded...
				}
			}
		});
	}