Page MenuHomePhabricator

D16062.id38648.diff
No OneTemporary

D16062.id38648.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -10,7 +10,7 @@
'core.pkg.css' => '8aeacc63',
'core.pkg.js' => '3f15fa62',
'darkconsole.pkg.js' => 'e7393ebb',
- 'differential.pkg.css' => 'f5569f20',
+ 'differential.pkg.css' => 'f3fb8324',
'differential.pkg.js' => '4b7d8f19',
'diffusion.pkg.css' => '91c5d3a6',
'diffusion.pkg.js' => '3a9a8bfa',
@@ -57,7 +57,7 @@
'rsrc/css/application/dashboard/dashboard.css' => 'bc6f2127',
'rsrc/css/application/diff/inline-comment-summary.css' => '51efda3a',
'rsrc/css/application/differential/add-comment.css' => 'c47f8c40',
- 'rsrc/css/application/differential/changeset-view.css' => '3f49a4bd',
+ 'rsrc/css/application/differential/changeset-view.css' => '805f1141',
'rsrc/css/application/differential/core.css' => '5b7b8ff4',
'rsrc/css/application/differential/phui-inline-comment.css' => '5953c28e',
'rsrc/css/application/differential/revision-comment.css' => '14b8565a',
@@ -552,7 +552,7 @@
'conpherence-update-css' => 'faf6be09',
'conpherence-widget-pane-css' => '775eaaba',
'd3' => 'a11a5ff2',
- 'differential-changeset-view-css' => '3f49a4bd',
+ 'differential-changeset-view-css' => '805f1141',
'differential-core-view-css' => '5b7b8ff4',
'differential-inline-comment-editor' => '64a5550f',
'differential-revision-add-comment-css' => 'c47f8c40',
@@ -1157,9 +1157,6 @@
'javelin-util',
'javelin-uri',
),
- '3f49a4bd' => array(
- 'phui-inline-comment-view-css',
- ),
'3f5d6dbf' => array(
'javelin-behavior',
'javelin-dom',
@@ -1540,6 +1537,9 @@
'javelin-vector',
'javelin-stratcom',
),
+ '805f1141' => array(
+ 'phui-inline-comment-view-css',
+ ),
'834a1173' => array(
'javelin-behavior',
'javelin-scrollbar',
diff --git a/src/applications/phriction/controller/PhrictionDiffController.php b/src/applications/phriction/controller/PhrictionDiffController.php
--- a/src/applications/phriction/controller/PhrictionDiffController.php
+++ b/src/applications/phriction/controller/PhrictionDiffController.php
@@ -45,61 +45,20 @@
$text_l = $content_l->getContent();
$text_r = $content_r->getContent();
- $text_l = phutil_utf8_hard_wrap($text_l, 80);
- $text_l = implode("\n", $text_l);
- $text_r = phutil_utf8_hard_wrap($text_r, 80);
- $text_r = implode("\n", $text_r);
+ $diff_view = id(new PhabricatorApplicationTransactionTextDiffDetailView())
+ ->setOldText($text_l)
+ ->setNewText($text_r);
- $engine = new PhabricatorDifferenceEngine();
- $changeset = $engine->generateChangesetFromFileContent($text_l, $text_r);
-
- $changeset->setFilename($content_r->getTitle());
-
- $changeset->setOldProperties(
- array(
- 'Title' => $content_l->getTitle(),
- ));
- $changeset->setNewProperties(
- array(
- 'Title' => $content_r->getTitle(),
- ));
-
- $whitespace_mode = DifferentialChangesetParser::WHITESPACE_SHOW_ALL;
-
- $parser = id(new DifferentialChangesetParser())
- ->setUser($viewer)
- ->setChangeset($changeset)
- ->setRenderingReference("{$l},{$r}");
-
- $parser->readParametersFromRequest($request);
- $parser->setWhitespaceMode($whitespace_mode);
-
- $engine = new PhabricatorMarkupEngine();
- $engine->setViewer($viewer);
- $engine->process();
- $parser->setMarkupEngine($engine);
-
- $spec = $request->getStr('range');
- list($range_s, $range_e, $mask) =
- DifferentialChangesetParser::parseRangeSpecification($spec);
-
- $parser->setRange($range_s, $range_e);
- $parser->setMask($mask);
-
- if ($request->isAjax()) {
- return id(new PhabricatorChangesetResponse())
- ->setRenderedChangeset($parser->renderChangeset());
- }
-
- $changes = id(new DifferentialChangesetListView())
- ->setUser($this->getViewer())
- ->setChangesets(array($changeset))
- ->setVisibleChangesets(array($changeset))
- ->setRenderingReferences(array("{$l},{$r}"))
- ->setRenderURI('/phriction/diff/'.$document->getID().'/')
- ->setTitle(pht('Changes'))
+ $changes = id(new PHUIObjectBoxView())
+ ->setHeaderText(pht('Content Changes'))
->setBackground(PHUIObjectBoxView::BLUE_PROPERTY)
- ->setParser($parser);
+ ->appendChild(
+ phutil_tag(
+ 'div',
+ array(
+ 'class' => 'prose-diff-frame',
+ ),
+ $diff_view));
require_celerity_resource('phriction-document-css');
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
@@ -93,6 +93,14 @@
user-select: none;
}
+.prose-diff {
+ white-space: pre-wrap;
+}
+
+.prose-diff-frame {
+ padding: 12px;
+}
+
.prose-diff span.old,
.prose-diff span.new {
padding: 0 2px;

File Metadata

Mime Type
text/plain
Expires
Tue, Oct 22, 10:37 AM (3 w, 6 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6741488
Default Alt Text
D16062.id38648.diff (5 KB)

Event Timeline