Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/view/DifferentialChangesetListView.php
Show First 20 Lines • Show All 125 Lines • ▼ Show 20 Lines | Javelin::initBehavior( | ||||
'View Standalone' => pht('View Standalone'), | 'View Standalone' => pht('View Standalone'), | ||||
'Show Raw File (Left)' => pht('Show Raw File (Left)'), | 'Show Raw File (Left)' => pht('Show Raw File (Left)'), | ||||
'Show Raw File (Right)' => pht('Show Raw File (Right)'), | 'Show Raw File (Right)' => pht('Show Raw File (Right)'), | ||||
'Configure Editor' => pht('Configure Editor'), | 'Configure Editor' => pht('Configure Editor'), | ||||
), | ), | ||||
)); | )); | ||||
$output = array(); | $output = array(); | ||||
$mapping = array(); | $ids = array(); | ||||
foreach ($changesets as $key => $changeset) { | foreach ($changesets as $key => $changeset) { | ||||
$file = $changeset->getFilename(); | $file = $changeset->getFilename(); | ||||
$class = 'differential-changeset'; | $class = 'differential-changeset'; | ||||
if (!$this->inlineURI) { | if (!$this->inlineURI) { | ||||
$class .= ' differential-changeset-noneditable'; | $class .= ' differential-changeset-noneditable'; | ||||
} | } | ||||
$ref = $this->references[$key]; | $ref = $this->references[$key]; | ||||
$detail = new DifferentialChangesetDetailView(); | $detail = new DifferentialChangesetDetailView(); | ||||
$uniq_id = 'diff-'.$changeset->getAnchorName(); | |||||
$detail->setID($uniq_id); | |||||
$view_options = $this->renderViewOptionsDropdown( | $view_options = $this->renderViewOptionsDropdown( | ||||
$detail, | $detail, | ||||
$ref, | $ref, | ||||
$changeset); | $changeset); | ||||
$detail->setChangeset($changeset); | $detail->setChangeset($changeset); | ||||
$detail->addButton($view_options); | $detail->addButton($view_options); | ||||
$detail->setSymbolIndex(idx($this->symbolIndexes, $key)); | $detail->setSymbolIndex(idx($this->symbolIndexes, $key)); | ||||
$detail->setVsChangesetID(idx($this->vsMap, $changeset->getID())); | $detail->setVsChangesetID(idx($this->vsMap, $changeset->getID())); | ||||
$detail->setEditable(true); | $detail->setEditable(true); | ||||
$detail->setRenderingRef($ref); | |||||
$detail->setAutoload(isset($this->visibleChangesets[$key])); | |||||
$detail->setRenderURI($this->renderURI); | |||||
$detail->setWhitespace($this->whitespace); | |||||
$uniq_id = 'diff-'.$changeset->getAnchorName(); | |||||
if (isset($this->visibleChangesets[$key])) { | if (isset($this->visibleChangesets[$key])) { | ||||
$load = 'Loading...'; | $load = 'Loading...'; | ||||
$mapping[$uniq_id] = $ref; | |||||
} else { | } else { | ||||
$load = javelin_tag( | $load = javelin_tag( | ||||
'a', | 'a', | ||||
array( | array( | ||||
'href' => '#'.$uniq_id, | 'href' => '#'.$uniq_id, | ||||
'sigil' => 'differential-load', | |||||
'meta' => array( | 'meta' => array( | ||||
'id' => $uniq_id, | 'id' => $detail->getID(), | ||||
'ref' => $ref, | |||||
'kill' => true, | 'kill' => true, | ||||
), | ), | ||||
'sigil' => 'differential-load', | |||||
'mustcapture' => true, | 'mustcapture' => true, | ||||
), | ), | ||||
pht('Load')); | pht('Load')); | ||||
} | } | ||||
$detail->appendChild( | $detail->appendChild( | ||||
phutil_tag( | phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'id' => $uniq_id, | 'id' => $uniq_id, | ||||
), | ), | ||||
phutil_tag('div', array('class' => 'differential-loading'), $load))); | phutil_tag('div', array('class' => 'differential-loading'), $load))); | ||||
$output[] = $detail->render(); | $output[] = $detail->render(); | ||||
$ids[] = $detail->getID(); | |||||
} | } | ||||
$this->requireResource('aphront-tooltip-css'); | $this->requireResource('aphront-tooltip-css'); | ||||
$this->initBehavior('differential-populate', array( | $this->initBehavior('differential-populate', array( | ||||
'registry' => $mapping, | 'changesetViewIDs' => $ids, | ||||
'whitespace' => $this->whitespace, | |||||
'uri' => $this->renderURI, | |||||
)); | )); | ||||
$this->initBehavior('differential-show-more', array( | $this->initBehavior('differential-show-more', array( | ||||
'uri' => $this->renderURI, | 'uri' => $this->renderURI, | ||||
'whitespace' => $this->whitespace, | 'whitespace' => $this->whitespace, | ||||
)); | )); | ||||
$this->initBehavior('differential-comment-jump', array()); | $this->initBehavior('differential-comment-jump', array()); | ||||
▲ Show 20 Lines • Show All 149 Lines • Show Last 20 Lines |