From 1354d17270961fff662d40f90521223f8fd0d73b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 14 Aug 2012 18:59:10 +0400 Subject: update dojo to 1.7.3 --- lib/dojo/io/script.js.uncompressed.js | 256 ++++++++++++++++++++++++++++++++++ 1 file changed, 256 insertions(+) create mode 100644 lib/dojo/io/script.js.uncompressed.js (limited to 'lib/dojo/io/script.js.uncompressed.js') diff --git a/lib/dojo/io/script.js.uncompressed.js b/lib/dojo/io/script.js.uncompressed.js new file mode 100644 index 000000000..628e31948 --- /dev/null +++ b/lib/dojo/io/script.js.uncompressed.js @@ -0,0 +1,256 @@ +define("dojo/io/script", ["../main"], function(dojo) { + // module: + // dojo/io/script + // summary: + // TODOC + + dojo.getObject("io", true, dojo); + +/*===== +dojo.declare("dojo.io.script.__ioArgs", dojo.__IoArgs, { + constructor: function(){ + // summary: + // All the properties described in the dojo.__ioArgs type, apply to this + // type as well, EXCEPT "handleAs". It is not applicable to + // dojo.io.script.get() calls, since it is implied by the usage of + // "jsonp" (response will be a JSONP call returning JSON) + // or the response is pure JavaScript defined in + // the body of the script that was attached. + // callbackParamName: String + // Deprecated as of Dojo 1.4 in favor of "jsonp", but still supported for + // legacy code. See notes for jsonp property. + // jsonp: String + // The URL parameter name that indicates the JSONP callback string. + // For instance, when using Yahoo JSONP calls it is normally, + // jsonp: "callback". For AOL JSONP calls it is normally + // jsonp: "c". + // checkString: String + // A string of JavaScript that when evaluated like so: + // "typeof(" + checkString + ") != 'undefined'" + // being true means that the script fetched has been loaded. + // Do not use this if doing a JSONP type of call (use callbackParamName instead). + // frameDoc: Document + // The Document object for a child iframe. If this is passed in, the script + // will be attached to that document. This can be helpful in some comet long-polling + // scenarios with Firefox and Opera. + this.callbackParamName = callbackParamName; + this.jsonp = jsonp; + this.checkString = checkString; + this.frameDoc = frameDoc; + } +}); +=====*/ + + var loadEvent = dojo.isIE ? "onreadystatechange" : "load", + readyRegExp = /complete|loaded/; + + dojo.io.script = { + get: function(/*dojo.io.script.__ioArgs*/args){ + // summary: + // sends a get request using a dynamically created script tag. + var dfd = this._makeScriptDeferred(args); + var ioArgs = dfd.ioArgs; + dojo._ioAddQueryToUrl(ioArgs); + + dojo._ioNotifyStart(dfd); + + if(this._canAttach(ioArgs)){ + var node = this.attach(ioArgs.id, ioArgs.url, args.frameDoc); + + //If not a jsonp callback or a polling checkString case, bind + //to load event on the script tag. + if(!ioArgs.jsonp && !ioArgs.args.checkString){ + var handle = dojo.connect(node, loadEvent, function(evt){ + if(evt.type == "load" || readyRegExp.test(node.readyState)){ + dojo.disconnect(handle); + ioArgs.scriptLoaded = evt; + } + }); + } + } + + dojo._ioWatch(dfd, this._validCheck, this._ioCheck, this._resHandle); + return dfd; + }, + + attach: function(/*String*/id, /*String*/url, /*Document?*/frameDocument){ + // summary: + // creates a new