mirror of
https://github.com/keeweb/keeweb.git
synced 2024-06-28 07:50:55 +02:00
commented out hard-coded dropbox code
This commit is contained in:
parent
c33031dd57
commit
cc907749e2
|
@ -7,7 +7,6 @@ var Backbone = require('backbone'),
|
||||||
Launcher = require('../../comp/launcher'),
|
Launcher = require('../../comp/launcher'),
|
||||||
Storage = require('../../storage'),
|
Storage = require('../../storage'),
|
||||||
Links = require('../../const/links'),
|
Links = require('../../const/links'),
|
||||||
DropboxLink = require('../../comp/dropbox-link'),
|
|
||||||
Format = require('../../util/format'),
|
Format = require('../../util/format'),
|
||||||
Locale = require('../../util/locale'),
|
Locale = require('../../util/locale'),
|
||||||
kdbxweb = require('kdbxweb'),
|
kdbxweb = require('kdbxweb'),
|
||||||
|
@ -200,45 +199,45 @@ var SettingsFileView = Backbone.View.extend({
|
||||||
Alerts.notImplemented();
|
Alerts.notImplemented();
|
||||||
},
|
},
|
||||||
|
|
||||||
saveToDropbox: function() {
|
// saveToDropbox: function() {
|
||||||
var that = this;
|
// var that = this;
|
||||||
this.model.set('syncing', true);
|
// this.model.set('syncing', true);
|
||||||
DropboxLink.authenticate(function(err) {
|
// DropboxLink.authenticate(function(err) {
|
||||||
that.model.set('syncing', false);
|
// that.model.set('syncing', false);
|
||||||
if (err) {
|
// if (err) {
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
if (that.model.get('storage') === 'dropbox') {
|
// if (that.model.get('storage') === 'dropbox') {
|
||||||
that.save();
|
// that.save();
|
||||||
} else {
|
// } else {
|
||||||
that.model.set('syncing', true);
|
// that.model.set('syncing', true);
|
||||||
DropboxLink.list('', function(err, files) { // TODO: replace with actual path
|
// DropboxLink.list('', function(err, files) { // TODO: replace with actual path
|
||||||
that.model.set('syncing', false);
|
// that.model.set('syncing', false);
|
||||||
if (!files) { return; }
|
// if (!files) { return; }
|
||||||
var expName = that.model.get('name').toLowerCase();
|
// var expName = that.model.get('name').toLowerCase();
|
||||||
var existingPath = files.filter(function(f) { return f.toLowerCase().replace('/', '') === expName; })[0];
|
// var existingPath = files.filter(function(f) { return f.toLowerCase().replace('/', '') === expName; })[0];
|
||||||
if (existingPath) {
|
// if (existingPath) {
|
||||||
Alerts.yesno({
|
// Alerts.yesno({
|
||||||
icon: 'dropbox',
|
// icon: 'dropbox',
|
||||||
header: Locale.setFileAlreadyExists,
|
// header: Locale.setFileAlreadyExists,
|
||||||
body: Locale.setFileAlreadyExistsBody.replace('{}', that.model.escape('name')),
|
// body: Locale.setFileAlreadyExistsBody.replace('{}', that.model.escape('name')),
|
||||||
success: function() {
|
// success: function() {
|
||||||
that.model.set('syncing', true);
|
// that.model.set('syncing', true);
|
||||||
DropboxLink.deleteFile(existingPath, function(err) {
|
// DropboxLink.deleteFile(existingPath, function(err) {
|
||||||
that.model.set('syncing', false);
|
// that.model.set('syncing', false);
|
||||||
if (!err) {
|
// if (!err) {
|
||||||
that.save({storage: 'dropbox'});
|
// that.save({storage: 'dropbox'});
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
} else {
|
// } else {
|
||||||
that.save({storage: 'dropbox'});
|
// that.save({storage: 'dropbox'});
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
},
|
// },
|
||||||
|
|
||||||
closeFile: function() {
|
closeFile: function() {
|
||||||
if (this.model.get('modified')) {
|
if (this.model.get('modified')) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user