Wrapper for the onloadend event handler

@param {DOM Event} event
@private
15314
function (event) {
                var
                    reader = event.target,
                    buffer,
                    len,
                    result,
                    idx;
                _gpfAssert(reader === this._reader, "Unexpected change of reader");
                if (reader.error) {
                    gpfFireEvent.call(this,
                        gpfI.IReadableStream.ERROR,
                        {
                            // According to W3C
                            // http://www.w3.org/TR/domcore/#interface-domerror
                            error: {
                                name: reader.error.name,
                                message: reader.error.message
                            }
                        },
                        this._eventsHandler
                    );
                } else if (reader.readyState === FileReader.DONE) {
                    buffer = new Int8Array(reader.result);
                    len = buffer.length;
                    result = [];
                    for (idx = 0; idx < len; ++idx) {
                        result.push(buffer[idx]);
                    }
                    gpfFireEvent.call(this, gpfI.IReadableStream.EVENT_DATA, {buffer: result}, this._eventsHandler);
                }
            }
1093811
function eventElementHandlers(event, eventElement) {
		eventElement
			.click(function(ev) {
				if (!eventElement.hasClass('ui-draggable-dragging') &&
					!eventElement.hasClass('ui-resizable-resizing')) {
						return trigger('eventClick', this, event, ev);
					}
			})
			.hover(
				function(ev) {
					trigger('eventMouseover', this, event, ev);
				},
				function(ev) {
					trigger('eventMouseout', this, event, ev);
				}
			);
		// TODO: don't fire eventMouseover/eventMouseout *while* dragging is occuring (on subject element)
		// TODO: same for resizing
	}
712973
function windowLoaded(event) {
    document.removeEventListener('DOMContentLoaded', windowLoaded);

    // JSDom > 7.1 does not allow re-dispatching the same event, so
    // a copy of the event needs to be created for the new dispatch
    const windowContentLoaded = document.createEvent('HTMLEvents');
    windowContentLoaded.initEvent('DOMContentLoaded', false, false);
    window.dispatchEvent(windowContentLoaded);
  }
1074090
function trigger (el, event) {
  if (document.createEvent) {
    var ev = document.createEvent('HTMLEvents')
    ev.initEvent(event, true, false)
    el.dispatchEvent(ev)
  } else {
    el.fireEvent('on' + event)
  }
}
484012
function (event) {
            var inputField = this.getTextInputField();
            var blurredElement = event.target;

            if (blurredElement === inputField) {
                if (inputField.nextSibling != null && inputField.value === "") {
                    this._makeInputFieldLastChild();
                }
            } else if (blurredElement.parentNode.className.indexOf("highlight") != -1) {
                this.unhighlightOption(blurredElement.parentNode);
            }
            // call TextInput onblur handler with avoidCallback set to true
            this.$TextInput._dom_onblur.call(this, event, true);

            if (this._cfg.onblur) {
                // timeout is needed to retrieve (on every browser) the activeElement
                ariaCoreTimer.addCallback({
                    fn : function () {
                        var isAncestor = ariaUtilsDom.isAncestor;
                        var focusedEl = Aria.$window.document.activeElement;

                        // if onblur is defined and window lost focus ( ==null ) or if focus is not in the widget or
                        // dropdown element
                        if (this._cfg
                                && (focusedEl == null || ((this._dropdownPopup == null || !isAncestor(focusedEl, this._dropdownPopup.domElement)) && !isAncestor(focusedEl, this._domElt)))) {
                            this.evalCallback(this._cfg.onblur);
                        }
                    },
                    scope : this,
                    delay : 100
                });
            }
        }
372219
function whenReady(callback) {

		function onLoaded() {
			document.removeEventListener( "DOMContentLoaded", onLoaded, false );
			callback();
		}

		if ( document.readyState === 'complete' ) {
			callback();
		} else {
			document.addEventListener( "DOMContentLoaded", onLoaded, false );
		}
	}
