Replace Sprite-Icons with FontAwesome
Summary: The removes the sprite sheet 'icons' and replaces it with FontAwesome fonts. Test Plan: - Grep for SPRITE_ICONS and replace - Grep for sprite-icons and replace - Grep for PhabricatorActionList and choose all new icons - Grep for Crumbs and fix icons - Test/Replace PHUIList Icon support - Test/Replace ObjectList Icon support (foot, epoch, etc) - Browse as many pages as I could get to - Remove sprite-icons and move remarkup to own sheet - Review this diff in Differential Reviewers: btrahan, epriestley Reviewed By: epriestley Subscribers: epriestley, Korvin, hach-que Differential Revision: https://secure.phabricator.com/D9052
This commit is contained in:
@@ -4,7 +4,6 @@ final class PhabricatorActionView extends AphrontView {
|
||||
|
||||
private $name;
|
||||
private $icon;
|
||||
private $iconSheet;
|
||||
private $href;
|
||||
private $disabled;
|
||||
private $workflow;
|
||||
@@ -71,11 +70,6 @@ final class PhabricatorActionView extends AphrontView {
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setIconSheet($sheet) {
|
||||
$this->iconSheet = $sheet;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setName($name) {
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
@@ -100,17 +94,13 @@ final class PhabricatorActionView extends AphrontView {
|
||||
|
||||
$icon = null;
|
||||
if ($this->icon) {
|
||||
$sheet = nonempty($this->iconSheet, PHUIIconView::SPRITE_ICONS);
|
||||
|
||||
$suffix = '';
|
||||
$color = '';
|
||||
if ($this->disabled) {
|
||||
$suffix = '-grey';
|
||||
$color = ' grey';
|
||||
}
|
||||
|
||||
$icon = id(new PHUIIconView())
|
||||
->addClass('phabricator-action-view-icon')
|
||||
->setSpriteIcon($this->icon.$suffix)
|
||||
->setSpriteSheet($sheet);
|
||||
->setIconFont($this->icon.$color);
|
||||
}
|
||||
|
||||
if ($this->href) {
|
||||
@@ -185,22 +175,4 @@ final class PhabricatorActionView extends AphrontView {
|
||||
array($icon, $item));
|
||||
}
|
||||
|
||||
public static function getAvailableIcons() {
|
||||
$manifest = PHUIIconView::getSheetManifest(PHUIIconView::SPRITE_ICONS);
|
||||
|
||||
$results = array();
|
||||
$prefix = 'icons-';
|
||||
foreach ($manifest as $sprite) {
|
||||
$name = $sprite['name'];
|
||||
if (preg_match('/-(white|grey)$/', $name)) {
|
||||
continue;
|
||||
}
|
||||
if (!strncmp($name, $prefix, strlen($prefix))) {
|
||||
$results[] = substr($name, strlen($prefix));
|
||||
}
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user