mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2025-12-23 13:12:42 +01:00
Moved commands to a separate file.
This commit is contained in:
25
app/commandsCatalog.js
Normal file
25
app/commandsCatalog.js
Normal file
@@ -0,0 +1,25 @@
|
||||
app.run(function() {
|
||||
|
||||
var dispatcher = app.get('dispatcher');
|
||||
|
||||
dispatcher.commands({
|
||||
'help': function() {
|
||||
return new app.models.HelpResult();
|
||||
},
|
||||
'clear': function() {
|
||||
app.controller('resultViewCtrl').clear();
|
||||
},
|
||||
'em': function() {
|
||||
var cfg = app.get('cmdConfig');
|
||||
cfg.emphasizeBytes = !cfg.cmdConfig.emphasizeBytes;
|
||||
}
|
||||
});
|
||||
|
||||
// TODO: Make as function
|
||||
dispatcher.command({
|
||||
canHandle: function(input) { return app.get('expression').canParse(input); },
|
||||
handle: function(input) {
|
||||
return app.get('expression').parse(input);
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user