1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-17 18:21:11 +01:00

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
This commit is contained in:
Chad Little 2014-12-20 20:59:24 -08:00
parent 194d33e4bd
commit b925f42c55
27 changed files with 33 additions and 166 deletions

View file

@ -148,7 +148,6 @@ return array(
'rsrc/css/phui/phui-workpanel-view.css' => '198c7e6c',
'rsrc/css/sprite-apps-large.css' => '20ec0cc0',
'rsrc/css/sprite-apps.css' => 'd5baed0f',
'rsrc/css/sprite-docs.css' => '5f65d0da',
'rsrc/css/sprite-gradient.css' => '4bdb98a7',
'rsrc/css/sprite-login.css' => 'a355d921',
'rsrc/css/sprite-main-header.css' => '92720ee2',
@ -320,8 +319,6 @@ return array(
'rsrc/image/sprite-apps-large-X2.png' => '79e15268',
'rsrc/image/sprite-apps-large.png' => '4d41b94a',
'rsrc/image/sprite-apps.png' => '5570df20',
'rsrc/image/sprite-docs-X2.png' => '6dc1adad',
'rsrc/image/sprite-docs.png' => '4636297f',
'rsrc/image/sprite-gradient.png' => 'ec15a417',
'rsrc/image/sprite-login-X2.png' => '5ae6de3a',
'rsrc/image/sprite-login.png' => '07f2c67c',
@ -811,7 +808,6 @@ return array(
'setup-issue-css' => '8f852bc0',
'sprite-apps-css' => 'd5baed0f',
'sprite-apps-large-css' => '20ec0cc0',
'sprite-docs-css' => '5f65d0da',
'sprite-gradient-css' => '4bdb98a7',
'sprite-login-css' => 'a355d921',
'sprite-main-header-css' => '92720ee2',

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -1,51 +0,0 @@
{
"version" : 1,
"sprites" : {
"docs_audio" : {
"name" : "docs_audio",
"rule" : ".docs_audio",
"hash" : "673217354b0a2406be92be7d1d710422"
},
"docs_doc" : {
"name" : "docs_doc",
"rule" : ".docs_doc",
"hash" : "5cc83abc67ba4b26bb898b35d75ebef7"
},
"docs_file" : {
"name" : "docs_file",
"rule" : ".docs_file",
"hash" : "319218d4f65c766faac607a26ffa751e"
},
"docs_image" : {
"name" : "docs_image",
"rule" : ".docs_image",
"hash" : "ee313b6b35435ef4c534614ea2a6182e"
},
"docs_movie" : {
"name" : "docs_movie",
"rule" : ".docs_movie",
"hash" : "aa9f12307047adb1bda4f74d4376a57a"
},
"docs_pdf" : {
"name" : "docs_pdf",
"rule" : ".docs_pdf",
"hash" : "a6e4a2cb8b8d0e6777e6010ab4d530b5"
},
"docs_place" : {
"name" : "docs_place",
"rule" : ".docs_place",
"hash" : "7328b8d6c6d8440975f7f098a347a17e"
},
"docs_zip" : {
"name" : "docs_zip",
"rule" : ".docs_zip",
"hash" : "d6b11a4d6217356fe7c488c729e6fc99"
}
},
"scales" : [
1,
2
],
"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",
"type" : "standard"
}

View file

@ -31,7 +31,6 @@ $sheets = array(
'apps' => $generator->buildAppsSheet(),
'apps-large' => $generator->buildAppsLargeSheet(),
'tokens' => $generator->buildTokenSheet(),
'docs' => $generator->buildDocsSheet(),
'gradient' => $generator->buildGradientSheet(),
'main-header' => $generator->buildMainHeaderSheet(),
'login' => $generator->buildLoginSheet(),

View file

@ -117,38 +117,6 @@ final class CeleritySpriteGenerator {
return $sheet;
}
public function buildDocsSheet() {
$icons = $this->getDirectoryList('docs_1x');
$scales = array(
'1x' => 1,
'2x' => 2,
);
$template = id(new PhutilSprite())
->setSourceSize(32, 32);
$sprites = array();
$prefix = 'docs_';
foreach ($icons as $icon) {
$sprite = id(clone $template)
->setName($prefix.$icon)
->setTargetCSS('.'.$prefix.$icon);
foreach ($scales as $scale_key => $scale) {
$path = $this->getPath($prefix.$scale_key.'/'.$icon.'.png');
$sprite->setSourceFile($path, $scale);
}
$sprites[] = $sprite;
}
$sheet = $this->buildSheet('docs', true);
$sheet->setScales($scales);
foreach ($sprites as $sprite) {
$sheet->addSprite($sprite);
}
return $sheet;
}
public function buildLoginSheet() {
$icons = $this->getDirectoryList('login_1x');
$scales = array(

View file

@ -3,7 +3,6 @@
final class ConpherenceFileWidgetView extends ConpherenceWidgetView {
public function render() {
require_celerity_resource('sprite-docs-css');
$conpherence = $this->getConpherence();
$widget_data = $conpherence->getWidgetData();
$files = $widget_data['files'];
@ -15,7 +14,7 @@ final class ConpherenceFileWidgetView extends ConpherenceWidgetView {
$icon_view = phutil_tag(
'div',
array(
'class' => 'file-icon sprite-docs '.$icon_class,
'class' => 'file-icon phui-font-fa phui-icon-view '.$icon_class,
),
'');
$file_view = id(new PhabricatorFileLinkView())

View file

@ -50,31 +50,36 @@ final class PhabricatorFilesConfigOptions
// largely lifted from http://en.wikipedia.org/wiki/Internet_media_type
$icon_default = array(
// audio file icon
'audio/basic' => 'docs_audio',
'audio/L24' => 'docs_audio',
'audio/mp4' => 'docs_audio',
'audio/mpeg' => 'docs_audio',
'audio/ogg' => 'docs_audio',
'audio/vorbis' => 'docs_audio',
'audio/vnd.rn-realaudio' => 'docs_audio',
'audio/vnd.wave' => 'docs_audio',
'audio/webm' => 'docs_audio',
'audio/basic' => 'fa-file-audio-o',
'audio/L24' => 'fa-file-audio-o',
'audio/mp4' => 'fa-file-audio-o',
'audio/mpeg' => 'fa-file-audio-o',
'audio/ogg' => 'fa-file-audio-o',
'audio/vorbis' => 'fa-file-audio-o',
'audio/vnd.rn-realaudio' => 'fa-file-audio-o',
'audio/vnd.wave' => 'fa-file-audio-o',
'audio/webm' => 'fa-file-audio-o',
// movie file icon
'video/mpeg' => 'docs_movie',
'video/mp4' => 'docs_movie',
'video/ogg' => 'docs_movie',
'video/quicktime' => 'docs_movie',
'video/webm' => 'docs_movie',
'video/x-matroska' => 'docs_movie',
'video/x-ms-wmv' => 'docs_movie',
'video/x-flv' => 'docs_movie',
'video/mpeg' => 'fa-file-movie-o',
'video/mp4' => 'fa-file-movie-o',
'video/ogg' => 'fa-file-movie-o',
'video/quicktime' => 'fa-file-movie-o',
'video/webm' => 'fa-file-movie-o',
'video/x-matroska' => 'fa-file-movie-o',
'video/x-ms-wmv' => 'fa-file-movie-o',
'video/x-flv' => 'fa-file-movie-o',
// pdf file icon
'application/pdf' => 'docs_pdf',
'application/pdf' => 'fa-file-pdf-o',
// zip file icon
'application/zip' => 'docs_zip',
'application/zip' => 'fa-file-zip-o',
// msword icon
'application/msword' => 'docs_doc',
) + array_fill_keys(array_keys($image_default), 'docs_image');
'application/msword' => 'fa-file-word-o',
// msexcel
'application/vnd.ms-excel' => 'fa-file-excel-o',
// mspowerpoint
'application/vnd.ms-powerpoint' => 'fa-file-powerpoint-o',
) + array_fill_keys(array_keys($image_default), 'fa-file-image-o');
return array(
$this->newOption('files.viewable-mime-types', 'wild', $viewable_default)

View file

@ -739,7 +739,7 @@ final class PhabricatorFile extends PhabricatorFileDAO
public function getDisplayIconForMimeType() {
$mime_map = PhabricatorEnv::getEnvConfig('files.icon-mime-types');
$mime_type = $this->getMimeType();
return idx($mime_map, $mime_type, 'docs_file');
return idx($mime_map, $mime_type, 'fa-file-o');
}
public function validateSecretKey($key) {

View file

@ -100,22 +100,24 @@
width: 32px;
height: 32px;
float: left;
font-size: 30px;
}
.conpherence-widget-pane #widgets-files .file-title {
display: block;
position: relative;
top: -4px;
left: 10px;
left: 2px;
overflow-x: hidden;
width: 165px;
width: 180px;
font-weight: bold;
text-overflow: ellipsis;
white-space: nowrap;
}
.conpherence-widget-pane #widgets-files .file-uploaded-by {
color: #a1a5a9;
position: relative;
top: 0px;
left: 10px;
left: 2px;
width: 170px;
font-size: 11px;
}

View file

@ -1,51 +0,0 @@
/**
* @provides sprite-docs-css
* @generated
*/
.sprite-docs {
background-image: url(/rsrc/image/sprite-docs.png);
background-repeat: no-repeat;
}
@media
only screen and (min-device-pixel-ratio: 1.5),
only screen and (-webkit-min-device-pixel-ratio: 1.5) {
.sprite-docs {
background-image: url(/rsrc/image/sprite-docs-X2.png);
background-size: 99px 99px;
}
}
.docs_audio {
background-position: 0px 0px;
}
.docs_doc {
background-position: -33px 0px;
}
.docs_file {
background-position: -66px 0px;
}
.docs_image {
background-position: 0px -33px;
}
.docs_movie {
background-position: -33px -33px;
}
.docs_pdf {
background-position: -66px -33px;
}
.docs_place {
background-position: 0px -66px;
}
.docs_zip {
background-position: -33px -66px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3 KiB