From: Alexander Ebert Date: Wed, 10 May 2023 13:34:39 +0000 (+0200) Subject: Add support for floating images X-Git-Tag: 6.0.0_Alpha_1~117 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c2dd2a43d84cc8589a564b983ae5a5897880ebd3;p=GitHub%2FWoltLab%2FWCF.git Add support for floating images See WoltLab/editor#51 --- diff --git a/wcfsetup/install/files/lib/system/html/input/filter/MessageHtmlInputFilter.class.php b/wcfsetup/install/files/lib/system/html/input/filter/MessageHtmlInputFilter.class.php index 4c69a26999..0cd44304f0 100644 --- a/wcfsetup/install/files/lib/system/html/input/filter/MessageHtmlInputFilter.class.php +++ b/wcfsetup/install/files/lib/system/html/input/filter/MessageHtmlInputFilter.class.php @@ -126,6 +126,11 @@ class MessageHtmlInputFilter implements IHtmlInputFilter $definition->addAttribute('img', 'data-attachment-id', 'Number'); $definition->addAttribute('img', 'srcset', 'Text'); + //
element for images + $definition->addElement('figure', 'Block', 'Flow', '', [ + 'class' => 'Text', + ]); + $parameters = [ 'config' => $config, 'definition' => $definition, diff --git a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php index 0e9c6a9d02..7e730ab150 100644 --- a/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php +++ b/wcfsetup/install/files/lib/system/html/input/node/HtmlInputNodeProcessor.class.php @@ -27,6 +27,7 @@ class HtmlInputNodeProcessor extends AbstractHtmlNodeProcessor * @var array */ public static $allowedClassNames = [ + 'figure' => ['image', 'image-style-side'], 'h2' => ['text-center', 'text-justify', 'text-right'], 'h3' => ['text-center', 'text-justify', 'text-right'], 'h4' => ['text-center', 'text-justify', 'text-right'], diff --git a/wcfsetup/install/files/style/layout/global.scss b/wcfsetup/install/files/style/layout/global.scss index 088e9f0438..81462e6d83 100644 --- a/wcfsetup/install/files/style/layout/global.scss +++ b/wcfsetup/install/files/style/layout/global.scss @@ -176,6 +176,19 @@ ol.nativeList { margin-bottom: 0 !important; } } + + figure.image { + clear: both; + display: table; + margin: 1em auto; + min-width: 50px; + text-align: center; + + &.image-style-side { + float: right; + margin: 0 0 20px 20px; + } + } } .containerContent,