mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-27 08:28:50 +02:00
no lint errors
This commit is contained in:
parent
48dd558de1
commit
5522d13f5f
8 changed files with 26 additions and 21 deletions
2
grunt.js
2
grunt.js
|
@ -83,7 +83,7 @@ module.exports = function(grunt) {
|
|||
// aliases: ['jquery:jquery-browserify'],
|
||||
entries: ['src/*.js'],
|
||||
//prepend: ['<banner:meta.banner>'],
|
||||
append: [],
|
||||
append: []
|
||||
/*hook: function (bundle) {
|
||||
// Do something with bundle
|
||||
}*/
|
||||
|
|
|
@ -14,7 +14,7 @@ var GRAPHICS = require('./constants').GRAPHICS;
|
|||
// essentially a static class
|
||||
var AnimationFactory = function() {
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
AnimationFactory.prototype.genCommitBirthAnimation = function(animationQueue, commit, gitVisuals) {
|
||||
if (!animationQueue) {
|
||||
|
@ -164,7 +164,7 @@ AnimationFactory.prototype.rebaseBirthPart = function(animationQueue, rebaseResp
|
|||
snapshotPart();
|
||||
birthPart();
|
||||
};
|
||||
|
||||
|
||||
animationQueue.add(new Animation({
|
||||
closure: animation,
|
||||
duration: GRAPHICS.defaultAnimationTime * 1.5
|
||||
|
|
|
@ -77,7 +77,7 @@ var AnimationQueue = Backbone.Model.extend({
|
|||
setTimeout(_.bind(function() {
|
||||
this.next();
|
||||
}, this), duration);
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
exports.Animation = Animation;
|
||||
|
|
|
@ -11,7 +11,7 @@ var CommitCollection = Backbone.Collection.extend({
|
|||
});
|
||||
|
||||
var CommandCollection = Backbone.Collection.extend({
|
||||
model: Command,
|
||||
model: Command
|
||||
});
|
||||
|
||||
var BranchCollection = Backbone.Collection.extend({
|
||||
|
@ -25,7 +25,7 @@ var CommandEntryCollection = Backbone.Collection.extend({
|
|||
|
||||
var CommandBuffer = Backbone.Model.extend({
|
||||
defaults: {
|
||||
collection: null,
|
||||
collection: null
|
||||
},
|
||||
|
||||
initialize: function(options) {
|
||||
|
@ -92,7 +92,7 @@ var CommandBuffer = Backbone.Model.extend({
|
|||
}
|
||||
|
||||
this.popAndProcess();
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
exports.CommitCollection = CommitCollection;
|
||||
|
|
|
@ -162,7 +162,7 @@ var Command = Backbone.Model.extend({
|
|||
_.escape('\t git <command> [<args>]'),
|
||||
'<br/>',
|
||||
'Supported commands:',
|
||||
'<br/>',
|
||||
'<br/>'
|
||||
];
|
||||
var commands = OptionParser.prototype.getMasterOptionMap();
|
||||
|
||||
|
@ -182,12 +182,16 @@ var Command = Backbone.Model.extend({
|
|||
});
|
||||
}],
|
||||
[/^refresh$/, function() {
|
||||
var events = require('./main').getEvents();
|
||||
|
||||
events.trigger('refreshTree');
|
||||
throw new CommandResult({
|
||||
msg: "Refreshing tree..."
|
||||
});
|
||||
}],
|
||||
[/^rollup (\d+)$/, function(bits) {
|
||||
var events = require('./main').getEvents();
|
||||
|
||||
// go roll up these commands by joining them with semicolons
|
||||
events.trigger('rollupCommands', bits[1]);
|
||||
throw new CommandResult({
|
||||
|
@ -261,7 +265,7 @@ var Command = Backbone.Model.extend({
|
|||
// steal these away so we can be completely JSON
|
||||
this.set('generalArgs', optionParser.generalArgs);
|
||||
this.set('supportedMap', optionParser.supportedMap);
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
|
@ -308,7 +312,7 @@ OptionParser.prototype.getMasterOptionMap = function() {
|
|||
},
|
||||
reset: {
|
||||
'--hard': false,
|
||||
'--soft': false, // this will raise an error but we catch it in gitEngine
|
||||
'--soft': false // this will raise an error but we catch it in gitEngine
|
||||
},
|
||||
merge: {},
|
||||
rebase: {
|
||||
|
|
|
@ -72,7 +72,7 @@ var CommandPromptView = Backbone.View.extend({
|
|||
},
|
||||
|
||||
hideCursor: function() {
|
||||
this.toggleCursor(false);
|
||||
this.toggleCursor(false);
|
||||
},
|
||||
|
||||
showCursor: function() {
|
||||
|
@ -85,7 +85,7 @@ var CommandPromptView = Backbone.View.extend({
|
|||
|
||||
onKey: function(e) {
|
||||
var el = e.srcElement;
|
||||
this.updatePrompt(el)
|
||||
this.updatePrompt(el);
|
||||
},
|
||||
|
||||
onKeyUp: function(e) {
|
||||
|
@ -120,7 +120,7 @@ var CommandPromptView = Backbone.View.extend({
|
|||
.replace(/</g,'<')
|
||||
.replace(/</g,'<')
|
||||
.replace(/ /g,' ')
|
||||
.replace(/\n/g,'')
|
||||
.replace(/\n/g,'');
|
||||
},
|
||||
|
||||
updatePrompt: function(el) {
|
||||
|
@ -160,7 +160,7 @@ var CommandPromptView = Backbone.View.extend({
|
|||
|
||||
commandSelectChange: function(delta) {
|
||||
this.index += delta;
|
||||
|
||||
|
||||
// if we are over / under, display blank line. yes this eliminates your
|
||||
// partially edited command, but i doubt that is much in this demo
|
||||
if (this.index >= this.commands.length || this.index < 0) {
|
||||
|
@ -285,10 +285,10 @@ var CommandView = Backbone.View.extend({
|
|||
// with jquery rather than brutally delete a html of HTML
|
||||
var changes = changeEvent.changes;
|
||||
var changeKeys = _.keys(changes);
|
||||
if (_.difference(changeKeys, ['status']) == 0) {
|
||||
if (_.difference(changeKeys, ['status']) === 0) {
|
||||
this.updateStatus();
|
||||
} else if (_.difference(changeKeys, ['error']) == 0) {
|
||||
// the above will
|
||||
} else if (_.difference(changeKeys, ['error']) === 0) {
|
||||
// the above will
|
||||
this.render();
|
||||
} else {
|
||||
this.render();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* Constants....!!!
|
||||
*/
|
||||
var TIME = {
|
||||
betweenCommandsDelay: 400,
|
||||
betweenCommandsDelay: 400
|
||||
};
|
||||
|
||||
// useful for locks, etc
|
||||
|
@ -37,7 +37,7 @@ var GRAPHICS = {
|
|||
defaultNodeStrokeWidth: 2,
|
||||
defaultNodeStroke: '#FFF',
|
||||
|
||||
orphanNodeFill: 'hsb(0.5,0.8,0.7)',
|
||||
orphanNodeFill: 'hsb(0.5,0.8,0.7)'
|
||||
};
|
||||
|
||||
exports.GLOBAL = GLOBAL;
|
||||
|
|
|
@ -1214,6 +1214,7 @@ GitEngine.prototype.checkout = function(idOrTarget) {
|
|||
};
|
||||
|
||||
GitEngine.prototype.branchStarter = function() {
|
||||
var args = null;
|
||||
// handle deletion first
|
||||
if (this.commandOptions['-d'] || this.commandOptions['-D']) {
|
||||
var names = this.commandOptions['-d'] || this.commandOptions['-D'];
|
||||
|
@ -1226,14 +1227,14 @@ GitEngine.prototype.branchStarter = function() {
|
|||
}
|
||||
|
||||
if (this.commandOptions['--contains']) {
|
||||
var args = this.commandOptions['--contains'];
|
||||
args = this.commandOptions['--contains'];
|
||||
this.validateArgBounds(args, 1, 1, '--contains');
|
||||
this.printBranchesWithout(args[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.commandOptions['-f']) {
|
||||
var args = this.commandOptions['-f'];
|
||||
args = this.commandOptions['-f'];
|
||||
this.twoArgsImpliedHead(args, '-f');
|
||||
|
||||
// we want to force a branch somewhere
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue