Enhanced support for new video posts (closed #75)

This commit is contained in:
Marcin Kurczewski 2014-04-09 14:19:15 +02:00
parent 74b2f935c3
commit d3e135ea15
11 changed files with 31 additions and 13 deletions

View file

@ -10,7 +10,12 @@
}
.post-type-youtube:after,
.post-type-flash:after {
.post-type-swf:after,
.post-type-mp4:after,
.post-type-webm:after,
.post-type-ogg:after,
.post-type-3gp:after,
.post-type-flv:after {
position: absolute;
right: 1px; /* border */
top: 1px; /* border */
@ -19,18 +24,22 @@
content: ' ';
pointer-events: none;
}
.post-type-flash {
.post-type-youtube,
.post-type-swf,
.post-type-mp4,
.post-type-webm,
.post-type-ogg,
.post-type-3gp,
.post-type-flv {
border-color: red;
}
.post-type-youtube {
border-color: red;
}
.post-type-flash:after {
background: url('../img/thumb-overlay-swf.png');
}
.post-type-youtube:after {
background: url('../img/thumb-overlay-yt.png');
}
.post-type-swf:after { background: url('../img/thumb-overlay-swf.png'); }
.post-type-youtube:after { background: url('../img/thumb-overlay-yt.png'); }
.post-type-mp4:after { background: url('../img/thumb-overlay-mp4.png'); }
.post-type-webm:after { background: url('../img/thumb-overlay-webm.png'); }
.post-type-ogg:after { background: url('../img/thumb-overlay-ogg.png'); }
.post-type-3gp:after { background: url('../img/thumb-overlay-3gp.png'); }
.post-type-flv:after { background: url('../img/thumb-overlay-flv.png'); }
.post .toggle-tag {

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -346,7 +346,13 @@ class TextHelper
'image/jpeg' => 'jpg',
'image/gif' => 'gif',
'image/png' => 'png',
'application/x-shockwave-flash' => 'swf'];
'application/x-shockwave-flash' => 'swf',
'video/mp4' => 'mp4',
'video/webm' => 'webm',
'video/ogg' => 'ogg',
'application/ogg' => 'ogg',
'video/x-flv' => 'flv',
'video/3gpp' => '3gp'];
return isset($mimeTypes[$mimeType])
? $mimeTypes[$mimeType]
: null;

View file

@ -192,6 +192,8 @@ class PostSearchParser extends AbstractSearchParser
$type = PostType::Flash;
elseif ($value == 'img')
$type = PostType::Image;
elseif ($value == 'video' or in_array($value, ['mp4', 'webm', 'ogg', '3gp', 'ogg']))
$type = PostType::Video;
elseif ($value == 'yt' or $value == 'youtube')
$type = PostType::Youtube;
else

View file

@ -4,7 +4,8 @@ CustomAssetViewDecorator::addStylesheet('post-small.css');
$classNames =
[
'post',
'post-type-' . TextHelper::camelCaseToHumanCase(PostType::toString($this->context->post->type))
'post-type-' .(TextHelper::resolveMimeType($this->context->post->mimeType) ?:
TextHelper::camelCaseToHumanCase(PostType::toString($this->context->post->type))),
];
$masstag = (isset($this->context->source)