keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
ballyhairs
Posts: 63
Joined: May 5th, 2009, 2:44 pm

Re: keyconfig 20080929

Post by ballyhairs »

Hello dorando,
I'm using 2 keys from you to copy address and another to run link from clipoard, but I recently switched to FF4 and I hide the address bar, these keys don't work when that bar is hidden, anyway you can make it smarter in getting the address and running the one from clipboard?


Here they are..

Get address

Code: Select all

 var ClipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
.getService(Components.interfaces.nsIClipboardHelper);

ClipboardHelper.copyString(gURLBar.value);


Run address

Code: Select all

    loadURI(readFromClipboard()); 
nameanyone
Posts: 22
Joined: February 14th, 2007, 10:54 am

Re: keyconfig 20080929

Post by nameanyone »

Hi dorando, In Fx4, the old "Close Tab and Focus to the left Tab" code is not compatible wih Tab Groups. Closing a tab can lead to a switch to a different tab group. Can you suggest an updated code? Thanks.
fhoshino
Posts: 19
Joined: February 24th, 2011, 1:47 am

Re: keyconfig 20080929

Post by fhoshino »

Hello dorando,
I'm trying to get ShortcutKey2URL to work, I want to use ShortcutKey2URL with a single key to launch (F-keys),

I tried to add the following code:

Code: Select all

gShortcutKey2URL.removeChildNodes(gShortcutKey2URL.keyListPanel);
var dummyFrameDocument = gShortcutKey2URL.dummyFrame.contentDocument;
var grid = dummyFrameDocument.documentElement.appendChild(dummyFrameDocument.createElement('grid'));
var columns = grid.appendChild(dummyFrameDocument.createElement('columns'));
for (var i = 0; i < 3; i++) {
var keyColumn = columns.appendChild(dummyFrameDocument.createElement('column'));
var nameColumn = columns.appendChild(dummyFrameDocument.createElement('column'));
}
var rows = grid.appendChild(dummyFrameDocument.createElement('rows'));
var row = null;
for (var i = 0, len = gShortcutKey2URL.settingData.length; i < len; i++) {
if (!row || i % 3 == 0) {row = rows.appendChild(dummyFrameDocument.createElement('row'));}
var keyLabel = row.appendChild(dummyFrameDocument.createElement('label'));
keyLabel.setAttribute('value', gShortcutKey2URL.settingData[i].key);
keyLabel.className = 'shortcutKey2URL-keyListPanel-key';
var nameLabel = row.appendChild(dummyFrameDocument.createElement('label'));
nameLabel.setAttribute('value', gShortcutKey2URL.settingData[i].name);
nameLabel.className = 'shortcutKey2URL-keyListPanel-name';}
var x = document.documentElement.boxObject.screenX + (document.width / 2) - (grid.boxObject.width / 2);
var y = document.documentElement.boxObject.screenY + (document.height / 2) - (grid.boxObject.height / 2);
gShortcutKey2URL.keyListPanel.appendChild(grid);
document.popupNode = null;
gShortcutKey2URL.keyListPanel.showPopup(document.documentElement, x, y, 'popup', null, null);

but this just shows the panel, it doesn't accept input keys, is there other way to do it?

or if this cannot be done, can I assign a function to call the key combination assigned for ShortcutKey2URL?

Many thanks.
User avatar
deadman36g
Posts: 49
Joined: January 5th, 2006, 12:14 pm
Location: Fort Smith, USA
Contact:

Re: keyconfig 20080929

Post by deadman36g »

Could someone please send me a zip of the keyconfig xpi file to work with firefox 4 b11 I read the update instructions but am having trouble

dadams9 @ gmail.com
nameanyone
Posts: 22
Joined: February 14th, 2007, 10:54 am

Re: keyconfig 20080929

Post by nameanyone »

Deadman36g wrote:Could someone please send me a zip of the keyconfig xpi file to work with firefox 4 b11 I read the update instructions but am having trouble

dadams9 @ gmail.com

I created one just the other day. Works for me. I'll send it to you in a minute.
PrimaFacie
Posts: 11
Joined: February 24th, 2011, 7:14 pm

