mirror of https://github.com/keeweb/keeweb.git
fix jshint
This commit is contained in:
parent
d6625d2825
commit
f83e39b1aa
|
@ -3,16 +3,12 @@
|
|||
var Launcher = require('../comp/launcher');
|
||||
|
||||
var Storage = {
|
||||
file: new (require('./storage-file'))(),
|
||||
dropbox: new (require('./storage-dropbox'))(),
|
||||
webdav: new (require('./storage-webdav'))(),
|
||||
gdrive: new (require('./storage-gdrive'))(),
|
||||
onedrive: new (require('./storage-onedrive'))(),
|
||||
cache: new (Launcher ? require('./storage-file-cache') : require('./storage-cache'))()
|
||||
file: require('./storage-file'),
|
||||
dropbox: require('./storage-dropbox'),
|
||||
webdav: require('./storage-webdav'),
|
||||
gdrive: require('./storage-gdrive'),
|
||||
onedrive: require('./storage-onedrive'),
|
||||
cache: Launcher ? require('./storage-file-cache') : require('./storage-cache')
|
||||
};
|
||||
|
||||
_.forEach(Storage, function(prv) {
|
||||
prv.init();
|
||||
});
|
||||
|
||||
module.exports = Storage;
|
||||
|
|
|
@ -29,6 +29,7 @@ _.extend(StorageBase.prototype, {
|
|||
}
|
||||
}
|
||||
this.logger = new Logger('storage-' + this.name);
|
||||
return this;
|
||||
},
|
||||
|
||||
_xhr: function(config) {
|
||||
|
|
|
@ -114,4 +114,4 @@ var StorageCache = StorageBase.extend({
|
|||
}
|
||||
});
|
||||
|
||||
module.exports = StorageCache;
|
||||
module.exports = new StorageCache();
|
||||
|
|
|
@ -213,4 +213,4 @@ var StorageDropbox = StorageBase.extend({
|
|||
}
|
||||
});
|
||||
|
||||
module.exports = StorageDropbox;
|
||||
module.exports = new StorageDropbox();
|
||||
|
|
|
@ -39,13 +39,13 @@ var StorageFileCache = StorageBase.extend({
|
|||
if (err) {
|
||||
return callback && callback(err);
|
||||
}
|
||||
var ts = logger.ts();
|
||||
var ts = that.logger.ts();
|
||||
try {
|
||||
Launcher.writeFile(that.getPath(id), data);
|
||||
logger.debug('Saved', id, logger.ts(ts));
|
||||
that.logger.debug('Saved', id, that.logger.ts(ts));
|
||||
if (callback) { callback(); }
|
||||
} catch (e) {
|
||||
logger.error('Error saving to cache', id, e);
|
||||
that.logger.error('Error saving to cache', id, e);
|
||||
if (callback) { callback(e); }
|
||||
}
|
||||
});
|
||||
|
@ -93,4 +93,4 @@ var StorageFileCache = StorageBase.extend({
|
|||
}
|
||||
});
|
||||
|
||||
module.exports = StorageFileCache;
|
||||
module.exports = new StorageFileCache();
|
||||
|
|
|
@ -109,4 +109,4 @@ var StorageFile = StorageBase.extend({
|
|||
}
|
||||
});
|
||||
|
||||
module.exports = StorageFile;
|
||||
module.exports = new StorageFile();
|
||||
|
|
|
@ -62,7 +62,7 @@ var StorageGDrive = StorageBase.extend({
|
|||
return callback && callback(null, { rev: rev });
|
||||
},
|
||||
error: function(err) {
|
||||
that.logger.error('Stat error', that.logger.ts(ts), resp.result.error);
|
||||
that.logger.error('Stat error', that.logger.ts(ts), err);
|
||||
return callback && callback(err);
|
||||
}
|
||||
});
|
||||
|
@ -213,4 +213,4 @@ var StorageGDrive = StorageBase.extend({
|
|||
}
|
||||
});
|
||||
|
||||
module.exports = StorageGDrive;
|
||||
module.exports = new StorageGDrive();
|
||||
|
|
|
@ -33,4 +33,4 @@ var StorageOneDrive = StorageBase.extend({
|
|||
}
|
||||
});
|
||||
|
||||
module.exports = StorageOneDrive;
|
||||
module.exports = new StorageOneDrive();
|
||||
|
|
|
@ -192,4 +192,4 @@ var StorageWebDav = StorageBase.extend({
|
|||
}
|
||||
});
|
||||
|
||||
module.exports = StorageWebDav;
|
||||
module.exports = new StorageWebDav();
|
||||
|
|
Loading…
Reference in New Issue