1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 06:38:12 +01:00

[muttator] allow external editor with ctrl-i when composing messages. Also a framework for more compose window related mappings (like y to send message)

This commit is contained in:
Martin Stubenschrott
2008-05-14 12:21:05 +00:00
parent f6474bb6ea
commit 64b0e3b8e1
14 changed files with 338 additions and 88 deletions

View File

@@ -36,8 +36,13 @@ liberator.config = {
guioptions: { m: ["mail-toolbar-menubar2"], T: ["mail-bar2"], f: ["folderPaneBox", "folderpane_splitter"], F: ["folderPaneHeader"] },
get browserModes() { return [liberator.modes.MESSAGE]; },
get mainWidget() { return GetThreadTree(); }, // focusContent() focuses this widget
mainWindowID: "messengerWindow", // used for :set titlestring
get mainWidget() { // focusContent() focuses this widget
return this.isComposeWindow ?
document.getElementById("content-frame") :
GetThreadTree();
},
get mainWindowID() { return this.isComposeWindow ? "msgcomposeWindow" : "messengerWindow"; },
isComposeWindow: false,
dialogs: [
/*["about", "About Firefox",
@@ -88,8 +93,33 @@ liberator.config = {
["o"], "Open a message",
function () { liberator.commandline.open(":", "open ", liberator.modes.EX); });
liberator.mappings.add([liberator.modes.COMPOSE],
["e"], "Edit message",
function () { liberator.editor.editWithExternalEditor(); });
// don't wait too long when selecting new messages
GetThreadTree()._selectDelay = 300; // TODO: make configurable
// GetThreadTree()._selectDelay = 300; // TODO: make configurable
this.isComposeWindow = window.wintype == "msgcompose";
if (this.isComposeWindow)
{
/*setTimeout(function() {
document.getElementById("content-frame").contentDocument.designMode = "off";
document.getElementById("content-frame").focus();
}, 500);*/
//document.getElementById("content-frame").contentWindow.addEventListener("load", function() {
/*window.addEventListener("load", function() {
alert("load");
if (! liberator.editor.editWithExternalEditor())
liberator.echoerr("Editing with external editor failed. Be sure to :set editor correctly");
}, true);
document.getElementById("content-frame").contentDocument.addEventListener("load", function() {
alert("load1");
}, true);*/
/*document.getElementById("content-frame").addEventListener("DOMContentLoaded", function() {
alert("load2");
}, true);*/
}
}
}