diff options
author | Jonathan Duran | 2012-03-14 08:59:17 -0700 |
---|---|---|
committer | Jonathan Duran | 2012-03-14 08:59:17 -0700 |
commit | e065244ac75d1d0f25fd5c75cb58e714a13fe16b (patch) | |
tree | 6b49a85a45fdd41b81be5603fbbc2e0d197eb187 /js/io/system | |
parent | e8f207dc50ad942ee8c1c1db6b146c0110ce3216 (diff) | |
download | ninja-e065244ac75d1d0f25fd5c75cb58e714a13fe16b.tar.gz |
Squashed commit of the following:
merge master into timeline
Signed-off-by: Jonathan Duran <jduran@motorola.com>
Diffstat (limited to 'js/io/system')
-rw-r--r-- | js/io/system/ninjalibrary.js | 10 | ||||
-rw-r--r-- | js/io/system/ninjalibrary.json | 2 |
2 files changed, 7 insertions, 5 deletions
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..00ee7ed2 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.6.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.0"} |
5 | ] | 5 | ] |
6 | } \ No newline at end of file | 6 | } \ No newline at end of file |