aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dojox/io/xhrMultiPart.js
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
commit1c5685d68f1b73270fb814fe04cbb490eb90ba5f (patch)
tree3d3ada08a934b96fc31531f1327690d7edc6f766 /includes/js/dojox/io/xhrMultiPart.js
parent104d59099e048688c4dbac37d72137006e396558 (diff)
downloadsemanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.gz
semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.bz2
Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojox/io/xhrMultiPart.js')
-rw-r--r--includes/js/dojox/io/xhrMultiPart.js81
1 files changed, 0 insertions, 81 deletions
diff --git a/includes/js/dojox/io/xhrMultiPart.js b/includes/js/dojox/io/xhrMultiPart.js
deleted file mode 100644
index 5792267..0000000
--- a/includes/js/dojox/io/xhrMultiPart.js
+++ /dev/null
@@ -1,81 +0,0 @@
-if(!dojo._hasResource["dojox.io.xhrMultiPart"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojox.io.xhrMultiPart"] = true;
-dojo.provide("dojox.io.xhrMultiPart");
-
-dojo.require("dojo._base.xhr");
-dojo.require("dojox.uuid.generateRandomUuid");
-
-(function(){
- function _createPart(args, boundary){
- if(!args["name"] && !args["content"]){
- throw new Error("Each part of a multi-part request requires 'name' and 'content'.");
- }
-
- var tmp = [];
- tmp.push("--" + boundary,
- "Content-Disposition: form-data; name=\"" + args.name + "\"" +
- (args["filename"] ? "; filename=\"" + args.filename + "\"" : ""));
-
- if(args["contentType"]){
- var ct = "Content-Type: " + args.contentType;
- if(args["charset"]){
- ct += "; Charset=" + args.charset;
- }
- tmp.push(ct);
- }
-
- if(args["contentTransferEncoding"]){
- tmp.push("Content-Transfer-Encoding: " + args.contentTransferEncoding);
- }
-
- tmp.push("", args.content);
-
- return tmp;
- }
-
- function _needIframe(node){
- return (!!(dojo.query("input[type=file]", node).length));
- }
-
- function _partsFromNode(node, boundary){
- // TODO: write this function!
- var tmp = [];
- return tmp;
- }
-
- dojox.io.xhrMultiPart = function(args){
- if(!args["file"] && !args["form"]){
- throw new Error("file or form must be provided to dojox.io.xhrMultiPart's arguments");
- }
-
- // unique guid as a boundary value for multipart posts
- var boundary = dojox.uuid.generateRandomUuid();
-
- var tmp = [];
- var out = "";
-
- if(args["file"]){
- var d = (dojo.isArray(args.file) ? args.file : [args.file]);
-
- for(var i=0; i < d.length; i++){
- tmp = tmp.concat(_createPart(d[i], boundary));
- }
- }
-
- if(args["form"]){
- tmp = tmp.concat(_partsFromNode(args["form"], boundary));
- }
-
- if(tmp.length){
- tmp.push("--"+boundary+"--", "");
- out = tmp.join("\r\n");
- }
-
- return dojo.rawXhrPost(dojo.mixin(args, {
- contentType: "multipart/form-data; boundary=" + boundary,
- postData: out
- }));
- }
-})();
-
-}