Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/diff/DiffChangesetList.js
| Show First 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | wake: function() { | ||||
| // We may be viewing the normal "/D123" view (with all the changesets) | // We may be viewing the normal "/D123" view (with all the changesets) | ||||
| // or the standalone view (with just one changeset). In the standalone | // or the standalone view (with just one changeset). In the standalone | ||||
| // view, some options (like jumping to next or previous file) do not | // view, some options (like jumping to next or previous file) do not | ||||
| // make sense and do not function. | // make sense and do not function. | ||||
| var standalone = this.getIsStandalone(); | var standalone = this.getIsStandalone(); | ||||
| var label; | var label; | ||||
| if (!standalone) { | |||||
| label = pht('Jump to the table of contents.'); | |||||
| this._installKey('t', 'diff-nav', label, this._ontoc); | |||||
| } | |||||
| label = pht('Jump to next change.'); | label = pht('Jump to next change.'); | ||||
| this._installJumpKey('j', label, 1); | this._installJumpKey('j', label, 1); | ||||
| label = pht('Jump to previous change.'); | label = pht('Jump to previous change.'); | ||||
| this._installJumpKey('k', label, -1); | this._installJumpKey('k', label, -1); | ||||
| if (!standalone) { | if (!standalone) { | ||||
| label = pht('Jump to next file.'); | label = pht('Jump to next file.'); | ||||
| Show All 13 Lines | wake: function() { | ||||
| this._installJumpKey('N', label, 1, 'comment', true); | this._installJumpKey('N', label, 1, 'comment', true); | ||||
| label = pht( | label = pht( | ||||
| 'Jump to previous inline comment, including collapsed comments.'); | 'Jump to previous inline comment, including collapsed comments.'); | ||||
| this._installJumpKey('P', label, -1, 'comment', true); | this._installJumpKey('P', label, -1, 'comment', true); | ||||
| if (!standalone) { | if (!standalone) { | ||||
| label = pht('Hide or show the current file.'); | label = pht('Hide or show the current file.'); | ||||
| this._installKey('h', label, this._onkeytogglefile); | this._installKey('h', 'diff-vis', label, this._onkeytogglefile); | ||||
| label = pht('Jump to the table of contents.'); | |||||
| this._installKey('t', label, this._ontoc); | |||||
| } | } | ||||
| label = pht('Reply to selected inline comment or change.'); | label = pht('Reply to selected inline comment or change.'); | ||||
| this._installKey('r', label, JX.bind(this, this._onkeyreply, false)); | this._installKey('r', 'inline', label, | ||||
| JX.bind(this, this._onkeyreply, false)); | |||||
| label = pht('Reply and quote selected inline comment.'); | label = pht('Reply and quote selected inline comment.'); | ||||
| this._installKey('R', label, JX.bind(this, this._onkeyreply, true)); | this._installKey('R', 'inline', label, | ||||
| JX.bind(this, this._onkeyreply, true)); | |||||
| label = pht('Edit selected inline comment.'); | label = pht('Edit selected inline comment.'); | ||||
| this._installKey('e', label, this._onkeyedit); | this._installKey('e', 'inline', label, this._onkeyedit); | ||||
| label = pht('Mark or unmark selected inline comment as done.'); | label = pht('Mark or unmark selected inline comment as done.'); | ||||
| this._installKey('w', label, this._onkeydone); | this._installKey('w', 'inline', 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', 'diff-vis', 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', 'diff-vis', label, this._onkeyhideall); | ||||
| label = pht('Open file in external editor.'); | label = pht('Open file in external editor.'); | ||||
| this._installKey('\\', label, this._onkeyopeneditor); | this._installKey('\\', 'diff-nav', label, this._onkeyopeneditor); | ||||
| }, | }, | ||||
| isAsleep: function() { | isAsleep: function() { | ||||
| return this._asleep; | return this._asleep; | ||||
| }, | }, | ||||
| newChangesetForNode: function(node) { | newChangesetForNode: function(node) { | ||||
| ▲ Show 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | _onload: function(e) { | ||||
| // TODO: Move this into Changeset. | // TODO: Move this into Changeset. | ||||
| var routable = changeset.getRoutable(); | var routable = changeset.getRoutable(); | ||||
| if (routable) { | if (routable) { | ||||
| routable.setPriority(2000); | routable.setPriority(2000); | ||||
| } | } | ||||
| }, | }, | ||||
| _installKey: function(key, label, handler) { | _installKey: function(key, group, label, handler) { | ||||
| handler = JX.bind(this, this._ifawake, handler); | handler = JX.bind(this, this._ifawake, handler); | ||||
| return new JX.KeyboardShortcut(key, label) | return new JX.KeyboardShortcut(key, label) | ||||
| .setHandler(handler) | .setHandler(handler) | ||||
| .setGroup(group) | |||||
| .register(); | .register(); | ||||
| }, | }, | ||||
| _installJumpKey: function(key, label, delta, filter, show_collapsed) { | _installJumpKey: function(key, label, delta, filter, show_collapsed) { | ||||
| filter = filter || null; | filter = filter || null; | ||||
| var options = { | var options = { | ||||
| filter: filter, | filter: filter, | ||||
| collapsed: show_collapsed | collapsed: show_collapsed | ||||
| }; | }; | ||||
| var handler = JX.bind(this, this._onjumpkey, delta, options); | var handler = JX.bind(this, this._onjumpkey, delta, options); | ||||
| return this._installKey(key, label, handler); | return this._installKey(key, 'diff-nav', label, handler); | ||||
| }, | }, | ||||
| _ontoc: function(manager) { | _ontoc: function(manager) { | ||||
| var toc = JX.$('toc'); | var toc = JX.$('toc'); | ||||
| manager.scrollTo(toc); | manager.scrollTo(toc); | ||||
| }, | }, | ||||
| getSelectedInline: function() { | getSelectedInline: function() { | ||||
| ▲ Show 20 Lines • Show All 1,639 Lines • Show Last 20 Lines | |||||