Re: keyconfig 20080929

Post by PrimaFacie »

nameanyone wrote:
Deadman36g wrote:Could someone please send me a zip of the keyconfig xpi file to work with firefox 4 b11 I read the update instructions but am having trouble

dadams9 @ gmail.com

I created one just the other day. Works for me. I'll send it to you in a minute.

Hi. Any chance you could send it to me as well? I don't have anything to edit the file myself. Thanks!

(email removed)

[edit]email removed. No email support is available here but heaps of hungry harvesting robots. LIMPET235 (Moderator)[/edit]
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20080929

Post by dorando »

mad.engineer wrote:Thanks for the code. I tried it and it seem to work, but noticed that often it won't re-wrap the paragraph correctly. What I'm looking for is similar to the Justify/Re-wrap in the UNIX Pico command.
Try

Code: Select all

var editor = GetCurrentEditor();
var selection = editor.selection;
var wrapWidth = gPrefs.getIntPref("mailnews.wraplength") - 1;

if(IsHTMLEditor())
 function getEditorSelection() {
  if(editor.selection.getRangeAt(0).toString().charAt(0) == "\n")
   return editor.selection.toString().substr(1);
  else
   return editor.selection.toString()
 }
else
 function getEditorSelection() { return editor.outputToString("text/plain",1 | 16) }

var startRange;

goDoCommand("cmd_beginLine");

do {
 goDoCommand("cmd_beginLine"); goDoCommand("cmd_selectEndLine");
 start = selection.getRangeAt(0);
 if(!start.toString().match(/^[\s>]*$/))
  break;
 goDoCommand("cmd_lineNext");
} while(selection.getRangeAt(0).compareBoundaryPoints(Range.END_TO_END,start) > 0);

if(selection == "") return;

var re = new RegExp("^"+getEditorSelection().match(/^[\s>]*/)+"([^\\s>])");

do {
 goDoCommand("cmd_beginLine"); goDoCommand("cmd_selectEndLine");

 if(!re.test(getEditorSelection()))
  break;

 startRange = selection.getRangeAt(0);

 goDoCommand("cmd_linePrevious");
} while(selection.getRangeAt(0).compareBoundaryPoints(Range.START_TO_START,startRange) < 0);

goDoCommand("cmd_lineNext");

var endRange = start;

do {
 goDoCommand("cmd_beginLine"); goDoCommand("cmd_selectEndLine");

 if(!re.test(getEditorSelection()))
  break;

 endRange = selection.getRangeAt(0);

 goDoCommand("cmd_lineNext");
} while(selection.getRangeAt(0).compareBoundaryPoints(Range.END_TO_END,endRange) > 0);

selection.getRangeAt(0).setStart(startRange.startContainer, startRange.startOffset);
selection.getRangeAt(0).setEnd(endRange.endContainer, endRange.endOffset);

var words = getEditorSelection().replace(/^[\s>]*/gm," ").split(/\s+/);
var text = [];
var lineStart = getEditorSelection().match(/^[\s>]*/);
var line = [];

for(var i = 1, l = words.length; i < l; i++) {
 if(lineStart[0].length + line.join(" ").length + words[i].length > wrapWidth) {
  text.push(lineStart + line.join(" "));
  line =  [];
 }
 line.push(words[i]);
}

text.push(lineStart + line.join(" "));

editor.insertText(text.join("\n"));

emil9216 wrote:Is it possible to make "space+T" key combination for opening a new tab? I can assign "space" for opening a new tab but i can't assign this combination "space+T".
Add a new key containing the following and assign space to it

Code: Select all

if(keyconfig.spaceMod)
 return;

keyconfig.spaceMod = {
 handleEvent: function(event){
  switch(event.type) {
   case "keyup": 
    if
(event.keyCode == 32 && !(event.altKey || event.metaKey || event.shiftKey || event.ctrlKey)) {
     window.removeEventListener("keypress", this, true);
     window.removeEventListener("keyup", this, true);
     delete keyconfig.spaceMod;
    }
    break;
   case "keypress": {
    event.preventDefault();
    if(!(event.altKey || event.metaKey || event.shiftKey || event.ctrlKey)
       && String.fromCharCode(event.charCode).toUpperCase() == "T")
     BrowserOpenTab();
   }
  }
 }
}

