mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-25 23:48:34 +02:00
level arbiter beginning
This commit is contained in:
parent
d5bddcc6b4
commit
27498419c9
10 changed files with 109 additions and 19 deletions
|
@ -6494,7 +6494,8 @@ var Level = Sandbox.extend({
|
|||
el: this.goalCanvasHolder.getCanvasLocation(),
|
||||
containerElement: this.goalCanvasHolder.getCanvasLocation(),
|
||||
treeString: this.goalTreeString,
|
||||
noKeyboardInput: true
|
||||
noKeyboardInput: true,
|
||||
noClick: true
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -6607,7 +6608,6 @@ var Level = Sandbox.extend({
|
|||
afterCB: _.bind(this.afterCommandCB, this),
|
||||
afterDeferHandler: _.bind(this.afterCommandDefer, this)
|
||||
});
|
||||
console.log('made my git shim');
|
||||
},
|
||||
|
||||
getCommandsThatCount: function() {
|
||||
|
@ -6712,6 +6712,18 @@ var Level = Sandbox.extend({
|
|||
return instants;
|
||||
},
|
||||
|
||||
startLevel: function(command, deferred) {
|
||||
command.addWarning(
|
||||
"You are in a level! You can't start a new one before exiting. I'll add the command for you..."
|
||||
);
|
||||
command.set('status', 'error');
|
||||
|
||||
Main.getEventBaton().trigger('commandSubmitted',
|
||||
'delay 3000; exit level; delay 500;' + command.get('rawStr')
|
||||
);
|
||||
deferred.resolve();
|
||||
},
|
||||
|
||||
exitLevel: function(command, deferred) {
|
||||
this.die();
|
||||
setTimeout(function() {
|
||||
|
@ -6855,7 +6867,8 @@ var Visualization = Backbone.View.extend({
|
|||
this.gitVisuals = new GitVisuals({
|
||||
commitCollection: this.commitCollection,
|
||||
branchCollection: this.branchCollection,
|
||||
paper: this.paper
|
||||
paper: this.paper,
|
||||
noClick: this.options.noClick
|
||||
});
|
||||
|
||||
var GitEngine = require('../git').GitEngine;
|
||||
|
@ -7363,6 +7376,7 @@ GitEngine.prototype.getOrMakeRecursive = function(tree, createdSoFar, objID) {
|
|||
};
|
||||
|
||||
GitEngine.prototype.tearDown = function() {
|
||||
this.eventBaton.releaseBaton('processGitCommand', this.dispatch, this);
|
||||
this.removeAll();
|
||||
};
|
||||
|
||||
|
@ -12720,6 +12734,8 @@ var VisEdge = require('../visuals/visEdge').VisEdge;
|
|||
var VisEdgeCollection = require('../visuals/visEdge').VisEdgeCollection;
|
||||
|
||||
function GitVisuals(options) {
|
||||
options = options || {};
|
||||
this.options = options;
|
||||
this.commitCollection = options.commitCollection;
|
||||
this.branchCollection = options.branchCollection;
|
||||
this.visNodeMap = {};
|
||||
|
@ -13800,6 +13816,9 @@ var VisNode = VisBase.extend({
|
|||
},
|
||||
|
||||
attachClickHandlers: function() {
|
||||
if (this.get('gitVisuals').options.noClick) {
|
||||
return;
|
||||
}
|
||||
var commandStr = 'git checkout ' + this.get('commit').get('id');
|
||||
var Main = require('../app');
|
||||
_.each([this.get('circle'), this.get('text')], function(rObj) {
|
||||
|
@ -14282,6 +14301,9 @@ var VisBranch = VisBase.extend({
|
|||
},
|
||||
|
||||
attachClickHandlers: function() {
|
||||
if (this.get('gitVisuals').options.noClick) {
|
||||
return;
|
||||
}
|
||||
var commandStr = 'git checkout ' + this.get('branch').get('id');
|
||||
var Main = require('../app');
|
||||
var objs = [this.get('rect'), this.get('text'), this.get('arrow')];
|
||||
|
@ -14705,8 +14727,7 @@ exports.GitShim = GitShim;
|
|||
|
||||
});
|
||||
|
||||
require.define("/src/js/views/multiView.js",function(require,module,exports,__dirname,__filename,process,global){var GitError = require('../util/errors').GitError;
|
||||
var _ = require('underscore');
|
||||
require.define("/src/js/views/multiView.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore');
|
||||
var Q = require('q');
|
||||
// horrible hack to get localStorage Backbone plugin
|
||||
var Backbone = (!require('../util').isBrowser()) ? require('backbone') : window.Backbone;
|
||||
|
@ -14718,6 +14739,8 @@ var LeftRightView = require('../views').LeftRightView;
|
|||
var ModalAlert = require('../views').ModalAlert;
|
||||
var KeyboardListener = require('../util/keyboard').KeyboardListener;
|
||||
|
||||
var GitError = require('../util/errors').GitError;
|
||||
|
||||
var MultiView = Backbone.View.extend({
|
||||
tagName: 'div',
|
||||
className: 'multiView',
|
||||
|
@ -16258,6 +16281,7 @@ GitEngine.prototype.getOrMakeRecursive = function(tree, createdSoFar, objID) {
|
|||
};
|
||||
|
||||
GitEngine.prototype.tearDown = function() {
|
||||
this.eventBaton.releaseBaton('processGitCommand', this.dispatch, this);
|
||||
this.removeAll();
|
||||
};
|
||||
|
||||
|
@ -17825,6 +17849,10 @@ exports.TreeCompare = TreeCompare;
|
|||
});
|
||||
require("/src/js/git/treeCompare.js");
|
||||
|
||||
require.define("/src/js/level/arbiter.js",function(require,module,exports,__dirname,__filename,process,global){
|
||||
});
|
||||
require("/src/js/level/arbiter.js");
|
||||
|
||||
require.define("/src/js/level/commands.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore');
|
||||
|
||||
var regexMap = {
|
||||
|
@ -18015,7 +18043,8 @@ var Level = Sandbox.extend({
|
|||
el: this.goalCanvasHolder.getCanvasLocation(),
|
||||
containerElement: this.goalCanvasHolder.getCanvasLocation(),
|
||||
treeString: this.goalTreeString,
|
||||
noKeyboardInput: true
|
||||
noKeyboardInput: true,
|
||||
noClick: true
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -18128,7 +18157,6 @@ var Level = Sandbox.extend({
|
|||
afterCB: _.bind(this.afterCommandCB, this),
|
||||
afterDeferHandler: _.bind(this.afterCommandDefer, this)
|
||||
});
|
||||
console.log('made my git shim');
|
||||
},
|
||||
|
||||
getCommandsThatCount: function() {
|
||||
|
@ -18233,6 +18261,18 @@ var Level = Sandbox.extend({
|
|||
return instants;
|
||||
},
|
||||
|
||||
startLevel: function(command, deferred) {
|
||||
command.addWarning(
|
||||
"You are in a level! You can't start a new one before exiting. I'll add the command for you..."
|
||||
);
|
||||
command.set('status', 'error');
|
||||
|
||||
Main.getEventBaton().trigger('commandSubmitted',
|
||||
'delay 3000; exit level; delay 500;' + command.get('rawStr')
|
||||
);
|
||||
deferred.resolve();
|
||||
},
|
||||
|
||||
exitLevel: function(command, deferred) {
|
||||
this.die();
|
||||
setTimeout(function() {
|
||||
|
@ -19734,6 +19774,22 @@ exports.CommandLineHistoryView = CommandLineHistoryView;
|
|||
});
|
||||
require("/src/js/views/commandViews.js");
|
||||
|
||||
require.define("/src/js/views/gitDemonstrationView.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore');
|
||||
var Q = require('q');
|
||||
// horrible hack to get localStorage Backbone plugin
|
||||
var Backbone = (!require('../util').isBrowser()) ? require('backbone') : window.Backbone;
|
||||
|
||||
var ModalTerminal = require('../views').ModalTerminal;
|
||||
var ContainedBase = require('../views').ContainedBase;
|
||||
var ConfirmCancelView = require('../views').ConfirmCancelView;
|
||||
var LeftRightView = require('../views').LeftRightView;
|
||||
var ModalAlert = require('../views').ModalAlert;
|
||||
var KeyboardListener = require('../util/keyboard').KeyboardListener;
|
||||
|
||||
|
||||
});
|
||||
require("/src/js/views/gitDemonstrationView.js");
|
||||
|
||||
require.define("/src/js/views/index.js",function(require,module,exports,__dirname,__filename,process,global){var GitError = require('../util/errors').GitError;
|
||||
var _ = require('underscore');
|
||||
var Q = require('q');
|
||||
|
@ -20187,8 +20243,7 @@ exports.LevelToolbar = LevelToolbar;
|
|||
});
|
||||
require("/src/js/views/index.js");
|
||||
|
||||
require.define("/src/js/views/multiView.js",function(require,module,exports,__dirname,__filename,process,global){var GitError = require('../util/errors').GitError;
|
||||
var _ = require('underscore');
|
||||
require.define("/src/js/views/multiView.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore');
|
||||
var Q = require('q');
|
||||
// horrible hack to get localStorage Backbone plugin
|
||||
var Backbone = (!require('../util').isBrowser()) ? require('backbone') : window.Backbone;
|
||||
|
@ -20200,6 +20255,8 @@ var LeftRightView = require('../views').LeftRightView;
|
|||
var ModalAlert = require('../views').ModalAlert;
|
||||
var KeyboardListener = require('../util/keyboard').KeyboardListener;
|
||||
|
||||
var GitError = require('../util/errors').GitError;
|
||||
|
||||
var MultiView = Backbone.View.extend({
|
||||
tagName: 'div',
|
||||
className: 'multiView',
|
||||
|
@ -20895,6 +20952,8 @@ var VisEdge = require('../visuals/visEdge').VisEdge;
|
|||
var VisEdgeCollection = require('../visuals/visEdge').VisEdgeCollection;
|
||||
|
||||
function GitVisuals(options) {
|
||||
options = options || {};
|
||||
this.options = options;
|
||||
this.commitCollection = options.commitCollection;
|
||||
this.branchCollection = options.branchCollection;
|
||||
this.visNodeMap = {};
|
||||
|
@ -22024,6 +22083,9 @@ var VisBranch = VisBase.extend({
|
|||
},
|
||||
|
||||
attachClickHandlers: function() {
|
||||
if (this.get('gitVisuals').options.noClick) {
|
||||
return;
|
||||
}
|
||||
var commandStr = 'git checkout ' + this.get('branch').get('id');
|
||||
var Main = require('../app');
|
||||
var objs = [this.get('rect'), this.get('text'), this.get('arrow')];
|
||||
|
@ -22636,6 +22698,9 @@ var VisNode = VisBase.extend({
|
|||
},
|
||||
|
||||
attachClickHandlers: function() {
|
||||
if (this.get('gitVisuals').options.noClick) {
|
||||
return;
|
||||
}
|
||||
var commandStr = 'git checkout ' + this.get('commit').get('id');
|
||||
var Main = require('../app');
|
||||
_.each([this.get('circle'), this.get('text')], function(rObj) {
|
||||
|
@ -22805,7 +22870,8 @@ var Visualization = Backbone.View.extend({
|
|||
this.gitVisuals = new GitVisuals({
|
||||
commitCollection: this.commitCollection,
|
||||
branchCollection: this.branchCollection,
|
||||
paper: this.paper
|
||||
paper: this.paper,
|
||||
noClick: this.options.noClick
|
||||
});
|
||||
|
||||
var GitEngine = require('../git').GitEngine;
|
||||
|
|
|
@ -258,6 +258,7 @@ GitEngine.prototype.getOrMakeRecursive = function(tree, createdSoFar, objID) {
|
|||
};
|
||||
|
||||
GitEngine.prototype.tearDown = function() {
|
||||
this.eventBaton.releaseBaton('processGitCommand', this.dispatch, this);
|
||||
this.removeAll();
|
||||
};
|
||||
|
||||
|
|
0
src/js/level/arbiter.js
Normal file
0
src/js/level/arbiter.js
Normal file
|
@ -114,7 +114,8 @@ var Level = Sandbox.extend({
|
|||
el: this.goalCanvasHolder.getCanvasLocation(),
|
||||
containerElement: this.goalCanvasHolder.getCanvasLocation(),
|
||||
treeString: this.goalTreeString,
|
||||
noKeyboardInput: true
|
||||
noKeyboardInput: true,
|
||||
noClick: true
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -227,7 +228,6 @@ var Level = Sandbox.extend({
|
|||
afterCB: _.bind(this.afterCommandCB, this),
|
||||
afterDeferHandler: _.bind(this.afterCommandDefer, this)
|
||||
});
|
||||
console.log('made my git shim');
|
||||
},
|
||||
|
||||
getCommandsThatCount: function() {
|
||||
|
@ -332,6 +332,18 @@ var Level = Sandbox.extend({
|
|||
return instants;
|
||||
},
|
||||
|
||||
startLevel: function(command, deferred) {
|
||||
command.addWarning(
|
||||
"You are in a level! You can't start a new one before exiting. I'll add the command for you..."
|
||||
);
|
||||
command.set('status', 'error');
|
||||
|
||||
Main.getEventBaton().trigger('commandSubmitted',
|
||||
'delay 3000; exit level; delay 500;' + command.get('rawStr')
|
||||
);
|
||||
deferred.resolve();
|
||||
},
|
||||
|
||||
exitLevel: function(command, deferred) {
|
||||
this.die();
|
||||
setTimeout(function() {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var GitError = require('../util/errors').GitError;
|
||||
var _ = require('underscore');
|
||||
var Q = require('q');
|
||||
// horrible hack to get localStorage Backbone plugin
|
||||
|
@ -11,6 +10,8 @@ var LeftRightView = require('../views').LeftRightView;
|
|||
var ModalAlert = require('../views').ModalAlert;
|
||||
var KeyboardListener = require('../util/keyboard').KeyboardListener;
|
||||
|
||||
var GitError = require('../util/errors').GitError;
|
||||
|
||||
var MultiView = Backbone.View.extend({
|
||||
tagName: 'div',
|
||||
className: 'multiView',
|
||||
|
|
|
@ -16,6 +16,8 @@ var VisEdge = require('../visuals/visEdge').VisEdge;
|
|||
var VisEdgeCollection = require('../visuals/visEdge').VisEdgeCollection;
|
||||
|
||||
function GitVisuals(options) {
|
||||
options = options || {};
|
||||
this.options = options;
|
||||
this.commitCollection = options.commitCollection;
|
||||
this.branchCollection = options.branchCollection;
|
||||
this.visNodeMap = {};
|
||||
|
|
|
@ -313,6 +313,9 @@ var VisBranch = VisBase.extend({
|
|||
},
|
||||
|
||||
attachClickHandlers: function() {
|
||||
if (this.get('gitVisuals').options.noClick) {
|
||||
return;
|
||||
}
|
||||
var commandStr = 'git checkout ' + this.get('branch').get('id');
|
||||
var Main = require('../app');
|
||||
var objs = [this.get('rect'), this.get('text'), this.get('arrow')];
|
||||
|
|
|
@ -314,6 +314,9 @@ var VisNode = VisBase.extend({
|
|||
},
|
||||
|
||||
attachClickHandlers: function() {
|
||||
if (this.get('gitVisuals').options.noClick) {
|
||||
return;
|
||||
}
|
||||
var commandStr = 'git checkout ' + this.get('commit').get('id');
|
||||
var Main = require('../app');
|
||||
_.each([this.get('circle'), this.get('text')], function(rObj) {
|
||||
|
|
|
@ -47,7 +47,8 @@ var Visualization = Backbone.View.extend({
|
|||
this.gitVisuals = new GitVisuals({
|
||||
commitCollection: this.commitCollection,
|
||||
branchCollection: this.branchCollection,
|
||||
paper: this.paper
|
||||
paper: this.paper,
|
||||
noClick: this.options.noClick
|
||||
});
|
||||
|
||||
var GitEngine = require('../git').GitEngine;
|
||||
|
|
11
todo.txt
11
todo.txt
|
@ -5,13 +5,10 @@ Big Graphic things:
|
|||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
[ ] levels dropdown selection?
|
||||
[ ] git demonstration view
|
||||
[ ] sandbox can launch and takedown levels
|
||||
|
||||
Medium things:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Commands
|
||||
========
|
||||
[ ] level arbiter (has everything by ID)
|
||||
|
||||
Small things to implement:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -21,7 +18,6 @@ Minor Bugs to fix:
|
|||
|
||||
Big Bugs to fix:
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
[ ] click handlers on goal visualization for the actual canvas elements
|
||||
|
||||
/*************************************
|
||||
** Publish Things **
|
||||
|
@ -32,6 +28,11 @@ Big Bugs to fix:
|
|||
Done things:
|
||||
(I only started this on Dec 17th 2012 to get a better sense of what was done)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
[x] click handlers on goal visualization for the actual canvas elements
|
||||
[x] sandbox can launch and takedown levels
|
||||
[x] TWO epic bugs squashed:
|
||||
* Raphael process.nextTick needed
|
||||
* _.debounce on prototype
|
||||
[x] window zoom alert thing -- this just needs to be timeouted one more time
|
||||
[x] level teardown
|
||||
[x] great die for levels
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue