diff options
author | Nivesh Rajbhandari | 2012-04-16 16:06:24 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-04-16 16:06:24 -0700 |
commit | c253192a08b499ea7be46fa5438d273e51f7ec5a (patch) | |
tree | 18a1f0e3679c0eb993a9dedb537035d3861f49ac /js/io/system/coreioapi.js | |
parent | e19376c54eedd1f1c457ba405b2f110be376a559 (diff) | |
parent | 4b900ea5cd6bb77eb30cec8c03b9ec9fa662c1e9 (diff) | |
download | ninja-c253192a08b499ea7be46fa5438d273e51f7ec5a.tar.gz |
Merge branch 'refs/heads/ninja-internal' into WebGLFixes
Diffstat (limited to 'js/io/system/coreioapi.js')
-rwxr-xr-x | js/io/system/coreioapi.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index f428a229..a06f45c6 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js | |||
@@ -217,7 +217,7 @@ exports.CoreIoApi = Montage.create(Component, { | |||
217 | value: function(serviceURL, path) { | 217 | value: function(serviceURL, path) { |
218 | var urlOut = path.replace(/\\/g,"/"); | 218 | var urlOut = path.replace(/\\/g,"/"); |
219 | urlOut = urlOut.replace(/:/g,""); | 219 | urlOut = urlOut.replace(/:/g,""); |
220 | urlOut = encodeURI(urlOut); | 220 | urlOut = encodeURIComponent(urlOut); |
221 | //add leading / if not already there | 221 | //add leading / if not already there |
222 | if((urlOut.length > 0) && (urlOut.charAt(0) !== "/")){ | 222 | if((urlOut.length > 0) && (urlOut.charAt(0) !== "/")){ |
223 | urlOut = "/" + urlOut; | 223 | urlOut = "/" + urlOut; |
@@ -393,12 +393,12 @@ exports.CoreIoApi = Montage.create(Component, { | |||
393 | xhr = new XMLHttpRequest(); | 393 | xhr = new XMLHttpRequest(); |
394 | // | 394 | // |
395 | xhr.open("POST", serviceURL, false); | 395 | xhr.open("POST", serviceURL, false); |
396 | xhr.responseType = "arraybuffer"; | 396 | //xhr.responseType = "arraybuffer"; |
397 | if(file.contentType && file.contentType.length) | 397 | if(file.contentType && file.contentType.length) |
398 | xhr.setRequestHeader("Content-Type", file.contentType); | 398 | xhr.setRequestHeader("Content-Type", file.contentType); |
399 | else | 399 | else |
400 | xhr.setRequestHeader("Content-Type", "text/plain"); | 400 | xhr.setRequestHeader("Content-Type", "text/plain"); |
401 | 401 | ||
402 | if (file.contents) | 402 | if (file.contents) |
403 | xhr.send(file.contents); | 403 | xhr.send(file.contents); |
404 | else | 404 | else |
@@ -1085,14 +1085,14 @@ exports.CoreIoApi = Montage.create(Component, { | |||
1085 | isValidUri:{ | 1085 | isValidUri:{ |
1086 | value: function(uri){ | 1086 | value: function(uri){ |
1087 | var isWindowsUri=false, isUnixUri=false,status=false; | 1087 | var isWindowsUri=false, isUnixUri=false,status=false; |
1088 | if(uri !== ""){ | 1088 | if((uri !== null) && (uri !== "")){ |
1089 | uri = uri.replace(/^\s+|\s+$/g,""); // strip any leading or trailing spaces | 1089 | uri = uri.replace(/^\s+|\s+$/g,""); // strip any leading or trailing spaces |
1090 | 1090 | ||
1091 | //for local machine folder uri | 1091 | //for local machine folder uri |
1092 | isWindowsUri = /^([a-zA-Z]:)([\\/][^<>:"/\\|?*]+)*[\\/]?$/gi.test(uri); | 1092 | isWindowsUri = /^([a-zA-Z]:)([\\/][^<>:"/\\|?*]+)*[\\/]?$/gi.test(uri); |
1093 | isUnixUri = /^(\/)?(\/(?![.])[^/]*)*\/?$/gi.test(uri);//folders beginning with . are hidden on Mac / Unix | 1093 | isUnixUri = /^(\/)?(\/(?![.])[^/]*)*\/?$/gi.test(uri);//folders beginning with . are hidden on Mac / Unix |
1094 | status = isWindowsUri || isUnixUri; | 1094 | status = isWindowsUri || isUnixUri; |
1095 | if(isWindowsUri && isUnixUri){status = false;} | 1095 | if((uri === "") || (isWindowsUri && isUnixUri)){status = false;} |
1096 | } | 1096 | } |
1097 | return status; | 1097 | return status; |
1098 | } | 1098 | } |