Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F16608821
D8686.id20607.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
9 KB
Referenced Files
None
Subscribers
None
D8686.id20607.diff
View Options
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
@@ -7,6 +7,17 @@
return false;
}
+ private function renderColgroup() {
+ return phutil_tag('colgroup', array(), array(
+ phutil_tag('col', array('class' => 'num')),
+ phutil_tag('col', array('class' => 'left')),
+ phutil_tag('col', array('class' => 'num')),
+ phutil_tag('col', array('class' => 'copy')),
+ phutil_tag('col', array('class' => 'right')),
+ phutil_tag('col', array('class' => 'cov')),
+ ));
+ }
+
public function renderTextChange(
$range_start,
$range_len,
@@ -31,6 +42,8 @@
}
$html = array();
+ $html[] = $this->renderColgroup();
+
$old_lines = $this->getOldLines();
$new_lines = $this->getNewLines();
$gaps = $this->getGaps();
@@ -184,7 +197,7 @@
}
$o_num = null;
- $o_classes = 'left';
+ $o_classes = '';
$o_text = null;
if (isset($old_lines[$ii])) {
$o_num = $old_lines[$ii]['line'];
@@ -192,14 +205,15 @@
if ($old_lines[$ii]['type']) {
if ($old_lines[$ii]['type'] == '\\') {
$o_text = $old_lines[$ii]['text'];
- $o_classes .= ' comment';
+ $o_class = 'comment';
} else if ($original_left && !isset($highlight_old[$o_num])) {
- $o_classes .= ' old-rebase';
+ $o_class = 'old-rebase';
} else if (empty($new_lines[$ii])) {
- $o_classes .= ' old old-full';
+ $o_class = 'old old-full';
} else {
- $o_classes .= ' old';
+ $o_class = 'old';
}
+ $o_classes = $o_class;
}
}
@@ -265,7 +279,6 @@
}
}
}
- $n_classes .= ' right'.$n_colspan;
if (isset($hunk_starts[$o_num])) {
$html[] = $context_not_available;
@@ -283,10 +296,11 @@
$n_id = null;
}
- // NOTE: This is a unicode zero-width space, which we use as a hint
- // when intercepting 'copy' events to make sure sensible text ends
- // up on the clipboard. See the 'phabricator-oncopy' behavior.
- $zero_space = "\xE2\x80\x8B";
+ // NOTE: This is a unicode 'word joiner' (essentially a non-breaking
+ // zero-width space), which we use as a hint when intercepting 'copy'
+ // events to make sure sensible text ends up on the clipboard.
+ // See the 'phabricator-oncopy' behavior.
+ $zero_space = "\xE2\x81\xA0";
// NOTE: The Javascript is sensitive to whitespace changes in this
// block!
@@ -326,9 +340,9 @@
}
$html[] = phutil_tag('tr', array('class' => 'inline'), array(
phutil_tag('th', array()),
- phutil_tag('td', array('class' => 'left'), $comment_html),
+ phutil_tag('td', array(), $comment_html),
phutil_tag('th', array()),
- phutil_tag('td', array('colspan' => 3, 'class' => 'right3'), $new),
+ phutil_tag('td', array('colspan' => 3), $new),
));
}
}
@@ -338,11 +352,11 @@
$on_right = true);
$html[] = phutil_tag('tr', array('class' => 'inline'), array(
phutil_tag('th', array()),
- phutil_tag('td', array('class' => 'left')),
+ phutil_tag('td', array()),
phutil_tag('th', array()),
phutil_tag(
'td',
- array('colspan' => 3, 'class' => 'right3'),
+ array('colspan' => 3),
$comment_html),
));
}
@@ -391,9 +405,9 @@
$comment_html = $this->renderInlineComment($comment, $on_right = false);
$html_old[] = phutil_tag('tr', array('class' => 'inline'), array(
phutil_tag('th', array()),
- phutil_tag('td', array('class' => 'left'), $comment_html),
+ phutil_tag('td', array(), $comment_html),
phutil_tag('th', array()),
- phutil_tag('td', array('colspan' => 3, 'class' => 'right3')),
+ phutil_tag('td', array('colspan' => 3)),
));
}
}
@@ -402,11 +416,11 @@
$comment_html = $this->renderInlineComment($comment, $on_right = true);
$html_new[] = phutil_tag('tr', array('class' => 'inline'), array(
phutil_tag('th', array()),
- phutil_tag('td', array('class' => 'left')),
+ phutil_tag('td', array()),
phutil_tag('th', array()),
phutil_tag(
'td',
- array('colspan' => 3, 'class' => 'right3'),
+ array('colspan' => 3),
$comment_html),
));
}
@@ -424,12 +438,15 @@
$th_new = phutil_tag('th', array('id' => "C{$id}OL1"), 1);
}
- $output = hsprintf(
+ $output = array();
+ $output[] = $this->renderColgroup();
+
+ $output[] = hsprintf(
'<tr class="differential-image-diff">'.
'%s'.
- '<td class="left differential-old-image">%s</td>'.
+ '<td class="differential-old-image">%s</td>'.
'%s'.
- '<td class="right3 differential-new-image" colspan="3">%s</td>'.
+ '<td class="differential-new-image" colspan="3">%s</td>'.
'</tr>'.
'%s'.
'%s',
diff --git a/src/applications/diffusion/controller/DiffusionBrowseFileController.php b/src/applications/diffusion/controller/DiffusionBrowseFileController.php
--- a/src/applications/diffusion/controller/DiffusionBrowseFileController.php
+++ b/src/applications/diffusion/controller/DiffusionBrowseFileController.php
@@ -789,7 +789,7 @@
$anchor_text,
// NOTE: See phabricator-oncopy behavior.
- "\xE2\x80\x8B",
+ "\xE2\x81\xA0",
// TODO: [HTML] Not ideal.
phutil_safe_html(str_replace("\t", ' ', $line['data'])),
diff --git a/src/view/layout/PhabricatorSourceCodeView.php b/src/view/layout/PhabricatorSourceCodeView.php
--- a/src/view/layout/PhabricatorSourceCodeView.php
+++ b/src/view/layout/PhabricatorSourceCodeView.php
@@ -61,7 +61,8 @@
pht('...'));
} else {
$content_number = $line_number;
- $content_line = hsprintf("\xE2\x80\x8B%s", $line);
+ // NOTE: See phabricator-oncopy behavior.
+ $content_line = hsprintf("\xE2\x81\xA0%s", $line);
}
$row_attributes = array();
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
@@ -16,12 +16,30 @@
.differential-diff {
background: #fff;
width: 100%;
+ min-width: 780px;
border-top: 1px solid {$lightblueborder};
border-bottom: 1px solid {$lightblueborder};
+ table-layout: fixed;
+}
+
+.differential-diff col.num {
+ width: 45px;
+}
+
+.differential-diff col.left,
+.differential-diff col.right {
+ width: 49.25%;
+}
+
+.differential-diff col.copy {
+ width: 0.5%;
+}
+
+.differential-diff col.cov {
+ width: 1%;
}
.differential-diff td {
- min-width: 320px;
/*
Disable ligatures in Firefox. Firefox 3 has fancypants ligature support, but
it gets applied to monospaced fonts, which sucks because it means that the
@@ -35,6 +53,7 @@
letter-spacing: 0.0083334px;
vertical-align: top;
white-space: pre-wrap;
+ word-wrap: break-word;
padding: 0 8px 1px;
line-height: 16px;
}
@@ -42,9 +61,6 @@
.differential-diff th {
text-align: right;
padding: 2px 6px 0px 0px;
- width: 4%;
- min-width: 45px;
- max-width: 4%;
vertical-align: top;
background: {$lightbluebackground};
color: {$bluetext};
@@ -59,21 +75,6 @@
-ms-user-select: none;
user-select: none;
}
-.differential-diff td.left {
- width: 45%;
-}
-
-.differential-diff td.right,
-.differential-diff td.right1 {
- width: 43.5%;
-}
-
-.differential-diff td.right2 {
- width: 44.5%;
-}
-.differential-diff td.right3 {
- width: 45%;
-}
.differential-changeset-immutable .differential-diff th {
cursor: auto;
@@ -126,8 +127,6 @@
}
.differential-diff td.cov {
- min-width: 1%;
- width: 1%;
padding: 0;
}
@@ -252,6 +251,7 @@
width: 100%;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
+ box-sizing: border-box;
overflow: hidden;
white-space: normal;
}
diff --git a/webroot/rsrc/js/core/behavior-oncopy.js b/webroot/rsrc/js/core/behavior-oncopy.js
--- a/webroot/rsrc/js/core/behavior-oncopy.js
+++ b/webroot/rsrc/js/core/behavior-oncopy.js
@@ -16,7 +16,7 @@
*/
JX.behavior('phabricator-oncopy', function() {
- var zws = "\u200B"; // Unicode Zero-Width Space
+ var zws = "\u2060"; // Unicode Word Joiner (Non-Breaking Zero-Width Space)
JX.enableDispatch(document.body, 'copy');
JX.Stratcom.listen(
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jun 18, 7:16 AM (18 h, 24 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
8140351
Default Alt Text
D8686.id20607.diff (9 KB)
Attached To
Mode
D8686: Break long words in differential two-up view
Attached
Detach File
Event Timeline
Log In to Comment