mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-18 21:02:41 +01:00
Add image size to thumbnails in Remarkup
Test Plan: View preview of comment with `{F10662}`. Search for `>getThumb`. Reviewers: epriestley Reviewed By: epriestley CC: aran, Koolvin Differential Revision: https://secure.phabricator.com/D2347
This commit is contained in:
parent
1dcc00646a
commit
4f9e5323ed
1 changed files with 9 additions and 8 deletions
|
@ -68,24 +68,25 @@ final class PhabricatorRemarkupRuleEmbedFile
|
|||
return $this->getEngine()->storeText($link);
|
||||
}
|
||||
|
||||
$attrs = array(
|
||||
'class' => 'phabricator-remarkup-embed-image',
|
||||
);
|
||||
|
||||
switch ($options['size']) {
|
||||
case 'full':
|
||||
$src_uri = $file->getBestURI();
|
||||
$attrs['src'] = $file->getBestURI();
|
||||
$link = null;
|
||||
break;
|
||||
case 'thumb':
|
||||
default:
|
||||
$src_uri = $file->getThumb160x120URI();
|
||||
$attrs['src'] = $file->getThumb160x120URI();
|
||||
$attrs['width'] = 160;
|
||||
$attrs['height'] = 120;
|
||||
$link = $file->getBestURI();
|
||||
break;
|
||||
}
|
||||
|
||||
$embed = phutil_render_tag(
|
||||
'img',
|
||||
array(
|
||||
'src' => $src_uri,
|
||||
'class' => 'phabricator-remarkup-embed-image',
|
||||
));
|
||||
$embed = phutil_render_tag('img', $attrs);
|
||||
|
||||
if ($link) {
|
||||
$embed = phutil_render_tag(
|
||||
|
|
Loading…
Reference in a new issue