| 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 13 matching lines...) Expand all Loading... |
| 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 | 30 |
| 31 /** | 31 /** |
| 32 * @unrestricted | 32 * @unrestricted |
| 33 */ | 33 */ |
| 34 Components.ShortcutsScreen = class { | 34 UI.ShortcutsScreen = class { |
| 35 constructor() { | 35 constructor() { |
| 36 /** @type {!Object.<string, !Components.ShortcutsSection>} */ | 36 /** @type {!Object.<string, !UI.ShortcutsSection>} */ |
| 37 this._sections = {}; | 37 this._sections = {}; |
| 38 } | 38 } |
| 39 | 39 |
| 40 static registerShortcuts() { | 40 static registerShortcuts() { |
| 41 // Elements panel | 41 // Elements panel |
| 42 var elementsSection = Components.shortcutsScreen.section(Common.UIString('El
ements Panel')); | 42 var elementsSection = UI.shortcutsScreen.section(Common.UIString('Elements P
anel')); |
| 43 | 43 |
| 44 var navigate = Components.ShortcutsScreen.ElementsPanelShortcuts.NavigateUp.
concat( | 44 var navigate = UI.ShortcutsScreen.ElementsPanelShortcuts.NavigateUp.concat( |
| 45 Components.ShortcutsScreen.ElementsPanelShortcuts.NavigateDown); | 45 UI.ShortcutsScreen.ElementsPanelShortcuts.NavigateDown); |
| 46 elementsSection.addRelatedKeys(navigate, Common.UIString('Navigate elements'
)); | 46 elementsSection.addRelatedKeys(navigate, Common.UIString('Navigate elements'
)); |
| 47 | 47 |
| 48 var expandCollapse = Components.ShortcutsScreen.ElementsPanelShortcuts.Expan
d.concat( | 48 var expandCollapse = |
| 49 Components.ShortcutsScreen.ElementsPanelShortcuts.Collapse); | 49 UI.ShortcutsScreen.ElementsPanelShortcuts.Expand.concat(UI.ShortcutsScre
en.ElementsPanelShortcuts.Collapse); |
| 50 elementsSection.addRelatedKeys(expandCollapse, Common.UIString('Expand/colla
pse')); | 50 elementsSection.addRelatedKeys(expandCollapse, Common.UIString('Expand/colla
pse')); |
| 51 | 51 |
| 52 elementsSection.addAlternateKeys( | 52 elementsSection.addAlternateKeys( |
| 53 Components.ShortcutsScreen.ElementsPanelShortcuts.EditAttribute, Common.
UIString('Edit attribute')); | 53 UI.ShortcutsScreen.ElementsPanelShortcuts.EditAttribute, Common.UIString
('Edit attribute')); |
| 54 elementsSection.addAlternateKeys( | 54 elementsSection.addAlternateKeys( |
| 55 Components.ShortcutsScreen.ElementsPanelShortcuts.HideElement, Common.UI
String('Hide element')); | 55 UI.ShortcutsScreen.ElementsPanelShortcuts.HideElement, Common.UIString('
Hide element')); |
| 56 elementsSection.addAlternateKeys( | 56 elementsSection.addAlternateKeys( |
| 57 Components.ShortcutsScreen.ElementsPanelShortcuts.ToggleEditAsHTML, Comm
on.UIString('Toggle edit as HTML')); | 57 UI.ShortcutsScreen.ElementsPanelShortcuts.ToggleEditAsHTML, Common.UIStr
ing('Toggle edit as HTML')); |
| 58 | 58 |
| 59 var stylesPaneSection = Components.shortcutsScreen.section(Common.UIString('
Styles Pane')); | 59 var stylesPaneSection = UI.shortcutsScreen.section(Common.UIString('Styles P
ane')); |
| 60 | 60 |
| 61 var nextPreviousProperty = Components.ShortcutsScreen.ElementsPanelShortcuts
.NextProperty.concat( | 61 var nextPreviousProperty = UI.ShortcutsScreen.ElementsPanelShortcuts.NextPro
perty.concat( |
| 62 Components.ShortcutsScreen.ElementsPanelShortcuts.PreviousProperty); | 62 UI.ShortcutsScreen.ElementsPanelShortcuts.PreviousProperty); |
| 63 stylesPaneSection.addRelatedKeys(nextPreviousProperty, Common.UIString('Next
/previous property')); | 63 stylesPaneSection.addRelatedKeys(nextPreviousProperty, Common.UIString('Next
/previous property')); |
| 64 | 64 |
| 65 stylesPaneSection.addRelatedKeys( | 65 stylesPaneSection.addRelatedKeys( |
| 66 Components.ShortcutsScreen.ElementsPanelShortcuts.IncrementValue, Common
.UIString('Increment value')); | 66 UI.ShortcutsScreen.ElementsPanelShortcuts.IncrementValue, Common.UIStrin
g('Increment value')); |
| 67 stylesPaneSection.addRelatedKeys( | 67 stylesPaneSection.addRelatedKeys( |
| 68 Components.ShortcutsScreen.ElementsPanelShortcuts.DecrementValue, Common
.UIString('Decrement value')); | 68 UI.ShortcutsScreen.ElementsPanelShortcuts.DecrementValue, Common.UIStrin
g('Decrement value')); |
| 69 | 69 |
| 70 stylesPaneSection.addAlternateKeys( | 70 stylesPaneSection.addAlternateKeys( |
| 71 Components.ShortcutsScreen.ElementsPanelShortcuts.IncrementBy10, Common.
UIString('Increment by %f', 10)); | 71 UI.ShortcutsScreen.ElementsPanelShortcuts.IncrementBy10, Common.UIString
('Increment by %f', 10)); |
| 72 stylesPaneSection.addAlternateKeys( | 72 stylesPaneSection.addAlternateKeys( |
| 73 Components.ShortcutsScreen.ElementsPanelShortcuts.DecrementBy10, Common.
UIString('Decrement by %f', 10)); | 73 UI.ShortcutsScreen.ElementsPanelShortcuts.DecrementBy10, Common.UIString
('Decrement by %f', 10)); |
| 74 | 74 |
| 75 stylesPaneSection.addAlternateKeys( | 75 stylesPaneSection.addAlternateKeys( |
| 76 Components.ShortcutsScreen.ElementsPanelShortcuts.IncrementBy100, Common
.UIString('Increment by %f', 100)); | 76 UI.ShortcutsScreen.ElementsPanelShortcuts.IncrementBy100, Common.UIStrin
g('Increment by %f', 100)); |
| 77 stylesPaneSection.addAlternateKeys( | 77 stylesPaneSection.addAlternateKeys( |
| 78 Components.ShortcutsScreen.ElementsPanelShortcuts.DecrementBy100, Common
.UIString('Decrement by %f', 100)); | 78 UI.ShortcutsScreen.ElementsPanelShortcuts.DecrementBy100, Common.UIStrin
g('Decrement by %f', 100)); |
| 79 | 79 |
| 80 stylesPaneSection.addAlternateKeys( | 80 stylesPaneSection.addAlternateKeys( |
| 81 Components.ShortcutsScreen.ElementsPanelShortcuts.IncrementBy01, Common.
UIString('Increment by %f', 0.1)); | 81 UI.ShortcutsScreen.ElementsPanelShortcuts.IncrementBy01, Common.UIString
('Increment by %f', 0.1)); |
| 82 stylesPaneSection.addAlternateKeys( | 82 stylesPaneSection.addAlternateKeys( |
| 83 Components.ShortcutsScreen.ElementsPanelShortcuts.DecrementBy01, Common.
UIString('Decrement by %f', 0.1)); | 83 UI.ShortcutsScreen.ElementsPanelShortcuts.DecrementBy01, Common.UIString
('Decrement by %f', 0.1)); |
| 84 | 84 |
| 85 // Debugger | 85 // Debugger |
| 86 var section = Components.shortcutsScreen.section(Common.UIString('Debugger')
); | 86 var section = UI.shortcutsScreen.section(Common.UIString('Debugger')); |
| 87 | 87 |
| 88 section.addAlternateKeys( | 88 section.addAlternateKeys( |
| 89 UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.toggle-pause'
), Common.UIString('Pause/ Continue')); | 89 UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.toggle-pause'
), Common.UIString('Pause/ Continue')); |
| 90 section.addAlternateKeys( | 90 section.addAlternateKeys( |
| 91 UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.step-over'),
Common.UIString('Step over')); | 91 UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.step-over'),
Common.UIString('Step over')); |
| 92 section.addAlternateKeys( | 92 section.addAlternateKeys( |
| 93 UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.step-into'),
Common.UIString('Step into')); | 93 UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.step-into'),
Common.UIString('Step into')); |
| 94 section.addAlternateKeys( | 94 section.addAlternateKeys( |
| 95 UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.step-out'), C
ommon.UIString('Step out')); | 95 UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.step-out'), C
ommon.UIString('Step out')); |
| 96 | 96 |
| 97 var nextAndPrevFrameKeys = Components.ShortcutsScreen.SourcesPanelShortcuts.
NextCallFrame.concat( | 97 var nextAndPrevFrameKeys = UI.ShortcutsScreen.SourcesPanelShortcuts.NextCall
Frame.concat( |
| 98 Components.ShortcutsScreen.SourcesPanelShortcuts.PrevCallFrame); | 98 UI.ShortcutsScreen.SourcesPanelShortcuts.PrevCallFrame); |
| 99 section.addRelatedKeys(nextAndPrevFrameKeys, Common.UIString('Next/previous
call frame')); | 99 section.addRelatedKeys(nextAndPrevFrameKeys, Common.UIString('Next/previous
call frame')); |
| 100 | 100 |
| 101 section.addAlternateKeys( | 101 section.addAlternateKeys( |
| 102 Components.ShortcutsScreen.SourcesPanelShortcuts.EvaluateSelectionInCons
ole, | 102 UI.ShortcutsScreen.SourcesPanelShortcuts.EvaluateSelectionInConsole, |
| 103 Common.UIString('Evaluate selection in console')); | 103 Common.UIString('Evaluate selection in console')); |
| 104 section.addAlternateKeys( | 104 section.addAlternateKeys( |
| 105 Components.ShortcutsScreen.SourcesPanelShortcuts.AddSelectionToWatch, | 105 UI.ShortcutsScreen.SourcesPanelShortcuts.AddSelectionToWatch, Common.UIS
tring('Add selection to watch')); |
| 106 Common.UIString('Add selection to watch')); | |
| 107 section.addAlternateKeys( | 106 section.addAlternateKeys( |
| 108 Components.ShortcutsScreen.SourcesPanelShortcuts.ToggleBreakpoint, Commo
n.UIString('Toggle breakpoint')); | 107 UI.ShortcutsScreen.SourcesPanelShortcuts.ToggleBreakpoint, Common.UIStri
ng('Toggle breakpoint')); |
| 109 section.addAlternateKeys( | 108 section.addAlternateKeys( |
| 110 UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.toggle-breakp
oints-active'), | 109 UI.shortcutRegistry.shortcutDescriptorsForAction('debugger.toggle-breakp
oints-active'), |
| 111 Common.UIString('Toggle all breakpoints')); | 110 Common.UIString('Toggle all breakpoints')); |
| 112 | 111 |
| 113 // Editing | 112 // Editing |
| 114 section = Components.shortcutsScreen.section(Common.UIString('Text Editor'))
; | 113 section = UI.shortcutsScreen.section(Common.UIString('Text Editor')); |
| 114 section.addAlternateKeys(UI.ShortcutsScreen.SourcesPanelShortcuts.GoToMember
, Common.UIString('Go to member')); |
| 115 section.addAlternateKeys( | 115 section.addAlternateKeys( |
| 116 Components.ShortcutsScreen.SourcesPanelShortcuts.GoToMember, Common.UISt
ring('Go to member')); | 116 UI.ShortcutsScreen.SourcesPanelShortcuts.ToggleAutocompletion, Common.UI
String('Autocompletion')); |
| 117 section.addAlternateKeys(UI.ShortcutsScreen.SourcesPanelShortcuts.GoToLine,
Common.UIString('Go to line')); |
| 117 section.addAlternateKeys( | 118 section.addAlternateKeys( |
| 118 Components.ShortcutsScreen.SourcesPanelShortcuts.ToggleAutocompletion, C
ommon.UIString('Autocompletion')); | 119 UI.ShortcutsScreen.SourcesPanelShortcuts.JumpToPreviousLocation, |
| 119 section.addAlternateKeys(Components.ShortcutsScreen.SourcesPanelShortcuts.Go
ToLine, Common.UIString('Go to line')); | |
| 120 section.addAlternateKeys( | |
| 121 Components.ShortcutsScreen.SourcesPanelShortcuts.JumpToPreviousLocation, | |
| 122 Common.UIString('Jump to previous editing location')); | 120 Common.UIString('Jump to previous editing location')); |
| 123 section.addAlternateKeys( | 121 section.addAlternateKeys( |
| 124 Components.ShortcutsScreen.SourcesPanelShortcuts.JumpToNextLocation, | 122 UI.ShortcutsScreen.SourcesPanelShortcuts.JumpToNextLocation, Common.UISt
ring('Jump to next editing location')); |
| 125 Common.UIString('Jump to next editing location')); | 123 section.addAlternateKeys(UI.ShortcutsScreen.SourcesPanelShortcuts.ToggleComm
ent, Common.UIString('Toggle comment')); |
| 126 section.addAlternateKeys( | 124 section.addAlternateKeys( |
| 127 Components.ShortcutsScreen.SourcesPanelShortcuts.ToggleComment, Common.U
IString('Toggle comment')); | 125 UI.ShortcutsScreen.SourcesPanelShortcuts.IncreaseCSSUnitByOne, Common.UI
String('Increment CSS unit by 1')); |
| 128 section.addAlternateKeys( | 126 section.addAlternateKeys( |
| 129 Components.ShortcutsScreen.SourcesPanelShortcuts.IncreaseCSSUnitByOne, | 127 UI.ShortcutsScreen.SourcesPanelShortcuts.DecreaseCSSUnitByOne, Common.UI
String('Decrement CSS unit by 1')); |
| 130 Common.UIString('Increment CSS unit by 1')); | |
| 131 section.addAlternateKeys( | 128 section.addAlternateKeys( |
| 132 Components.ShortcutsScreen.SourcesPanelShortcuts.DecreaseCSSUnitByOne, | 129 UI.ShortcutsScreen.SourcesPanelShortcuts.IncreaseCSSUnitByTen, Common.UI
String('Increment CSS unit by 10')); |
| 133 Common.UIString('Decrement CSS unit by 1')); | |
| 134 section.addAlternateKeys( | 130 section.addAlternateKeys( |
| 135 Components.ShortcutsScreen.SourcesPanelShortcuts.IncreaseCSSUnitByTen, | 131 UI.ShortcutsScreen.SourcesPanelShortcuts.DecreaseCSSUnitByTen, Common.UI
String('Decrement CSS unit by 10')); |
| 136 Common.UIString('Increment CSS unit by 10')); | |
| 137 section.addAlternateKeys( | 132 section.addAlternateKeys( |
| 138 Components.ShortcutsScreen.SourcesPanelShortcuts.DecreaseCSSUnitByTen, | 133 UI.ShortcutsScreen.SourcesPanelShortcuts.SelectNextOccurrence, Common.UI
String('Select next occurrence')); |
| 139 Common.UIString('Decrement CSS unit by 10')); | 134 section.addAlternateKeys(UI.ShortcutsScreen.SourcesPanelShortcuts.SoftUndo,
Common.UIString('Soft undo')); |
| 140 section.addAlternateKeys( | 135 section.addAlternateKeys( |
| 141 Components.ShortcutsScreen.SourcesPanelShortcuts.SelectNextOccurrence, | 136 UI.ShortcutsScreen.SourcesPanelShortcuts.GotoMatchingBracket, Common.UIS
tring('Go to matching bracket')); |
| 142 Common.UIString('Select next occurrence')); | |
| 143 section.addAlternateKeys(Components.ShortcutsScreen.SourcesPanelShortcuts.So
ftUndo, Common.UIString('Soft undo')); | |
| 144 section.addAlternateKeys( | 137 section.addAlternateKeys( |
| 145 Components.ShortcutsScreen.SourcesPanelShortcuts.GotoMatchingBracket, | 138 UI.ShortcutsScreen.SourcesPanelShortcuts.CloseEditorTab, Common.UIString
('Close editor tab')); |
| 146 Common.UIString('Go to matching bracket')); | |
| 147 section.addAlternateKeys( | |
| 148 Components.ShortcutsScreen.SourcesPanelShortcuts.CloseEditorTab, Common.
UIString('Close editor tab')); | |
| 149 section.addAlternateKeys( | 139 section.addAlternateKeys( |
| 150 UI.shortcutRegistry.shortcutDescriptorsForAction('sources.switch-file'), | 140 UI.shortcutRegistry.shortcutDescriptorsForAction('sources.switch-file'), |
| 151 Common.UIString('Switch between files with the same name and different e
xtensions.')); | 141 Common.UIString('Switch between files with the same name and different e
xtensions.')); |
| 152 | 142 |
| 153 // Timeline panel | 143 // Timeline panel |
| 154 section = Components.shortcutsScreen.section(Common.UIString('Timeline Panel
')); | 144 section = UI.shortcutsScreen.section(Common.UIString('Timeline Panel')); |
| 155 section.addAlternateKeys( | 145 section.addAlternateKeys( |
| 156 UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.toggle-record
ing'), | 146 UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.toggle-record
ing'), |
| 157 Common.UIString('Start/stop recording')); | 147 Common.UIString('Start/stop recording')); |
| 158 section.addAlternateKeys( | 148 section.addAlternateKeys( |
| 159 UI.shortcutRegistry.shortcutDescriptorsForAction('main.reload'), Common.
UIString('Record page reload')); | 149 UI.shortcutRegistry.shortcutDescriptorsForAction('main.reload'), Common.
UIString('Record page reload')); |
| 160 section.addAlternateKeys( | 150 section.addAlternateKeys( |
| 161 UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.save-to-file'
), Common.UIString('Save profile')); | 151 UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.save-to-file'
), Common.UIString('Save profile')); |
| 162 section.addAlternateKeys( | 152 section.addAlternateKeys( |
| 163 UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.load-from-fil
e'), Common.UIString('Load profile')); | 153 UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.load-from-fil
e'), Common.UIString('Load profile')); |
| 164 section.addRelatedKeys( | 154 section.addRelatedKeys( |
| 165 UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.jump-to-previ
ous-frame') | 155 UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.jump-to-previ
ous-frame') |
| 166 .concat(UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.j
ump-to-next-frame')), | 156 .concat(UI.shortcutRegistry.shortcutDescriptorsForAction('timeline.j
ump-to-next-frame')), |
| 167 Common.UIString('Jump to previous/next frame')); | 157 Common.UIString('Jump to previous/next frame')); |
| 168 | 158 |
| 169 // Profiles panel | 159 // Profiles panel |
| 170 section = Components.shortcutsScreen.section(Common.UIString('Profiles Panel
')); | 160 section = UI.shortcutsScreen.section(Common.UIString('Profiles Panel')); |
| 171 section.addAlternateKeys( | 161 section.addAlternateKeys( |
| 172 UI.shortcutRegistry.shortcutDescriptorsForAction('profiler.toggle-record
ing'), | 162 UI.shortcutRegistry.shortcutDescriptorsForAction('profiler.toggle-record
ing'), |
| 173 Common.UIString('Start/stop recording')); | 163 Common.UIString('Start/stop recording')); |
| 174 | 164 |
| 175 // Layers panel | 165 // Layers panel |
| 176 section = Components.shortcutsScreen.section(Common.UIString('Layers Panel')
); | 166 section = UI.shortcutsScreen.section(Common.UIString('Layers Panel')); |
| 177 section.addAlternateKeys(Components.ShortcutsScreen.LayersPanelShortcuts.Res
etView, Common.UIString('Reset view')); | 167 section.addAlternateKeys(UI.ShortcutsScreen.LayersPanelShortcuts.ResetView,
Common.UIString('Reset view')); |
| 168 section.addAlternateKeys(UI.ShortcutsScreen.LayersPanelShortcuts.PanMode, Co
mmon.UIString('Switch to pan mode')); |
| 178 section.addAlternateKeys( | 169 section.addAlternateKeys( |
| 179 Components.ShortcutsScreen.LayersPanelShortcuts.PanMode, Common.UIString
('Switch to pan mode')); | 170 UI.ShortcutsScreen.LayersPanelShortcuts.RotateMode, Common.UIString('Swi
tch to rotate mode')); |
| 180 section.addAlternateKeys( | 171 section.addAlternateKeys( |
| 181 Components.ShortcutsScreen.LayersPanelShortcuts.RotateMode, Common.UIStr
ing('Switch to rotate mode')); | 172 UI.ShortcutsScreen.LayersPanelShortcuts.TogglePanRotate, |
| 182 section.addAlternateKeys( | |
| 183 Components.ShortcutsScreen.LayersPanelShortcuts.TogglePanRotate, | |
| 184 Common.UIString('Temporarily toggle pan/rotate mode while held')); | 173 Common.UIString('Temporarily toggle pan/rotate mode while held')); |
| 185 section.addAlternateKeys(Components.ShortcutsScreen.LayersPanelShortcuts.Zoo
mIn, Common.UIString('Zoom in')); | 174 section.addAlternateKeys(UI.ShortcutsScreen.LayersPanelShortcuts.ZoomIn, Com
mon.UIString('Zoom in')); |
| 186 section.addAlternateKeys(Components.ShortcutsScreen.LayersPanelShortcuts.Zoo
mOut, Common.UIString('Zoom out')); | 175 section.addAlternateKeys(UI.ShortcutsScreen.LayersPanelShortcuts.ZoomOut, Co
mmon.UIString('Zoom out')); |
| 187 section.addRelatedKeys( | 176 section.addRelatedKeys( |
| 188 Components.ShortcutsScreen.LayersPanelShortcuts.Up.concat(Components.Sho
rtcutsScreen.LayersPanelShortcuts.Down), | 177 UI.ShortcutsScreen.LayersPanelShortcuts.Up.concat(UI.ShortcutsScreen.Lay
ersPanelShortcuts.Down), |
| 189 Common.UIString('Pan or rotate up/down')); | 178 Common.UIString('Pan or rotate up/down')); |
| 190 section.addRelatedKeys( | 179 section.addRelatedKeys( |
| 191 Components.ShortcutsScreen.LayersPanelShortcuts.Left.concat( | 180 UI.ShortcutsScreen.LayersPanelShortcuts.Left.concat(UI.ShortcutsScreen.L
ayersPanelShortcuts.Right), |
| 192 Components.ShortcutsScreen.LayersPanelShortcuts.Right), | |
| 193 Common.UIString('Pan or rotate left/right')); | 181 Common.UIString('Pan or rotate left/right')); |
| 194 } | 182 } |
| 195 | 183 |
| 196 /** | 184 /** |
| 197 * @param {string} name | 185 * @param {string} name |
| 198 * @return {!Components.ShortcutsSection} | 186 * @return {!UI.ShortcutsSection} |
| 199 */ | 187 */ |
| 200 section(name) { | 188 section(name) { |
| 201 var section = this._sections[name]; | 189 var section = this._sections[name]; |
| 202 if (!section) | 190 if (!section) |
| 203 this._sections[name] = section = new Components.ShortcutsSection(name); | 191 this._sections[name] = section = new UI.ShortcutsSection(name); |
| 204 return section; | 192 return section; |
| 205 } | 193 } |
| 206 | 194 |
| 207 /** | 195 /** |
| 208 * @return {!UI.Widget} | 196 * @return {!UI.Widget} |
| 209 */ | 197 */ |
| 210 createShortcutsTabView() { | 198 createShortcutsTabView() { |
| 211 var orderedSections = []; | 199 var orderedSections = []; |
| 212 for (var section in this._sections) | 200 for (var section in this._sections) |
| 213 orderedSections.push(this._sections[section]); | 201 orderedSections.push(this._sections[section]); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 229 var note = scrollPane.createChild('p', 'help-footnote'); | 217 var note = scrollPane.createChild('p', 'help-footnote'); |
| 230 note.appendChild(UI.createDocumentationLink( | 218 note.appendChild(UI.createDocumentationLink( |
| 231 'iterate/inspect-styles/shortcuts', Common.UIString('Full list of DevToo
ls keyboard shortcuts and gestures'))); | 219 'iterate/inspect-styles/shortcuts', Common.UIString('Full list of DevToo
ls keyboard shortcuts and gestures'))); |
| 232 | 220 |
| 233 return widget; | 221 return widget; |
| 234 } | 222 } |
| 235 }; | 223 }; |
| 236 | 224 |
| 237 /** | 225 /** |
| 238 * We cannot initialize it here as localized strings are not loaded yet. | 226 * We cannot initialize it here as localized strings are not loaded yet. |
| 239 * @type {!Components.ShortcutsScreen} | 227 * @type {!UI.ShortcutsScreen} |
| 240 */ | 228 */ |
| 241 Components.shortcutsScreen; | 229 UI.shortcutsScreen; |
| 242 | 230 |
| 243 /** | 231 /** |
| 244 * @unrestricted | 232 * @unrestricted |
| 245 */ | 233 */ |
| 246 Components.ShortcutsSection = class { | 234 UI.ShortcutsSection = class { |
| 247 /** | 235 /** |
| 248 * @param {string} name | 236 * @param {string} name |
| 249 */ | 237 */ |
| 250 constructor(name) { | 238 constructor(name) { |
| 251 this.name = name; | 239 this.name = name; |
| 252 this._lines = /** @type {!Array.<!{key: !Node, text: string}>} */ ([]); | 240 this._lines = /** @type {!Array.<!{key: !Node, text: string}>} */ ([]); |
| 253 this.order = ++Components.ShortcutsSection._sequenceNumber; | 241 this.order = ++UI.ShortcutsSection._sequenceNumber; |
| 254 } | 242 } |
| 255 | 243 |
| 256 /** | 244 /** |
| 257 * @param {!UI.KeyboardShortcut.Descriptor} key | 245 * @param {!UI.KeyboardShortcut.Descriptor} key |
| 258 * @param {string} description | 246 * @param {string} description |
| 259 */ | 247 */ |
| 260 addKey(key, description) { | 248 addKey(key, description) { |
| 261 this._addLine(this._renderKey(key), description); | 249 this._addLine(this._renderKey(key), description); |
| 262 } | 250 } |
| 263 | 251 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 var result = createDocumentFragment(); | 333 var result = createDocumentFragment(); |
| 346 for (var i = 0; i < nodes.length; ++i) { | 334 for (var i = 0; i < nodes.length; ++i) { |
| 347 if (i > 0) | 335 if (i > 0) |
| 348 result.appendChild(delimiter.cloneNode(true)); | 336 result.appendChild(delimiter.cloneNode(true)); |
| 349 result.appendChild(nodes[i]); | 337 result.appendChild(nodes[i]); |
| 350 } | 338 } |
| 351 return result; | 339 return result; |
| 352 } | 340 } |
| 353 }; | 341 }; |
| 354 | 342 |
| 355 Components.ShortcutsSection._sequenceNumber = 0; | 343 UI.ShortcutsSection._sequenceNumber = 0; |
| 356 | 344 |
| 357 | 345 |
| 358 Components.ShortcutsScreen.ElementsPanelShortcuts = { | 346 UI.ShortcutsScreen.ElementsPanelShortcuts = { |
| 359 NavigateUp: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Up)], | 347 NavigateUp: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Up)], |
| 360 | 348 |
| 361 NavigateDown: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Dow
n)], | 349 NavigateDown: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Dow
n)], |
| 362 | 350 |
| 363 Expand: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Right)], | 351 Expand: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Right)], |
| 364 | 352 |
| 365 Collapse: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Left)], | 353 Collapse: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Left)], |
| 366 | 354 |
| 367 EditAttribute: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.En
ter)], | 355 EditAttribute: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.En
ter)], |
| 368 | 356 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 393 [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.PageUp, UI.Ke
yboardShortcut.Modifiers.Shift)], | 381 [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.PageUp, UI.Ke
yboardShortcut.Modifiers.Shift)], |
| 394 | 382 |
| 395 DecrementBy100: | 383 DecrementBy100: |
| 396 [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.PageDown, UI.
KeyboardShortcut.Modifiers.Shift)], | 384 [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.PageDown, UI.
KeyboardShortcut.Modifiers.Shift)], |
| 397 | 385 |
| 398 IncrementBy01: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Up
, UI.KeyboardShortcut.Modifiers.Alt)], | 386 IncrementBy01: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Up
, UI.KeyboardShortcut.Modifiers.Alt)], |
| 399 | 387 |
| 400 DecrementBy01: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Do
wn, UI.KeyboardShortcut.Modifiers.Alt)] | 388 DecrementBy01: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Do
wn, UI.KeyboardShortcut.Modifiers.Alt)] |
| 401 }; | 389 }; |
| 402 | 390 |
| 403 Components.ShortcutsScreen.SourcesPanelShortcuts = { | 391 UI.ShortcutsScreen.SourcesPanelShortcuts = { |
| 404 SelectNextOccurrence: [UI.KeyboardShortcut.makeDescriptor('d', UI.KeyboardShor
tcut.Modifiers.CtrlOrMeta)], | 392 SelectNextOccurrence: [UI.KeyboardShortcut.makeDescriptor('d', UI.KeyboardShor
tcut.Modifiers.CtrlOrMeta)], |
| 405 | 393 |
| 406 SoftUndo: [UI.KeyboardShortcut.makeDescriptor('u', UI.KeyboardShortcut.Modifie
rs.CtrlOrMeta)], | 394 SoftUndo: [UI.KeyboardShortcut.makeDescriptor('u', UI.KeyboardShortcut.Modifie
rs.CtrlOrMeta)], |
| 407 | 395 |
| 408 GotoMatchingBracket: [UI.KeyboardShortcut.makeDescriptor('m', UI.KeyboardShort
cut.Modifiers.Ctrl)], | 396 GotoMatchingBracket: [UI.KeyboardShortcut.makeDescriptor('m', UI.KeyboardShort
cut.Modifiers.Ctrl)], |
| 409 | 397 |
| 410 ToggleAutocompletion: | 398 ToggleAutocompletion: |
| 411 [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Space, UI.Key
boardShortcut.Modifiers.Ctrl)], | 399 [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Space, UI.Key
boardShortcut.Modifiers.Ctrl)], |
| 412 | 400 |
| 413 IncreaseCSSUnitByOne: | 401 IncreaseCSSUnitByOne: |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Plus, UI.Keyb
oardShortcut.Modifiers.Alt)], | 438 [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Plus, UI.Keyb
oardShortcut.Modifiers.Alt)], |
| 451 | 439 |
| 452 CloseEditorTab: [UI.KeyboardShortcut.makeDescriptor('w', UI.KeyboardShortcut.M
odifiers.Alt)], | 440 CloseEditorTab: [UI.KeyboardShortcut.makeDescriptor('w', UI.KeyboardShortcut.M
odifiers.Alt)], |
| 453 | 441 |
| 454 Save: [UI.KeyboardShortcut.makeDescriptor('s', UI.KeyboardShortcut.Modifiers.C
trlOrMeta)], | 442 Save: [UI.KeyboardShortcut.makeDescriptor('s', UI.KeyboardShortcut.Modifiers.C
trlOrMeta)], |
| 455 | 443 |
| 456 SaveAll: [UI.KeyboardShortcut.makeDescriptor( | 444 SaveAll: [UI.KeyboardShortcut.makeDescriptor( |
| 457 's', UI.KeyboardShortcut.Modifiers.CtrlOrMeta | UI.KeyboardShortcut.Modifi
ers.ShiftOrOption)], | 445 's', UI.KeyboardShortcut.Modifiers.CtrlOrMeta | UI.KeyboardShortcut.Modifi
ers.ShiftOrOption)], |
| 458 }; | 446 }; |
| 459 | 447 |
| 460 Components.ShortcutsScreen.LayersPanelShortcuts = { | 448 UI.ShortcutsScreen.LayersPanelShortcuts = { |
| 461 ResetView: [UI.KeyboardShortcut.makeDescriptor('0')], | 449 ResetView: [UI.KeyboardShortcut.makeDescriptor('0')], |
| 462 | 450 |
| 463 PanMode: [UI.KeyboardShortcut.makeDescriptor('x')], | 451 PanMode: [UI.KeyboardShortcut.makeDescriptor('x')], |
| 464 | 452 |
| 465 RotateMode: [UI.KeyboardShortcut.makeDescriptor('v')], | 453 RotateMode: [UI.KeyboardShortcut.makeDescriptor('v')], |
| 466 | 454 |
| 467 TogglePanRotate: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.
Shift)], | 455 TogglePanRotate: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.
Shift)], |
| 468 | 456 |
| 469 ZoomIn: [ | 457 ZoomIn: [ |
| 470 UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Plus, UI.Keyboar
dShortcut.Modifiers.Shift), | 458 UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Plus, UI.Keyboar
dShortcut.Modifiers.Shift), |
| 471 UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.NumpadPlus) | 459 UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.NumpadPlus) |
| 472 ], | 460 ], |
| 473 | 461 |
| 474 ZoomOut: [ | 462 ZoomOut: [ |
| 475 UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Minus, UI.Keyboa
rdShortcut.Modifiers.Shift), | 463 UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Minus, UI.Keyboa
rdShortcut.Modifiers.Shift), |
| 476 UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.NumpadMinus) | 464 UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.NumpadMinus) |
| 477 ], | 465 ], |
| 478 | 466 |
| 479 Up: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Up), UI.Keybo
ardShortcut.makeDescriptor('w')], | 467 Up: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Up), UI.Keybo
ardShortcut.makeDescriptor('w')], |
| 480 | 468 |
| 481 Down: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Down), UI.K
eyboardShortcut.makeDescriptor('s')], | 469 Down: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Down), UI.K
eyboardShortcut.makeDescriptor('s')], |
| 482 | 470 |
| 483 Left: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Left), UI.K
eyboardShortcut.makeDescriptor('a')], | 471 Left: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Left), UI.K
eyboardShortcut.makeDescriptor('a')], |
| 484 | 472 |
| 485 Right: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Right), UI
.KeyboardShortcut.makeDescriptor('d')] | 473 Right: [UI.KeyboardShortcut.makeDescriptor(UI.KeyboardShortcut.Keys.Right), UI
.KeyboardShortcut.makeDescriptor('d')] |
| 486 }; | 474 }; |
| OLD | NEW |