diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index 918a1f4105..f482fe3c26 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -1009,6 +1009,7 @@ phutil_register_library_map(array( 'PhabricatorFileTestDataGenerator' => 'applications/files/lipsum/PhabricatorFileTestDataGenerator.php', 'PhabricatorFileTransformController' => 'applications/files/controller/PhabricatorFileTransformController.php', 'PhabricatorFileUploadController' => 'applications/files/controller/PhabricatorFileUploadController.php', + 'PhabricatorFileUploadDialogController' => 'applications/files/controller/PhabricatorFileUploadDialogController.php', 'PhabricatorFileUploadException' => 'applications/files/exception/PhabricatorFileUploadException.php', 'PhabricatorFilesConfigOptions' => 'applications/files/config/PhabricatorFilesConfigOptions.php', 'PhabricatorFilesManagementEnginesWorkflow' => 'applications/files/management/PhabricatorFilesManagementEnginesWorkflow.php', @@ -2805,6 +2806,7 @@ phutil_register_library_map(array( 'PhabricatorFileTestDataGenerator' => 'PhabricatorTestDataGenerator', 'PhabricatorFileTransformController' => 'PhabricatorFileController', 'PhabricatorFileUploadController' => 'PhabricatorFileController', + 'PhabricatorFileUploadDialogController' => 'PhabricatorFileController', 'PhabricatorFileUploadException' => 'Exception', 'PhabricatorFilesConfigOptions' => 'PhabricatorApplicationConfigOptions', 'PhabricatorFilesManagementEnginesWorkflow' => 'PhabricatorFilesManagementWorkflow', diff --git a/src/applications/files/application/PhabricatorApplicationFiles.php b/src/applications/files/application/PhabricatorApplicationFiles.php index 2d79ac1003..5d7d45258b 100644 --- a/src/applications/files/application/PhabricatorApplicationFiles.php +++ b/src/applications/files/application/PhabricatorApplicationFiles.php @@ -49,6 +49,7 @@ final class PhabricatorApplicationFiles extends PhabricatorApplication { 'proxy/' => 'PhabricatorFileProxyController', 'xform/(?P[^/]+)/(?P[^/]+)/(?P[^/]+)/' => 'PhabricatorFileTransformController', + 'uploaddialog/' => 'PhabricatorFileUploadDialogController', ), ); } diff --git a/src/applications/files/controller/PhabricatorFileUploadDialogController.php b/src/applications/files/controller/PhabricatorFileUploadDialogController.php new file mode 100644 index 0000000000..3928a3b14b --- /dev/null +++ b/src/applications/files/controller/PhabricatorFileUploadDialogController.php @@ -0,0 +1,20 @@ +getRequest(); + $user = $request->getUser(); + + $dialog = id(new AphrontDialogView()) + ->setUser($user) + ->setTitle(pht('Upload Image')) + ->appendChild(pht( + 'To add files, drag and drop them into the comment text area.')) + ->addCancelButton('/', pht('Close')); + + return id(new AphrontDialogResponse())->setDialog($dialog); + } + +} diff --git a/src/applications/maniphest/controller/ManiphestTaskDetailController.php b/src/applications/maniphest/controller/ManiphestTaskDetailController.php index 1292a90f76..3992d4c783 100644 --- a/src/applications/maniphest/controller/ManiphestTaskDetailController.php +++ b/src/applications/maniphest/controller/ManiphestTaskDetailController.php @@ -257,11 +257,6 @@ final class ManiphestTaskDetailController extends ManiphestController { ->setValue($draft_text) ->setID('transaction-comments') ->setUser($user)) - ->appendChild( - id(new AphrontFormDragAndDropUploadControl()) - ->setLabel(pht('Attached Files')) - ->setName('files') - ->setActivatedClass('aphront-panel-view-drag-and-drop')) ->appendChild( id(new AphrontFormSubmitControl()) ->setValue($is_serious ? pht('Submit') : pht('Avast!'))); diff --git a/src/applications/maniphest/controller/ManiphestTaskEditController.php b/src/applications/maniphest/controller/ManiphestTaskEditController.php index afde05d34a..4290abdb1a 100644 --- a/src/applications/maniphest/controller/ManiphestTaskEditController.php +++ b/src/applications/maniphest/controller/ManiphestTaskEditController.php @@ -485,15 +485,6 @@ final class ManiphestTaskEditController extends ManiphestController { $form ->appendChild($description_control); - if (!$task->getID()) { - $form - ->appendChild( - id(new AphrontFormDragAndDropUploadControl()) - ->setLabel(pht('Attached Files')) - ->setName('files') - ->setActivatedClass('aphront-panel-view-drag-and-drop')); - } - $form ->appendChild( id(new AphrontFormSubmitControl()) diff --git a/src/view/form/control/PhabricatorRemarkupControl.php b/src/view/form/control/PhabricatorRemarkupControl.php index c71c0d162e..728f68c748 100644 --- a/src/view/form/control/PhabricatorRemarkupControl.php +++ b/src/view/form/control/PhabricatorRemarkupControl.php @@ -54,8 +54,12 @@ final class PhabricatorRemarkupControl extends AphrontFormTextAreaControl { ), 'table' => array( 'tip' => pht('Table'), - ) + ), + 'image' => array( + 'tip' => pht('Upload File'), + ), ); + if (!$this->disableMacro and function_exists('imagettftext')) { $actions[] = array( 'spacer' => true, diff --git a/webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js b/webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js index 1152bedd6a..ef01e1d908 100644 --- a/webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js +++ b/webroot/rsrc/js/core/behavior-phabricator-remarkup-assist.js @@ -174,6 +174,9 @@ JX.behavior('phabricator-remarkup-assist', function(config) { }) .start(); break; + case 'image': + new JX.Workflow('/file/uploaddialog/').start(); + break; case 'chaos': if (edit_mode == 'chaos') { set_edit_mode(root, 'normal');