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

Remove docs sprite, replace with FontAwesome

Summary: Removes the docs sprite in Conpherence with FontAwesome, adds additional icons. Unsure what happens if someone customized this config option.

Test Plan: Added images and files to a Conpherence, saw new icons.

Reviewers: btrahan, epriestley

Reviewed By: epriestley

Subscribers: Korvin, epriestley

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

+33 -166
-4
resources/celerity/map.php
··· 148 148 'rsrc/css/phui/phui-workpanel-view.css' => '198c7e6c', 149 149 'rsrc/css/sprite-apps-large.css' => '20ec0cc0', 150 150 'rsrc/css/sprite-apps.css' => 'd5baed0f', 151 - 'rsrc/css/sprite-docs.css' => '5f65d0da', 152 151 'rsrc/css/sprite-gradient.css' => '4bdb98a7', 153 152 'rsrc/css/sprite-login.css' => 'a355d921', 154 153 'rsrc/css/sprite-main-header.css' => '92720ee2', ··· 320 319 'rsrc/image/sprite-apps-large-X2.png' => '79e15268', 321 320 'rsrc/image/sprite-apps-large.png' => '4d41b94a', 322 321 'rsrc/image/sprite-apps.png' => '5570df20', 323 - 'rsrc/image/sprite-docs-X2.png' => '6dc1adad', 324 - 'rsrc/image/sprite-docs.png' => '4636297f', 325 322 'rsrc/image/sprite-gradient.png' => 'ec15a417', 326 323 'rsrc/image/sprite-login-X2.png' => '5ae6de3a', 327 324 'rsrc/image/sprite-login.png' => '07f2c67c', ··· 811 808 'setup-issue-css' => '8f852bc0', 812 809 'sprite-apps-css' => 'd5baed0f', 813 810 'sprite-apps-large-css' => '20ec0cc0', 814 - 'sprite-docs-css' => '5f65d0da', 815 811 'sprite-gradient-css' => '4bdb98a7', 816 812 'sprite-login-css' => 'a355d921', 817 813 'sprite-main-header-css' => '92720ee2',
resources/sprite/docs_1x/audio.png

This is a binary file and will not be displayed.

resources/sprite/docs_1x/doc.png

This is a binary file and will not be displayed.

resources/sprite/docs_1x/file.png

This is a binary file and will not be displayed.

resources/sprite/docs_1x/image.png

This is a binary file and will not be displayed.

resources/sprite/docs_1x/movie.png

This is a binary file and will not be displayed.

resources/sprite/docs_1x/pdf.png

This is a binary file and will not be displayed.

resources/sprite/docs_1x/place.png

This is a binary file and will not be displayed.

resources/sprite/docs_1x/zip.png

This is a binary file and will not be displayed.

resources/sprite/docs_2x/audio.png

This is a binary file and will not be displayed.

resources/sprite/docs_2x/doc.png

This is a binary file and will not be displayed.

resources/sprite/docs_2x/file.png

This is a binary file and will not be displayed.

resources/sprite/docs_2x/image.png

This is a binary file and will not be displayed.

resources/sprite/docs_2x/movie.png

This is a binary file and will not be displayed.

resources/sprite/docs_2x/pdf.png

This is a binary file and will not be displayed.

resources/sprite/docs_2x/place.png

This is a binary file and will not be displayed.

resources/sprite/docs_2x/zip.png

This is a binary file and will not be displayed.

