mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-09 22:24:26 +02:00
there we go
This commit is contained in:
parent
2f57f4cfe3
commit
4e6e82e698
3 changed files with 44 additions and 3 deletions
|
@ -4520,7 +4520,7 @@ Sandbox.prototype.takeControl = function() {
|
||||||
Main.getEventBaton().stealBaton('processSandboxCommand', this.processSandboxCommand, this);
|
Main.getEventBaton().stealBaton('processSandboxCommand', this.processSandboxCommand, this);
|
||||||
|
|
||||||
// and our git shim
|
// and our git shim
|
||||||
// TODO HACKY
|
// TODO HACKY needs to be AFTER PAPER INITIALIZE dropped down from visualization wtf
|
||||||
setTimeout(_.bind(function() {
|
setTimeout(_.bind(function() {
|
||||||
this.gitShim.insertShim();
|
this.gitShim.insertShim();
|
||||||
}, this), 1000);
|
}, this), 1000);
|
||||||
|
@ -17082,7 +17082,7 @@ Sandbox.prototype.takeControl = function() {
|
||||||
Main.getEventBaton().stealBaton('processSandboxCommand', this.processSandboxCommand, this);
|
Main.getEventBaton().stealBaton('processSandboxCommand', this.processSandboxCommand, this);
|
||||||
|
|
||||||
// and our git shim
|
// and our git shim
|
||||||
// TODO HACKY
|
// TODO HACKY needs to be AFTER PAPER INITIALIZE dropped down from visualization wtf
|
||||||
setTimeout(_.bind(function() {
|
setTimeout(_.bind(function() {
|
||||||
this.gitShim.insertShim();
|
this.gitShim.insertShim();
|
||||||
}, this), 1000);
|
}, this), 1000);
|
||||||
|
|
41
src/js/git/gitShim.js
Normal file
41
src/js/git/gitShim.js
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
var _ = require('underscore');
|
||||||
|
var Q = require('q');
|
||||||
|
|
||||||
|
var Main = require('../app');
|
||||||
|
|
||||||
|
function GitShim(options) {
|
||||||
|
options = options || {};
|
||||||
|
this.beforeCB = options.beforeCB || function() {};
|
||||||
|
this.afterCB = options.afterCB || function() {};
|
||||||
|
|
||||||
|
this.eventBaton = options.eventBaton || Main.getEventBaton();
|
||||||
|
}
|
||||||
|
|
||||||
|
GitShim.prototype.insertShim = function() {
|
||||||
|
console.log('stealing baton');
|
||||||
|
this.eventBaton.stealBaton('processGitCommand', this.processGitCommand, this);
|
||||||
|
console.log(this.eventBaton);
|
||||||
|
};
|
||||||
|
|
||||||
|
GitShim.prototype.processGitCommand = function(command, deferred) {
|
||||||
|
console.log('in before');
|
||||||
|
this.beforeCB();
|
||||||
|
|
||||||
|
// ok we make a NEW deferred and pass it back
|
||||||
|
var newDeferred = Q.defer();
|
||||||
|
newDeferred.promise.then(_.bind(function() {
|
||||||
|
// give this method the original defer so it can resolve it
|
||||||
|
this.afterGitCommandProcessed(command, deferred);
|
||||||
|
}, this));
|
||||||
|
|
||||||
|
// punt to the previous listener
|
||||||
|
this.eventBaton.passBatonBack('processGitCommand', this.processGitCommand, this, [command, newDeferred]);
|
||||||
|
};
|
||||||
|
|
||||||
|
GitShim.prototype.afterGitCommandProcessed = function(command, deferred) {
|
||||||
|
this.afterCB();
|
||||||
|
deferred.resolve();
|
||||||
|
};
|
||||||
|
|
||||||
|
exports.GitShim = GitShim;
|
||||||
|
|
|
@ -52,7 +52,7 @@ Sandbox.prototype.takeControl = function() {
|
||||||
Main.getEventBaton().stealBaton('processSandboxCommand', this.processSandboxCommand, this);
|
Main.getEventBaton().stealBaton('processSandboxCommand', this.processSandboxCommand, this);
|
||||||
|
|
||||||
// and our git shim
|
// and our git shim
|
||||||
// TODO HACKY
|
// TODO HACKY needs to be AFTER PAPER INITIALIZE dropped down from visualization wtf
|
||||||
setTimeout(_.bind(function() {
|
setTimeout(_.bind(function() {
|
||||||
this.gitShim.insertShim();
|
this.gitShim.insertShim();
|
||||||
}, this), 1000);
|
}, this), 1000);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue