@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Unconditionally enable drag-and-drop uploads for Remarkup text areas

Summary: Make these always work. Notably, this makes them work in Maniphest. Previously this was at odds with stuff fixed in D3651.

Test Plan: Dragged and dropped files into Remarkup in Maniphest.

Reviewers: btrahan, vrana

Reviewed By: btrahan

CC: aran

Differential Revision: https://secure.phabricator.com/D3652

+17 -28
-1
src/applications/differential/view/DifferentialAddCommentView.php
··· 133 133 ->setName('comment') 134 134 ->setID('comment-content') 135 135 ->setLabel('Comment') 136 - ->setEnableDragAndDropFileUploads(true) 137 136 ->setValue($this->draft ? $this->draft->getDraft() : null)) 138 137 ->appendChild( 139 138 id(new AphrontFormSubmitControl())
-1
src/applications/phame/controller/post/PhamePostEditController.php
··· 259 259 ->setName('body') 260 260 ->setValue($post->getBody()) 261 261 ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL) 262 - ->setEnableDragAndDropFileUploads(true) 263 262 ->setID('post-body') 264 263 ) 265 264 ->appendChild(
+1 -2
src/applications/phriction/controller/PhrictionEditController.php
··· 223 223 ->setValue($content_text) 224 224 ->setHeight(AphrontFormTextAreaControl::HEIGHT_VERY_TALL) 225 225 ->setName('content') 226 - ->setID('document-textarea') 227 - ->setEnableDragAndDropFileUploads(true)) 226 + ->setID('document-textarea')) 228 227 ->appendChild( 229 228 id(new AphrontFormTextControl()) 230 229 ->setLabel('Edit Notes')
+1 -2
src/applications/ponder/view/PonderAddAnswerView.php
··· 60 60 ->setName('answer') 61 61 ->setLabel('Answer') 62 62 ->setError(true) 63 - ->setID('answer-content') 64 - ->setEnableDragAndDropFileUploads(true)) 63 + ->setID('answer-content')) 65 64 ->appendChild( 66 65 id(new AphrontFormSubmitControl()) 67 66 ->setValue($is_serious ? 'Submit' : 'Make it so.'));
+1 -2
src/applications/ponder/view/PonderAddCommentView.php
··· 60 60 ->addHiddenInput('question_id', $questionID) 61 61 ->appendChild( 62 62 id(new AphrontFormTextAreaControl()) 63 - ->setName('content') 64 - ->setEnableDragAndDropFileUploads(false)) 63 + ->setName('content')) 65 64 ->appendChild( 66 65 id(new AphrontFormSubmitControl()) 67 66 ->setValue($is_serious ? 'Submit' : 'Editorialize'));
+1 -20
src/view/form/control/AphrontFormTextAreaControl.php
··· 48 48 return 'aphront-form-control-textarea'; 49 49 } 50 50 51 - public function setEnableDragAndDropFileUploads($enable) { 52 - $this->enableDragAndDropFileUploads = $enable; 53 - return $this; 54 - } 55 - 56 51 public function setCustomClass($custom_class) { 57 52 $this->customClass = $custom_class; 58 53 return $this; ··· 74 69 $classes[] = $this->customClass; 75 70 $classes = trim(implode(' ', $classes)); 76 71 77 - $id = $this->getID(); 78 - if ($this->enableDragAndDropFileUploads) { 79 - if (!$id) { 80 - $id = celerity_generate_unique_node_id(); 81 - } 82 - Javelin::initBehavior( 83 - 'aphront-drag-and-drop-textarea', 84 - array( 85 - 'target' => $id, 86 - 'activatedClass' => 'aphront-textarea-drag-and-drop', 87 - 'uri' => '/file/dropupload/', 88 - )); 89 - } 90 - 91 72 return phutil_render_tag( 92 73 'textarea', 93 74 array( ··· 96 77 'readonly' => $this->getReadonly() ? 'readonly' : null, 97 78 'class' => $classes, 98 79 'style' => $this->getControlStyle(), 99 - 'id' => $id, 80 + 'id' => $this->getID(), 100 81 ), 101 82 phutil_escape_html($this->getValue())); 102 83 }
+13
src/view/form/control/PhabricatorRemarkupControl.php
··· 19 19 final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl { 20 20 21 21 protected function renderInput() { 22 + $id = $this->getID(); 23 + if (!$id) { 24 + $id = celerity_generate_unique_node_id(); 25 + $this->setID($id); 26 + } 27 + 28 + Javelin::initBehavior( 29 + 'aphront-drag-and-drop-textarea', 30 + array( 31 + 'target' => $id, 32 + 'activatedClass' => 'aphront-textarea-drag-and-drop', 33 + 'uri' => '/file/dropupload/', 34 + )); 22 35 23 36 Javelin::initBehavior('phabricator-remarkup-assist', array()); 24 37 Javelin::initBehavior('phabricator-tooltips', array());