diff --git a/CHANGELOG.txt b/CHANGELOG.txt index c5d29c1a9f..95d4189160 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -15,6 +15,7 @@ Changelog * Added `defer` flag to `PageQuerySet.specific` (Karl Hobley) * Snippets can now be deleted from the listing view (LB (Ben Johnston)) * Increased max length of redirect URL field to 255 (Michael Harrison) + * Added documentation for new JS/CSS media files association with Draftail feature definitions (Ed Henderson) * Fix: Handle all exceptions from `Image.get_file_size` (Andrew Plummer) * Fix: Fix display of breadcrumbs in ModelAdmin (LB (Ben Johnston)) * Fix: Remove duplicate border radius of avatars (Benjamin Thurm) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index dcaaa00628..aa86010afb 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -303,6 +303,7 @@ Contributors * Andrew Plummer * Dmitry Vasilev * Benjamin Thurm +* Ed Henderson Translators =========== diff --git a/docs/advanced_topics/customisation/extending_draftail.rst b/docs/advanced_topics/customisation/extending_draftail.rst index 2ed3ed4f54..28f9b4520c 100644 --- a/docs/advanced_topics/customisation/extending_draftail.rst +++ b/docs/advanced_topics/customisation/extending_draftail.rst @@ -183,7 +183,8 @@ In order to achieve this, we start with registering the rich text feature like f features.register_editor_plugin( 'draftail', feature_name, draftail_features.EntityFeature( control, - js=['stock.js'] # Additional JS to be loaded when this feature is active + js=['stock.js'] + css={'all': ['stock.css']} ) ) @@ -193,6 +194,10 @@ In order to achieve this, we start with registering the rich text feature like f 'to_database_format': {'entity_decorators': {type_: stock_entity_decorator}}, }) +The ``js`` and ``css`` keyword arguments on ``EntityFeature`` can be used to specify additional +JS and CSS files to load when this feature is active. Both are optional. Their values are added to a ``Media`` object, more documentation on these objects +is available in the `Django Form Assets documentation `_. + Since entities hold data, the conversion to/from database format is more complicated. We have to create the two handlers: .. code-block:: python diff --git a/docs/releases/2.2.rst b/docs/releases/2.2.rst index 9e39cf25ab..3c6588b8fc 100644 --- a/docs/releases/2.2.rst +++ b/docs/releases/2.2.rst @@ -24,6 +24,7 @@ Other features * Added ``defer`` flag to ``PageQuerySet.specific`` (Karl Hobley) * Snippets can now be deleted from the listing view (LB (Ben Johnston)) * Increased max length of redirect URL field to 255 (Michael Harrison) + * Added documentation for new JS/CSS media files association with Draftail feature definitions (Ed Henderson) Bug fixes ~~~~~~~~~