aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/stores/settingstore.js
blob: 5ceed7dbbe05e65e9e03b91c185c1df4fde2b138 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
for(var EventEmitter____Key in EventEmitter){if(EventEmitter.hasOwnProperty(EventEmitter____Key)){_SettingsStore[EventEmitter____Key]=EventEmitter[EventEmitter____Key];}}var ____SuperProtoOfEventEmitter=EventEmitter===null?null:EventEmitter.prototype;_SettingsStore.prototype=Object.create(____SuperProtoOfEventEmitter);_SettingsStore.prototype.constructor=_SettingsStore;_SettingsStore.__superConstructor__=EventEmitter;
    function _SettingsStore() {"use strict";
        EventEmitter.call(this);

        //FIXME: What do we do if we haven't requested anything from the server yet?
        this.settings = {
            version: "0.12",
            showEventLog: true,
            mode: "transparent",
        }; 
    }
    _SettingsStore.prototype.getAll=function() {"use strict";
        return this.settings;
    };
    _SettingsStore.prototype.handle=function(action) {"use strict";
        switch (action.actionType) {
            case ActionTypes.SETTINGS_UPDATE:
                this.settings = action.settings;
                this.emit("change");
                break;
            default:
                return;
        }
    };

var SettingsStore = new _SettingsStore();
AppDispatcher.register(SettingsStore.handle.bind(SettingsStore));