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

render_tag -> tag: Differential Changeset stuff

Summary: I cheated in a couple of places here, but this is in the process of getting refactored anyway, and there's a pretty clear boundary.

Test Plan: Viewed changesets in Differential, viewed standalone. Viewed context elements.

Reviewers: vrana

Reviewed By: vrana

CC: aran

Maniphest Tasks: T2432

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

+76 -41
+4
src/applications/differential/controller/DifferentialChangesetViewController.php
··· 234 234 235 235 Javelin::initBehavior('differential-comment-jump', array()); 236 236 237 + // TODO: [HTML] Clean up DifferentialChangesetParser output, but it's 238 + // undergoing like six kinds of refactoring anyway. 239 + $output = phutil_safe_html($output); 240 + 237 241 $detail = new DifferentialChangesetDetailView(); 238 242 $detail->setChangeset($changeset); 239 243 $detail->appendChild($output);
+16 -8
src/applications/differential/render/DifferentialChangesetHTMLRenderer.php
··· 319 319 $meta['whitespace'] = DifferentialChangesetParser::WHITESPACE_SHOW_ALL; 320 320 } 321 321 322 - $more = null; 322 + $content = array(); 323 + $content[] = $message; 323 324 if ($force !== 'none') { 324 - $more = ' '.javelin_tag( 325 + $content[] = ' '; 326 + $content[] = javelin_tag( 325 327 'a', 326 328 array( 327 329 'mustcapture' => true, ··· 334 336 } 335 337 336 338 return $this->wrapChangeInTable( 337 - javelin_render_tag( 339 + javelin_tag( 338 340 'tr', 339 341 array( 340 342 'sigil' => 'context-target', 341 343 ), 342 - '<td class="differential-shield" colspan="6">'. 343 - phutil_escape_html($message). 344 - $more. 345 - '</td>')); 344 + phutil_tag( 345 + 'td', 346 + array( 347 + 'class' => 'differential-shield', 348 + 'colspan' => 6, 349 + ), 350 + $content))); 346 351 } 347 352 348 353 protected function wrapChangeInTable($content) { ··· 350 355 return null; 351 356 } 352 357 353 - return javelin_render_tag( 358 + // TODO: [HTML] After TwoUpRenderer gets refactored, fix this. 359 + $content = phutil_safe_html($content); 360 + 361 + return javelin_tag( 354 362 'table', 355 363 array( 356 364 'class' => 'differential-diff remarkup-code PhabricatorMonospaced',
+26 -6
src/applications/differential/render/DifferentialChangesetTwoUpRenderer.php
··· 148 148 } 149 149 } 150 150 151 - $container = javelin_render_tag( 151 + $container = javelin_tag( 152 152 'tr', 153 153 array( 154 154 'sigil' => 'context-target', 155 155 ), 156 - '<td colspan="2" class="show-more">'. 157 - implode(' &bull; ', $contents). 158 - '</td>'. 159 - '<th class="show-context-line">'.$context_line.'</td>'. 160 - '<td colspan="3" class="show-context">'.$context.'</td>'); 156 + array( 157 + phutil_tag( 158 + 'td', 159 + array( 160 + 'colspan' => 2, 161 + 'class' => 'show-more', 162 + ), 163 + array_interleave( 164 + " \xE2\x80\xA2 ", // Bullet 165 + $contents)), 166 + phutil_tag( 167 + 'th', 168 + array( 169 + 'class' => 'show-context-line', 170 + ), 171 + $context_line ? (int)$context_line : null), 172 + phutil_tag( 173 + 'td', 174 + array( 175 + 'colspan' => 3, 176 + 'class' => 'show-context', 177 + ), 178 + // TODO: [HTML] Escaping model here isn't ideal. 179 + phutil_safe_html($context)), 180 + )); 161 181 162 182 $html[] = $container; 163 183
+18 -16
src/applications/differential/view/DifferentialChangesetDetailView.php
··· 59 59 60 60 $buttons = null; 61 61 if ($this->buttons) { 62 - $buttons = 63 - '<div class="differential-changeset-buttons">'. 64 - implode('', $this->buttons). 65 - '</div>'; 62 + $buttons = phutil_tag( 63 + 'div', 64 + array( 65 + 'class' => 'differential-changeset-buttons', 66 + ), 67 + $this->buttons); 66 68 } 67 69 68 70 $id = $this->getID(); ··· 77 79 78 80 $display_filename = $changeset->getDisplayFilename(); 79 81 80 - $output = javelin_render_tag( 82 + return javelin_tag( 81 83 'div', 82 84 array( 83 85 'sigil' => 'differential-changeset', ··· 90 92 'class' => $class, 91 93 'id' => $id, 92 94 ), 93 - id(new PhabricatorAnchorView()) 94 - ->setAnchorName($changeset->getAnchorName()) 95 - ->setNavigationMarker(true) 96 - ->render(). 97 - $buttons. 98 - '<h1>'.phutil_escape_html($display_filename).'</h1>'. 99 - '<div style="clear: both;"></div>'. 100 - $this->renderChildren()); 101 - 102 - 103 - return $output; 95 + $this->renderHTMLView( 96 + array( 97 + id(new PhabricatorAnchorView()) 98 + ->setAnchorName($changeset->getAnchorName()) 99 + ->setNavigationMarker(true) 100 + ->render(), 101 + $buttons, 102 + phutil_tag('h1', array(), $display_filename), 103 + phutil_tag('div', array('style' => 'clear: both'), ''), 104 + $this->renderHTMLChildren(), 105 + ))); 104 106 } 105 107 106 108 }
+12 -10
src/applications/differential/view/DifferentialChangesetListView.php
··· 192 192 )); 193 193 } 194 194 195 - return 196 - id(new PhabricatorHeaderView()) 197 - ->setHeader($this->getTitle()) 198 - ->render(). 199 - phutil_render_tag( 200 - 'div', 195 + return $this->renderHTMLView( 201 196 array( 202 - 'class' => 'differential-review-stage', 203 - 'id' => 'differential-review-stage', 204 - ), 205 - implode("\n", $output)); 197 + id(new PhabricatorHeaderView()) 198 + ->setHeader($this->getTitle()) 199 + ->render(), 200 + phutil_tag( 201 + 'div', 202 + array( 203 + 'class' => 'differential-review-stage', 204 + 'id' => 'differential-review-stage', 205 + ), 206 + $output), 207 + )); 206 208 } 207 209 208 210 /**
-1
webroot/rsrc/js/application/core/behavior-dark-console.js
··· 81 81 JX.DOM.alterClass(req.all[req.current], 'dark-selected', true); 82 82 83 83 if (statics.visible) { 84 - JX.log('visible!'); 85 84 draw_request(key); 86 85 } 87 86 }