callback for script loads, used to check status of loading.

@param {Event} evt the event from the browser for the script
that was loaded.
18926
function (evt) {
          //Using currentTarget instead of target for Firefox 2.0's sake. Not
          //all old browsers will be supported, but this one was easy enough
          //to support and still makes sense.
          if (
            evt.type === "load" ||
            readyRegExp.test((evt.currentTarget || evt.srcElement).readyState)
          ) {
            //Reset interactive script so a script node is not held onto for
            //to long.
            interactiveScript = null;

            //Pull out the name of the module and the context.
            var data = getScriptData(evt);
            context.completeLoad(data.id);
          }
        }
1051507
function (evt) {
      var evh = this.evtHandlers, et = evt.type;
      if (evh) {
          for (var i = 0, sz = evh.length; sz > i; i++) {
              if (evh[i].evtType === et) {
                  evh[i].executeCb(evt, this.eh, this.parent.vscope);
                  break;
              }
          }
      }
  }
416189
def on_event(self, evt, is_final):
        
        for msg in XmlHelper.message_iter(evt):
            # Single security element in historical request
            node = msg.GetElement('securityData')
            if node.HasElement('securityError'):
                secid = XmlHelper.get_child_value(node, 'security')
                self.security_errors.append(XmlHelper.as_security_error(node.GetElement('securityError'), secid))
            else:
                self.on_security_data_node(node)
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);
	}
}
1303737
function(evt) {
        evt.layer.events.on({
            tileloadstart: this.makeSameOrigin,
            tileloaded: this.onTileLoaded,
            scope: this
        });        
    }
484581
function (evt) {
                var args = mapReadyHandlerArgs[evt.mapId];
                if (args) {
                    this._triggerLoadingIndicator(args.container, false);
                    delete mapReadyHandlerArgs[evt.mapId];
                    this._listeners--;
                    if (this._listeners === 0) {
                        this.mapManager.$removeListeners({
                            "mapReady" : {
                                fn : this._removeLoadingIndicator,
                                scope : this
                            }
                        });
                    }

                }
            }
960798
function (evt) {
            if(this.fireEvent('before' + evt.type.replace(/^on/, '').toLowerCase()) === false){
                return false;
            }
            if(this.fireEvent(evt.type.replace(/^on/, ''), evt) === false){
                return false;
            }
            return this.fireEvent('after' + evt.type.replace(/^on/, '').toLowerCase())
        }
836088
function (evt, callback) {
    var self = this;

    var payload = evt;

    if (self.payload && self.payload !== '') {
      payload = dotty.get(evt, self.payload);
    }

    if (self.evtExtFn.length === 3) {
      if (self.id) {
        self.extractId(evt, function (err, id) {
          if (err) {
            debug(err);
            return callback(err);
          }

          self.loadViewModel(id, function (err, vm) {
            if (err) {
              debug(err);
              return callback(err);
            }

            try {
              self.evtExtFn(_.cloneDeep(payload), vm, function () {
                try {
                  callback.apply(this, _.toArray(arguments));
                } catch (e) {
                  debug(e);
                  process.emit('uncaughtException', e);
                }
              });
            } catch (e) {
              debug(e);
              process.emit('uncaughtException', e);
            }
          });
        });
        return;
      }

      try {
        self.evtExtFn(_.cloneDeep(payload), self.collection, function () {
          try {
            callback.apply(this, _.toArray(arguments));
          } catch (e) {
            debug(e);
            process.emit('uncaughtException', e);
          }
        });
      } catch (e) {
        debug(e);
        process.emit('uncaughtException', e);
      }
      return;
    }

    if (self.evtExtFn.length === 1) {
      try {
        var res = self.evtExtFn(evt);
        try {
          callback(null, res);
        } catch (e) {
          debug(e);
          process.emit('uncaughtException', e);
        }
      } catch (e) {
        debug(e);
        process.emit('uncaughtException', e);
      }
      return;
    }

    if (self.evtExtFn.length === 2) {
      if (!self.collection || !self.id) {
        try {
          self.evtExtFn(evt, function () {
            try {
              callback.apply(this, _.toArray(arguments));
            } catch (e) {
              debug(e);
              process.emit('uncaughtException', e);
            }
          });
        } catch (e) {
          debug(e);
          process.emit('uncaughtException', e);
        }
        return;
      }

      self.extractId(evt, function (err, id) {
        if (err) {
          debug(err);
          return callback(err);
        }

        self.loadViewModel(id, function (err, vm) {
          if (err) {
            debug(err);
            return callback(err);
          }

          try {
            var res = self.evtExtFn(_.cloneDeep(payload), vm);
            try {
              callback(null, res);
            } catch (e) {
              debug(e);
              process.emit('uncaughtException', e);
            }
          } catch (e) {
            debug(e);
            process.emit('uncaughtException', e);
          }
        });
      });
    }
  }
