1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 12:00:55 +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:
vrana 2012-04-30 13:28:20 -07:00
parent 1dcc00646a
commit 4f9e5323ed

View file

@ -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(