keeweb/app/scripts/storage/storage-dropbox.js

21 lines
487 B
JavaScript
Raw Normal View History

2015-12-02 21:39:40 +01:00
'use strict';
var DropboxLink = require('../comp/dropbox-link');
var StorageDropbox = {
name: 'dropbox',
enabled: true,
load: function(path, callback) {
2015-12-07 20:07:56 +01:00
DropboxLink.openFile(path, function(err, data, stat) {
2015-12-07 22:00:44 +01:00
if (callback) { callback(err, data, stat ? stat.versionTag : null); }
2015-12-07 20:07:56 +01:00
});
2015-12-02 21:39:40 +01:00
},
save: function(path, data, callback) {
2015-12-07 22:00:44 +01:00
DropboxLink.saveFile(path, data, true, callback || _.noop);
2015-12-02 21:39:40 +01:00
}
};
module.exports = StorageDropbox;