@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.

Remove Crop Image from Conpherence Edit UI

Summary: Ref T11730. Removes the front end crop feature. Will follow up with proper removal, but this seems broken outright.

Test Plan:
Edit a room, don't seen "Crop" feature. Upload new photo, works fine.

- grep for `ConpherencePicCropControl`
- grep for `aphront-crop`

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T11730

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

-174
-8
resources/celerity/map.php
··· 547 547 'rsrc/js/core/behavior-autofocus.js' => '7319e029', 548 548 'rsrc/js/core/behavior-badge-view.js' => '8ff5e24c', 549 549 'rsrc/js/core/behavior-choose-control.js' => '327a00d1', 550 - 'rsrc/js/core/behavior-crop.js' => 'fa0f4fc2', 551 550 'rsrc/js/core/behavior-dark-console.js' => 'f411b6ae', 552 551 'rsrc/js/core/behavior-detect-timezone.js' => '4c193c96', 553 552 'rsrc/js/core/behavior-device.js' => 'bb1dd507', ··· 655 654 'javelin-behavior-aphlict-listen' => 'fb20ac8d', 656 655 'javelin-behavior-aphlict-status' => '5e2634b9', 657 656 'javelin-behavior-aphront-basic-tokenizer' => 'b3a4b884', 658 - 'javelin-behavior-aphront-crop' => 'fa0f4fc2', 659 657 'javelin-behavior-aphront-drag-and-drop-textarea' => '484a6e22', 660 658 'javelin-behavior-aphront-form-disable-on-submit' => '5c54cbf3', 661 659 'javelin-behavior-aphront-more' => 'a80d0378', ··· 2242 2240 'javelin-mask', 2243 2241 'javelin-util', 2244 2242 'phabricator-busy', 2245 - ), 2246 - 'fa0f4fc2' => array( 2247 - 'javelin-behavior', 2248 - 'javelin-dom', 2249 - 'javelin-vector', 2250 - 'javelin-magical-init', 2251 2243 ), 2252 2244 'fb20ac8d' => array( 2253 2245 'javelin-behavior',
-2
src/__phutil_library_map__.php
··· 305 305 'ConpherenceParticipantQuery' => 'applications/conpherence/query/ConpherenceParticipantQuery.php', 306 306 'ConpherenceParticipantView' => 'applications/conpherence/view/ConpherenceParticipantView.php', 307 307 'ConpherenceParticipationStatus' => 'applications/conpherence/constants/ConpherenceParticipationStatus.php', 308 - 'ConpherencePicCropControl' => 'applications/conpherence/view/ConpherencePicCropControl.php', 309 308 'ConpherenceQueryThreadConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceQueryThreadConduitAPIMethod.php', 310 309 'ConpherenceQueryTransactionConduitAPIMethod' => 'applications/conpherence/conduit/ConpherenceQueryTransactionConduitAPIMethod.php', 311 310 'ConpherenceReplyHandler' => 'applications/conpherence/mail/ConpherenceReplyHandler.php', ··· 4782 4781 'ConpherenceParticipantQuery' => 'PhabricatorOffsetPagedQuery', 4783 4782 'ConpherenceParticipantView' => 'AphrontView', 4784 4783 'ConpherenceParticipationStatus' => 'ConpherenceConstants', 4785 - 'ConpherencePicCropControl' => 'AphrontFormControl', 4786 4784 'ConpherenceQueryThreadConduitAPIMethod' => 'ConpherenceConduitAPIMethod', 4787 4785 'ConpherenceQueryTransactionConduitAPIMethod' => 'ConpherenceConduitAPIMethod', 4788 4786 'ConpherenceReplyHandler' => 'PhabricatorMailReplyHandler',
-4
src/applications/conpherence/controller/ConpherenceUpdateController.php
··· 507 507 'src' => $crop_uri, 508 508 )))) 509 509 ->appendChild( 510 - id(new ConpherencePicCropControl()) 511 - ->setLabel(pht('Crop Image')) 512 - ->setValue($image)) 513 - ->appendChild( 514 510 id(new ConpherenceFormDragAndDropUploadControl()) 515 511 ->setLabel(pht('Change Image'))); 516 512 } else {
-78
src/applications/conpherence/view/ConpherencePicCropControl.php
··· 1 - <?php 2 - 3 - final class ConpherencePicCropControl extends AphrontFormControl { 4 - 5 - protected function getCustomControlClass() { 6 - return 'aphront-form-crop'; 7 - } 8 - 9 - protected function renderInput() { 10 - $width = ConpherenceImageData::CROP_WIDTH; 11 - $height = ConpherenceImageData::CROP_HEIGHT; 12 - 13 - $file = $this->getValue(); 14 - 15 - if ($file === null) { 16 - return phutil_tag( 17 - 'img', 18 - array( 19 - 'src' => PhabricatorUser::getDefaultProfileImageURI(), 20 - ), 21 - ''); 22 - } 23 - 24 - $c_id = celerity_generate_unique_node_id(); 25 - $metadata = $file->getMetadata(); 26 - $scale = PhabricatorImageTransformer::getScaleForCrop( 27 - $file, 28 - $width, 29 - $height); 30 - 31 - Javelin::initBehavior( 32 - 'aphront-crop', 33 - array( 34 - 'cropBoxID' => $c_id, 35 - 'width' => $width, 36 - 'height' => $height, 37 - 'scale' => $scale, 38 - 'imageH' => $metadata[PhabricatorFile::METADATA_IMAGE_HEIGHT], 39 - 'imageW' => $metadata[PhabricatorFile::METADATA_IMAGE_WIDTH], 40 - )); 41 - 42 - return javelin_tag( 43 - 'div', 44 - array( 45 - 'id' => $c_id, 46 - 'sigil' => 'crop-box', 47 - 'mustcapture' => true, 48 - 'class' => 'crop-box', 49 - ), 50 - array( 51 - javelin_tag( 52 - 'img', 53 - array( 54 - 'src' => $file->getBestURI(), 55 - 'class' => 'crop-image', 56 - 'sigil' => 'crop-image', 57 - ), 58 - ''), 59 - javelin_tag( 60 - 'input', 61 - array( 62 - 'type' => 'hidden', 63 - 'name' => 'image_x', 64 - 'sigil' => 'crop-x', 65 - ), 66 - ''), 67 - javelin_tag( 68 - 'input', 69 - array( 70 - 'type' => 'hidden', 71 - 'name' => 'image_y', 72 - 'sigil' => 'crop-y', 73 - ), 74 - ''), 75 - )); 76 - } 77 - 78 - }
-82
webroot/rsrc/js/core/behavior-crop.js
··· 1 - /** 2 - * @provides javelin-behavior-aphront-crop 3 - * @requires javelin-behavior 4 - * javelin-dom 5 - * javelin-vector 6 - * javelin-magical-init 7 - */ 8 - 9 - JX.behavior('aphront-crop', function(config) { 10 - 11 - var dragging = false; 12 - var startX, startY; 13 - var finalX, finalY; 14 - 15 - var cropBox = JX.$(config.cropBoxID); 16 - var basePos = JX.$V(cropBox); 17 - cropBox.style.height = config.height + 'px'; 18 - cropBox.style.width = config.width + 'px'; 19 - var baseD = JX.$V(config.width, config.height); 20 - 21 - var image = JX.DOM.find(cropBox, 'img', 'crop-image'); 22 - image.style.height = (config.imageH * config.scale) + 'px'; 23 - image.style.width = (config.imageW * config.scale) + 'px'; 24 - var imageD = JX.$V( 25 - config.imageW * config.scale, 26 - config.imageH * config.scale 27 - ); 28 - var minLeft = baseD.x - imageD.x; 29 - var minTop = baseD.y - imageD.y; 30 - 31 - var ondrag = function(e) { 32 - e.kill(); 33 - dragging = true; 34 - var p = JX.$V(e); 35 - startX = p.x; 36 - startY = p.y; 37 - }; 38 - 39 - var onmove = function(e) { 40 - if (!dragging) { 41 - return; 42 - } 43 - e.kill(); 44 - 45 - var p = JX.$V(e); 46 - var dx = startX - p.x; 47 - var dy = startY - p.y; 48 - var imagePos = JX.$V(image); 49 - var moveLeft = imagePos.x - basePos.x - dx; 50 - var moveTop = imagePos.y - basePos.y - dy; 51 - 52 - image.style.left = Math.min(Math.max(minLeft, moveLeft), 0) + 'px'; 53 - image.style.top = Math.min(Math.max(minTop, moveTop), 0) + 'px'; 54 - 55 - // reset these; a new beginning! 56 - startX = p.x; 57 - startY = p.y; 58 - 59 - // save off where we are right now 60 - imagePos = JX.$V(image); 61 - finalX = Math.abs(imagePos.x - basePos.x); 62 - finalY = Math.abs(imagePos.y - basePos.y); 63 - JX.DOM.find(cropBox, 'input', 'crop-x').value = finalX; 64 - JX.DOM.find(cropBox, 'input', 'crop-y').value = finalY; 65 - }; 66 - 67 - var ondrop = function() { 68 - if (!dragging) { 69 - return; 70 - } 71 - dragging = false; 72 - }; 73 - 74 - // NOTE: Javelin does not dispatch mousemove by default. 75 - JX.enableDispatch(cropBox, 'mousemove'); 76 - 77 - JX.DOM.listen(cropBox, 'mousedown', [], ondrag); 78 - JX.DOM.listen(cropBox, 'mousemove', [], onmove); 79 - JX.DOM.listen(cropBox, 'mouseup', [], ondrop); 80 - JX.DOM.listen(cropBox, 'mouseout', [], ondrop); 81 - 82 - });