Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add image caption support #911

Merged
merged 12 commits into from
Feb 17, 2020
Merged

Add image caption support #911

merged 12 commits into from
Feb 17, 2020

Conversation

thet
Copy link
Member

@thet thet commented Jun 11, 2019

In the TinyMCE Image dialog:

  • Adds an option for image captioning support from the description of the image ("Show Image Caption from Image Description") (uses an plone.outputfilters filter),
  • Adds an textfield for manual image captions,
  • Wraps the image in a <figure> tag and adds a <figcaption> if "Show Image Caption from Image Description" is not checked and the manual caption is present.
  • If no caption is present, only the image tag is added.

Re-adds image caption support, which was present until Plone 5.

Screenshot:
Screenshot from 2019-06-20 11-39-45

Merge:
#911
plone/plone.staticresources#30
plone/Products.CMFPlone#2887
plone/plone.outputfilters#36
plone/plone.app.upgrade#226

@mister-roboto
Copy link

@thet thanks for creating this Pull Request and help improve Plone!

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass.

Whenever you feel that the pull request is ready to be tested, either start all jenkins jobs pull requests by yourself, or simply add a comment in this pull request stating:

@jenkins-plone-org please run jobs

With this simple comment all the jobs will be started automatically.

Happy hacking!

@coveralls
Copy link

coveralls commented Jun 11, 2019

Coverage Status

Coverage increased (+0.7%) to 58.243% when pulling e7896b0 on thet-figcaption into 7b32d1b on master.

@thet thet changed the title add figcaption support A image caption support Jun 19, 2019
@thet thet changed the title A image caption support Add image caption support Jun 19, 2019
thet added a commit to plone/plone.staticresources that referenced this pull request Jun 19, 2019
@thet thet force-pushed the thet-figcaption branch from abbd851 to ed6dbc7 Compare June 19, 2019 01:24
thet added a commit to plone/plone.staticresources that referenced this pull request Jun 19, 2019
@thet thet assigned iham and MrTango Jun 19, 2019
@thet thet force-pushed the thet-figcaption branch from ed6dbc7 to 17e42b9 Compare June 19, 2019 01:32
thet added a commit to plone/plone.staticresources that referenced this pull request Jun 20, 2019
@thet thet force-pushed the thet-figcaption branch from c780d60 to d8d27de Compare June 20, 2019 08:30
@thet
Copy link
Member Author

thet commented Jun 20, 2019

The PRs regarding image captioning support are almost ready.
But there are some open questions

  • plone.outputfilters.filters.resolveuid_and_caption.ResolveUIDAndCaptionFilter uses the IImageCaptioningEnabler utility to check if the image captioning filter should be applied. We do not register such a utility and we do not have a controlpanel setting for that. So that filter always returns false.
    In contrast to that, we have a ResolveUidsAlwaysEnabled in plone.outputfilters which always returns true, so resolving uuids works.
    AFAIK this is the core of the image captioning regression from Plone 4.
    Probably the captioning setting should go in the image controlpanel.
    Ref: https://github.com/plone/plone.outputfilters/blob/bf2c1d160039b83299abca5f9467fc51cf9ef884/plone/outputfilters/filters/resolveuid_and_caption.py#L41

  • plone.outputfilters uses a image captioning template which uses a dl/dd structure. This needs to be changed to figure/figcaption.

  • At the Buschenschanksprint we discussed potential accessibility problems. If we add a figcaption from the description, we need to omit the alt tag from the image.
    To fix that properly we would need to specify how images and image captions should be done in respect to accessibility.

Before proceeding I'd like to get some feedback.

@thet
Copy link
Member Author

thet commented Jun 20, 2019

Some more ideas (out of scope for this PR):

  • Image copyright info handling in plone.outputfilters.
  • Copying EXIF information when scaling.

thet added a commit to plone/plone.staticresources that referenced this pull request Jan 3, 2020
@thet thet requested review from jensens and esteele January 3, 2020 16:03
@davilima6
Copy link
Member

@jenkins-plone-org please run jobs

thet added a commit to plone/plone.staticresources that referenced this pull request Jan 5, 2020
thet added a commit to plone/plone.staticresources that referenced this pull request Jan 7, 2020
thet added a commit to plone/plone.staticresources that referenced this pull request Feb 12, 2020
@thet thet merged commit 3e64876 into master Feb 17, 2020
@thet thet deleted the thet-figcaption branch February 17, 2020 14:03
thet added a commit to plone/plone.staticresources that referenced this pull request Feb 17, 2020
thet added a commit to plone/plone.staticresources that referenced this pull request Feb 17, 2020
mister-roboto pushed a commit to plone/buildout.coredev that referenced this pull request Feb 17, 2020
Branch: refs/heads/master
Date: 2020-02-17T18:17:32+01:00
Author: Johannes Raggam (thet) <thetetet@gmail.com>
Commit: plone/plone.staticresources@05a12a6

Add figcaption support - plone/mockup#911

Files changed:
A news/30.feature
A src/plone/staticresources/upgrades/7.zcml
A src/plone/staticresources/upgrades/profiles/7/registry.xml
M src/plone/staticresources/profiles/default/metadata.xml
M src/plone/staticresources/profiles/default/registry/bundles.xml
M src/plone/staticresources/setuphandlers.py
M src/plone/staticresources/upgrades/configure.zcml
Repository: plone.staticresources

Branch: refs/heads/master
Date: 2020-02-17T18:17:32+01:00
Author: Johannes Raggam (thet) <thetetet@gmail.com>
Commit: plone/plone.staticresources@cad5e61

compiled

Files changed:
M src/plone/staticresources/static/plone-tinymce-compiled.js
M src/plone/staticresources/static/plone-tinymce-compiled.min.js
@thet
Copy link
Member Author

thet commented Feb 17, 2020

@iham all merged! Should be in the next Plone release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants