keyconfig 20110522

Announce and Discuss the Latest Theme and Extension Releases.
Post Reply
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20080929

Post by dorando »

nettrotter wrote:
dorando wrote:

Code: Select all

var t = content.getSelection().toString();
if(
t) {
 gBrowser.addTab("http://translate.google.com/translate_t?hl=en#auto|en|"+t);
}
 else {
 gBrowser.addTab("http://translate.google.com/translate?u="+content.location);
}
  


If I wanna open translations in the foregound new tab, what is the code?
Try

Code: Select all

var t = content.getSelection().toString();
if(
t) {
 gBrowser.selectedTab = gBrowser.addTab("http://translate.google.com/translate_t?hl=en#auto|en|"+t);
}
 else {
 gBrowser.selectedTab = gBrowser.addTab("http://translate.google.com/translate?u="+content.location);
}
  
nettrotter
Posts: 87
Joined: June 26th, 2007, 6:17 pm

Re: keyconfig 20080929

Post by nettrotter »

I like to open gtalk online on the sidebar. Thus I bookmark http://talkgadget.google.com/talkgadget/popout to bookmark toolbar and set it open in the sidebar! and keyword to "gtalk". The step works very well. every time when i click that item on the bookmark toolbar, it will open gtalk online on the sidebar properly.

but when i use the gesture

Code: Select all

if(window.loadURI) loadURI(getShortcutOrURI('gtalk',{}));

it will open gtalk online in the new tab. Can you help me with the code to open it on the sidebar??
Thanks in advance.
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20080929

Post by dorando »

Try

Code: Select all

openWebPanel("Google Talk","http://talkgadget.google.com/talkgadget/popout"); 
nettrotter
Posts: 87
Joined: June 26th, 2007, 6:17 pm

Re: keyconfig 20080929

Post by nettrotter »

Thank you, It's very useful.
This can be considered as the general expression of opening a webpage on the sidebar?

openwebPanel("panel name"," the url");
nettrotter
Posts: 87
Joined: June 26th, 2007, 6:17 pm

Re: keyconfig 20080929

Post by nettrotter »

Code: Select all

var sidebar_box = document.getElementById('sidebar-box');
if(sidebar_box.hidden) {openWebPanel("Google Talk","http://talkgadget.google.com/talkgadget/popout");}
else {toggleSidebar();}


toggle on/off google talk on sidebar
nettrotter
Posts: 87
Joined: June 26th, 2007, 6:17 pm

Re: keyconfig 20080929

Post by nettrotter »

Hi, dorando, I come to bother you again. I feel a bit sorry for that...
Now, I have one bookmarklet to recommend a webpage to the site douban.

Code: Select all

javascript:void(function(){var%20d=document,e=encodeURIComponent,s1=window.getSelection,s2=d.getSelection,s3=d.selection,s=s1?s1():s2?s2():s3?s3.createRange().text:'',r='http://www.douban.com/recommend/?url='+e(d.location.href)+'&title='+e(d.title)+'&sel='+e(s)+'&v=1',x=function(){if(!window.open(r,'douban','toolbar=0,resizable=1,scrollbars=yes,status=1,width=450,height=330'))location.href=r+'&r=1'};if(/Firefox/.test(navigator.userAgent)){setTimeout(x,0)}else{x()}})()


Can you convert in into the code of keyconfig without changing its effect?
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20080929

Post by dorando »

nettrotter wrote:This can be considered as the general expression of opening a webpage on the sidebar?
Yes, should be.

nettrotter wrote:Can you convert in into the code of keyconfig without changing its effect?
Try

Code: Select all

var d = content.document;
var e = encodeURIComponent;
var s = content.getSelection();
var r = 'http://www.douban.com/recommend/?url='+e(d.location.href)+'&title='+e(d.title)+'&sel='+e(s)+'&v=1';
var x = function(){
 if(!content.open(r,'douban','toolbar=0,resizable=1,scrollbars=yes,status=1,width=450,height=330'))
  content.location.href=r+'&r=1'
};
setTimeout(x,0); 
qalif
Posts: 1
Joined: November 1st, 2008, 7:30 pm

Re: keyconfig 20080929

Post by qalif »

Hello :)

I've got question about "Global". Now "Global" means "For all Firefox/Thunderbird windows". Is there any way to register hot key globally for whole system (MS Windows Vista SP1). I'm interested to get ability to check new messages for all accounts even if Thunderbird window is not active (it is hidden in system tray) with one key. Now I use F4 in other e-mail client, but I decided to change it to Thunderbird and now I'm looking for solution ;)
User avatar
tonymec
Posts: 734
Joined: October 15th, 2004, 2:58 am
Location: Ixelles (Brussels Capital Region, Belgium)
Contact:

