diff --git a/build/bundle.js b/build/bundle.js index 06ac2775..c75cb83d 100644 --- a/build/bundle.js +++ b/build/bundle.js @@ -10996,6 +10996,8 @@ var Errors = require('../util/errors'); var GitCommands = require('../git/commands'); var GitOptionParser = GitCommands.GitOptionParser; +var sandboxInstantCommands = require('../level/sandboxCommands').sandboxInstantCommands; + var CommandProcessError = Errors.CommandProcessError; var GitError = Errors.GitError; var Warning = Errors.Warning; @@ -11091,77 +11093,6 @@ var Command = Backbone.Model.extend({ this.set('result', this.get('error').toResult()); }, - getSandboxCommands: function() { - return [ - [/^ls/, function() { - throw new CommandResult({ - msg: "DontWorryAboutFilesInThisDemo.txt" - }); - }], - [/^cd/, function() { - throw new CommandResult({ - msg: "Directory Changed to '/directories/dont/matter/in/this/demo'" - }); - }], - [/^git help($|\s)/, function() { - // sym link this to the blank git command - var allCommands = Command.prototype.getSandboxCommands(); - // wow this is hacky :( - var equivalent = 'git'; - _.each(allCommands, function(bits) { - var regex = bits[0]; - if (regex.test(equivalent)) { - bits[1](); - } - }); - }], - [/^git$/, function() { - var lines = [ - 'Git Version PCOTTLE.1.0', - '
', - 'Usage:', - _.escape('\t git []'), - '
', - 'Supported commands:', - '
' - ]; - var commands = GitOptionParser.prototype.getMasterOptionMap(); - - // build up a nice display of what we support - _.each(commands, function(commandOptions, command) { - lines.push('git ' + command); - _.each(commandOptions, function(vals, optionName) { - lines.push('\t ' + optionName); - }, this); - }, this); - - // format and throw - var msg = lines.join('\n'); - msg = msg.replace(/\t/g, '   '); - throw new CommandResult({ - msg: msg - }); - }], - [/^refresh$/, function() { - var events = require('../app').getEvents(); - - events.trigger('refreshTree'); - throw new CommandResult({ - msg: "Refreshing tree..." - }); - }], - [/^rollup (\d+)$/, function(bits) { - var events = require('../app').getEvents(); - - // go roll up these commands by joining them with semicolons - events.trigger('rollupCommands', bits[1]); - throw new CommandResult({ - msg: 'Commands combined!' - }); - }] - ]; - }, - parse: function() { var str = this.get('rawStr'); // first if the string is empty, they just want a blank line @@ -11173,7 +11104,7 @@ var Command = Backbone.Model.extend({ this.set('rawStr', str); // then check if it's one of our sandbox commands - _.each(this.getSandboxCommands(), function(tuple) { + _.each(sandboxInstantCommands, function(tuple) { var regex = tuple[0]; var results = regex.exec(str); if (results) { @@ -11380,6 +11311,90 @@ exports.GitOptionParser = GitOptionParser; }); +require.define("/src/js/level/sandboxCommands.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore'); + +var GitCommands = require('../git/commands'); +var GitOptionParser = GitCommands.GitOptionParser; + +var Errors = require('../util/errors'); +var CommandProcessError = Errors.CommandProcessError; +var GitError = Errors.GitError; +var Warning = Errors.Warning; +var CommandResult = Errors.CommandResult; + +var sandboxInstantCommands = [ + [/^ls/, function() { + throw new CommandResult({ + msg: "DontWorryAboutFilesInThisDemo.txt" + }); + }], + [/^cd/, function() { + throw new CommandResult({ + msg: "Directory Changed to '/directories/dont/matter/in/this/demo'" + }); + }], + [/^git help($|\s)/, function() { + // sym link this to the blank git command + var allCommands = Command.prototype.getSandboxCommands(); + // wow this is hacky :( + var equivalent = 'git'; + _.each(allCommands, function(bits) { + var regex = bits[0]; + if (regex.test(equivalent)) { + bits[1](); + } + }); + }], + [/^git$/, function() { + var lines = [ + 'Git Version PCOTTLE.1.0', + '
', + 'Usage:', + _.escape('\t git []'), + '
', + 'Supported commands:', + '
' + ]; + var commands = GitOptionParser.prototype.getMasterOptionMap(); + + // build up a nice display of what we support + _.each(commands, function(commandOptions, command) { + lines.push('git ' + command); + _.each(commandOptions, function(vals, optionName) { + lines.push('\t ' + optionName); + }, this); + }, this); + + // format and throw + var msg = lines.join('\n'); + msg = msg.replace(/\t/g, '   '); + throw new CommandResult({ + msg: msg + }); + }], + [/^refresh$/, function() { + var events = require('../app').getEvents(); + + events.trigger('refreshTree'); + throw new CommandResult({ + msg: "Refreshing tree..." + }); + }], + [/^rollup (\d+)$/, function(bits) { + var events = require('../app').getEvents(); + + // go roll up these commands by joining them with semicolons + events.trigger('rollupCommands', bits[1]); + throw new CommandResult({ + msg: 'Commands combined!' + }); + }] +]; + +exports.sandboxInstantCommands = sandboxInstantCommands; + +}); + require.define("/src/js/app/index.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore'); var Backbone = require('backbone'); @@ -13787,8 +13802,6 @@ function InputWaterfall(options) { 'git rebase': true }; - console.log('made'); - this.listen(); } @@ -16207,8 +16220,6 @@ function InputWaterfall(options) { 'git rebase': true }; - console.log('made'); - this.listen(); } @@ -16273,6 +16284,91 @@ exports.InputWaterfall = InputWaterfall; }); require("/src/js/level/inputWaterfall.js"); +require.define("/src/js/level/sandboxCommands.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore'); + +var GitCommands = require('../git/commands'); +var GitOptionParser = GitCommands.GitOptionParser; + +var Errors = require('../util/errors'); +var CommandProcessError = Errors.CommandProcessError; +var GitError = Errors.GitError; +var Warning = Errors.Warning; +var CommandResult = Errors.CommandResult; + +var sandboxInstantCommands = [ + [/^ls/, function() { + throw new CommandResult({ + msg: "DontWorryAboutFilesInThisDemo.txt" + }); + }], + [/^cd/, function() { + throw new CommandResult({ + msg: "Directory Changed to '/directories/dont/matter/in/this/demo'" + }); + }], + [/^git help($|\s)/, function() { + // sym link this to the blank git command + var allCommands = Command.prototype.getSandboxCommands(); + // wow this is hacky :( + var equivalent = 'git'; + _.each(allCommands, function(bits) { + var regex = bits[0]; + if (regex.test(equivalent)) { + bits[1](); + } + }); + }], + [/^git$/, function() { + var lines = [ + 'Git Version PCOTTLE.1.0', + '
', + 'Usage:', + _.escape('\t git []'), + '
', + 'Supported commands:', + '
' + ]; + var commands = GitOptionParser.prototype.getMasterOptionMap(); + + // build up a nice display of what we support + _.each(commands, function(commandOptions, command) { + lines.push('git ' + command); + _.each(commandOptions, function(vals, optionName) { + lines.push('\t ' + optionName); + }, this); + }, this); + + // format and throw + var msg = lines.join('\n'); + msg = msg.replace(/\t/g, '   '); + throw new CommandResult({ + msg: msg + }); + }], + [/^refresh$/, function() { + var events = require('../app').getEvents(); + + events.trigger('refreshTree'); + throw new CommandResult({ + msg: "Refreshing tree..." + }); + }], + [/^rollup (\d+)$/, function(bits) { + var events = require('../app').getEvents(); + + // go roll up these commands by joining them with semicolons + events.trigger('rollupCommands', bits[1]); + throw new CommandResult({ + msg: 'Commands combined!' + }); + }] +]; + +exports.sandboxInstantCommands = sandboxInstantCommands; + +}); +require("/src/js/level/sandboxCommands.js"); + require.define("/src/js/models/collections.js",function(require,module,exports,__dirname,__filename,process,global){var _ = require('underscore'); // horrible hack to get localStorage Backbone plugin var Backbone = (!require('../util').isBrowser()) ? Backbone = require('backbone') : Backbone = window.Backbone; @@ -16390,6 +16486,8 @@ var Errors = require('../util/errors'); var GitCommands = require('../git/commands'); var GitOptionParser = GitCommands.GitOptionParser; +var sandboxInstantCommands = require('../level/sandboxCommands').sandboxInstantCommands; + var CommandProcessError = Errors.CommandProcessError; var GitError = Errors.GitError; var Warning = Errors.Warning; @@ -16485,77 +16583,6 @@ var Command = Backbone.Model.extend({ this.set('result', this.get('error').toResult()); }, - getSandboxCommands: function() { - return [ - [/^ls/, function() { - throw new CommandResult({ - msg: "DontWorryAboutFilesInThisDemo.txt" - }); - }], - [/^cd/, function() { - throw new CommandResult({ - msg: "Directory Changed to '/directories/dont/matter/in/this/demo'" - }); - }], - [/^git help($|\s)/, function() { - // sym link this to the blank git command - var allCommands = Command.prototype.getSandboxCommands(); - // wow this is hacky :( - var equivalent = 'git'; - _.each(allCommands, function(bits) { - var regex = bits[0]; - if (regex.test(equivalent)) { - bits[1](); - } - }); - }], - [/^git$/, function() { - var lines = [ - 'Git Version PCOTTLE.1.0', - '
', - 'Usage:', - _.escape('\t git []'), - '
', - 'Supported commands:', - '
' - ]; - var commands = GitOptionParser.prototype.getMasterOptionMap(); - - // build up a nice display of what we support - _.each(commands, function(commandOptions, command) { - lines.push('git ' + command); - _.each(commandOptions, function(vals, optionName) { - lines.push('\t ' + optionName); - }, this); - }, this); - - // format and throw - var msg = lines.join('\n'); - msg = msg.replace(/\t/g, '   '); - throw new CommandResult({ - msg: msg - }); - }], - [/^refresh$/, function() { - var events = require('../app').getEvents(); - - events.trigger('refreshTree'); - throw new CommandResult({ - msg: "Refreshing tree..." - }); - }], - [/^rollup (\d+)$/, function(bits) { - var events = require('../app').getEvents(); - - // go roll up these commands by joining them with semicolons - events.trigger('rollupCommands', bits[1]); - throw new CommandResult({ - msg: 'Commands combined!' - }); - }] - ]; - }, - parse: function() { var str = this.get('rawStr'); // first if the string is empty, they just want a blank line @@ -16567,7 +16594,7 @@ var Command = Backbone.Model.extend({ this.set('rawStr', str); // then check if it's one of our sandbox commands - _.each(this.getSandboxCommands(), function(tuple) { + _.each(sandboxInstantCommands, function(tuple) { var regex = tuple[0]; var results = regex.exec(str); if (results) { diff --git a/src/js/level/inputWaterfall.js b/src/js/level/inputWaterfall.js index 2140410c..54d413f0 100644 --- a/src/js/level/inputWaterfall.js +++ b/src/js/level/inputWaterfall.js @@ -25,8 +25,6 @@ function InputWaterfall(options) { 'git rebase': true }; - console.log('made'); - this.listen(); } diff --git a/src/js/models/commandModel.js b/src/js/models/commandModel.js index 47263d2f..e698938a 100644 --- a/src/js/models/commandModel.js +++ b/src/js/models/commandModel.js @@ -6,6 +6,8 @@ var Errors = require('../util/errors'); var GitCommands = require('../git/commands'); var GitOptionParser = GitCommands.GitOptionParser; +var sandboxInstantCommands = require('../level/sandboxCommands').sandboxInstantCommands; + var CommandProcessError = Errors.CommandProcessError; var GitError = Errors.GitError; var Warning = Errors.Warning; @@ -101,77 +103,6 @@ var Command = Backbone.Model.extend({ this.set('result', this.get('error').toResult()); }, - getSandboxCommands: function() { - return [ - [/^ls/, function() { - throw new CommandResult({ - msg: "DontWorryAboutFilesInThisDemo.txt" - }); - }], - [/^cd/, function() { - throw new CommandResult({ - msg: "Directory Changed to '/directories/dont/matter/in/this/demo'" - }); - }], - [/^git help($|\s)/, function() { - // sym link this to the blank git command - var allCommands = Command.prototype.getSandboxCommands(); - // wow this is hacky :( - var equivalent = 'git'; - _.each(allCommands, function(bits) { - var regex = bits[0]; - if (regex.test(equivalent)) { - bits[1](); - } - }); - }], - [/^git$/, function() { - var lines = [ - 'Git Version PCOTTLE.1.0', - '
', - 'Usage:', - _.escape('\t git []'), - '
', - 'Supported commands:', - '
' - ]; - var commands = GitOptionParser.prototype.getMasterOptionMap(); - - // build up a nice display of what we support - _.each(commands, function(commandOptions, command) { - lines.push('git ' + command); - _.each(commandOptions, function(vals, optionName) { - lines.push('\t ' + optionName); - }, this); - }, this); - - // format and throw - var msg = lines.join('\n'); - msg = msg.replace(/\t/g, '   '); - throw new CommandResult({ - msg: msg - }); - }], - [/^refresh$/, function() { - var events = require('../app').getEvents(); - - events.trigger('refreshTree'); - throw new CommandResult({ - msg: "Refreshing tree..." - }); - }], - [/^rollup (\d+)$/, function(bits) { - var events = require('../app').getEvents(); - - // go roll up these commands by joining them with semicolons - events.trigger('rollupCommands', bits[1]); - throw new CommandResult({ - msg: 'Commands combined!' - }); - }] - ]; - }, - parse: function() { var str = this.get('rawStr'); // first if the string is empty, they just want a blank line @@ -183,7 +114,7 @@ var Command = Backbone.Model.extend({ this.set('rawStr', str); // then check if it's one of our sandbox commands - _.each(this.getSandboxCommands(), function(tuple) { + _.each(sandboxInstantCommands, function(tuple) { var regex = tuple[0]; var results = regex.exec(str); if (results) {