1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-04 07:14:10 +01:00

Add some standard JS function completers for the liberator API

This commit is contained in:
Kris Maglione
2008-11-12 23:55:34 +00:00
parent 5221fb41be
commit d7076c5aa5
6 changed files with 66 additions and 35 deletions

View File

@@ -258,6 +258,23 @@ function Mappings() //{{{
////////////////////// PUBLIC SECTION //////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
liberator.registerObserver("load_completion", function ()
{
completion.setFunctionCompleter(mappings.get,
[
null,
function (obj, filter, args)
{
let mode = this.eval(args[0]);
return util.Array.flatten(
[
[[name, map.description] for ([i, name] in Iterator(map.names))]
for ([i, map] in Iterator(user[mode].concat(main[mode])))
])
}
]);
});
// FIXME:
Mappings.flags = {
ALLOW_EVENT_ROUTING: 1 << 0, // if set, return true inside the map command to pass the event further to firefox