1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-01-05 06:04:13 +01:00

First work towards cleaning up the commandline.js rat's nest. Don't expect any of these new interfaces to stay remotely as they are.

--HG--
branch : key-processing
This commit is contained in:
Kris Maglione
2011-01-26 01:24:54 -05:00
parent a66864d077
commit c284e1ced8
18 changed files with 829 additions and 790 deletions

View File

@@ -61,6 +61,27 @@ var IO = Module("io", {
services.downloadManager.addListener(this.downloadListener);
},
CommandFileMode: Class("CommandFileMode", modules.CommandMode, {
init: function init(prompt, params) {
init.supercall(this);
this.prompt = isArray(prompt) ? prompt : ["Question", prompt];
update(this, params);
},
historyKey: "file",
get mode() modules.modes.FILE_INPUT,
complete: function (context) {
if (this.completer)
this.completer(context);
context = context.fork("files", 0);
modules.completion.file(context);
context.filters = context.filters.concat(this.filters || []);
}
}),
destroy: function destroy() {
services.downloadManager.removeListener(this.downloadListener);
for (let [, plugin] in Iterator(plugins.contexts))
@@ -1002,6 +1023,16 @@ unlet s:cpo_save
}]);
},
modes: function (dactyl, modules, window) {
const { commandline, modes } = modules;
modes.addMode("FILE_INPUT", {
extended: true,
description: "Active when selecting a file",
bases: [modes.COMMAND_LINE],
input: true
});
},
options: function (dactyl, modules, window) {
const { options } = modules;