Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/document/PhabricatorJupyterDocumentEngine.php
Show All 35 Lines | final class PhabricatorJupyterDocumentEngine | ||||
} | } | ||||
public function canDiffDocuments( | public function canDiffDocuments( | ||||
PhabricatorDocumentRef $uref, | PhabricatorDocumentRef $uref, | ||||
PhabricatorDocumentRef $vref) { | PhabricatorDocumentRef $vref) { | ||||
return true; | return true; | ||||
} | } | ||||
public function newDiffView( | public function newEngineBlocks( | ||||
PhabricatorDocumentRef $uref, | PhabricatorDocumentRef $uref, | ||||
PhabricatorDocumentRef $vref) { | PhabricatorDocumentRef $vref) { | ||||
$blocks = new PhabricatorDocumentEngineBlocks(); | |||||
try { | |||||
$u_blocks = $this->newDiffBlocks($uref); | $u_blocks = $this->newDiffBlocks($uref); | ||||
$v_blocks = $this->newDiffBlocks($vref); | $v_blocks = $this->newDiffBlocks($vref); | ||||
return id(new PhabricatorDocumentEngineBlocks()) | $blocks->addBlockList($uref, $u_blocks); | ||||
->addBlockList($uref, $u_blocks) | $blocks->addBlockList($vref, $v_blocks); | ||||
->addBlockList($vref, $v_blocks); | } catch (Exception $ex) { | ||||
$blocks->addMessage($ex->getMessage()); | |||||
} | |||||
return $blocks; | |||||
} | } | ||||
private function newDiffBlocks(PhabricatorDocumentRef $ref) { | private function newDiffBlocks(PhabricatorDocumentRef $ref) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$content = $ref->loadData(); | $content = $ref->loadData(); | ||||
$cells = $this->newCells($content, true); | $cells = $this->newCells($content, true); | ||||
▲ Show 20 Lines • Show All 479 Lines • Show Last 20 Lines |