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

Remarkup for Differential comments.

+192 -6
+10 -1
src/__celerity_resource_map__.php
··· 118 118 ), 119 119 'differential-revision-comment-css' => 120 120 array( 121 - 'uri' => '/res/d9924857/rsrc/css/application/differential/revision-comment.css', 121 + 'uri' => '/res/21572195/rsrc/css/application/differential/revision-comment.css', 122 122 'type' => 'css', 123 123 'requires' => 124 124 array( ··· 178 178 array( 179 179 ), 180 180 'disk' => '/rsrc/css/core/core.css', 181 + ), 182 + 'phabricator-remarkup-css' => 183 + array( 184 + 'uri' => '/res/786989c3/rsrc/css/core/remarkup.css', 185 + 'type' => 'css', 186 + 'requires' => 187 + array( 188 + ), 189 + 'disk' => '/rsrc/css/core/remarkup.css', 181 190 ), 182 191 'syntax-highlighting-css' => 183 192 array(
+1
src/__phutil_library_map__.php
··· 88 88 'DifferentialHunk' => 'applications/differential/storage/hunk', 89 89 'DifferentialLintStatus' => 'applications/differential/constants/lintstatus', 90 90 'DifferentialMail' => 'applications/differential/mail/base', 91 + 'DifferentialMarkupEngineFactory' => 'applications/differential/parser/markup', 91 92 'DifferentialNewDiffMail' => 'applications/differential/mail/newdiff', 92 93 'DifferentialReviewRequestMail' => 'applications/differential/mail/reviewrequest', 93 94 'DifferentialRevision' => 'applications/differential/storage/revision',
+1 -1
src/applications/differential/controller/revisionedit/DifferentialRevisionEditController.php
··· 86 86 $editor->setReviewers($request->getArr('reviewers')); 87 87 $editor->save(); 88 88 89 - $response = id(new AphrontRedirectResponse()) 89 + return id(new AphrontRedirectResponse()) 90 90 ->setURI('/D'.$revision->getID()); 91 91 } 92 92
+2 -2
src/applications/differential/editor/revision/DifferentialRevisionEditor.php
··· 365 365 } 366 366 367 367 } else { 368 - $diff = $revision->getActiveDiff(); 368 + $diff = $revision->loadActiveDiff(); 369 369 if ($diff) { 370 - $changesets = id(new DifferentialChangeset())->loadAllWithDiff($diff); 370 + $changesets = $diff->loadChangesets(); 371 371 } else { 372 372 $changesets = array(); 373 373 }
-1
src/applications/differential/editor/revision/__init__.php
··· 9 9 phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus'); 10 10 phutil_require_module('phabricator', 'applications/differential/mail/ccwelcome'); 11 11 phutil_require_module('phabricator', 'applications/differential/mail/newdiff'); 12 - phutil_require_module('phabricator', 'applications/differential/storage/changeset'); 13 12 phutil_require_module('phabricator', 'applications/differential/storage/revision'); 14 13 phutil_require_module('phabricator', 'storage/qsprintf'); 15 14 phutil_require_module('phabricator', 'storage/queryfx');
+49
src/applications/differential/parser/markup/DifferentialMarkupEngineFactory.php
··· 1 + <?php 2 + 3 + /* 4 + * Copyright 2011 Facebook, Inc. 5 + * 6 + * Licensed under the Apache License, Version 2.0 (the "License"); 7 + * you may not use this file except in compliance with the License. 8 + * You may obtain a copy of the License at 9 + * 10 + * http://www.apache.org/licenses/LICENSE-2.0 11 + * 12 + * Unless required by applicable law or agreed to in writing, software 13 + * distributed under the License is distributed on an "AS IS" BASIS, 14 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 + * See the License for the specific language governing permissions and 16 + * limitations under the License. 17 + */ 18 + 19 + class DifferentialMarkupEngineFactory { 20 + 21 + public function newDifferentialCommentMarkupEngine() { 22 + $engine = new PhutilRemarkupEngine(); 23 + 24 + $rules = array(); 25 + $rules[] = new PhutilRemarkupRuleEscapeRemarkup(); 26 + $rules[] = new PhutilRemarkupRuleHyperlink(); 27 + $rules[] = new PhutilRemarkupRuleEscapeHTML(); 28 + $rules[] = new PhutilRemarkupRuleMonospace(); 29 + $rules[] = new PhutilRemarkupRuleBold(); 30 + $rules[] = new PhutilRemarkupRuleItalic(); 31 + 32 + $blocks = array(); 33 + $blocks[] = new PhutilRemarkupEngineRemarkupHeaderBlockRule(); 34 + $blocks[] = new PhutilRemarkupEngineRemarkupListBlockRule(); 35 + $blocks[] = new PhutilRemarkupEngineRemarkupCodeBlockRule(); 36 + $blocks[] = new PhutilRemarkupEngineRemarkupDefaultBlockRule(); 37 + 38 + foreach ($blocks as $block) { 39 + if (!($block instanceof PhutilRemarkupEngineRemarkupCodeBlockRule)) { 40 + $block->setMarkupRules($rules); 41 + } 42 + } 43 + 44 + $engine->setBlockRules($blocks); 45 + 46 + return $engine; 47 + } 48 + 49 + }
+22
src/applications/differential/parser/markup/__init__.php
··· 1 + <?php 2 + /** 3 + * This file is automatically generated. Lint this module to rebuild it. 4 + * @generated 5 + */ 6 + 7 + 8 + 9 + phutil_require_module('phutil', 'markup/engine/remarkup'); 10 + phutil_require_module('phutil', 'markup/engine/remarkup/blockrule/remarkupcode'); 11 + phutil_require_module('phutil', 'markup/engine/remarkup/blockrule/remarkupdefault'); 12 + phutil_require_module('phutil', 'markup/engine/remarkup/blockrule/remarkupheader'); 13 + phutil_require_module('phutil', 'markup/engine/remarkup/blockrule/remarkuplist'); 14 + phutil_require_module('phutil', 'markup/engine/remarkup/markuprule/bold'); 15 + phutil_require_module('phutil', 'markup/engine/remarkup/markuprule/escapehtml'); 16 + phutil_require_module('phutil', 'markup/engine/remarkup/markuprule/escaperemarkup'); 17 + phutil_require_module('phutil', 'markup/engine/remarkup/markuprule/hyperlink'); 18 + phutil_require_module('phutil', 'markup/engine/remarkup/markuprule/italics'); 19 + phutil_require_module('phutil', 'markup/engine/remarkup/markuprule/monospace'); 20 + 21 + 22 + phutil_require_source('DifferentialMarkupEngineFactory.php');
+6
src/applications/differential/storage/revision/DifferentialRevision.php
··· 69 69 $this->getID()); 70 70 } 71 71 72 + public function loadActiveDiff() { 73 + return id(new DifferentialDiff())->loadOneWhere( 74 + 'revisionID = %d ORDER BY id DESC LIMIT 1', 75 + $this->getID()); 76 + } 77 + 72 78 public function loadRelationships() { 73 79 if (!$this->getID()) { 74 80 $this->relationships = array();
+11 -1
src/applications/differential/view/revisioncomment/DifferentialRevisionCommentView.php
··· 20 20 21 21 private $comment; 22 22 private $handles; 23 + private $markupEngine; 23 24 24 25 public function setComment($comment) { 25 26 $this->comment = $comment; ··· 28 29 29 30 public function setHandles(array $handles) { 30 31 $this->handles = $handles; 32 + return $this; 33 + } 34 + 35 + public function setMarkupEngine($markup_engine) { 36 + $this->markupEngine = $markup_engine; 31 37 return $this; 32 38 } 33 39 34 40 public function render() { 35 41 42 + require_celerity_resource('phabricator-remarkup-css'); 36 43 require_celerity_resource('differential-revision-comment-css'); 37 44 38 45 $comment = $this->comment; ··· 52 59 $content = $comment->getContent(); 53 60 if (strlen(rtrim($content))) { 54 61 $title = "{$author} {$verb} this revision:"; 55 - $content = phutil_escape_html($content); 62 + $content = 63 + '<div class="phabricator-remarkup">'. 64 + $this->markupEngine->markupText($content). 65 + '</div>'; 56 66 } else { 57 67 $title = null; 58 68 $content =
+4
src/applications/differential/view/revisioncommentlist/DifferentialRevisionCommentListView.php
··· 35 35 36 36 require_celerity_resource('differential-revision-comment-list-css'); 37 37 38 + $factory = new DifferentialMarkupEngineFactory(); 39 + $engine = $factory->newDifferentialCommentMarkupEngine(); 40 + 38 41 $comments = array(); 39 42 foreach ($this->comments as $comment) { 40 43 $view = new DifferentialRevisionCommentView(); 41 44 $view->setComment($comment); 42 45 $view->setHandles($this->handles); 46 + $view->setMarkupEngine($engine); 43 47 44 48 $comments[] = $view->render(); 45 49 }
+1
src/applications/differential/view/revisioncommentlist/__init__.php
··· 6 6 7 7 8 8 9 + phutil_require_module('phabricator', 'applications/differential/parser/markup'); 9 10 phutil_require_module('phabricator', 'applications/differential/view/revisioncomment'); 10 11 phutil_require_module('phabricator', 'infratructure/celerity/api'); 11 12 phutil_require_module('phabricator', 'view/base');
+55
webroot/rsrc/css/application/differential/revision-comment.css
··· 37 37 margin: 0em; 38 38 padding: .3em 5px .4em 1.25em; 39 39 } 40 + 41 + .differential-comment-content code { 42 + width: 88ex; 43 + width: 81ch; 44 + } 45 + 46 + .differential-comment-nocontent { 47 + font-weight: bold; 48 + } 49 + 50 + .differential-comment-action-testplan .differential-comment-content { 51 + border-color: #660099; 52 + background: #f6f3ff; 53 + } 54 + 55 + .differential-comment-action-abandon .differential-comment-content { 56 + border-color: #222222; 57 + background: #f3f3f3; 58 + } 59 + 60 + .differential-comment-action-accept .differential-comment-content { 61 + border-color: #009966; 62 + background: #f3fff3; 63 + } 64 + 65 + .differential-comment-action-reject .differential-comment-content { 66 + border-color: #aa0000; 67 + background: #fff3f3; 68 + } 69 + 70 + .differential-comment-action-commit .differential-comment-content { 71 + border-color: #006699; 72 + background: #f3f3ff; 73 + } 74 + 75 + 76 + .differential-comment-action-reclaim .differential-comment-content { 77 + border-color: #0099aa; 78 + background: #f3fff9; 79 + } 80 + 81 + .differential-comment-action-update .differential-comment-content { 82 + border-color: #6699cc; 83 + background: #f3f9ff; 84 + } 85 + 86 + .differential-comment-action-add_reviewers .differential-comment-content { 87 + border-color: #aa99cc; 88 + background: #f9f3ff; 89 + } 90 + 91 + .differential-comment-action-request_review .differential-comment-content { 92 + border-color: #cc9966; 93 + background: #fff9f3; 94 + }
+30
webroot/rsrc/css/core/remarkup.css
··· 1 + /** 2 + * @provides phabricator-remarkup-css 3 + */ 4 + 5 + .phabricator-remarkup p { 6 + margin: 1em 0; 7 + } 8 + 9 + .phabricator-remarkup code { 10 + background: #fdfae7; 11 + border: 1px solid #f5e178; 12 + display: block; 13 + white-space: pre; 14 + font-family: "Monaco", monospace; 15 + font-size: 10px; 16 + color: #000000; 17 + margin: 1em 2em; 18 + padding: .5em 1.5em; 19 + } 20 + 21 + .phabricator-remarkup code.remarkup-counterexample { 22 + border: 1px solid #aa0000; 23 + background-color: #ffaaaa; 24 + } 25 + 26 + .phabricator-remarkup ul { 27 + list-style: disc; 28 + margin: 1em 0 1em 3em; 29 + } 30 +