1136115
function handler ( event ){
	var elem = this, returned, data = event.data || {};
	// mousemove or mouseup
	if ( data.elem ){
		// update event properties...
		elem = event.dragTarget = data.elem; // drag source element
		event.dragProxy = drag.proxy || elem; // proxy element or source
		event.cursorOffsetX = data.pageX - data.left; // mousedown offset
		event.cursorOffsetY = data.pageY - data.top; // mousedown offset
		event.offsetX = event.pageX - event.cursorOffsetX; // element offset
		event.offsetY = event.pageY - event.cursorOffsetY; // element offset
		}
	// mousedown, check some initial props to avoid the switch statement
	else if ( drag.dragging || ( data.which>0 && event.which!=data.which ) ||
		$( event.target ).is( data.not ) ) return;
	// handle various events
	switch ( event.type ){
		// mousedown, left click, event.target is not restricted, init dragging
		case 'mousedown':
			$.extend( data, $( elem ).offset(), {
				elem: elem, target: event.target,
				pageX: event.pageX, pageY: event.pageY
				}); // store some initial attributes
			$event.add( document, "mousemove mouseup", handler, data );
			selectable( elem, false ); // disable text selection
			drag.dragging = null; // pending state
			break; // prevents text selection in safari
		// mousemove, check distance, start dragging
		case !drag.dragging && 'mousemove':
			if ( squared( event.pageX-data.pageX )
				+ squared( event.pageY-data.pageY ) //  x² + y² = distance²
				< data.distance ) break; // distance tolerance not reached
			event.target = data.target; // force target from "mousedown" event (fix distance issue)
			returned = hijack( event, "dragstart", elem ); // trigger "dragstart", return proxy element
			if ( returned !== false ){ // "dragstart" not rejected
				drag.dragging = elem; // activate element
				drag.proxy = event.dragProxy = $( returned || elem )[0]; // set proxy
				}
		// mousemove, dragging
		case 'mousemove':
			if ( drag.dragging ){
				returned = hijack( event, "drag", elem ); // trigger "drag"
				if ( data.drop && $special.drop ){ // manage drop events
					$special.drop.allowed = ( returned !== false ); // prevent drop
					$special.drop.handler( event ); // "dropstart", "dropend"
					}
				if ( returned !== false ) break; // "drag" not rejected, stop
				event.type = "mouseup"; // helps "drop" handler behave
				}
		// mouseup, stop dragging
		case 'mouseup':
			$event.remove( document, "mousemove mouseup", handler ); // remove page events
			if ( drag.dragging ){
				if ( data.drop && $special.drop ) $special.drop.handler( event ); // "drop"
				hijack( event, "dragend", elem ); // trigger "dragend"
				}
			selectable( elem, true ); // enable text selection
			drag.dragging = drag.proxy = data.elem = false; // deactivate element
			break;
		}
	}
948956
function onReady( event ) {
  // bail if already triggered or IE8 document is not ready just yet
  var isIE8NotReady = event.type === 'readystatechange' && document.readyState !== 'complete';
  if ( docReady.isReady || isIE8NotReady ) {
    return;
  }

  trigger();
}
786350
function(event) {
		if (this.hasScroll()) {
			// TODO merge with no-scroll-else
			if (!this.active || this.last()) {
				this.activate(event, this.element.children(".ui-menu-item:first"));
				return;
			}
			var base = this.active.offset().top,
				height = this.element.height(),
				result = this.element.children(".ui-menu-item").filter(function() {
					var close = $(this).offset().top - base - height + $(this).height();
					// TODO improve approximation
					return close < 10 && close > -10;
				});

			// TODO try to catch this earlier when scrollTop indicates the last page anyway
			if (!result.length) {
				result = this.element.children(".ui-menu-item:last");
			}
			this.activate(event, result);
		} else {
			this.activate(event, this.element.children(".ui-menu-item")
				.filter(!this.active || this.last() ? ":first" : ":last"));
		}
	}
