OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Nokia Inc. All rights reserved. | 2 * Copyright (C) 2008 Nokia Inc. All rights reserved. |
3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. | 3 * Copyright (C) 2013 Samsung Electronics. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 { | 60 { |
61 this._update(); | 61 this._update(); |
62 }, | 62 }, |
63 | 63 |
64 willHide: function() | 64 willHide: function() |
65 { | 65 { |
66 this.deleteButton.visible = false; | 66 this.deleteButton.visible = false; |
67 }, | 67 }, |
68 | 68 |
69 /** | 69 /** |
70 * @param {KeyboardEvent} event | |
71 */ | |
72 handleShortcut: function(event) | |
73 { | |
74 if (WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) && !event.sh
iftKey && event.keyIdentifier === "U+005A") { // Z key | |
75 this.domStorage.undo(); | |
76 event.handled = true; | |
77 return; | |
78 } | |
79 | |
80 var isRedoKey = WebInspector.isMac() ? event.metaKey && event.shiftKey &
& event.keyIdentifier === "U+005A" : // Z key | |
81 event.ctrlKey && event.keyIdentif
ier === "U+0059"; // Y key | |
82 if (isRedoKey) { | |
83 this.domStorage.redo(); | |
84 event.handled = true; | |
85 return; | |
86 } | |
87 }, | |
88 | |
89 /** | |
90 * @param {WebInspector.Event} event | 70 * @param {WebInspector.Event} event |
91 */ | 71 */ |
92 _domStorageItemsCleared: function(event) | 72 _domStorageItemsCleared: function(event) |
93 { | 73 { |
94 if (!this.isShowing() || !this._dataGrid) | 74 if (!this.isShowing() || !this._dataGrid) |
95 return; | 75 return; |
96 | 76 |
97 this._dataGrid.rootNode().removeChildren(); | 77 this._dataGrid.rootNode().removeChildren(); |
98 this._dataGrid.addCreationNode(false); | 78 this._dataGrid.addCreationNode(false); |
99 this.deleteButton.visible = false; | 79 this.deleteButton.visible = false; |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 { | 252 { |
273 if (!node || node.isCreationNode) | 253 if (!node || node.isCreationNode) |
274 return; | 254 return; |
275 | 255 |
276 if (this.domStorage) | 256 if (this.domStorage) |
277 this.domStorage.removeItem(node.data.key); | 257 this.domStorage.removeItem(node.data.key); |
278 }, | 258 }, |
279 | 259 |
280 __proto__: WebInspector.View.prototype | 260 __proto__: WebInspector.View.prototype |
281 } | 261 } |
OLD | NEW |