Document icons sprite sheet.

Summary: Adds 32 and 64 px images to represent basic documents.

Test Plan: Differential

Reviewers: epriestley, btrahan

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D5317
This commit is contained in:
Chad Little
2013-03-10 14:16:16 -07:00
parent ca20323b87
commit fbb032c710
23 changed files with 158 additions and 2 deletions

View File

@@ -497,6 +497,20 @@ celerity_register_resource_map(array(
'disk' => '/rsrc/image/sprite-conpher.png',
'type' => 'png',
),
'/rsrc/image/sprite-docs-X2.png' =>
array(
'hash' => '57d3286ce88133f3ec9240e35f6bb897',
'uri' => '/res/57d3286c/rsrc/image/sprite-docs-X2.png',
'disk' => '/rsrc/image/sprite-docs-X2.png',
'type' => 'png',
),
'/rsrc/image/sprite-docs.png' =>
array(
'hash' => 'b2b089072d6eddd831402a77c02b5736',
'uri' => '/res/b2b08907/rsrc/image/sprite-docs.png',
'disk' => '/rsrc/image/sprite-docs.png',
'type' => 'png',
),
'/rsrc/image/sprite-gradient.png' =>
array(
'hash' => '92aebaab67dcc6baf2ea99294368d895',
@@ -3455,6 +3469,15 @@ celerity_register_resource_map(array(
),
'disk' => '/rsrc/css/sprite-conpher.css',
),
'sprite-docs-css' =>
array(
'uri' => '/res/b32f93bc/rsrc/css/sprite-docs.css',
'type' => 'css',
'requires' =>
array(
),
'disk' => '/rsrc/css/sprite-docs.css',
),
'sprite-gradient-css' =>
array(
'uri' => '/res/e62e7a0f/rsrc/css/sprite-gradient.css',

View File

@@ -256,6 +256,38 @@ 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 buildGradientSheet() {
$gradients = $this->getDirectoryList('gradients');