1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 03:50:54 +01:00

Use proper file icons in lightbox

Summary: Ref T3612. Passes in file size and file icon for non-images.

Test Plan: Review a PDF and PSD in a lightbox.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Maniphest Tasks: T3612

Differential Revision: https://secure.phabricator.com/D16957
This commit is contained in:
Chad Little 2016-11-28 11:08:38 -08:00
parent 5cc4f6407c
commit 80570d668b
3 changed files with 21 additions and 18 deletions

View file

@ -10,7 +10,7 @@ return array(
'conpherence.pkg.css' => '0b64e988',
'conpherence.pkg.js' => '6249a1cf',
'core.pkg.css' => '4107e0f7',
'core.pkg.js' => '11c6a1ec',
'core.pkg.js' => '1602cd3d',
'darkconsole.pkg.js' => 'e7393ebb',
'differential.pkg.css' => 'a4ba74b5',
'differential.pkg.js' => '634399e9',
@ -505,7 +505,7 @@ return array(
'rsrc/js/core/behavior-hovercard.js' => 'bcaccd64',
'rsrc/js/core/behavior-keyboard-pager.js' => 'a8da01f0',
'rsrc/js/core/behavior-keyboard-shortcuts.js' => '01fca1f0',
'rsrc/js/core/behavior-lightbox-attachments.js' => '0b4ac79f',
'rsrc/js/core/behavior-lightbox-attachments.js' => 'e62f3c48',
'rsrc/js/core/behavior-line-linker.js' => '1499a8cb',
'rsrc/js/core/behavior-more.js' => 'a80d0378',
'rsrc/js/core/behavior-object-selector.js' => 'e0ec7f2f',
@ -651,7 +651,7 @@ return array(
'javelin-behavior-history-install' => '7ee2b591',
'javelin-behavior-icon-composer' => '8499b6ab',
'javelin-behavior-launch-icon-composer' => '48086888',
'javelin-behavior-lightbox-attachments' => '0b4ac79f',
'javelin-behavior-lightbox-attachments' => 'e62f3c48',
'javelin-behavior-line-chart' => 'e4232876',
'javelin-behavior-load-blame' => '42126667',
'javelin-behavior-maniphest-batch-editor' => '782ab6e7',
@ -991,15 +991,6 @@ return array(
'javelin-dom',
'javelin-router',
),
'0b4ac79f' => array(
'javelin-behavior',
'javelin-stratcom',
'javelin-dom',
'javelin-mask',
'javelin-util',
'phuix-icon-view',
'phabricator-busy',
),
'0f764c35' => array(
'javelin-install',
'javelin-util',
@ -2129,6 +2120,15 @@ return array(
'javelin-workflow',
'javelin-magical-init',
),
'e62f3c48' => array(
'javelin-behavior',
'javelin-stratcom',
'javelin-dom',
'javelin-mask',
'javelin-util',
'phuix-icon-view',
'phabricator-busy',
),
'e9581f08' => array(
'javelin-behavior',
'javelin-stratcom',

View file

@ -83,6 +83,10 @@ final class PhabricatorFileLinkView extends AphrontView {
return $this->fileSize;
}
private function getFileIcon() {
return FileTypeIcon::getFileIcon($this->getFileName());
}
public function getMetadata() {
return array(
'phid' => $this->getFilePHID(),
@ -91,6 +95,8 @@ final class PhabricatorFileLinkView extends AphrontView {
'dUri' => $this->getFileDownloadURI(),
'name' => $this->getFileName(),
'monogram' => $this->getFileMonogram(),
'icon' => $this->getFileIcon(),
'size' => $this->getFileSize(),
);
}
@ -107,11 +113,8 @@ final class PhabricatorFileLinkView extends AphrontView {
$class = $this->getCustomClass();
}
$filename = $this->getFileName();
$type_icon = FileTypeIcon::getFileIcon($filename);
$icon = id(new PHUIIconView())
->setIcon($type_icon);
->setIcon($this->getFileIcon());
$info = phutil_tag(
'span',
@ -125,7 +128,7 @@ final class PhabricatorFileLinkView extends AphrontView {
array(
'class' => 'phabricator-remarkup-embed-layout-name',
),
$filename);
$this->getFileName());
$inner = phutil_tag(
'span',

View file

@ -99,7 +99,7 @@ JX.behavior('lightbox-attachments', function (config) {
);
} else {
var imgIcon = new JX.PHUIXIconView()
.setIcon('fa-file-text-o phui-lightbox-file-icon')
.setIcon(target_data.icon + ' phui-lightbox-file-icon')
.getNode();
var nameElement =
JX.$N('div',