keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
mad.engineer
Posts: 314
Joined: August 8th, 2006, 4:08 pm

Re: keyconfig 20080929

Post by mad.engineer »

On a different topic, looking at the install.rdf file in the Keyconfig extension shows that it only supports up to v3.0.3 of TB. I'm curious as to when this will get updated to support the upcoming TB 3.1 or anything after 3.0.3?. Thanks
mad.engineer
Posts: 314
Joined: August 8th, 2006, 4:08 pm

Re: keyconfig 20080929

Post by mad.engineer »

I'm trying to assign a key via Keyconfig to go to a specific folder as shown in: http://kb.mozillazine.org/Keyconfig_ext ... hunderbird

Go to a specific folder. Customize the first line to specify the folder URI.

const uri = "mailbox://someone@pop.example.com/Inbox"
with (document.getElementById("folderTree").view)
for (var i = 0; i < rowCount; ++i) with (getResourceAtIndex(i))
uri == Value? selection.select(i) :
uri.indexOf(Value) == 0 && !isContainerOpen(i)? toggleOpenState(i) : null


I replaced the const uri with the actual uri of one of my IMAP folders, assigned it a key, but when I press the key nothing happens?. Am I missing something here?. Thanks
mad.engineer
Posts: 314
Joined: August 8th, 2006, 4:08 pm

Re: keyconfig 20080929

Post by mad.engineer »

I just updated to TB 3.0.3 and it disabled the Keyconfig add-on. I checked the installed.rdf file and it shows that maxversion set to 3.0.3, so I'm not sure why TB disabled it saying that it is not compatible?. For the time being, I've added "extensions.checkCompatibility" in TB 3.0.3 via about:config and set it to false to temp bypass the version check so that I can continue using Keyconfig.

Anyone know when the new compatible version will become available?. This is the most important add-on for me. Thanks
mad.engineer
Posts: 314
Joined: August 8th, 2006, 4:08 pm

Re: keyconfig 20080929

Post by mad.engineer »

I'm using TB 3.0.3 and trying to setup a key via Keyconfig such that I can toggle between View->All Message and View->Custom-Last 5 Days. I found a similar code while searching this forum: viewtopic.php?f=48&t=72994&start=525

var viewFlags = gDBView ? gDBView.viewFlags : gCurViewFlags;

if(viewFlags & nsMsgViewFlagsType.kUnreadOnly)
goDoCommand('cmd_viewAllMsgs');
else
goDoCommand('cmd_viewUnreadMsgs');

I replaced viewUnreadMsgs above with ViewChangeByValue (9 for the first custom view, 10 for the next, and so on) as shown at: http://kb.mozillazine.org/Keyconfig_ext ... hunderbird and it does not work.

I replaced:
goDoCommand('cmd_viewUnreadMsgs'); with

goDoCommand('cmd_ViewChangeByValue(11)'); in the above code but it did not work. Obviously, I'm missing something here. dorando, can you please help out. Thanks
Giulioski
Posts: 30
Joined: March 3rd, 2007, 2:26 am

Re: keyconfig 20080929

Post by Giulioski »

Hi I too have installed 3.0.3 on al pc's and now it's disabled. Is there any update downloadable? thx
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20080929

Post by dorando »

Compatibility information has been updated, it might be necessary to click on Tools > Add-ons > Find Updates (which might incorrectly state at the top that "No updates were found" while "A compatibility update has been applied" as stated below the extension name) if the extensions didn't got re-enabled already.

Note that it is possible to disable the compatibility enforcing by adding a boolean 'extensions.checkCompatibility' through about:config.

mad.engineer wrote:On a different topic, looking at the install.rdf file in the Keyconfig extension shows that it only supports up to v3.0.3 of TB. I'm curious as to when this will get updated to support the upcoming TB 3.1 or anything after 3.0.3?. Thanks
Compatibility information is gathered from the updateURL, maxVersion in the install.rdf is mostly only useful if the updateURL can't be reached. BTW, the 3.0.3 is for Firefox, the 2.0.0.17 is Thunderbird.
mad.engineer wrote:I'm trying to assign a key via Keyconfig to go to a specific folder [...]
Try

Code: Select all

SelectFolder("mailbox://someone@pop.example.com/Inbox"); 
and

Code: Select all