Re: keyconfig 20080929

Post by tonymec »

qalif wrote:I've got question about "Global". Now "Global" means "For all Firefox/Thunderbird windows". Is there any way to register hot key globally for whole system (MS Windows Vista SP1). I'm interested to get ability to check new messages for all accounts even if Thunderbird window is not active (it is hidden in system tray) with one key. Now I use F4 in other e-mail client, but I decided to change it to Thunderbird and now I'm looking for solution ;)

No. keyconfig is installed distinctly for every Mozilla application where you want to use it, and it stores its settings in that application's profile. Since your Firefox, Thunderbird, SeaMonkey, Sunbird, ... preferences are each separate, you can't set keyconfig settings in one of them and see them "magically" apply to another.

Oh -- here's an idea: if you use SeaMonkey instead of Firefox and Thunderbird, you can set global key bindings in the browser and see them appear in the mailer, or vice-versa. Just be sure to use SeaMonkey 2.0a1 or later, because keyconfig requires the "Toolkit" backend which is not compiled into SeaMonkey 1.1.x (or earlier). You may or may not need to also set extensions.checkCompatibility to false in about:config in order to make it install.
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20080929

Post by dorando »

qalif wrote:Hello :)

I've got question about "Global". Now "Global" means "For all Firefox/Thunderbird windows". Is there any way to register hot key globally for whole system (MS Windows Vista SP1). I'm interested to get ability to check new messages for all accounts even if Thunderbird window is not active (it is hidden in system tray) with one key. Now I use F4 in other e-mail client, but I decided to change it to Thunderbird and now I'm looking for solution ;)
Sorry, AFAIK the core doesn't provide anything to make OS wide hotkeys possible currently. Songbird provides a sbIGlobalHotkeys service (seems to be part of sbIntegration) which could maybe be ported over, or maybe JSctypes could be used, but nothing I can help with.
User avatar
FireLove
Posts: 108
Joined: July 27th, 2008, 5:59 pm

Re: keyconfig 20080929

Post by FireLove »

Hey dorando,
Great extension, many thanks! It completely changed the way I use my Mac!

But I could not find commands for couple of things :
1) "Recent pages" backForwardMenu.tooltip - widget to list history of current tab
2) "List all tabs" listAllTabs.label - widget to list all tabs in current window

All that I've found so far on http://mxr.mozilla.org/ wasn't working for me ...
Can you help, please!
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20080929

Post by dorando »

FireLove wrote:1) "Recent pages" backForwardMenu.tooltip - widget to list history of current tab
Try

Code: Select all

document.getElementById("back-forward-dropmarker").open = true; 
or (if you want to remove the BackForward button)

Code: Select all

document.getElementById("backForwardMenu").showPopup(gBrowser, -1, -1, "popup", null, null); 

FireLove wrote:2) "List all tabs" listAllTabs.label - widget to list all tabs in current window
Try

Code: Select all

gBrowser.mTabContainer.mAllTabsButton.open = true; 
or (if you want to hide the button)

Code: Select all

if(!keyconfig.alltabsPopup) {
 keyconfig.alltabsPopup = gBrowser.mTabContainer.mAllTabsButton.parentNode.parentNode.appendChild(document.createElement("popup"));
 keyconfig.alltabsPopup.className = "tabs-alltabs-popup";
}

keyconfig.alltabsPopup.showPopup(gBrowser, -1, -1, "popup", null, null); 
User avatar
FireLove
Posts: 108
Joined: July 27th, 2008, 5:59 pm

Re: keyconfig 20080929

Post by FireLove »

WOW!
Dorando you Rock!
Works like charm!
(used only first lines )))
Cheers
User avatar
FireLove
Posts: 108
Joined: July 27th, 2008, 5:59 pm

Re: keyconfig 20080929

Post by FireLove »

Hey Dorando,
another thing I couldn't find here.... Zoom!
But not Zoom In/Out - the one that handles browser windows (on a Mac) - maximizes it!
Set for it global system pref, which works for most apps, except for any flavor of firefox.

Wow, quick trip to mxr.mozilla.org, reveals that resizing is a complex process ...
mxr.mozilla.org/...cocoa/nsCocoaWindow.mm#910
Looking forward from you for always elegant solution ;)
Regards,
Love of Fire
dorando
Posts: 1203
Joined: January 9th, 2004, 9:57 am
Contact:

Re: keyconfig 20080929

Post by dorando »

Try

Code: Select all

window.maximize(); 
Post Reply