summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorportix <none@none>2012-08-21 18:55:42 +0200
committerportix <none@none>2012-08-21 18:55:42 +0200
commit16e15d7a2b71410520643dd83e6f8733a23a13a5 (patch)
treec3a803ebdf37541882e5eaeff2d559c5b4d558bb /scripts
parent99a66bed6491a00be08bbb261957408e49f6cf6c (diff)
downloaddwb-16e15d7a2b71410520643dd83e6f8733a23a13a5.zip
Implementing extensions.bind; fixing failing unbind when called with function-argument; jsapi-documentation
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/extensions.js14
1 files changed, 14 insertions, 0 deletions
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);
+ }
}
});
})();