Changeset View
Changeset View
Standalone View
Standalone View
src/view/form/control/PhabricatorRemarkupControl.php
| Show All 28 Lines | protected function renderInput() { | ||||
| Javelin::initBehavior( | Javelin::initBehavior( | ||||
| 'aphront-drag-and-drop-textarea', | 'aphront-drag-and-drop-textarea', | ||||
| array( | array( | ||||
| 'target' => $id, | 'target' => $id, | ||||
| 'activatedClass' => 'aphront-textarea-drag-and-drop', | 'activatedClass' => 'aphront-textarea-drag-and-drop', | ||||
| 'uri' => '/file/dropupload/', | 'uri' => '/file/dropupload/', | ||||
| )); | )); | ||||
| 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'), | ||||
| ▲ Show 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | if ($user) { | ||||
| ->loadPreferences() | ->loadPreferences() | ||||
| ->getPreference( | ->getPreference( | ||||
| PhabricatorUserPreferences::PREFERENCE_MONOSPACED_TEXTAREAS); | PhabricatorUserPreferences::PREFERENCE_MONOSPACED_TEXTAREAS); | ||||
| if ($monospaced_textareas == 'enabled') { | if ($monospaced_textareas == 'enabled') { | ||||
| $monospaced_textareas_class = 'PhabricatorMonospaced'; | $monospaced_textareas_class = 'PhabricatorMonospaced'; | ||||
| } | } | ||||
| } | } | ||||
| if ($user) { | |||||
| $tab_indents = $user | |||||
| ->loadPreferences() | |||||
| ->getPreference( | |||||
| PhabricatorUserPreferences::PREFERENCE_TAB_INSERTS_INDENT); | |||||
| if ($tab_indents == true) { | |||||
| Javelin::initBehavior( | |||||
| 'aphront-alternate-tab-key', | |||||
| array( | |||||
| 'target' => $id | |||||
| )); | |||||
| } | |||||
| } | |||||
| $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', | ||||
| ), | ), | ||||
| array( | array( | ||||
| $buttons, | $buttons, | ||||
| parent::renderInput(), | parent::renderInput(), | ||||
| )); | )); | ||||
| } | } | ||||
| } | } | ||||