add deprecation message for commmandKeyBinding

This commit is contained in:
nightwing 2013-09-25 23:26:18 +04:00
commit 04cc031da6
3 changed files with 40 additions and 5 deletions

View file

@ -19,11 +19,7 @@ var EventEmitter = require("../lib/event_emitter").EventEmitter;
**/
var CommandManager = function(platform, commands) {
this.platform = platform;
this.commands = this.byName = {};
this.commandKeyBinding = {};
this.addCommands(commands);
HashHandler.call(this, commands, platform);
this.setDefaultHandler("exec", function(e) {
return e.command.exec(e.editor, e.args || {});

View file

@ -38,6 +38,20 @@ function HashHandler(config, platform) {
this.platform = platform || (useragent.isMac ? "mac" : "win");
this.commands = {};
this.commandKeyBinding = {};
// todo remove this after a while
if (this.__defineGetter__ && this.__defineSetter__ && typeof console != "undefined" && console.error) {
this.__defineGetter__("commmandKeyBinding", function() {
console.error("commmandKeyBinding has too many m's. use commandKeyBinding")
return this.commandKeyBinding;
});
this.__defineSetter__("commmandKeyBinding", function(val) {
console.error("commmandKeyBinding has too many m's. use commandKeyBinding")
return this.commandKeyBinding = val;
});
} else {
this.commmandKeyBinding = commandKeyBinding;
}
this.addCommands(config);
};