From: Alexander Ebert Date: Fri, 29 Mar 2019 10:34:13 +0000 (+0100) Subject: CSS for embedded content, fix for TOC generation X-Git-Tag: 5.2.0_Alpha_1~176^2~7^2~3 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f709b4a7eebc0c52d52398aabb8cc27db4214cdc;p=GitHub%2FWoltLab%2FWCF.git CSS for embedded content, fix for TOC generation --- diff --git a/wcfsetup/install/files/lib/system/html/output/HtmlOutputProcessor.class.php b/wcfsetup/install/files/lib/system/html/output/HtmlOutputProcessor.class.php index 37856c01ec..ea9ec8400b 100644 --- a/wcfsetup/install/files/lib/system/html/output/HtmlOutputProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/output/HtmlOutputProcessor.class.php @@ -16,11 +16,11 @@ use wcf\system\message\embedded\object\MessageEmbeddedObjectManager; */ class HtmlOutputProcessor extends AbstractHtmlProcessor { /** - * generate the table of contents - * @var bool + * Generate the table of contents, implicitly enable this for certain object types on demand. + * @var bool|null * @since 5.2 */ - public $enableToc = false; + public $enableToc; /** * Removes any link contained inside the message text. @@ -96,7 +96,9 @@ class HtmlOutputProcessor extends AbstractHtmlProcessor { MessageEmbeddedObjectManager::getInstance()->setActiveMessage($objectType, $objectID, $this->languageID); $objectType = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.message', $objectType); - $this->enableToc = (!empty($objectType->additionalData['enableToc'])); + if ($this->enableToc === null) { + $this->enableToc = (!empty($objectType->additionalData['enableToc'])); + } } /** diff --git a/wcfsetup/install/files/style/ui/embeddedContent.scss b/wcfsetup/install/files/style/ui/embeddedContent.scss new file mode 100644 index 0000000000..2b8dc8c4b6 --- /dev/null +++ b/wcfsetup/install/files/style/ui/embeddedContent.scss @@ -0,0 +1,73 @@ +.embeddedContent { + background-color: $wcfContentBackground; + border: 1px solid $wcfContentBorderInner; + border-radius: 3px; + margin: 10px 0; +} + +.embeddedContentLink { + display: block; + padding: 10px; +} + +.embeddedContentCategory { + color: $wcfContentDimmedText; + text-transform: uppercase; + + @include wcfFontSmall; +} + +.embeddedContentTitle { + color: $wcfContentHeadlineText; + margin-bottom: 20px; + + @include wcfFontHeadline; + @include wcfFontBold; +} + +.embeddedContentDescription { + color: $wcfContentText; + max-height: 120px; + overflow: hidden; + position: relative; +} +.embeddedContentDescription::after { + background-image: linear-gradient(to top, $wcfContentBackground, transparent); + bottom: 0; + content: ""; + left: 0; + position: absolute; + right: 0; + top: 100px; +} + +.embeddedContentMeta { + align-items: center; + border-top: 1px solid $wcfContentBorderInner; + color: $wcfContentDimmedText; + display: flex; + padding: 10px; + + @include wcfFontSmall; +} + +.embeddedContentMetaImage { + flex: 0 auto; + margin-right: 10px; +} + +.embeddedContentMetaContent { + flex: 1 auto; +} + +.embeddedContentMetaAuthor { + color: $wcfContentText; + + > a { + color: inherit; + + &:hover { + text-decoration: underline; + } + } +}