1
0
mirror of https://github.com/keeweb/keeweb.git synced 2024-06-26 07:39:04 +02:00
keeweb/app/scripts/storage/storage-base.js
2016-03-27 10:06:23 +03:00

38 lines
852 B
JavaScript

'use strict';
var Backbone = require('backbone'),
Logger = require('../util/logger'),
AppSettingsModel = require('../models/app-settings-model');
var StorageBase = function() {
};
_.extend(StorageBase.prototype, {
name: null,
icon: null,
iconSvg: null,
enabled: false,
system: false,
uipos: null,
logger: null,
appSettings: AppSettingsModel.instance,
init: function() {
if (!this.name) {
throw 'Failed to init provider: no name';
}
if (!this.system) {
var enabled = this.appSettings.get(this.name);
if (typeof enabled === 'boolean') {
this.enabled = enabled;
}
}
this.logger = new Logger('storage-' + this.name);
}
});
StorageBase.extend = Backbone.Model.extend;
module.exports = StorageBase;