Page MenuHomePhabricator

D18936.diff
No OneTemporary

D18936.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -13,7 +13,7 @@
'core.pkg.js' => '4c79d74f',
'darkconsole.pkg.js' => '1f9a31bc',
'differential.pkg.css' => '45951e9e',
- 'differential.pkg.js' => '500a75c5',
+ 'differential.pkg.js' => 'c1af2de3',
'diffusion.pkg.css' => 'a2d17c7d',
'diffusion.pkg.js' => '6134c5a1',
'favicon.ico' => '30672e08',
@@ -443,7 +443,7 @@
'rsrc/js/application/releeph/releeph-preview-branch.js' => 'b2b4fbaf',
'rsrc/js/application/releeph/releeph-request-state-change.js' => 'a0b57eb8',
'rsrc/js/application/releeph/releeph-request-typeahead.js' => 'de2e896f',
- 'rsrc/js/application/repository/repository-crossreference.js' => '7fe9bc12',
+ 'rsrc/js/application/repository/repository-crossreference.js' => 'c5627622',
'rsrc/js/application/search/behavior-reorder-profile-menu-items.js' => 'e2e0a072',
'rsrc/js/application/search/behavior-reorder-queries.js' => 'e9581f08',
'rsrc/js/application/slowvote/behavior-slowvote-embed.js' => '887ad43f',
@@ -692,7 +692,7 @@
'javelin-behavior-reorder-applications' => '76b9fc3e',
'javelin-behavior-reorder-columns' => 'e1d25dfb',
'javelin-behavior-reorder-profile-menu-items' => 'e2e0a072',
- 'javelin-behavior-repository-crossreference' => '7fe9bc12',
+ 'javelin-behavior-repository-crossreference' => 'c5627622',
'javelin-behavior-scrollbar' => '834a1173',
'javelin-behavior-search-reorder-queries' => 'e9581f08',
'javelin-behavior-select-content' => 'bf5374ef',
@@ -1555,12 +1555,6 @@
'7f243deb' => array(
'javelin-install',
),
- '7fe9bc12' => array(
- 'javelin-behavior',
- 'javelin-dom',
- 'javelin-stratcom',
- 'javelin-uri',
- ),
'834a1173' => array(
'javelin-behavior',
'javelin-scrollbar',
@@ -1928,6 +1922,12 @@
'javelin-stratcom',
'phabricator-tooltip',
),
+ 'c5627622' => array(
+ 'javelin-behavior',
+ 'javelin-dom',
+ 'javelin-stratcom',
+ 'javelin-uri',
+ ),
'c587b80f' => array(
'javelin-install',
),
diff --git a/src/applications/differential/view/DifferentialChangesetDetailView.php b/src/applications/differential/view/DifferentialChangesetDetailView.php
--- a/src/applications/differential/view/DifferentialChangesetDetailView.php
+++ b/src/applications/differential/view/DifferentialChangesetDetailView.php
@@ -204,6 +204,7 @@
'loaded' => $this->getLoaded(),
'undoTemplates' => hsprintf('%s', $renderer->renderUndoTemplates()),
'displayPath' => hsprintf('%s', $display_parts),
+ 'path' => $display_filename,
'icon' => $display_icon,
),
'class' => $class,
diff --git a/webroot/rsrc/js/application/repository/repository-crossreference.js b/webroot/rsrc/js/application/repository/repository-crossreference.js
--- a/webroot/rsrc/js/application/repository/repository-crossreference.js
+++ b/webroot/rsrc/js/application/repository/repository-crossreference.js
@@ -96,6 +96,17 @@
if (target.hasAttribute('data-symbol-name')) {
symbol = target.getAttribute('data-symbol-name');
}
+
+ var line = getLineNumber(target);
+ if (line !== null) {
+ query.line = line;
+ }
+
+ var path = getPath(target);
+ if (path !== null) {
+ query.path = path;
+ }
+
var uri = JX.$U('/diffusion/symbol/' + symbol + '/');
uri.addQueryParams(query);
window.open(uri);
@@ -111,6 +122,57 @@
}
}
+ function getLineNumber(target) {
+
+ // Figure out the line number by finding the most recent "<th />" in this
+ // row with a number in it. We may need to skip over one "<th />" if the
+ // diff is being displayed in unified mode.
+
+ var cell = JX.DOM.findAbove(target, 'td');
+ if (!cell) {
+ return null;
+ }
+
+ var row = JX.DOM.findAbove(target, 'tr');
+ if (!row) {
+ return null;
+ }
+
+ var ii;
+
+ var cell_list = [];
+ for (ii = 0; ii < row.childNodes.length; ii++) {
+ cell_list.push(row.childNodes[ii]);
+ }
+ cell_list.reverse();
+
+ var found = false;
+ for (ii = 0; ii < cell_list.length; ii++) {
+ if (cell_list[ii] === cell) {
+ found = true;
+ }
+
+ if (found && JX.DOM.isType(cell_list[ii], 'th')) {
+ var int_value = parseInt(cell_list[ii].textContent, 10);
+ if (int_value) {
+ return int_value;
+ }
+ }
+ }
+
+ return null;
+ }
+
+ function getPath(target) {
+ var changeset = JX.DOM.findAbove(target, 'div', 'differential-changeset');
+
+ if (!changeset) {
+ return null;
+ }
+
+ return JX.Stratcom.getData(changeset).path;
+ }
+
if (config.container) {
link(JX.$(config.container), config.lang);
} else if (config.section) {

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 16, 11:14 PM (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7707826
Default Alt Text
D18936.diff (4 KB)

Event Timeline