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

PHUI Text View

Summary: Adds basic colors and text styles for shorthand use.

Test Plan: UIExamples

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

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

+207
+9
src/__celerity_resource_map__.php
··· 3616 3616 ), 3617 3617 'disk' => '/rsrc/css/phui/phui-icon.css', 3618 3618 ), 3619 + 'phui-text-css' => 3620 + array( 3621 + 'uri' => '/res/ca884ca6/rsrc/css/phui/phui-text.css', 3622 + 'type' => 'css', 3623 + 'requires' => 3624 + array( 3625 + ), 3626 + 'disk' => '/rsrc/css/phui/phui-text.css', 3627 + ), 3619 3628 'ponder-comment-table-css' => 3620 3629 array( 3621 3630 'uri' => '/res/a1bb9056/rsrc/css/application/ponder/comments.css',
+4
src/__phutil_library_map__.php
··· 669 669 'PHUIFeedStoryView' => 'view/phui/PHUIFeedStoryView.php', 670 670 'PHUIIconExample' => 'applications/uiexample/examples/PHUIIconExample.php', 671 671 'PHUIIconView' => 'view/phui/PHUIIconView.php', 672 + 'PHUITextExample' => 'applications/uiexample/examples/PHUITextExample.php', 673 + 'PHUITextView' => 'view/phui/PHUITextView.php', 672 674 'PackageCreateMail' => 'applications/owners/mail/PackageCreateMail.php', 673 675 'PackageDeleteMail' => 'applications/owners/mail/PackageDeleteMail.php', 674 676 'PackageMail' => 'applications/owners/mail/PackageMail.php', ··· 2375 2377 'PHUIFeedStoryView' => 'AphrontView', 2376 2378 'PHUIIconExample' => 'PhabricatorUIExample', 2377 2379 'PHUIIconView' => 'AphrontTagView', 2380 + 'PHUITextExample' => 'PhabricatorUIExample', 2381 + 'PHUITextView' => 'AphrontTagView', 2378 2382 'PackageCreateMail' => 'PackageMail', 2379 2383 'PackageDeleteMail' => 'PackageMail', 2380 2384 'PackageMail' => 'PhabricatorMail',
+105
src/applications/uiexample/examples/PHUITextExample.php
··· 1 + <?php 2 + 3 + final class PHUITextExample extends PhabricatorUIExample { 4 + 5 + public function getName() { 6 + return 'Text'; 7 + } 8 + 9 + public function getDescription() { 10 + return 'Simple styles for displaying text.'; 11 + } 12 + 13 + public function renderExample() { 14 + 15 + $color1 = 'This is RED. '; 16 + $color2 = 'This is ORANGE. '; 17 + $color3 = 'This is YELLOW. '; 18 + $color4 = 'This is GREEN. '; 19 + $color5 = 'This is BLUE. '; 20 + $color6 = 'This is INDIGO. '; 21 + $color7 = 'This is VIOLET. '; 22 + $color8 = 'This is WHITE. '; 23 + $color9 = 'This is BLACK. '; 24 + 25 + $text1 = 'This is BOLD. '; 26 + $text2 = 'This is Uppercase. '; 27 + $text3 = 'This is Stricken.'; 28 + 29 + $content = 30 + array( 31 + id(new PHUITextView()) 32 + ->setText($color1) 33 + ->addClass(PHUI::TEXT_RED), 34 + id(new PHUITextView()) 35 + ->setText($color2) 36 + ->addClass(PHUI::TEXT_ORANGE), 37 + id(new PHUITextView()) 38 + ->setText($color3) 39 + ->addClass(PHUI::TEXT_YELLOW), 40 + id(new PHUITextView()) 41 + ->setText($color4) 42 + ->addClass(PHUI::TEXT_GREEN), 43 + id(new PHUITextView()) 44 + ->setText($color5) 45 + ->addClass(PHUI::TEXT_BLUE), 46 + id(new PHUITextView()) 47 + ->setText($color6) 48 + ->addClass(PHUI::TEXT_INDIGO), 49 + id(new PHUITextView()) 50 + ->setText($color7) 51 + ->addClass(PHUI::TEXT_VIOLET), 52 + id(new PHUITextView()) 53 + ->setText($color8) 54 + ->addClass(PHUI::TEXT_WHITE), 55 + id(new PHUITextView()) 56 + ->setText($color9) 57 + ->addClass(PHUI::TEXT_BLACK)); 58 + 59 + $content2 = 60 + array( 61 + id(new PHUITextView()) 62 + ->setText($text1) 63 + ->addClass(PHUI::TEXT_BOLD), 64 + id(new PHUITextView()) 65 + ->setText($text2) 66 + ->addClass(PHUI::TEXT_UPPERCASE), 67 + id(new PHUITextView()) 68 + ->setText($text3) 69 + ->addClass(PHUI::TEXT_STRIKE)); 70 + 71 + $layout1 = id(new PHUIBoxView()) 72 + ->appendChild($content) 73 + ->setShadow(true) 74 + ->addPadding(PHUI::PADDING_MEDIUM); 75 + 76 + $head1 = id(new PhabricatorHeaderView()) 77 + ->setHeader(pht('Basic Colors')); 78 + 79 + $wrap1 = id(new PHUIBoxView()) 80 + ->appendChild($layout1) 81 + ->addMargin(PHUI::MARGIN_LARGE); 82 + 83 + $layout2 = id(new PHUIBoxView()) 84 + ->appendChild($content2) 85 + ->setShadow(true) 86 + ->addPadding(PHUI::PADDING_MEDIUM); 87 + 88 + $head2 = id(new PhabricatorHeaderView()) 89 + ->setHeader(pht('Basic Transforms')); 90 + 91 + $wrap2 = id(new PHUIBoxView()) 92 + ->appendChild($layout2) 93 + ->addMargin(PHUI::MARGIN_LARGE); 94 + 95 + return phutil_tag( 96 + 'div', 97 + array(), 98 + array( 99 + $head1, 100 + $wrap1, 101 + $head2, 102 + $wrap2 103 + )); 104 + } 105 + }
+14
src/view/phui/PHUI.php
··· 42 42 const PADDING_MEDIUM_TOP = 'pmt'; 43 43 const PADDING_LARGE_TOP = 'plt'; 44 44 45 + const TEXT_BOLD = 'phui-text-bold'; 46 + const TEXT_UPPERCASE = 'phui-text-uppercase'; 47 + const TEXT_STRIKE = 'phui-text-strike'; 48 + 49 + const TEXT_RED = 'phui-text-red'; 50 + const TEXT_ORANGE = 'phui-text-orange'; 51 + const TEXT_YELLOW = 'phui-text-yellow'; 52 + const TEXT_GREEN = 'phui-text-green'; 53 + const TEXT_BLUE = 'phui-text-blue'; 54 + const TEXT_INDIGO = 'phui-text-indigo'; 55 + const TEXT_VIOLET = 'phui-text-violet'; 56 + const TEXT_WHITE = 'phui-text-white'; 57 + const TEXT_BLACK = 'phui-text-black'; 58 + 45 59 }
+20
src/view/phui/PHUITextView.php
··· 1 + <?php 2 + 3 + final class PHUITextView extends AphrontTagView { 4 + 5 + private $text; 6 + 7 + public function setText($text) { 8 + $this->appendChild($text); 9 + return $this; 10 + } 11 + 12 + public function getTagName() { 13 + return 'span'; 14 + } 15 + 16 + public function getTagAttributes() { 17 + require_celerity_resource('phui-text-css'); 18 + return array(); 19 + } 20 + }
+55
webroot/rsrc/css/phui/phui-text.css
··· 1 + /** 2 + * @provides phui-text-css 3 + */ 4 + 5 + 6 + /* Styles */ 7 + .phui-text-bold { 8 + font-weight: bold; 9 + } 10 + 11 + .phui-text-uppercase { 12 + text-transform: uppercase; 13 + } 14 + 15 + .phui-text-strike { 16 + text-decoration: line-through; 17 + } 18 + 19 + 20 + /* Colors */ 21 + .phui-text-red { 22 + color: #E41C2B; 23 + } 24 + 25 + .phui-text-orange { 26 + color: #EA921D; 27 + } 28 + 29 + .phui-text-yellow { 30 + color: #EABB1D; 31 + } 32 + 33 + .phui-text-green { 34 + color: #2FC118 35 + } 36 + 37 + .phui-text-blue { 38 + color: #1D5998; 39 + } 40 + 41 + .phui-text-indigo { 42 + color: #BD1772; 43 + } 44 + 45 + .phui-text-violet { 46 + color: #701A9C; 47 + } 48 + 49 + .phui-text-white { 50 + color: #fff; 51 + } 52 + 53 + .phui-text-black { 54 + color: #333; 55 + }