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 |
11 * copyright notice, this list of conditions and the following disclaimer | 11 * copyright notice, this list of conditions and the following disclaimer |
12 * in the documentation and/or other materials provided with the | 12 * in the documentation and/or other materials provided with the |
13 * distribution. | 13 * distribution. |
14 * * Neither the name of Google Inc. nor the names of its | 14 * * Neither the name of Google Inc. nor the names of its |
15 * contributors may be used to endorse or promote products derived from | 15 * contributors may be used to endorse or promote products derived from |
16 * this software without specific prior written permission. | 16 * this software without specific prior written permission. |
17 * | 17 * |
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | 19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
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 | |
31 /** | 30 /** |
32 * @constructor | 31 * @unrestricted |
33 */ | 32 */ |
34 WebInspector.ShortcutsScreen = function() | 33 WebInspector.ShortcutsScreen = class { |
35 { | 34 constructor() { |
36 /** @type {!Object.<string, !WebInspector.ShortcutsSection>} */ | 35 /** @type {!Object.<string, !WebInspector.ShortcutsSection>} */ |
37 this._sections = {}; | 36 this._sections = {}; |
| 37 } |
| 38 |
| 39 static registerShortcuts() { |
| 40 // Elements panel |
| 41 var elementsSection = WebInspector.shortcutsScreen.section(WebInspector.UISt
ring('Elements Panel')); |
| 42 |
| 43 var navigate = WebInspector.ShortcutsScreen.ElementsPanelShortcuts.NavigateU
p.concat( |
| 44 WebInspector.ShortcutsScreen.ElementsPanelShortcuts.NavigateDown); |
| 45 elementsSection.addRelatedKeys(navigate, WebInspector.UIString('Navigate ele
ments')); |
| 46 |
| 47 var expandCollapse = WebInspector.ShortcutsScreen.ElementsPanelShortcuts.Exp
and.concat( |
| 48 WebInspector.ShortcutsScreen.ElementsPanelShortcuts.Collapse); |
| 49 elementsSection.addRelatedKeys(expandCollapse, WebInspector.UIString('Expand
/collapse')); |
| 50 |
| 51 elementsSection.addAlternateKeys( |
| 52 WebInspector.ShortcutsScreen.ElementsPanelShortcuts.EditAttribute, WebIn
spector.UIString('Edit attribute')); |
| 53 elementsSection.addAlternateKeys( |
| 54 WebInspector.ShortcutsScreen.ElementsPanelShortcuts.HideElement, WebInsp
ector.UIString('Hide element')); |
| 55 elementsSection.addAlternateKeys( |
| 56 WebInspector.ShortcutsScreen.ElementsPanelShortcuts.ToggleEditAsHTML, |
| 57 WebInspector.UIString('Toggle edit as HTML')); |
| 58 |
| 59 var stylesPaneSection = WebInspector.shortcutsScreen.section(WebInspector.UI
String('Styles Pane')); |
| 60 |
| 61 var nextPreviousProperty = WebInspector.ShortcutsScreen.ElementsPanelShortcu
ts.NextProperty.concat( |
| 62 WebInspector.ShortcutsScreen.ElementsPanelShortcuts.PreviousProperty); |
| 63 stylesPaneSection.addRelatedKeys(nextPreviousProperty, WebInspector.UIString
('Next/previous property')); |
| 64 |
| 65 stylesPaneSection.addRelatedKeys( |
| 66 WebInspector.ShortcutsScreen.ElementsPanelShortcuts.IncrementValue, WebI
nspector.UIString('Increment value')); |
| 67 stylesPaneSection.addRelatedKeys( |
| 68 WebInspector.ShortcutsScreen.ElementsPanelShortcuts.DecrementValue, WebI
nspector.UIString('Decrement value')); |
| 69 |
| 70 stylesPaneSection.addAlternateKeys( |
| 71 WebInspector.ShortcutsScreen.ElementsPanelShortcuts.IncrementBy10, |
| 72 WebInspector.UIString('Increment by %f', 10)); |
| 73 stylesPaneSection.addAlternateKeys( |
| 74 WebInspector.ShortcutsScreen.ElementsPanelShortcuts.DecrementBy10, |
| 75 WebInspector.UIString('Decrement by %f', 10)); |
| 76 |
| 77 stylesPaneSection.addAlternateKeys( |
| 78 WebInspector.ShortcutsScreen.ElementsPanelShortcuts.IncrementBy100, |
| 79 WebInspector.UIString('Increment by %f', 100)); |
| 80 stylesPaneSection.addAlternateKeys( |
| 81 WebInspector.ShortcutsScreen.ElementsPanelShortcuts.DecrementBy100, |
| 82 WebInspector.UIString('Decrement by %f', 100)); |
| 83 |
| 84 stylesPaneSection.addAlternateKeys( |
| 85 WebInspector.ShortcutsScreen.ElementsPanelShortcuts.IncrementBy01, |
| 86 WebInspector.UIString('Increment by %f', 0.1)); |
| 87 stylesPaneSection.addAlternateKeys( |
| 88 WebInspector.ShortcutsScreen.ElementsPanelShortcuts.DecrementBy01, |
| 89 WebInspector.UIString('Decrement by %f', 0.1)); |
| 90 |
| 91 // Debugger |
| 92 var section = WebInspector.shortcutsScreen.section(WebInspector.UIString('De
bugger')); |
| 93 |
| 94 section.addAlternateKeys( |
| 95 WebInspector.shortcutRegistry.shortcutDescriptorsForAction('debugger.tog
gle-pause'), |
| 96 WebInspector.UIString('Pause/ Continue')); |
| 97 section.addAlternateKeys( |
| 98 WebInspector.shortcutRegistry.shortcutDescriptorsForAction('debugger.ste
p-over'), |
| 99 WebInspector.UIString('Step over')); |
| 100 section.addAlternateKeys( |
| 101 WebInspector.shortcutRegistry.shortcutDescriptorsForAction('debugger.ste
p-into'), |
| 102 WebInspector.UIString('Step into')); |
| 103 section.addAlternateKeys( |
| 104 WebInspector.shortcutRegistry.shortcutDescriptorsForAction('debugger.ste
p-out'), |
| 105 WebInspector.UIString('Step out')); |
| 106 |
| 107 var nextAndPrevFrameKeys = WebInspector.ShortcutsScreen.SourcesPanelShortcut
s.NextCallFrame.concat( |
| 108 WebInspector.ShortcutsScreen.SourcesPanelShortcuts.PrevCallFrame); |
| 109 section.addRelatedKeys(nextAndPrevFrameKeys, WebInspector.UIString('Next/pre
vious call frame')); |
| 110 |
| 111 section.addAlternateKeys( |
| 112 WebInspector.ShortcutsScreen.SourcesPanelShortcuts.EvaluateSelectionInCo
nsole, |
| 113 WebInspector.UIString('Evaluate selection in console')); |
| 114 section.addAlternateKeys( |
| 115 WebInspector.ShortcutsScreen.SourcesPanelShortcuts.AddSelectionToWatch, |
| 116 WebInspector.UIString('Add selection to watch')); |
| 117 section.addAlternateKeys( |
| 118 WebInspector.ShortcutsScreen.SourcesPanelShortcuts.ToggleBreakpoint, |
| 119 WebInspector.UIString('Toggle breakpoint')); |
| 120 section.addAlternateKeys( |
| 121 WebInspector.shortcutRegistry.shortcutDescriptorsForAction('debugger.tog
gle-breakpoints-active'), |
| 122 WebInspector.UIString('Toggle all breakpoints')); |
| 123 |
| 124 // Editing |
| 125 section = WebInspector.shortcutsScreen.section(WebInspector.UIString('Text E
ditor')); |
| 126 section.addAlternateKeys( |
| 127 WebInspector.ShortcutsScreen.SourcesPanelShortcuts.GoToMember, WebInspec
tor.UIString('Go to member')); |
| 128 section.addAlternateKeys( |
| 129 WebInspector.ShortcutsScreen.SourcesPanelShortcuts.ToggleAutocompletion, |
| 130 WebInspector.UIString('Autocompletion')); |
| 131 section.addAlternateKeys( |
| 132 WebInspector.ShortcutsScreen.SourcesPanelShortcuts.GoToLine, WebInspecto
r.UIString('Go to line')); |
| 133 section.addAlternateKeys( |
| 134 WebInspector.ShortcutsScreen.SourcesPanelShortcuts.JumpToPreviousLocatio
n, |
| 135 WebInspector.UIString('Jump to previous editing location')); |
| 136 section.addAlternateKeys( |
| 137 WebInspector.ShortcutsScreen.SourcesPanelShortcuts.JumpToNextLocation, |
| 138 WebInspector.UIString('Jump to next editing location')); |
| 139 section.addAlternateKeys( |
| 140 WebInspector.ShortcutsScreen.SourcesPanelShortcuts.ToggleComment, WebIns
pector.UIString('Toggle comment')); |
| 141 section.addAlternateKeys( |
| 142 WebInspector.ShortcutsScreen.SourcesPanelShortcuts.IncreaseCSSUnitByOne, |
| 143 WebInspector.UIString('Increment CSS unit by 1')); |
| 144 section.addAlternateKeys( |
| 145 WebInspector.ShortcutsScreen.SourcesPanelShortcuts.DecreaseCSSUnitByOne, |
| 146 WebInspector.UIString('Decrement CSS unit by 1')); |
| 147 section.addAlternateKeys( |
| 148 WebInspector.ShortcutsScreen.SourcesPanelShortcuts.IncreaseCSSUnitByTen, |
| 149 WebInspector.UIString('Increment CSS unit by 10')); |
| 150 section.addAlternateKeys( |
| 151 WebInspector.ShortcutsScreen.SourcesPanelShortcuts.DecreaseCSSUnitByTen, |
| 152 WebInspector.UIString('Decrement CSS unit by 10')); |
| 153 section.addAlternateKeys( |
| 154 WebInspector.ShortcutsScreen.SourcesPanelShortcuts.SelectNextOccurrence, |
| 155 WebInspector.UIString('Select next occurrence')); |
| 156 section.addAlternateKeys( |
| 157 WebInspector.ShortcutsScreen.SourcesPanelShortcuts.SoftUndo, WebInspecto
r.UIString('Soft undo')); |
| 158 section.addAlternateKeys( |
| 159 WebInspector.ShortcutsScreen.SourcesPanelShortcuts.GotoMatchingBracket, |
| 160 WebInspector.UIString('Go to matching bracket')); |
| 161 section.addAlternateKeys( |
| 162 WebInspector.ShortcutsScreen.SourcesPanelShortcuts.CloseEditorTab, WebIn
spector.UIString('Close editor tab')); |
| 163 section.addAlternateKeys( |
| 164 WebInspector.shortcutRegistry.shortcutDescriptorsForAction('sources.swit
ch-file'), |
| 165 WebInspector.UIString('Switch between files with the same name and diffe
rent extensions.')); |
| 166 |
| 167 // Timeline panel |
| 168 section = WebInspector.shortcutsScreen.section(WebInspector.UIString('Timeli
ne Panel')); |
| 169 section.addAlternateKeys( |
| 170 WebInspector.shortcutRegistry.shortcutDescriptorsForAction('timeline.tog
gle-recording'), |
| 171 WebInspector.UIString('Start/stop recording')); |
| 172 section.addAlternateKeys( |
| 173 WebInspector.shortcutRegistry.shortcutDescriptorsForAction('main.reload'
), |
| 174 WebInspector.UIString('Record page reload')); |
| 175 section.addAlternateKeys( |
| 176 WebInspector.shortcutRegistry.shortcutDescriptorsForAction('timeline.sav
e-to-file'), |
| 177 WebInspector.UIString('Save timeline data')); |
| 178 section.addAlternateKeys( |
| 179 WebInspector.shortcutRegistry.shortcutDescriptorsForAction('timeline.loa
d-from-file'), |
| 180 WebInspector.UIString('Load timeline data')); |
| 181 section.addRelatedKeys( |
| 182 WebInspector.shortcutRegistry.shortcutDescriptorsForAction('timeline.jum
p-to-previous-frame') |
| 183 .concat(WebInspector.shortcutRegistry.shortcutDescriptorsForAction('
timeline.jump-to-next-frame')), |
| 184 WebInspector.UIString('Jump to previous/next frame')); |
| 185 |
| 186 // Profiles panel |
| 187 section = WebInspector.shortcutsScreen.section(WebInspector.UIString('Profil
es Panel')); |
| 188 section.addAlternateKeys( |
| 189 WebInspector.shortcutRegistry.shortcutDescriptorsForAction('profiler.tog
gle-recording'), |
| 190 WebInspector.UIString('Start/stop recording')); |
| 191 |
| 192 // Layers panel |
| 193 if (Runtime.experiments.isEnabled('layersPanel')) { |
| 194 section = WebInspector.shortcutsScreen.section(WebInspector.UIString('Laye
rs Panel')); |
| 195 section.addAlternateKeys( |
| 196 WebInspector.ShortcutsScreen.LayersPanelShortcuts.ResetView, WebInspec
tor.UIString('Reset view')); |
| 197 section.addAlternateKeys( |
| 198 WebInspector.ShortcutsScreen.LayersPanelShortcuts.PanMode, WebInspecto
r.UIString('Switch to pan mode')); |
| 199 section.addAlternateKeys( |
| 200 WebInspector.ShortcutsScreen.LayersPanelShortcuts.RotateMode, WebInspe
ctor.UIString('Switch to rotate mode')); |
| 201 section.addAlternateKeys( |
| 202 WebInspector.ShortcutsScreen.LayersPanelShortcuts.TogglePanRotate, |
| 203 WebInspector.UIString('Temporarily toggle pan/rotate mode while held')
); |
| 204 section.addAlternateKeys( |
| 205 WebInspector.ShortcutsScreen.LayersPanelShortcuts.ZoomIn, WebInspector
.UIString('Zoom in')); |
| 206 section.addAlternateKeys( |
| 207 WebInspector.ShortcutsScreen.LayersPanelShortcuts.ZoomOut, WebInspecto
r.UIString('Zoom out')); |
| 208 section.addRelatedKeys( |
| 209 WebInspector.ShortcutsScreen.LayersPanelShortcuts.Up.concat( |
| 210 WebInspector.ShortcutsScreen.LayersPanelShortcuts.Down), |
| 211 WebInspector.UIString('Pan or rotate up/down')); |
| 212 section.addRelatedKeys( |
| 213 WebInspector.ShortcutsScreen.LayersPanelShortcuts.Left.concat( |
| 214 WebInspector.ShortcutsScreen.LayersPanelShortcuts.Right), |
| 215 WebInspector.UIString('Pan or rotate left/right')); |
| 216 } |
| 217 } |
| 218 |
| 219 /** |
| 220 * @param {string} name |
| 221 * @return {!WebInspector.ShortcutsSection} |
| 222 */ |
| 223 section(name) { |
| 224 var section = this._sections[name]; |
| 225 if (!section) |
| 226 this._sections[name] = section = new WebInspector.ShortcutsSection(name); |
| 227 return section; |
| 228 } |
| 229 |
| 230 /** |
| 231 * @return {!WebInspector.Widget} |
| 232 */ |
| 233 createShortcutsTabView() { |
| 234 var orderedSections = []; |
| 235 for (var section in this._sections) |
| 236 orderedSections.push(this._sections[section]); |
| 237 function compareSections(a, b) { |
| 238 return a.order - b.order; |
| 239 } |
| 240 orderedSections.sort(compareSections); |
| 241 |
| 242 var widget = new WebInspector.Widget(); |
| 243 |
| 244 widget.element.className = 'settings-tab-container'; // Override |
| 245 widget.element.createChild('header').createChild('h3').createTextChild(WebIn
spector.UIString('Shortcuts')); |
| 246 var scrollPane = widget.element.createChild('div', 'help-container-wrapper')
; |
| 247 var container = scrollPane.createChild('div'); |
| 248 container.className = 'help-content help-container'; |
| 249 for (var i = 0; i < orderedSections.length; ++i) |
| 250 orderedSections[i].renderSection(container); |
| 251 |
| 252 var note = scrollPane.createChild('p', 'help-footnote'); |
| 253 note.appendChild(WebInspector.linkifyDocumentationURLAsNode( |
| 254 'iterate/inspect-styles/shortcuts', |
| 255 WebInspector.UIString('Full list of DevTools keyboard shortcuts and gest
ures'))); |
| 256 |
| 257 return widget; |
| 258 } |
38 }; | 259 }; |
39 | 260 |
40 WebInspector.ShortcutsScreen.prototype = { | |
41 /** | |
42 * @param {string} name | |
43 * @return {!WebInspector.ShortcutsSection} | |
44 */ | |
45 section: function(name) | |
46 { | |
47 var section = this._sections[name]; | |
48 if (!section) | |
49 this._sections[name] = section = new WebInspector.ShortcutsSection(n
ame); | |
50 return section; | |
51 }, | |
52 | |
53 /** | |
54 * @return {!WebInspector.Widget} | |
55 */ | |
56 createShortcutsTabView: function() | |
57 { | |
58 var orderedSections = []; | |
59 for (var section in this._sections) | |
60 orderedSections.push(this._sections[section]); | |
61 function compareSections(a, b) | |
62 { | |
63 return a.order - b.order; | |
64 } | |
65 orderedSections.sort(compareSections); | |
66 | |
67 var widget = new WebInspector.Widget(); | |
68 | |
69 widget.element.className = "settings-tab-container"; // Override | |
70 widget.element.createChild("header").createChild("h3").createTextChild(W
ebInspector.UIString("Shortcuts")); | |
71 var scrollPane = widget.element.createChild("div", "help-container-wrapp
er"); | |
72 var container = scrollPane.createChild("div"); | |
73 container.className = "help-content help-container"; | |
74 for (var i = 0; i < orderedSections.length; ++i) | |
75 orderedSections[i].renderSection(container); | |
76 | |
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"))); | |
79 | |
80 return widget; | |
81 } | |
82 }; | |
83 | |
84 /** | 261 /** |
85 * We cannot initialize it here as localized strings are not loaded yet. | 262 * We cannot initialize it here as localized strings are not loaded yet. |
86 * @type {!WebInspector.ShortcutsScreen} | 263 * @type {!WebInspector.ShortcutsScreen} |
87 */ | 264 */ |
88 WebInspector.shortcutsScreen; | 265 WebInspector.shortcutsScreen; |
89 | 266 |
90 /** | 267 /** |
91 * @constructor | 268 * @unrestricted |
92 * @param {string} name | |
93 */ | 269 */ |
94 WebInspector.ShortcutsSection = function(name) | 270 WebInspector.ShortcutsSection = class { |
95 { | 271 /** |
| 272 * @param {string} name |
| 273 */ |
| 274 constructor(name) { |
96 this.name = name; | 275 this.name = name; |
97 this._lines = /** @type {!Array.<!{key: !Node, text: string}>} */ ([]); | 276 this._lines = /** @type {!Array.<!{key: !Node, text: string}>} */ ([]); |
98 this.order = ++WebInspector.ShortcutsSection._sequenceNumber; | 277 this.order = ++WebInspector.ShortcutsSection._sequenceNumber; |
| 278 } |
| 279 |
| 280 /** |
| 281 * @param {!WebInspector.KeyboardShortcut.Descriptor} key |
| 282 * @param {string} description |
| 283 */ |
| 284 addKey(key, description) { |
| 285 this._addLine(this._renderKey(key), description); |
| 286 } |
| 287 |
| 288 /** |
| 289 * @param {!Array.<!WebInspector.KeyboardShortcut.Descriptor>} keys |
| 290 * @param {string} description |
| 291 */ |
| 292 addRelatedKeys(keys, description) { |
| 293 this._addLine(this._renderSequence(keys, '/'), description); |
| 294 } |
| 295 |
| 296 /** |
| 297 * @param {!Array.<!WebInspector.KeyboardShortcut.Descriptor>} keys |
| 298 * @param {string} description |
| 299 */ |
| 300 addAlternateKeys(keys, description) { |
| 301 this._addLine(this._renderSequence(keys, WebInspector.UIString('or')), descr
iption); |
| 302 } |
| 303 |
| 304 /** |
| 305 * @param {!Node} keyElement |
| 306 * @param {string} description |
| 307 */ |
| 308 _addLine(keyElement, description) { |
| 309 this._lines.push({key: keyElement, text: description}); |
| 310 } |
| 311 |
| 312 /** |
| 313 * @param {!Element} container |
| 314 */ |
| 315 renderSection(container) { |
| 316 var parent = container.createChild('div', 'help-block'); |
| 317 |
| 318 var headLine = parent.createChild('div', 'help-line'); |
| 319 headLine.createChild('div', 'help-key-cell'); |
| 320 headLine.createChild('div', 'help-section-title help-cell').textContent = th
is.name; |
| 321 |
| 322 for (var i = 0; i < this._lines.length; ++i) { |
| 323 var line = parent.createChild('div', 'help-line'); |
| 324 var keyCell = line.createChild('div', 'help-key-cell'); |
| 325 keyCell.appendChild(this._lines[i].key); |
| 326 keyCell.appendChild(this._createSpan('help-key-delimiter', ':')); |
| 327 line.createChild('div', 'help-cell').textContent = this._lines[i].text; |
| 328 } |
| 329 } |
| 330 |
| 331 /** |
| 332 * @param {!Array.<!WebInspector.KeyboardShortcut.Descriptor>} sequence |
| 333 * @param {string} delimiter |
| 334 * @return {!Node} |
| 335 */ |
| 336 _renderSequence(sequence, delimiter) { |
| 337 var delimiterSpan = this._createSpan('help-key-delimiter', delimiter); |
| 338 return this._joinNodes(sequence.map(this._renderKey.bind(this)), delimiterSp
an); |
| 339 } |
| 340 |
| 341 /** |
| 342 * @param {!WebInspector.KeyboardShortcut.Descriptor} key |
| 343 * @return {!Node} |
| 344 */ |
| 345 _renderKey(key) { |
| 346 var keyName = key.name; |
| 347 var plus = this._createSpan('help-combine-keys', '+'); |
| 348 return this._joinNodes(keyName.split(' + ').map(this._createSpan.bind(this,
'help-key')), plus); |
| 349 } |
| 350 |
| 351 /** |
| 352 * @param {string} className |
| 353 * @param {string} textContent |
| 354 * @return {!Element} |
| 355 */ |
| 356 _createSpan(className, textContent) { |
| 357 var node = createElement('span'); |
| 358 node.className = className; |
| 359 node.textContent = textContent; |
| 360 return node; |
| 361 } |
| 362 |
| 363 /** |
| 364 * @param {!Array.<!Element>} nodes |
| 365 * @param {!Element} delimiter |
| 366 * @return {!Node} |
| 367 */ |
| 368 _joinNodes(nodes, delimiter) { |
| 369 var result = createDocumentFragment(); |
| 370 for (var i = 0; i < nodes.length; ++i) { |
| 371 if (i > 0) |
| 372 result.appendChild(delimiter.cloneNode(true)); |
| 373 result.appendChild(nodes[i]); |
| 374 } |
| 375 return result; |
| 376 } |
99 }; | 377 }; |
100 | 378 |
101 WebInspector.ShortcutsSection._sequenceNumber = 0; | 379 WebInspector.ShortcutsSection._sequenceNumber = 0; |
102 | 380 |
103 WebInspector.ShortcutsSection.prototype = { | |
104 /** | |
105 * @param {!WebInspector.KeyboardShortcut.Descriptor} key | |
106 * @param {string} description | |
107 */ | |
108 addKey: function(key, description) | |
109 { | |
110 this._addLine(this._renderKey(key), description); | |
111 }, | |
112 | |
113 /** | |
114 * @param {!Array.<!WebInspector.KeyboardShortcut.Descriptor>} keys | |
115 * @param {string} description | |
116 */ | |
117 addRelatedKeys: function(keys, description) | |
118 { | |
119 this._addLine(this._renderSequence(keys, "/"), description); | |
120 }, | |
121 | |
122 /** | |
123 * @param {!Array.<!WebInspector.KeyboardShortcut.Descriptor>} keys | |
124 * @param {string} description | |
125 */ | |
126 addAlternateKeys: function(keys, description) | |
127 { | |
128 this._addLine(this._renderSequence(keys, WebInspector.UIString("or")), d
escription); | |
129 }, | |
130 | |
131 /** | |
132 * @param {!Node} keyElement | |
133 * @param {string} description | |
134 */ | |
135 _addLine: function(keyElement, description) | |
136 { | |
137 this._lines.push({ key: keyElement, text: description }); | |
138 }, | |
139 | |
140 /** | |
141 * @param {!Element} container | |
142 */ | |
143 renderSection: function(container) | |
144 { | |
145 var parent = container.createChild("div", "help-block"); | |
146 | |
147 var headLine = parent.createChild("div", "help-line"); | |
148 headLine.createChild("div", "help-key-cell"); | |
149 headLine.createChild("div", "help-section-title help-cell").textContent
= this.name; | |
150 | |
151 for (var i = 0; i < this._lines.length; ++i) { | |
152 var line = parent.createChild("div", "help-line"); | |
153 var keyCell = line.createChild("div", "help-key-cell"); | |
154 keyCell.appendChild(this._lines[i].key); | |
155 keyCell.appendChild(this._createSpan("help-key-delimiter", ":")); | |
156 line.createChild("div", "help-cell").textContent = this._lines[i].te
xt; | |
157 } | |
158 }, | |
159 | |
160 /** | |
161 * @param {!Array.<!WebInspector.KeyboardShortcut.Descriptor>} sequence | |
162 * @param {string} delimiter | |
163 * @return {!Node} | |
164 */ | |
165 _renderSequence: function(sequence, delimiter) | |
166 { | |
167 var delimiterSpan = this._createSpan("help-key-delimiter", delimiter); | |
168 return this._joinNodes(sequence.map(this._renderKey.bind(this)), delimit
erSpan); | |
169 }, | |
170 | |
171 /** | |
172 * @param {!WebInspector.KeyboardShortcut.Descriptor} key | |
173 * @return {!Node} | |
174 */ | |
175 _renderKey: function(key) | |
176 { | |
177 var keyName = key.name; | |
178 var plus = this._createSpan("help-combine-keys", "+"); | |
179 return this._joinNodes(keyName.split(" + ").map(this._createSpan.bind(th
is, "help-key")), plus); | |
180 }, | |
181 | |
182 /** | |
183 * @param {string} className | |
184 * @param {string} textContent | |
185 * @return {!Element} | |
186 */ | |
187 _createSpan: function(className, textContent) | |
188 { | |
189 var node = createElement("span"); | |
190 node.className = className; | |
191 node.textContent = textContent; | |
192 return node; | |
193 }, | |
194 | |
195 /** | |
196 * @param {!Array.<!Element>} nodes | |
197 * @param {!Element} delimiter | |
198 * @return {!Node} | |
199 */ | |
200 _joinNodes: function(nodes, delimiter) | |
201 { | |
202 var result = createDocumentFragment(); | |
203 for (var i = 0; i < nodes.length; ++i) { | |
204 if (i > 0) | |
205 result.appendChild(delimiter.cloneNode(true)); | |
206 result.appendChild(nodes[i]); | |
207 } | |
208 return result; | |
209 } | |
210 }; | |
211 | |
212 WebInspector.ShortcutsScreen.registerShortcuts = function() | |
213 { | |
214 // Elements panel | |
215 var elementsSection = WebInspector.shortcutsScreen.section(WebInspector.UISt
ring("Elements Panel")); | |
216 | |
217 var navigate = WebInspector.ShortcutsScreen.ElementsPanelShortcuts.NavigateU
p.concat(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.NavigateDown); | |
218 elementsSection.addRelatedKeys(navigate, WebInspector.UIString("Navigate ele
ments")); | |
219 | |
220 var expandCollapse = WebInspector.ShortcutsScreen.ElementsPanelShortcuts.Exp
and.concat(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.Collapse); | |
221 elementsSection.addRelatedKeys(expandCollapse, WebInspector.UIString("Expand
/collapse")); | |
222 | |
223 elementsSection.addAlternateKeys(WebInspector.ShortcutsScreen.ElementsPanelS
hortcuts.EditAttribute, WebInspector.UIString("Edit attribute")); | |
224 elementsSection.addAlternateKeys(WebInspector.ShortcutsScreen.ElementsPanelS
hortcuts.HideElement, WebInspector.UIString("Hide element")); | |
225 elementsSection.addAlternateKeys(WebInspector.ShortcutsScreen.ElementsPanelS
hortcuts.ToggleEditAsHTML, WebInspector.UIString("Toggle edit as HTML")); | |
226 | |
227 var stylesPaneSection = WebInspector.shortcutsScreen.section(WebInspector.UI
String("Styles Pane")); | |
228 | |
229 var nextPreviousProperty = WebInspector.ShortcutsScreen.ElementsPanelShortcu
ts.NextProperty.concat(WebInspector.ShortcutsScreen.ElementsPanelShortcuts.Previ
ousProperty); | |
230 stylesPaneSection.addRelatedKeys(nextPreviousProperty, WebInspector.UIString
("Next/previous property")); | |
231 | |
232 stylesPaneSection.addRelatedKeys(WebInspector.ShortcutsScreen.ElementsPanelS
hortcuts.IncrementValue, WebInspector.UIString("Increment value")); | |
233 stylesPaneSection.addRelatedKeys(WebInspector.ShortcutsScreen.ElementsPanelS
hortcuts.DecrementValue, WebInspector.UIString("Decrement value")); | |
234 | |
235 stylesPaneSection.addAlternateKeys(WebInspector.ShortcutsScreen.ElementsPane
lShortcuts.IncrementBy10, WebInspector.UIString("Increment by %f", 10)); | |
236 stylesPaneSection.addAlternateKeys(WebInspector.ShortcutsScreen.ElementsPane
lShortcuts.DecrementBy10, WebInspector.UIString("Decrement by %f", 10)); | |
237 | |
238 stylesPaneSection.addAlternateKeys(WebInspector.ShortcutsScreen.ElementsPane
lShortcuts.IncrementBy100, WebInspector.UIString("Increment by %f", 100)); | |
239 stylesPaneSection.addAlternateKeys(WebInspector.ShortcutsScreen.ElementsPane
lShortcuts.DecrementBy100, WebInspector.UIString("Decrement by %f", 100)); | |
240 | |
241 stylesPaneSection.addAlternateKeys(WebInspector.ShortcutsScreen.ElementsPane
lShortcuts.IncrementBy01, WebInspector.UIString("Increment by %f", 0.1)); | |
242 stylesPaneSection.addAlternateKeys(WebInspector.ShortcutsScreen.ElementsPane
lShortcuts.DecrementBy01, WebInspector.UIString("Decrement by %f", 0.1)); | |
243 | |
244 | |
245 // Debugger | |
246 var section = WebInspector.shortcutsScreen.section(WebInspector.UIString("De
bugger")); | |
247 | |
248 section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsFo
rAction("debugger.toggle-pause"), WebInspector.UIString("Pause/ Continue")); | |
249 section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsFo
rAction("debugger.step-over"), WebInspector.UIString("Step over")); | |
250 section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsFo
rAction("debugger.step-into"), WebInspector.UIString("Step into")); | |
251 section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsFo
rAction("debugger.step-out"), WebInspector.UIString("Step out")); | |
252 | |
253 var nextAndPrevFrameKeys = WebInspector.ShortcutsScreen.SourcesPanelShortcut
s.NextCallFrame.concat(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.PrevCa
llFrame); | |
254 section.addRelatedKeys(nextAndPrevFrameKeys, WebInspector.UIString("Next/pre
vious call frame")); | |
255 | |
256 section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.
EvaluateSelectionInConsole, WebInspector.UIString("Evaluate selection in console
")); | |
257 section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.
AddSelectionToWatch, WebInspector.UIString("Add selection to watch")); | |
258 section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.
ToggleBreakpoint, WebInspector.UIString("Toggle breakpoint")); | |
259 section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsFo
rAction("debugger.toggle-breakpoints-active"), WebInspector.UIString("Toggle all
breakpoints")); | |
260 | |
261 // Editing | |
262 section = WebInspector.shortcutsScreen.section(WebInspector.UIString("Text E
ditor")); | |
263 section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.
GoToMember, WebInspector.UIString("Go to member")); | |
264 section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.
ToggleAutocompletion, WebInspector.UIString("Autocompletion")); | |
265 section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.
GoToLine, WebInspector.UIString("Go to line")); | |
266 section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.
JumpToPreviousLocation, WebInspector.UIString("Jump to previous editing location
")); | |
267 section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.
JumpToNextLocation, WebInspector.UIString("Jump to next editing location")); | |
268 section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.
ToggleComment, WebInspector.UIString("Toggle comment")); | |
269 section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.
IncreaseCSSUnitByOne, WebInspector.UIString("Increment CSS unit by 1")); | |
270 section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.
DecreaseCSSUnitByOne, WebInspector.UIString("Decrement CSS unit by 1")); | |
271 section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.
IncreaseCSSUnitByTen, WebInspector.UIString("Increment CSS unit by 10")); | |
272 section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.
DecreaseCSSUnitByTen, WebInspector.UIString("Decrement CSS unit by 10")); | |
273 section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.
SelectNextOccurrence, WebInspector.UIString("Select next occurrence")); | |
274 section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.
SoftUndo, WebInspector.UIString("Soft undo")); | |
275 section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.
GotoMatchingBracket, WebInspector.UIString("Go to matching bracket")); | |
276 section.addAlternateKeys(WebInspector.ShortcutsScreen.SourcesPanelShortcuts.
CloseEditorTab, WebInspector.UIString("Close editor tab")); | |
277 section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsFo
rAction("sources.switch-file"), WebInspector.UIString("Switch between files with
the same name and different extensions.")); | |
278 | |
279 // Timeline panel | |
280 section = WebInspector.shortcutsScreen.section(WebInspector.UIString("Timeli
ne Panel")); | |
281 section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsFo
rAction("timeline.toggle-recording"), WebInspector.UIString("Start/stop recordin
g")); | |
282 section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsFo
rAction("main.reload"), WebInspector.UIString("Record page reload")); | |
283 section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsFo
rAction("timeline.save-to-file"), WebInspector.UIString("Save timeline data")); | |
284 section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsFo
rAction("timeline.load-from-file"), WebInspector.UIString("Load timeline data"))
; | |
285 section.addRelatedKeys(WebInspector.shortcutRegistry.shortcutDescriptorsForA
ction("timeline.jump-to-previous-frame").concat(WebInspector.shortcutRegistry.sh
ortcutDescriptorsForAction("timeline.jump-to-next-frame")), WebInspector.UIStrin
g("Jump to previous/next frame")); | |
286 | |
287 | |
288 // Profiles panel | |
289 section = WebInspector.shortcutsScreen.section(WebInspector.UIString("Profil
es Panel")); | |
290 section.addAlternateKeys(WebInspector.shortcutRegistry.shortcutDescriptorsFo
rAction("profiler.toggle-recording"), WebInspector.UIString("Start/stop recordin
g")); | |
291 | |
292 // Layers panel | |
293 if (Runtime.experiments.isEnabled("layersPanel")) { | |
294 section = WebInspector.shortcutsScreen.section(WebInspector.UIString("La
yers Panel")); | |
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")); | |
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")); | |
299 section.addAlternateKeys(WebInspector.ShortcutsScreen.LayersPanelShortcu
ts.ZoomIn, WebInspector.UIString("Zoom in")); | |
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")); | |
302 section.addRelatedKeys(WebInspector.ShortcutsScreen.LayersPanelShortcuts
.Left.concat(WebInspector.ShortcutsScreen.LayersPanelShortcuts.Right), WebInspec
tor.UIString("Pan or rotate left/right")); | |
303 } | |
304 }; | |
305 | 381 |
306 WebInspector.ShortcutsScreen.ElementsPanelShortcuts = { | 382 WebInspector.ShortcutsScreen.ElementsPanelShortcuts = { |
307 NavigateUp: [ | 383 NavigateUp: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.Keyboar
dShortcut.Keys.Up)], |
308 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Up) | 384 |
309 ], | 385 NavigateDown: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.Keybo
ardShortcut.Keys.Down)], |
310 | 386 |
311 NavigateDown: [ | 387 Expand: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardSho
rtcut.Keys.Right)], |
312 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Down) | 388 |
313 ], | 389 Collapse: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardS
hortcut.Keys.Left)], |
314 | 390 |
315 Expand: [ | 391 EditAttribute: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.Keyb
oardShortcut.Keys.Enter)], |
316 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Right) | 392 |
317 ], | 393 HideElement: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.Keyboa
rdShortcut.Keys.H)], |
318 | 394 |
319 Collapse: [ | 395 ToggleEditAsHTML: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.K
eyboardShortcut.Keys.F2)], |
320 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Left) | 396 |
321 ], | 397 NextProperty: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.Keybo
ardShortcut.Keys.Tab)], |
322 | 398 |
323 EditAttribute: [ | 399 PreviousProperty: [WebInspector.KeyboardShortcut.makeDescriptor( |
324 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Enter) | 400 WebInspector.KeyboardShortcut.Keys.Tab, WebInspector.KeyboardShortcut.Modi
fiers.Shift)], |
325 ], | 401 |
326 | 402 IncrementValue: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.Key
boardShortcut.Keys.Up)], |
327 HideElement: [ | 403 |
328 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.H) | 404 DecrementValue: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.Key
boardShortcut.Keys.Down)], |
329 ], | 405 |
330 | 406 IncrementBy10: [ |
331 ToggleEditAsHTML: [ | 407 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.K
eys.PageUp), |
332 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.F2) | 408 WebInspector.KeyboardShortcut.makeDescriptor( |
333 ], | 409 WebInspector.KeyboardShortcut.Keys.Up, WebInspector.KeyboardShortcut.Mod
ifiers.Shift) |
334 | 410 ], |
335 NextProperty: [ | 411 |
336 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Tab) | 412 DecrementBy10: [ |
337 ], | 413 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.K
eys.PageDown), |
338 | 414 WebInspector.KeyboardShortcut.makeDescriptor( |
339 PreviousProperty: [ | 415 WebInspector.KeyboardShortcut.Keys.Down, WebInspector.KeyboardShortcut.M
odifiers.Shift) |
340 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Tab, WebInspector.KeyboardShortcut.Modifiers.Shift) | 416 ], |
341 ], | 417 |
342 | 418 IncrementBy100: [WebInspector.KeyboardShortcut.makeDescriptor( |
343 IncrementValue: [ | 419 WebInspector.KeyboardShortcut.Keys.PageUp, WebInspector.KeyboardShortcut.M
odifiers.Shift)], |
344 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Up) | 420 |
345 ], | 421 DecrementBy100: [WebInspector.KeyboardShortcut.makeDescriptor( |
346 | 422 WebInspector.KeyboardShortcut.Keys.PageDown, WebInspector.KeyboardShortcut
.Modifiers.Shift)], |
347 DecrementValue: [ | 423 |
348 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Down) | 424 IncrementBy01: [WebInspector.KeyboardShortcut.makeDescriptor( |
349 ], | 425 WebInspector.KeyboardShortcut.Keys.Up, WebInspector.KeyboardShortcut.Modif
iers.Alt)], |
350 | 426 |
351 IncrementBy10: [ | 427 DecrementBy01: [WebInspector.KeyboardShortcut.makeDescriptor( |
352 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.PageUp), | 428 WebInspector.KeyboardShortcut.Keys.Down, WebInspector.KeyboardShortcut.Mod
ifiers.Alt)] |
353 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Up, WebInspector.KeyboardShortcut.Modifiers.Shift) | |
354 ], | |
355 | |
356 DecrementBy10: [ | |
357 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.PageDown), | |
358 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Down, WebInspector.KeyboardShortcut.Modifiers.Shift) | |
359 ], | |
360 | |
361 IncrementBy100: [ | |
362 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.PageUp, WebInspector.KeyboardShortcut.Modifiers.Shift) | |
363 ], | |
364 | |
365 DecrementBy100: [ | |
366 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.PageDown, WebInspector.KeyboardShortcut.Modifiers.Shift) | |
367 ], | |
368 | |
369 IncrementBy01: [ | |
370 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Up, WebInspector.KeyboardShortcut.Modifiers.Alt) | |
371 ], | |
372 | |
373 DecrementBy01: [ | |
374 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Down, WebInspector.KeyboardShortcut.Modifiers.Alt) | |
375 ] | |
376 }; | 429 }; |
377 | 430 |
378 WebInspector.ShortcutsScreen.SourcesPanelShortcuts = { | 431 WebInspector.ShortcutsScreen.SourcesPanelShortcuts = { |
379 SelectNextOccurrence: [ | 432 SelectNextOccurrence: |
380 WebInspector.KeyboardShortcut.makeDescriptor("d", WebInspector.KeyboardS
hortcut.Modifiers.CtrlOrMeta) | 433 [WebInspector.KeyboardShortcut.makeDescriptor('d', WebInspector.KeyboardSh
ortcut.Modifiers.CtrlOrMeta)], |
381 ], | 434 |
382 | 435 SoftUndo: [WebInspector.KeyboardShortcut.makeDescriptor('u', WebInspector.Keyb
oardShortcut.Modifiers.CtrlOrMeta)], |
383 SoftUndo: [ | 436 |
384 WebInspector.KeyboardShortcut.makeDescriptor("u", WebInspector.KeyboardS
hortcut.Modifiers.CtrlOrMeta) | 437 GotoMatchingBracket: |
385 ], | 438 [WebInspector.KeyboardShortcut.makeDescriptor('m', WebInspector.KeyboardSh
ortcut.Modifiers.Ctrl)], |
386 | 439 |
387 GotoMatchingBracket: [ | 440 ToggleAutocompletion: [WebInspector.KeyboardShortcut.makeDescriptor( |
388 WebInspector.KeyboardShortcut.makeDescriptor("m", WebInspector.KeyboardS
hortcut.Modifiers.Ctrl) | 441 WebInspector.KeyboardShortcut.Keys.Space, WebInspector.KeyboardShortcut.Mo
difiers.Ctrl)], |
389 ], | 442 |
390 | 443 IncreaseCSSUnitByOne: [WebInspector.KeyboardShortcut.makeDescriptor( |
391 ToggleAutocompletion: [ | 444 WebInspector.KeyboardShortcut.Keys.Up, WebInspector.KeyboardShortcut.Modif
iers.Alt)], |
392 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Space, WebInspector.KeyboardShortcut.Modifiers.Ctrl) | 445 |
393 ], | 446 DecreaseCSSUnitByOne: [WebInspector.KeyboardShortcut.makeDescriptor( |
394 | 447 WebInspector.KeyboardShortcut.Keys.Down, WebInspector.KeyboardShortcut.Mod
ifiers.Alt)], |
395 IncreaseCSSUnitByOne: [ | 448 |
396 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Up, WebInspector.KeyboardShortcut.Modifiers.Alt) | 449 IncreaseCSSUnitByTen: [WebInspector.KeyboardShortcut.makeDescriptor( |
397 ], | 450 WebInspector.KeyboardShortcut.Keys.PageUp, WebInspector.KeyboardShortcut.M
odifiers.Alt)], |
398 | 451 |
399 DecreaseCSSUnitByOne: [ | 452 DecreaseCSSUnitByTen: [WebInspector.KeyboardShortcut.makeDescriptor( |
400 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Down, WebInspector.KeyboardShortcut.Modifiers.Alt) | 453 WebInspector.KeyboardShortcut.Keys.PageDown, WebInspector.KeyboardShortcut
.Modifiers.Alt)], |
401 ], | 454 EvaluateSelectionInConsole: [WebInspector.KeyboardShortcut.makeDescriptor( |
402 | 455 'e', WebInspector.KeyboardShortcut.Modifiers.Shift | WebInspector.Keyboard
Shortcut.Modifiers.Ctrl)], |
403 IncreaseCSSUnitByTen: [ | 456 |
404 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.PageUp, WebInspector.KeyboardShortcut.Modifiers.Alt) | 457 AddSelectionToWatch: [WebInspector.KeyboardShortcut.makeDescriptor( |
405 ], | 458 'a', WebInspector.KeyboardShortcut.Modifiers.Shift | WebInspector.Keyboard
Shortcut.Modifiers.Ctrl)], |
406 | 459 |
407 DecreaseCSSUnitByTen: [ | 460 GoToMember: [WebInspector.KeyboardShortcut.makeDescriptor( |
408 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.PageDown, WebInspector.KeyboardShortcut.Modifiers.Alt) | 461 'o', WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta | WebInspector.Key
boardShortcut.Modifiers.Shift)], |
409 ], | 462 |
410 EvaluateSelectionInConsole: [ | 463 GoToLine: [WebInspector.KeyboardShortcut.makeDescriptor('g', WebInspector.Keyb
oardShortcut.Modifiers.Ctrl)], |
411 WebInspector.KeyboardShortcut.makeDescriptor("e", WebInspector.KeyboardS
hortcut.Modifiers.Shift | WebInspector.KeyboardShortcut.Modifiers.Ctrl) | 464 |
412 ], | 465 ToggleBreakpoint: |
413 | 466 [WebInspector.KeyboardShortcut.makeDescriptor('b', WebInspector.KeyboardSh
ortcut.Modifiers.CtrlOrMeta)], |
414 AddSelectionToWatch: [ | 467 |
415 WebInspector.KeyboardShortcut.makeDescriptor("a", WebInspector.KeyboardS
hortcut.Modifiers.Shift | WebInspector.KeyboardShortcut.Modifiers.Ctrl) | 468 NextCallFrame: [WebInspector.KeyboardShortcut.makeDescriptor( |
416 ], | 469 WebInspector.KeyboardShortcut.Keys.Period, WebInspector.KeyboardShortcut.M
odifiers.Ctrl)], |
417 | 470 |
418 GoToMember: [ | 471 PrevCallFrame: [WebInspector.KeyboardShortcut.makeDescriptor( |
419 WebInspector.KeyboardShortcut.makeDescriptor("o", WebInspector.KeyboardS
hortcut.Modifiers.CtrlOrMeta | WebInspector.KeyboardShortcut.Modifiers.Shift) | 472 WebInspector.KeyboardShortcut.Keys.Comma, WebInspector.KeyboardShortcut.Mo
difiers.Ctrl)], |
420 ], | 473 |
421 | 474 ToggleComment: [WebInspector.KeyboardShortcut.makeDescriptor( |
422 GoToLine: [ | 475 WebInspector.KeyboardShortcut.Keys.Slash, WebInspector.KeyboardShortcut.Mo
difiers.CtrlOrMeta)], |
423 WebInspector.KeyboardShortcut.makeDescriptor("g", WebInspector.KeyboardS
hortcut.Modifiers.Ctrl) | 476 |
424 ], | 477 JumpToPreviousLocation: [WebInspector.KeyboardShortcut.makeDescriptor( |
425 | 478 WebInspector.KeyboardShortcut.Keys.Minus, WebInspector.KeyboardShortcut.Mo
difiers.Alt)], |
426 ToggleBreakpoint: [ | 479 |
427 WebInspector.KeyboardShortcut.makeDescriptor("b", WebInspector.KeyboardS
hortcut.Modifiers.CtrlOrMeta) | 480 JumpToNextLocation: [WebInspector.KeyboardShortcut.makeDescriptor( |
428 ], | 481 WebInspector.KeyboardShortcut.Keys.Plus, WebInspector.KeyboardShortcut.Mod
ifiers.Alt)], |
429 | 482 |
430 NextCallFrame: [ | 483 CloseEditorTab: [WebInspector.KeyboardShortcut.makeDescriptor('w', WebInspecto
r.KeyboardShortcut.Modifiers.Alt)], |
431 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Period, WebInspector.KeyboardShortcut.Modifiers.Ctrl) | 484 |
432 ], | 485 Save: [WebInspector.KeyboardShortcut.makeDescriptor('s', WebInspector.Keyboard
Shortcut.Modifiers.CtrlOrMeta)], |
433 | 486 |
434 PrevCallFrame: [ | 487 SaveAll: [WebInspector.KeyboardShortcut.makeDescriptor( |
435 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Comma, WebInspector.KeyboardShortcut.Modifiers.Ctrl) | 488 's', WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta | WebInspector.Key
boardShortcut.Modifiers.ShiftOrOption)], |
436 ], | |
437 | |
438 ToggleComment: [ | |
439 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Slash, WebInspector.KeyboardShortcut.Modifiers.CtrlOrMeta) | |
440 ], | |
441 | |
442 JumpToPreviousLocation: [ | |
443 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Minus, WebInspector.KeyboardShortcut.Modifiers.Alt) | |
444 ], | |
445 | |
446 JumpToNextLocation: [ | |
447 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Plus, WebInspector.KeyboardShortcut.Modifiers.Alt) | |
448 ], | |
449 | |
450 CloseEditorTab: [ | |
451 WebInspector.KeyboardShortcut.makeDescriptor("w", WebInspector.KeyboardS
hortcut.Modifiers.Alt) | |
452 ], | |
453 | |
454 Save: [ | |
455 WebInspector.KeyboardShortcut.makeDescriptor("s", WebInspector.KeyboardS
hortcut.Modifiers.CtrlOrMeta) | |
456 ], | |
457 | |
458 SaveAll: [ | |
459 WebInspector.KeyboardShortcut.makeDescriptor("s", WebInspector.KeyboardS
hortcut.Modifiers.CtrlOrMeta | WebInspector.KeyboardShortcut.Modifiers.ShiftOrOp
tion) | |
460 ], | |
461 }; | 489 }; |
462 | 490 |
463 WebInspector.ShortcutsScreen.LayersPanelShortcuts = { | 491 WebInspector.ShortcutsScreen.LayersPanelShortcuts = { |
464 ResetView: [ | 492 ResetView: [WebInspector.KeyboardShortcut.makeDescriptor('0')], |
465 WebInspector.KeyboardShortcut.makeDescriptor("0") | 493 |
466 ], | 494 PanMode: [WebInspector.KeyboardShortcut.makeDescriptor('x')], |
467 | 495 |
468 PanMode: [ | 496 RotateMode: [WebInspector.KeyboardShortcut.makeDescriptor('v')], |
469 WebInspector.KeyboardShortcut.makeDescriptor("x") | 497 |
470 ], | 498 TogglePanRotate: [WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.Ke
yboardShortcut.Keys.Shift)], |
471 | 499 |
472 RotateMode: [ | 500 ZoomIn: [ |
473 WebInspector.KeyboardShortcut.makeDescriptor("v") | 501 WebInspector.KeyboardShortcut.makeDescriptor( |
474 ], | 502 WebInspector.KeyboardShortcut.Keys.Plus, WebInspector.KeyboardShortcut.M
odifiers.Shift), |
475 | 503 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.K
eys.NumpadPlus) |
476 TogglePanRotate: [ | 504 ], |
477 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Shift) | 505 |
478 ], | 506 ZoomOut: [ |
479 | 507 WebInspector.KeyboardShortcut.makeDescriptor( |
480 ZoomIn: [ | 508 WebInspector.KeyboardShortcut.Keys.Minus, WebInspector.KeyboardShortcut.
Modifiers.Shift), |
481 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Plus, WebInspector.KeyboardShortcut.Modifiers.Shift), | 509 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.K
eys.NumpadMinus) |
482 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.NumpadPlus) | 510 ], |
483 ], | 511 |
484 | 512 Up: [ |
485 ZoomOut: [ | 513 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.K
eys.Up), |
486 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Minus, WebInspector.KeyboardShortcut.Modifiers.Shift), | 514 WebInspector.KeyboardShortcut.makeDescriptor('w') |
487 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.NumpadMinus) | 515 ], |
488 ], | 516 |
489 | 517 Down: [ |
490 Up: [ | 518 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.K
eys.Down), |
491 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Up), | 519 WebInspector.KeyboardShortcut.makeDescriptor('s') |
492 WebInspector.KeyboardShortcut.makeDescriptor("w") | 520 ], |
493 ], | 521 |
494 | 522 Left: [ |
495 Down: [ | 523 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.K
eys.Left), |
496 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Down), | 524 WebInspector.KeyboardShortcut.makeDescriptor('a') |
497 WebInspector.KeyboardShortcut.makeDescriptor("s") | 525 ], |
498 ], | 526 |
499 | 527 Right: [ |
500 Left: [ | 528 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortcut.K
eys.Right), |
501 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Left), | 529 WebInspector.KeyboardShortcut.makeDescriptor('d') |
502 WebInspector.KeyboardShortcut.makeDescriptor("a") | 530 ] |
503 ], | 531 }; |
504 | |
505 Right: [ | |
506 WebInspector.KeyboardShortcut.makeDescriptor(WebInspector.KeyboardShortc
ut.Keys.Right), | |
507 WebInspector.KeyboardShortcut.makeDescriptor("d") | |
508 ] | |
509 }; | |
OLD | NEW |