1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-26 00:32:42 +01:00

Fix some derp with Differential revision formatting.

Summary:
  - Prevent long comments from expanding the inline box.
  - Make anchor links to inlines work properly.
  - Get rid of "pre" white-space formatting in inline comments.

Test Plan: Viewed a revision with crazy comments in it.

Reviewers:

CC:
This commit is contained in:
epriestley 2011-02-13 16:00:21 -08:00
parent 580116b1c1
commit fcc467fe5e
6 changed files with 30 additions and 20 deletions

View file

@ -109,7 +109,7 @@ celerity_register_resource_map(array(
), ),
'differential-revision-add-comment-css' => 'differential-revision-add-comment-css' =>
array( array(
'uri' => '/res/9be761de/rsrc/css/application/differential/add-comment.css', 'uri' => '/res/aaae14d3/rsrc/css/application/differential/add-comment.css',
'type' => 'css', 'type' => 'css',
'requires' => 'requires' =>
array( array(
@ -118,7 +118,7 @@ celerity_register_resource_map(array(
), ),
'differential-changeset-view-css' => 'differential-changeset-view-css' =>
array( array(
'uri' => '/res/8b893b8e/rsrc/css/application/differential/changeset-view.css', 'uri' => '/res/f26ca6f9/rsrc/css/application/differential/changeset-view.css',
'type' => 'css', 'type' => 'css',
'requires' => 'requires' =>
array( array(
@ -145,7 +145,7 @@ celerity_register_resource_map(array(
), ),
'differential-revision-comment-css' => 'differential-revision-comment-css' =>
array( array(
'uri' => '/res/678be39a/rsrc/css/application/differential/revision-comment.css', 'uri' => '/res/b271baaf/rsrc/css/application/differential/revision-comment.css',
'type' => 'css', 'type' => 'css',
'requires' => 'requires' =>
array( array(
@ -466,7 +466,7 @@ celerity_register_resource_map(array(
'uri' => '/res/pkg/4f907a28/core.pkg.css', 'uri' => '/res/pkg/4f907a28/core.pkg.css',
'type' => 'css', 'type' => 'css',
), ),
'4b8af7b5' => '2525bbc7' =>
array ( array (
'name' => 'differential.pkg.css', 'name' => 'differential.pkg.css',
'symbols' => 'symbols' =>
@ -480,7 +480,7 @@ celerity_register_resource_map(array(
6 => 'differential-revision-add-comment-css', 6 => 'differential-revision-add-comment-css',
7 => 'differential-revision-comment-list-css', 7 => 'differential-revision-comment-list-css',
), ),
'uri' => '/res/pkg/4b8af7b5/differential.pkg.css', 'uri' => '/res/pkg/2525bbc7/differential.pkg.css',
'type' => 'css', 'type' => 'css',
), ),
'30d594cf' => '30d594cf' =>
@ -513,14 +513,14 @@ celerity_register_resource_map(array(
'phabricator-directory-css' => '4f907a28', 'phabricator-directory-css' => '4f907a28',
'phabricator-remarkup-css' => '4f907a28', 'phabricator-remarkup-css' => '4f907a28',
'syntax-highlighting-css' => '4f907a28', 'syntax-highlighting-css' => '4f907a28',
'differential-core-view-css' => '4b8af7b5', 'differential-core-view-css' => '2525bbc7',
'differential-changeset-view-css' => '4b8af7b5', 'differential-changeset-view-css' => '2525bbc7',
'differential-revision-detail-css' => '4b8af7b5', 'differential-revision-detail-css' => '2525bbc7',
'differential-revision-history-css' => '4b8af7b5', 'differential-revision-history-css' => '2525bbc7',
'differential-table-of-contents-css' => '4b8af7b5', 'differential-table-of-contents-css' => '2525bbc7',
'differential-revision-comment-css' => '4b8af7b5', 'differential-revision-comment-css' => '2525bbc7',
'differential-revision-add-comment-css' => '4b8af7b5', 'differential-revision-add-comment-css' => '2525bbc7',
'differential-revision-comment-list-css' => '4b8af7b5', 'differential-revision-comment-list-css' => '2525bbc7',
'javelin-behavior-differential-feedback-preview' => '30d594cf', 'javelin-behavior-differential-feedback-preview' => '30d594cf',
'javelin-behavior-differential-edit-inline-comments' => '30d594cf', 'javelin-behavior-differential-edit-inline-comments' => '30d594cf',
'javelin-behavior-differential-populate' => '30d594cf', 'javelin-behavior-differential-populate' => '30d594cf',

View file

@ -120,6 +120,13 @@ final class DifferentialInlineCommentView extends AphrontView {
} }
} }
$anchor = phutil_render_tag(
'a',
array(
'name' => 'inline-'.$inline->getID(),
),
'');
$markup = javelin_render_tag( $markup = javelin_render_tag(
'div', 'div',
array( array(
@ -128,6 +135,7 @@ final class DifferentialInlineCommentView extends AphrontView {
'meta' => $metadata, 'meta' => $metadata,
), ),
'<div class="differential-inline-comment-head">'. '<div class="differential-inline-comment-head">'.
$anchor.
$links. $links.
'<span class="differential-inline-comment-line">'.$line.'</span>'. '<span class="differential-inline-comment-line">'.$line.'</span>'.
phutil_escape_html($handles[$inline->getAuthorPHID()]->getName()). phutil_escape_html($handles[$inline->getAuthorPHID()]->getName()).

View file

@ -133,7 +133,7 @@ final class DifferentialRevisionCommentView extends AphrontView {
$lines = phutil_render_tag( $lines = phutil_render_tag(
'a', 'a',
array( array(
'href' => '#', 'href' => '#inline-'.$inline->getID(),
'class' => 'num', 'class' => 'num',
), ),
$lines); $lines);

View file

@ -24,7 +24,5 @@
#inline-comment-preview { #inline-comment-preview {
margin-left: 60px; margin-left: 60px;
width: 550px;
width: 88ex;
width: 81ch;
} }

View file

@ -136,11 +136,13 @@
font-family: Verdana; font-family: Verdana;
font-size: 11px; font-size: 11px;
margin: 4px 0px; margin: 4px 0px;
max-width: 81ch;
padding: 8px 10px; padding: 8px 10px;
width: 100%; width: 100%;
-moz-box-sizing: border-box; -moz-box-sizing: border-box;
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
overflow: hidden;
max-width: 520px;
white-space: normal;
} }
.differential-inline-comment-head { .differential-inline-comment-head {

View file

@ -38,6 +38,10 @@
padding: .3em 5px .4em 1.25em; padding: .3em 5px .4em 1.25em;
} }
.differential-comment-content {
overflow: hidden;
}
.differential-comment-core .phabricator-remarkup p { .differential-comment-core .phabricator-remarkup p {
margin: 0.35em 0; margin: 0.35em 0;
} }
@ -97,8 +101,6 @@
background: #fff9f3; background: #fff9f3;
} }
.differential-inline-summary th, .differential-inline-summary th,
.differential-inline-summary td { .differential-inline-summary td {
vertical-align: top; vertical-align: top;