CSS for embedded content, fix for TOC generation
authorAlexander Ebert <ebert@woltlab.com>
Fri, 29 Mar 2019 10:34:13 +0000 (11:34 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 29 Mar 2019 10:34:13 +0000 (11:34 +0100)
wcfsetup/install/files/lib/system/html/output/HtmlOutputProcessor.class.php
wcfsetup/install/files/style/ui/embeddedContent.scss [new file with mode: 0644]

index 37856c01ec730902273368a9615f773b3597e742..ea9ec8400b9187a2a855208df30739306e0baf64 100644 (file)
@@ -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 (file)
index 0000000..2b8dc8c
--- /dev/null
@@ -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;
+               }
+       }
+}