Add <noscript> tag & hide map from screenreaders. - #96
Open
Sardis93 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a fallback message displayed inside a
<noscript>tag within the map canvas<div>for users who have JavaScript disabled in their browser. The message is configurable via the existingSettings form using a text format widget (supporting text formats such as plain text or filtered HTML).
Changes
templates/openy-map.html.twig— addsaria-hidden="true"to.openy-map-canvasto hide the interactive map from screen readers, and renders a<noscript>tag inside it when#noscript_textis set on the elementsrc/Element/OpenYMap.php— readsnoscript_textfrom config, processes it throughcheck_markup(), and passes the result to the render element as#noscript_textsrc/Form/SettingsForm.php— adds atext_formatfield to the admin settings form so editors can customise the message and choose a text formatconfig/install/openy_map.settings.yml— ships a sensible default value (plain_textformat)config/schema/openy_map.schema.yml— declaresnoscript_textas a mapping ofvalue(translatable text) andformat(string)openy_map.install—openy_map_update_8010()backfills the new config key for existing installationsTest plan
<noscript>content is not visible to the user