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

began moving some mappings from mappings.js -> buffer.js; Also the constructors of Mail() and Buffer() accept an argument in which mode they should add the mapping

This commit is contained in:
Martin Stubenschrott
2008-02-14 15:00:05 +00:00
parent e652d53e5d
commit 3b461b18c2
5 changed files with 68 additions and 53 deletions

View File

@@ -26,12 +26,12 @@ the provisions above, a recipient may use your version of this file under
the terms of any one of the MPL, the GPL or the LGPL.
}}} ***** END LICENSE BLOCK *****/
vimperator.Mail = function ()
vimperator.Mail = function (validModes)
{
////////////////////////////////////////////////////////////////////////////////
////////////////////// PRIVATE SECTION /////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
var modes = validModes || [vimperator.modes.NORMAL];
/////////////////////////////////////////////////////////////////////////////}}}
////////////////////// OPTIONS /////////////////////////////////////////////////
@@ -48,20 +48,33 @@ vimperator.Mail = function ()
////////////////////// MAPPINGS ////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////{{{
vimperator.mappings.add([vimperator.modes.NORMAL], ["<Return>", "<Space>"],
vimperator.mappings.add(modes, ["<Return>", "i"],
"Focus message",
function () { content.focus(); }
);
function () { content.focus(); });
// FIXME:the following mappings do not yet work!
vimperator.mappings.add([vimperator.modes.NORMAL], ["r"],
"Reply to sender",
function () { goDoCommand("cmd_reply"); }
);
vimperator.mappings.add([vimperator.modes.NORMAL], ["d", "<Del>"],
vimperator.mappings.add(modes, ["d", "<Del>"],
"Move mail to Trash folder",
function () { goDoCommand("cmd_delete"); }
);
function () { goDoCommand("cmd_delete"); });
vimperator.mappings.add(modes, ["j", "<Right>"],
"Select next message",
function () { goDoCommand("cmd_nextMsg"); });
vimperator.mappings.add(modes, ["J", "<Tab>"],
"Select next unread message",
function () { goDoCommand("cmd_nextUnreadMsg"); });
vimperator.mappings.add(modes, ["k", "<Left>"],
"Select previous message",
function () { goDoCommand("cmd_previousMsg"); });
vimperator.mappings.add(modes, ["K"],
"Select previous unread message",
function () { goDoCommand("cmd_previousUnreadMsg"); });
vimperator.mappings.add(modes, ["r"],
"Reply to sender",
function () { goDoCommand("cmd_reply"); });
/////////////////////////////////////////////////////////////////////////////}}}
////////////////////// PUBLIC SECTION //////////////////////////////////////////