OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.com> | 3 * Copyright (C) 2008 Matt Lilek <webkit@mattlilek.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 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 * @override | 752 * @override |
753 * @param {!KeyboardEvent} event | 753 * @param {!KeyboardEvent} event |
754 */ | 754 */ |
755 handleShortcut: function(event) | 755 handleShortcut: function(event) |
756 { | 756 { |
757 /** | 757 /** |
758 * @param {!WebInspector.ElementsTreeOutline} treeOutline | 758 * @param {!WebInspector.ElementsTreeOutline} treeOutline |
759 */ | 759 */ |
760 function handleUndoRedo(treeOutline) | 760 function handleUndoRedo(treeOutline) |
761 { | 761 { |
762 if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && !even
t.shiftKey && event.keyIdentifier === "U+005A") { // Z key | 762 if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && !even
t.shiftKey && (event.key === "Z" || event.key === "z")) { // Z key |
763 treeOutline.domModel().undo(); | 763 treeOutline.domModel().undo(); |
764 event.handled = true; | 764 event.handled = true; |
765 return; | 765 return; |
766 } | 766 } |
767 | 767 |
768 var isRedoKey = WebInspector.isMac() ? event.metaKey && event.shiftK
ey && event.keyIdentifier === "U+005A" : // Z key | 768 var isRedoKey = WebInspector.isMac() ? event.metaKey && event.shiftK
ey && (event.key === "Z" || event.key === "z") : // Z key |
769 event.ctrlKey && event.keyIde
ntifier === "U+0059"; // Y key | 769 event.ctrlKey && (event.key =
== "Y" || event.key === "y"); // Y key |
770 if (isRedoKey) { | 770 if (isRedoKey) { |
771 treeOutline.domModel().redo(); | 771 treeOutline.domModel().redo(); |
772 event.handled = true; | 772 event.handled = true; |
773 } | 773 } |
774 } | 774 } |
775 | 775 |
776 if (WebInspector.isEditing() && event.keyCode !== WebInspector.KeyboardS
hortcut.Keys.F2.code) | 776 if (WebInspector.isEditing() && event.keyCode !== WebInspector.KeyboardS
hortcut.Keys.F2.code) |
777 return; | 777 return; |
778 | 778 |
779 var treeOutline = null; | 779 var treeOutline = null; |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1287 */ | 1287 */ |
1288 wasShown: function() | 1288 wasShown: function() |
1289 { | 1289 { |
1290 this._toolbarItem.setToggled(true); | 1290 this._toolbarItem.setToggled(true); |
1291 this._nodeChanged(); | 1291 this._nodeChanged(); |
1292 WebInspector.ThrottledWidget.prototype.wasShown.call(this); | 1292 WebInspector.ThrottledWidget.prototype.wasShown.call(this); |
1293 }, | 1293 }, |
1294 | 1294 |
1295 __proto__: WebInspector.ThrottledWidget.prototype | 1295 __proto__: WebInspector.ThrottledWidget.prototype |
1296 } | 1296 } |
OLD | NEW |