alert(gDBView.msgFolder.URI); 
to get the URI.
mad.engineer wrote:I'm using TB 3.0.3 and trying to setup a key via Keyconfig such that I can toggle between View->All Message and View->Custom-Last 5 Days.
Try

Code: Select all

gFolderDisplay.view._mailViewIndex ? ViewChange(0) : ViewChange(11);  
mad.engineer wrote:I replaced:
goDoCommand('cmd_viewUnreadMsgs'); with

goDoCommand('cmd_ViewChangeByValue(11)'); in the above code but it did not work.
That should have been just ViewChangeByValue(11) without the goDoCommand('cmd_ and '); but that function seems to have been replaced by ViewChange in Thunderbird 3.
Giulioski
Posts: 30
Joined: March 3rd, 2007, 2:26 am

Re: keyconfig 20080929

Post by Giulioski »

ok, it's working with 3.0.3, however it would be better to change also the version number so that's more evident the update was done.
mad.engineer
Posts: 314
Joined: August 8th, 2006, 4:08 pm

Re: keyconfig 20080929

Post by mad.engineer »

Hi dorando. Thank you very much again for updating the Keyconfig to make it compatible with TB 3.0.3 and also for my other 2 requests above. Both are working fine now. Appreciate your help.
mad.engineer
Posts: 314
Joined: August 8th, 2006, 4:08 pm

Re: keyconfig 20080929

Post by mad.engineer »

Hi dorando, Regarding your suggestion related to:

SelectFolder("mailbox://someone@pop.example.com/Inbox");

I am wondering if there is any way to add to above, such that when you select the above specific folder using the Key, it would also shift the Focus to the corresponding message view area (right-hand side window)?. The reason for this request is because, with the above code, it simply jumps to the folder in question, but the focus stays on the folder itself. You still need to click on the message view window to highlight and select a message to open/read. By shifting the focus, it would save an extra step and directly highlight the first message in that folder and one could hit Enter to open/read it. Thank you again.
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20080929

Post by dorando »

Giulioski wrote:ok, it's working with 3.0.3, however it would be better to change also the version number so that's more evident the update was done.
The extension hasn't been updated...

mad.engineer wrote:I am wondering if there is any way to add to above, such that when you select the above specific folder using the Key, it would also shift the Focus to the corresponding message view area (right-hand side window)?.
Try adding

Code: Select all

GetThreadTree().focus();  
below the other code.
mad.engineer
Posts: 314
Joined: August 8th, 2006, 4:08 pm

Re: keyconfig 20080929

Post by mad.engineer »

Thank you dorando
mad.engineer
Posts: 314
Joined: August 8th, 2006, 4:08 pm

Re: keyconfig 20080929

Post by mad.engineer »

