From bea52c9574156cce6f2b2d9e210533fa198c8484 Mon Sep 17 00:00:00 2001 From: Martin Stubenschrott Date: Thu, 12 Jun 2008 00:55:47 +0000 Subject: [PATCH] some small code cleanup --- content/mail.js | 4 ++++ content/muttator.js | 54 ++++++++++++++++++++------------------------- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/content/mail.js b/content/mail.js index ea10199a..232cdfc8 100644 --- a/content/mail.js +++ b/content/mail.js @@ -247,6 +247,10 @@ liberator.Mail = function () //{{{ MsgOpenNewTabForMessage(); }); + /*liberator.mappings.add([liberator.modes.NORMAL], + ["o"], "Open a message", + function () { liberator.commandline.open(":", "open ", liberator.modes.EX); });*/ + liberator.mappings.add(modes, [""], "Scroll message or select next unread one", function () { return true; }, diff --git a/content/muttator.js b/content/muttator.js index f523b81e..aae209b5 100644 --- a/content/muttator.js +++ b/content/muttator.js @@ -95,36 +95,6 @@ liberator.config = { init: function () { - /*liberator.mappings.add([liberator.modes.NORMAL], - ["o"], "Open a message", - function () { liberator.commandline.open(":", "open ", liberator.modes.EX); });*/ - - // TODO: move elsewhere, probably compose.js - liberator.mappings.add([liberator.modes.COMPOSE], - ["e"], "Edit message", - function () { liberator.editor.editWithExternalEditor(); }); - - liberator.mappings.add([liberator.modes.COMPOSE], - ["y"], "Send message now", - function () { goDoCommand("cmd_sendNow"); }); - - liberator.mappings.add([liberator.modes.COMPOSE], - ["Y"], "Send message later", - function () { goDoCommand("cmd_sendLater"); }); - - // FIXME: does not really work reliably - liberator.mappings.add([liberator.modes.COMPOSE], - ["t"], "Select To: field", - function () { awSetFocus(0, awGetInputElement(1)); }); - - liberator.mappings.add([liberator.modes.COMPOSE], - ["s"], "Select Subject: field", - function () { GetMsgSubjectElement().focus(); }); - - liberator.mappings.add([liberator.modes.COMPOSE], - ["i"], "Select message body", - function () { SetMsgBodyFrameFocus(); }); - // don't wait too long when selecting new messages // GetThreadTree()._selectDelay = 300; // TODO: make configurable this.isComposeWindow = window.wintype == "msgcompose"; @@ -132,7 +102,31 @@ liberator.config = { // load Muttator specific modules if (this.isComposeWindow) { + // TODO: move mappings elsewhere, probably compose.js + liberator.mappings.add([liberator.modes.COMPOSE], + ["e"], "Edit message", + function () { liberator.editor.editWithExternalEditor(); }); + liberator.mappings.add([liberator.modes.COMPOSE], + ["y"], "Send message now", + function () { goDoCommand("cmd_sendNow"); }); + + liberator.mappings.add([liberator.modes.COMPOSE], + ["Y"], "Send message later", + function () { goDoCommand("cmd_sendLater"); }); + + // FIXME: does not really work reliably + liberator.mappings.add([liberator.modes.COMPOSE], + ["t"], "Select To: field", + function () { awSetFocus(0, awGetInputElement(1)); }); + + liberator.mappings.add([liberator.modes.COMPOSE], + ["s"], "Select Subject: field", + function () { GetMsgSubjectElement().focus(); }); + + liberator.mappings.add([liberator.modes.COMPOSE], + ["i"], "Select message body", + function () { SetMsgBodyFrameFocus(); }); } else {