}
function title() {
- return $this->attachment->title ?: $this->attachment->filename;
+ return $this->attachment->getTitle();
}
function linkTitle() {
case 'image/jpg':
case 'image/jpeg':
try {
- $thumb = $this->attachment->getThumbnail();
- $this->out->element('img', array('src' => $thumb->getUrl(), 'alt' => ''));
+ // Tell getThumbnail that we can show an animated image if it has one (4th arg, "force_still")
+ $thumb = $this->attachment->getThumbnail(null, null, false, false);
+ $this->out->element('img', array('class'=>'u-photo', 'src' => $thumb->getUrl(), 'alt' => ''));
+ } catch (UseFileAsThumbnailException $e) {
+ $this->out->element('img', array('class'=>'u-photo', 'src' => $e->file->getUrl(), 'alt' => $e->file->title));
} catch (UnsupportedMediaException $e) {
// FIXME: Show a good representation of unsupported/unshowable images
}
$poster = null;
}
$this->out->elementStart($mediatype,
- array('class'=>'attachment_player',
+ array('class'=>"attachment_player u-{$mediatype}",
'poster'=>$poster,
'controls'=>'controls'));
$this->out->element('source',
$scripts[] = $script;
}
foreach ($scripts as $script) {
- common_log(LOG_DEBUG, $script->textContent);
+ common_debug($script->textContent);
$script->parentNode->removeChild($script);
}