mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-29 09:20:03 +02:00
levle 4 cute
This commit is contained in:
parent
bde5681573
commit
a83a12b211
6 changed files with 185 additions and 45 deletions
|
@ -897,6 +897,7 @@ GitEngine.prototype.dateSortFunc = function(cA, cB) {
|
|||
var dateB = new Date(cB.get('createTime'));
|
||||
if (dateA - dateB === 0) {
|
||||
console.warn('WUT it is equal');
|
||||
console.log(cA, cB);
|
||||
}
|
||||
return dateA - dateB;
|
||||
};
|
||||
|
|
|
@ -43,7 +43,6 @@ var Level = Sandbox.extend({
|
|||
this.commandsThatCount = this.getCommandsThatCount();
|
||||
this.solved = false;
|
||||
|
||||
// possible options on how stringent to be on comparisons go here
|
||||
this.treeCompare = new TreeCompare();
|
||||
|
||||
this.initGoalData(options);
|
||||
|
@ -156,13 +155,11 @@ var Level = Sandbox.extend({
|
|||
showSolution: function(command, deferred) {
|
||||
var confirmDefer = Q.defer();
|
||||
var confirmView = new ConfirmCancelTerminal({
|
||||
modalAlert: {
|
||||
markdowns: [
|
||||
'## Are you sure you want to see the solution?',
|
||||
'',
|
||||
'I believe in you! You can do it'
|
||||
]
|
||||
},
|
||||
markdowns: [
|
||||
'## Are you sure you want to see the solution?',
|
||||
'',
|
||||
'I believe in you! You can do it'
|
||||
],
|
||||
deferred: confirmDefer
|
||||
});
|
||||
|
||||
|
@ -282,7 +279,12 @@ var Level = Sandbox.extend({
|
|||
|
||||
// ok so lets see if they solved it...
|
||||
var current = this.mainVis.gitEngine.exportTree();
|
||||
var solved = this.treeCompare.compareAllBranchesWithinTreesAndHEAD(current, this.level.goalTreeString);
|
||||
var solved;
|
||||
if (this.level.compareOnlyMaster) {
|
||||
solved = this.treeCompare.compareBranchWithinTrees(current, this.level.goalTreeString, 'master');
|
||||
} else {
|
||||
solved = this.treeCompare.compareAllBranchesWithinTreesAndHEAD(current, this.level.goalTreeString);
|
||||
}
|
||||
|
||||
if (!solved) {
|
||||
defer.resolve();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue