aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/datastructures.es6.js
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2014-09-15 18:08:26 +0200
committerMaximilian Hils <git@maximilianhils.com>2014-09-15 18:08:26 +0200
commitcbf18320cdbd05197f232da69b3c9a5391735156 (patch)
tree63b9cf8fd6a8e8fb5be6b2d5a655acf3d33b6229 /web/src/js/datastructures.es6.js
parent9f8d2eea64d4611c1e2f7e7043fe6d3ef9a6aa40 (diff)
downloadmitmproxy-cbf18320cdbd05197f232da69b3c9a5391735156.tar.gz
mitmproxy-cbf18320cdbd05197f232da69b3c9a5391735156.tar.bz2
mitmproxy-cbf18320cdbd05197f232da69b3c9a5391735156.zip
client-side structure
Diffstat (limited to 'web/src/js/datastructures.es6.js')
-rw-r--r--web/src/js/datastructures.es6.js105
1 files changed, 0 insertions, 105 deletions
diff --git a/web/src/js/datastructures.es6.js b/web/src/js/datastructures.es6.js
deleted file mode 100644
index e9e2ee77..00000000
--- a/web/src/js/datastructures.es6.js
+++ /dev/null
@@ -1,105 +0,0 @@
-class EventEmitter {
- constructor(){
- this.listeners = {};
- }
- emit(event){
- if(!(event in this.listeners)){
- return;
- }
- this.listeners[event].forEach(function (listener) {
- listener(event, this);
- }.bind(this));
- }
- addListener(event, f){
- this.listeners[event] = this.listeners[event] || [];
- this.listeners[event].push(f);
- }
- removeListener(event, f){
- if(!(event in this.listeners)){
- return false;
- }
- var index = this.listeners.indexOf(f);
- if (index >= 0) {
- this.listeners.splice(this.listeners.indexOf(f), 1);
- }
- }
-}
-
-var FLOW_CHANGED = "flow.changed";
-
-class FlowStore extends EventEmitter{
- constructor() {
- super();
- this.flows = [];
- }
-
- getAll() {
- return this.flows;
- }
-
- close(){
- console.log("FlowStore.close()");
- this.listeners = [];
- }
-
- emitChange() {
- return this.emit(FLOW_CHANGED);
- }
-
- addChangeListener(f) {
- this.addListener(FLOW_CHANGED, f);
- }
-
- removeChangeListener(f) {
- this.removeListener(FLOW_CHANGED, f);
- }
-}
-
-class DummyFlowStore extends FlowStore {
- constructor(flows) {
- super();
- this.flows = flows;
- }
-
- addFlow(flow) {
- this.flows.push(flow);
- this.emitChange();
- }
-}
-
-
-var SETTINGS_CHANGED = "settings.changed";
-
-class Settings extends EventEmitter {
- constructor(){
- super();
- this.settings = false;
- }
-
- getAll(){
- return this.settings;
- }
-
- emitChange() {
- return this.emit(SETTINGS_CHANGED);
- }
-
- addChangeListener(f) {
- this.addListener(SETTINGS_CHANGED, f);
- }
-
- removeChangeListener(f) {
- this.removeListener(SETTINGS_CHANGED, f);
- }
-}
-
-class DummySettings extends Settings {
- constructor(settings){
- super();
- this.settings = settings;
- }
- update(obj){
- _.merge(this.settings, obj);
- this.emitChange();
- }
-} \ No newline at end of file