-51
resources/sprite/manifest/docs.json
··· 1 - { 2 - "version" : 1, 3 - "sprites" : { 4 - "docs_audio" : { 5 - "name" : "docs_audio", 6 - "rule" : ".docs_audio", 7 - "hash" : "673217354b0a2406be92be7d1d710422" 8 - }, 9 - "docs_doc" : { 10 - "name" : "docs_doc", 11 - "rule" : ".docs_doc", 12 - "hash" : "5cc83abc67ba4b26bb898b35d75ebef7" 13 - }, 14 - "docs_file" : { 15 - "name" : "docs_file", 16 - "rule" : ".docs_file", 17 - "hash" : "319218d4f65c766faac607a26ffa751e" 18 - }, 19 - "docs_image" : { 20 - "name" : "docs_image", 21 - "rule" : ".docs_image", 22 - "hash" : "ee313b6b35435ef4c534614ea2a6182e" 23 - }, 24 - "docs_movie" : { 25 - "name" : "docs_movie", 26 - "rule" : ".docs_movie", 27 - "hash" : "aa9f12307047adb1bda4f74d4376a57a" 28 - }, 29 - "docs_pdf" : { 30 - "name" : "docs_pdf", 31 - "rule" : ".docs_pdf", 32 - "hash" : "a6e4a2cb8b8d0e6777e6010ab4d530b5" 33 - }, 34 - "docs_place" : { 35 - "name" : "docs_place", 36 - "rule" : ".docs_place", 37 - "hash" : "7328b8d6c6d8440975f7f098a347a17e" 38 - }, 39 - "docs_zip" : { 40 - "name" : "docs_zip", 41 - "rule" : ".docs_zip", 42 - "hash" : "d6b11a4d6217356fe7c488c729e6fc99" 43 - } 44 - }, 45 - "scales" : [ 46 - 1, 47 - 2 48 - ], 49 - "header" : "\/**\n * @provides sprite-docs-css\n * @generated\n *\/\n\n.sprite-docs {\n background-image: url(\/rsrc\/image\/sprite-docs.png);\n background-repeat: no-repeat;\n}\n\n@media\nonly screen and (min-device-pixel-ratio: 1.5),\nonly screen and (-webkit-min-device-pixel-ratio: 1.5) {\n .sprite-docs {\n background-image: url(\/rsrc\/image\/sprite-docs-X2.png);\n background-size: {X}px {Y}px;\n }\n}\n", 50 - "type" : "standard" 51 - }
-1
scripts/celerity/generate_sprites.php
··· 31 31 'apps' => $generator->buildAppsSheet(), 32 32 'apps-large' => $generator->buildAppsLargeSheet(), 33 33 'tokens' => $generator->buildTokenSheet(), 34 - 'docs' => $generator->buildDocsSheet(), 35 34 'gradient' => $generator->buildGradientSheet(), 36 35 'main-header' => $generator->buildMainHeaderSheet(), 37 36 'login' => $generator->buildLoginSheet(),
-32
src/applications/celerity/CeleritySpriteGenerator.php
··· 117 117 return $sheet; 118 118 } 119 119 120 - public function buildDocsSheet() { 121 - $icons = $this->getDirectoryList('docs_1x'); 122 - $scales = array( 123 - '1x' => 1, 124 - '2x' => 2, 125 - ); 126 - $template = id(new PhutilSprite()) 127 - ->setSourceSize(32, 32); 128 - 129 - $sprites = array(); 130 - $prefix = 'docs_'; 131 - foreach ($icons as $icon) { 132 - $sprite = id(clone $template) 133 - ->setName($prefix.$icon) 134 - ->setTargetCSS('.'.$prefix.$icon); 135 - 136 - foreach ($scales as $scale_key => $scale) { 137 - $path = $this->getPath($prefix.$scale_key.'/'.$icon.'.png'); 138 - $sprite->setSourceFile($path, $scale); 139 - } 140 - $sprites[] = $sprite; 141 - } 142 - 143 - $sheet = $this->buildSheet('docs', true); 144 - $sheet->setScales($scales); 145 - foreach ($sprites as $sprite) { 146 - $sheet->addSprite($sprite); 147 - } 148 - 149 - return $sheet; 150 - } 151 - 152 120 public function buildLoginSheet() { 153 121 $icons = $this->getDirectoryList('login_1x'); 154 122 $scales = array(
+1 -2
src/applications/conpherence/view/ConpherenceFileWidgetView.php
··· 3 3 final class ConpherenceFileWidgetView extends ConpherenceWidgetView { 4 4 5 5 public function render() { 6 - require_celerity_resource('sprite-docs-css'); 7 6 $conpherence = $this->getConpherence(); 8 7 $widget_data = $conpherence->getWidgetData(); 9 8 $files = $widget_data['files']; ··· 15 14 $icon_view = phutil_tag( 16 15 'div', 17 16 array( 18 - 'class' => 'file-icon sprite-docs '.$icon_class, 17 + 'class' => 'file-icon phui-font-fa phui-icon-view '.$icon_class, 19 18 ), 20 19 ''); 21 20 $file_view = id(new PhabricatorFileLinkView())
+26 -21
src/applications/files/config/PhabricatorFilesConfigOptions.php
··· 50 50 // largely lifted from http://en.wikipedia.org/wiki/Internet_media_type 51 51 $icon_default = array( 52 52 // audio file icon 53 - 'audio/basic' => 'docs_audio', 54 - 'audio/L24' => 'docs_audio', 55 - 'audio/mp4' => 'docs_audio', 56 - 'audio/mpeg' => 'docs_audio', 57 - 'audio/ogg' => 'docs_audio', 58 - 'audio/vorbis' => 'docs_audio', 59 - 'audio/vnd.rn-realaudio' => 'docs_audio', 60 - 'audio/vnd.wave' => 'docs_audio', 61 - 'audio/webm' => 'docs_audio', 53 + 'audio/basic' => 'fa-file-audio-o', 54 + 'audio/L24' => 'fa-file-audio-o', 55 + 'audio/mp4' => 'fa-file-audio-o', 56 + 'audio/mpeg' => 'fa-file-audio-o', 57 + 'audio/ogg' => 'fa-file-audio-o', 58 + 'audio/vorbis' => 'fa-file-audio-o', 59 + 'audio/vnd.rn-realaudio' => 'fa-file-audio-o', 60 + 'audio/vnd.wave' => 'fa-file-audio-o', 61 + 'audio/webm' => 'fa-file-audio-o', 62 62 // movie file icon 63 - 'video/mpeg' => 'docs_movie', 64 - 'video/mp4' => 'docs_movie', 65 - 'video/ogg' => 'docs_movie', 66 - 'video/quicktime' => 'docs_movie', 67 - 'video/webm' => 'docs_movie', 68 - 'video/x-matroska' => 'docs_movie', 69 - 'video/x-ms-wmv' => 'docs_movie', 70 - 'video/x-flv' => 'docs_movie', 63 + 'video/mpeg' => 'fa-file-movie-o', 64 + 'video/mp4' => 'fa-file-movie-o', 65 + 'video/ogg' => 'fa-file-movie-o', 66 + 'video/quicktime' => 'fa-file-movie-o', 67 + 'video/webm' => 'fa-file-movie-o', 68 + 'video/x-matroska' => 'fa-file-movie-o', 69 + 'video/x-ms-wmv' => 'fa-file-movie-o', 70 + 'video/x-flv' => 'fa-file-movie-o', 71 71 // pdf file icon 72 - 'application/pdf' => 'docs_pdf', 72 + 'application/pdf' => 'fa-file-pdf-o', 73 73 // zip file icon 74 - 'application/zip' => 'docs_zip', 74 + 'application/zip' => 'fa-file-zip-o', 75 75 // msword icon 76 - 'application/msword' => 'docs_doc', 77 - ) + array_fill_keys(array_keys($image_default), 'docs_image'); 76 + 'application/msword' => 'fa-file-word-o', 77 + // msexcel 78 + 'application/vnd.ms-excel' => 'fa-file-excel-o', 79 + // mspowerpoint 80 + 'application/vnd.ms-powerpoint' => 'fa-file-powerpoint-o', 81 + 82 + ) + array_fill_keys(array_keys($image_default), 'fa-file-image-o'); 78 83 79 84 return array( 80 85 $this->newOption('files.viewable-mime-types', 'wild', $viewable_default)
+1 -1
src/applications/files/storage/PhabricatorFile.php
··· 739 739 public function getDisplayIconForMimeType() { 740 740 $mime_map = PhabricatorEnv::getEnvConfig('files.icon-mime-types'); 741 741 $mime_type = $this->getMimeType(); 742 - return idx($mime_map, $mime_type, 'docs_file'); 742 + return idx($mime_map, $mime_type, 'fa-file-o'); 743 743 } 744 744 745 745 public function validateSecretKey($key) {
+5 -3
webroot/rsrc/css/application/conpherence/widget-pane.css
··· 100 100 width: 32px; 101 101 height: 32px; 102 102 float: left; 103 + font-size: 30px; 103 104 } 104 105 .conpherence-widget-pane #widgets-files .file-title { 105 106 display: block; 106 107 position: relative; 107 108 top: -4px; 108 - left: 10px; 109 + left: 2px; 109 110 overflow-x: hidden; 110 - width: 165px; 111 + width: 180px; 111 112 font-weight: bold; 112 113 text-overflow: ellipsis; 114 + white-space: nowrap; 113 115 } 114 116 .conpherence-widget-pane #widgets-files .file-uploaded-by { 115 117 color: #a1a5a9; 116 118 position: relative; 117 119 top: 0px; 118 - left: 10px; 120 + left: 2px; 119 121 width: 170px; 120 122 font-size: 11px; 121 123 }
-51
webroot/rsrc/css/sprite-docs.css
··· 1 - /** 2 - * @provides sprite-docs-css 3 - * @generated 4 - */ 5 - 6 - .sprite-docs { 7 - background-image: url(/rsrc/image/sprite-docs.png); 8 - background-repeat: no-repeat; 9 - } 10 - 11 - @media 12 - only screen and (min-device-pixel-ratio: 1.5), 13 - only screen and (-webkit-min-device-pixel-ratio: 1.5) { 14 - .sprite-docs { 15 - background-image: url(/rsrc/image/sprite-docs-X2.png); 16 - background-size: 99px 99px; 17 - } 18 - } 19 - 20 - 21 - .docs_audio { 22 - background-position: 0px 0px; 23 - } 24 - 25 - .docs_doc { 26 - background-position: -33px 0px; 27 - } 28 - 29 - .docs_file { 30 - background-position: -66px 0px; 31 - } 32 - 33 - .docs_image { 34 - background-position: 0px -33px; 35 - } 36 - 37 - .docs_movie { 38 - background-position: -33px -33px; 39 - } 40 - 41 - .docs_pdf { 42 - background-position: -66px -33px; 43 - } 44 - 45 - .docs_place { 46 - background-position: 0px -66px; 47 - } 48 - 49 - .docs_zip { 50 - background-position: -33px -66px; 51 - }
webroot/rsrc/image/sprite-docs-X2.png

This is a binary file and will not be displayed.

webroot/rsrc/image/sprite-docs.png

This is a binary file and will not be displayed.