mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-23 20:24:45 +02:00
better
This commit is contained in:
parent
d5f456fa0c
commit
6ee05c1f0a
6 changed files with 102 additions and 33 deletions
src/js/level
|
@ -82,7 +82,6 @@ var Sandbox = Backbone.View.extend({
|
|||
Main.getEvents().trigger('commandSubmittedPassive', value);
|
||||
|
||||
util.splitTextCommand(value, function(command) {
|
||||
console.log('adding command', command);
|
||||
this.commandCollection.add(new Command({
|
||||
rawStr: command,
|
||||
parseWaterfall: this.parseWaterfall
|
||||
|
@ -94,7 +93,8 @@ var Sandbox = Backbone.View.extend({
|
|||
var commandMap = {
|
||||
help: this.helpDialog,
|
||||
reset: this.reset,
|
||||
delay: this.delay
|
||||
delay: this.delay,
|
||||
clear: this.clear
|
||||
};
|
||||
var method = commandMap[command.get('method')];
|
||||
if (!method) { throw new Error('no method for that wut'); }
|
||||
|
@ -102,6 +102,11 @@ var Sandbox = Backbone.View.extend({
|
|||
method.apply(this, [command, deferred]);
|
||||
},
|
||||
|
||||
clear: function(command, deferred) {
|
||||
Main.getEvents().trigger('clearOldCommands');
|
||||
command.finishWith(deferred);
|
||||
},
|
||||
|
||||
delay: function(command, deferred) {
|
||||
var amount = parseInt(command.get('regexResults')[1], 10);
|
||||
setTimeout(function() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue