mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
ES2015 first look / babeljs
This commit is contained in:
parent
5dcceaaca5
commit
445cd155e5
123 changed files with 3214 additions and 3680 deletions
38
dev/Storage/Settings.jsx
Normal file
38
dev/Storage/Settings.jsx
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
|
||||
import {window} from 'common';
|
||||
import Utils from 'Common/Utils';
|
||||
|
||||
class SettingsStorage
|
||||
{
|
||||
constructor() {
|
||||
this.settings = window['rainloopAppData'] || {};
|
||||
this.settings = Utils.isNormal(this.settings) ? this.settings : {};
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @return {*}
|
||||
*/
|
||||
settingsGet(name) {
|
||||
return Utils.isUnd(this.settings[name]) ? null : this.settings[name];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @param {*} value
|
||||
*/
|
||||
settingsSet(name, value) {
|
||||
this.settings[name] = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} name
|
||||
* @return {boolean}
|
||||
*/
|
||||
capa(name) {
|
||||
const values = this.settingsGet('Capa');
|
||||
return Utils.isArray(values) && Utils.isNormal(name) && -1 < Utils.inArray(name, values);
|
||||
};
|
||||
}
|
||||
|
||||
module.exports = new SettingsStorage();
|
||||
Loading…
Add table
Add a link
Reference in a new issue