[Pkg-javascript-commits] [dojo] 07/88: Update dojo/request documentation. refs #15594 !strict
David Prévot
taffit at moszumanska.debian.org
Thu Aug 21 17:39:29 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag 1.8.5
in repository dojo.
commit 8925e3194938c085072e4c76be6a5e0c6a396c37
Author: Bryan Forbes <bryan at reigndropsfall.net>
Date: Tue Aug 14 21:05:05 2012 +0000
Update dojo/request documentation. refs #15594 !strict
git-svn-id: http://svn.dojotoolkit.org/src/branches/1.8/dojo@29485 560b804f-0ae3-0310-86f3-f6aa0a117693
---
request.js | 20 +++++++++++++-------
request/iframe.js | 23 +++++++++++------------
request/node.js | 33 ++++++++++++++++++---------------
request/script.js | 21 ++++++++++-----------
request/xhr.js | 27 +++++++++++++--------------
5 files changed, 65 insertions(+), 59 deletions(-)
diff --git a/request.js b/request.js
index 2d37421..61d771e 100644
--- a/request.js
+++ b/request.js
@@ -1,7 +1,8 @@
define([
'./request/default!'/*=====,
- './_base/declare' =====*/
-], function(request/*=====, declare =====*/){
+ './_base/declare',
+ './promise/Promise' =====*/
+], function(request/*=====, declare, Promise =====*/){
/*=====
request = function(url, options){
// summary:
@@ -10,8 +11,13 @@ define([
// The URL to request.
// options: dojo/request.__Options?
// Options for the request.
- // returns: dojo/promise/Promise
+ // returns: dojo/request.__Promise
};
+ request.__Promise = declare(Promise, {
+ // response: dojo/promise/Promise
+ // A promise resolving to an object representing
+ // the response from the server.
+ });
request.__BaseOptions = declare(null, {
// query: String|Object?
// Query parameters to append to the URL.
@@ -41,7 +47,7 @@ define([
// URL to request
// options: dojo/request.__BaseOptions?
// Options for the request.
- // returns: dojo/promise/Promise
+ // returns: dojo/request.__Promise
};
request.post = function(url, options){
// summary:
@@ -50,7 +56,7 @@ define([
// URL to request
// options: dojo/request.__BaseOptions?
// Options for the request.
- // returns: dojo/promise/Promise
+ // returns: dojo/request.__Promise
};
request.put = function(url, options){
// summary:
@@ -59,7 +65,7 @@ define([
// URL to request
// options: dojo/request.__BaseOptions?
// Options for the request.
- // returns: dojo/promise/Promise
+ // returns: dojo/request.__Promise
};
request.del = function(url, options){
// summary:
@@ -68,7 +74,7 @@ define([
// URL to request
// options: dojo/request.__BaseOptions?
// Options for the request.
- // returns: dojo/promise/Promise
+ // returns: dojo/request.__Promise
};
=====*/
return request;
diff --git a/request/iframe.js b/request/iframe.js
index 6422955..5beb1bf 100644
--- a/request/iframe.js
+++ b/request/iframe.js
@@ -336,16 +336,6 @@ define([
method: 'POST'
};
function iframe(url, options, returnDeferred){
- // summary:
- // Sends a request using an iframe element with the given URL and options.
- // url: String
- // URL to request
- // options: dojo/request/iframe.__Options?
- // Options for the request.
- // returnDeferred: Boolean
- // Return a dojo/Deferred rather than a dojo/promise/Promise
- // returns: dojo/promise/Promise|dojo/Deferred
-
var response = util.parseArgs(url, util.deepCreate(defaultOptions, options), true);
url = response.url;
options = response.options;
@@ -377,6 +367,15 @@ define([
}
/*=====
+ iframe = function(url, options){
+ // summary:
+ // Sends a request using an iframe element with the given URL and options.
+ // url: String
+ // URL to request
+ // options: dojo/request/iframe.__Options?
+ // Options for the request.
+ // returns: dojo/request.__Promise
+ };
iframe.__BaseOptions = declare(request.__BaseOptions, {
// form: DOMNode?
// A form node to use to submit data to the server.
@@ -400,7 +399,7 @@ define([
// URL to request
// options: dojo/request/iframe.__BaseOptions?
// Options for the request.
- // returns: dojo/promise/Promise
+ // returns: dojo/request.__Promise
};
iframe.post = function(url, options){
// summary:
@@ -409,7 +408,7 @@ define([
// URL to request
// options: dojo/request/iframe.__BaseOptions?
// Options for the request.
- // returns: dojo/promise/Promise
+ // returns: dojo/request.__Promise
};
=====*/
iframe.create = create;
diff --git a/request/node.js b/request/node.js
index e842926..4bdf2c1 100644
--- a/request/node.js
+++ b/request/node.js
@@ -6,8 +6,10 @@ define([
'../node!http',
'../node!https',
'../node!url',
- '../node!stream'
-], function(require, util, handlers, RequestTimeoutError, http, https, URL, stream){
+ '../node!stream'/*=====,
+ '../request',
+ '../_base/declare' =====*/
+], function(require, util, handlers, RequestTimeoutError, http, https, URL, stream/*=====, request, declare =====*/){
var Stream = stream.Stream,
undefined;
@@ -18,15 +20,6 @@ define([
headers: {}
};
function node(url, options){
- // summary:
- // Sends a request using the included http or https interface from node.js
- // with the given URL and options.
- // url: String
- // URL to request
- // options: dojo/request/node.__Options?
- // Options for the request.
- // returns: dojo/promise/Promise
-
var response = util.parseArgs(url, util.deepCreate(defaultOptions, options), options && options.data instanceof Stream);
url = response.url;
options = response.options;
@@ -126,6 +119,16 @@ define([
}
/*=====
+ node = function(url, options){
+ // summary:
+ // Sends a request using the included http or https interface from node.js
+ // with the given URL and options.
+ // url: String
+ // URL to request
+ // options: dojo/request/node.__Options?
+ // Options for the request.
+ // returns: dojo/request.__Promise
+ };
node.__BaseOptions = declare(request.__BaseOptions, {
// data: String|Object|Stream?
// Data to transfer. This is ignored for GET and DELETE
@@ -151,7 +154,7 @@ define([
// URL to request
// options: dojo/request/node.__BaseOptions?
// Options for the request.
- // returns: dojo/promise/Promise
+ // returns: dojo/request.__Promise
};
node.post = function(url, options){
// summary:
@@ -160,7 +163,7 @@ define([
// URL to request
// options: dojo/request/node.__BaseOptions?
// Options for the request.
- // returns: dojo/promise/Promise
+ // returns: dojo/request.__Promise
};
node.put = function(url, options){
// summary:
@@ -169,7 +172,7 @@ define([
// URL to request
// options: dojo/request/node.__BaseOptions?
// Options for the request.
- // returns: dojo/promise/Promise
+ // returns: dojo/request.__Promise
};
node.del = function(url, options){
// summary:
@@ -178,7 +181,7 @@ define([
// URL to request
// options: dojo/request/node.__BaseOptions?
// Options for the request.
- // returns: dojo/promise/Promise
+ // returns: dojo/request.__Promise
};
=====*/
diff --git a/request/script.js b/request/script.js
index ca0c5e6..cb0ae72 100644
--- a/request/script.js
+++ b/request/script.js
@@ -103,16 +103,6 @@ define([
}
function script(url, options, returnDeferred){
- // summary:
- // Sends a request using a script element with the given URL and options.
- // url: String
- // URL to request
- // options: dojo/request/script.__Options?
- // Options for the request.
- // returnDeferred: Boolean
- // Return a dojo/Deferred rather than a dojo/promise/Promise
- // returns: dojo/promise/Promise|dojo/Deferred
-
var response = util.parseArgs(url, util.deepCopy({}, options));
url = response.url;
options = response.options;
@@ -168,6 +158,15 @@ define([
}
script.get = script;
/*=====
+ script = function(url, options){
+ // summary:
+ // Sends a request using a script element with the given URL and options.
+ // url: String
+ // URL to request
+ // options: dojo/request/script.__Options?
+ // Options for the request.
+ // returns: dojo/request.__Promise
+ };
script.__BaseOptions = declare(request.__BaseOptions, {
// jsonp: String?
// The URL parameter name that indicates the JSONP callback string.
@@ -198,7 +197,7 @@ define([
// URL to request
// options: dojo/request/script.__BaseOptions?
// Options for the request.
- // returns: dojo/promise/Promise
+ // returns: dojo/request.__Promise
};
=====*/
diff --git a/request/xhr.js b/request/xhr.js
index 6edc63f..99b3de4 100644
--- a/request/xhr.js
+++ b/request/xhr.js
@@ -128,16 +128,6 @@ define([
}
};
function xhr(url, options, returnDeferred){
- // summary:
- // Sends a request using XMLHttpRequest with the given URL and options.
- // url: String
- // URL to request
- // options: dojo/request/xhr.__Options?
- // Options for the request.
- // returnDeferred: Boolean
- // Return a dojo/Deferred rather than a dojo/promise/Promise
- // returns: dojo/promise/Promise|dojo/Deferred
-
var response = util.parseArgs(
url,
util.deepCreate(defaultOptions, options),
@@ -225,6 +215,15 @@ define([
}
/*=====
+ xhr = function(url, options){
+ // summary:
+ // Sends a request using XMLHttpRequest with the given URL and options.
+ // url: String
+ // URL to request
+ // options: dojo/request/xhr.__Options?
+ // Options for the request.
+ // returns: dojo/request.__Promise
+ };
xhr.__BaseOptions = declare(request.__BaseOptions, {
// sync: Boolean?
// Whether to make a synchronous request or not. Default
@@ -256,7 +255,7 @@ define([
// URL to request
// options: dojo/request/xhr.__BaseOptions?
// Options for the request.
- // returns: dojo/promise/Promise
+ // returns: dojo/request.__Promise
};
xhr.post = function(url, options){
// summary:
@@ -265,7 +264,7 @@ define([
// URL to request
// options: dojo/request/xhr.__BaseOptions?
// Options for the request.
- // returns: dojo/promise/Promise
+ // returns: dojo/request.__Promise
};
xhr.put = function(url, options){
// summary:
@@ -274,7 +273,7 @@ define([
// URL to request
// options: dojo/request/xhr.__BaseOptions?
// Options for the request.
- // returns: dojo/promise/Promise
+ // returns: dojo/request.__Promise
};
xhr.del = function(url, options){
// summary:
@@ -283,7 +282,7 @@ define([
// URL to request
// options: dojo/request/xhr.__BaseOptions?
// Options for the request.
- // returns: dojo/promise/Promise
+ // returns: dojo/request.__Promise
};
=====*/
xhr._create = function(){
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git
More information about the Pkg-javascript-commits
mailing list