From bbdaa37abdcdd85a4606caabf88b2052fc0c6d6a Mon Sep 17 00:00:00 2001 From: Peter Cottle Date: Tue, 25 Dec 2012 17:39:31 -0800 Subject: [PATCH] before refactor --- build/bundle.js | 26 ++++++++++---------------- src/js/app/inputWaterfall.js | 17 +++++++++++++++++ src/js/git/index.js | 2 +- src/js/models/collections.js | 5 +---- src/js/visuals/index.js | 4 +--- 5 files changed, 30 insertions(+), 24 deletions(-) create mode 100644 src/js/app/inputWaterfall.js diff --git a/build/bundle.js b/build/bundle.js index 86e93772..d08173cb 100644 --- a/build/bundle.js +++ b/build/bundle.js @@ -4537,10 +4537,7 @@ var CommandBuffer = Backbone.Model.extend({ }, initialize: function(options) { - require('../app').getEvents().on('gitCommandReady', _.bind( - this.addCommand, this - )); - + require('../app').getEvents().on('gitCommandReady', this.addCommand, this); options.collection.bind('add', this.addCommand, this); this.buffer = []; @@ -4644,7 +4641,7 @@ function GitEngine(options) { this.commandOptions = {}; this.generalArgs = []; - this.events.on('processCommand', _.bind(this.dispatch, this)); + this.events.on('processCommand', this.dispatch, this); // backbone or something uses _.uniqueId, so we make our own here this.uniqueId = (function() { @@ -11926,9 +11923,7 @@ function GitVisuals(options) { this.deferred = []; this.events = require('../app').getEvents(); - this.events.on('refreshTree', _.bind( - this.refreshTree, this - )); + this.events.on('refreshTree', this.refreshTree, this); } GitVisuals.prototype.defer = function(action) { @@ -14063,6 +14058,10 @@ exports.init = init; }); require("/src/js/app/index.js"); +require.define("/src/js/app/inputWaterfall.js",function(require,module,exports,__dirname,__filename,process,global){undefined +}); +require("/src/js/app/inputWaterfall.js"); + require.define("/src/js/git/headless.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore'); var Backbone = require('backbone'); @@ -14150,7 +14149,7 @@ function GitEngine(options) { this.commandOptions = {}; this.generalArgs = []; - this.events.on('processCommand', _.bind(this.dispatch, this)); + this.events.on('processCommand', this.dispatch, this); // backbone or something uses _.uniqueId, so we make our own here this.uniqueId = (function() { @@ -15954,10 +15953,7 @@ var CommandBuffer = Backbone.Model.extend({ }, initialize: function(options) { - require('../app').getEvents().on('gitCommandReady', _.bind( - this.addCommand, this - )); - + require('../app').getEvents().on('gitCommandReady', this.addCommand, this); options.collection.bind('add', this.addCommand, this); this.buffer = []; @@ -17986,9 +17982,7 @@ function GitVisuals(options) { this.deferred = []; this.events = require('../app').getEvents(); - this.events.on('refreshTree', _.bind( - this.refreshTree, this - )); + this.events.on('refreshTree', this.refreshTree, this); } GitVisuals.prototype.defer = function(action) { diff --git a/src/js/app/inputWaterfall.js b/src/js/app/inputWaterfall.js new file mode 100644 index 00000000..4dfc635e --- /dev/null +++ b/src/js/app/inputWaterfall.js @@ -0,0 +1,17 @@ +var _ = require('underscore'); +var Backbone = require('backbone'); + +var Main = require('../main'); + +function InputWaterfall() { + + Main.getEvents().on('processCommand', this.process) + +}; + +InputWaterfall.prototype.listen = function() { + Main.getEvents(). + +}; + +exports.InputWaterfall = InputWaterfall; diff --git a/src/js/git/index.js b/src/js/git/index.js index b603f348..f2bad6b6 100644 --- a/src/js/git/index.js +++ b/src/js/git/index.js @@ -28,7 +28,7 @@ function GitEngine(options) { this.commandOptions = {}; this.generalArgs = []; - this.events.on('processCommand', _.bind(this.dispatch, this)); + this.events.on('processCommand', this.dispatch, this); // backbone or something uses _.uniqueId, so we make our own here this.uniqueId = (function() { diff --git a/src/js/models/collections.js b/src/js/models/collections.js index 76931b71..7eda523b 100644 --- a/src/js/models/collections.js +++ b/src/js/models/collections.js @@ -32,10 +32,7 @@ var CommandBuffer = Backbone.Model.extend({ }, initialize: function(options) { - require('../app').getEvents().on('gitCommandReady', _.bind( - this.addCommand, this - )); - + require('../app').getEvents().on('gitCommandReady', this.addCommand, this); options.collection.bind('add', this.addCommand, this); this.buffer = []; diff --git a/src/js/visuals/index.js b/src/js/visuals/index.js index 1c38c776..370906bc 100644 --- a/src/js/visuals/index.js +++ b/src/js/visuals/index.js @@ -37,9 +37,7 @@ function GitVisuals(options) { this.deferred = []; this.events = require('../app').getEvents(); - this.events.on('refreshTree', _.bind( - this.refreshTree, this - )); + this.events.on('refreshTree', this.refreshTree, this); } GitVisuals.prototype.defer = function(action) {