From 16e15d7a2b71410520643dd83e6f8733a23a13a5 Mon Sep 17 00:00:00 2001 From: portix Date: Tue, 21 Aug 2012 18:55:42 +0200 Subject: Implementing extensions.bind; fixing failing unbind when called with function-argument; jsapi-documentation --- scripts/lib/extensions.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'scripts') diff --git a/scripts/lib/extensions.js b/scripts/lib/extensions.js index 499d3332..1fb8b496 100644 --- a/scripts/lib/extensions.js +++ b/scripts/lib/extensions.js @@ -184,6 +184,20 @@ return true; } } + }, + "bind" : { + value : function(name, shortcut, options) { + if (!name || !shortcut) + return; + if (options.load === undefined || options.load) + extensions.load(name, options.config); + bind(shortcut, function () { + if (extensions.toggle(name, options.config)) + io.notify("Extension " + name + " enabled"); + else + io.notify("Extension " + name + " disabled"); + }, options.command); + } } }); })(); -- cgit v1.2.3