Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14361585
D16062.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D16062.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 11:36 AM (18 h, 14 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6913831
Default Alt Text
D16062.diff (3 KB)
Attached To
Mode
D16062: Use prose diffs in Phriction
Attached
Detach File
Event Timeline
Log In to Comment