mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-15 13:09:14 +00:00
Bug 185270. Make Insert/shift+insert open link in new tab (foreground/background, depending on whether shift is pressed). r=caillon, sr=jag
This commit is contained in:
parent
597f6914d2
commit
ec704b5a30
@ -177,7 +177,6 @@
|
||||
<handler event="keypress" keycode="VK_DELETE" modifiers="shift" command="cmd_cut" />
|
||||
<handler event="keypress" keycode="VK_DELETE" modifiers="control" command="cmd_copy" />
|
||||
<handler event="keypress" keycode="VK_INSERT" modifiers="control" command="cmd_copy" />
|
||||
<handler event="keypress" keycode="VK_INSERT" modifiers="shift" command="cmd_paste" />
|
||||
<handler event="keypress" keycode="VK_HOME" modifiers="shift,control" command="cmd_selectTop" />
|
||||
<handler event="keypress" keycode="VK_END" modifiers="shift,control" command="cmd_selectBottom" />
|
||||
<handler event="keypress" keycode="VK_F20" command="cmd_cut" />
|
||||
|
@ -95,7 +95,6 @@
|
||||
<handler event="keypress" keycode="VK_DELETE" modifiers="shift" command="cmd_cut"/>
|
||||
<handler event="keypress" keycode="VK_DELETE" modifiers="control" command="cmd_deleteWordForward"/>
|
||||
<handler event="keypress" keycode="VK_INSERT" modifiers="control" command="cmd_copy"/>
|
||||
<handler event="keypress" keycode="VK_INSERT" modifiers="shift" command="cmd_paste"/>
|
||||
<handler event="keypress" keycode="VK_HOME" modifiers="control" command="cmd_scrollTop"/>
|
||||
<handler event="keypress" keycode="VK_END" modifiers="control" command="cmd_scrollBottom"/>
|
||||
<handler event="keypress" keycode="VK_LEFT" modifiers="control" command="cmd_wordPrevious" />
|
||||
|
@ -11,6 +11,7 @@
|
||||
<key key="]" command="Browser:Forward" modifiers="accel"/>
|
||||
<key key="." oncommand="BrowserStop();" modifiers="accel"/>
|
||||
<key id="goHome" keycode="VK_HOME" command="Browser:Home" modifiers="meta"/>
|
||||
<key id="key_newTabWithTarget" keycode="VK_INSERT" modifiers="shift" command="cmd_newTabWithTarget"/>
|
||||
</keyset>
|
||||
|
||||
</overlay>
|
||||
|
@ -109,6 +109,7 @@
|
||||
<commandset id="commands">
|
||||
<command id="cmd_newNavigator"/>
|
||||
<command id="cmd_newNavigatorTab" oncommand="BrowserOpenTab();"/>
|
||||
<command id="cmd_newTabWithTarget" oncommand="contentAreaClick(event);"/>
|
||||
|
||||
<command id="cmd_newEditor"/>
|
||||
<!-- NOT IMPLEMENTED
|
||||
|
@ -17,6 +17,8 @@
|
||||
|
||||
<key id="goHome" keycode="VK_HOME" command="Browser:Home" modifiers="alt"/>
|
||||
<key id="key_fullScreen" keycode="VK_F11" command="View:FullScreen"/>
|
||||
<key id="key_newTabWithTarget" keycode="VK_INSERT" command="cmd_newTabWithTarget"/>
|
||||
<key id="key_newTabWithTarget" keycode="VK_INSERT" modifiers="shift" command="cmd_newTabWithTarget"/>
|
||||
</keyset>
|
||||
|
||||
<menuitem id="menuitem_fullScreen" hidden="false"/>
|
||||
|
@ -16,6 +16,8 @@
|
||||
<key id="goHome" keycode="VK_HOME" command="Browser:Home" modifiers="alt"/>
|
||||
|
||||
<key id="key_fullScreen" keycode="VK_F11" command="View:FullScreen"/>
|
||||
<key id="key_newTabWithTarget" keycode="VK_INSERT" command="cmd_newTabWithTarget"/>
|
||||
<key id="key_newTabWithTarget" keycode="VK_INSERT" modifiers="shift" command="cmd_newTabWithTarget"/>
|
||||
</keyset>
|
||||
|
||||
<menuitem id="menuitem_fullScreen" hidden="false"/>
|
||||
|
@ -124,6 +124,8 @@
|
||||
if (local_name) {
|
||||
local_name = local_name.toLowerCase();
|
||||
}
|
||||
|
||||
var isKeyPress = (event.type == "keypress");
|
||||
|
||||
switch (local_name) {
|
||||
case "a":
|
||||
@ -133,7 +135,8 @@
|
||||
linkNode = target;
|
||||
break;
|
||||
case "input":
|
||||
if ((event.target.type.toLowerCase() == "text" || event.target.type == "") // text field
|
||||
if ((event.target.type == "text") // text field
|
||||
&& !isKeyPress // not a key event
|
||||
&& event.detail == 2 // double click
|
||||
&& event.button == 0 // left mouse button
|
||||
&& event.target.value.length == 0) { // no text has been entered
|
||||
@ -148,12 +151,11 @@
|
||||
linkNode = null;
|
||||
break;
|
||||
}
|
||||
var href;
|
||||
if (linkNode) {
|
||||
handleLinkClick(event, linkNode.href, linkNode);
|
||||
return true;
|
||||
href = linkNode.href;
|
||||
} else {
|
||||
// Try simple XLink
|
||||
var href;
|
||||
linkNode = target;
|
||||
while (linkNode) {
|
||||
if (linkNode.nodeType == Node.ELEMENT_NODE) {
|
||||
@ -164,11 +166,21 @@
|
||||
}
|
||||
if (href && href != "") {
|
||||
href = makeURLAbsolute(target.baseURI,href);
|
||||
handleLinkClick(event, href, null);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (pref && event.button == 1 &&
|
||||
|
||||
if (href) {
|
||||
if (isKeyPress) {
|
||||
openNewTabWith(href, true, event.shiftKey);
|
||||
event.preventBubble();
|
||||
}
|
||||
else {
|
||||
handleLinkClick(event, href, null);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
if (pref && !isKeyPress && event.button == 1 &&
|
||||
!findParentNode(event.originalTarget, "scrollbar") &&
|
||||
pref.getBoolPref("middlemouse.contentLoadURL")) {
|
||||
if (middleMousePaste(event)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user