Hi dorando, Currently when I write a message using the Compose window in TB 3.0.3, I have to use the mouse to select between To:, Cc:, Bcc: fields from the pull-down menu (see screen shot here: http://img18.imageshack.us/img18/9095/screenshotfi.jpg). Is there any way via Keyconfig such that I can assign a key to toggle between these fields in the message compose window instead?. That way, I can either toggle or assign separate keys for each such that pressing one key would auto select To: from the menu, another key to select Cc: etc. Thanks
mad.engineer
Posts: 314
Joined: August 8th, 2006, 4:08 pm

Re: keyconfig 20080929

Post by mad.engineer »

Hi dorando, I've changed the keyboard shortcut key for the operation "Cut" from the default "Ctrl-X" to "Ctrl-K" in TB 3.0.3 Message Compose window. The command that I'm using for this function is: goDoCommand("cmd_cut")

The above is working OK so far, such that it works when I first highlight a word/sentence/character using the mouse and then press "Ctrl-K". This is the default behavior.

What I'm trying to figure out if there is any way to add the capability to the same function such that, if I do not highlight anything via the mouse, pressing "Ctrl-K" would Cut from the current position of the cursor to the end of the current line?. Do you of any code I can add to the Keyconfig to make this happen?. Thank you.
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20080929

Post by dorando »

mad.engineer wrote:Hi dorando, Currently when I write a message using the Compose window in TB 3.0.3, I have to use the mouse to select between To:, Cc:, Bcc: fields from the pull-down menu [...]. Is there any way via Keyconfig such that I can assign a key to toggle between these fields in the message compose window instead?. That way, I can either toggle or assign separate keys for each such that pressing one key would auto select To: from the menu, another key to select Cc: etc. Thanks
Try

Code: Select all

try {
 /addressCol2#([0-9]*)/.test(commandDispatcher.focusedElement.parentNode.parentNode.parentNode.id)
 var popup = awGetPopupElement(RegExp.$1);

 switch(popup.selectedIndex) {
  case awGetSelectItemIndex("addr_to"):
   popup.selectedIndex = awGetSelectItemIndex("addr_cc");
   break;
  case awGetSelectItemIndex("addr_cc"):
   popup.selectedIndex = awGetSelectItemIndex("addr_bcc");
   break;
  default:
   popup.selectedIndex = awGetSelectItemIndex("addr_to");
 }

}
 catch(err) { } 
mad.engineer wrote:Hi dorando, I've changed the keyboard shortcut key for the operation "Cut" from the default "Ctrl-X" to "Ctrl-K" in TB 3.0.3 Message Compose window. The command that I'm using for this function is: goDoCommand("cmd_cut")

The above is working OK so far, such that it works when I first highlight a word/sentence/character using the mouse and then press "Ctrl-K". This is the default behavior.

What I'm trying to figure out if there is any way to add the capability to the same function such that, if I do not highlight anything via the mouse, pressing "Ctrl-K" would Cut from the current position of the cursor to the end of the current line?. Do you of any code I can add to the Keyconfig to make this happen?. Thank you.
Try

Code: Select all

if(commandDispatcher.focusedWindow.getSelection().toString() == "" &&
   (!commandDispatcher.focusedElement || commandDispatcher.focusedElement.selectionStart == commandDispatcher.focusedElement.selectionEnd)) 
 goDoCommand
("cmd_selectEndLine");

goDoCommand("cmd_cut");  
mad.engineer
Posts: 314
Joined: August 8th, 2006, 4:08 pm

Re: keyconfig 20080929

Post by mad.engineer »

Hi dorando,

First thanks for taking time to answer the requests.

1) For the question related to "Ctrl-K"L
----------------------------------------------

if(commandDispatcher.focusedWindow.getSelection().toString() == "" &&
(!commandDispatcher.focusedElement || commandDispatcher.focusedElement.selectionStart == commandDispatcher.focusedElement.selectionEnd))
goDoCommand("cmd_selectEndLine");

goDoCommand("cmd_cut");

The above works great, but there is one thing that I found out missing that I would like your help with. Is there a way to add a code in the above such that pressing Ctrl-K would also Cut/Delete a blank line?. For example:

----
This is a 1st line

This is the 2nd line
----

In the above example, your code works great when the cursor is at any position on the above two lines. But if I move the cursor anywhere in the middle of the above two lines, which as you can see is a blank line, pressing Ctrl-K, will not do anything. What I'm hoping for is to have the ability to cut/delete the blank line (where ever the cursor may be on that blank line) as well, as mentioned in the above example, so that the 2nd line will automatically shift up and look like this instead:

This is a 1st test line
This is the 2nd test line



2) For the question related to toggle between Tc:, Cc:, Bcc: in the Message Write window:
----------------------------------------------------------------------------------------------------------

try {
/addressCol2#([0-9]*)/.test(commandDispatcher.focusedElement.parentNode.parentNode.parentNode.id)
var popup = awGetPopupElement(RegExp.$1);

switch(popup.selectedIndex) {
case awGetSelectItemIndex("addr_to"):
popup.selectedIndex = awGetSelectItemIndex("addr_cc");
break;
case awGetSelectItemIndex("addr_cc"):
popup.selectedIndex = awGetSelectItemIndex("addr_bcc");
break;
default:
popup.selectedIndex = awGetSelectItemIndex("addr_to");
}

} catch(err) { }

I created a new Key, pasted the above code as is in it. But when I open a new message write/compose window and press that assigned key, nothing happened. I noticed that, by default the window focus is in the address box field where you type the email address and not on the To:, Cc:, Bcc: pull-down menu box. Also, if your shift the window focus to the pull-down menu (To:, Cc:, Bcc:), then even if you use the Up/Down arrow key, it toggles between the entries (To:, Cc:, Bcc: etc). I think this may be the default behavior. But if I need to first shift the focus to the pull-down box, then I can also use the mouse to select from the list and this defeats the whole purpose of using a keyboard shortcut instead. Not sure, if this may be the cause of your code not working or else?. I also checked the Error Console, but did not see any related errors there either. Any suggestion that you can give would be great.

I appreciate your help. Thanks again.
Post Reply