aboutsummaryrefslogtreecommitdiff
path: root/js/io/system
diff options
context:
space:
mode:
authorJohn Mayhew2012-04-02 16:28:39 -0700
committerJohn Mayhew2012-04-02 16:28:39 -0700
commitb4155fb4c33675a8a7cd37473513718043fdf0ba (patch)
tree3d8c802473f2395d53d599ec9d8b70b60a4db50c /js/io/system
parent5ba9aeac94c86049423fd5d4b37b277263939c13 (diff)
parentc6de22bf42be90b403491b5f87b1818d9020310c (diff)
downloadninja-b4155fb4c33675a8a7cd37473513718043fdf0ba.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into WorkingBranch
Conflicts: js/helper-classes/RDGE/rdge-compiled.js js/helper-classes/RDGE/runtime/GLRuntime.js js/helper-classes/RDGE/src/core/script/MeshManager.js js/helper-classes/RDGE/src/core/script/engine.js js/helper-classes/RDGE/src/core/script/fx/ssao.js js/helper-classes/RDGE/src/core/script/init_state.js js/helper-classes/RDGE/src/core/script/run_state.js js/helper-classes/RDGE/src/core/script/scenegraphNodes.js js/helper-classes/RDGE/src/core/script/utilities.js js/helper-classes/RDGE/src/tools/compile-rdge-core.bat js/helper-classes/RDGE/src/tools/compile-rdge-core.sh js/helper-classes/RDGE/src/tools/rdge-compiled.js js/lib/drawing/world.js js/lib/rdge/materials/bump-metal-material.js js/lib/rdge/materials/deform-material.js js/lib/rdge/materials/flat-material.js js/lib/rdge/materials/fly-material.js js/lib/rdge/materials/julia-material.js js/lib/rdge/materials/keleidoscope-material.js js/lib/rdge/materials/linear-gradient-material.js js/lib/rdge/materials/mandel-material.js js/lib/rdge/materials/plasma-material.js js/lib/rdge/materials/pulse-material.js js/lib/rdge/materials/radial-blur-material.js js/lib/rdge/materials/radial-gradient-material.js js/lib/rdge/materials/relief-tunnel-material.js js/lib/rdge/materials/square-tunnel-material.js js/lib/rdge/materials/star-material.js js/lib/rdge/materials/taper-material.js js/lib/rdge/materials/tunnel-material.js js/lib/rdge/materials/twist-material.js js/lib/rdge/materials/twist-vert-material.js js/lib/rdge/materials/uber-material.js js/lib/rdge/materials/water-material.js js/lib/rdge/materials/z-invert-material.js js/preloader/Preloader.js
Diffstat (limited to 'js/io/system')
-rwxr-xr-xjs/io/system/coreioapi.js6
-rw-r--r--js/io/system/ninjalibrary.js10
-rw-r--r--js/io/system/ninjalibrary.json4
3 files changed, 11 insertions, 9 deletions
diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js
index f428a229..b0ffe2d8 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
diff --git a/js/io/system/ninjalibrary.js b/js/io/system/ninjalibrary.js
index 960bdef9..201598fc 100644
--- a/js/io/system/ninjalibrary.js
+++ b/js/io/system/ninjalibrary.js
@@ -82,7 +82,7 @@ exports.NinjaLibrary = Montage.create(Object.prototype, {
82 // 82 //
83 copyLibToCloud: { 83 copyLibToCloud: {
84 enumerable: false, 84 enumerable: false,
85 value: function (path, libName) { 85 value: function (path, libName, callback) {
86 // 86 //
87 if(this.coreApi.directoryExists({uri: path+libName}).status === 404) { 87 if(this.coreApi.directoryExists({uri: path+libName}).status === 404) {
88 this.chromeApi.directoryContents(this.chromeApi.fileSystem.root, function (contents) { 88 this.chromeApi.directoryContents(this.chromeApi.fileSystem.root, function (contents) {
@@ -91,7 +91,7 @@ exports.NinjaLibrary = Montage.create(Object.prototype, {
91 //Getting contents of library to be copied 91 //Getting contents of library to be copied
92 this.chromeApi.directoryContents(contents[i], function (lib) { 92 this.chromeApi.directoryContents(contents[i], function (lib) {
93 //Creating directory structure from subfolders 93 //Creating directory structure from subfolders
94 this.copyDirectoryToCloud(path, contents[i], path, function (status) {console.log(status)}); 94 this.copyDirectoryToCloud(path, contents[i], path, callback);
95 }.bind(this)); 95 }.bind(this));
96 break; 96 break;
97 } 97 }
@@ -116,7 +116,7 @@ exports.NinjaLibrary = Montage.create(Object.prototype, {
116 dir = folder.name; 116 dir = folder.name;
117 } 117 }
118 // 118 //
119 if (!this.coreApi.createDirectory({uri: dir})) { 119 if (!this.coreApi.createDirectory({uri: dir.replace(/\/\//gi, '/')})) {
120 //Error occured while creating folders 120 //Error occured while creating folders
121 return; 121 return;
122 } 122 }
@@ -132,12 +132,14 @@ exports.NinjaLibrary = Montage.create(Object.prototype, {
132 this.chromeApi.fileContent(contents[i].fullPath, function (result) { 132 this.chromeApi.fileContent(contents[i].fullPath, function (result) {
133 // 133 //
134 //this.coreApi.createFile({uri: fileRoot+result.file.fullPath, contents: blob.getBlob(result.data.type), contentType: result.data.type}); 134 //this.coreApi.createFile({uri: fileRoot+result.file.fullPath, contents: blob.getBlob(result.data.type), contentType: result.data.type});
135 this.coreApi.createFile({uri: fileRoot+result.file.fullPath, contents: result.content}); 135 this.coreApi.createFile({uri: (fileRoot+result.file.fullPath).replace(/\/\//gi, '/'), contents: result.content});
136 }.bind(this)); 136 }.bind(this));
137 } 137 }
138 } 138 }
139 }.bind(this)); 139 }.bind(this));
140 } 140 }
141 //TODO Add logic for proper callback status(es)
142 if (callback) callback(true);
141 } 143 }
142 }, 144 },
143 //////////////////////////////////////////////////////////////////// 145 ////////////////////////////////////////////////////////////////////
diff --git a/js/io/system/ninjalibrary.json b/js/io/system/ninjalibrary.json
index a61c30d1..29df45b8 100644
--- a/js/io/system/ninjalibrary.json
+++ b/js/io/system/ninjalibrary.json
@@ -1,6 +1,6 @@
1{ 1{
2 "libraries": [ 2 "libraries": [
3 {"name": "Montage", "path": "/node_modules/descriptor.json", "version": "0.6.0.0"}, 3 {"name": "Montage", "path": "/node_modules/descriptor.json", "version": "0.7.0.0"},
4 {"name": "RDGE", "path": "/assets/descriptor.json", "version": "0.5.0.1"} 4 {"name": "RDGE", "path": "/assets/descriptor.json", "version": "0.5.1.2"}
5 ] 5 ]
6} \ No newline at end of file 6} \ No newline at end of file