make hash_handler parseKeys accessible from outside

This commit is contained in:
nightwing 2012-04-25 21:19:11 +04:00
commit 6799599306

View file

@ -84,10 +84,10 @@ function HashHandler(config, platform) {
var ckb = this.commmandKeyBinding; var ckb = this.commmandKeyBinding;
key.split("|").forEach(function(keyPart) { key.split("|").forEach(function(keyPart) {
var binding = parseKeys(keyPart, command); var binding = this.parseKeys(keyPart, command);
var hashId = binding.hashId; var hashId = binding.hashId;
(ckb[hashId] || (ckb[hashId] = {}))[binding.key] = command; (ckb[hashId] || (ckb[hashId] = {}))[binding.key] = command;
}); }, this);
}; };
this.addCommands = function(commands) { this.addCommands = function(commands) {
@ -127,7 +127,7 @@ function HashHandler(config, platform) {
this.bindKey(key, command); this.bindKey(key, command);
}; };
function parseKeys(keys, val) { this.parseKeys = function(keys, val) {
var key; var key;
var hashId = 0; var hashId = 0;
var parts = keys.toLowerCase().trim().split(/\s*\-\s*/); var parts = keys.toLowerCase().trim().split(/\s*\-\s*/);