mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 00:40:07 +02:00
Issue #70 dont mark as solved when using solution show
This commit is contained in:
parent
94d354af22
commit
92bd248c18
7 changed files with 87 additions and 39 deletions
|
@ -7356,16 +7356,17 @@ var Level = Sandbox.extend({
|
||||||
|
|
||||||
showSolution: function(command, deferred) {
|
showSolution: function(command, deferred) {
|
||||||
var toIssue = this.level.solutionCommand;
|
var toIssue = this.level.solutionCommand;
|
||||||
var issueFunc = function() {
|
var issueFunc = _.bind(function() {
|
||||||
|
this.isShowingSolution = true;
|
||||||
Main.getEventBaton().trigger(
|
Main.getEventBaton().trigger(
|
||||||
'commandSubmitted',
|
'commandSubmitted',
|
||||||
toIssue
|
toIssue
|
||||||
);
|
);
|
||||||
};
|
}, this);
|
||||||
|
|
||||||
var commandStr = command.get('rawStr');
|
var commandStr = command.get('rawStr');
|
||||||
if (!this.testOptionOnString(commandStr, 'noReset')) {
|
if (!this.testOptionOnString(commandStr, 'noReset')) {
|
||||||
toIssue = 'reset; ' + toIssue;
|
toIssue = 'reset --forSolution; ' + toIssue;
|
||||||
}
|
}
|
||||||
if (this.testOptionOnString(commandStr, 'force')) {
|
if (this.testOptionOnString(commandStr, 'force')) {
|
||||||
issueFunc();
|
issueFunc();
|
||||||
|
@ -7375,13 +7376,9 @@ var Level = Sandbox.extend({
|
||||||
|
|
||||||
// allow them for force the solution
|
// allow them for force the solution
|
||||||
var confirmDefer = Q.defer();
|
var confirmDefer = Q.defer();
|
||||||
// TODO intl
|
var dialog = intl.getDialog(require('../dialogs/confirmShowSolution'))[0];
|
||||||
var confirmView = new ConfirmCancelTerminal({
|
var confirmView = new ConfirmCancelTerminal({
|
||||||
markdowns: [
|
markdowns: dialog.options.markdowns,
|
||||||
'## Are you sure you want to see the solution?',
|
|
||||||
'',
|
|
||||||
'I believe in you! You can do it'
|
|
||||||
],
|
|
||||||
deferred: confirmDefer
|
deferred: confirmDefer
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -7555,7 +7552,10 @@ var Level = Sandbox.extend({
|
||||||
|
|
||||||
levelSolved: function(defer) {
|
levelSolved: function(defer) {
|
||||||
this.solved = true;
|
this.solved = true;
|
||||||
Main.getEvents().trigger('levelSolved', this.level.id);
|
if (!this.isShowingSolution) {
|
||||||
|
Main.getEvents().trigger('levelSolved', this.level.id);
|
||||||
|
}
|
||||||
|
|
||||||
this.hideGoal();
|
this.hideGoal();
|
||||||
|
|
||||||
var nextLevel = Main.getLevelArbiter().getNextLevel(this.level.id);
|
var nextLevel = Main.getLevelArbiter().getNextLevel(this.level.id);
|
||||||
|
@ -7636,8 +7636,13 @@ var Level = Sandbox.extend({
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
|
||||||
reset: function() {
|
reset: function(command, deferred) {
|
||||||
this.gitCommandsIssued = [];
|
this.gitCommandsIssued = [];
|
||||||
|
|
||||||
|
var commandStr = (command) ? command.get('rawStr') : '';
|
||||||
|
if (!this.testOptionOnString(commandStr, 'forSolution')) {
|
||||||
|
this.isShowingSolution = false;
|
||||||
|
}
|
||||||
this.solved = false;
|
this.solved = false;
|
||||||
Level.__super__.reset.apply(this, arguments);
|
Level.__super__.reset.apply(this, arguments);
|
||||||
},
|
},
|
||||||
|
@ -14055,7 +14060,7 @@ var instantCommands = [
|
||||||
var regexMap = {
|
var regexMap = {
|
||||||
'reset solved': /^reset solved($|\s)/,
|
'reset solved': /^reset solved($|\s)/,
|
||||||
'help': /^help( +general)?$|^\?$/,
|
'help': /^help( +general)?$|^\?$/,
|
||||||
'reset': /^reset$/,
|
'reset': /^reset( +--forSolution)?$/,
|
||||||
'delay': /^delay (\d+)$/,
|
'delay': /^delay (\d+)$/,
|
||||||
'clear': /^clear($|\s)/,
|
'clear': /^clear($|\s)/,
|
||||||
'exit level': /^exit level($|\s)/,
|
'exit level': /^exit level($|\s)/,
|
||||||
|
@ -17529,6 +17534,22 @@ DisabledMap.prototype.getInstantCommands = function() {
|
||||||
exports.DisabledMap = DisabledMap;
|
exports.DisabledMap = DisabledMap;
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
require.define("/src/js/dialogs/confirmShowSolution.js",function(require,module,exports,__dirname,__filename,process,global){exports.dialog = {
|
||||||
|
'en_US': [{
|
||||||
|
type: 'ModalAlert',
|
||||||
|
options: {
|
||||||
|
markdowns: [
|
||||||
|
'## Are you sure you want to see the solution?',
|
||||||
|
'',
|
||||||
|
'I believe in you! You can do it'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
require.define("/src/js/level/arbiter.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore');
|
require.define("/src/js/level/arbiter.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore');
|
||||||
|
@ -20982,6 +21003,23 @@ exports.init = init;
|
||||||
});
|
});
|
||||||
require("/src/js/app/index.js");
|
require("/src/js/app/index.js");
|
||||||
|
|
||||||
|
require.define("/src/js/dialogs/confirmShowSolution.js",function(require,module,exports,__dirname,__filename,process,global){exports.dialog = {
|
||||||
|
'en_US': [{
|
||||||
|
type: 'ModalAlert',
|
||||||
|
options: {
|
||||||
|
markdowns: [
|
||||||
|
'## Are you sure you want to see the solution?',
|
||||||
|
'',
|
||||||
|
'I believe in you! You can do it'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
require("/src/js/dialogs/confirmShowSolution.js");
|
||||||
|
|
||||||
require.define("/src/js/dialogs/levelBuilder.js",function(require,module,exports,__dirname,__filename,process,global){exports.dialog = {
|
require.define("/src/js/dialogs/levelBuilder.js",function(require,module,exports,__dirname,__filename,process,global){exports.dialog = {
|
||||||
'en_US': [{
|
'en_US': [{
|
||||||
type: 'ModalAlert',
|
type: 'ModalAlert',
|
||||||
|
@ -24983,16 +25021,17 @@ var Level = Sandbox.extend({
|
||||||
|
|
||||||
showSolution: function(command, deferred) {
|
showSolution: function(command, deferred) {
|
||||||
var toIssue = this.level.solutionCommand;
|
var toIssue = this.level.solutionCommand;
|
||||||
var issueFunc = function() {
|
var issueFunc = _.bind(function() {
|
||||||
|
this.isShowingSolution = true;
|
||||||
Main.getEventBaton().trigger(
|
Main.getEventBaton().trigger(
|
||||||
'commandSubmitted',
|
'commandSubmitted',
|
||||||
toIssue
|
toIssue
|
||||||
);
|
);
|
||||||
};
|
}, this);
|
||||||
|
|
||||||
var commandStr = command.get('rawStr');
|
var commandStr = command.get('rawStr');
|
||||||
if (!this.testOptionOnString(commandStr, 'noReset')) {
|
if (!this.testOptionOnString(commandStr, 'noReset')) {
|
||||||
toIssue = 'reset; ' + toIssue;
|
toIssue = 'reset --forSolution; ' + toIssue;
|
||||||
}
|
}
|
||||||
if (this.testOptionOnString(commandStr, 'force')) {
|
if (this.testOptionOnString(commandStr, 'force')) {
|
||||||
issueFunc();
|
issueFunc();
|
||||||
|
@ -25002,13 +25041,9 @@ var Level = Sandbox.extend({
|
||||||
|
|
||||||
// allow them for force the solution
|
// allow them for force the solution
|
||||||
var confirmDefer = Q.defer();
|
var confirmDefer = Q.defer();
|
||||||
// TODO intl
|
var dialog = intl.getDialog(require('../dialogs/confirmShowSolution'))[0];
|
||||||
var confirmView = new ConfirmCancelTerminal({
|
var confirmView = new ConfirmCancelTerminal({
|
||||||
markdowns: [
|
markdowns: dialog.options.markdowns,
|
||||||
'## Are you sure you want to see the solution?',
|
|
||||||
'',
|
|
||||||
'I believe in you! You can do it'
|
|
||||||
],
|
|
||||||
deferred: confirmDefer
|
deferred: confirmDefer
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -25182,7 +25217,10 @@ var Level = Sandbox.extend({
|
||||||
|
|
||||||
levelSolved: function(defer) {
|
levelSolved: function(defer) {
|
||||||
this.solved = true;
|
this.solved = true;
|
||||||
Main.getEvents().trigger('levelSolved', this.level.id);
|
if (!this.isShowingSolution) {
|
||||||
|
Main.getEvents().trigger('levelSolved', this.level.id);
|
||||||
|
}
|
||||||
|
|
||||||
this.hideGoal();
|
this.hideGoal();
|
||||||
|
|
||||||
var nextLevel = Main.getLevelArbiter().getNextLevel(this.level.id);
|
var nextLevel = Main.getLevelArbiter().getNextLevel(this.level.id);
|
||||||
|
@ -25263,8 +25301,13 @@ var Level = Sandbox.extend({
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
|
||||||
reset: function() {
|
reset: function(command, deferred) {
|
||||||
this.gitCommandsIssued = [];
|
this.gitCommandsIssued = [];
|
||||||
|
|
||||||
|
var commandStr = (command) ? command.get('rawStr') : '';
|
||||||
|
if (!this.testOptionOnString(commandStr, 'forSolution')) {
|
||||||
|
this.isShowingSolution = false;
|
||||||
|
}
|
||||||
this.solved = false;
|
this.solved = false;
|
||||||
Level.__super__.reset.apply(this, arguments);
|
Level.__super__.reset.apply(this, arguments);
|
||||||
},
|
},
|
||||||
|
@ -25942,7 +25985,7 @@ var instantCommands = [
|
||||||
var regexMap = {
|
var regexMap = {
|
||||||
'reset solved': /^reset solved($|\s)/,
|
'reset solved': /^reset solved($|\s)/,
|
||||||
'help': /^help( +general)?$|^\?$/,
|
'help': /^help( +general)?$|^\?$/,
|
||||||
'reset': /^reset$/,
|
'reset': /^reset( +--forSolution)?$/,
|
||||||
'delay': /^delay (\d+)$/,
|
'delay': /^delay (\d+)$/,
|
||||||
'clear': /^clear($|\s)/,
|
'clear': /^clear($|\s)/,
|
||||||
'exit level': /^exit level($|\s)/,
|
'exit level': /^exit level($|\s)/,
|
||||||
|
|
1
build/bundle.min.3da7a96b.js
Normal file
1
build/bundle.min.3da7a96b.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
build/bundle.min.js
vendored
2
build/bundle.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -412,7 +412,7 @@
|
||||||
For a much easier time perusing the source, see the individual files at:
|
For a much easier time perusing the source, see the individual files at:
|
||||||
https://github.com/pcottle/learnGitBranching
|
https://github.com/pcottle/learnGitBranching
|
||||||
-->
|
-->
|
||||||
<script src="build/bundle.min.598fe9d4.js"></script>
|
<script src="build/bundle.min.3da7a96b.js"></script>
|
||||||
|
|
||||||
<!-- The advantage of github pages: super-easy, simple, slick static hostic.
|
<!-- The advantage of github pages: super-easy, simple, slick static hostic.
|
||||||
The downside? No raw logs to parse for analytics, so I have to include
|
The downside? No raw logs to parse for analytics, so I have to include
|
||||||
|
|
|
@ -152,16 +152,17 @@ var Level = Sandbox.extend({
|
||||||
|
|
||||||
showSolution: function(command, deferred) {
|
showSolution: function(command, deferred) {
|
||||||
var toIssue = this.level.solutionCommand;
|
var toIssue = this.level.solutionCommand;
|
||||||
var issueFunc = function() {
|
var issueFunc = _.bind(function() {
|
||||||
|
this.isShowingSolution = true;
|
||||||
Main.getEventBaton().trigger(
|
Main.getEventBaton().trigger(
|
||||||
'commandSubmitted',
|
'commandSubmitted',
|
||||||
toIssue
|
toIssue
|
||||||
);
|
);
|
||||||
};
|
}, this);
|
||||||
|
|
||||||
var commandStr = command.get('rawStr');
|
var commandStr = command.get('rawStr');
|
||||||
if (!this.testOptionOnString(commandStr, 'noReset')) {
|
if (!this.testOptionOnString(commandStr, 'noReset')) {
|
||||||
toIssue = 'reset; ' + toIssue;
|
toIssue = 'reset --forSolution; ' + toIssue;
|
||||||
}
|
}
|
||||||
if (this.testOptionOnString(commandStr, 'force')) {
|
if (this.testOptionOnString(commandStr, 'force')) {
|
||||||
issueFunc();
|
issueFunc();
|
||||||
|
@ -171,13 +172,9 @@ var Level = Sandbox.extend({
|
||||||
|
|
||||||
// allow them for force the solution
|
// allow them for force the solution
|
||||||
var confirmDefer = Q.defer();
|
var confirmDefer = Q.defer();
|
||||||
// TODO intl
|
var dialog = intl.getDialog(require('../dialogs/confirmShowSolution'))[0];
|
||||||
var confirmView = new ConfirmCancelTerminal({
|
var confirmView = new ConfirmCancelTerminal({
|
||||||
markdowns: [
|
markdowns: dialog.options.markdowns,
|
||||||
'## Are you sure you want to see the solution?',
|
|
||||||
'',
|
|
||||||
'I believe in you! You can do it'
|
|
||||||
],
|
|
||||||
deferred: confirmDefer
|
deferred: confirmDefer
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -351,7 +348,10 @@ var Level = Sandbox.extend({
|
||||||
|
|
||||||
levelSolved: function(defer) {
|
levelSolved: function(defer) {
|
||||||
this.solved = true;
|
this.solved = true;
|
||||||
Main.getEvents().trigger('levelSolved', this.level.id);
|
if (!this.isShowingSolution) {
|
||||||
|
Main.getEvents().trigger('levelSolved', this.level.id);
|
||||||
|
}
|
||||||
|
|
||||||
this.hideGoal();
|
this.hideGoal();
|
||||||
|
|
||||||
var nextLevel = Main.getLevelArbiter().getNextLevel(this.level.id);
|
var nextLevel = Main.getLevelArbiter().getNextLevel(this.level.id);
|
||||||
|
@ -432,8 +432,13 @@ var Level = Sandbox.extend({
|
||||||
];
|
];
|
||||||
},
|
},
|
||||||
|
|
||||||
reset: function() {
|
reset: function(command, deferred) {
|
||||||
this.gitCommandsIssued = [];
|
this.gitCommandsIssued = [];
|
||||||
|
|
||||||
|
var commandStr = (command) ? command.get('rawStr') : '';
|
||||||
|
if (!this.testOptionOnString(commandStr, 'forSolution')) {
|
||||||
|
this.isShowingSolution = false;
|
||||||
|
}
|
||||||
this.solved = false;
|
this.solved = false;
|
||||||
Level.__super__.reset.apply(this, arguments);
|
Level.__super__.reset.apply(this, arguments);
|
||||||
},
|
},
|
||||||
|
|
|
@ -71,7 +71,7 @@ var instantCommands = [
|
||||||
var regexMap = {
|
var regexMap = {
|
||||||
'reset solved': /^reset solved($|\s)/,
|
'reset solved': /^reset solved($|\s)/,
|
||||||
'help': /^help( +general)?$|^\?$/,
|
'help': /^help( +general)?$|^\?$/,
|
||||||
'reset': /^reset$/,
|
'reset': /^reset( +--forSolution)?$/,
|
||||||
'delay': /^delay (\d+)$/,
|
'delay': /^delay (\d+)$/,
|
||||||
'clear': /^clear($|\s)/,
|
'clear': /^clear($|\s)/,
|
||||||
'exit level': /^exit level($|\s)/,
|
'exit level': /^exit level($|\s)/,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue