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:
		| @@ -10,7 +10,7 @@ return array( | |||||||
|     'conpherence.pkg.css' => '0b64e988', |     'conpherence.pkg.css' => '0b64e988', | ||||||
|     'conpherence.pkg.js' => '6249a1cf', |     'conpherence.pkg.js' => '6249a1cf', | ||||||
|     'core.pkg.css' => '4107e0f7', |     'core.pkg.css' => '4107e0f7', | ||||||
|     'core.pkg.js' => '11c6a1ec', |     'core.pkg.js' => '1602cd3d', | ||||||
|     'darkconsole.pkg.js' => 'e7393ebb', |     'darkconsole.pkg.js' => 'e7393ebb', | ||||||
|     'differential.pkg.css' => 'a4ba74b5', |     'differential.pkg.css' => 'a4ba74b5', | ||||||
|     'differential.pkg.js' => '634399e9', |     'differential.pkg.js' => '634399e9', | ||||||
| @@ -505,7 +505,7 @@ return array( | |||||||
|     'rsrc/js/core/behavior-hovercard.js' => 'bcaccd64', |     'rsrc/js/core/behavior-hovercard.js' => 'bcaccd64', | ||||||
|     'rsrc/js/core/behavior-keyboard-pager.js' => 'a8da01f0', |     'rsrc/js/core/behavior-keyboard-pager.js' => 'a8da01f0', | ||||||
|     'rsrc/js/core/behavior-keyboard-shortcuts.js' => '01fca1f0', |     '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-line-linker.js' => '1499a8cb', | ||||||
|     'rsrc/js/core/behavior-more.js' => 'a80d0378', |     'rsrc/js/core/behavior-more.js' => 'a80d0378', | ||||||
|     'rsrc/js/core/behavior-object-selector.js' => 'e0ec7f2f', |     'rsrc/js/core/behavior-object-selector.js' => 'e0ec7f2f', | ||||||
| @@ -651,7 +651,7 @@ return array( | |||||||
|     'javelin-behavior-history-install' => '7ee2b591', |     'javelin-behavior-history-install' => '7ee2b591', | ||||||
|     'javelin-behavior-icon-composer' => '8499b6ab', |     'javelin-behavior-icon-composer' => '8499b6ab', | ||||||
|     'javelin-behavior-launch-icon-composer' => '48086888', |     'javelin-behavior-launch-icon-composer' => '48086888', | ||||||
|     'javelin-behavior-lightbox-attachments' => '0b4ac79f', |     'javelin-behavior-lightbox-attachments' => 'e62f3c48', | ||||||
|     'javelin-behavior-line-chart' => 'e4232876', |     'javelin-behavior-line-chart' => 'e4232876', | ||||||
|     'javelin-behavior-load-blame' => '42126667', |     'javelin-behavior-load-blame' => '42126667', | ||||||
|     'javelin-behavior-maniphest-batch-editor' => '782ab6e7', |     'javelin-behavior-maniphest-batch-editor' => '782ab6e7', | ||||||
| @@ -991,15 +991,6 @@ return array( | |||||||
|       'javelin-dom', |       'javelin-dom', | ||||||
|       'javelin-router', |       'javelin-router', | ||||||
|     ), |     ), | ||||||
|     '0b4ac79f' => array( |  | ||||||
|       'javelin-behavior', |  | ||||||
|       'javelin-stratcom', |  | ||||||
|       'javelin-dom', |  | ||||||
|       'javelin-mask', |  | ||||||
|       'javelin-util', |  | ||||||
|       'phuix-icon-view', |  | ||||||
|       'phabricator-busy', |  | ||||||
|     ), |  | ||||||
|     '0f764c35' => array( |     '0f764c35' => array( | ||||||
|       'javelin-install', |       'javelin-install', | ||||||
|       'javelin-util', |       'javelin-util', | ||||||
| @@ -2129,6 +2120,15 @@ return array( | |||||||
|       'javelin-workflow', |       'javelin-workflow', | ||||||
|       'javelin-magical-init', |       'javelin-magical-init', | ||||||
|     ), |     ), | ||||||
|  |     'e62f3c48' => array( | ||||||
|  |       'javelin-behavior', | ||||||
|  |       'javelin-stratcom', | ||||||
|  |       'javelin-dom', | ||||||
|  |       'javelin-mask', | ||||||
|  |       'javelin-util', | ||||||
|  |       'phuix-icon-view', | ||||||
|  |       'phabricator-busy', | ||||||
|  |     ), | ||||||
|     'e9581f08' => array( |     'e9581f08' => array( | ||||||
|       'javelin-behavior', |       'javelin-behavior', | ||||||
|       'javelin-stratcom', |       'javelin-stratcom', | ||||||
|   | |||||||
| @@ -83,6 +83,10 @@ final class PhabricatorFileLinkView extends AphrontView { | |||||||
|     return $this->fileSize; |     return $this->fileSize; | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   private function getFileIcon() { | ||||||
|  |     return FileTypeIcon::getFileIcon($this->getFileName()); | ||||||
|  |   } | ||||||
|  |  | ||||||
|   public function getMetadata() { |   public function getMetadata() { | ||||||
|     return array( |     return array( | ||||||
|       'phid'     => $this->getFilePHID(), |       'phid'     => $this->getFilePHID(), | ||||||
| @@ -91,6 +95,8 @@ final class PhabricatorFileLinkView extends AphrontView { | |||||||
|       'dUri'     => $this->getFileDownloadURI(), |       'dUri'     => $this->getFileDownloadURI(), | ||||||
|       'name'     => $this->getFileName(), |       'name'     => $this->getFileName(), | ||||||
|       'monogram' => $this->getFileMonogram(), |       'monogram' => $this->getFileMonogram(), | ||||||
|  |       'icon'     => $this->getFileIcon(), | ||||||
|  |       'size'     => $this->getFileSize(), | ||||||
|     ); |     ); | ||||||
|   } |   } | ||||||
|  |  | ||||||
| @@ -107,11 +113,8 @@ final class PhabricatorFileLinkView extends AphrontView { | |||||||
|       $class = $this->getCustomClass(); |       $class = $this->getCustomClass(); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     $filename = $this->getFileName(); |  | ||||||
|     $type_icon = FileTypeIcon::getFileIcon($filename); |  | ||||||
|  |  | ||||||
|     $icon = id(new PHUIIconView()) |     $icon = id(new PHUIIconView()) | ||||||
|       ->setIcon($type_icon); |       ->setIcon($this->getFileIcon()); | ||||||
|  |  | ||||||
|     $info = phutil_tag( |     $info = phutil_tag( | ||||||
|       'span', |       'span', | ||||||
| @@ -125,7 +128,7 @@ final class PhabricatorFileLinkView extends AphrontView { | |||||||
|       array( |       array( | ||||||
|         'class' => 'phabricator-remarkup-embed-layout-name', |         'class' => 'phabricator-remarkup-embed-layout-name', | ||||||
|       ), |       ), | ||||||
|       $filename); |       $this->getFileName()); | ||||||
|  |  | ||||||
|     $inner = phutil_tag( |     $inner = phutil_tag( | ||||||
|       'span', |       'span', | ||||||
|   | |||||||
| @@ -99,7 +99,7 @@ JX.behavior('lightbox-attachments', function (config) { | |||||||
|         ); |         ); | ||||||
|     } else { |     } else { | ||||||
|       var imgIcon = new JX.PHUIXIconView() |       var imgIcon = new JX.PHUIXIconView() | ||||||
|         .setIcon('fa-file-text-o phui-lightbox-file-icon') |         .setIcon(target_data.icon + ' phui-lightbox-file-icon') | ||||||
|         .getNode(); |         .getNode(); | ||||||
|       var nameElement = |       var nameElement = | ||||||
|         JX.$N('div', |         JX.$N('div', | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Chad Little
					Chad Little