655319
function (event) {
                var domEvent = /** @type aria.DomEvent */
                new ariaDomEvent(event);
                var fromTarget = /** @type HTMLElement */
                domEvent.target;
                var toTarget = /** @type HTMLElement */
                domEvent.relatedTarget;
                for (var i = this.openedPopups.length - 1; i >= 0; i--) {
                    var popup = /** @type aria.popups.Popup */
                    this.openedPopups[i];
                    if (!utilsDom.isAncestor(toTarget, popup.getDomElement())
                            && utilsDom.isAncestor(fromTarget, popup.getDomElement())) {
                        popup.closeOnMouseOut(domEvent);
                    }
                }
                domEvent.$dispose();
            }
133761
function(event) {
            var args = Array.prototype.slice.call(arguments);
            (this.emitter || (this.emitter = new emitter())).emit.apply(this, args);
        }
1310960
function onReadystatechange(e) {

	if (!(e instanceof Event)) {
		throw new TypeError('Invalid event was given');
	}

	if (document.readyState == 'interactive') {
		makeReady.call(this);
	}

	if (document.readyState == 'complete') {
		makeLoaded.call(this);
	}
}
462017
function() {
			delete this.stopped;
			if (this.callback) {
				try{
					this.module.exports = this.callback();
				}catch(e) {
					if (e === STOP_EVENT) {
						this.onfail();
					}else{
						return this.onfail();
					}
				}
				return this.onload();
			}else{
				this.create();
				this.bind();
				document.head.appendChild(this.tag);
			}
		}
901395
@Override
    public void onBrowserEvent(Event event) {

        switch (DOM.eventGetType(event)) {
            case Event.ONMOUSEUP:
                Event.releaseCapture(getElement());
                m_capturedMouse = false;
                break;
            case Event.ONMOUSEDOWN:
                Event.setCapture(getElement());
                m_capturedMouse = true;
                //$FALL-THROUGH$
            case Event.ONMOUSEMOVE:
                if (m_capturedMouse) {
                    event.preventDefault();
                    double abolut_top = getAbsoluteTop();
                    int y = ((event.getClientY() - (int)abolut_top) + Window.getScrollTop());
                    setSliderPosition(y);
                    if (m_parent != null) {
                        m_parent.onBarSelected(y);
                    }
                }
                //$FALL-THROUGH$
            default:

        }
    }
1111636
function(event){
			var self = this;
			self.$instance.hide().appendTo(self.root);
			if((!event || !event.isDefaultPrevented())
				&& self.beforeOpen(event) !== false) {

				if(event){
					event.preventDefault();
				}
				var $content = self.getContent();

				if($content) {
					opened.push(self);

					toggleGlobalEvents(true);

					self.$instance.fadeIn(self.openSpeed);
					self.beforeContent(event);

					/* Set content and show */
					return $.when($content)
						.always(function($openendContent){
							if($openendContent) {
								self.setContent($openendContent);
								self.afterContent(event);
							}
						})
						.then(self.$instance.promise())
						/* Call afterOpen after fadeIn is done */
						.done(function(){ self.afterOpen(event); });
				}
			}
			self.$instance.detach();
			return $.Deferred().reject().promise();
		}
1115664
function() {
			if (!this._attached) {

				forEachEventType(this._eventTypes, this._handler, function(eventType) {
					var that = this;

					function handleEvent() {
						that._handleEvent.apply(that, arguments);
					}

					Box.DOM.on(this.element, eventType, handleEvent);

					this._boundHandler[eventType] = handleEvent;
				}, this);

				this._attached = true;
			}
		}
521755
function onLoad({ input }, { clickClass, onVideoShow, height }) {
  if (!isDom(input)) {
    throw new Error("input should be a DOM Element.")
  }
  let classes = document.getElementsByClassName(clickClass)
  for (let i = 0; i < classes.length; i++) {
    classes[i].onclick = function() {
      let url = this.getAttribute("data-url")
      onVideoShow(url)
      url += "?autoplay=1"
      this.parentNode.innerHTML = withoutDetailsTemplate(url, height, id)
    }
  }
}