Differential D16817 Diff 40504 src/applications/transactions/view/PhabricatorApplicationTransactionTextDiffDetailView.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/view/PhabricatorApplicationTransactionTextDiffDetailView.php
Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | foreach ($diff->getParts() as $part) { | ||||
$text); | $text); | ||||
break; | break; | ||||
case '=': | case '=': | ||||
$result[] = $text; | $result[] = $text; | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
return phutil_tag( | $diff_view = phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'prose-diff', | 'class' => 'prose-diff', | ||||
), | ), | ||||
$result); | $result); | ||||
$old_view = phutil_tag( | |||||
'div', | |||||
array( | |||||
'class' => 'prose-diff', | |||||
), | |||||
$this->oldText); | |||||
$new_view = phutil_tag( | |||||
'div', | |||||
array( | |||||
'class' => 'prose-diff', | |||||
), | |||||
$this->newText); | |||||
return id(new PHUITabGroupView()) | |||||
->addTab( | |||||
id(new PHUITabView()) | |||||
->setKey('old') | |||||
->setName(pht('Old')) | |||||
->appendChild($old_view)) | |||||
->addTab( | |||||
id(new PHUITabView()) | |||||
->setKey('new') | |||||
->setName(pht('New')) | |||||
->appendChild($new_view)) | |||||
->addTab( | |||||
id(new PHUITabView()) | |||||
->setKey('diff') | |||||
->setName(pht('Diff')) | |||||
->appendChild($diff_view)) | |||||
->selectTab('diff'); | |||||
} | } | ||||
private function buildDiff() { | private function buildDiff() { | ||||
$engine = new PhutilProseDifferenceEngine(); | $engine = new PhutilProseDifferenceEngine(); | ||||
return $engine->getDiff($this->oldText, $this->newText); | return $engine->getDiff($this->oldText, $this->newText); | ||||
} | } | ||||
} | } |