Skip to content

Commit a7272df

Browse files
sophiebitsepriestley
authored and
epriestley
committedApr 9, 2014
Switch back to zwsp for oncopy line marker
Summary: Fixes T4759. Turns out Chrome on windows doesn't really like the word joiner character. We'll switch back to zwsp but make it `position: absolute;` so it doesn't turn into a line break. Test Plan: Looked at diffs in IE9 and Chrome Windows. Made sure copying still works as expected. Reviewers: chad, #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: epriestley, Korvin Maniphest Tasks: T4759 Differential Revision: https://secure.phabricator.com/D8727
1 parent 563a1ac commit a7272df

File tree

6 files changed

+27
-20
lines changed

6 files changed

+27
-20
lines changed
 

‎resources/celerity/map.php

+11-11
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
'names' =>
99
array(
1010
'core.pkg.css' => 'ab5dd633',
11-
'core.pkg.js' => '68839013',
11+
'core.pkg.js' => 'c5b39816',
1212
'darkconsole.pkg.js' => 'ca8671ce',
13-
'differential.pkg.css' => '9578e86b',
13+
'differential.pkg.css' => '12c11318',
1414
'differential.pkg.js' => '11a5b750',
1515
'diffusion.pkg.css' => '3783278d',
1616
'diffusion.pkg.js' => '5b4010f4',
@@ -55,7 +55,7 @@
5555
'rsrc/css/application/countdown/timer.css' => '86b7b0a0',
5656
'rsrc/css/application/diff/inline-comment-summary.css' => '14a91639',
5757
'rsrc/css/application/differential/add-comment.css' => 'c478bcaa',
58-
'rsrc/css/application/differential/changeset-view.css' => '6a0299e9',
58+
'rsrc/css/application/differential/changeset-view.css' => '1570a1ff',
5959
'rsrc/css/application/differential/core.css' => '7ac3cabc',
6060
'rsrc/css/application/differential/results-table.css' => '239924f9',
6161
'rsrc/css/application/differential/revision-comment.css' => '48186045',
@@ -463,7 +463,7 @@
463463
'rsrc/js/core/behavior-line-linker.js' => 'bc778103',
464464
'rsrc/js/core/behavior-more.js' => '9b9197be',
465465
'rsrc/js/core/behavior-object-selector.js' => 'b4eef37b',
466-
'rsrc/js/core/behavior-oncopy.js' => 'e69e4400',
466+
'rsrc/js/core/behavior-oncopy.js' => 'c3e218fe',
467467
'rsrc/js/core/behavior-phabricator-nav.js' => 'b5842a5e',
468468
'rsrc/js/core/behavior-phabricator-remarkup-assist.js' => 'c021950a',
469469
'rsrc/js/core/behavior-refresh-csrf.js' => 'c4b31646',
@@ -505,7 +505,7 @@
505505
'conpherence-notification-css' => '403cf598',
506506
'conpherence-update-css' => '1099a660',
507507
'conpherence-widget-pane-css' => '87b12e0c',
508-
'differential-changeset-view-css' => '6a0299e9',
508+
'differential-changeset-view-css' => '1570a1ff',
509509
'differential-core-view-css' => '7ac3cabc',
510510
'differential-inline-comment-editor' => 'f2441746',
511511
'differential-results-table-css' => '239924f9',
@@ -596,7 +596,7 @@
596596
'javelin-behavior-phabricator-nav' => 'b5842a5e',
597597
'javelin-behavior-phabricator-notification-example' => 'c51a6616',
598598
'javelin-behavior-phabricator-object-selector' => 'b4eef37b',
599-
'javelin-behavior-phabricator-oncopy' => 'e69e4400',
599+
'javelin-behavior-phabricator-oncopy' => 'c3e218fe',
600600
'javelin-behavior-phabricator-remarkup-assist' => 'c021950a',
601601
'javelin-behavior-phabricator-reveal-content' => '8f24abfc',
602602
'javelin-behavior-phabricator-search-typeahead' => 'f6b56f7a',
@@ -1635,6 +1635,11 @@
16351635
2 => 'javelin-util',
16361636
3 => 'javelin-magical-init',
16371637
),
1638+
'c3e218fe' =>
1639+
array(
1640+
0 => 'javelin-behavior',
1641+
1 => 'javelin-dom',
1642+
),
16381643
'c4b31646' =>
16391644
array(
16401645
0 => 'javelin-request',
@@ -1810,11 +1815,6 @@
18101815
2 => 'javelin-view-visitor',
18111816
3 => 'javelin-util',
18121817
),
1813-
'e69e4400' =>
1814-
array(
1815-
0 => 'javelin-behavior',
1816-
1 => 'javelin-dom',
1817-
),
18181818
'e7c21fb3' =>
18191819
array(
18201820
0 => 'javelin-dom',

‎src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php

+8-6
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,10 @@ public function renderTextChange(
284284
$n_id = null;
285285
}
286286

287-
// NOTE: This is a unicode 'word joiner' (essentially a non-breaking
288-
// zero-width space), which we use as a hint when intercepting 'copy'
289-
// events to make sure sensible text ends up on the clipboard.
290-
// See the 'phabricator-oncopy' behavior.
291-
$zero_space = "\xE2\x81\xA0";
287+
// NOTE: This is a unicode zero-width space, which we use as a hint when
288+
// intercepting 'copy' events to make sure sensible text ends up on the
289+
// clipboard. See the 'phabricator-oncopy' behavior.
290+
$zero_space = "\xE2\x80\x8B";
292291

293292
// NOTE: The Javascript is sensitive to whitespace changes in this
294293
// block!
@@ -301,7 +300,10 @@ public function renderTextChange(
301300
phutil_tag(
302301
'td',
303302
array('class' => $n_classes, 'colspan' => $n_colspan),
304-
array($zero_space, $n_text)),
303+
array(
304+
phutil_tag('span', array('class' => 'zwsp'), $zero_space),
305+
$n_text
306+
)),
305307
$n_cov,
306308
));
307309

‎src/applications/diffusion/controller/DiffusionBrowseFileController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ private function buildDisplayRows(
789789
$anchor_text,
790790

791791
// NOTE: See phabricator-oncopy behavior.
792-
"\xE2\x81\xA0",
792+
"\xE2\x80\x8B",
793793

794794
// TODO: [HTML] Not ideal.
795795
phutil_safe_html(str_replace("\t", ' ', $line['data'])),

‎src/view/layout/PhabricatorSourceCodeView.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function render() {
6262
} else {
6363
$content_number = $line_number;
6464
// NOTE: See phabricator-oncopy behavior.
65-
$content_line = hsprintf("\xE2\x81\xA0%s", $line);
65+
$content_line = hsprintf("\xE2\x80\x8B%s", $line);
6666
}
6767

6868
$row_attributes = array();

‎webroot/rsrc/css/application/differential/changeset-view.css

+5
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@
5959
line-height: 16px;
6060
}
6161

62+
.differential-diff td .zwsp {
63+
position: absolute;
64+
width: 0;
65+
}
66+
6267
.differential-diff th {
6368
text-align: right;
6469
padding: 2px 6px 0px 0px;

‎webroot/rsrc/js/core/behavior-oncopy.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
JX.behavior('phabricator-oncopy', function() {
1818

19-
var zws = "\u2060"; // Unicode Word Joiner (Non-Breaking Zero-Width Space)
19+
var zws = "\u200B"; // Unicode Zero-Width Space
2020

2121
JX.enableDispatch(document.body, 'copy');
2222
JX.Stratcom.listen(

0 commit comments

Comments
 (0)
Failed to load comments.