aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/stores/settingstore.js
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2014-09-16 16:26:16 +1200
committerAldo Cortesi <aldo@nullcube.com>2014-09-16 16:27:09 +1200
commit6efe1aa6a92ce7f9f264903e9d27fb5cf6c32bfe (patch)
treee654b27eeb7a44c61c0e1a43850966735aefb3cd /web/src/js/stores/settingstore.js
parent6bac1540bd9383c4e6e0510d9b75db34346187ed (diff)
downloadmitmproxy-6efe1aa6a92ce7f9f264903e9d27fb5cf6c32bfe.tar.gz
mitmproxy-6efe1aa6a92ce7f9f264903e9d27fb5cf6c32bfe.tar.bz2
mitmproxy-6efe1aa6a92ce7f9f264903e9d27fb5cf6c32bfe.zip
We're not ready for ES6
Lets re-evaluate in June next year when it's actually released
Diffstat (limited to 'web/src/js/stores/settingstore.js')
-rw-r--r--web/src/js/stores/settingstore.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/web/src/js/stores/settingstore.js b/web/src/js/stores/settingstore.js
new file mode 100644
index 00000000..5ceed7db
--- /dev/null
+++ b/web/src/js/stores/settingstore.js
@@ -0,0 +1,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));