diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 3c51b869d9..e30ed96c13 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -460,7 +460,7 @@ return array( 'rsrc/js/core/behavior-keyboard-shortcuts.js' => 'd75709e6', 'rsrc/js/core/behavior-konami.js' => '5bc2cb21', 'rsrc/js/core/behavior-lightbox-attachments.js' => '3aa45ad9', - 'rsrc/js/core/behavior-line-linker.js' => 'bc778103', + 'rsrc/js/core/behavior-line-linker.js' => '0969ff43', 'rsrc/js/core/behavior-more.js' => '9b9197be', 'rsrc/js/core/behavior-object-selector.js' => 'e6f67523', 'rsrc/js/core/behavior-oncopy.js' => 'c3e218fe', @@ -601,7 +601,7 @@ return array( 'javelin-behavior-phabricator-hovercards' => '9c808199', 'javelin-behavior-phabricator-keyboard-pager' => 'b657bdf8', 'javelin-behavior-phabricator-keyboard-shortcuts' => 'd75709e6', - 'javelin-behavior-phabricator-line-linker' => 'bc778103', + 'javelin-behavior-phabricator-line-linker' => '0969ff43', 'javelin-behavior-phabricator-nav' => 'b5842a5e', 'javelin-behavior-phabricator-notification-example' => 'c51a6616', 'javelin-behavior-phabricator-object-selector' => 'e6f67523', @@ -864,6 +864,13 @@ return array( array( 0 => 'javelin-install', ), + '0969ff43' => + array( + 0 => 'javelin-behavior', + 1 => 'javelin-stratcom', + 2 => 'javelin-dom', + 3 => 'javelin-history', + ), '09b15cf1' => array( 0 => 'javelin-stratcom', @@ -1683,13 +1690,6 @@ return array( 0 => 'javelin-install', 1 => 'javelin-dom', ), - 'bc778103' => - array( - 0 => 'javelin-behavior', - 1 => 'javelin-stratcom', - 2 => 'javelin-dom', - 3 => 'javelin-history', - ), 'bd0aedcd' => array( 0 => 'javelin-install', diff --git a/src/applications/diffusion/controller/DiffusionBrowseFileController.php b/src/applications/diffusion/controller/DiffusionBrowseFileController.php index 0e0825ba42..fdeeabdb56 100644 --- a/src/applications/diffusion/controller/DiffusionBrowseFileController.php +++ b/src/applications/diffusion/controller/DiffusionBrowseFileController.php @@ -413,6 +413,7 @@ final class DiffusionBrowseFileController extends DiffusionBrowseController { $callsign = $repository->getCallsign(); $editor_link = $user->loadEditorLink($path, $line, $callsign); + $template = $user->loadEditorLink($path, '%l', $callsign); $icon_edit = id(new PHUIIconView()) ->setIconFont('fa-pencil'); @@ -421,6 +422,8 @@ final class DiffusionBrowseFileController extends DiffusionBrowseController { ->setText(pht('Open in Editor')) ->setHref($editor_link) ->setIcon($icon_edit) + ->setID('editor_link') + ->setMetadata(array('link_template' => $template)) ->setDisabled(!$editor_link); return $button; diff --git a/webroot/rsrc/js/core/behavior-line-linker.js b/webroot/rsrc/js/core/behavior-line-linker.js index 9175b725e8..2a564b7125 100644 --- a/webroot/rsrc/js/core/behavior-line-linker.js +++ b/webroot/rsrc/js/core/behavior-line-linker.js @@ -10,6 +10,7 @@ JX.behavior('phabricator-line-linker', function() { var origin = null; var target = null; var root = null; + var editor_link = JX.$('editor_link'); function getRowNumber(tr) { var th = JX.DOM.find(tr, 'th', 'phabricator-source-line'); @@ -79,6 +80,10 @@ JX.behavior('phabricator-line-linker', function() { target = null; e.kill(); JX.History.replace(uri); + if (editor_link.href) { + editdata = JX.Stratcom.getData(editor_link); + editor_link.href = editdata.link_template.replace('%25l', o); + } }); });