| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 /** | 31 /** |
| 32 * @constructor | 32 * @constructor |
| 33 */ | 33 */ |
| 34 WebInspector.ShortcutsScreen = function() | 34 WebInspector.ShortcutsScreen = function() |
| 35 { | 35 { |
| 36 /** @type {!Object.<string, !WebInspector.ShortcutsSection>} */ | 36 /** @type {!Object.<string, !WebInspector.ShortcutsSection>} */ |
| 37 this._sections = {}; | 37 this._sections = {}; |
| 38 } | 38 }; |
| 39 | 39 |
| 40 WebInspector.ShortcutsScreen.prototype = { | 40 WebInspector.ShortcutsScreen.prototype = { |
| 41 /** | 41 /** |
| 42 * @param {string} name | 42 * @param {string} name |
| 43 * @return {!WebInspector.ShortcutsSection} | 43 * @return {!WebInspector.ShortcutsSection} |
| 44 */ | 44 */ |
| 45 section: function(name) | 45 section: function(name) |
| 46 { | 46 { |
| 47 var section = this._sections[name]; | 47 var section = this._sections[name]; |
| 48 if (!section) | 48 if (!section) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 72 var container = scrollPane.createChild("div"); | 72 var container = scrollPane.createChild("div"); |
| 73 container.className = "help-content help-container"; | 73 container.className = "help-content help-container"; |
| 74 for (var i = 0; i < orderedSections.length; ++i) | 74 for (var i = 0; i < orderedSections.length; ++i) |
| 75 orderedSections[i].renderSection(container); | 75 orderedSections[i].renderSection(container); |
| 76 | 76 |
| 77 var note = scrollPane.createChild("p", "help-footnote"); | 77 var note = scrollPane.createChild("p", "help-footnote"); |
| 78 note.appendChild(WebInspector.linkifyDocumentationURLAsNode("iterate/ins
pect-styles/shortcuts", WebInspector.UIString("Full list of DevTools keyboard sh
ortcuts and gestures"))); | 78 note.appendChild(WebInspector.linkifyDocumentationURLAsNode("iterate/ins
pect-styles/shortcuts", WebInspector.UIString("Full list of DevTools keyboard sh
ortcuts and gestures"))); |
| 79 | 79 |
| 80 return widget; | 80 return widget; |
| 81 } | 81 } |
| 82 } | 82 }; |
| 83 | 83 |
| 84 /** | 84 /** |
| 85 * We cannot initialize it here as localized strings are not loaded yet. | 85 * We cannot initialize it here as localized strings are not loaded yet. |
| 86 * @type {!WebInspector.ShortcutsScreen} | 86 * @type {!WebInspector.ShortcutsScreen} |
| 87 */ | 87 */ |
| 88 WebInspector.shortcutsScreen; | 88 WebInspector.shortcutsScreen; |
| 89 | 89 |
| 90 /** | 90 /** |
| 91 * @constructor | 91 * @constructor |
| 92 * @param {string} name | 92 * @param {string} name |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 _joinNodes: function(nodes, delimiter) | 200 _joinNodes: function(nodes, delimiter) |
| 201 { | 201 { |
| 202 var result = createDocumentFragment(); | 202 var result = createDocumentFragment(); |
| 203 for (var i = 0; i < nodes.length; ++i) { | 203 for (var i = 0; i < nodes.length; ++i) { |
| 204 if (i > 0) | 204 if (i > 0) |
| 205 result.appendChild(delimiter.cloneNode(true)); | 205 result.appendChild(delimiter.cloneNode(true)); |
| 206 result.appendChild(nodes[i]); | 206 result.appendChild(nodes[i]); |
| 207 } | 207 } |
| 208 return result; | 208 return result; |
| 209 } | 209 } |
| 210 } | 210 }; |
| 211 | 211 |
| 212 WebInspector.ShortcutsScreen.registerShortcuts = function() | 212 WebInspector.ShortcutsScreen.registerShortcuts = function() |
| 213 { | 213 { |
| 214 // Elements panel | 214 // Elements panel |
| 215 var elementsSection = WebInspector.shortcutsScreen.section(WebInspector.UISt
ring("Elements Panel")); | 215 var elementsSection = WebInspector.shortcutsScreen.section(WebInspector.UISt
ring("Elements Panel")); |
| 216 | 216 |
| 217 var navigate = WebInspector.ShortcutsScreen.ElementsPanelShortcuts.NavigateU
p.concat(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.NavigateDown); | 217 var navigate = WebInspector.ShortcutsScreen.ElementsPanelShortcuts.NavigateU
p.concat(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.NavigateDown); |
| 218 elementsSection.addRelatedKeys(navigate, WebInspector.UIString("Navigate ele
ments")); | 218 elementsSection.addRelatedKeys(navigate, WebInspector.UIString("Navigate ele
ments")); |
| 219 | 219 |
| 220 var expandCollapse = WebInspector.ShortcutsScreen.ElementsPanelShortcuts.Exp
and.concat(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.Collapse); | 220 var expandCollapse = WebInspector.ShortcutsScreen.ElementsPanelShortcuts.Exp
and.concat(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.Collapse); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 section = WebInspector.shortcutsScreen.section(WebInspector.UIString("La
yers Panel")); | 294 section = WebInspector.shortcutsScreen.section(WebInspector.UIString("La
yers Panel")); |
| 295 section.addAlternateKeys(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.ResetView, WebInspector.UIString("Reset view")); | 295 section.addAlternateKeys(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.ResetView, WebInspector.UIString("Reset view")); |
| 296 section.addAlternateKeys(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.PanMode, WebInspector.UIString("Switch to pan mode")); | 296 section.addAlternateKeys(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.PanMode, WebInspector.UIString("Switch to pan mode")); |
| 297 section.addAlternateKeys(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.RotateMode, WebInspector.UIString("Switch to rotate mode")); | 297 section.addAlternateKeys(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.RotateMode, WebInspector.UIString("Switch to rotate mode")); |
| 298 section.addAlternateKeys(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.TogglePanRotate, WebInspector.UIString("Temporarily toggle pan/rotate mode wh
ile held")); | 298 section.addAlternateKeys(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.TogglePanRotate, WebInspector.UIString("Temporarily toggle pan/rotate mode wh
ile held")); |
| 299 section.addAlternateKeys(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.ZoomIn, WebInspector.UIString("Zoom in")); | 299 section.addAlternateKeys(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.ZoomIn, WebInspector.UIString("Zoom in")); |
| 300 section.addAlternateKeys(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.ZoomOut, WebInspector.UIString("Zoom out")); | 300 section.addAlternateKeys(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.ZoomOut, WebInspector.UIString("Zoom out")); |
| 301 section.addRelatedKeys(WebInspector.ShortcutsScreen.LayersPanelShortcuts
.Up.concat(WebInspector.ShortcutsScreen.LayersPanelShortcuts.Down), WebInspector
.UIString("Pan or rotate up/down")); | 301 section.addRelatedKeys(WebInspector.ShortcutsScreen.LayersPanelShortcuts
.Up.concat(WebInspector.ShortcutsScreen.LayersPanelShortcuts.Down), WebInspector
.UIString("Pan or rotate up/down")); |
| 302 section.addRelatedKeys(WebInspector.ShortcutsScreen.LayersPanelShortcuts
.Left.concat(WebInspector.ShortcutsScreen.LayersPanelShortcuts.Right), WebInspec
tor.UIString("Pan or rotate left/right")); | 302 section.addRelatedKeys(WebInspector.ShortcutsScreen.LayersPanelShortcuts
.Left.concat(WebInspector.ShortcutsScreen.LayersPanelShortcuts.Right), WebInspec
tor.UIString("Pan or rotate left/right")); |
| 303 } | 303 } |
| 304 } | 304 }; |
| 305 | 305 |
| 306 WebInspector.ShortcutsScreen.ElementsPanelShortcuts = { | 306 WebInspector.ShortcutsScreen.ElementsPanelShortcuts = { |
| 307 NavigateUp: [ | 307 NavigateUp: [ |
| 308 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Up) | 308 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Up) |
| 309 ], | 309 ], |
| 310 | 310 |
| 311 NavigateDown: [ | 311 NavigateDown: [ |
| 312 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Down) | 312 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Down) |
| 313 ], | 313 ], |
| 314 | 314 |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 | 499 |
| 500 Left: [ | 500 Left: [ |
| 501 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Left), | 501 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Left), |
| 502 WebInspector.KeyboardShortcut.makeDescriptor("a") | 502 WebInspector.KeyboardShortcut.makeDescriptor("a") |
| 503 ], | 503 ], |
| 504 | 504 |
| 505 Right: [ | 505 Right: [ |
| 506 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Right), | 506 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Right), |
| 507 WebInspector.KeyboardShortcut.makeDescriptor("d") | 507 WebInspector.KeyboardShortcut.makeDescriptor("d") |
| 508 ] | 508 ] |
| 509 } | 509 }; |
| OLD | NEW |