From 2e857ecbd9cf509d04c72d775c1adc1b1ed119ed Mon Sep 17 00:00:00 2001 From: Martin Stubenschrott Date: Tue, 29 Apr 2008 20:19:39 +0000 Subject: [PATCH] new folder navigation commands gi (go inbox), ctrl-n and ctrl-p --- content/mail.js | 57 +++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 53 insertions(+), 4 deletions(-) diff --git a/content/mail.js b/content/mail.js index c8d823a5..e29d5017 100644 --- a/content/mail.js +++ b/content/mail.js @@ -186,6 +186,54 @@ liberator.Mail = function () { flags: liberator.Mappings.flags.COUNT }); + + // FOLDER SWITCHING + liberator.mappings.add(modes, ["gi"], + "Go to inbox", + function (count) + { + var folder = liberator.mail.getFolders("Inbox", false, true)[(count > 0) ? (count - 1) : 0]; + if (folder) + SelectFolder(folder.URI); + else + liberator.beep(); + }, + { flags: liberator.Mappings.flags.COUNT }); + + liberator.mappings.add(modes, [""], + "Select next folder", + function (count) + { + count = (count > 0 ) ? count : 1; + var tree = GetFolderTree(); + var c = tree.currentIndex; + if (c + count >= tree.view.rowCount) + { + liberator.beep(); + return; + } + tree.view.selection.timedSelect(c + count, tree._selectDelay ); + }, + { flags: liberator.Mappings.flags.COUNT }); + + liberator.mappings.add(modes, [""], + "Select previous folder", + function (count) + { + count = (count > 0 ) ? count : 1; + var tree = GetFolderTree(); + var c = tree.currentIndex; + if (c - count < 0) + { + liberator.beep(); + return; + } + tree.view.selection.timedSelect(c - count, tree._selectDelay ); + }, + { flags: liberator.Mappings.flags.COUNT }); + + + // THREADING liberator.mappings.add(modes, ["za"], "Toggle thread collapsed/expanded", function () { if (!liberator.mail.expandThread()) liberator.mail.collapseThread(); }); @@ -208,25 +256,26 @@ liberator.Mail = function () liberator.mappings.add(modes, [""], - "Get new messages", + "Go forward", function (count) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.forward, true); }, { flags: liberator.Mappings.flags.COUNT }); liberator.mappings.add(modes, [""], - "Get new messages", + "Go back", function (count) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.back, true); }, { flags: liberator.Mappings.flags.COUNT }); liberator.mappings.add(modes, ["gg"], - "Get new messages", + "Select first message", function (count) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.firstMessage, true); }, { flags: liberator.Mappings.flags.COUNT }); liberator.mappings.add(modes, ["G"], - "Get new messages", + "Select last message", function (count) { if (count < 1) count = 1; while (count--) GoNextMessage(nsMsgNavigationType.lastMessage, false); }, { flags: liberator.Mappings.flags.COUNT }); + // tagging messages liberator.mappings.add(modes, ["tr"], "Toggle selected messages read",