major
nice-to-have
defect
major
major
#23013
WYSIWYG editor: text color, font, hyperlinks, references to TL subject objects, source code
The following features are possible enhancements to the WYSIWYG editor:
- Support for WYSIWYG attributes in tables/grids (This would involve designing a field similar to the text pop-up fields for multi-line string attributes, but for WYSIWYG attributes)
- Text formatting:
- Text color
- Text highlighting (background color)
- Font and font size
- Insert:
- Hyperlinks (either inserted manually or detected automatically, similar to the BulletinBoardRenderer)
- Emojis
- Images
- References to TL objects
- Format text as source code
These additional features should be enabled or disabled in the application configuration. At a minimum, the ability to enter hyperlinks can lead to security issues. Here, it is essential to ensure that no JavaScript can be executed on the page via the link (javascript:... must be prohibited).
Application
The CKEditor configuration can be customized via the com.top_logic.layout.wysiwyg.ui.StructuredTextConfigService by selecting from a list of available features:
#!xml
<config service-class="com.top_logic.layout.wysiwyg.ui.StructuredTextConfigService">
<instance>
<html-config>
<feature-ref name="basicstyles" />
<feature-ref name="colors" />
<feature-ref name="insert" />
</html-config>
</instance>
</config>
This feature list can also be customized per HTML attribute using the ` wysiwyg ` annotation.
#!xml
<property name="description" type="tl.model.wysiwyg:Html">
<annotations>
<wysiwyg features="basicstyles, insert"/>
</annotations>
</property>
CKEditor Demo
At https://ckeditor.com/docs/ckeditor4/latest/examples/fullpreset.html, you can find a demo of the CKEditor with all its native features.
Test
/com.top_logic.demo/src/test/com/top_logic/demo/scripted/wysiwyg/TestWysiwyg.script.xml