cmdController only used by cmd

This commit is contained in:
Borys Levytskyi
2015-04-05 13:36:34 +03:00
parent 5ce2f2b653
commit a5b0bf40e0
3 changed files with 8 additions and 5 deletions

View File

@@ -8,7 +8,7 @@ app.compose(function() {
return {
execute: function(rawInput) {
var input = rawInput.trim();
var input = rawInput.trim().toLowerCase();
var handler = this.findHandler(input);
if(handler != null) {
@@ -82,6 +82,9 @@ app.compose(function() {
displayCommandError: function (input, message) {
var error = new app.models.ErrorResult(message);
cmdController.display(new app.models.DisplayResult(input, error));
},
clear: function() {
cmdController.clear();
}
};
});

View File

@@ -2,6 +2,7 @@ app.run(function() {
"use strict";
var cmd = app.get('cmd');
var cmdConfig = app.get('cmdConfig');
cmd.commands({
'help': function() {
@@ -13,11 +14,10 @@ app.run(function() {
return new app.models.HelpResult();
},
'clear': function() {
app.controller('cmdController').clear();
cmd.clear();
},
'em': function() {
var cfg = app.get('cmdConfig');
cfg.emphasizeBytes = !cfg.emphasizeBytes;
cmdConfig.emphasizeBytes = !cmdConfig.emphasizeBytes;
}
});

View File

@@ -44,7 +44,7 @@
</div>
<div>
<input id="in" type="text" class="expressionInput mono" data-controller="expressionInputCtrl" placeholder="type expression like '1>>2' or 'help' "/>
<input id="in" type="text" class="expressionInput mono" data-controller="expressionInputCtrl" placeholder="> type expression like '1>>2' or 'help' "/>
<span data-controller="configPanelCtrl" class="configPnl">
<span id="emphasizeBytes" class="indicator on"><strong>em:</strong> Emphasize Bytes</span>