dojo » _xdWatchInFlight
dojo._xdWatchInFlight
<script src="../../js/dojo.js"></script>
defined in dojo/_base/_loader/loader_xd.js
Internal xd loader function. Monitors in-flight requests for xd module resources.
Usage
function () (view source)
var noLoads = ""; var waitInterval = (dojo.config.xdWaitSeconds || 15) * 1000; var expired = (this._xdStartTime + waitInterval) < (new Date()).getTime(); //If any xdInFlight are true, then still waiting for something to load. //Come back later. If we timed out, report the things that did not load. for(var param in this._xdInFlight){ if(this._xdInFlight[param] === true){ if(expired){ noLoads += param + " "; }else{ return; } } } //All done. Clean up and notify. this._xdClearInterval(); if(expired){ throw "Could not load cross-domain resources: " + noLoads; } this._xdWalkReqs(); var defLength = this._xdDefList.length; for(var i= 0; i < defLength; i++){ var content = dojo._xdDefList[i]; if(dojo.config["debugAtAllCosts"] && content["resourceName"]){ if(!this["_xdDebugQueue"]){ this._xdDebugQueue = []; } this._xdDebugQueue.push({resourceName: content.resourceName, resourcePath: content.resourcePath}); }else{ //Evaluate the resource to bring it into being. //Pass in scope args to allow multiple versions of modules in a page. content.apply(dojo.global, dojo._scopeArgs); } } //Evaluate any resources that were not evaled before. //This normally shouldn't happen with proper dojo.provide and dojo.require //usage, but providing it just in case. Note that these may not be executed //in the original order that the developer intended. for(var i = 0; i < this._xdContents.length; i++){ var current = this._xdContents[i]; if(current.content && !current.isDefined){ //Pass in scope args to allow multiple versions of modules in a page. current.content.apply(dojo.global, dojo._scopeArgs); } } //Clean up for the next round of xd loading. this._xdReset(); if(this["_xdDebugQueue"] && this._xdDebugQueue.length > 0){ this._xdDebugFileLoaded(); }else{ this._xdNotifyLoaded(); }