Skip to content

Commit 5646d3b

Browse files
committed
Keyboard shortcuts cleanup
1 parent 6eb7645 commit 5646d3b

File tree

3 files changed

+6
-63
lines changed

3 files changed

+6
-63
lines changed

chrome/content/tabutils.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2805,18 +2805,6 @@ tabutils._tabPrefObserver = {
28052805
//Tab animations
28062806
TU_hookCode("gBrowser.removeTab", 'window.getComputedStyle(aTab).maxWidth == "0.1px"', 'aTab.boxObject.width == 0');
28072807

2808-
//Shortcuts
2809-
tabutils.addEventListener(window, "keypress", function(event) {
2810-
if ((event.ctrlKey || event.metaKey) && event.shiftKey && (event.charCode == 90 || event.charCode == 122)) {//Ctrl+Shift+Z
2811-
let popup = document.getElementById('undoCloseTabPopup');
2812-
if (popup.state == "open") {
2813-
popup.hidePopup();
2814-
event.preventDefault();
2815-
event.stopPropagation();
2816-
}
2817-
}
2818-
}, true);
2819-
28202808
//Don't allow drag/dblclick on the tab bar to act on the window
28212809
if ("_update" in TabsInTitlebar) // Compat. with Linux
28222810
TU_hookCode("TabsInTitlebar._update", "!this._dragBindingAlive", "$& && TU_getPref('extensions.tabutils.dragBindingAlive', true)");

chrome/content/tabutils.xul

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@
3232
<window id="main-window">
3333
<commandset id="tuCommandSet">
3434
<command id="cmd_tuOptions" oncommand="openDialog('chrome://tabutils/content/preferences.xul', 'Tab Utilities', 'chrome,titlebar,toolbar,centerscreen,dialog=no').focus();"/>
35-
<command id="cmd_copyPageLocation" oncommand="Services.nsIClipboardHelper.copyString(gBrowser.currentURI.spec);"/>
35+
<command id="cmd_copyPageUrl" oncommand="Services.nsIClipboardHelper.copyString(gBrowser.currentURI.spec);"/>
3636
<command id="cmd_copyAllPageUrls" oncommand="Services.nsIClipboardHelper.copyString([tab.linkedBrowser.currentURI.spec for (tab of gBrowser.allTabs)].join('\n'));"/>
37-
<command id="cmd_cutPageLocation" oncommand="document.getElementById('cmd_copyPageLocation').doCommand();document.getElementById('cmd_close').doCommand();"/>
3837
<command id="cmd_pasteAndGo" oncommand="var clipboard = readFromClipboard();if (!clipboard) return;if (clipboard.indexOf('\n') != -1) {gBrowser.loadTabs(clipboard.split('\n'), TU_getPref('extensions.tabutils.loadUrlInBackground'), false);return;} if (gURLBar) {gURLBar.value = clipboard;gURLBar.handleCommand();}"/>
3938
<command id="cmd_pasteAndSearch" oncommand="var url = readFromClipboard(), searchbar = BrowserSearch.searchBar;if (url) if (searchbar) {searchbar.value = url;searchbar.handleSearchCommand();}"/>
4039
<command id="cmd_recentlyClosedTabs" oncommand="var popup = document.getElementById('undoCloseTabPopup');if (popup.state == 'open') popup.hidePopup(); else popup.openPopup(gBrowser.mPanelContainer, 'overlap');"/>
@@ -44,12 +43,11 @@
4443
</commandset>
4544

4645
<keyset id="tuClipboardKeyset">
47-
<key id="key_copyPageLocation" key="C" modifiers="accel" oncommand="goDoCommand('cmd_copy', 'cmd_copyPageLocation');"/>
46+
<key id="key_copyPageUrl" key="C" modifiers="accel" oncommand="goDoCommand('cmd_copy', 'cmd_copyPageUrl');"/>
4847
<key id="key_copyAllPageUrls" key="C" modifiers="accel,shift" oncommand="goDoCommand('cmd_copy', 'cmd_copyAllPageUrls');"/>
49-
<key id="key_cutPageLocation" key="X" modifiers="accel" oncommand="goDoCommand('cmd_cut', 'cmd_cutPageLocation');"/>
5048
<key id="key_pasteAndGo" key="V" modifiers="accel" oncommand="goDoCommand('cmd_paste', 'cmd_pasteAndGo');"/>
51-
<key id="key_pasteAndSearch" key="V" modifiers="accel,shift" oncommand="goDoCommand('cmd_pasteAndSearch', 'cmd_pasteAndSearch');"/>
52-
<key id="key_undoCloseTab2" key="Z" modifiers="accel" oncommand="goDoCommand('cmd_undo', 'History:UndoCloseTab');"/>
49+
<key id="key_pasteAndSearch" key="V" modifiers="accel,shift" oncommand="goDoCommand('cmd_pasteNoFormatting', 'cmd_pasteAndSearch');"/>
50+
<key id="key_undoCloseTabZ" key="Z" modifiers="accel" oncommand="goDoCommand('cmd_undo', 'History:UndoCloseTab');"/>
5351
<key id="key_recentlyClosedTabs" key="Z" modifiers="accel,shift" oncommand="goDoCommand('cmd_redo', 'cmd_recentlyClosedTabs');"/>
5452
</keyset>
5553

@@ -60,9 +58,6 @@
6058
<key id="key_freezeTab" key="F" modifiers="accel,alt" oncommand="gBrowser.freezeTab(gBrowser.mCurrentTab);"/>
6159
<key id="key_faviconizeTab" key="I" modifiers="accel,alt" oncommand="gBrowser.faviconizeTab(gBrowser.mCurrentTab);"/>
6260
<key id="key_pinTab" key="P" modifiers="accel,alt" oncommand="gBrowser.pinTab(gBrowser.mCurrentTab, !gBrowser.mCurrentTab.pinned);"/>
63-
<key id="key_closeLeftTabs" oncommand="gBrowser.closeLeftTabs(gBrowser.mCurrentTab);" keycode="VK_F3" modifiers="accel,shift"/>
64-
<key id="key_closeAllTabs" oncommand="gBrowser.closeAllTabs();" keycode="VK_F4" modifiers="accel,shift"/>
65-
<key id="key_closeRightTabs" oncommand="gBrowser.closeRightTabs(gBrowser.mCurrentTab);" keycode="VK_F5" modifiers="accel,shift"/>
6661
<key id="key_moveTabBackward" oncommand="gBrowser.moveTabBackward();" keycode="VK_PAGE_UP" modifiers="accel,shift"/>
6762
<key id="key_moveTabForward" oncommand="gBrowser.moveTabForward();" keycode="VK_PAGE_DOWN" modifiers="accel,shift"/>
6863
<key id="key_moveTabToStart" oncommand="gBrowser.moveTabToStart();" keycode="VK_HOME" modifiers="accel,shift"/>
@@ -76,8 +71,6 @@
7671
<key id="key_selectPinnedTab7" oncommand="gBrowser.selectPinnedTabAtIndex(6, event);" key="7" modifiers="accel,alt"/>
7772
<key id="key_selectPinnedTab8" oncommand="gBrowser.selectPinnedTabAtIndex(7, event);" key="8" modifiers="accel,alt"/>
7873
<key id="key_selectLastPinnedTab" oncommand="gBrowser.selectPinnedTabAtIndex(-1, event);" key="9" modifiers="accel,alt"/>
79-
<key id="key_prevGroup" command="cmd_prevGroup" keycode="VK_UP" modifiers="control"/>
80-
<key id="key_nextGroup" command="cmd_nextGroup" keycode="VK_DOWN" modifiers="control"/>
8174
<key id="key_toggleTabsToolbar" oncommand="var tabsToolbar = document.getElementById('TabsToolbar'); setToolbarVisibility(tabsToolbar, tabsToolbar.collapsed);" key="\" modifiers="accel"/>
8275
<key id="key_togglePinnedTabsBar" oncommand="var pref = 'extensions.tabutils.pinTab.showPhantom'; TU_setPref(pref, !TU_getPref(pref));" key="\" modifiers="accel,alt"/>
8376
<key id="key_locateTabsToolbarPrev" oncommand="var pref = 'extensions.tabutils.tabBarPosition'; TU_setPref(pref, (TU_getPref(pref, 0) + 3) % 4);" key="[" modifiers="accel,alt"/>

defaults/preferences/prefs.js

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -146,20 +146,12 @@ pref("extensions.tabutils.menu.context_copyTabURL.accesskey", "U");
146146
pref("extensions.tabutils.menu.context_copyTabURL.multiselected", "any");
147147
pref("extensions.tabutils.menu.context_copyTabURL.oncommand", "Cc['@mozilla.org/widget/clipboardhelper;1'].getService(Ci.nsIClipboardHelper).copyString([tab.linkedBrowser.currentURI.spec for (tab of gBrowser.mContextTabs)].join('\\n'));");
148148

149-
pref("extensions.tabutils.menu.context_template", false);
150-
pref("extensions.tabutils.menu.context_template.label", "");
151-
pref("extensions.tabutils.menu.context_template.accesskey", "");
152-
pref("extensions.tabutils.menu.context_template.insertbefore", "");
153-
pref("extensions.tabutils.menu.context_template.multiselected", "");
154-
pref("extensions.tabutils.menu.context_template.oncommand", "");
155-
156149
pref("extensions.tabutils.shortcut.tuClipboardKeyset.disabled", true);
157-
pref("extensions.tabutils.shortcut.key_copyPageLocation", true);
150+
pref("extensions.tabutils.shortcut.key_copyPageUrl", true);
158151
pref("extensions.tabutils.shortcut.key_copyAllPageUrls", true);
159-
pref("extensions.tabutils.shortcut.key_cutPageLocation", true);
160152
pref("extensions.tabutils.shortcut.key_pasteAndGo", true);
161153
pref("extensions.tabutils.shortcut.key_pasteAndSearch", true);
162-
pref("extensions.tabutils.shortcut.key_undoCloseTab2", true);
154+
pref("extensions.tabutils.shortcut.key_undoCloseTabZ", true);
163155
pref("extensions.tabutils.shortcut.key_recentlyClosedTabs", true);
164156

165157
pref("extensions.tabutils.shortcut.tuKeyset.disabled", false);
@@ -169,46 +161,16 @@ pref("extensions.tabutils.shortcut.key_lockTab", true);
169161
pref("extensions.tabutils.shortcut.key_freezeTab", true);
170162
pref("extensions.tabutils.shortcut.key_faviconizeTab", true);
171163
pref("extensions.tabutils.shortcut.key_pinTab", true);
172-
pref("extensions.tabutils.shortcut.key_closeLeftTabs", false);
173-
pref("extensions.tabutils.shortcut.key_closeAllTabs", false);
174-
pref("extensions.tabutils.shortcut.key_closeRightTabs", false);
175164
pref("extensions.tabutils.shortcut.key_moveTabBackward", true);
176165
pref("extensions.tabutils.shortcut.key_moveTabForward", true);
177166
pref("extensions.tabutils.shortcut.key_moveTabToStart", true);
178167
pref("extensions.tabutils.shortcut.key_moveTabToEnd", true);
179-
pref("extensions.tabutils.shortcut.key_prevGroup", false);
180-
pref("extensions.tabutils.shortcut.key_nextGroup", false);
181-
182-
pref("extensions.tabutils.shortcut.key_selectTab1.oncommand", "gBrowser.selectUnpinnedTabAtIndex(0, event);");
183-
pref("extensions.tabutils.shortcut.key_selectTab2.oncommand", "gBrowser.selectUnpinnedTabAtIndex(1, event);");
184-
pref("extensions.tabutils.shortcut.key_selectTab3.oncommand", "gBrowser.selectUnpinnedTabAtIndex(2, event);");
185-
pref("extensions.tabutils.shortcut.key_selectTab4.oncommand", "gBrowser.selectUnpinnedTabAtIndex(3, event);");
186-
pref("extensions.tabutils.shortcut.key_selectTab5.oncommand", "gBrowser.selectUnpinnedTabAtIndex(4, event);");
187-
pref("extensions.tabutils.shortcut.key_selectTab6.oncommand", "gBrowser.selectUnpinnedTabAtIndex(5, event);");
188-
pref("extensions.tabutils.shortcut.key_selectTab7.oncommand", "gBrowser.selectUnpinnedTabAtIndex(6, event);");
189-
pref("extensions.tabutils.shortcut.key_selectTab8.oncommand", "gBrowser.selectUnpinnedTabAtIndex(7, event);");
190-
pref("extensions.tabutils.shortcut.key_selectLastTab.oncommand", "gBrowser.selectUnpinnedTabAtIndex(-1, event);");
191-
192-
pref("extensions.tabutils.shortcut.key_template", false);
193-
pref("extensions.tabutils.shortcut.key_template.key", "");
194-
pref("extensions.tabutils.shortcut.key_template.keycode", "");
195-
pref("extensions.tabutils.shortcut.key_template.modifiers", "");
196-
pref("extensions.tabutils.shortcut.key_template.oncommand", "");
197168

198169
pref("extensions.tabutils.button.newtab-button.onclick", "gBrowser.onTabClick(event);");
199170
pref("extensions.tabutils.button.alltabs-button.onclick", "");
200171
pref("extensions.tabutils.button.tabs-closebutton.onclick", "");
201172
pref("extensions.tabutils.button.undoclosetab-button.onclick", "");
202173

203-
pref("extensions.tabutils.button.button_template", false);
204-
pref("extensions.tabutils.button.button_template.label", "");
205-
pref("extensions.tabutils.button.button_template.image", "");
206-
pref("extensions.tabutils.button.button_template.parent", "");
207-
pref("extensions.tabutils.button.button_template.insertafter", "");
208-
pref("extensions.tabutils.button.button_template.onclick", "");
209-
pref("extensions.tabutils.button.button_template.oncommand", "");
210-
pref("extensions.tabutils.button.button_template.tooltiptext", "");
211-
212174
pref("extensions.tabutils.css.example", "");
213175
pref("extensions.tabutils.js.example", "");
214176

0 commit comments

Comments
 (0)