Kind-of-terrible (?) oncopy handler

Summary: Works in Safari, Firefox, Chrome.

Test Plan: Copied some text, threw up a little in my mouth.

Reviewers: aran, tuomaspelkonen, tomo, rstout, btrahan

Reviewed By: aran

CC: aran, epriestley, ddfisher

Maniphest Tasks: T145, T995

Differential Revision: https://secure.phabricator.com/D244
This commit is contained in:
epriestley
2012-03-15 19:04:59 -07:00
parent fffc1e51d0
commit 57fd4bc68b
6 changed files with 103 additions and 2 deletions

View File

@@ -142,6 +142,7 @@ final class PhabricatorPasteViewController extends PhabricatorPasteController {
$text_list = explode("\n", $source);
Javelin::initBehavior('phabricator-oncopy', array());
$rows = $this->buildDisplayRows($text_list);
$corpus_table = phutil_render_tag(
@@ -179,7 +180,10 @@ final class PhabricatorPasteViewController extends PhabricatorPasteController {
),
$n);
$rows[] = '<tr id="'.$anchor.'"><th>'.$link.'</th>'.
'<td style="white-space: pre-wrap;">'.$line.'</td></tr>';
'<td style="white-space: pre-wrap;">'.
// NOTE: See the 'phabricator-oncopy' behavior.
"\xE2\x80\x8B".
$line.'</td></tr>';
++$n;
}