@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix an issue where the repository symbol index would incorrectly activate inside inline comments

Summary:
See PHI185. When looking at a revision, you can Command-Click (Mac) symbols to jump to their definitions (provided the symbol index has been built).

Currently, the code works on any node inside the changeset list, so it activates when clicking links inside inline comments and opening them in a new window.

To avoid this, don't activate if we're inside an inline comment. This technically prevents you from doing a symbol lookup on a symbol inside a codeblock inside an inline, but that seems fine/reasonable.

Test Plan: Wrote `Dxxx` in an inline, command-clicked it. Before: got a symbol lookup. After: just a new tab with the revision.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D18753

+22 -11
+9 -9
resources/celerity/map.php
··· 13 13 'core.pkg.js' => '4c79d74f', 14 14 'darkconsole.pkg.js' => '1f9a31bc', 15 15 'differential.pkg.css' => '45951e9e', 16 - 'differential.pkg.js' => 'b71b8c5d', 16 + 'differential.pkg.js' => 'ae6460e0', 17 17 'diffusion.pkg.css' => 'a2d17c7d', 18 18 'diffusion.pkg.js' => '6134c5a1', 19 19 'favicon.ico' => '30672e08', ··· 444 444 'rsrc/js/application/releeph/releeph-preview-branch.js' => 'b2b4fbaf', 445 445 'rsrc/js/application/releeph/releeph-request-state-change.js' => 'a0b57eb8', 446 446 'rsrc/js/application/releeph/releeph-request-typeahead.js' => 'de2e896f', 447 - 'rsrc/js/application/repository/repository-crossreference.js' => 'e5339c43', 447 + 'rsrc/js/application/repository/repository-crossreference.js' => '7fe9bc12', 448 448 'rsrc/js/application/search/behavior-reorder-profile-menu-items.js' => 'e2e0a072', 449 449 'rsrc/js/application/search/behavior-reorder-queries.js' => 'e9581f08', 450 450 'rsrc/js/application/slowvote/behavior-slowvote-embed.js' => '887ad43f', ··· 690 690 'javelin-behavior-reorder-applications' => '76b9fc3e', 691 691 'javelin-behavior-reorder-columns' => 'e1d25dfb', 692 692 'javelin-behavior-reorder-profile-menu-items' => 'e2e0a072', 693 - 'javelin-behavior-repository-crossreference' => 'e5339c43', 693 + 'javelin-behavior-repository-crossreference' => '7fe9bc12', 694 694 'javelin-behavior-scrollbar' => '834a1173', 695 695 'javelin-behavior-search-reorder-queries' => 'e9581f08', 696 696 'javelin-behavior-select-content' => 'bf5374ef', ··· 1546 1546 '7f243deb' => array( 1547 1547 'javelin-install', 1548 1548 ), 1549 + '7fe9bc12' => array( 1550 + 'javelin-behavior', 1551 + 'javelin-dom', 1552 + 'javelin-stratcom', 1553 + 'javelin-uri', 1554 + ), 1549 1555 '834a1173' => array( 1550 1556 'javelin-behavior', 1551 1557 'javelin-scrollbar', ··· 2072 2078 'e4cc26b3' => array( 2073 2079 'javelin-behavior', 2074 2080 'javelin-dom', 2075 - ), 2076 - 'e5339c43' => array( 2077 - 'javelin-behavior', 2078 - 'javelin-dom', 2079 - 'javelin-stratcom', 2080 - 'javelin-uri', 2081 2081 ), 2082 2082 'e5822781' => array( 2083 2083 'javelin-behavior',
+13 -2
webroot/rsrc/js/application/repository/repository-crossreference.js
··· 46 46 if (!isSignalkey(e)) { 47 47 return; 48 48 } 49 + 50 + var target = e.getTarget(); 51 + 52 + try { 53 + // If we're in an inline comment, don't link symbols. 54 + if (JX.DOM.findAbove(target, 'div', 'differential-inline-comment')) { 55 + return; 56 + } 57 + } catch (ex) { 58 + // Continue if we're not inside an inline comment. 59 + } 60 + 49 61 if (e.getType() === 'mouseover') { 50 - var target = e.getTarget(); 51 62 while (target !== document.body) { 52 63 if (JX.DOM.isNode(target, 'span') && 53 64 (target.className in class_map)) { ··· 58 69 target = target.parentNode; 59 70 } 60 71 } else if (e.getType() === 'click') { 61 - openSearch(e.getTarget(), lang); 72 + openSearch(target, lang); 62 73 } 63 74 }); 64 75 }