diff options
author | Jose Antonio Marquez | 2012-02-07 17:03:44 -0800 |
---|---|---|
committer | Jose Antonio Marquez | 2012-02-07 17:03:44 -0800 |
commit | af58afcffff5ac556d16f050a325ac0406897fcd (patch) | |
tree | 7f2051ae72c2263549cb947d353d36509c1cc39d /js/io/system/chromeapi.js | |
parent | b91f9cf6fea870f75dad3e446fe8f47d9bf81b8f (diff) | |
download | ninja-af58afcffff5ac556d16f050a325ac0406897fcd.tar.gz |
Copy local library to cloud
Adding functionality to copy a local library to the cloud. Currently creating directory structure. Need to add ability to copy files and ensure proper mime-type is set.
Diffstat (limited to 'js/io/system/chromeapi.js')
-rw-r--r-- | js/io/system/chromeapi.js | 43 |
1 files changed, 41 insertions, 2 deletions
diff --git a/js/io/system/chromeapi.js b/js/io/system/chromeapi.js index 2fc8769c..fc93b22a 100644 --- a/js/io/system/chromeapi.js +++ b/js/io/system/chromeapi.js | |||
@@ -7,11 +7,10 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
7 | /* ///////////////////////////////////////////////////////////////////// | 7 | /* ///////////////////////////////////////////////////////////////////// |
8 | //////////////////////////////////////////////////////////////////////// | 8 | //////////////////////////////////////////////////////////////////////// |
9 | NOTES: | 9 | NOTES: |
10 | |||
10 | The init function starts up the file system API, and a size must be | 11 | The init function starts up the file system API, and a size must be |
11 | set, no unlimited available as of now. | 12 | set, no unlimited available as of now. |
12 | 13 | ||
13 | Core API reference in NINJA: this.application.ninja.coreIoApi | ||
14 | |||
15 | //////////////////////////////////////////////////////////////////////// | 14 | //////////////////////////////////////////////////////////////////////// |
16 | ///////////////////////////////////////////////////////////////////// */ | 15 | ///////////////////////////////////////////////////////////////////// */ |
17 | // | 16 | // |
@@ -123,6 +122,46 @@ exports.ChromeApi = Montage.create(Object.prototype, { | |||
123 | } | 122 | } |
124 | }, | 123 | }, |
125 | //////////////////////////////////////////////////////////////////// | 124 | //////////////////////////////////////////////////////////////////// |
125 | // | ||
126 | fileDelete: { | ||
127 | enumerable: true, | ||
128 | value: function(filePath, callback) { | ||
129 | this.fileSystem.root.getFile(filePath, {create: false}, function(file) { | ||
130 | file.remove(function() { | ||
131 | if (callback) callback(true); | ||
132 | }); | ||
133 | }, function (e) {if (callback) callback(false)}); | ||
134 | } | ||
135 | }, | ||
136 | //////////////////////////////////////////////////////////////////// | ||
137 | // | ||
138 | fileContent: { | ||
139 | enumerable: true, | ||
140 | value: function() { | ||
141 | } | ||
142 | }, | ||
143 | //////////////////////////////////////////////////////////////////// | ||
144 | // | ||
145 | fileCopy: { | ||
146 | enumerable: true, | ||
147 | value: function() { | ||
148 | } | ||
149 | }, | ||
150 | //////////////////////////////////////////////////////////////////// | ||
151 | // | ||
152 | fileRename: { | ||
153 | enumerable: true, | ||
154 | value: function() { | ||
155 | } | ||
156 | }, | ||
157 | //////////////////////////////////////////////////////////////////// | ||
158 | // | ||
159 | fileMove: { | ||
160 | enumerable: true, | ||
161 | value: function() { | ||
162 | } | ||
163 | }, | ||
164 | //////////////////////////////////////////////////////////////////// | ||
126 | //Creating directory from path, callback optional | 165 | //Creating directory from path, callback optional |
127 | directoryNew: { | 166 | directoryNew: { |
128 | enumerable: true, | 167 | enumerable: true, |