From 7d180d25e435035ded83698575ee0d28daecaa6f Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Thu, 24 Feb 2011 15:04:37 -0500 Subject: [PATCH] [tele] Fix some broken indentation. Fix commandline.open references. Remove useless try-catch blocks. --- teledactyl/content/addressbook.js | 2 +- teledactyl/content/mail.js | 35 +++++++++---------------------- 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/teledactyl/content/addressbook.js b/teledactyl/content/addressbook.js index e89ad05e..2a7dd1e5 100644 --- a/teledactyl/content/addressbook.js +++ b/teledactyl/content/addressbook.js @@ -144,7 +144,7 @@ const Addressbook = Module("addressbook", { else displayName = "-name=\"" + displayName.replace(/"/g, "") + "\""; - commandline.open(":", "contact " + address + " " + displayName, modes.EX); + CommandExMode().open("contact " + address + " " + displayName); }); }, services: function initServices(dactyl, modules, window) { diff --git a/teledactyl/content/mail.js b/teledactyl/content/mail.js index e53b5cf5..99d93e31 100644 --- a/teledactyl/content/mail.js +++ b/teledactyl/content/mail.js @@ -506,10 +506,6 @@ const Mail = Module("mail", { MsgOpenNewTabForMessage(); }); - /*mappings.add([modes.NORMAL], - ["o"], "Open a message", - function () { commandline.open(":", "open ", modes.EX); });*/ - mappings.add(myModes, [""], "Scroll message or select next unread one", function () Events.PASS); @@ -555,40 +551,29 @@ const Mail = Module("mail", { mappings.add(myModes, ["*"], "Select next message from the same sender", function (args) { - try { - let author = gDBView.hdrForFirstSelectedMessage.mime2DecodedAuthor.toLowerCase(); - mail.selectMessage(function (msg) msg.mime2DecodedAuthor.toLowerCase().indexOf(author) == 0, true, true, false, args.count); - } - catch (e) { dactyl.beep(); } + let author = gDBView.hdrForFirstSelectedMessage.mime2DecodedAuthor.toLowerCase(); + mail.selectMessage(function (msg) msg.mime2DecodedAuthor.toLowerCase().indexOf(author) == 0, true, true, false, args.count); }, { count: true }); mappings.add(myModes, ["#"], "Select previous message from the same sender", function (args) { - try { - let author = gDBView.hdrForFirstSelectedMessage.mime2DecodedAuthor.toLowerCase(); - mail.selectMessage(function (msg) msg.mime2DecodedAuthor.toLowerCase().indexOf(author) == 0, true, true, true, args.count); - } - catch (e) { dactyl.beep(); } + let author = gDBView.hdrForFirstSelectedMessage.mime2DecodedAuthor.toLowerCase(); + mail.selectMessage(function (msg) msg.mime2DecodedAuthor.toLowerCase().indexOf(author) == 0, true, true, true, args.count); }, { count: true }); // SENDING MESSAGES mappings.add(myModes, ["m"], "Compose a new message", - function () { commandline.open(":", "mail -subject=", modes.EX); }); + function () { CommandExMode().open("mail -subject="); }); mappings.add(myModes, ["M"], "Compose a new message to the sender of selected mail", function () { - try { - let to = mail._escapeRecipient(gDBView.hdrForFirstSelectedMessage.mime2DecodedAuthor); - commandline.open(":", "mail " + to + " -subject=", modes.EX); - } - catch (e) { - dactyl.beep(); - } + let to = mail._escapeRecipient(gDBView.hdrForFirstSelectedMessage.mime2DecodedAuthor); + CommandExMode().open("mail " + to + " -subject="); }); mappings.add(myModes, ["r"], @@ -658,15 +643,15 @@ const Mail = Module("mail", { // MOVING MAIL mappings.add(myModes, ["c"], "Change folders", - function () { commandline.open(":", "goto ", modes.EX); }); + function () { CommandExMode().open("goto "); }); mappings.add(myModes, ["s"], "Move selected messages", - function () { commandline.open(":", "moveto ", modes.EX); }); + function () { CommandExMode().open("moveto "); }); mappings.add(myModes, ["S"], "Copy selected messages", - function () { commandline.open(":", "copyto ", modes.EX); }); + function () { CommandExMode().open("copyto "); }); mappings.add(myModes, [""], "Archive message",