Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/js/application/diff/DiffChangesetList.js
| Show First 20 Lines • Show All 188 Lines • ▼ Show 20 Lines | wake: function() { | ||||
| label = pht('Jump to next inline comment, including collapsed comments.'); | label = pht('Jump to next inline comment, including collapsed comments.'); | ||||
| 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); | ||||
| var formation = this.getFormationView(); | |||||
| if (formation) { | |||||
| var filetree = formation.getColumn(0); | |||||
| var toggletree = JX.bind(filetree, filetree.toggleVisibility); | |||||
| this._installKey('f', 'diff-vis', label, toggletree); | |||||
| } | |||||
| if (!standalone) { | if (!standalone) { | ||||
| label = pht('Hide or show the current file.'); | label = pht('Hide or show the current file.'); | ||||
| this._installKey('h', 'diff-vis', label, this._onkeytogglefile); | this._installKey('h', 'diff-vis', label, this._onkeytogglefile); | ||||
| } | } | ||||
| label = pht('Reply to selected inline comment or change.'); | label = pht('Reply to selected inline comment or change.'); | ||||
| this._installKey('r', 'inline', label, | this._installKey('r', 'inline', label, | ||||
| JX.bind(this, this._onkeyreply, false)); | JX.bind(this, this._onkeyreply, false)); | ||||
| ▲ Show 20 Lines • Show All 473 Lines • ▼ Show 20 Lines | _redrawSelection: function(scroll) { | ||||
| // a new empty comment, then use the "Unsaved" button to select it, then | // a new empty comment, then use the "Unsaved" button to select it, then | ||||
| // cancel it), we can still keep the cursor here but do not want to show | // cancel it), we can still keep the cursor here but do not want to show | ||||
| // a selection reticle over an invisible node. | // a selection reticle over an invisible node. | ||||
| if (cursor.deleted) { | if (cursor.deleted) { | ||||
| this.setFocus(null); | this.setFocus(null); | ||||
| return; | return; | ||||
| } | } | ||||
| var tree = this._getTreeView(); | |||||
| if (cursor.changeset) { | |||||
| tree.setSelectedPath(cursor.changeset.getPathView()); | |||||
| } else { | |||||
| tree.setSelectedPath(null); | |||||
| } | |||||
| this.setFocus(cursor.nodes.begin, cursor.nodes.end); | this.setFocus(cursor.nodes.begin, cursor.nodes.end); | ||||
| if (scroll) { | if (scroll) { | ||||
| var pos = JX.$V(cursor.nodes.begin); | var pos = JX.$V(cursor.nodes.begin); | ||||
| JX.DOM.scrollToPosition(0, pos.y - 60); | JX.DOM.scrollToPosition(0, pos.y - 60); | ||||
| } | } | ||||
| return this; | return this; | ||||
| ▲ Show 20 Lines • Show All 440 Lines • ▼ Show 20 Lines | redrawPreview: function() { | ||||
| // Clear the mouse hover reticle after a substantive edit: we don't get | // Clear the mouse hover reticle after a substantive edit: we don't get | ||||
| // a "mouseout" event if the row vanished because of row being removed | // a "mouseout" event if the row vanished because of row being removed | ||||
| // after an edit. | // after an edit. | ||||
| this.resetHover(); | this.resetHover(); | ||||
| }, | }, | ||||
| setFocus: function(node, extended_node) { | setFocus: function(node, extended_node) { | ||||
| if (!node) { | |||||
| var tree = this._getTreeView(); | |||||
| tree.setSelectedPath(null); | |||||
| } | |||||
| this._focusStart = node; | this._focusStart = node; | ||||
| this._focusEnd = extended_node; | this._focusEnd = extended_node; | ||||
| this._redrawFocus(); | this._redrawFocus(); | ||||
| }, | }, | ||||
| _redrawFocus: function() { | _redrawFocus: function() { | ||||
| var node = this._focusStart; | var node = this._focusStart; | ||||
| var extended_node = this._focusEnd || node; | var extended_node = this._focusEnd || node; | ||||
| ▲ Show 20 Lines • Show All 338 Lines • ▼ Show 20 Lines | _redrawBanner: function() { | ||||
| var node = this._getBannerNode(); | var node = this._getBannerNode(); | ||||
| var changeset = this._getVisibleChangeset(); | var changeset = this._getVisibleChangeset(); | ||||
| var tree = this._getTreeView(); | var tree = this._getTreeView(); | ||||
| var formation = this.getFormationView(); | var formation = this.getFormationView(); | ||||
| if (!changeset) { | if (!changeset) { | ||||
| this._bannerChangeset = null; | this._bannerChangeset = null; | ||||
| JX.DOM.remove(node); | JX.DOM.remove(node); | ||||
| tree.setSelectedPath(null); | tree.setFocusedPath(null); | ||||
| if (formation) { | if (formation) { | ||||
| formation.repaint(); | formation.repaint(); | ||||
| } | } | ||||
| return; | return; | ||||
| } | } | ||||
| // Don't do anything if nothing has changed. This seems to avoid some | // Don't do anything if nothing has changed. This seems to avoid some | ||||
| // flickering issues in Safari, at least. | // flickering issues in Safari, at least. | ||||
| if (this._bannerChangeset === changeset) { | if (this._bannerChangeset === changeset) { | ||||
| return; | return; | ||||
| } | } | ||||
| this._bannerChangeset = changeset; | this._bannerChangeset = changeset; | ||||
| var paths = tree.getPaths(); | var paths = tree.getPaths(); | ||||
| for (var ii = 0; ii < paths.length; ii++) { | for (var ii = 0; ii < paths.length; ii++) { | ||||
| var path = paths[ii]; | var path = paths[ii]; | ||||
| if (path.getChangeset() === changeset) { | if (path.getChangeset() === changeset) { | ||||
| tree.setSelectedPath(path); | tree.setFocusedPath(path); | ||||
| } | } | ||||
| } | } | ||||
| var inlines = this._getInlinesByType(); | var inlines = this._getInlinesByType(); | ||||
| var unsaved = inlines.unsaved; | var unsaved = inlines.unsaved; | ||||
| var unsubmitted = inlines.unsubmitted; | var unsubmitted = inlines.unsubmitted; | ||||
| var undone = inlines.undone; | var undone = inlines.undone; | ||||
| ▲ Show 20 Lines • Show All 509 Lines • Show Last 20 Lines | |||||