diff --git a/resources/celerity/map.php b/resources/celerity/map.php --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -10,9 +10,9 @@ 'conpherence.pkg.css' => '3c8a0668', 'conpherence.pkg.js' => '020aebcf', 'core.pkg.css' => 'f2319e1f', - 'core.pkg.js' => '7b53702c', - 'differential.pkg.css' => 'fb0c6265', - 'differential.pkg.js' => '62b6fdff', + 'core.pkg.js' => 'a7c9c5f4', + 'differential.pkg.css' => '9a93fe9e', + 'differential.pkg.js' => 'e268fcc6', 'diffusion.pkg.css' => '42c75c37', 'diffusion.pkg.js' => '91192d85', 'maniphest.pkg.css' => '35995d6d', @@ -61,7 +61,7 @@ 'rsrc/css/application/dashboard/dashboard.css' => '4267d6c6', 'rsrc/css/application/diff/inline-comment-summary.css' => '81eb368d', 'rsrc/css/application/differential/add-comment.css' => '7e5900d9', - 'rsrc/css/application/differential/changeset-view.css' => 'cd2e3f8b', + 'rsrc/css/application/differential/changeset-view.css' => '6c8a3935', 'rsrc/css/application/differential/core.css' => 'bdb93065', 'rsrc/css/application/differential/phui-inline-comment.css' => '48acce5b', 'rsrc/css/application/differential/revision-comment.css' => '7dbc8d1d', @@ -373,7 +373,7 @@ 'rsrc/js/application/dashboard/behavior-dashboard-query-panel-select.js' => '1e413dc9', 'rsrc/js/application/dashboard/behavior-dashboard-tab-panel.js' => '9b1cbd76', 'rsrc/js/application/diff/DiffChangeset.js' => 'e7cf10d6', - 'rsrc/js/application/diff/DiffChangesetList.js' => '26fb79ba', + 'rsrc/js/application/diff/DiffChangesetList.js' => '04023d82', 'rsrc/js/application/diff/DiffInline.js' => 'a4a14a94', 'rsrc/js/application/diff/behavior-preview-link.js' => 'f51e9c17', 'rsrc/js/application/differential/behavior-diff-radios.js' => '925fe8cd', @@ -471,7 +471,7 @@ 'rsrc/js/core/behavior-linked-container.js' => '74446546', 'rsrc/js/core/behavior-more.js' => '506aa3f4', 'rsrc/js/core/behavior-object-selector.js' => 'a4af0b4a', - 'rsrc/js/core/behavior-oncopy.js' => 'fa4aef0e', + 'rsrc/js/core/behavior-oncopy.js' => '12e8deee', 'rsrc/js/core/behavior-phabricator-nav.js' => 'f166c949', 'rsrc/js/core/behavior-phabricator-remarkup-assist.js' => '2f80333f', 'rsrc/js/core/behavior-read-only-warning.js' => 'b9109f8f', @@ -539,7 +539,7 @@ 'conpherence-thread-manager' => 'aec8e38c', 'conpherence-transaction-css' => '3a3f5e7e', 'd3' => 'd67475f5', - 'differential-changeset-view-css' => 'cd2e3f8b', + 'differential-changeset-view-css' => '6c8a3935', 'differential-core-view-css' => 'bdb93065', 'differential-revision-add-comment-css' => '7e5900d9', 'differential-revision-comment-css' => '7dbc8d1d', @@ -634,7 +634,7 @@ 'javelin-behavior-phabricator-nav' => 'f166c949', 'javelin-behavior-phabricator-notification-example' => '29819b75', 'javelin-behavior-phabricator-object-selector' => 'a4af0b4a', - 'javelin-behavior-phabricator-oncopy' => 'fa4aef0e', + 'javelin-behavior-phabricator-oncopy' => '12e8deee', 'javelin-behavior-phabricator-remarkup-assist' => '2f80333f', 'javelin-behavior-phabricator-reveal-content' => 'b105a3a6', 'javelin-behavior-phabricator-search-typeahead' => '1cb7d027', @@ -752,7 +752,7 @@ 'phabricator-darkmessage' => '26cd4b73', 'phabricator-dashboard-css' => '4267d6c6', 'phabricator-diff-changeset' => 'e7cf10d6', - 'phabricator-diff-changeset-list' => '26fb79ba', + 'phabricator-diff-changeset-list' => '04023d82', 'phabricator-diff-inline' => 'a4a14a94', 'phabricator-drag-and-drop-file-upload' => '4370900d', 'phabricator-draggable-list' => '3c6bd549', @@ -905,6 +905,10 @@ 'javelin-uri', 'javelin-util', ), + '04023d82' => array( + 'javelin-install', + 'phuix-button-view', + ), '04f8a1e3' => array( 'javelin-behavior', 'javelin-stratcom', @@ -994,6 +998,10 @@ 'javelin-workflow', 'phuix-icon-view', ), + '12e8deee' => array( + 'javelin-behavior', + 'javelin-dom', + ), '1325b731' => array( 'javelin-behavior', 'javelin-uri', @@ -1085,10 +1093,6 @@ 'javelin-json', 'phabricator-draggable-list', ), - '26fb79ba' => array( - 'javelin-install', - 'phuix-button-view', - ), '27daef73' => array( 'multirow-row-manager', 'javelin-install', @@ -1454,6 +1458,9 @@ 'javelin-vector', 'phui-hovercard', ), + '6c8a3935' => array( + 'phui-inline-comment-view-css', + ), '6cfa0008' => array( 'javelin-dom', 'javelin-dynval', @@ -1959,9 +1966,6 @@ 'javelin-util', 'phabricator-keyboard-shortcut-manager', ), - 'cd2e3f8b' => array( - 'phui-inline-comment-view-css', - ), 'cf32921f' => array( 'javelin-behavior', 'javelin-dom', @@ -2120,10 +2124,6 @@ 'javelin-view-visitor', 'javelin-util', ), - 'fa4aef0e' => array( - 'javelin-behavior', - 'javelin-dom', - ), 'fa6f30b2' => array( 'javelin-behavior', 'javelin-dom', diff --git a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php --- a/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetHTMLRenderer.php @@ -437,11 +437,17 @@ $classes[] = 'PhabricatorMonospaced'; $classes[] = $this->getRendererTableClass(); + $sigils = array(); + $sigils[] = 'differential-diff'; + foreach ($this->getTableSigils() as $sigil) { + $sigils[] = $sigil; + } + return javelin_tag( 'table', array( 'class' => implode(' ', $classes), - 'sigil' => 'differential-diff intercept-copy', + 'sigil' => implode(' ', $sigils), ), array( $this->renderColgroup(), @@ -449,6 +455,10 @@ )); } + protected function getTableSigils() { + return array(); + } + protected function buildInlineComment( PhabricatorInlineCommentInterface $comment, $on_right = false) { diff --git a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php --- a/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php +++ b/src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php @@ -109,16 +109,20 @@ phutil_tag( 'td', array( - 'colspan' => 2, + 'class' => 'show-context-line n left-context', + )), + phutil_tag( + 'td', + array( 'class' => 'show-more', ), $contents), phutil_tag( - 'th', + 'td', array( - 'class' => 'show-context-line', - ), - $context_line ? (int)$context_line : null), + 'class' => 'show-context-line n', + 'data-n' => $context_line, + )), phutil_tag( 'td', array( @@ -404,4 +408,10 @@ ->addInlineView($view); } + protected function getTableSigils() { + return array( + 'intercept-copy', + ); + } + } diff --git a/webroot/rsrc/css/application/differential/changeset-view.css b/webroot/rsrc/css/application/differential/changeset-view.css --- a/webroot/rsrc/css/application/differential/changeset-view.css +++ b/webroot/rsrc/css/application/differential/changeset-view.css @@ -87,7 +87,7 @@ color: {$darkgreytext}; } -.differential-changeset-immutable .differential-diff th { +.differential-changeset-immutable .differential-diff td { cursor: auto; } @@ -161,6 +161,10 @@ content: attr(data-n); } +.differential-diff td.show-context-line.n { + cursor: auto; +} + .differential-diff td.cov { padding: 0; } @@ -201,7 +205,7 @@ } .differential-diff td.show-more, -.differential-diff th.show-context-line, +.differential-diff td.show-context-line, .differential-diff td.show-context, .differential-diff td.differential-shield { background: {$lightbluebackground}; @@ -211,7 +215,7 @@ } .device .differential-diff td.show-more, -.device .differential-diff th.show-context-line, +.device .differential-diff td.show-context-line, .device .differential-diff td.show-context, .device .differential-diff td.differential-shield { padding: 6px 0; @@ -229,10 +233,14 @@ color: {$bluetext}; } -.differential-diff th.show-context-line { +.differential-diff td.show-context-line { padding-right: 6px; } +.differential-diff td.show-context-line.left-context { + border-right: none; +} + .differential-diff td.show-context { padding-left: 14px; } @@ -410,8 +418,7 @@ .differential-diff.copy-l > tbody > tr > td, .differential-diff.copy-r > tbody > tr > td { - -moz-user-select: -moz-none; - -khtml-user-select: none; + -moz-user-select: none; -ms-user-select: none; -webkit-user-select: none; user-select: none; @@ -423,12 +430,24 @@ } .differential-diff.copy-l > tbody > tr > td:nth-child(2) { + -moz-user-select: auto; + -ms-user-select: auto; -webkit-user-select: auto; user-select: auto; opacity: 1; } +.differential-diff.copy-l > tbody > tr > td.show-more:nth-child(2) { + -moz-user-select: none; + -ms-user-select: none; + -webkit-user-select: none; + user-select: none; + opacity: 0.25; +} + .differential-diff.copy-r > tbody > tr > td:nth-child(5) { + -moz-user-select: auto; + -ms-user-select: auto; -webkit-user-select: auto; user-select: auto; opacity: 1; diff --git a/webroot/rsrc/js/application/diff/DiffChangesetList.js b/webroot/rsrc/js/application/diff/DiffChangesetList.js --- a/webroot/rsrc/js/application/diff/DiffChangesetList.js +++ b/webroot/rsrc/js/application/diff/DiffChangesetList.js @@ -1246,8 +1246,24 @@ return changeset.getInlineForRow(inline_row); }, - getLineNumberFromHeader: function(th) { - return parseInt(th.getAttribute('data-n')); + getLineNumberFromHeader: function(node) { + var n = parseInt(node.getAttribute('data-n')); + + if (!n) { + return null; + } + + // If this is a line number that's part of a row showing more context, + // we don't want to let users leave inlines here. + + try { + JX.DOM.findAbove(node, 'tr', 'context-target'); + return null; + } catch (ex) { + // Ignore. + } + + return n; }, getDisplaySideFromHeader: function(th) { @@ -1295,7 +1311,7 @@ }, _updateRange: function(target, is_out) { - // Don't update the range if this "