Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/diff/DiffChangesetList.js
| Show First 20 Lines • Show All 205 Lines • ▼ Show 20 Lines | wake: function() { | ||||
| this._installKey('w', label, this._onkeydone); | this._installKey('w', label, this._onkeydone); | ||||
| label = pht('Collapse or expand inline comment.'); | label = pht('Collapse or expand inline comment.'); | ||||
| this._installKey('q', label, this._onkeycollapse); | this._installKey('q', label, this._onkeycollapse); | ||||
| label = pht('Hide or show all inline comments.'); | label = pht('Hide or show all inline comments.'); | ||||
| this._installKey('A', label, this._onkeyhideall); | this._installKey('A', label, this._onkeyhideall); | ||||
| label = pht('Open file in external editor.'); | |||||
| this._installKey('\\', label, this._onkeyopeneditor); | |||||
| }, | }, | ||||
| isAsleep: function() { | isAsleep: function() { | ||||
| return this._asleep; | return this._asleep; | ||||
| }, | }, | ||||
| newChangesetForNode: function(node) { | newChangesetForNode: function(node) { | ||||
| var changeset = JX.DiffChangeset.getForNode(node); | var changeset = JX.DiffChangeset.getForNode(node); | ||||
| ▲ Show 20 Lines • Show All 223 Lines • ▼ Show 20 Lines | _onkeytogglefile: function() { | ||||
| return; | return; | ||||
| } | } | ||||
| } | } | ||||
| var pht = this.getTranslations(); | var pht = this.getTranslations(); | ||||
| this._warnUser(pht('You must select a file to hide or show.')); | this._warnUser(pht('You must select a file to hide or show.')); | ||||
| }, | }, | ||||
| _onkeyopeneditor: function() { | |||||
| var pht = this.getTranslations(); | |||||
| var cursor = this._cursorItem; | |||||
| if (cursor) { | |||||
| if (cursor.type == 'file') { | |||||
| var changeset = cursor.changeset; | |||||
| var editor_uri = changeset.getEditorURI(); | |||||
| if (editor_uri === null) { | |||||
| this._warnUser(pht('No external editor is configured.')); | |||||
| return; | |||||
| } | |||||
| JX.$U(editor_uri).go(); | |||||
| return; | |||||
| } | |||||
| } | |||||
| this._warnUser(pht('You must select a file to edit.')); | |||||
| }, | |||||
| _onkeycollapse: function() { | _onkeycollapse: function() { | ||||
| var cursor = this._cursorItem; | var cursor = this._cursorItem; | ||||
| if (cursor) { | if (cursor) { | ||||
| if (cursor.type == 'comment') { | if (cursor.type == 'comment') { | ||||
| var inline = cursor.target; | var inline = cursor.target; | ||||
| if (inline.canCollapse()) { | if (inline.canCollapse()) { | ||||
| this.setFocus(null); | this.setFocus(null); | ||||
| ▲ Show 20 Lines • Show All 383 Lines • ▼ Show 20 Lines | _onmenu: function(e) { | ||||
| e.prevent(); | e.prevent(); | ||||
| menu.close(); | menu.close(); | ||||
| }); | }); | ||||
| list.addItem(engine_item); | list.addItem(engine_item); | ||||
| add_link('fa-arrow-left', pht('Show Raw File (Left)'), data.leftURI); | add_link('fa-arrow-left', pht('Show Raw File (Left)'), data.leftURI); | ||||
| add_link('fa-arrow-right', pht('Show Raw File (Right)'), data.rightURI); | add_link('fa-arrow-right', pht('Show Raw File (Right)'), data.rightURI); | ||||
| add_link('fa-pencil', pht('Open in Editor'), data.editor, true); | |||||
| add_link('fa-wrench', pht('Configure Editor'), data.editorConfigure); | var editor_uri = changeset.getEditorURI(); | ||||
| if (editor_uri !== null) { | |||||
| add_link('fa-pencil', pht('Open in Editor'), editor_uri, true); | |||||
| } else { | |||||
| var configure_uri = changeset.getEditorConfigureURI(); | |||||
| if (configure_uri !== null) { | |||||
| add_link('fa-wrench', pht('Configure Editor'), configure_uri); | |||||
| } | |||||
| } | |||||
| menu.setContent(list.getNode()); | menu.setContent(list.getNode()); | ||||
| menu.listen('open', function() { | menu.listen('open', function() { | ||||
| // When the user opens the menu, check if there are any "Show More" | // When the user opens the menu, check if there are any "Show More" | ||||
| // links in the changeset body. If there aren't, disable the "Show | // links in the changeset body. If there aren't, disable the "Show | ||||
| // Entire File" menu item since it won't change anything. | // Entire File" menu item since it won't change anything. | ||||
| ▲ Show 20 Lines • Show All 1,056 Lines • Show Last 20 Lines | |||||