mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2025-12-12 16:02:08 +01:00
Renamed resultViewCtrl to cmdController
This commit is contained in:
@@ -8,7 +8,7 @@ app.run(function() {
|
||||
return new app.models.HelpResult();
|
||||
},
|
||||
'clear': function() {
|
||||
app.controller('resultViewCtrl').clear();
|
||||
app.controller('cmdController').clear();
|
||||
},
|
||||
'em': function() {
|
||||
var cfg = app.get('cmdConfig');
|
||||
|
||||
@@ -4,14 +4,13 @@ app.compose(function() {
|
||||
app.set('dispatcher', function() {
|
||||
var handlers = [];
|
||||
var is = app.get('is');
|
||||
var resultView = app.controller('resultViewCtrl');
|
||||
var cmdController = app.controller('cmdController');
|
||||
|
||||
return {
|
||||
dispatch: function(rawInput) {
|
||||
var input = rawInput.trim();
|
||||
var handler = this.findHandler(input);
|
||||
|
||||
|
||||
if(handler != null) {
|
||||
|
||||
if(app.debugMode) {
|
||||
@@ -77,12 +76,12 @@ app.compose(function() {
|
||||
var cmdResult = handler.handle(input);
|
||||
if(cmdResult != null) {
|
||||
var r = new app.models.DisplayResult(input, cmdResult);
|
||||
resultView.display(r);
|
||||
cmdController.display(r);
|
||||
}
|
||||
},
|
||||
displayCommandError: function (input, message) {
|
||||
var error = new app.models.ErrorResult(message);
|
||||
resultView.display(new app.models.DisplayResult(input, error));
|
||||
cmdController.display(new app.models.DisplayResult(input, error));
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
@@ -53,7 +53,7 @@ app.compose(function() {
|
||||
}
|
||||
});
|
||||
|
||||
app.controller('resultViewCtrl', function() {
|
||||
app.controller('cmdController', function() {
|
||||
var html = app.get('html');
|
||||
|
||||
return {
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div id="output" data-controller="resultViewCtrl">
|
||||
<div id="output" data-controller="cmdController">
|
||||
</div>
|
||||
|
||||
<script data-template="helpResultTpl" type="text/template">
|
||||
|
||||
Reference in New Issue
Block a user