From 9f4e11279fedd2c4fafd647f8305220f68ec3ad7 Mon Sep 17 00:00:00 2001 From: kirsty-hames Date: Wed, 2 Apr 2025 10:58:58 +0100 Subject: [PATCH 01/11] altTitle provided for menu button aria label --- templates/boxMenuItem.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/boxMenuItem.jsx b/templates/boxMenuItem.jsx index eb05bf3..db870e0 100644 --- a/templates/boxMenuItem.jsx +++ b/templates/boxMenuItem.jsx @@ -14,6 +14,7 @@ export default function BoxMenuItem (props) { _isLocked, _isComplete, title, + altTitle, _isOptional, _nthChild, _totalChild @@ -31,8 +32,9 @@ export default function BoxMenuItem (props) { const locked = _isLocked ? _globals?._accessibility?._ariaLabels?.locked : linkText; const optional = _isOptional ? _globals?._accessibility?._ariaLabels?.optional : ''; const itemCount = compile(_globals?._menu?._boxMenu?.itemCount || '', { _nthChild, _totalChild }); + const itemTitle = altTitle || title; const ariaLabel = [ - completion, locked, `${title}.`, `${itemCount}.`, `${optional}` + completion, locked, `${itemTitle}.`, `${itemCount}.`, `${optional}` ].filter(Boolean).join(' '); return ( From 57876511c76de43b9831078e7c4329f8a0501a93 Mon Sep 17 00:00:00 2001 From: kirsty-hames Date: Wed, 2 Apr 2025 11:00:09 +0100 Subject: [PATCH 02/11] altTitle added to contentObjects example --- example.json | 1 + 1 file changed, 1 insertion(+) diff --git a/example.json b/example.json index 6bd8e4c..434f87c 100644 --- a/example.json +++ b/example.json @@ -50,6 +50,7 @@ "_isHidden": false, "title": "Welcome to Adapt Learning", "displayTitle": "Welcome to Adapt Learning", + "altTitle": "", "body": "This page contains a working Adapt page with all core bundled components and plugins working.", "_graphic": { "alt": "", From f865d6a29c824c742d3c8cc14fcbaa97ca30727b Mon Sep 17 00:00:00 2001 From: kirsty-hames Date: Wed, 2 Apr 2025 11:01:33 +0100 Subject: [PATCH 03/11] altTitle added to properties.schema --- properties.schema | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/properties.schema b/properties.schema index e94566a..30400a0 100644 --- a/properties.schema +++ b/properties.schema @@ -289,6 +289,15 @@ "type": "object", "required": false, "properties": { + "altTitle": { + "type": "string", + "inputType": "Text", + "validators": [], + "title": "Alternative Title", + "help": "Alternative text read out by screen readers for the menu button text" + "required": false, + "translatable": true + }, "_renderAsGroup": { "type": "boolean", "required": false, From b3ac64417409b7927f3b2df7f486d627377921fd Mon Sep 17 00:00:00 2001 From: kirsty-hames Date: Wed, 2 Apr 2025 11:02:34 +0100 Subject: [PATCH 04/11] altTitle added to contentobject.schema --- schema/contentobject.schema.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/schema/contentobject.schema.json b/schema/contentobject.schema.json index faa8bba..bf34e4d 100644 --- a/schema/contentobject.schema.json +++ b/schema/contentobject.schema.json @@ -13,6 +13,15 @@ "title": "Box Menu", "default": {}, "properties": { + "altTitle": { + "type": "string", + "title": "Alternative Title", + "description": "Alternative text read out by screen readers for the menu button text", + "default": "", + "_adapt": { + "translatable": true + } + }, "_renderAsGroup": { "type": "boolean", "title": "Make this a parent group of menu items", From 63a3b22e99ae2ec20718445b5e007445a58e2b87 Mon Sep 17 00:00:00 2001 From: kirsty-hames Date: Wed, 2 Apr 2025 11:03:47 +0100 Subject: [PATCH 05/11] altTitle added to README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5290488..ce479f4 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,8 @@ The following attributes, set within *contentObjects.json*, configure the defaul **displayTitle** (string): This text is displayed on the menu item. +>**altTitle** (string): This will be read out by screen readers instead of **title** for the menu button text. Use if **title** contains punctuation or html syntax that shouldn't be read. + **body** (string): Optional text that appears on the menu item. Often used to inform the learner about the menu choice. If no **pageBody** is supplied, this text will also appear as the body text of the page header. **pageBody** (string): Optional text that appears as the body text of the page header. If this text is not provided, the **body** text will be used (if it is supplied). Reference [*adapt-contrib-vanilla/templates/page.hbs*](https://github.com/adaptlearning/adapt-contrib-vanilla/blob/master/templates/page.hbs). From 331300f6cab1996c0f3b592a64ee7c5ee2a7652e Mon Sep 17 00:00:00 2001 From: kirsty-hames Date: Wed, 2 Apr 2025 14:16:44 +0100 Subject: [PATCH 06/11] replace menu item altTitle with titleAriaLabel ...altTitle is already a supported contentObject property used to provide an alternative on screen title for PLP https://github.com/adaptlearning/adapt-contrib-pageLevelProgress/pull/208 --- templates/boxMenuItem.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/boxMenuItem.jsx b/templates/boxMenuItem.jsx index db870e0..2d475ec 100644 --- a/templates/boxMenuItem.jsx +++ b/templates/boxMenuItem.jsx @@ -14,7 +14,7 @@ export default function BoxMenuItem (props) { _isLocked, _isComplete, title, - altTitle, + titleAriaLabel, _isOptional, _nthChild, _totalChild @@ -32,7 +32,7 @@ export default function BoxMenuItem (props) { const locked = _isLocked ? _globals?._accessibility?._ariaLabels?.locked : linkText; const optional = _isOptional ? _globals?._accessibility?._ariaLabels?.optional : ''; const itemCount = compile(_globals?._menu?._boxMenu?.itemCount || '', { _nthChild, _totalChild }); - const itemTitle = altTitle || title; + const itemTitle = titleAriaLabel || title; const ariaLabel = [ completion, locked, `${itemTitle}.`, `${itemCount}.`, `${optional}` ].filter(Boolean).join(' '); From 4b93fee387225c7e250a403cdeef9dc05519f88c Mon Sep 17 00:00:00 2001 From: kirsty-hames Date: Wed, 2 Apr 2025 14:17:20 +0100 Subject: [PATCH 07/11] Update properties.schema --- properties.schema | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/properties.schema b/properties.schema index 30400a0..beceef1 100644 --- a/properties.schema +++ b/properties.schema @@ -289,12 +289,12 @@ "type": "object", "required": false, "properties": { - "altTitle": { + "titleAriaLabel": { "type": "string", "inputType": "Text", "validators": [], - "title": "Alternative Title", - "help": "Alternative text read out by screen readers for the menu button text" + "title": "Title ARIA label", + "help": "Alternative title text read out by screen readers for the menu button text" "required": false, "translatable": true }, From f18fc2c326ce0e1c1768f0b4e28776caef1ba752 Mon Sep 17 00:00:00 2001 From: kirsty-hames Date: Wed, 2 Apr 2025 14:18:02 +0100 Subject: [PATCH 08/11] Update contentobject.schema.json --- schema/contentobject.schema.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/schema/contentobject.schema.json b/schema/contentobject.schema.json index bf34e4d..aa067ac 100644 --- a/schema/contentobject.schema.json +++ b/schema/contentobject.schema.json @@ -13,10 +13,10 @@ "title": "Box Menu", "default": {}, "properties": { - "altTitle": { + "titleAriaLabel": { "type": "string", - "title": "Alternative Title", - "description": "Alternative text read out by screen readers for the menu button text", + "title": "Title ARIA label", + "description": "Alternative title text read out by screen readers for the menu button text", "default": "", "_adapt": { "translatable": true From d82c3f00b7d739d55924a7dae7bee87c9458b2d7 Mon Sep 17 00:00:00 2001 From: kirsty-hames Date: Wed, 2 Apr 2025 14:18:40 +0100 Subject: [PATCH 09/11] Update example --- example.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example.json b/example.json index 434f87c..ee549bf 100644 --- a/example.json +++ b/example.json @@ -50,7 +50,7 @@ "_isHidden": false, "title": "Welcome to Adapt Learning", "displayTitle": "Welcome to Adapt Learning", - "altTitle": "", + "titleAriaLabel": "", "body": "This page contains a working Adapt page with all core bundled components and plugins working.", "_graphic": { "alt": "", From 00e53669750fc0c67c4237ffc68a29b80c3da9d3 Mon Sep 17 00:00:00 2001 From: kirsty-hames Date: Wed, 2 Apr 2025 14:19:51 +0100 Subject: [PATCH 10/11] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ce479f4..1b51151 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ The following attributes, set within *contentObjects.json*, configure the defaul **displayTitle** (string): This text is displayed on the menu item. ->**altTitle** (string): This will be read out by screen readers instead of **title** for the menu button text. Use if **title** contains punctuation or html syntax that shouldn't be read. +>**titleAriaLabel** (string): This will be read out by screen readers instead of **title** for the menu button text. Use if **title** contains punctuation or html syntax that shouldn't be read. **body** (string): Optional text that appears on the menu item. Often used to inform the learner about the menu choice. If no **pageBody** is supplied, this text will also appear as the body text of the page header. From 30d1e971fd941d8b735468bd8a48931c82fd619b Mon Sep 17 00:00:00 2001 From: Brad Simpson Date: Thu, 1 May 2025 09:39:29 -0600 Subject: [PATCH 11/11] Add missing comma in schema --- properties.schema | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/properties.schema b/properties.schema index beceef1..acd87f1 100644 --- a/properties.schema +++ b/properties.schema @@ -294,7 +294,7 @@ "inputType": "Text", "validators": [], "title": "Title ARIA label", - "help": "Alternative title text read out by screen readers for the menu button text" + "help": "Alternative title text read out by screen readers for the menu button text", "required": false, "translatable": true },