diff --git a/src/__celerity_resource_map__.php b/src/__celerity_resource_map__.php
index 76431744d8..7b6d2b1901 100644
--- a/src/__celerity_resource_map__.php
+++ b/src/__celerity_resource_map__.php
@@ -61,6 +61,15 @@ celerity_register_resource_map(array(
),
'disk' => '/rsrc/css/aphront/headsup-action-list-view.css',
),
+ 'aphront-list-filter-view-css' =>
+ array(
+ 'uri' => '/res/e6cff171/rsrc/css/aphront/list-filter-view.css',
+ 'type' => 'css',
+ 'requires' =>
+ array(
+ ),
+ 'disk' => '/rsrc/css/aphront/list-filter-view.css',
+ ),
0 =>
array(
'uri' => '/res/39de799e/rsrc/js/javelin/docs/Base.js',
@@ -71,15 +80,6 @@ celerity_register_resource_map(array(
),
'disk' => '/rsrc/js/javelin/docs/Base.js',
),
- 'aphront-list-filter-view-css' =>
- array(
- 'uri' => '/res/e6cff171/rsrc/css/aphront/list-filter-view.css',
- 'type' => 'css',
- 'requires' =>
- array(
- ),
- 'disk' => '/rsrc/css/aphront/list-filter-view.css',
- ),
'aphront-pager-view-css' =>
array(
'uri' => '/res/43fb79f0/rsrc/css/aphront/pager-view.css',
@@ -322,6 +322,18 @@ celerity_register_resource_map(array(
),
'disk' => '/rsrc/js/application/differential/behavior-add-reviewers.js',
),
+ 'javelin-behavior-differential-comment-jump' =>
+ array(
+ 'uri' => '/res/a84186de/rsrc/js/application/differential/behavior-comment-jump.js',
+ 'type' => 'js',
+ 'requires' =>
+ array(
+ 0 => 'javelin-behavior',
+ 1 => 'javelin-util',
+ 2 => 'javelin-dom',
+ ),
+ 'disk' => '/rsrc/js/application/differential/behavior-comment-jump.js',
+ ),
'javelin-behavior-differential-diff-radios' =>
array(
'uri' => '/res/004cb66f/rsrc/js/application/differential/behavior-diff-radios.js',
diff --git a/src/applications/differential/controller/changesetview/DifferentialChangesetViewController.php b/src/applications/differential/controller/changesetview/DifferentialChangesetViewController.php
index 54986233de..90f0eee714 100644
--- a/src/applications/differential/controller/changesetview/DifferentialChangesetViewController.php
+++ b/src/applications/differential/controller/changesetview/DifferentialChangesetViewController.php
@@ -192,6 +192,8 @@ class DifferentialChangesetViewController extends DifferentialController {
'whitespace' => $request->getStr('whitespace'),
));
+ Javelin::initBehavior('differential-comment-jump', array());
+
$detail = new DifferentialChangesetDetailView();
$detail->setChangeset($changeset);
$detail->appendChild($output);
@@ -219,7 +221,8 @@ class DifferentialChangesetViewController extends DifferentialController {
$output =
'
'.
- '
'.
+ '
'.
$detail->render().
'
'.
'
';
diff --git a/src/applications/differential/view/changesetlistview/DifferentialChangesetListView.php b/src/applications/differential/view/changesetlistview/DifferentialChangesetListView.php
index 0939a7c5a1..a3605a92a6 100644
--- a/src/applications/differential/view/changesetlistview/DifferentialChangesetListView.php
+++ b/src/applications/differential/view/changesetlistview/DifferentialChangesetListView.php
@@ -133,6 +133,8 @@ class DifferentialChangesetListView extends AphrontView {
'uri' => $this->renderURI,
));
+ Javelin::initBehavior('differential-comment-jump', array());
+
if ($this->editable) {
$revision = $this->revision;
Javelin::initBehavior('differential-edit-inline-comments', array(
@@ -141,7 +143,7 @@ class DifferentialChangesetListView extends AphrontView {
}
return
- '
'.
+ '
'.
implode("\n", $output).
'
';
}
diff --git a/src/applications/differential/view/inlinecomment/DifferentialInlineCommentView.php b/src/applications/differential/view/inlinecomment/DifferentialInlineCommentView.php
index 31644466f1..8d92b79c3b 100644
--- a/src/applications/differential/view/inlinecomment/DifferentialInlineCommentView.php
+++ b/src/applications/differential/view/inlinecomment/DifferentialInlineCommentView.php
@@ -82,6 +82,24 @@ final class DifferentialInlineCommentView extends AphrontView {
$links = array();
+ $links[] = javelin_render_tag(
+ 'a',
+ array(
+ 'href' => '#',
+ 'mustcapture' => true,
+ 'sigil' => 'differential-inline-prev',
+ ),
+ 'Previous');
+
+ $links[] = javelin_render_tag(
+ 'a',
+ array(
+ 'href' => '#',
+ 'mustcapture' => true,
+ 'sigil' => 'differential-inline-next',
+ ),
+ 'Next');
+
$links[] = javelin_render_tag(
'a',
array(
diff --git a/webroot/rsrc/js/application/differential/behavior-comment-jump.js b/webroot/rsrc/js/application/differential/behavior-comment-jump.js
new file mode 100644
index 0000000000..217c85b078
--- /dev/null
+++ b/webroot/rsrc/js/application/differential/behavior-comment-jump.js
@@ -0,0 +1,29 @@
+/**
+ * @provides javelin-behavior-differential-comment-jump
+ * @requires javelin-behavior
+ * javelin-util
+ * javelin-dom
+ */
+
+JX.behavior('differential-comment-jump', function(config) {
+ function handle_jump(offset) {
+ return (function(e) {
+ var parent = JX.$('differential-review-stage');
+ var clicked = e.getNode('differential-inline-comment');
+ var inlines = JX.DOM.scry(parent, 'div', 'differential-inline-comment');
+ var jumpto = null;
+
+ for (var ii = 0; ii < inlines.length; ii++) {
+ if (inlines[ii] == clicked) {
+ jumpto = inlines[(ii + offset + inlines.length) % inlines.length];
+ break;
+ }
+ }
+ JX.DOM.scrollTo(jumpto);
+ e.kill();
+ });
+ }
+
+ JX.Stratcom.listen('click', 'differential-inline-prev', handle_jump(-1));
+ JX.Stratcom.listen('click', 'differential-inline-next', handle_jump(+1));
+});