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