Changeset View
Changeset View
Standalone View
Standalone View
src/view/form/control/PhabricatorRemarkupControl.php
Show All 36 Lines | if (!$this->getDisabled()) { | ||||
array( | array( | ||||
'target' => $id, | 'target' => $id, | ||||
'activatedClass' => 'aphront-textarea-drag-and-drop', | 'activatedClass' => 'aphront-textarea-drag-and-drop', | ||||
'uri' => '/file/dropupload/', | 'uri' => '/file/dropupload/', | ||||
'chunkThreshold' => PhabricatorFileStorageEngine::getChunkThreshold(), | 'chunkThreshold' => PhabricatorFileStorageEngine::getChunkThreshold(), | ||||
)); | )); | ||||
} | } | ||||
$root_id = celerity_generate_unique_node_id(); | |||||
Javelin::initBehavior( | Javelin::initBehavior( | ||||
'phabricator-remarkup-assist', | 'phabricator-remarkup-assist', | ||||
array( | array( | ||||
'pht' => array( | 'pht' => array( | ||||
'bold text' => pht('bold text'), | 'bold text' => pht('bold text'), | ||||
'italic text' => pht('italic text'), | 'italic text' => pht('italic text'), | ||||
'monospaced text' => pht('monospaced text'), | 'monospaced text' => pht('monospaced text'), | ||||
'List Item' => pht('List Item'), | 'List Item' => pht('List Item'), | ||||
'Quoted Text' => pht('Quoted Text'), | 'Quoted Text' => pht('Quoted Text'), | ||||
'data' => pht('data'), | 'data' => pht('data'), | ||||
'name' => pht('name'), | 'name' => pht('name'), | ||||
'URL' => pht('URL'), | 'URL' => pht('URL'), | ||||
), | ), | ||||
'disabled' => $this->getDisabled(), | 'disabled' => $this->getDisabled(), | ||||
'rootID' => $root_id, | |||||
)); | )); | ||||
Javelin::initBehavior('phabricator-tooltips', array()); | Javelin::initBehavior('phabricator-tooltips', array()); | ||||
$actions = array( | $actions = array( | ||||
'fa-bold' => array( | 'fa-bold' => array( | ||||
'tip' => pht('Bold'), | 'tip' => pht('Bold'), | ||||
), | ), | ||||
'fa-italic' => array( | 'fa-italic' => array( | ||||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Lines | if ($can_use_macros) { | ||||
$actions[] = array( | $actions[] = array( | ||||
'spacer' => true, | 'spacer' => true, | ||||
); | ); | ||||
$actions['fa-meh-o'] = array( | $actions['fa-meh-o'] = array( | ||||
'tip' => pht('Meme'), | 'tip' => pht('Meme'), | ||||
); | ); | ||||
} | } | ||||
$actions['fa-eye'] = array( | |||||
'tip' => pht('Preview'), | |||||
'align' => 'right', | |||||
); | |||||
$actions[] = array( | |||||
'spacer' => true, | |||||
'align' => 'right', | |||||
); | |||||
$actions['fa-life-bouy'] = array( | $actions['fa-life-bouy'] = array( | ||||
'tip' => pht('Help'), | 'tip' => pht('Help'), | ||||
'align' => 'right', | 'align' => 'right', | ||||
'href' => PhabricatorEnv::getDoclink('Remarkup Reference'), | 'href' => PhabricatorEnv::getDoclink('Remarkup Reference'), | ||||
); | ); | ||||
if (!$this->disableFullScreen) { | if (!$this->disableFullScreen) { | ||||
$actions[] = array( | $actions[] = array( | ||||
'spacer' => true, | 'spacer' => true, | ||||
'align' => 'right', | 'align' => 'right', | ||||
); | ); | ||||
$actions['fa-arrows-alt'] = array( | $actions['fa-arrows-alt'] = array( | ||||
'tip' => pht('Fullscreen Mode'), | 'tip' => pht('Fullscreen Mode'), | ||||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | protected function renderInput() { | ||||
$this->setCustomClass( | $this->setCustomClass( | ||||
'remarkup-assist-textarea '.$monospaced_textareas_class); | 'remarkup-assist-textarea '.$monospaced_textareas_class); | ||||
return javelin_tag( | return javelin_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'sigil' => 'remarkup-assist-control', | 'sigil' => 'remarkup-assist-control', | ||||
'class' => $this->getDisabled() ? 'disabled-control' : null, | 'class' => $this->getDisabled() ? 'disabled-control' : null, | ||||
'id' => $root_id, | |||||
), | ), | ||||
array( | array( | ||||
$buttons, | $buttons, | ||||
parent::renderInput(), | parent::renderInput(), | ||||
)); | )); | ||||
} | } | ||||
} | } |