Fixed typos in comments and strings

This commit is contained in:
Hongarc 2018-11-29 01:34:58 +07:00
parent 5e8d83536e
commit 694f414e22
21 changed files with 46 additions and 46 deletions

View file

@ -165,7 +165,7 @@ var initRootEvents = function(eventBaton) {
var initDemo = function(sandbox) {
var params = util.parseQueryString(window.location.href);
// being the smart programmer I am (not), I dont include a true value on demo, so
// being the smart programmer I am (not), I don't include a true value on demo, so
// I have to check if the key exists here
var commands;
if (/(iPhone|iPod|iPad).*AppleWebKit/i.test(navigator.userAgent) || /android/i.test(navigator.userAgent)) {

View file

@ -16,7 +16,7 @@ var commandConfigs = {
var commands = {
execute: function(vcs, name, engine, commandObj) {
if (!commandConfigs[vcs][name]) {
throw new Error('i dont have a command for ' + name);
throw new Error('i don\'t have a command for ' + name);
}
var config = commandConfigs[vcs][name];
if (config.delegate) {

View file

@ -107,7 +107,7 @@ var assertBranchIsRemoteTracking = function(engine, branchName) {
if (!tracking) {
throw new GitError({
msg: intl.todo(
branchName + ' is not a remote tracking branch! I dont know where to push'
branchName + ' is not a remote tracking branch! I don\'t know where to push'
)
});
}
@ -519,7 +519,7 @@ var commandConfig = {
command.addWarning(
intl.str('git-warning-hard')
);
// dont absorb the arg off of --hard
// don't absorb the arg off of --hard
generalArgs = generalArgs.concat(commandOptions['--hard']);
}

View file

@ -36,7 +36,7 @@ function getMockFactory() {
};
mockFactory.highlightEachWithPromise = function(chain, toRebase, destBranch) {
// dont add any steps
// don't add any steps
return chain;
};

View file

@ -61,7 +61,7 @@ GitEngine.prototype.initUniqueID = function() {
GitEngine.prototype.handleModeChange = function(vcs, callback) {
if (this.mode === vcs) {
// dont fire event aggressively
// don't fire event aggressively
callback();
return;
}
@ -96,8 +96,8 @@ GitEngine.prototype.setMode = function(vcs) {
deferred.resolve();
var chain = deferred.promise;
// this stuff is tricky because we dont animate when
// we didnt do anything, but we DO animate when
// this stuff is tricky because we don't animate when
// we didn't do anything, but we DO animate when
// either of the operations happen. so a lot of
// branching ahead...
var neededUpdate = this.updateAllBranchesForHg();
@ -318,7 +318,7 @@ GitEngine.prototype.instantiateFromTree = function(tree) {
if (tree.originTree) {
var treeString = JSON.stringify(tree.originTree);
// if we dont have an animation queue (like when loading
// if we don't have an animation queue (like when loading
// right away), just go ahead and make an empty one
this.animationQueue = this.animationQueue || new AnimationQueue({
callback: function() {}
@ -434,7 +434,7 @@ GitEngine.prototype.findCommonAncestorForRemote = function(myTarget) {
return this.getCommonAncestor(
leftTarget,
rightTarget,
true // dont throw since we dont know the order here.
true // don't throw since we don't know the order here.
).get('id');
};
@ -451,7 +451,7 @@ GitEngine.prototype.findCommonAncestorWithRemote = function(originTarget) {
// Like above, could have two parents
var leftTarget = this.findCommonAncestorWithRemote(parents[0].get('id'));
var rightTarget = this.findCommonAncestorWithRemote(parents[1].get('id'));
return this.getCommonAncestor(leftTarget, rightTarget, true /* dont throw */).get('id');
return this.getCommonAncestor(leftTarget, rightTarget, true /* don't throw */).get('id');
};
GitEngine.prototype.makeBranchOnOriginAndTrack = function(branchName, target) {
@ -1113,7 +1113,7 @@ GitEngine.prototype.push = function(options) {
if (!commitsToMake.length) {
if (!options.force) {
// We are already up to date, and we cant be deleting
// either since we dont have --force
// either since we don't have --force
throw new GitError({
msg: intl.str('git-error-origin-fetch-uptodate')
});
@ -1133,7 +1133,7 @@ GitEngine.prototype.push = function(options) {
// now here is the tricky part -- the difference between local master
// and remote master might be commits C2, C3, and C4, but the remote
// might already have those commits. In this case, we dont need to
// might already have those commits. In this case, we don't need to
// make them, so filter these out
commitsToMake = _.filter(commitsToMake, function(commitJSON) {
return !this.origin.refs[commitJSON.id];
@ -1307,7 +1307,7 @@ GitEngine.prototype.fetchCore = function(sourceDestPairs, options) {
// now here is the tricky part -- the difference between local master
// and remote master might be commits C2, C3, and C4, but we
// might already have those commits. In this case, we dont need to
// might already have those commits. In this case, we don't need to
// make them, so filter these out
commitsToMake = _.filter(commitsToMake, function(commitJSON) {
return !this.refs[commitJSON.id];
@ -1617,7 +1617,7 @@ GitEngine.prototype.resolveName = function(someRef) {
GitEngine.prototype.resolveID = function(idOrTarget) {
if (idOrTarget === null || idOrTarget === undefined) {
throw new Error('Dont call this with null / undefined');
throw new Error('Don\'t call this with null / undefined');
}
if (typeof idOrTarget !== 'string') {
@ -1823,7 +1823,7 @@ GitEngine.prototype.pruneTreeAndPlay = function() {
GitEngine.prototype.pruneTree = function() {
var set = this.getUpstreamBranchSet();
// dont prune commits that HEAD depends on
// don't prune commits that HEAD depends on
var headSet = Graph.getUpstreamSet(this, 'HEAD');
_.each(headSet, function(val, commitID) {
set[commitID] = true;
@ -2238,7 +2238,7 @@ GitEngine.prototype.rebaseInteractiveTest = function(targetSource, currentLocati
if (extraCommits.length > 0) {
throw new GitError({
msg: intl.todo('Hey those commits dont exist in the set!')
msg: intl.todo('Hey those commits don\'t exist in the set!')
});
}
}
@ -2290,7 +2290,7 @@ GitEngine.prototype.rebaseInteractive = function(targetSource, currentLocation,
_.each(options.initialCommitOrdering[0].split(','), function(id) {
if (!rebaseMap[id]) {
throw new GitError({
msg: intl.todo('Hey those commits dont exist in the set!')
msg: intl.todo('Hey those commits don\'t exist in the set!')
});
}
initialCommitOrdering.push(id);
@ -2326,7 +2326,7 @@ GitEngine.prototype.filterRebaseCommits = function(
}
// we ALSO need to throw out commits that will do the same changes. like
// if the upstream set has a commit C4 and we have C4', we dont rebase the C4' again.
// if the upstream set has a commit C4 and we have C4', we don't rebase the C4' again.
var baseID = this.scrapeBaseID(commit.get('id'));
if (changesAlreadyMade[baseID]) {
return false;
@ -2787,7 +2787,7 @@ GitEngine.prototype.log = function(ref, omitSet) {
GitEngine.prototype.getCommonAncestor = function(ancestor, cousin, dontThrow) {
if (this.isUpstreamOf(cousin, ancestor) && !dontThrow) {
throw new Error('Dont use common ancestor if we are upstream!');
throw new Error('Don\'t use common ancestor if we are upstream!');
}
var upstreamSet = Graph.getUpstreamSet(this, ancestor);

View file

@ -271,7 +271,7 @@ var LevelBuilder = Level.extend({
this.startDialogObj = levelObj;
}.bind(this))
.fail(function() {
// nothing to do, they dont want to edit it apparently
// nothing to do, they don't want to edit it apparently
})
.done(function() {
if (command) {
@ -340,7 +340,7 @@ var LevelBuilder = Level.extend({
return whenEditedDialog.promise;
}.bind(this))
.fail(function() {
// if they dont want to edit the start dialog, do nothing
// if they don't want to edit the start dialog, do nothing
})
.done(function() {
askForStartDeferred.resolve();
@ -385,14 +385,14 @@ var LevelBuilder = Level.extend({
'help builder': LevelBuilder.__super__.startDialog
};
if (!methodMap[command.get('method')]) {
throw new Error('woah we dont support that method yet');
throw new Error('woah we don\'t support that method yet');
}
methodMap[command.get('method')].apply(this, arguments);
},
afterCommandDefer: function(defer, command) {
// we dont need to compare against the goal anymore
// we don't need to compare against the goal anymore
defer.resolve();
},

View file

@ -401,7 +401,7 @@ var Level = Sandbox.extend({
doesCommandCountTowardsTotal: function(command) {
if (command.get('error')) {
// dont count errors towards our count
// don't count errors towards our count
return false;
}
@ -645,7 +645,7 @@ var Level = Sandbox.extend({
};
var method = methodMap[command.get('method')];
if (!method) {
throw new Error('woah we dont support that method yet', method);
throw new Error('woah we don\'t support that method yet', method);
}
method.apply(this, [command, defer]);

View file

@ -27,7 +27,7 @@ ParseWaterfall.prototype.initParseWaterfall = function() {
return;
}
// by deferring the initialization here, we dont require()
// by deferring the initialization here, we don't require()
// level too early (which barfs our init)
this.parseWaterfall = this.options.parseWaterfall || [
Commands.parse,

View file

@ -43,7 +43,7 @@ var Command = Backbone.Model.extend({
},
initDefaults: function() {
// weird things happen with defaults if you dont
// weird things happen with defaults if you don't
// make new objects
this.set('generalArgs', []);
this.set('supportedMap', {});

View file

@ -76,7 +76,7 @@ EventBaton.prototype.passBatonBack = function(name, func, context, args) {
}
});
if (indexBefore === undefined) {
throw new Error('you are the last baton holder! or i didnt find you');
throw new Error('you are the last baton holder! or i didn\'t find you');
}
var toCallObj = listeners[indexBefore];
@ -105,7 +105,7 @@ EventBaton.prototype.releaseBaton = function(name, func, context) {
if (!found) {
console.log('did not find that function', func, context, name, arguments);
console.log(this.eventMap);
throw new Error('cant releasebaton if yu dont have it');
throw new Error('cant releasebaton if yu don\'t have it');
}
this.eventMap[name] = newListeners;
};

View file

@ -334,7 +334,7 @@ var MultiViewBuilder = ContainedBase.extend({
this.addChildViewObj(newView);
}.bind(this))
.fail(function() {
// they dont want to add the view apparently, so just return
// they don't want to add the view apparently, so just return
})
.done();
},

View file

@ -129,9 +129,9 @@ var GitDemonstrationView = ContainedBase.extend({
positive: function() {
if (this.demonstrated || !this.hasControl) {
// dont do anything if we are demonstrating, and if
// don't do anything if we are demonstrating, and if
// we receive a meta nav event and we aren't listening,
// then dont do anything either
// then don't do anything either
return;
}
this.demonstrated = true;

View file

@ -98,7 +98,7 @@ GitVisuals.prototype.resetAll = function() {
GitVisuals.prototype.tearDown = function() {
this.resetAll();
this.paper.remove();
// Unregister the refresh tree listener so we dont accumulate
// Unregister the refresh tree listener so we don't accumulate
// these over time. However we aren't calling tearDown in
// some places... but this is an improvement
var Main = require('../app');
@ -442,7 +442,7 @@ GitVisuals.prototype.fullCalc = function() {
};
GitVisuals.prototype.calcTreeCoords = function() {
// this method can only contain things that dont rely on graphics
// this method can only contain things that don't rely on graphics
if (!this.rootCommit) {
throw new Error('grr, no root commit!');
}

View file

@ -41,7 +41,7 @@ var VisBase = Backbone.Model.extend({
} else {
this.get(key).stop();
this.get(key).animate(attr[key], speed, easing);
// some keys dont support animating too, so set those instantly here
// some keys don't support animating too, so set those instantly here
_.forEach(this.getNonAnimateKeys(), function(nonAnimateKey) {
if (attr[key] && attr[key][nonAnimateKey] !== undefined) {
this.get(key).attr(nonAnimateKey, attr[key][nonAnimateKey]);

View file

@ -407,7 +407,7 @@ var VisBranch = VisBase.extend({
var textPos = this.getTextPosition();
var name = this.getName();
// when from a reload, we dont need to generate the text
// when from a reload, we don't need to generate the text
var text = paper.text(textPos.x, textPos.y, String(name));
text.attr({
'font-size': 14,

View file

@ -421,7 +421,7 @@ var VisNode = VisBase.extend({
});
// continuation calculation
if ((vx * vx + vy * vy) < 0.1 && Math.abs(y - maxHeight) <= 0.1) {
// dont need to animate anymore, we are on ground
// don't need to animate anymore, we are on ground
return false;
}
// keep animating!

View file

@ -251,7 +251,7 @@ var VisTag = VisBase.extend({
var textPos = this.getTextPosition();
var name = this.getName();
// when from a reload, we dont need to generate the text
// when from a reload, we don't need to generate the text
var text = paper.text(textPos.x, textPos.y, String(name));
text.attr({
'font-size': 14,

View file

@ -34,7 +34,7 @@ var Visualization = Backbone.View.extend({
this.paper = paper;
var Main = require('../app');
// if we dont want to receive keyboard input (directly),
// if we don't want to receive keyboard input (directly),
// make a new event baton so git engine steals something that no one
// is broadcasting to
this.eventBaton = (options.noKeyboardInput) ?