keyconfig 20110522
-
- Posts: 1086
- Joined: November 8th, 2011, 12:06 pm
Re: keyconfig 20110522
hello
I want when I click left and right arrow to activate the left or right accordingly tab
how can I do that?
but I don't want to do that when I have focused some text and I want to move to the right or left character
thanks!
I want when I click left and right arrow to activate the left or right accordingly tab
how can I do that?
but I don't want to do that when I have focused some text and I want to move to the right or left character
thanks!
-
- Posts: 92
- Joined: August 17th, 2014, 5:57 am
Re: keyconfig 20110522
Hi, I'm using this codeto add the selected text to clipboard.
Is there any way to have it work even when selecting something in a textfield?
Thanx.
Code: Select all
var selection = document.commandDispatcher.focusedWindow.getSelection().toString();
if (!selection)
{ return; }
var str = readFromClipboard();
if (str)
{ selection = str + " " + selection; }
var clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"].getService(Ci.nsIClipboardHelper);
clipboard.copyString(selection);
Is there any way to have it work even when selecting something in a textfield?
Thanx.
-
- Posts: 6421
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
@firefoxuse
Try these:
* Shortcut: Right Arrow
* Shortcut: Left Arrow
@t3l0zvxqIiXuzuH0
Try this:
Try these:
* Shortcut: Right Arrow
Code: Select all
gBrowser.tabContainer.advanceSelectedTab(1, true);
* Shortcut: Left Arrow
Code: Select all
gBrowser.tabContainer.advanceSelectedTab(-1, true);
@t3l0zvxqIiXuzuH0
Try this:
Code: Select all
var selection = getBrowserSelection();
if (!selection) return;
var str = readFromClipboard();
if (str) selection = str + " " + selection;
var clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"].
getService(Ci.nsIClipboardHelper);
clipboard.copyString(selection);
-
- Posts: 92
- Joined: August 17th, 2014, 5:57 am
Re: keyconfig 20110522
morat wrote:@t3l0zvxqIiXuzuH0
Try this:Code: Select all
var selection = getBrowserSelection();
if (!selection) return;
var str = readFromClipboard();
if (str) selection = str + " " + selection;
var clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"].
getService(Ci.nsIClipboardHelper);
clipboard.copyString(selection);
Perfect. Thanks.
-
- Posts: 1086
- Joined: November 8th, 2011, 12:06 pm
Re: keyconfig 20110522
morat wrote:@firefoxuse
Try these:
* Shortcut: Right ArrowCode: Select all
gBrowser.tabContainer.advanceSelectedTab(1, true);
* Shortcut: Left ArrowCode: Select all
gBrowser.tabContainer.advanceSelectedTab(-1, true);
thanks, but after I entered them into configuration, they appeared DISABLED !
any hint?
-
- Posts: 9
- Joined: May 29th, 2014, 12:43 am
Re: keyconfig 20110522
ventainais wrote:Hmm, has the reply a References header (View > Message Source) or any other header identifying the main message? Also try removingventainais wrote:Thank you for the reply, but the code wont copy anything, just the message appears "No reply found", but there is a reply.Code: Select all
if(!folder.canFileMessages)
continue;
Alternatively try (just comparing the subject):Code: Select all
var messageId = gFolderDisplay.selectedMessage.messageId;
var messageSubject = gFolderDisplay.selectedMessage.mime2DecodedSubject;
var replyMessage = null;
var allFolders = MailServices.accounts.allFolders.enumerate();
var folders = [];
while(allFolders.hasMoreElements()) {
var folder = allFolders.getNext().QueryInterface(Components.interfaces.nsIMsgFolder);
if(!folder.canFileMessages)
continue;
var messages = folder.messages;
while(messages.hasMoreElements()) {
var message = messages.getNext().QueryInterface(Components.interfaces.nsIMsgDBHdr);
if(message.mime2DecodedSubject == messageSubject)
if(!replyMessage || message.date > replyMessage.date)
replyMessage = message;
}
}
if(replyMessage && replyMessage.messageId != messageId) {
MsgHdrToMimeMessage(replyMessage, null, function (aMsgHdr, aMimeMessage) {
Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper)
.copyString([
(aMsgHdr.flags & Components.interfaces.nsMsgMessageFlags.HasRe ? "Re: " : "") + aMsgHdr.mime2DecodedSubject,
new Date(aMsgHdr.dateInSeconds * 1000),
aMsgHdr.mime2DecodedAuthor,
aMsgHdr.mime2DecodedRecipients,
"",
aMimeMessage.coerceBodyToPlaintext(gFolderDisplay.displayedFolder).replace(/^\s+/,"").replace(/\s+$/g,"").replace(/\n/g,"\r\n")
].join("\r\n"));
alert("Reply copied");
}, true);
} else {
alert("No reply found");
}
I am using IMAP server and I don't know where to find the References header in the source
There is a Message-ID: <1482295362.93038.1403161307842.JavaMail.zimbra@test.eu>
Removing the one code line wont help.
The alternative gives the same error.
The solution was to remove ! from if(!replyMessage || message.date > replyMessage.date)
replyMessage = message;
-
- Posts: 9
- Joined: May 29th, 2014, 12:43 am
Re: keyconfig 20110522
ventainais wrote:ventainais wrote:Hmm, has the reply a References header (View > Message Source) or any other header identifying the main message? Also try removingventainais wrote:Thank you for the reply, but the code wont copy anything, just the message appears "No reply found", but there is a reply.Code: Select all
if(!folder.canFileMessages)
continue;
Alternatively try (just comparing the subject):Code: Select all
var messageId = gFolderDisplay.selectedMessage.messageId;
var messageSubject = gFolderDisplay.selectedMessage.mime2DecodedSubject;
var replyMessage = null;
var allFolders = MailServices.accounts.allFolders.enumerate();
var folders = [];
while(allFolders.hasMoreElements()) {
var folder = allFolders.getNext().QueryInterface(Components.interfaces.nsIMsgFolder);
if(!folder.canFileMessages)
continue;
var messages = folder.messages;
while(messages.hasMoreElements()) {
var message = messages.getNext().QueryInterface(Components.interfaces.nsIMsgDBHdr);
if(message.mime2DecodedSubject == messageSubject)
if(!replyMessage || message.date > replyMessage.date)
replyMessage = message;
}
}
if(replyMessage && replyMessage.messageId != messageId) {
MsgHdrToMimeMessage(replyMessage, null, function (aMsgHdr, aMimeMessage) {
Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper)
.copyString([
(aMsgHdr.flags & Components.interfaces.nsMsgMessageFlags.HasRe ? "Re: " : "") + aMsgHdr.mime2DecodedSubject,
new Date(aMsgHdr.dateInSeconds * 1000),
aMsgHdr.mime2DecodedAuthor,
aMsgHdr.mime2DecodedRecipients,
"",
aMimeMessage.coerceBodyToPlaintext(gFolderDisplay.displayedFolder).replace(/^\s+/,"").replace(/\s+$/g,"").replace(/\n/g,"\r\n")
].join("\r\n"));
alert("Reply copied");
}, true);
} else {
alert("No reply found");
}
I am using IMAP server and I don't know where to find the References header in the source
There is a Message-ID: <1482295362.93038.1403161307842.JavaMail.zimbra@test.eu>
Removing the one code line wont help.
The alternative gives the same error.
The solution was to remove ! from if(!replyMessage || message.date > replyMessage.date)
replyMessage = message;
I just noticed that the scrip copies the replay I made to the sender, but I need to copy the last reply which I got from the sender.
Please help.
-
- Posts: 68
- Joined: November 8th, 2013, 8:59 pm
Re: keyconfig 20110522
Searched but didn't find a relevant result - is there a way to open a sub-menu item (ideally under the mouse) using keyconfig? Was wanting to open the History>Recently Closed Tabs sub-menu using a shortcut.
-
- Posts: 92
- Joined: August 17th, 2014, 5:57 am
Re: keyconfig 20110522
@Springtime
You can do that with a mouse gesture using Firegestures.
You can do that with a mouse gesture using Firegestures.
-
- Posts: 68
- Joined: November 8th, 2013, 8:59 pm
Re: keyconfig 20110522
t3l0zvxqIiXuzuH0 wrote:@Springtime
You can do that with a mouse gesture using Firegestures.
Thanks for the suggestion, but was ideally looking for a way to do it with a keyboard shortcut. For clarification by 'under the mouse' I meant the menu being at the mouse's position when the hotkey is activated (not sure if Firefox supports this, I know Opera Presto did this).
-
- Posts: 1086
- Joined: November 8th, 2011, 12:06 pm
Re: keyconfig 20110522
any response for me?
-
- Posts: 6421
- Joined: February 3rd, 2009, 6:29 pm
Re: keyconfig 20110522
firefoxuse wrote:they appeared DISABLED
Did you type the shortcut in the "<Disabled>" textbox? Did you use the "Apply" button?
-
- Posts: 1086
- Joined: November 8th, 2011, 12:06 pm
Re: keyconfig 20110522
morat wrote:firefoxuse wrote:they appeared DISABLED
Did you type the shortcut in the "<Disabled>" textbox? Did you use the "Apply" button?
I typed the shortcut in the Disabled textbox and it works now marvelously!
thanks!
-
- Posts: 92
- Joined: August 17th, 2014, 5:57 am
Re: keyconfig 20110522
t3l0zvxqIiXuzuH0 wrote:morat wrote:@t3l0zvxqIiXuzuH0
Try this:Code: Select all
var selection = getBrowserSelection();
if (!selection) return;
var str = readFromClipboard();
if (str) selection = str + " " + selection;
var clipboard = Cc["@mozilla.org/widget/clipboardhelper;1"].
getService(Ci.nsIClipboardHelper);
clipboard.copyString(selection);
Perfect. Thanks.
Well, not so perfect after all. It turns out that getBrowserSelection() limits selection to 150 characters. So I changed the first line to this and it seems to work:
Code: Select all
var command = "cmd_insertText";
var controller = document.commandDispatcher.getControllerForCommand(command);
if ( controller && controller.isCommandEnabled(command) )
{ var selection = getBrowserSelection(); }
else
{ var selection = document.commandDispatcher.focusedWindow.getSelection().toString(); }
It still uses getBrowserSelection() in text areas but I use it mostly to select words in a page before a web search, so it works for me.
I gladly accept better ideas. Thanks.