From d3487b6371cff190a46623b15497d493d186e2c5 Mon Sep 17 00:00:00 2001 From: Chad Little Date: Wed, 12 Oct 2016 18:41:09 -0700 Subject: [PATCH] Remove unused drag and drop Conpherence code Summary: Ref T11730. Removes unused code since this is now it's own page. Test Plan: rebuild maps, grep for javelin code, classnames Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin Maniphest Tasks: T11730 Differential Revision: https://secure.phabricator.com/D16700 --- resources/celerity/map.php | 11 +---- resources/celerity/packages.php | 1 - src/__phutil_library_map__.php | 2 - ...onpherenceFormDragAndDropUploadControl.php | 40 ------------------- .../behavior-drag-and-drop-photo.js | 38 ------------------ 5 files changed, 1 insertion(+), 91 deletions(-) delete mode 100644 src/applications/conpherence/view/ConpherenceFormDragAndDropUploadControl.php delete mode 100644 webroot/rsrc/js/application/conpherence/behavior-drag-and-drop-photo.js diff --git a/resources/celerity/map.php b/resources/celerity/map.php index bb082d5a78..46db1cb4f4 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -8,7 +8,7 @@ return array( 'names' => array( 'conpherence.pkg.css' => '4601645d', - 'conpherence.pkg.js' => '11f3e07e', + 'conpherence.pkg.js' => '44dd69f5', 'core.pkg.css' => '7ca260a3', 'core.pkg.js' => '30185d95', 'darkconsole.pkg.js' => 'e7393ebb', @@ -437,7 +437,6 @@ return array( 'rsrc/js/application/calendar/behavior-recurring-edit.js' => '5f1c4d5f', 'rsrc/js/application/config/behavior-reorder-fields.js' => 'b6993408', 'rsrc/js/application/conpherence/ConpherenceThreadManager.js' => '01774ab2', - 'rsrc/js/application/conpherence/behavior-drag-and-drop-photo.js' => 'cf86d16a', 'rsrc/js/application/conpherence/behavior-durable-column.js' => 'c5238acb', 'rsrc/js/application/conpherence/behavior-menu.js' => '9eb55204', 'rsrc/js/application/conpherence/behavior-participant-pane.js' => '8604caa8', @@ -665,7 +664,6 @@ return array( 'javelin-behavior-choose-control' => '327a00d1', 'javelin-behavior-comment-actions' => '0300eae6', 'javelin-behavior-config-reorder-fields' => 'b6993408', - 'javelin-behavior-conpherence-drag-and-drop-photo' => 'cf86d16a', 'javelin-behavior-conpherence-menu' => '9eb55204', 'javelin-behavior-conpherence-participant-pane' => '8604caa8', 'javelin-behavior-conpherence-pontificate' => 'f2e58483', @@ -2010,12 +2008,6 @@ return array( 'javelin-util', 'phabricator-notification-css', ), - 'cf86d16a' => array( - 'javelin-behavior', - 'javelin-dom', - 'javelin-workflow', - 'phabricator-drag-and-drop-file-upload', - ), 'cfd23f37' => array( 'javelin-install', 'javelin-util', @@ -2305,7 +2297,6 @@ return array( 'conpherence-header-pane-css', ), 'conpherence.pkg.js' => array( - 'javelin-behavior-conpherence-drag-and-drop-photo', 'javelin-behavior-conpherence-menu', 'javelin-behavior-conpherence-participant-pane', 'javelin-behavior-conpherence-pontificate', diff --git a/resources/celerity/packages.php b/resources/celerity/packages.php index a3a2a6132a..e10ba48d28 100644 --- a/resources/celerity/packages.php +++ b/resources/celerity/packages.php @@ -162,7 +162,6 @@ return array( 'conpherence-header-pane-css', ), 'conpherence.pkg.js' => array( - 'javelin-behavior-conpherence-drag-and-drop-photo', 'javelin-behavior-conpherence-menu', 'javelin-behavior-conpherence-participant-pane', 'javelin-behavior-conpherence-pontificate', diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php index e5b770a89f..49a3e000cf 100644 --- a/src/__phutil_library_map__.php +++ b/src/__phutil_library_map__.php @@ -291,7 +291,6 @@ phutil_register_library_map(array( 'ConpherenceDAO' => 'applications/conpherence/storage/ConpherenceDAO.php', 'ConpherenceDurableColumnView' => 'applications/conpherence/view/ConpherenceDurableColumnView.php', 'ConpherenceEditor' => 'applications/conpherence/editor/ConpherenceEditor.php', - 'ConpherenceFormDragAndDropUploadControl' => 'applications/conpherence/view/ConpherenceFormDragAndDropUploadControl.php', 'ConpherenceFulltextQuery' => 'applications/conpherence/query/ConpherenceFulltextQuery.php', 'ConpherenceIndex' => 'applications/conpherence/storage/ConpherenceIndex.php', 'ConpherenceLayoutView' => 'applications/conpherence/view/ConpherenceLayoutView.php', @@ -4808,7 +4807,6 @@ phutil_register_library_map(array( 'ConpherenceDAO' => 'PhabricatorLiskDAO', 'ConpherenceDurableColumnView' => 'AphrontTagView', 'ConpherenceEditor' => 'PhabricatorApplicationTransactionEditor', - 'ConpherenceFormDragAndDropUploadControl' => 'AphrontFormControl', 'ConpherenceFulltextQuery' => 'PhabricatorOffsetPagedQuery', 'ConpherenceIndex' => 'ConpherenceDAO', 'ConpherenceLayoutView' => 'AphrontTagView', diff --git a/src/applications/conpherence/view/ConpherenceFormDragAndDropUploadControl.php b/src/applications/conpherence/view/ConpherenceFormDragAndDropUploadControl.php deleted file mode 100644 index 3d9ea57cf9..0000000000 --- a/src/applications/conpherence/view/ConpherenceFormDragAndDropUploadControl.php +++ /dev/null @@ -1,40 +0,0 @@ -dropID = $drop_id; - return $this; - } - public function getDropID() { - return $this->dropID; - } - - protected function getCustomControlClass() { - return null; - } - - protected function renderInput() { - - $drop_id = celerity_generate_unique_node_id(); - Javelin::initBehavior('conpherence-drag-and-drop-photo', - array( - 'target' => $drop_id, - 'form_pane' => 'conpherence-form', - 'upload_uri' => '/file/dropupload/', - 'activated_class' => 'conpherence-dialogue-upload-photo', - )); - require_celerity_resource('conpherence-update-css'); - - return phutil_tag( - 'div', - array( - 'id' => $drop_id, - 'class' => 'conpherence-dialogue-drag-photo', - ), - pht('Drag and drop an image here to upload it.')); - } - -} diff --git a/webroot/rsrc/js/application/conpherence/behavior-drag-and-drop-photo.js b/webroot/rsrc/js/application/conpherence/behavior-drag-and-drop-photo.js deleted file mode 100644 index 7980bf3871..0000000000 --- a/webroot/rsrc/js/application/conpherence/behavior-drag-and-drop-photo.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * @provides javelin-behavior-conpherence-drag-and-drop-photo - * @requires javelin-behavior - * javelin-dom - * javelin-workflow - * phabricator-drag-and-drop-file-upload - */ - -JX.behavior('conpherence-drag-and-drop-photo', function(config) { - - var target = JX.$(config.target); - var form_pane = JX.$(config.form_pane); - - function onupload(f) { - var data = { - 'file_id' : f.getID(), - 'action' : 'metadata' - }; - - var form = JX.DOM.find(form_pane, 'form'); - var workflow = JX.Workflow.newFromForm(form, data); - workflow.start(); - } - - if (JX.PhabricatorDragAndDropFileUpload.isSupported()) { - var drop = new JX.PhabricatorDragAndDropFileUpload(target) - .setURI(config.upload_uri); - drop.listen('didBeginDrag', function() { - JX.DOM.alterClass(target, config.activated_class, true); - }); - drop.listen('didEndDrag', function() { - JX.DOM.alterClass(target, config.activated_class, false); - }); - drop.listen('didUpload', onupload); - drop.start(); - } - -});