OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). | 3 * Copyright (C) 2007 Matt Lilek (pewtermoose@gmail.com). |
4 * Copyright (C) 2009 Joseph Pecoraro | 4 * Copyright (C) 2009 Joseph Pecoraro |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 { | 818 { |
819 var shortcut = WebInspector.KeyboardShortcut; | 819 var shortcut = WebInspector.KeyboardShortcut; |
820 var section = WebInspector.shortcutsHelp.section(WebInspector.UIString("All
Panels")); | 820 var section = WebInspector.shortcutsHelp.section(WebInspector.UIString("All
Panels")); |
821 var keys = [ | 821 var keys = [ |
822 shortcut.shortcutToString("]", shortcut.Modifiers.CtrlOrMeta), | 822 shortcut.shortcutToString("]", shortcut.Modifiers.CtrlOrMeta), |
823 shortcut.shortcutToString("[", shortcut.Modifiers.CtrlOrMeta) | 823 shortcut.shortcutToString("[", shortcut.Modifiers.CtrlOrMeta) |
824 ]; | 824 ]; |
825 section.addRelatedKeys(keys, WebInspector.UIString("Next/previous panel")); | 825 section.addRelatedKeys(keys, WebInspector.UIString("Next/previous panel")); |
826 section.addKey(shortcut.shortcutToString(shortcut.Keys.Esc), WebInspector.UI
String("Toggle console")); | 826 section.addKey(shortcut.shortcutToString(shortcut.Keys.Esc), WebInspector.UI
String("Toggle console")); |
827 section.addKey(shortcut.shortcutToString("f", shortcut.Modifiers.CtrlOrMeta)
, WebInspector.UIString("Search")); | 827 section.addKey(shortcut.shortcutToString("f", shortcut.Modifiers.CtrlOrMeta)
, WebInspector.UIString("Search")); |
828 keys = [ | 828 if (WebInspector.isMac()) { |
829 shortcut.shortcutToString("g", shortcut.Modifiers.CtrlOrMeta), | 829 keys = [ |
830 shortcut.shortcutToString("g", shortcut.Modifiers.CtrlOrMeta | shortcut.
Modifiers.Shift) | 830 shortcut.shortcutToString("g", shortcut.Modifiers.Meta), |
831 ]; | 831 shortcut.shortcutToString("g", shortcut.Modifiers.Meta | shortcut.Mo
difiers.Shift) |
832 section.addRelatedKeys(keys, WebInspector.UIString("Find next/previous")); | 832 ]; |
| 833 section.addRelatedKeys(keys, WebInspector.UIString("Find next/previous")
); |
| 834 } |
833 } | 835 } |
834 | 836 |
835 WebInspector.documentKeyDown = function(event) | 837 WebInspector.documentKeyDown = function(event) |
836 { | 838 { |
837 var isInputElement = event.target.nodeName === "INPUT"; | 839 var isInputElement = event.target.nodeName === "INPUT"; |
838 var isInEditMode = event.target.enclosingNodeOrSelfWithClass("text-prompt")
|| WebInspector.isEditingAnyField(); | 840 var isInEditMode = event.target.enclosingNodeOrSelfWithClass("text-prompt")
|| WebInspector.isEditingAnyField(); |
839 const helpKey = WebInspector.isMac() ? "U+003F" : "U+00BF"; // "?" for both
platforms | 841 const helpKey = WebInspector.isMac() ? "U+003F" : "U+00BF"; // "?" for both
platforms |
840 | 842 |
841 if (event.keyIdentifier === "F1" || | 843 if (event.keyIdentifier === "F1" || |
842 (event.keyIdentifier === helpKey && event.shiftKey && (!isInEditMode &&
!isInputElement || event.metaKey))) { | 844 (event.keyIdentifier === helpKey && event.shiftKey && (!isInEditMode &&
!isInputElement || event.metaKey))) { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
904 break; | 906 break; |
905 | 907 |
906 case "F3": | 908 case "F3": |
907 if (!isMac) { | 909 if (!isMac) { |
908 WebInspector.focusSearchField(); | 910 WebInspector.focusSearchField(); |
909 event.preventDefault(); | 911 event.preventDefault(); |
910 } | 912 } |
911 break; | 913 break; |
912 | 914 |
913 case "U+0047": // G key | 915 case "U+0047": // G key |
914 if (isMac) | 916 if (isMac && event.metaKey && !event.ctrlKey && !event.altKey) { |
915 var isFindAgainKey = event.metaKey && !event.ctrlKey && !event.a
ltKey; | |
916 else | |
917 var isFindAgainKey = event.ctrlKey && !event.metaKey && !event.a
ltKey; | |
918 | |
919 if (isFindAgainKey) { | |
920 if (event.shiftKey) { | 917 if (event.shiftKey) { |
921 if (this.currentPanel.jumpToPreviousSearchResult) | 918 if (this.currentPanel.jumpToPreviousSearchResult) |
922 this.currentPanel.jumpToPreviousSearchResult(); | 919 this.currentPanel.jumpToPreviousSearchResult(); |
923 } else if (this.currentPanel.jumpToNextSearchResult) | 920 } else if (this.currentPanel.jumpToNextSearchResult) |
924 this.currentPanel.jumpToNextSearchResult(); | 921 this.currentPanel.jumpToNextSearchResult(); |
925 event.preventDefault(); | 922 event.preventDefault(); |
926 } | 923 } |
927 | |
928 break; | 924 break; |
929 | 925 |
930 // Windows and Mac have two different definitions of [, so accept both. | 926 // Windows and Mac have two different definitions of [, so accept both. |
931 case "U+005B": | 927 case "U+005B": |
932 case "U+00DB": // [ key | 928 case "U+00DB": // [ key |
933 if (isMac) | 929 if (isMac) |
934 var isRotateLeft = event.metaKey && !event.shiftKey && !event.ct
rlKey && !event.altKey; | 930 var isRotateLeft = event.metaKey && !event.shiftKey && !event.ct
rlKey && !event.altKey; |
935 else | 931 else |
936 var isRotateLeft = event.ctrlKey && !event.shiftKey && !event.me
taKey && !event.altKey; | 932 var isRotateLeft = event.ctrlKey && !event.shiftKey && !event.me
taKey && !event.altKey; |
937 | 933 |
(...skipping 1171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2109 { | 2105 { |
2110 if (this._inHistory) | 2106 if (this._inHistory) |
2111 return; | 2107 return; |
2112 | 2108 |
2113 this._history.splice(this._historyIterator + 1, this._history.length - t
his._historyIterator - 1); | 2109 this._history.splice(this._historyIterator + 1, this._history.length - t
his._historyIterator - 1); |
2114 if (!this._history.length || this._history[this._history.length - 1] !==
panelName) | 2110 if (!this._history.length || this._history[this._history.length - 1] !==
panelName) |
2115 this._history.push(panelName); | 2111 this._history.push(panelName); |
2116 this._historyIterator = this._history.length - 1; | 2112 this._historyIterator = this._history.length - 1; |
2117 } | 2113 } |
2118 } | 2114 } |
OLD | NEW |