diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 8c6db3a4cd..fd451b1c56 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -13,7 +13,7 @@ return array( 'core.pkg.js' => '1e667bcb', 'dark-console.pkg.js' => '187792c2', 'differential.pkg.css' => 'd71d4531', - 'differential.pkg.js' => '21616a78', + 'differential.pkg.js' => 'b3e29cb8', 'diffusion.pkg.css' => '42c75c37', 'diffusion.pkg.js' => 'a98c0bf7', 'maniphest.pkg.css' => '35995d6d', @@ -381,7 +381,7 @@ return array( 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => '0116d3e8', 'rsrc/js/application/diff/DiffChangeset.js' => '20715b98', 'rsrc/js/application/diff/DiffChangesetList.js' => '40d6c41c', - 'rsrc/js/application/diff/DiffInline.js' => '15de2478', + 'rsrc/js/application/diff/DiffInline.js' => '6227a0e3', 'rsrc/js/application/diff/DiffPathView.js' => '8207abf9', 'rsrc/js/application/diff/DiffTreeView.js' => '5d83623b', 'rsrc/js/application/differential/behavior-diff-radios.js' => '925fe8cd', @@ -776,7 +776,7 @@ return array( 'phabricator-dashboard-css' => '5a205b9d', 'phabricator-diff-changeset' => '20715b98', 'phabricator-diff-changeset-list' => '40d6c41c', - 'phabricator-diff-inline' => '15de2478', + 'phabricator-diff-inline' => '6227a0e3', 'phabricator-diff-path-view' => '8207abf9', 'phabricator-diff-tree-view' => '5d83623b', 'phabricator-drag-and-drop-file-upload' => '4370900d', @@ -1034,9 +1034,6 @@ return array( 'javelin-stratcom', 'javelin-util', ), - '15de2478' => array( - 'javelin-dom', - ), '1a844c06' => array( 'javelin-install', 'javelin-util', @@ -1511,6 +1508,9 @@ return array( '60cd9241' => array( 'javelin-behavior', ), + '6227a0e3' => array( + 'javelin-dom', + ), '6337cf26' => array( 'javelin-behavior', 'javelin-dom', diff --git a/src/applications/transactions/storage/PhabricatorApplicationTransactionComment.php b/src/applications/transactions/storage/PhabricatorApplicationTransactionComment.php index 3239125249..896b45556a 100644 --- a/src/applications/transactions/storage/PhabricatorApplicationTransactionComment.php +++ b/src/applications/transactions/storage/PhabricatorApplicationTransactionComment.php @@ -101,6 +101,11 @@ abstract class PhabricatorApplicationTransactionComment return ($this->oldComment !== self::ATTACHABLE); } + public function getRawRemarkupURI() { + return urisprintf( + '/transactions/raw/%s/', + $this->getTransactionPHID()); + } /* -( PhabricatorMarkupInterface )----------------------------------------- */ diff --git a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php index e5d9313877..404ff40194 100644 --- a/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php +++ b/src/infrastructure/diff/view/PHUIDiffInlineCommentDetailView.php @@ -173,12 +173,6 @@ final class PHUIDiffInlineCommentDetailView 'action' => 'edit', 'key' => 'e', ); - - $menu_items[] = array( - 'label' => pht('Delete Comment'), - 'icon' => 'fa-trash-o', - 'action' => 'delete', - ); } else if ($is_preview) { $links[] = javelin_tag( 'a', @@ -236,6 +230,28 @@ final class PHUIDiffInlineCommentDetailView ); } + if (!$is_preview) { + $xaction_phid = $inline->getTransactionPHID(); + $storage = $inline->getStorageObject(); + + if ($xaction_phid) { + $menu_items[] = array( + 'label' => pht('View Raw Remarkup'), + 'icon' => 'fa-code', + 'action' => 'raw', + 'uri' => $storage->getRawRemarkupURI(), + ); + } + } + + if ($this->editable && !$is_preview) { + $menu_items[] = array( + 'label' => pht('Delete Comment'), + 'icon' => 'fa-trash-o', + 'action' => 'delete', + ); + } + $done_button = null; $mark_done = $this->getCanMarkDone(); diff --git a/src/view/phui/PHUITimelineEventView.php b/src/view/phui/PHUITimelineEventView.php index 83c1889ed7..73acf437af 100644 --- a/src/view/phui/PHUITimelineEventView.php +++ b/src/view/phui/PHUITimelineEventView.php @@ -705,7 +705,7 @@ final class PHUITimelineEventView extends AphrontView { $items[] = id(new PhabricatorActionView()) ->setIcon('fa-code') ->setHref('/transactions/raw/'.$xaction_phid.'/') - ->setName(pht('View Remarkup')) + ->setName(pht('View Raw Remarkup')) ->addSigil('transaction-raw') ->setMetadata( array( diff --git a/webroot/rsrc/js/application/diff/DiffInline.js b/webroot/rsrc/js/application/diff/DiffInline.js index 654dcfa85e..4d29c78de0 100644 --- a/webroot/rsrc/js/application/diff/DiffInline.js +++ b/webroot/rsrc/js/application/diff/DiffInline.js @@ -921,7 +921,7 @@ JX.install('DiffInline', { for (var ii = 0; ii < this._menuItems.length; ii++) { var spec = this._menuItems[ii]; - var onmenu = JX.bind(this, this._onMenuItem, menu, spec.action); + var onmenu = JX.bind(this, this._onMenuItem, menu, spec.action, spec); var item = new JX.PHUIXActionView() .setIcon(spec.icon) @@ -938,7 +938,7 @@ JX.install('DiffInline', { return items; }, - _onMenuItem: function(menu, action, e) { + _onMenuItem: function(menu, action, spec, e) { e.prevent(); menu.close(); @@ -958,6 +958,10 @@ JX.install('DiffInline', { case 'edit': this.edit(); break; + case 'raw': + new JX.Workflow(spec.uri) + .start(); + break; } },