Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/diff/view/PHUIDiffInlineCommentEditView.php
Show First 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | private function newCorpusView() { | ||||
$head = $context->getHeadLines(); | $head = $context->getHeadLines(); | ||||
$head = $this->newContextView($head); | $head = $this->newContextView($head); | ||||
$state = $inline->getContentStateForEdit($viewer); | $state = $inline->getContentStateForEdit($viewer); | ||||
$main = $state->getContentSuggestionText(); | $main = $state->getContentSuggestionText(); | ||||
$main_count = count(phutil_split_lines($main)); | $main_count = count(phutil_split_lines($main)); | ||||
$default = $context->getBodyLines(); | |||||
$default = implode('', $default); | |||||
// Browsers ignore one leading newline in text areas. Add one so that | // Browsers ignore one leading newline in text areas. Add one so that | ||||
// any actual leading newlines in the content are preserved. | // any actual leading newlines in the content are preserved. | ||||
$main = "\n".$main; | $main = "\n".$main; | ||||
$textarea = javelin_tag( | $textarea = javelin_tag( | ||||
'textarea', | 'textarea', | ||||
array( | array( | ||||
'class' => 'inline-suggestion-input PhabricatorMonospaced', | 'class' => 'inline-suggestion-input PhabricatorMonospaced', | ||||
'rows' => max(3, $main_count + 1), | 'rows' => max(3, $main_count + 1), | ||||
'sigil' => 'inline-content-suggestion', | 'sigil' => 'inline-content-suggestion', | ||||
'meta' => array( | |||||
'defaultText' => $default, | |||||
), | |||||
), | ), | ||||
$main); | $main); | ||||
$main = phutil_tag( | $main = phutil_tag( | ||||
'tr', | 'tr', | ||||
array( | array( | ||||
'class' => 'inline-suggestion-input-row', | 'class' => 'inline-suggestion-input-row', | ||||
), | ), | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |