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

Partially generalize Remarkup previews and add support to Differential

Summary:
Ref T3671. A lot of applications have pretty ad-hoc preview code. Clean it up a bit and add Summary preview to Differential.

After ApplicationTransactions we might want to try to serialize the whole form and show a preview of all the transactions, but this seems not very useful in most cases (I'd guess that Remarkup previews are 99% of the value) and tricky to get right (e.g., adding images which don't exist yet to Pholio mocks).

I think I can add this in a few other places, too.

Test Plan:
Edited Maniphest Tasks and Differential Revisions, mashed some buttons. Verified previews rendered correctly. Grepped for removed CSS classes (no hits).

{F52907}

Reviewers: btrahan, Firehed

Reviewed By: btrahan

CC: aran, chad

Maniphest Tasks: T3671

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

+284 -125
+68 -59
src/__celerity_resource_map__.php
··· 1845 1845 ), 1846 1846 'disk' => '/rsrc/js/application/maniphest/behavior-batch-selector.js', 1847 1847 ), 1848 - 'javelin-behavior-maniphest-description-preview' => 1849 - array( 1850 - 'uri' => '/res/58ba0ec2/rsrc/js/application/maniphest/behavior-task-preview.js', 1851 - 'type' => 'js', 1852 - 'requires' => 1853 - array( 1854 - 0 => 'javelin-behavior', 1855 - 1 => 'javelin-dom', 1856 - 2 => 'javelin-util', 1857 - 3 => 'phabricator-shaped-request', 1858 - ), 1859 - 'disk' => '/rsrc/js/application/maniphest/behavior-task-preview.js', 1860 - ), 1861 1848 'javelin-behavior-maniphest-list-editor' => 1862 1849 array( 1863 1850 'uri' => '/res/a251e72f/rsrc/js/application/maniphest/behavior-list-edit.js', ··· 2376 2363 ), 2377 2364 'disk' => '/rsrc/js/application/releeph/releeph-request-typeahead.js', 2378 2365 ), 2366 + 'javelin-behavior-remarkup-preview' => 2367 + array( 2368 + 'uri' => '/res/6ec98508/rsrc/js/core/behavior-remarkup-preview.js', 2369 + 'type' => 'js', 2370 + 'requires' => 2371 + array( 2372 + 0 => 'javelin-behavior', 2373 + 1 => 'javelin-dom', 2374 + 2 => 'javelin-util', 2375 + 3 => 'phabricator-shaped-request', 2376 + ), 2377 + 'disk' => '/rsrc/js/core/behavior-remarkup-preview.js', 2378 + ), 2379 2379 'javelin-behavior-repository-crossreference' => 2380 2380 array( 2381 2381 'uri' => '/res/d3f9d50b/rsrc/js/application/repository/repository-crossreference.js', ··· 2937 2937 ), 2938 2938 'maniphest-task-edit-css' => 2939 2939 array( 2940 - 'uri' => '/res/0760f768/rsrc/css/application/maniphest/task-edit.css', 2940 + 'uri' => '/res/c0c64a27/rsrc/css/application/maniphest/task-edit.css', 2941 2941 'type' => 'css', 2942 2942 'requires' => 2943 2943 array( ··· 3441 3441 ), 3442 3442 'phabricator-remarkup-css' => 3443 3443 array( 3444 - 'uri' => '/res/07cab525/rsrc/css/core/remarkup.css', 3444 + 'uri' => '/res/8531b6a1/rsrc/css/core/remarkup.css', 3445 3445 'type' => 'css', 3446 3446 'requires' => 3447 3447 array( ··· 3864 3864 ), 3865 3865 'disk' => '/rsrc/css/phui/phui-list.css', 3866 3866 ), 3867 + 'phui-remarkup-preview-css' => 3868 + array( 3869 + 'uri' => '/res/702b30c4/rsrc/css/phui/phui-remarkup-preview.css', 3870 + 'type' => 'css', 3871 + 'requires' => 3872 + array( 3873 + ), 3874 + 'disk' => '/rsrc/css/phui/phui-remarkup-preview.css', 3875 + ), 3867 3876 'phui-spacing-css' => 3868 3877 array( 3869 3878 'uri' => '/res/28891fd3/rsrc/css/phui/phui-spacing.css', ··· 4191 4200 ), array( 4192 4201 'packages' => 4193 4202 array( 4194 - 'cc5dfafe' => 4203 + '604768b8' => 4195 4204 array( 4196 4205 'name' => 'core.pkg.css', 4197 4206 'symbols' => ··· 4239 4248 40 => 'phabricator-property-list-view-css', 4240 4249 41 => 'phabricator-tag-view-css', 4241 4250 ), 4242 - 'uri' => '/res/pkg/cc5dfafe/core.pkg.css', 4251 + 'uri' => '/res/pkg/604768b8/core.pkg.css', 4243 4252 'type' => 'css', 4244 4253 ), 4245 4254 '606f7152' => ··· 4430 4439 ), 4431 4440 'reverse' => 4432 4441 array( 4433 - 'aphront-dialog-view-css' => 'cc5dfafe', 4434 - 'aphront-error-view-css' => 'cc5dfafe', 4435 - 'aphront-form-view-css' => 'cc5dfafe', 4436 - 'aphront-list-filter-view-css' => 'cc5dfafe', 4437 - 'aphront-pager-view-css' => 'cc5dfafe', 4438 - 'aphront-panel-view-css' => 'cc5dfafe', 4439 - 'aphront-table-view-css' => 'cc5dfafe', 4440 - 'aphront-tokenizer-control-css' => 'cc5dfafe', 4441 - 'aphront-tooltip-css' => 'cc5dfafe', 4442 - 'aphront-typeahead-control-css' => 'cc5dfafe', 4442 + 'aphront-dialog-view-css' => '604768b8', 4443 + 'aphront-error-view-css' => '604768b8', 4444 + 'aphront-form-view-css' => '604768b8', 4445 + 'aphront-list-filter-view-css' => '604768b8', 4446 + 'aphront-pager-view-css' => '604768b8', 4447 + 'aphront-panel-view-css' => '604768b8', 4448 + 'aphront-table-view-css' => '604768b8', 4449 + 'aphront-tokenizer-control-css' => '604768b8', 4450 + 'aphront-tooltip-css' => '604768b8', 4451 + 'aphront-typeahead-control-css' => '604768b8', 4443 4452 'differential-changeset-view-css' => 'dd27a69b', 4444 4453 'differential-core-view-css' => 'dd27a69b', 4445 4454 'differential-inline-comment-editor' => '48040be9', ··· 4453 4462 'differential-table-of-contents-css' => 'dd27a69b', 4454 4463 'diffusion-commit-view-css' => 'c8ce2d88', 4455 4464 'diffusion-icons-css' => 'c8ce2d88', 4456 - 'global-drag-and-drop-css' => 'cc5dfafe', 4465 + 'global-drag-and-drop-css' => '604768b8', 4457 4466 'inline-comment-summary-css' => 'dd27a69b', 4458 4467 'javelin-aphlict' => '606f7152', 4459 4468 'javelin-behavior' => '2dbbb7d1', ··· 4526 4535 'javelin-util' => '2dbbb7d1', 4527 4536 'javelin-vector' => '2dbbb7d1', 4528 4537 'javelin-workflow' => '2dbbb7d1', 4529 - 'lightbox-attachment-css' => 'cc5dfafe', 4538 + 'lightbox-attachment-css' => '604768b8', 4530 4539 'maniphest-task-summary-css' => '06bacb9a', 4531 4540 'maniphest-transaction-detail-css' => '06bacb9a', 4532 - 'phabricator-action-list-view-css' => 'cc5dfafe', 4533 - 'phabricator-application-launch-view-css' => 'cc5dfafe', 4541 + 'phabricator-action-list-view-css' => '604768b8', 4542 + 'phabricator-application-launch-view-css' => '604768b8', 4534 4543 'phabricator-busy' => '606f7152', 4535 4544 'phabricator-content-source-view-css' => 'dd27a69b', 4536 - 'phabricator-core-css' => 'cc5dfafe', 4537 - 'phabricator-crumbs-view-css' => 'cc5dfafe', 4545 + 'phabricator-core-css' => '604768b8', 4546 + 'phabricator-crumbs-view-css' => '604768b8', 4538 4547 'phabricator-drag-and-drop-file-upload' => '48040be9', 4539 4548 'phabricator-dropdown-menu' => '606f7152', 4540 4549 'phabricator-file-upload' => '606f7152', 4541 - 'phabricator-filetree-view-css' => 'cc5dfafe', 4542 - 'phabricator-flag-css' => 'cc5dfafe', 4543 - 'phabricator-form-view-css' => 'cc5dfafe', 4544 - 'phabricator-header-view-css' => 'cc5dfafe', 4550 + 'phabricator-filetree-view-css' => '604768b8', 4551 + 'phabricator-flag-css' => '604768b8', 4552 + 'phabricator-form-view-css' => '604768b8', 4553 + 'phabricator-header-view-css' => '604768b8', 4545 4554 'phabricator-hovercard' => '606f7152', 4546 - 'phabricator-jump-nav' => 'cc5dfafe', 4555 + 'phabricator-jump-nav' => '604768b8', 4547 4556 'phabricator-keyboard-shortcut' => '606f7152', 4548 4557 'phabricator-keyboard-shortcut-manager' => '606f7152', 4549 - 'phabricator-main-menu-view' => 'cc5dfafe', 4558 + 'phabricator-main-menu-view' => '604768b8', 4550 4559 'phabricator-menu-item' => '606f7152', 4551 - 'phabricator-nav-view-css' => 'cc5dfafe', 4560 + 'phabricator-nav-view-css' => '604768b8', 4552 4561 'phabricator-notification' => '606f7152', 4553 - 'phabricator-notification-css' => 'cc5dfafe', 4554 - 'phabricator-notification-menu-css' => 'cc5dfafe', 4555 - 'phabricator-object-item-list-view-css' => 'cc5dfafe', 4562 + 'phabricator-notification-css' => '604768b8', 4563 + 'phabricator-notification-menu-css' => '604768b8', 4564 + 'phabricator-object-item-list-view-css' => '604768b8', 4556 4565 'phabricator-object-selector-css' => 'dd27a69b', 4557 4566 'phabricator-phtize' => '606f7152', 4558 4567 'phabricator-prefab' => '606f7152', 4559 4568 'phabricator-project-tag-css' => '06bacb9a', 4560 - 'phabricator-property-list-view-css' => 'cc5dfafe', 4561 - 'phabricator-remarkup-css' => 'cc5dfafe', 4569 + 'phabricator-property-list-view-css' => '604768b8', 4570 + 'phabricator-remarkup-css' => '604768b8', 4562 4571 'phabricator-shaped-request' => '48040be9', 4563 - 'phabricator-side-menu-view-css' => 'cc5dfafe', 4564 - 'phabricator-standard-page-view' => 'cc5dfafe', 4565 - 'phabricator-tag-view-css' => 'cc5dfafe', 4572 + 'phabricator-side-menu-view-css' => '604768b8', 4573 + 'phabricator-standard-page-view' => '604768b8', 4574 + 'phabricator-tag-view-css' => '604768b8', 4566 4575 'phabricator-textareautils' => '606f7152', 4567 4576 'phabricator-tooltip' => '606f7152', 4568 - 'phabricator-transaction-view-css' => 'cc5dfafe', 4569 - 'phabricator-zindex-css' => 'cc5dfafe', 4570 - 'phui-button-css' => 'cc5dfafe', 4571 - 'phui-form-css' => 'cc5dfafe', 4572 - 'phui-icon-view-css' => 'cc5dfafe', 4573 - 'phui-spacing-css' => 'cc5dfafe', 4574 - 'sprite-apps-large-css' => 'cc5dfafe', 4575 - 'sprite-gradient-css' => 'cc5dfafe', 4576 - 'sprite-icons-css' => 'cc5dfafe', 4577 - 'sprite-menu-css' => 'cc5dfafe', 4578 - 'syntax-highlighting-css' => 'cc5dfafe', 4577 + 'phabricator-transaction-view-css' => '604768b8', 4578 + 'phabricator-zindex-css' => '604768b8', 4579 + 'phui-button-css' => '604768b8', 4580 + 'phui-form-css' => '604768b8', 4581 + 'phui-icon-view-css' => '604768b8', 4582 + 'phui-spacing-css' => '604768b8', 4583 + 'sprite-apps-large-css' => '604768b8', 4584 + 'sprite-gradient-css' => '604768b8', 4585 + 'sprite-icons-css' => '604768b8', 4586 + 'sprite-menu-css' => '604768b8', 4587 + 'syntax-highlighting-css' => '604768b8', 4579 4588 ), 4580 4589 ));
+4
src/__phutil_library_map__.php
··· 749 749 'PHUIListView' => 'view/phui/PHUIListView.php', 750 750 'PHUIListViewTestCase' => 'view/layout/__tests__/PHUIListViewTestCase.php', 751 751 'PHUIPagedFormView' => 'view/form/PHUIPagedFormView.php', 752 + 'PHUIRemarkupPreviewPanel' => 'view/phui/PHUIRemarkupPreviewPanel.php', 752 753 'PHUIStatusItemView' => 'view/phui/PHUIStatusItemView.php', 753 754 'PHUIStatusListView' => 'view/phui/PHUIStatusListView.php', 754 755 'PHUITextExample' => 'applications/uiexample/examples/PHUITextExample.php', ··· 1272 1273 'PhabricatorMarkupEngine' => 'infrastructure/markup/PhabricatorMarkupEngine.php', 1273 1274 'PhabricatorMarkupInterface' => 'infrastructure/markup/PhabricatorMarkupInterface.php', 1274 1275 'PhabricatorMarkupOneOff' => 'infrastructure/markup/PhabricatorMarkupOneOff.php', 1276 + 'PhabricatorMarkupPreviewController' => 'infrastructure/markup/PhabricatorMarkupPreviewController.php', 1275 1277 'PhabricatorMercurialGraphStream' => 'applications/repository/daemon/PhabricatorMercurialGraphStream.php', 1276 1278 'PhabricatorMetaMTAActor' => 'applications/metamta/query/PhabricatorMetaMTAActor.php', 1277 1279 'PhabricatorMetaMTAActorQuery' => 'applications/metamta/query/PhabricatorMetaMTAActorQuery.php', ··· 2764 2766 'PHUIListView' => 'AphrontTagView', 2765 2767 'PHUIListViewTestCase' => 'PhabricatorTestCase', 2766 2768 'PHUIPagedFormView' => 'AphrontTagView', 2769 + 'PHUIRemarkupPreviewPanel' => 'AphrontTagView', 2767 2770 'PHUIStatusItemView' => 'AphrontTagView', 2768 2771 'PHUIStatusListView' => 'AphrontTagView', 2769 2772 'PHUITextExample' => 'PhabricatorUIExample', ··· 3320 3323 'PhabricatorManiphestTaskTestDataGenerator' => 'PhabricatorTestDataGenerator', 3321 3324 'PhabricatorMarkupCache' => 'PhabricatorCacheDAO', 3322 3325 'PhabricatorMarkupOneOff' => 'PhabricatorMarkupInterface', 3326 + 'PhabricatorMarkupPreviewController' => 'PhabricatorController', 3323 3327 'PhabricatorMetaMTAActorQuery' => 'PhabricatorQuery', 3324 3328 'PhabricatorMetaMTAConfigOptions' => 'PhabricatorApplicationConfigOptions', 3325 3329 'PhabricatorMetaMTAController' => 'PhabricatorController',
+1
src/applications/differential/application/PhabricatorApplicationDifferential.php
··· 60 60 ), 61 61 'subscribe/(?P<action>add|rem)/(?P<id>[1-9]\d*)/' 62 62 => 'DifferentialSubscribeController', 63 + 'preview/' => 'PhabricatorMarkupPreviewController', 63 64 ), 64 65 ); 65 66 }
+5 -3
src/applications/differential/controller/DifferentialRevisionEditController.php
··· 147 147 id(new AphrontFormDividerControl())); 148 148 } 149 149 150 + $preview = array(); 150 151 foreach ($aux_fields as $aux_field) { 151 152 $control = $aux_field->renderEditControl(); 152 153 if ($control) { 153 154 $form->appendChild($control); 154 155 } 156 + $preview[] = $aux_field->renderEditPreview(); 155 157 } 156 158 157 159 $submit = id(new AphrontFormSubmitControl()) ··· 185 187 186 188 $crumbs->addCrumb( 187 189 id(new PhabricatorCrumbView()) 188 - ->setName($title) 189 - ->setHref('')); 190 + ->setName($title)); 190 191 191 192 return $this->buildApplicationPage( 192 193 array( 193 194 $crumbs, 194 195 $error_view, 195 - $form), 196 + $form, 197 + $preview), 196 198 array( 197 199 'title' => $title, 198 200 'device' => true,
+13
src/applications/differential/field/specification/DifferentialFieldSpecification.php
··· 149 149 150 150 151 151 /** 152 + * Optionally, build a preview panel for the field which will appear on the 153 + * edit interface. This is used for the "Summary" field, but custom fields 154 + * generally need not implement it. 155 + * 156 + * @return AphrontView|string Something renderable. 157 + * @task edit 158 + */ 159 + public function renderEditPreview() { 160 + return null; 161 + } 162 + 163 + 164 + /** 152 165 * This method will be called after @{method:setValueFromRequest} but before 153 166 * the field is saved. It gives you an opportunity to inspect the field value 154 167 * and throw a @{class:DifferentialFieldValidationException} if there is a
+17 -1
src/applications/differential/field/specification/DifferentialSummaryFieldSpecification.php
··· 4 4 extends DifferentialFreeformFieldSpecification { 5 5 6 6 private $summary = ''; 7 + private $controlID; 7 8 8 9 public function shouldAppearOnEdit() { 9 10 return true; ··· 19 20 } 20 21 21 22 public function renderEditControl() { 22 - return id(new AphrontFormTextAreaControl()) 23 + return id(new PhabricatorRemarkupControl()) 23 24 ->setLabel('Summary') 24 25 ->setName('summary') 26 + ->setID($this->getControlID()) 25 27 ->setValue($this->summary); 28 + } 29 + 30 + public function renderEditPreview() { 31 + return id(new PHUIRemarkupPreviewPanel()) 32 + ->setHeader(pht('Summary Preview')) 33 + ->setControlID($this->getControlID()) 34 + ->setPreviewURI('/differential/preview/'); 26 35 } 27 36 28 37 public function shouldExtractMentions() { ··· 84 93 85 94 public function getKeyForSearchIndex() { 86 95 return PhabricatorSearchField::FIELD_BODY; 96 + } 97 + 98 + private function getControlID() { 99 + if (!$this->controlID) { 100 + $this->controlID = celerity_generate_unique_node_id(); 101 + } 102 + return $this->controlID; 87 103 } 88 104 89 105 }
+1 -1
src/applications/differential/field/specification/DifferentialTestPlanFieldSpecification.php
··· 31 31 } 32 32 } 33 33 34 - return id(new AphrontFormTextAreaControl()) 34 + return id(new PhabricatorRemarkupControl()) 35 35 ->setLabel('Test Plan') 36 36 ->setName('testplan') 37 37 ->setValue($this->plan)
+1 -1
src/applications/maniphest/application/PhabricatorApplicationManiphest.php
··· 59 59 'descriptionchange/(?:(?P<id>[1-9]\d*)/)?' => 60 60 'ManiphestTaskDescriptionChangeController', 61 61 'descriptionpreview/' => 62 - 'ManiphestTaskDescriptionPreviewController', 62 + 'PhabricatorMarkupPreviewController', 63 63 ), 64 64 'transaction/' => array( 65 65 'save/' => 'ManiphestTransactionSaveController',
+5 -25
src/applications/maniphest/controller/ManiphestTaskEditController.php
··· 536 536 ->addCancelButton($cancel_uri) 537 537 ->setValue($button_name)); 538 538 539 - $inst1 = pht('Description Preview'); 540 - $inst2 = pht('Loading preview...'); 541 - 542 - $description_preview_panel = hsprintf( 543 - '<div class="aphront-panel-preview aphront-panel-preview-full"> 544 - <div class="maniphest-description-preview-header"> 545 - %s 546 - </div> 547 - <div id="description-preview"> 548 - <div class="aphront-panel-preview-loading-text"> 549 - %s 550 - </div> 551 - </div> 552 - </div>', 553 - $inst1, 554 - $inst2); 555 - 556 - Javelin::initBehavior( 557 - 'maniphest-description-preview', 558 - array( 559 - 'preview' => 'description-preview', 560 - 'textarea' => 'description-textarea', 561 - 'uri' => '/maniphest/task/descriptionpreview/', 562 - )); 539 + $preview = id(new PHUIRemarkupPreviewPanel()) 540 + ->setHeader(pht('Description Preview')) 541 + ->setControlID('description-textarea') 542 + ->setPreviewURI($this->getApplicationURI('task/descriptionpreview/')); 563 543 564 544 if ($task->getID()) { 565 545 $page_objects = array( $task->getPHID() ); ··· 583 563 $crumbs, 584 564 $error_view, 585 565 $form, 586 - $description_preview_panel, 566 + $preview, 587 567 ), 588 568 array( 589 569 'title' => $header_name,
+20
src/infrastructure/markup/PhabricatorMarkupPreviewController.php
··· 1 + <?php 2 + 3 + final class PhabricatorMarkupPreviewController 4 + extends PhabricatorController { 5 + 6 + public function processRequest() { 7 + $request = $this->getRequest(); 8 + $viewer = $request->getUser(); 9 + 10 + $text = $request->getStr('text'); 11 + 12 + $output = PhabricatorMarkupEngine::renderOneObject( 13 + id(new PhabricatorMarkupOneOff())->setContent($text), 14 + 'default', 15 + $viewer); 16 + 17 + return id(new AphrontAjaxResponse()) 18 + ->setContent($output); 19 + } 20 + }
+94
src/view/phui/PHUIRemarkupPreviewPanel.php
··· 1 + <?php 2 + 3 + /** 4 + * Render a simple preview panel for a bound Remarkup text control. 5 + */ 6 + final class PHUIRemarkupPreviewPanel extends AphrontTagView { 7 + 8 + private $header; 9 + private $loadingText; 10 + private $controlID; 11 + private $previewURI; 12 + 13 + protected function canAppendChild() { 14 + return false; 15 + } 16 + 17 + public function setPreviewURI($preview_uri) { 18 + $this->previewURI = $preview_uri; 19 + return $this; 20 + } 21 + 22 + public function setControlID($control_id) { 23 + $this->controlID = $control_id; 24 + return $this; 25 + } 26 + 27 + public function setHeader($header) { 28 + $this->header = $header; 29 + return $this; 30 + } 31 + 32 + public function setLoadingText($loading_text) { 33 + $this->loadingText = $loading_text; 34 + return $this; 35 + } 36 + 37 + public function getTagName() { 38 + return 'div'; 39 + } 40 + 41 + public function getTagAttributes() { 42 + return array( 43 + 'class' => 'phui-remarkup-preview', 44 + ); 45 + } 46 + 47 + protected function getTagContent() { 48 + if ($this->previewURI === null) { 49 + throw new Exception("Call setPreviewURI() before rendering!"); 50 + } 51 + if ($this->controlID === null) { 52 + throw new Exception("Call setControlID() before rendering!"); 53 + } 54 + 55 + $preview_id = celerity_generate_unique_node_id(); 56 + 57 + require_celerity_resource('phui-remarkup-preview-css'); 58 + Javelin::initBehavior( 59 + 'remarkup-preview', 60 + array( 61 + 'previewID' => $preview_id, 62 + 'controlID' => $this->controlID, 63 + 'uri' => $this->previewURI, 64 + )); 65 + 66 + $loading = phutil_tag( 67 + 'div', 68 + array( 69 + 'class' => 'phui-preview-loading-text', 70 + ), 71 + nonempty($this->loadingText, pht('Loading preview...'))); 72 + 73 + $header = null; 74 + if ($this->header) { 75 + $header = phutil_tag( 76 + 'div', 77 + array( 78 + 'class' => 'phui-preview-header', 79 + ), 80 + $this->header); 81 + } 82 + 83 + $preview = phutil_tag( 84 + 'div', 85 + array( 86 + 'id' => $preview_id, 87 + 'class' => 'phabricator-remarkup', 88 + ), 89 + $loading); 90 + 91 + return array($header, $preview); 92 + } 93 + 94 + }
-6
webroot/rsrc/css/application/maniphest/task-edit.css
··· 2 2 * @provides maniphest-task-edit-css 3 3 */ 4 4 5 - .maniphest-description-preview-header { 6 - color: #666; 7 - margin-bottom: 1em; 8 - font-size: 11px; 9 - } 10 - 11 5 .maniphest-auxiliary-header { 12 6 font-weight: bold; 13 7 font-size: 14px;
+1
webroot/rsrc/css/core/remarkup.css
··· 158 158 background: #dddddd; 159 159 } 160 160 161 + .phui-remarkup-preview .phabricator-remarkup-mention-unknown, 161 162 .aphront-panel-preview .phabricator-remarkup-mention-unknown { 162 163 font-weight: bold; 163 164 background: #ffaaaa;
+23
webroot/rsrc/css/phui/phui-remarkup-preview.css
··· 1 + /** 2 + * @provides phui-remarkup-preview-css 3 + */ 4 + 5 + .phui-preview-header { 6 + color: #666666; 7 + margin-bottom: 12px; 8 + font-size: 11px; 9 + } 10 + 11 + .phui-remarkup-preview { 12 + background: #fbfbfb; 13 + border-bottom: 1px solid #aaaaaa; 14 + padding: 12px; 15 + } 16 + 17 + .device-phone .aphront-panel-preview { 18 + display: none; 19 + } 20 + 21 + .phui-preview-loading-text { 22 + color: #666666; 23 + }
-29
webroot/rsrc/js/application/maniphest/behavior-task-preview.js
··· 1 - /** 2 - * @provides javelin-behavior-maniphest-description-preview 3 - * @requires javelin-behavior 4 - * javelin-dom 5 - * javelin-util 6 - * phabricator-shaped-request 7 - */ 8 - 9 - JX.behavior('maniphest-description-preview', function(config) { 10 - 11 - var preview = JX.$(config.preview); 12 - var textarea = JX.$(config.textarea); 13 - 14 - var callback = function(r) { 15 - JX.DOM.setContent(JX.$(config.preview), JX.$H(r)); 16 - }; 17 - 18 - var getdata = function() { 19 - return { 20 - description : textarea.value 21 - }; 22 - }; 23 - 24 - var request = new JX.PhabricatorShapedRequest(config.uri, callback, getdata); 25 - var trigger = JX.bind(request, request.trigger); 26 - 27 - JX.DOM.listen(textarea, 'keydown', null, trigger); 28 - request.start(); 29 - });
+31
webroot/rsrc/js/core/behavior-remarkup-preview.js
··· 1 + /** 2 + * @provides javelin-behavior-remarkup-preview 3 + * @requires javelin-behavior 4 + * javelin-dom 5 + * javelin-util 6 + * phabricator-shaped-request 7 + */ 8 + 9 + JX.behavior('remarkup-preview', function(config) { 10 + 11 + var preview = JX.$(config.previewID); 12 + var control = JX.$(config.controlID); 13 + 14 + var callback = function(r) { 15 + JX.DOM.setContent(preview, JX.$H(r)); 16 + }; 17 + 18 + var getdata = function() { 19 + return { 20 + text : control.value 21 + }; 22 + }; 23 + 24 + var request = new JX.PhabricatorShapedRequest(config.uri, callback, getdata); 25 + var trigger = JX.bind(request, request.trigger); 26 + 27 + JX.DOM.listen(control, 'keydown', null, trigger); 28 + request.start(); 29 + 30 + trigger(); 31 + });