MozillaZine

keyconfig 20110522

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

Post Posted October 27th, 2008, 11:02 am

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

Post Posted October 29th, 2008, 7:57 pm

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

Post Posted October 30th, 2008, 1:30 am

Try
Code: Select all
openWebPanel("Google Talk","http://talkgadget.google.com/talkgadget/popout"); 

nettrotter
 
Posts: 87
Joined: June 26th, 2007, 6:17 pm

Post Posted October 30th, 2008, 6:41 am

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

Post Posted October 30th, 2008, 6:50 am

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

Post Posted November 1st, 2008, 2:13 am

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

Post Posted November 1st, 2008, 2:16 pm

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

Post Posted November 1st, 2008, 7:36 pm

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 ;)

tonymec

User avatar
 
Posts: 708
Joined: October 15th, 2004, 2:58 am
Location: Schaerbeek (near Brussels, Belgium)

Post Posted November 1st, 2008, 8:11 pm

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

Post Posted November 2nd, 2008, 4:50 am

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.

FireLove

User avatar
 
Posts: 108
Joined: July 27th, 2008, 5:59 pm

Post Posted November 3rd, 2008, 3:35 am

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

Post Posted November 3rd, 2008, 5:31 am

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); 

FireLove

User avatar
 
Posts: 108
Joined: July 27th, 2008, 5:59 pm

Post Posted November 3rd, 2008, 1:34 pm

WOW!
Dorando you Rock!
Works like charm!
(used only first lines )))
Cheers

FireLove

User avatar
 
Posts: 108
Joined: July 27th, 2008, 5:59 pm

Post Posted November 5th, 2008, 2:20 pm

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

Post Posted November 6th, 2008, 5:19 am

Try
Code: Select all
window.maximize(); 

Return to Extension/Theme Releases


Who is online

Users browsing this forum: No registered users and 1 guest