From: Marcel Werk Date: Sun, 27 Nov 2016 13:05:18 +0000 (+0100) Subject: Overhauled media-bbcode X-Git-Tag: 3.0.0_RC_1~121 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ae911c33e0e69c56792e87cf13111552468acc53;p=GitHub%2FWoltLab%2FWCF.git Overhauled media-bbcode --- diff --git a/com.woltlab.wcf/templates/mediaBBCodeTag.tpl b/com.woltlab.wcf/templates/mediaBBCodeTag.tpl index 448dcfedd1..b4f206b367 100644 --- a/com.woltlab.wcf/templates/mediaBBCodeTag.tpl +++ b/com.woltlab.wcf/templates/mediaBBCodeTag.tpl @@ -1 +1,11 @@ -{$media->getTitle()} \ No newline at end of file +
+ {if $thumbnailSize != 'original'} + {$media->altText} + {else} + {$media->altText} + {/if} + + {if $media->caption} +
{$media->caption}
+ {/if} +
diff --git a/wcfsetup/install/files/lib/system/cache/runtime/ViewableMediaRuntimeCache.class.php b/wcfsetup/install/files/lib/system/cache/runtime/ViewableMediaRuntimeCache.class.php new file mode 100644 index 0000000000..2803d3db91 --- /dev/null +++ b/wcfsetup/install/files/lib/system/cache/runtime/ViewableMediaRuntimeCache.class.php @@ -0,0 +1,24 @@ + + * @package WoltLabSuite\Core\System\Cache\Runtime + * @since 3.0 + * + * @method ViewableMedia[] getCachedObjects() + * @method ViewableMedia getObject($objectID) + * @method ViewableMedia[] getObjects(array $objectIDs) + */ +class ViewableMediaRuntimeCache extends AbstractRuntimeCache { + /** + * @inheritDoc + */ + protected $listClassName = ViewableMediaList::class; +} diff --git a/wcfsetup/install/files/lib/system/message/embedded/object/MediaMessageEmbeddedObjectHandler.class.php b/wcfsetup/install/files/lib/system/message/embedded/object/MediaMessageEmbeddedObjectHandler.class.php index fd11d4ad9a..aad97f6699 100644 --- a/wcfsetup/install/files/lib/system/message/embedded/object/MediaMessageEmbeddedObjectHandler.class.php +++ b/wcfsetup/install/files/lib/system/message/embedded/object/MediaMessageEmbeddedObjectHandler.class.php @@ -2,7 +2,7 @@ namespace wcf\system\message\embedded\object; use wcf\data\media\Media; use wcf\data\media\MediaList; -use wcf\system\cache\runtime\MediaRuntimeCache; +use wcf\system\cache\runtime\ViewableMediaRuntimeCache; use wcf\system\html\input\HtmlInputProcessor; use wcf\util\ArrayUtil; @@ -39,7 +39,7 @@ class MediaMessageEmbeddedObjectHandler extends AbstractSimpleMessageEmbeddedObj * @inheritDoc */ public function loadObjects(array $objectIDs) { - return MediaRuntimeCache::getInstance()->getObjects($objectIDs); + return ViewableMediaRuntimeCache::getInstance()->getObjects($objectIDs); } /** diff --git a/wcfsetup/install/files/style/bbcode/media.scss b/wcfsetup/install/files/style/bbcode/media.scss new file mode 100644 index 0000000000..b8613ae1d6 --- /dev/null +++ b/wcfsetup/install/files/style/bbcode/media.scss @@ -0,0 +1,11 @@ +.mediaBBCode { + display: inline-block; + + figcaption { + color: $wcfContentDimmedText; + margin-top: 5px; + text-align: center; + + @include wcfFontSmall; + } +}