keyconfig 20110522
- Qwerky
- Posts: 122
- Joined: March 5th, 2005, 10:33 pm
- Location: Adanac
Re: keyconfig 20110522
@morat
For the Maximize Message Pane extension, I have no buttons on the toolbar at all (which is what I desire; I wish to operate by shortcut only). I think the buttons are configurable in the extension.
I should add that there is a button in the message header, but not in the main window toolbar.
Yes, the extension ID is the same.
For the Maximize Message Pane extension, I have no buttons on the toolbar at all (which is what I desire; I wish to operate by shortcut only). I think the buttons are configurable in the extension.
I should add that there is a button in the message header, but not in the main window toolbar.
Yes, the extension ID is the same.
Last edited by Qwerky on April 1st, 2022, 4:52 pm, edited 2 times in total.
Mr. Qwerky
- Qwerky
- Posts: 122
- Joined: March 5th, 2005, 10:33 pm
- Location: Adanac
Re: keyconfig 20110522
Perhaps I should uninstall and reinstall the add-on, since it was automatically updated when TB updated?
Mr. Qwerky
- Qwerky
- Posts: 122
- Joined: March 5th, 2005, 10:33 pm
- Location: Adanac
Re: keyconfig 20110522
@morat
I went back and again tried your first code for page up:
and it now appears to be working, so apologies, as I don't know why it didn't when I first tested it. Based on that, I made similar changes in the page down code, and that works as well!
There is a slight issue with the page up code, in that if the current thread selection is at the bottom of the thread pane, then it works correctly; but if the current thread selection is higher (eg. two messages up from the bottom of the thread pane), then the page up code causes the thread pane selection to move to the message which is two messages above the current top of the thread pane, i.e. the code always causes the thread pane selection to move up exactly the number of rows currently visible, rather than just to the top currently visible row. I suspect that this issue was there in TB 60 with the original code as well. There does not appear to be a similar issue with the page down code. This is a very minor issue which I can live with.
Now I will see if I can follow your example to convert those other codes.
Hurray! These codes are now working as well.
I went back and again tried your first code for page up:
Code: Select all
(function () {
var threadTree = window.GetThreadTree();
var threadTreeObj = threadTree;
var pageCount = threadTreeObj.getPageLength() - 1;
var currentMsgIndex = threadTreeObj.view.selection.currentIndex;
var newCount;
if ((currentMsgIndex - pageCount) < 0) {
newCount = 0;
} else {
newCount = currentMsgIndex - pageCount;
}
threadTreeObj.ensureRowIsVisible(newCount);
threadTreeObj.view.selection.select(newCount);
})();
There is a slight issue with the page up code, in that if the current thread selection is at the bottom of the thread pane, then it works correctly; but if the current thread selection is higher (eg. two messages up from the bottom of the thread pane), then the page up code causes the thread pane selection to move to the message which is two messages above the current top of the thread pane, i.e. the code always causes the thread pane selection to move up exactly the number of rows currently visible, rather than just to the top currently visible row. I suspect that this issue was there in TB 60 with the original code as well. There does not appear to be a similar issue with the page down code. This is a very minor issue which I can live with.
Now I will see if I can follow your example to convert those other codes.
Hurray! These codes are now working as well.
Mr. Qwerky
- Qwerky
- Posts: 122
- Joined: March 5th, 2005, 10:33 pm
- Location: Adanac
Re: keyconfig 20110522
New issue: the ViewChange() function no longer functions for me as it did previously. Has this function been changed? Does it require different parameters?
Mr. Qwerky
-
- Posts: 6426
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
Here is my move thread pane selection code snippets.
tbkeys issue 66 comment
http://github.com/wshanks/tbkeys/issues ... -778853006
...
The ViewChange function works for me.
* toggle mail views between all and unread
Reference
http://searchfox.org/comm-esr91/search? ... ViewChange
...
Maximize Message Pane is an experiment_apis addon. The toggle command is in the browser.js file in the .xpi archive.
I don't think it's possible to call the toggle command directly. The following code snippets don't work.
I can access the MailExtensions world from chrome, but I don't think that helps here
tbkeys issue 46
http://github.com/wshanks/tbkeys/issues/46
tbkeys issue 66 comment
http://github.com/wshanks/tbkeys/issues ... -778853006
...
The ViewChange function works for me.
* toggle mail views between all and unread
Code: Select all
(function () {
if (window.document.getElementById("viewPicker").label == "Unread") {
window.ViewChange(0);
} else {
window.ViewChange(1);
}
})();
http://searchfox.org/comm-esr91/search? ... ViewChange
...
Maximize Message Pane is an experiment_apis addon. The toggle command is in the browser.js file in the .xpi archive.
I don't think it's possible to call the toggle command directly. The following code snippets don't work.
Code: Select all
window.goDoCommand('cmd_max-msg-pane');
Code: Select all
window.doMMPCommand("cmd_max-msg-pane");
tbkeys issue 46
http://github.com/wshanks/tbkeys/issues/46
Last edited by morat on April 5th, 2022, 7:22 am, edited 1 time in total.
- Qwerky
- Posts: 122
- Joined: March 5th, 2005, 10:33 pm
- Location: Adanac
Re: keyconfig 20110522
The ViewChange() function works for me in the Error Console, but when called from tbkeys using a line like:
the error is: "Uncaught ReferenceError: ViewChange is not defined", and it lists the tbkeys extension.
Even though Maximize Message Pane was showing the latest version (having been update when Thunderbird was updated), I uninstalled and reinstalled it, and restarted TB. I still have no button in the main toolbar--do you? The only associated button is in the Message Header Pane.
Now, however, your sample code to "push the button" does work for me! I added it to tbkeys "shift-z" and it works. There is a slight issue: when the message pane is displayed, and the button is visible, the "push the button" code works properly, both in the error console, and from the shortcut. But when the message pane is collapsed, and the button not visible, using the shortcut or running the code in the error console, either way, the operation is correct but the error console lists several "Cookie" messages. Since this is one of my very frequently used functions, this will generate a huge amount of error console text--will this be a problem?
Code: Select all
"a": "ViewChange(0)",
Even though Maximize Message Pane was showing the latest version (having been update when Thunderbird was updated), I uninstalled and reinstalled it, and restarted TB. I still have no button in the main toolbar--do you? The only associated button is in the Message Header Pane.
Now, however, your sample code to "push the button" does work for me! I added it to tbkeys "shift-z" and it works. There is a slight issue: when the message pane is displayed, and the button is visible, the "push the button" code works properly, both in the error console, and from the shortcut. But when the message pane is collapsed, and the button not visible, using the shortcut or running the code in the error console, either way, the operation is correct but the error console lists several "Cookie" messages. Since this is one of my very frequently used functions, this will generate a huge amount of error console text--will this be a problem?
Mr. Qwerky
-
- Posts: 6426
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
Remember to include the window object in custom commands.
WRONG:
CORRECT:
tbkeys info: http://forums.mozillazine.org/viewtopic ... #p14872763
WRONG:
Code: Select all
"a": "ViewChange(0)",
Code: Select all
"a": "window.ViewChange(0)",
- Qwerky
- Posts: 122
- Joined: March 5th, 2005, 10:33 pm
- Location: Adanac
Re: keyconfig 20110522
Thank you. All ViewChange() shortcuts now working.morat wrote:Remember to include the window object in custom commands.
Mr. Qwerky
-
- Posts: 6426
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
I get a button on the mail toolbar, right of the hamburger button.
Ignore those errors. That's a common error when reloading the message content.
Ignore those errors. That's a common error when reloading the message content.
- Qwerky
- Posts: 122
- Joined: March 5th, 2005, 10:33 pm
- Location: Adanac
Re: keyconfig 20110522
Strange, I get no button there at all. That suits me, as I really don't want extra buttons on the toolbar, as long as your code continues to work for me (which it does so far)... I presume it is pushing the button on the message header pane, rather than the invisible button on the toolbar.morat wrote:I get a button on the mail toolbar, right of the hamburger button.
Got it. Thanks.Ignore those errors. That's a common error when reloading the message content.
Mr. Qwerky
- Qwerky
- Posts: 122
- Joined: March 5th, 2005, 10:33 pm
- Location: Adanac
Re: keyconfig 20110522
The problem is that it will not allow one to set an alphabetic key as shortcut, without including either Control or Alt. That is an issue with Thunderbird, which I wish they would address.morat wrote:I can change the "Maximize message pane" shortcut in the Addons Manager tab.
i.e. Tools > Addons and Themes > Extensions > Cogwheel > Manage Extension Shortcuts
Manage addons keyboard shortcuts
http://www.ghacks.net/2019/01/16/manage ... outaddons/
Previous versions of Maximize Message Pane had an options window where the user could select the desired shortcut. I don't know if it's possible for the new MailExtensions to do that. If so, I could ask the add-on developer if he would consider reinstating that ability.
Meanwhile, your workaround:
Is working well. But there is an issue that it would be nice to overcome: When the thread pane is maximized/message pane minimized (standard Thunderbird function) and the focus is in the thread pane, and then this workaround is issued to maximize the message pane, the focus is left in the thread pane, so that moving up or down moves to a different message, rather than scrolling the contents of the current maximized message up or down.Here is how to click a browser action button using the extension id.
Maximize Message Pane extension id: {CC1FC7EB-79F7-4A28-B12C-731304F16E53}
Code: Select all
(function () { function getWidgetId(id) { id = id.toLowerCase(); id = id.replace(/[^a-z0-9_-]/g, '_'); return id + '-browserAction-toolbarbutton'; } var extensionId = '{CC1FC7EB-79F7-4A28-B12C-731304F16E53}'; var widgetId = getWidgetId(extensionId); var button = window.document.getElementById(widgetId); button.click(); })();
With the previous version of Maximize Message Pane, when the message pane is maximized via the shortcut, the focus is automatically switched to the message pane (by the add-on, I presume), and then restored to the thread pane when it is toggled back. I believe the current version of Maximize Message Pane also does this when toggled via the shortcut.
Is it possible to detect which pane currently has the focus, and which state the message pane splitter is in, so that the focus can be set appropriately when your code above is used to 'push the button'?
In Thunderbird 60 and earlier, it was possible to call functions within an extension, as I used this technique to call a function in Identity Chooser from a shortcut. I suppose that this is no longer possible with the new MailExtensions?I don't think it's possible to call the toggle command directly.
Mr. Qwerky
-
- Posts: 6426
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
I get a button on the mail toolbar, right of the hamburger button. And I get a button on the header view toolbar, right of the more button.
Here is how to click the button on the header view toolbar and set the focus on the thread pane after a delay.
Here is how to click the button on the header view toolbar and set the focus on the thread pane after a delay.
Code: Select all
(function () {
function getWidgetId(id) {
id = id.toLowerCase();
id = id.replace(/[^a-z0-9_-]/g, '_');
return id + '-messageDisplayAction-toolbarbutton';
}
var extensionId = '{CC1FC7EB-79F7-4A28-B12C-731304F16E53}';
var widgetId = getWidgetId(extensionId);
var button = window.document.getElementById(widgetId);
button.click();
window.setTimeout(function () {
var focusedElement = window.gFolderDisplay.focusedPane;
if (focusedElement == window.GetMessagePane()) {
window.SetFocusThreadPane();
}
}, 1000);
})();
- Qwerky
- Posts: 122
- Joined: March 5th, 2005, 10:33 pm
- Location: Adanac
Re: keyconfig 20110522
@morat
Thank you! I added an else clause to focus the message pane when it is maximized:
Works great.
Thank you! I added an else clause to focus the message pane when it is maximized:
Code: Select all
(function () {
function getWidgetId(id) {
id = id.toLowerCase();
id = id.replace(/[^a-z0-9_-]/g, '_');
return id + '-browserAction-toolbarbutton';
}
var extensionId = '{CC1FC7EB-79F7-4A28-B12C-731304F16E53}';
var widgetId = getWidgetId(extensionId);
var button = window.document.getElementById(widgetId);
button.click();
window.setTimeout(function () {
var focusedElement = window.gFolderDisplay.focusedPane;
if (focusedElement == window.GetMessagePane()) {
window.SetFocusThreadPane();
} else {
window.SetFocusMessagePane();
}
}, 100);
})();
Mr. Qwerky
- Qwerky
- Posts: 122
- Joined: March 5th, 2005, 10:33 pm
- Location: Adanac
Re: keyconfig 20110522
In previous versions of TB, the following code would allow a shortcut to directly pull down the Tag button in the toolbar:
This no longer works; the error is "showPopup() is not a function". What would be the current code to accomplish this?
Code: Select all
document.getElementById("button-tag").firstChild.showPopup();
Mr. Qwerky
-
- Posts: 6426
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
Try this:
openPopup
http://udn.realityripple.com/docs/Archi ... /openPopup
http://udn.realityripple.com/docs/Archi ... ositioning
Code: Select all
(function () {
var button = window.document.getElementById("button-tag");
var popup = window.document.getElementById("button-tagpopup");
popup.openPopup(button, "after_start", 0, 0, false, false);
})();
http://udn.realityripple.com/docs/Archi ... /openPopup
http://udn.realityripple.com/docs/Archi ... ositioning
Last edited by morat on April 9th, 2022, 6:53 am, edited 1 time in total.