Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/document/PhabricatorJupyterDocumentEngine.php
Show All 30 Lines | protected function getContentScore(PhabricatorDocumentRef $ref) { | ||||
return 500; | return 500; | ||||
} | } | ||||
protected function canRenderDocumentType(PhabricatorDocumentRef $ref) { | protected function canRenderDocumentType(PhabricatorDocumentRef $ref) { | ||||
return $ref->isProbablyJSON(); | return $ref->isProbablyJSON(); | ||||
} | } | ||||
public function canDiffDocuments( | public function canDiffDocuments( | ||||
PhabricatorDocumentRef $uref, | PhabricatorDocumentRef $uref = null, | ||||
PhabricatorDocumentRef $vref) { | PhabricatorDocumentRef $vref = null) { | ||||
return true; | return true; | ||||
} | } | ||||
public function newEngineBlocks( | public function newEngineBlocks( | ||||
PhabricatorDocumentRef $uref, | PhabricatorDocumentRef $uref = null, | ||||
PhabricatorDocumentRef $vref) { | PhabricatorDocumentRef $vref = null) { | ||||
$blocks = new PhabricatorDocumentEngineBlocks(); | $blocks = new PhabricatorDocumentEngineBlocks(); | ||||
try { | try { | ||||
if ($uref) { | |||||
$u_blocks = $this->newDiffBlocks($uref); | $u_blocks = $this->newDiffBlocks($uref); | ||||
} else { | |||||
$u_blocks = array(); | |||||
} | |||||
if ($vref) { | |||||
$v_blocks = $this->newDiffBlocks($vref); | $v_blocks = $this->newDiffBlocks($vref); | ||||
} else { | |||||
$v_blocks = array(); | |||||
} | |||||
$blocks->addBlockList($uref, $u_blocks); | $blocks->addBlockList($uref, $u_blocks); | ||||
$blocks->addBlockList($vref, $v_blocks); | $blocks->addBlockList($vref, $v_blocks); | ||||
} catch (Exception $ex) { | } catch (Exception $ex) { | ||||
$blocks->addMessage($ex->getMessage()); | $blocks->addMessage($ex->getMessage()); | ||||
} | } | ||||
return $blocks; | return $blocks; | ||||
▲ Show 20 Lines • Show All 682 Lines • Show Last 20 Lines |