Code: Select all
var pref = "dom.event.contextmenu.enabled";
gBrowser.mPrefs.setBoolPref(pref, !gBrowser.mPrefs.getBoolPref(pref));
Code: Select all
var pref = "dom.event.contextmenu.enabled";
gBrowser.mPrefs.setBoolPref(pref, !gBrowser.mPrefs.getBoolPref(pref));
Code: Select all
toggleElement (element)
var b = document.getElementById(element);
b.collapsed = !b.collapsed;
return b.collapsed;
Not really, you'll need to add the relevant code to all <key>s.Iceweasel wrote:Is it possible to write functions which can be called from various keys?
If only needed for the current window/session adding anything to a global object should suffice (window.blah = "something") otherwise you can store anything in the Preferences or maybe withIceweasel wrote:Is it possible to store a state which can be read the net time a key is pressed?
TryIceweasel wrote:I would like to hide/unhide my tool and tab bars (when I need more screen estate). I have already written a function that does that. But preferably, I would like to be able to toggle the state of individual menus as well as having a toggle all, which is why I'd like to create a callable function:Rather than just toggling all menu states, I'd like to hide them all the first time - and if they are hidden already, remember that and only unhide those the next time that were visible before.Code: Select all
toggleElement (element)
var b = document.getElementById(element);
b.collapsed = !b.collapsed;
return b.collapsed;
Code: Select all
if(keyconfig.toolbars) {
keyconfig.toolbars.forEach(function(node){
node.collapsed = false;
});
delete keyconfig.toolbars;
} else {
keyconfig.toolbars = [];
["toolbar-menubar","nav-bar","PersonalToolbar","status-bar"].forEach(function(id){
var node = document.getElementById(id);
if(!node.collapsed) {
keyconfig.toolbars.push(node);
node.collapsed = true;
}
});
if(!gBrowser.mStrip.collapsed) {
gBrowser.mStrip.collapsed = true;
keyconfig.toolbars.push(gBrowser.mStrip);
}
}
OzarksCrescentMural wrote:Hi,
I need the keyconfig command codes for Select All, Copy, Paste.
I'm just trying to set Add a New Key for Select All and Copy and another one for Select All and Paste. I do these keystrokes a million times a night for my job.
Your help is much appreciated.
Thanks!
Code: Select all
document.getElementById("sessionmanager-toolbar").open = true;
Code: Select all
gSessionManager.load();
gSessionManager.saveWindow();
gSessionManager.save();
gSessionManager.remove();
Code: Select all
evernote_performClip(null);
TryOzarksCrescentMural wrote:I need the keyconfig command codes for Select All, Copy, Paste.
Code: Select all
goDoCommand("cmd_selectAll");
goDoCommand("cmd_copy");
goDoCommand("cmd_paste");
TryOzarksCrescentMural wrote:Say, I've already highlighted the text I want.
So I'd want the command to do the following:
Copy
Switch to Tab 2
Click in the search box
Select all and paste
Enter
Code: Select all
goDoCommand("cmd_copy");
gBrowser.selectTabAtIndex(1);
var input = content.document.getElementsByName("q")[0];
input.focus();
goDoCommand("cmd_selectAll");
goDoCommand("cmd_paste");
input.form.submit();
Code: Select all
goDoCommand("cmd_copy");
gBrowser.selectTabAtIndex(1);
var input = content.document.getElementsByName("q")[0];
input.focus();
goDoCommand("cmd_selectAll");
goDoCommand("cmd_paste");
var utils = commandDispatcher.focusedWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
getInterface(Components.interfaces.nsIDOMWindowUtils);
utils.sendKeyEvent("keypress", KeyEvent.DOM_VK_ENTER, 0, 0);
Code: Select all
var input = content.document.getElementsByName("q")[0];
TryFireLove wrote:Session Manager had big update, broke shortcuts I had for it's functions.
[...]
The broken ones are:Code: Select all
gSessionManager.load();
gSessionManager.saveWindow();
gSessionManager.save();
gSessionManager.remove();
Code: Select all
com.morac.gSessionManager.load(window);
com.morac.gSessionManager.saveWindow(window);
com.morac.gSessionManager.save(window);
com.morac.gSessionManager.remove();
Code: Select all
var tabs = "extensions.tabmix.hideTabbar";
if(!keyconfig.toolbars) // 1st, 3rd, ...
{
keyconfig.toolbars = [];
keyconfig.tabbar = gBrowser.mPrefs.getIntPref(tabs);
if (keyconfig.tabbar == 0)
{
gBrowser.mPrefs.setIntPref(tabs, 2);
}
["toolbar-menubar","nav-bar","PersonalToolbar","aios-toolbox-left","FindToolbar"].forEach(
function(id)
{
var node = document.getElementById(id);
if(!node.collapsed)
{
keyconfig.toolbars.push(node);
node.collapsed = true;
}
});
}
else // 2nd, 4th, ...
{
if (keyconfig.tabbar == 0)
{
gBrowser.mPrefs.setIntPref(tabs, 0);
}
keyconfig.toolbars.forEach (
function(node)
{
node.collapsed = false;
});
delete keyconfig.toolbars;
}
dorando wrote:TryFireLove wrote:Session Manager had big update, broke shortcuts I had for it's functions.
[...]
The broken ones are:Code: Select all
gSessionManager.load();
gSessionManager.saveWindow();
gSessionManager.save();
gSessionManager.remove();Code: Select all
com.morac.gSessionManager.load(window);
com.morac.gSessionManager.saveWindow(window);
com.morac.gSessionManager.save(window);
com.morac.gSessionManager.remove();
Code: Select all
gBrowser.mTabContainer.advanceSelectedTab(1,true) /* next */
gBrowser.mTabContainer.advanceSelectedTab(-1,true) /* previous */