175194
function (evt) {
        this.lastMoveEvt = evt;
        if (this.started && !this.timeoutId && (evt.xy.x != this.last.x ||
                                                evt.xy.y != this.last.y)) {
            if(this.documentDrag === true && this.documentEvents) {
                if(evt.element === document) {
                    this.adjustXY(evt);
                    // do setEvent manually because the documentEvents are not
                    // registered with the map
                    this.setEvent(evt);
                } else {
                    this.removeDocumentEvents();
                }
            }
            if (this.interval > 0) {
                this.timeoutId = setTimeout(
                    OpenLayers.Function.bind(this.removeTimeout, this),
                    this.interval);
            }
            this.dragging = true;

            this.move(evt);
            this.callback("move", [evt.xy]);
            if(!this.oldOnselectstart) {
                this.oldOnselectstart = document.onselectstart;
                document.onselectstart = OpenLayers.Function.False;
            }
            this.last = evt.xy;
        }
        return true;
    }
891032
function loadScript(url, done) {
  var script = doc.createElement('script');
  script.src = url;
  script.onload = onreadystatechange = function() {
    if (!this.readyState ||
        this.readyState === 'load' ||
        this.readyState === 'complete') {
      done && done();
      script.onload = onreadystatechange
      script.parentNode.removeChild(script);
    }
  };
  body.appendChild(script);
}
954126
def on(self, evt, func):
        ''''''
        if evt not in self._callbacks:
            raise NotImplementedError('callback "%s"' % evt)
        else:
            self._callbacks[evt] = func
583042
function(err)
  {
    // we're done loading
    self._isLoading = false;

    // emit an event to notify subscribers
    self.emit('loadcomplete', err, self);

    // invoke the callback if one was specified
    if (Util.isFunction(callback))
    {
      callback(err, self);
    }
  }
823610
function() {
			this.loaded		= false;
			this.stopped	= true;

			var current = Script.current(this.loader);

			// Unbind and remove the relevant tag, if any.
			this.destroy();

			// Welcome traveller!  You've discovered the ugly truth!  This is
			// the 'magic' of the require script, allowing execution to be
			// halted until dependencies have been satisfied.  Basically it:
			//
			// * Sets up top level error handlers
			// * throws an error
			// * catches that error at the top level
			// * reverts the handling functionality back to its original state
			//
			// It is definitely not pretty, but by doing so we can halt
			// execution of a script at an arbitrary point, as long as the stack
			// does not have any `try{ ... }catch{ ... }` blocks along the way.
			var existing	= window.onerror,
				tag			= this.tag;

			function handler(event) {
				if (event.target !== window) {
					return true;
				}

				if (root.removeEventListener) {
					root.removeEventListener('error', handler, true);
				}else root.detachEvent('onerror', handler);

				window.onerror = existing;
				return Event.cancel(event);
			}

			window.onerror = handler;
			if (root.addEventListener) {
				root.addEventListener('error', handler, true);
			}else root.attachEvent('onerror', handler);

			throw STOP_EVENT;

		}