window.addEventListener("keyup", keyconfig.spaceMod, true);
window.addEventListener("keypress", keyconfig.spaceMod, true); 

mad.engineer wrote:Is it possible to update the compatibility info of keyconfig for TB 3.3a2?. I tried disabling the compatibility check but it still would not work in TB. Thanks
See the reply to stevvie.

ballyhairs wrote:I'm using 2 keys from you to copy address and another to run link from clipoard, but I recently switched to FF4 and I hide the address bar, these keys don't work when that bar is hidden, anyway you can make it smarter in getting the address and running the one from clipboard?
Try

Code: Select all

var ClipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
.
getService(Components.interfaces.nsIClipboardHelper);

ClipboardHelper.copyString(content.location);    

nameanyone wrote:Hi dorando, In Fx4, the old "Close Tab and Focus to the left Tab" code is not compatible wih Tab Groups. Closing a tab can lead to a switch to a different tab group. Can you suggest an updated code?
Try

Code: Select all

var tab = gBrowser.mCurrentTab; gBrowser.tabContainer.advanceSelectedTab(-1, false); tab.owner = null; gBrowser.removeTab(tab); 

fhoshino wrote:I'm trying to get ShortcutKey2URL to work, I want to use ShortcutKey2URL with a single key to launch (F-keys), [...]
Try

Code: Select all

gShortcutKey2URL.startKeyReceive();  

PrimaFacie wrote:I don't have anything to edit the file myself.
.xpi = .zip
.manifest = .txt
.js = .txt
fhoshino
Posts: 19
Joined: February 24th, 2011, 1:47 am

Re: keyconfig 20080929

Post by fhoshino »

dorando,
Thanks for your advise,
but I have switched to another similar addon.
mad.engineer
Posts: 314
Joined: August 8th, 2006, 4:08 pm

Re: keyconfig 20080929

Post by mad.engineer »

dorando, Thank you for the code. I tried and it works great as expected :-)

I'm hoping if you could provide me the code that I can use via Keyconfig to do a "Save All" in the TB message attachment window?. I use IMAP, so my goal is that when I receive a message which has multiple attachments, instead of moving my cursor in the attachment window and doing a right-mouse click and select "Save All" to save them to my desktop, I could use a key to do the same that would invoke a "Save All" function, if that it possible?. Thanks again for the great add-on !
ballyhairs
Posts: 63
Joined: May 5th, 2009, 2:44 pm

Re: keyconfig 20080929

Post by ballyhairs »

dorando,
I love you man, thanks :)
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20080929

Post by dorando »

mad.engineer wrote:I'm hoping if you could provide me the code that I can use via Keyconfig to do a "Save All" in the TB message attachment window?.
Try

Code: Select all

HandleAllAttachments('save'); 
mad.engineer
Posts: 314
Joined: August 8th, 2006, 4:08 pm

Re: keyconfig 20080929

Post by mad.engineer »

dorando, You're a genius!. Thank you again :-)
PrimaFacie
Posts: 11
Joined: February 24th, 2011, 7:14 pm

Re: keyconfig 20080929

Post by PrimaFacie »

dorando wrote:
PrimaFacie wrote:I don't have anything to edit the file myself.
.xpi = .zip
.manifest = .txt
.js = .txt

Thanks for that!

I managed to open it and edit the files per the instructions found http://forums.mozillazine.org/viewtopic.php?f=38&t=2064341&p=10264475#p10264475.

Unfortunately, Firefox says it's corrupt, so it can't be installed. :(
bolobb
Posts: 94
Joined: April 25th, 2010, 1:44 pm

Re: keyconfig 20080929

Post by bolobb »

The addon is now not compatible with FF3.6.15.
kangarooo
Posts: 3
Joined: March 6th, 2011, 12:18 pm

Re: keyconfig 20080929

Post by kangarooo »

I installed Keyconfig.
How to make shortcut in that Keyconfig for CTRL+ALT+D to save bookmark without asking in Unsorted bookmarks or in specific folder?
Post Reply