Skip to content

Commit

Permalink
Merge pull request #10296 from KDSBrowne/2.2-add-slide-text-SR
Browse files Browse the repository at this point in the history
Add presentation slide text for screen readers
  • Loading branch information
antobinary committed Aug 20, 2020
2 parents 74ae881 + 916b7d7 commit 64cc59f
Showing 1 changed file with 19 additions and 0 deletions.
Expand Up @@ -25,6 +25,18 @@ const intlMessages = defineMessages({
id: 'app.presentation.notificationLabel',
description: 'label displayed in toast when presentation switches',
},
slideContentStart: {
id: 'app.presentation.startSlideContent',
description: 'Indicate the slide content start',
},
slideContentEnd: {
id: 'app.presentation.endSlideContent',
description: 'Indicate the slide content end',
},
noSlideContent: {
id: 'app.presentation.emptySlideContent',
description: 'No content available for slide',
},
});

const ALLOW_FULLSCREEN = Meteor.settings.public.app.allowFullscreen;
Expand Down Expand Up @@ -390,6 +402,7 @@ class PresentationArea extends PureComponent {
// renders the whole presentation area
renderPresentationArea(svgDimensions, viewBoxDimensions) {
const {
intl,
podId,
currentSlide,
slidePosition,
Expand All @@ -412,6 +425,7 @@ class PresentationArea extends PureComponent {

const {
imageUri,
content,
} = currentSlide;

let viewBoxPosition;
Expand Down Expand Up @@ -439,6 +453,10 @@ class PresentationArea extends PureComponent {
const svgViewBox = `${viewBoxPosition.x} ${viewBoxPosition.y} `
+ `${viewBoxDimensions.width} ${Number.isNaN(viewBoxDimensions.height) ? 0 : viewBoxDimensions.height}`;

const slideContent = content ? `${intl.formatMessage(intlMessages.slideContentStart)}
${content}
${intl.formatMessage(intlMessages.slideContentEnd)}` : intl.formatMessage(intlMessages.noSlideContent);

return (
<div
style={{
Expand All @@ -448,6 +466,7 @@ class PresentationArea extends PureComponent {
textAlign: 'center',
}}
>
<span id="currentSlideText" className={styles.visuallyHidden}>{slideContent}</span>
{this.renderPresentationClose()}
{this.renderPresentationDownload()}
{this.renderPresentationFullscreen()}
Expand Down

0 comments on commit 64cc59f

Please sign in to comment.