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