1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-22 05:25:46 +01:00

Make Melodactyl minimally functional. Closes issue #340.

--HG--
rename : pentadactyl/chrome.manifest => common/chrome.manifest
This commit is contained in:
Kris Maglione
2011-02-22 10:01:56 -05:00
parent d92f3f2c9c
commit 8299257422
13 changed files with 259 additions and 338 deletions

View File

@@ -440,10 +440,36 @@ const Player = Module("player", {
}
}, {
}, {
modes: function initModes(dactyl, modules, window) {
modes.addMode("SEARCH_VIEW", {
description: "Search View mode",
bases: [modes.COMMAND_LINE],
});
modes.addMode("SEARCH_VIEW_FORWARD", {
description: "Forward Search View mode",
bases: [modes.SEARCH_VIEW]
});
modes.addMode("SEARCH_VIEW_BACKWARD", {
description: "Backward Search View mode",
bases: [modes.SEARCH_VIEW]
});
},
commandline: function () {
commandline.registerCallback("change", modes.SEARCH_VIEW_FORWARD, this.closure.onSearchKeyPress);
commandline.registerCallback("submit", modes.SEARCH_VIEW_FORWARD, this.closure.onSearchSubmit);
commandline.registerCallback("cancel", modes.SEARCH_VIEW_FORWARD, this.closure.onSearchCancel);
player.CommandMode = Class("CommandSearchViewMode", modules.CommandMode, {
init: function init(mode) {
this.mode = mode;
init.supercall(this);
},
historyKey: "search-view",
get prompt() this.mode === modules.modes.SEARCH_VIEW_BACKWARD ? "?" : "/",
get onCancel() player.closure.onSearchCancel,
get onChange() player.closure.onSearchKeyPress,
get onSubmit() player.closure.onSearchSubmit
});
},
commands: function () {
commands.add(["f[ilter]"],
@@ -754,7 +780,7 @@ const Player = Module("player", {
mappings.add([modes.PLAYER],
["/"], "Search forward for a track",
function () { commandline.open("/", "", modes.SEARCH_VIEW_FORWARD); });
function () { player.CommandMode(modes.SEARCH_VIEW_FORWARD).open(); });
mappings.add([modes.PLAYER],
["n"], "Find the next track",