1007163
function (scriptUrl, guid, callback) {
        var script = document.createElement('script');

        script.type = 'text/javascript';
        script.setAttribute('ortcScriptId', guid);

        waitingClusterResponse = true;

        if (script.readyState) { // IE
            script.onreadystatechange = function () {
                if (script.readyState == 'loaded' || script.readyState == 'complete') {
                    waitingClusterResponse = false;
                    script.onreadystatechange = null;

                    if (typeof (SOCKET_SERVER) != 'undefined' && SOCKET_SERVER.indexOf('undefined') < 0 && SOCKET_SERVER.indexOf('unknown_server') < 0) {
                        callback(true, guid);
                    } else {
                        callback(false, guid);
                    }
                }
            };
        } else { // Others
            script.onload = function () {
                waitingClusterResponse = false;

                if (typeof (SOCKET_SERVER) != 'undefined' && SOCKET_SERVER.indexOf('undefined') < 0 && SOCKET_SERVER.indexOf('unknown_server') < 0) {
                    callback(true, guid);
                } else {
                    callback(false, guid);
                }
            };
        }

        script.onerror = function () {
            waitingClusterResponse = false;
        }

        script.src = scriptUrl;

        document.getElementsByTagName('head')[0].appendChild(script);
    }
84490
function (evt, args) {
            var smList = this._smList;
            if (smList) {
                // smList can be null if the module is in the process of being disposed
                for (var i = 0, l = smList.length; i < l; i++) {
                    if (smList[i] == evt.src) {
                        ariaUtilsArray.removeAt(smList, i);
                        if (evt.reloadingObject) {
                            evt.reloadingObject.$onOnce({
                                "objectLoaded" : {
                                    scope : this,
                                    fn : this.__onSubModuleReloaded
                                }
                            });
                        }
                        break;
                    }
                }
            }
        }
336880
function (evt) {
        if (!this.includeXY) {
            this.clearMouseCache();
        } else if (!this.element.hasScrollEvent) {
            OpenLayers.Event.observe(window, "scroll", this.clearMouseListener);
            this.element.hasScrollEvent = true;
        }
        
        if (!this.element.scrolls) {
            var viewportElement = OpenLayers.Util.getViewportElement();
            this.element.scrolls = [
                window.pageXOffset || viewportElement.scrollLeft,
                window.pageYOffset || viewportElement.scrollTop
            ];
        }

        if (!this.element.lefttop) {
            this.element.lefttop = [
                (document.documentElement.clientLeft || 0),
                (document.documentElement.clientTop  || 0)
            ];
        }
        
        if (!this.element.offsets) {
            this.element.offsets = OpenLayers.Util.pagePosition(this.element);
        }

        return new OpenLayers.Pixel(
            (evt.clientX + this.element.scrolls[0]) - this.element.offsets[0]
                         - this.element.lefttop[0], 
            (evt.clientY + this.element.scrolls[1]) - this.element.offsets[1]
                         - this.element.lefttop[1]
        ); 
    }
1230885
function(src) {
    var _deferred = $q.defer();

    // Instance
    var _loadable = {

      src: src,

      // Loading completion flag
      isComplete: false,

      promise: _deferred.promise,

      // TODO switch to $document
      $element: document.createElement('script')
    };

    // Build DOM element
    _loadable.$element.src = src;
    _loadable.$element.type = 'text/javascript';
    _loadable.$element.async = false;

    _head.insertBefore(_loadable.$element, _head.firstChild);

    // Mark loading in progress
    _loadingList.push(_loadable);

    // Completion
    _loadable.$element.onload = _loadable.$element.onreadystatechange = function() {

      if(!_loadable.isComplete && (!this.readyState || this.readyState === "loaded" || this.readyState === "complete")) {
        _loadable.isComplete = true;
        _loadable.$element.onload = _loadable.$element.onreadystatechange = null;
        
        if(_head && _loadable.$element.parentNode) {
          _head.removeChild(_loadable.$element);
        }

        // Mark complete
        var i = _loadingList.indexOf(_loadable);
        if(i !== -1) {
          _loadingList.splice(i, 1);
        }
        _completedList.push(_loadable);

        _deferred.resolve(_loadable);
      }
    };

    return _loadable;
  }