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

Allow dialogs to opt in to being resizable

Summary: Ref T11034. Ref T4788. This allows you to resize the typeahead browse dialog if you want. I plan to let you resize the object selector dialog in the future.

Test Plan: {F1695433}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T4788, T11034

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

+156 -17
+18 -17
resources/celerity/map.php
··· 7 7 */ 8 8 return array( 9 9 'names' => array( 10 - 'core.pkg.css' => 'c7fc5aec', 11 - 'core.pkg.js' => '10275c16', 10 + 'core.pkg.css' => 'b9e2e1e5', 11 + 'core.pkg.js' => '80f86a0a', 12 12 'darkconsole.pkg.js' => 'e7393ebb', 13 13 'differential.pkg.css' => 'b3eea3f5', 14 14 'differential.pkg.js' => '4b7d8f19', ··· 18 18 'maniphest.pkg.js' => '949a7498', 19 19 'rsrc/css/aphront/aphront-bars.css' => '231ac33c', 20 20 'rsrc/css/aphront/dark-console.css' => 'f54bf286', 21 - 'rsrc/css/aphront/dialog-view.css' => 'b4334e08', 21 + 'rsrc/css/aphront/dialog-view.css' => '913c172e', 22 22 'rsrc/css/aphront/lightbox-attachment.css' => '7acac05d', 23 23 'rsrc/css/aphront/list-filter-view.css' => '5d6f0526', 24 24 'rsrc/css/aphront/multi-column.css' => 'fd18389d', ··· 245 245 'rsrc/externals/javelin/lib/URI.js' => 'c989ade3', 246 246 'rsrc/externals/javelin/lib/Vector.js' => '2caa8fb8', 247 247 'rsrc/externals/javelin/lib/WebSocket.js' => 'e292eaf4', 248 - 'rsrc/externals/javelin/lib/Workflow.js' => '0eb34d1d', 248 + 'rsrc/externals/javelin/lib/Workflow.js' => '1e911d0f', 249 249 'rsrc/externals/javelin/lib/__tests__/Cookie.js' => '5ed109e8', 250 250 'rsrc/externals/javelin/lib/__tests__/DOM.js' => 'c984504b', 251 251 'rsrc/externals/javelin/lib/__tests__/JSON.js' => '837a7d68', ··· 339 339 'rsrc/image/people/washington.png' => '40dd301c', 340 340 'rsrc/image/phrequent_active.png' => 'a466a8ed', 341 341 'rsrc/image/phrequent_inactive.png' => 'bfc15a69', 342 + 'rsrc/image/resize.png' => 'fd476de4', 342 343 'rsrc/image/sprite-login-X2.png' => 'e3991e37', 343 344 'rsrc/image/sprite-login.png' => '03d5af29', 344 345 'rsrc/image/sprite-menu-X2.png' => 'cfd8fca5', ··· 530 531 'almanac-css' => 'dbb9b3af', 531 532 'aphront-bars' => '231ac33c', 532 533 'aphront-dark-console-css' => 'f54bf286', 533 - 'aphront-dialog-view-css' => 'b4334e08', 534 + 'aphront-dialog-view-css' => '913c172e', 534 535 'aphront-list-filter-view-css' => '5d6f0526', 535 536 'aphront-multi-column-view-css' => 'fd18389d', 536 537 'aphront-panel-view-css' => '8427b78d', ··· 749 750 'javelin-workboard-card' => 'c587b80f', 750 751 'javelin-workboard-column' => 'bae58312', 751 752 'javelin-workboard-controller' => '55baf5ed', 752 - 'javelin-workflow' => '0eb34d1d', 753 + 'javelin-workflow' => '1e911d0f', 753 754 'lightbox-attachment-css' => '7acac05d', 754 755 'maniphest-batch-editor' => 'b0f0b6d5', 755 756 'maniphest-report-css' => '9b9580b7', ··· 981 982 'javelin-dom', 982 983 'javelin-router', 983 984 ), 984 - '0eb34d1d' => array( 985 - 'javelin-stratcom', 986 - 'javelin-request', 987 - 'javelin-dom', 988 - 'javelin-vector', 989 - 'javelin-install', 990 - 'javelin-util', 991 - 'javelin-mask', 992 - 'javelin-uri', 993 - 'javelin-routable', 994 - ), 995 985 '0f764c35' => array( 996 986 'javelin-install', 997 987 'javelin-util', ··· 1070 1060 'javelin-install', 1071 1061 'javelin-dom', 1072 1062 'javelin-reactor-dom', 1063 + ), 1064 + '1e911d0f' => array( 1065 + 'javelin-stratcom', 1066 + 'javelin-request', 1067 + 'javelin-dom', 1068 + 'javelin-vector', 1069 + 'javelin-install', 1070 + 'javelin-util', 1071 + 'javelin-mask', 1072 + 'javelin-uri', 1073 + 'javelin-routable', 1073 1074 ), 1074 1075 '21ba5861' => array( 1075 1076 'javelin-behavior',
+2
src/applications/typeahead/controller/PhabricatorTypeaheadModularDatasourceController.php
··· 250 250 ->setRenderDialogAsDiv(true) 251 251 ->setTitle($source->getBrowseTitle()) 252 252 ->appendChild($browser) 253 + ->setResizeX(true) 254 + ->setResizeY($frame_id) 253 255 ->addFooter($function_help) 254 256 ->addCancelButton('/', pht('Close')); 255 257 }
+35
src/view/AphrontDialogView.php
··· 24 24 private $flush; 25 25 private $validationException; 26 26 private $objectList; 27 + private $resizeX; 28 + private $resizeY; 27 29 28 30 29 31 const WIDTH_DEFAULT = 'default'; ··· 70 72 71 73 public function getShortTitle() { 72 74 return $this->shortTitle; 75 + } 76 + 77 + public function setResizeY($resize_y) { 78 + $this->resizeY = $resize_y; 79 + return $this; 80 + } 81 + 82 + public function getResizeY() { 83 + return $this->resizeY; 84 + } 85 + 86 + public function setResizeX($resize_x) { 87 + $this->resizeX = $resize_x; 88 + return $this; 89 + } 90 + 91 + public function getResizeX() { 92 + return $this->resizeX; 73 93 } 74 94 75 95 public function addSubmitButton($text = null) { ··· 347 367 $this->footers); 348 368 } 349 369 370 + $resize = null; 371 + if ($this->resizeX || $this->resizeY) { 372 + $resize = javelin_tag( 373 + 'div', 374 + array( 375 + 'class' => 'aphront-dialog-resize', 376 + 'sigil' => 'jx-dialog-resize', 377 + 'meta' => array( 378 + 'resizeX' => $this->resizeX, 379 + 'resizeY' => $this->resizeY, 380 + ), 381 + )); 382 + } 383 + 350 384 $tail = null; 351 385 if ($buttons || $footer) { 352 386 $tail = phutil_tag( ··· 357 391 array( 358 392 $buttons, 359 393 $footer, 394 + $resize, 360 395 )); 361 396 } 362 397
+18
webroot/rsrc/css/aphront/dialog-view.css
··· 48 48 49 49 .aphront-dialog-tail { 50 50 border: none; 51 + position: relative; 51 52 background: {$lightgreybackground}; 52 53 padding: 8px 16px; 53 54 border-top: 1px solid {$thinblueborder}; 54 55 border-bottom-left-radius: 3px; 55 56 border-bottom-right-radius: 3px; 57 + } 58 + 59 + .device .aphront-dialog-resize { 60 + /* No resizing on devices. */ 61 + display: none; 62 + } 63 + 64 + .aphront-dialog-resize { 65 + position: absolute; 66 + right: -4px; 67 + bottom: -4px; 68 + width: 18px; 69 + height: 18px; 70 + background-image: url(/rsrc/image/resize.png); 71 + background-size: 100%; 72 + cursor: nwse-resize; 73 + pointer-events: all; 56 74 } 57 75 58 76 .aphront-dialog-foot {
+83
webroot/rsrc/externals/javelin/lib/Workflow.js
··· 157 157 _getActiveWorkflow : function() { 158 158 var stack = JX.Workflow._stack; 159 159 return stack[stack.length - 1]; 160 + }, 161 + 162 + _onresizestart: function(e) { 163 + var self = JX.Workflow; 164 + if (self._resizing) { 165 + return; 166 + } 167 + 168 + var workflow = self._getActiveWorkflow(); 169 + if (!workflow) { 170 + return; 171 + } 172 + 173 + e.kill(); 174 + 175 + var form = JX.DOM.find(workflow._root, 'div', 'jx-dialog'); 176 + var resize = e.getNodeData('jx-dialog-resize'); 177 + var node_y = JX.$(resize.resizeY); 178 + 179 + var dim = JX.Vector.getDim(form); 180 + dim.y = JX.Vector.getDim(node_y).y; 181 + 182 + if (!form._minimumSize) { 183 + form._minimumSize = dim; 184 + } 185 + 186 + self._resizing = { 187 + min: form._minimumSize, 188 + form: form, 189 + startPos: JX.$V(e), 190 + startDim: dim, 191 + resizeY: node_y, 192 + resizeX: resize.resizeX 193 + }; 194 + }, 195 + 196 + _onmousemove: function(e) { 197 + var self = JX.Workflow; 198 + if (!self._resizing) { 199 + return; 200 + } 201 + 202 + var spec = self._resizing; 203 + var form = spec.form; 204 + var min = spec.min; 205 + 206 + var delta = JX.$V(e).add(-spec.startPos.x, -spec.startPos.y); 207 + var src_dim = spec.startDim; 208 + var dst_dim = JX.$V(src_dim.x + delta.x, src_dim.y + delta.y); 209 + 210 + if (dst_dim.x < min.x) { 211 + dst_dim.x = min.x; 212 + } 213 + 214 + if (dst_dim.y < min.y) { 215 + dst_dim.y = min.y; 216 + } 217 + 218 + if (spec.resizeX) { 219 + JX.$V(dst_dim.x, null).setDim(form); 220 + } 221 + 222 + if (spec.resizeY) { 223 + JX.$V(null, dst_dim.y).setDim(spec.resizeY); 224 + } 225 + }, 226 + 227 + _onmouseup: function() { 228 + var self = JX.Workflow; 229 + if (!self._resizing) { 230 + return; 231 + } 232 + 233 + self._resizing = false; 160 234 } 161 235 }, 162 236 ··· 219 293 'didSyntheticSubmit', 220 294 [], 221 295 JX.Workflow._onsyntheticsubmit); 296 + 297 + JX.DOM.listen( 298 + this._root, 299 + 'mousedown', 300 + 'jx-dialog-resize', 301 + JX.Workflow._onresizestart); 222 302 223 303 // Note that even in the presence of a content frame, we're doing 224 304 // everything here at top level: dialogs are fully modal and cover ··· 413 493 } 414 494 415 495 JX.Stratcom.listen('keydown', null, close_dialog_when_user_presses_escape); 496 + 497 + JX.Stratcom.listen('mousemove', null, JX.Workflow._onmousemove); 498 + JX.Stratcom.listen('mouseup', null, JX.Workflow._onmouseup); 416 499 } 417 500 418 501 });
webroot/rsrc/image/resize.png

This is a binary file and will not be displayed.