mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-26 16:08:34 +02:00
temporary UNSTABLE since codemod went nuts
This commit is contained in:
parent
2257668f9d
commit
f048f99e7f
14 changed files with 32 additions and 39 deletions
|
@ -1,5 +1,4 @@
|
|||
var TreeCompare = require('../graph/treeCompare');
|
||||
var _ = require('underscore');
|
||||
|
||||
var loadTree = function(treeString) {
|
||||
return TreeCompare.convertTreeSafe(treeString);
|
||||
|
@ -13,7 +12,8 @@ var testMethod = function(compareMethod, goalTreeString, cases, options) {
|
|||
cases[goalTreeString] = true;
|
||||
}
|
||||
|
||||
_.each(cases, function(value, actualTree) {
|
||||
Object.keys(cases).forEach(function(actualTree) {
|
||||
var value = cases[actualTree];
|
||||
var isEqual = TreeCompare.dispatch(compareMethod, goalTreeString, actualTree);
|
||||
if (isEqual !== value) {
|
||||
console.log('this goal tree', loadTree(goalTreeString));
|
||||
|
@ -21,7 +21,7 @@ var testMethod = function(compareMethod, goalTreeString, cases, options) {
|
|||
console.log('for this value', value);
|
||||
}
|
||||
expect(isEqual).toBe(value);
|
||||
});
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
describe('Tree Compare', function() {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var _ = require('underscore');
|
||||
var Q = require('q');
|
||||
|
||||
var Main = require('../app');
|
||||
|
|
|
@ -316,7 +316,7 @@ var LevelBuilder = Level.extend({
|
|||
]
|
||||
});
|
||||
askForHintView.getPromise()
|
||||
.then(this.defineHint, this))
|
||||
.then(this.defineHint.bind(this))
|
||||
.fail(function() {
|
||||
this.level.hint = {'en_US': ''};
|
||||
}.bind(this))
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var _ = require('underscore');
|
||||
var intl = require('../intl');
|
||||
|
||||
var Commands = require('../commands');
|
||||
|
@ -25,7 +24,7 @@ DisabledMap.prototype.getInstantCommands = function() {
|
|||
});
|
||||
};
|
||||
|
||||
_.each(this.disabledMap, function(val, disabledCommand) {
|
||||
Object.keys(this.disabledMap).forEach(function(disabledCommand) {
|
||||
// XXX get hold of vcs from disabledMap
|
||||
var vcs = 'git';
|
||||
disabledCommand = disabledCommand.slice(vcs.length + 1);
|
||||
|
@ -35,7 +34,7 @@ DisabledMap.prototype.getInstantCommands = function() {
|
|||
' has no regex matching');
|
||||
}
|
||||
instants.push([gitRegex, onMatch]);
|
||||
});
|
||||
}.bind(this));
|
||||
return instants;
|
||||
};
|
||||
|
||||
|
|
|
@ -368,16 +368,16 @@ var Level = Sandbox.extend({
|
|||
initGitShim: function(options) {
|
||||
// ok we definitely want a shim here
|
||||
this.gitShim = new GitShim({
|
||||
beforeCB: this.beforeCommandCB, this),
|
||||
afterCB: this.afterCommandCB, this),
|
||||
afterDeferHandler: this.afterCommandDefer, this)
|
||||
beforeCB: this.beforeCommandCB.bind(this),
|
||||
afterCB: this.afterCommandCB.bind(this),
|
||||
afterDeferHandler: this.afterCommandDefer.bind(this)
|
||||
});
|
||||
},
|
||||
|
||||
undo: function() {
|
||||
this.gitCommandsIssued.pop();
|
||||
Level.__super__.undo.apply(this, arguments);
|
||||
}.bind(this)
|
||||
}.bind(this),
|
||||
|
||||
afterCommandCB: function(command) {
|
||||
if (command.get('error')) {
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var _ = require('underscore');
|
||||
var intl = require('../intl');
|
||||
|
||||
var GitCommands = require('../git/commands');
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var _ = require('underscore');
|
||||
var Q = require('q');
|
||||
var Backbone = require('backbone');
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var _ = require('underscore');
|
||||
var Q = require('q');
|
||||
var Backbone = require('backbone');
|
||||
|
||||
|
@ -68,7 +67,7 @@ var Sandbox = Backbone.View.extend({
|
|||
|
||||
initGitShim: function(options) {
|
||||
this.gitShim = new GitShim({
|
||||
beforeCB: this.beforeCommandCB, this)
|
||||
beforeCB: this.beforeCommandCB.bind(this)
|
||||
});
|
||||
},
|
||||
|
||||
|
@ -83,7 +82,7 @@ var Sandbox = Backbone.View.extend({
|
|||
Main.getEventBaton().stealBaton('levelExited', this.levelExited, this);
|
||||
|
||||
this.insertGitShim();
|
||||
}.bind(this)
|
||||
}.bind(this),
|
||||
|
||||
releaseControl: function() {
|
||||
// we will be handling commands that are submitted, mainly to add the sanadbox
|
||||
|
|
|
@ -68,14 +68,14 @@ var MarkdownGrabber = ContainedBase.extend({
|
|||
// do button stuff
|
||||
var buttonDefer = Q.defer();
|
||||
buttonDefer.promise
|
||||
.then(this.confirmed, this))
|
||||
.fail(this.cancelled, this))
|
||||
.then(this.confirmed.bind(this))
|
||||
.fail(this.cancelled.bind(this))
|
||||
.done();
|
||||
|
||||
var confirmCancel = new Views.ConfirmCancelView({
|
||||
deferred: buttonDefer,
|
||||
destination: this.getDestination()
|
||||
}.bind(this)
|
||||
}.bind(this));
|
||||
}
|
||||
|
||||
this.updatePreview();
|
||||
|
@ -98,7 +98,7 @@ var MarkdownGrabber = ContainedBase.extend({
|
|||
keyup: function() {
|
||||
if (!this.throttledPreview) {
|
||||
this.throttledPreview = _.throttle(
|
||||
this.updatePreview, this),
|
||||
this.updatePreview.bind(this),
|
||||
500
|
||||
);
|
||||
}
|
||||
|
@ -107,7 +107,7 @@ var MarkdownGrabber = ContainedBase.extend({
|
|||
|
||||
getRawText: function() {
|
||||
return this.$('textarea').val();
|
||||
}.bind(this)
|
||||
}.bind(this),
|
||||
|
||||
exportToArray: function() {
|
||||
return this.getRawText().split('\n');
|
||||
|
@ -155,7 +155,7 @@ var MarkdownPresenter = ContainedBase.extend({
|
|||
.fail(function() {
|
||||
this.deferred.reject();
|
||||
}.bind(this))
|
||||
.done(this.die, this));
|
||||
.done(this.die.bind(this));
|
||||
}
|
||||
|
||||
this.show();
|
||||
|
@ -230,8 +230,8 @@ var DemonstrationBuilder = ContainedBase.extend({
|
|||
});
|
||||
|
||||
buttonDeferred.promise
|
||||
.then(this.confirmed, this))
|
||||
.fail(this.cancelled, this))
|
||||
.then(this.confirmed.bind(this))
|
||||
.fail(this.cancelled.bind(this))
|
||||
.done();
|
||||
},
|
||||
|
||||
|
@ -243,7 +243,7 @@ var DemonstrationBuilder = ContainedBase.extend({
|
|||
options: this.getExportObj()
|
||||
}]
|
||||
});
|
||||
}.bind(this)
|
||||
}.bind(this),
|
||||
|
||||
getExportObj: function() {
|
||||
return {
|
||||
|
|
|
@ -107,7 +107,7 @@ var GeneralButton = ContainedBase.extend({
|
|||
click: function() {
|
||||
if (!this.clickFunc) {
|
||||
this.clickFunc = _.throttle(
|
||||
this.sendClick, this),
|
||||
this.sendClick.bind(this),
|
||||
500
|
||||
);
|
||||
}
|
||||
|
@ -578,11 +578,11 @@ var CanvasTerminalHolder = BaseView.extend({
|
|||
|
||||
// If the entire window gets resized such that the terminal is outside the view, then
|
||||
// move it back into the view, and expand/shrink it vertically as necessary.
|
||||
$(window).on('resize', _.debounce(this.recalcLayout, this), 300));
|
||||
$(window).on('resize', _.debounce(this.recalcLayout.bind(this), 300));
|
||||
|
||||
if (options.additionalClass) {
|
||||
this.$el.addClass(options.additionalClass);
|
||||
}.bind(this)
|
||||
}
|
||||
},
|
||||
|
||||
getAnimationTime: function() { return 700; },
|
||||
|
|
|
@ -42,7 +42,7 @@ var LevelDropdownView = ContainedBase.extend({
|
|||
|
||||
this.navEvents = _.clone(Backbone.Events);
|
||||
this.navEvents.on('clickedID', _.debounce(
|
||||
this.loadLevelID, this),
|
||||
this.loadLevelID.bind(this),
|
||||
300,
|
||||
true
|
||||
));
|
||||
|
@ -60,7 +60,7 @@ var LevelDropdownView = ContainedBase.extend({
|
|||
enter: 'positive'
|
||||
},
|
||||
wait: true
|
||||
}.bind(this)
|
||||
});
|
||||
|
||||
this.sequences = LevelStore.getSequences();
|
||||
this.sequenceToLevels = LevelStore.getSequenceToLevels();
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var _ = require('underscore');
|
||||
var Backbone = require('backbone');
|
||||
var Q = require('q');
|
||||
|
||||
|
@ -76,14 +75,14 @@ AnimationFactory.highlightEachWithPromise = function(
|
|||
toHighlight,
|
||||
destObj
|
||||
) {
|
||||
_.each(toHighlight, function(commit) {
|
||||
toHighlight.forEach(function(commit) {
|
||||
chain = chain.then(function() {
|
||||
return this.playHighlightPromiseAnimation(
|
||||
commit,
|
||||
destObj
|
||||
);
|
||||
}.bind(this));
|
||||
}, this);
|
||||
}.bind(this));
|
||||
return chain;
|
||||
};
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
var _ = require('underscore');
|
||||
var Q = require('q');
|
||||
var Backbone = require('backbone');
|
||||
var GlobalStateActions = require('../../actions/GlobalStateActions');
|
||||
|
|
|
@ -91,7 +91,7 @@ var Visualization = Backbone.View.extend({
|
|||
this.shown = false;
|
||||
this.setTreeOpacity(0);
|
||||
// reflow needed
|
||||
process.nextTick(this.fadeTreeIn, this));
|
||||
process.nextTick(this.fadeTreeIn.bind(this));
|
||||
|
||||
this.customEvents.trigger('gitEngineReady');
|
||||
this.customEvents.trigger('paperReady');
|
||||
|
@ -99,7 +99,7 @@ var Visualization = Backbone.View.extend({
|
|||
|
||||
clearOrigin: function() {
|
||||
delete this.originVis;
|
||||
}.bind(this)
|
||||
}.bind(this),
|
||||
|
||||
makeOrigin: function(options) {
|
||||
// oh god, here we go. We basically do a bizarre form of composition here,
|
||||
|
@ -186,7 +186,7 @@ var Visualization = Backbone.View.extend({
|
|||
|
||||
show: function() {
|
||||
$(this.paper.canvas).css('visibility', 'visible');
|
||||
setTimeout(this.fadeTreeIn, this), 10);
|
||||
setTimeout(this.fadeTreeIn.bind(this), 10);
|
||||
this.originToo('show', arguments);
|
||||
this.myResize();
|
||||
},
|
||||
|
@ -196,7 +196,7 @@ var Visualization = Backbone.View.extend({
|
|||
this.setTreeOpacity(1);
|
||||
this.originToo('showHarsh', arguments);
|
||||
this.myResize();
|
||||
}.bind(this)
|
||||
}.bind(this),
|
||||
|
||||
resetFromThisTreeNow: function(treeString) {
|
||||
this.treeString = treeString;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue