29
0
mirror of https://github.com/joomla/joomla-cms.git synced 2024-06-20 11:05:08 +00:00

[4.1] Joomla-Accessibility Checker (jooa11y). (#36190)

* jooa11y scaffolding

media folder
web assets
     hard coded until we decide on npm or not

to install check out this branch
npm run build:js
npm run build:css
discover install the plugin

todo - aka brian needs help
[] make the checker start
[] make the checker use the settings from the plugin

* script loads now

* tippy - temp

* editor button

* toolbar

* enpugh

* Jooa11y/enhancements (#132)

* Add some enhancements

* Fix wrong name

Co-authored-by: Benjamin Trenkle <benjamin.trenkle@wicked-software.de>

* tabs

* tippy popper licence and naming

* postgresql install

* xml bug

* cleaning

* tidy

* fix

* dont need scss

* needs to be an integer

* deploy version

* might not be the best way?

* Revert "Auxiliary commit to revert individual files from 18199dd5bec43f5b52bfcfd1b0bb13afb865dc2c"

This reverts commit 4eb15800ccc4bb0d64580013b58a92505bc5abfc.

* clarify show

* options

* package.lock

* remove editor button

* cs

* string

* set input

* deploy

* Temporary add git to node ci (#133)

* github link

* param

* Revert "param"

This reverts commit 378a64e0a3.

* params

* spelling

* revert

* sql field

* cs and spelling

* Fix npm

* Revert drone.yml change

* Switch package to tarball

* Use the es module

* Update eslint-plugin-vue to 8.2.0

* CS (#135)

* lang

* progress update

* fix strings

* load strings

* js change from @fedik

* typo and package-lock

* sef and non-sef

* revert change by Dimitris

* Update joomla-a11y-checker version

* Update joomla-a11y-checker version

* Update view preview url

* simplify

* Update jooa11y.php

* fix jscs (#136)

* undo eslint change

* remove "Additional ruleset toggles" from the plugin settings

* Update .eslintrc

lets try this again

* final try

* sha

Co-authored-by: Benjamin Trenkle <benjamin.trenkle@wicked-software.de>
Co-authored-by: Harald Leithner <leithner@itronic.at>
Co-authored-by: dgrammatiko <d.grammatiko@gmail.com>
Co-authored-by: Dimitris Grammatikogiannis <dg@dgrammatiko.dev>
Co-authored-by: Benjamin Trenkle <bembelimen@users.noreply.github.com>
Co-authored-by: Fedir Zinchuk <getthesite@gmail.com>
This commit is contained in:
Brian Teeman 2021-12-29 09:39:29 +00:00 committed by GitHub
parent 9a5a7784e3
commit 1a32b68ae9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 5444 additions and 4357 deletions

View File

@ -0,0 +1,2 @@
INSERT INTO `#__extensions` (`name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES
('plg_system_jooa11y', 'plugin', 'jooa11y', 'system', 0, 1, 1, 0, 1, '', '', '', 0, NULL, 0, 0);

View File

@ -0,0 +1,2 @@
INSERT INTO "#__extensions" ("name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "checked_out", "checked_out_time", "ordering", "state") VALUES
('plg_system_jooa11y', 'plugin', 'jooa11y', 'system', 0, 1, 1, 0, 1, '', '', '', 0, NULL, 0, 0);

View File

@ -18,6 +18,7 @@ use Joomla\CMS\Language\Associations;
use Joomla\CMS\Language\Text;
use Joomla\CMS\MVC\View\GenericDataException;
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Toolbar\Toolbar;
use Joomla\CMS\Toolbar\ToolbarHelper;
@ -213,16 +214,19 @@ class HtmlView extends BaseHtmlView
$toolbar->versions('com_content.article', $this->item->id);
}
$url = Route::link(
'site',
RouteHelper::getArticleRoute($this->item->id . ':' . $this->item->alias, $this->item->catid, $this->item->language),
true
);
$url = RouteHelper::getArticleRoute($this->item->id . ':' . $this->item->alias, $this->item->catid, $this->item->language);
$toolbar->preview($url, 'JGLOBAL_PREVIEW')
$toolbar->preview(Route::link('site', $url, true), 'JGLOBAL_PREVIEW')
->bodyHeight(80)
->modalWidth(90);
if (PluginHelper::isEnabled('system', 'jooa11y'))
{
$toolbar->jooa11y(Route::link('site', $url . '&jooa11y=1', true), 'JGLOBAL_JOOA11Y')
->bodyHeight(80)
->modalWidth(90);
}
if (Associations::isEnabled() && ComponentHelper::isEnabled('com_associations'))
{
$toolbar->standardButton('contract')

View File

@ -483,6 +483,7 @@ JGLOBAL_INTRO_TEXT="Intro Text"
JGLOBAL_ISFREESOFTWARE="%s is free software released under the <a href=\"https://www.gnu.org/licenses/gpl-2.0.html\" target=\"_blank\">GNU General Public License</a>."
JGLOBAL_ITEM_FEATURE="Feature Item"
JGLOBAL_ITEM_UNFEATURE="Unfeature Item"
JGLOBAL_JOOA11Y="Accessibility Check"
JGLOBAL_KEEP_TYPING="Keep typing ..."
JGLOBAL_LANGUAGE_VERSION_NOT_PLATFORM="Language pack does not match this Joomla! version. Some strings may be missing and will be displayed in English."
JGLOBAL_LEARN_MORE="Learn More"

View File

@ -0,0 +1,169 @@
; Joomla! Project
; (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
; License GNU General Public License version 2 or later; see LICENSE.txt
; Note : All ini files need to be saved as UTF-8
PLG_SYSTEM_JOOA11Y="System - Joomla Accessibility Checker"
PLG_SYSTEM_JOOA11Y_FIELD_CHECK_ROOT="Content Container"
PLG_SYSTEM_JOOA11Y_FIELD_CHECK_ROOT_DESC="Aria Landmark on the page that will be checked for accessibility. The default setting is <strong>main</strong>."
PLG_SYSTEM_JOOA11Y_FIELD_CONTAINER_IGNORE="Ignore Regions"
PLG_SYSTEM_JOOA11Y_FIELD_CONTAINER_IGNORE_DESC="Ignore specific regions within the Content Container. Use commas to separate classes or elements (eg #ignore, .ignore)"
PLG_SYSTEM_JOOA11Y_FIELD_READABILITY_ROOT="Readability Container"
PLG_SYSTEM_JOOA11Y_FIELD_READABILITY_ROOT_DESC="Aria Landmark on the page that will be checked for readability. The default setting is <strong>main</strong>."
PLG_SYSTEM_JOOA11Y_FIELD_SHOW_ALWAYS="Show Always"
PLG_SYSTEM_JOOA11Y_FIELD_SHOW_ALWAYS_DESC="Load the accessiblity checker on all pages. This is useful when developing the website but should not be left on when the website is live."
PLG_SYSTEM_JOOA11Y_XML_DESCRIPTION="The Joomla Accessibility Checker visually highlights common accessibility and usability issues. Geared towards content authors, the plugin identifies errors or warnings and provides guidance on how to fix them."
;Global text
PLG_SYSTEM_JOOA11Y_ALERT_CLOSE="Close"
PLG_SYSTEM_JOOA11Y_ALERT_TEXT="Alert"
PLG_SYSTEM_JOOA11Y_CONTAINER_LABEL="Accessibility Checker"
PLG_SYSTEM_JOOA11Y_CONTRAST="Contrast"
PLG_SYSTEM_JOOA11Y_DARK_MODE="Dark Mode"
PLG_SYSTEM_JOOA11Y_ERROR="Error"
PLG_SYSTEM_JOOA11Y_FORM_LABELS="Form labels"
PLG_SYSTEM_JOOA11Y_GOOD="Good"
PLG_SYSTEM_JOOA11Y_HIDE_OUTLINE="Hide Outline"
PLG_SYSTEM_JOOA11Y_HIDE_SETTINGS="Hide Settings"
PLG_SYSTEM_JOOA11Y_LANG_CODE="en"
PLG_SYSTEM_JOOA11Y_LINKS_ADVANCED="Links (Advanced)"
PLG_SYSTEM_JOOA11Y_MAIN_TOGGLE_LABEL="Check Accessibility"
PLG_SYSTEM_JOOA11Y_OFF="Off"
PLG_SYSTEM_JOOA11Y_ON="On"
PLG_SYSTEM_JOOA11Y_PAGE_OUTLINE="Page Outline"
PLG_SYSTEM_JOOA11Y_SETTINGS="Settings"
PLG_SYSTEM_JOOA11Y_SHORTCUT_SR="Skip to issue. Keyboard shortcut: Alt period"
PLG_SYSTEM_JOOA11Y_SHORTCUT_TOOLTIP="Skip to issue"
PLG_SYSTEM_JOOA11Y_SHOW_OUTLINE="Show Outline"
PLG_SYSTEM_JOOA11Y_SHOW_SETTINGS="Show Settings"
PLG_SYSTEM_JOOA11Y_WARNING="Warning"
;Readability panel.
PLG_SYSTEM_JOOA11Y_AVG_WORD_PER_SENTENCE="Average words per sentence:"
PLG_SYSTEM_JOOA11Y_COMPLEX_WORDS="Complex words:"
PLG_SYSTEM_JOOA11Y_DIFFICULT_READABILITY="Difficult"
PLG_SYSTEM_JOOA11Y_FAIRLY_DIFFICULT_READABILITY="Fairly difficult"
PLG_SYSTEM_JOOA11Y_GOOD_READABILITY="Good"
PLG_SYSTEM_JOOA11Y_READABILITY="Readability:"
PLG_SYSTEM_JOOA11Y_TOTAL_WORDS="Words:"
PLG_SYSTEM_JOOA11Y_VERY_DIFFICULT_READABILITY="Very difficult"
;Panel status
PLG_SYSTEM_JOOA11Y_PANEL_STATUS_1="1 accessibility error and 1 warning found."
PLG_SYSTEM_JOOA11Y_PANEL_STATUS_10="%(warningCount) <span class=\"jooa11y-visually-hidden\">warnings found.</span>"
PLG_SYSTEM_JOOA11Y_PANEL_STATUS_11="%(totalCount) <span class=\"jooa11y-visually-hidden\">total issues found.</span>"
PLG_SYSTEM_JOOA11Y_PANEL_STATUS_2="1 accessibility error and %(warningCount) warnings found."
PLG_SYSTEM_JOOA11Y_PANEL_STATUS_3="%(errorCount) accessibility errors and 1 warning found."
PLG_SYSTEM_JOOA11Y_PANEL_STATUS_4="%(errorCount) accessibility errors and %(warningCount) warnings found."
PLG_SYSTEM_JOOA11Y_PANEL_STATUS_5="1 accessibility error found."
PLG_SYSTEM_JOOA11Y_PANEL_STATUS_6="%(errorCount) accessibility errors found."
PLG_SYSTEM_JOOA11Y_PANEL_STATUS_7="Please review warning."
PLG_SYSTEM_JOOA11Y_PANEL_STATUS_8="Please review %(warningCount) warnings."
PLG_SYSTEM_JOOA11Y_PANEL_STATUS_9="No accessibility errors found."
PLG_SYSTEM_JOOA11Y_PANEL_STATUS_12="The item you are trying to view is not visible; it may be hidden or inside of an accordion or tab component. Here\'s a preview="
;Headings
PLG_SYSTEM_JOOA11Y_HEADING_EMPTY="Empty heading found! To fix, delete this line or change its format from <strong>Heading %(level)</strong> to <strong>Normal</strong> or <strong>Paragraph</strong>."
PLG_SYSTEM_JOOA11Y_HEADING_EMPTY_WITH_IMAGE="Heading has no text, but contains an image. If this is not a heading, change its format from <strong>Heading %(level)</strong> to <strong>Normal</strong> or <strong>Paragraph</strong>. Otherwise, please add alt text to the image if it is not decorative."
PLG_SYSTEM_JOOA11Y_HEADING_FIRST="The first heading on a page should usually be a Heading 1 or Heading 2. Heading 1 should be the start of the main content section, and is the main heading that describes the overall purpose of the page. Learn more about <a href=\"https://www.w3.org/WAI/tutorials/page-structure/headings/\" target=\"_blank\">Heading Structure.</a>"
PLG_SYSTEM_JOOA11Y_HEADING_LONG="Heading is long! Headings should be used to organize content and convey structure. They should be brief, informative, and unique. Please keep headings less than 160 characters (no more than a sentence)."
PLG_SYSTEM_JOOA11Y_HEADING_LONG_INFO="Character Count: <strong>%(headingLength)</strong>."
PLG_SYSTEM_JOOA11Y_HEADING_MISSING_ONE="Missing Heading 1. Heading 1 should be the start of the main content area, and is the main heading that describes the overall purpose of the page. Learn more about <a href=\"https://www.w3.org/WAI/tutorials/page-structure/headings/\" target=\"_blank\">Heading Structure.</a>"
PLG_SYSTEM_JOOA11Y_HEADING_NON_CONSECUTIVE_LEVEL="Non-consecutive heading level used. Headings should never skip levels, or go from <strong>Heading %(prevLevel)</strong> to <strong>Heading %(level)</strong>."
PLG_SYSTEM_JOOA11Y_PANEL_HEADING_MISSING_ONE="Missing Heading 1!"
;Link Text
PLG_SYSTEM_JOOA11Y_LINK_BEST_PRACTICES="Consider replacing the link text: <strong>%(error)</strong>"
PLG_SYSTEM_JOOA11Y_LINK_BEST_PRACTICES_DETAILS="<ul><li>&quot;Click here&quot; places focus on mouse mechanics, when many people do not use a mouse or may be viewing this website on a mobile device. Consider using a different verb that relates to the task.</li><li>Avoid using HTML symbols as call to actions unless they are hidden to assistive technologies.</li></ul>"
PLG_SYSTEM_JOOA11Y_LINK_EMPTY="Remove empty links without any text."
PLG_SYSTEM_JOOA11Y_LINK_EMPTY_LINK_NO_LABEL="Link does not have discernable text that is visible to screen readers and other assistive technology. To fix:<ul><li>Add some concise text that describes where the link takes you.</li><li>If it is an <a href=\"https://a11y-101.com/development/icons-and-links\" target=\"_blank\">icon link or SVG</a> it is likely missing a descriptive label.</li><li>If you think this link is an error due to a copy/paste bug, consider deleting it.</li></ul>"
PLG_SYSTEM_JOOA11Y_LINK_LABEL="The descriptive label for this link is: <strong>%(linkText)</strong>"
PLG_SYSTEM_JOOA11Y_LINK_STOPWORD="Link text may not be descriptive enough out of context: <strong>%(error)</strong>"
PLG_SYSTEM_JOOA11Y_LINK_STOPWORD_TIP="<strong>Tip!</strong> Link text should always be clear, unique, and meaningful. Avoid common words like \"click here\"; or \"learn more\"."
PLG_SYSTEM_JOOA11Y_LINK_URL="Longer, less intelligible URLs used as link text might be difficult to listen to with assistive technology. In most cases, it is better to use human-readable text instead of the URL. Short URLs (such as a site\'s homepage) are okay."
PLG_SYSTEM_JOOA11Y_LINK_URL_TIP="<strong>Tip!</strong> Link text should always be clear, unique, and meaningful so it could be understood out of context."
;Links Advanced
PLG_SYSTEM_JOOA11Y_FILE_TYPE_WARNING="Link points to a PDF or downloadable file (e.g. MP3, Zip, Word Doc) without warning. Indicate the file type within the link text. If it is a large file, consider including the file size."
PLG_SYSTEM_JOOA11Y_FILE_TYPE_WARNING_TIP="<strong>Example:</strong> Executive Report (PDF, 3MB)"
PLG_SYSTEM_JOOA11Y_LINK_IDENTICAL_NAME="Link has identical text as another link, although it points to a different page. Multiple links with the same text may cause confusion for people who use screen readers."
PLG_SYSTEM_JOOA11Y_LINK_IDENTICAL_NAME_TIP="Consider making the following link more descriptive to help distinguish it from other links: <strong>%(linkText)</strong>"
PLG_SYSTEM_JOOA11Y_NEW_TAB_WARNING="Link opens in a new tab or window without warning. Doing so can be disorienting, especially for people who have difficulty perceiving visual content. Secondly, it is not always a good practice to control someone\'s experience or make decisions for them. Indicate that the link opens in a new window within the link text."
PLG_SYSTEM_JOOA11Y_NEW_TAB_WARNING_TIP="<strong>Tip!</strong> Learn best practices: <a href=\"https://www.nngroup.com/articles/new-browser-windows-and-tabs/\">opening links in new browser windows and tabs.</a>!"
;Images
PLG_SYSTEM_JOOA11Y_HYPERLINK_ALT_LENGTH_MESSAGE="Alt text description on a linked image is <strong>too long</strong>. The alt text on linked images should describe where the link takes you, not a literal description of the image. <strong>Consider using the title of the page it links to as the alt text.</strong>"
PLG_SYSTEM_JOOA11Y_HYPERLINK_ALT_LENGTH_MESSAGE_INFO="The alt text is <strong>%(altLength)</strong> characters: <strong>%(altText)</strong>"
PLG_SYSTEM_JOOA11Y_LINK_ALT_HAS_BAD_WORD_MESSAGE="File extension within the alt text found. If the image conveys a story, mood, or important information - be sure to describe the image."
PLG_SYSTEM_JOOA11Y_LINK_ALT_HAS_BAD_WORD_MESSAGE_INFO="Remove: <strong>%(error)</strong>.<br>The alt text for this image is: <strong>%(altText)</strong>"
PLG_SYSTEM_JOOA11Y_LINK_ALT_HAS_SUS_WORD_MESSAGE="Assistive technologies already indicate that this is an image, so &quot;<strong>%(error)</strong>&quot; or &quot;%(error) of&quot; may be redundant."
PLG_SYSTEM_JOOA11Y_LINK_ALT_HAS_SUS_WORD_MESSAGE_INFO="The alt text for this image is: <strong>%(altText)</strong>"
PLG_SYSTEM_JOOA11Y_LINK_ALT_PLACEHOLDER_MESSAGE="Non-descript or placeholder alt text found. Replace the following alt text with something more meaningful: <strong>%(altText)</strong>."
PLG_SYSTEM_JOOA11Y_LINK_ALT_TOO_LONG_MESSAGE="Alt text description is <strong>too long</strong>. Alt text should be concise, yet meaningful like a <em>tweet</em> (around 100 characters). If this is a complex image or a graph, consider putting the long description of the image in the text below or an accordion component."
PLG_SYSTEM_JOOA11Y_LINK_ALT_TOO_LONG_MESSAGE_INFO="The alt text is <strong>%(altLength)</strong> characters: <strong>%(altText)</strong>"
PLG_SYSTEM_JOOA11Y_LINK_ANCHOR_LINK_AND_ALT_MESSAGE="Image link contains <strong>both alt text and surrounding link text.</strong> If this image is decorative and is being used as a functional link to another page, consider marking the image as decorative - the surrounding link text should suffice."
PLG_SYSTEM_JOOA11Y_LINK_ANCHOR_LINK_AND_ALT_MESSAGE_INFO="Alt text: <strong>%(altText)</strong>"
PLG_SYSTEM_JOOA11Y_LINK_DECORATIVE_MESSAGE="Image is marked as <strong>decorative</strong> and will be ignored by assistive technology. If the image conveys a story, mood or important information - be sure to add alt text."
PLG_SYSTEM_JOOA11Y_LINK_HYPERLINKED_IMAGE_ARIA_HIDDEN="Link around image has <span class=\"jooa11y-kbd\">aria-hidden=&quot;true&quot;</span> but is still keyboard focusable. If you are intending to hide a redundant or duplicate link, add <span class=\"jooa11y-kbd\">tabindex=&quot;-1&quot;</span> as well."
PLG_SYSTEM_JOOA11Y_LINK_IMAGE_BAD_ALT_MESSAGE="File extension within the alt text found. Ensure the alt text describes the destination of the link, not a literal description of the image. Remove: <strong>%(error)</strong>."
PLG_SYSTEM_JOOA11Y_LINK_IMAGE_BAD_ALT_MESSAGE_INFO="The alt text for this image is: <strong>%(altText)</strong>"
PLG_SYSTEM_JOOA11Y_LINK_IMAGE_LINK_ALT_TEXT_MESSAGE="Image link contains alt text, although please ensure alt text describes the destination page. <strong>Consider using the title of the page it links to as the alt text.</strong> Does the alt text describe where the link takes you?"
PLG_SYSTEM_JOOA11Y_LINK_IMAGE_LINK_ALT_TEXT_MESSAGE_INFO="Alt text: <strong>%(altText)</strong>"
PLG_SYSTEM_JOOA11Y_LINK_IMAGE_LINK_NULL_ALT_NO_TEXT_MESSAGE="Image within link is marked as decorative and there is no link text. Please add alt text to the image that describes the destination of the link."
PLG_SYSTEM_JOOA11Y_LINK_IMAGE_PLACEHOLDER_ALT_MESSAGE="Non-descript or placeholder alt text within a linked image found. Ensure the alt text describes the destination of the link, not a literal description of the image. Replace the following alt text: <strong>%(altText)</strong>."
PLG_SYSTEM_JOOA11Y_LINK_IMAGE_SUS_ALT_MESSAGE="Assistive technologies already indicate that this is an image, so &quot;<strong>%(error)</strong>&quot; or &quot;%(error) of&quot; may be redundant. Ensure the alt text describes the destination of the link, not a literal description of the image."
PLG_SYSTEM_JOOA11Y_LINK_IMAGE_SUS_ALT_MESSAGE_INFO="The alt text for this image is: <strong>%(altText)</strong>."
PLG_SYSTEM_JOOA11Y_LINK_LINK_HAS_ALT_MESSAGE="Image is marked as decorative, although the link is using the surrounding text as a descriptive label."
PLG_SYSTEM_JOOA11Y_LINK_PASS_ALT="The alt text for this image is: <strong>%(altText)</strong>"
PLG_SYSTEM_JOOA11Y_MISSING_ALT_LINK_BUT_HAS_TEXT_MESSAGE="Image is being used as a link with surrounding text, although the alt attribute should be marked as decorative."
PLG_SYSTEM_JOOA11Y_MISSING_ALT_LINK_MESSAGE="Image is being used as a link but is missing alt text! Please ensure alt text describes where the link takes you."
PLG_SYSTEM_JOOA11Y_MISSING_ALT_MESSAGE="Missing alt text! If the image conveys a story, mood, or important information - be sure to describe the image."
;Labels
PLG_SYSTEM_JOOA11Y_LABELS_ARIA_LABEL_INPUT_MESSAGE="Input has an accessible name, although please ensure there is a visible label too."
PLG_SYSTEM_JOOA11Y_LABELS_ARIA_LABEL_INPUT_MESSAGE_INFO="The accessible name for this input is: <strong>%(ariaLabel)</strong>"
PLG_SYSTEM_JOOA11Y_LABELS_INPUT_RESET_MESSAGE="Reset buttons should <strong>not</strong> be used unless specifically needed because they are easy to activate by mistake."
PLG_SYSTEM_JOOA11Y_LABELS_INPUT_RESET_MESSAGE_TIP="<strong>Tip!</strong> Learn why <a href=\"https://www.nngroup.com/articles/reset-and-cancel-buttons/\" target=\"_blank\">Reset and Cancel buttons pose usability issues.</a>"
PLG_SYSTEM_JOOA11Y_LABELS_MISSING_IMAGE_INPUT_MESSAGE="Image button is missing alt text. Please add alt text to provide an accessible name. For example: <em>Search</em> or <em>Submit</em>."
PLG_SYSTEM_JOOA11Y_LABELS_MISSING_LABEL_MESSAGE="There is no label associated with this input. Please add an <span class=\"jooa11y-kbd\">id</span> to this input, and add a matching <span class=\"jooa11y-kbd\">for</span> attribute to the label."
PLG_SYSTEM_JOOA11Y_LABELS_NO_FOR_ATTRIBUTE_MESSAGE="There is no label associated with this input. Add a <span class=\"jooa11y-kbd\">for</span> attribute to the label that matches the <span class=\"jooa11y-kbd\">id</span> of this input."
PLG_SYSTEM_JOOA11Y_LABELS_NO_FOR_ATTRIBUTE_MESSAGE_INFO="The ID for this input is: <strong>id=&#34;%(t)&#34;</strong>"
;Embedded content
PLG_SYSTEM_JOOA11Y_EMBED_AUDIO="Please ensure to provide a <strong>transcript for all podcasts.</strong> Providing transcripts for audio content is a mandatory Level A requirement. Transcripts support people who are D/deaf or hard-of-hearing, but can benefit everyone. Consider placing the transcript below or within an accordion panel."
PLG_SYSTEM_JOOA11Y_EMBED_GENERAL_WARNING="Unable to check embedded content. Please make sure that images have alt text, videos have captions, text has sufficient contrast, and interactive components are <a href=\"https://webaim.org/techniques/keyboard/\" target=\"_blank\">keyboard accessible.</a>"
PLG_SYSTEM_JOOA11Y_EMBED_MISSING_TITLE="Embedded content requires an accessible name that describes its contents. Please provide a unique <span class=\"jooa11y-kbd\">title</span> or <span class=\"jooa11y-kbd\">aria-label</span> attribute on the <span class=\"jooa11y-kbd\">iframe</span> element. Learn more about <a href=\"https://dequeuniversity.com/tips/provide-iframe-titles\" target=\"_blank\">iFrames.</a>"
PLG_SYSTEM_JOOA11Y_EMBED_VIDEO="Please ensure <strong>all videos have closed captioning.</strong> Providing captions for all audio and video content is a mandatory Level A requirement. Captions support people who are D/deaf or hard-of-hearing."
;Contrast
PLG_SYSTEM_JOOA11Y_CONTRAST_ERROR_INPUT_MESSAGE="The text within this input does not have enough contrast with the background. The contrast ratio should be at least 4.5:1 for normal text and 3:1 for large text."
PLG_SYSTEM_JOOA11Y_CONTRAST_ERROR_INPUT_MESSAGE_INFO="The contrast ratio is <strong>%(cratio)</strong>."
PLG_SYSTEM_JOOA11Y_CONTRAST_ERROR_MESSAGE="This text does not have enough contrast with the background. The contrast ratio should be at least 4.5:1 for normal text and 3:1 for large text."
PLG_SYSTEM_JOOA11Y_CONTRAST_ERROR_MESSAGE_INFO="The contrast ratio is <strong>%(cratio)</strong> for the following text: <strong>%(nodetext)</strong>"
PLG_SYSTEM_JOOA11Y_CONTRAST_WARNING_MESSAGE="The contrast of this text is unknown and needs to be manually reviewed. Ensure the text and the background have strong contrasting colours. The contrast ratio should be at least 4.5:1 for normal text and 3:1 for large text."
PLG_SYSTEM_JOOA11Y_CONTRAST_WARNING_MESSAGE_INFO="Please review contrast of the following text:<br><strong>%(nodetext)</strong>"
;Readability
PLG_SYSTEM_JOOA11Y_READABILITY_NOT_ENOUGH_CONTENT_MESSAGE="Not enough content to calculate readability score."
PLG_SYSTEM_JOOA11Y_READABILITY_NO_P_OR_LI_MESSAGE="Unable to calculate readability score. No paragraph <span class=\"jooa11y-badge\">&lt;p&gt;</span> or list content <span class=\"jooa11y-badge\">&lt;li&gt;</span> found."
;QA
PLG_SYSTEM_JOOA11Y_QA_BAD_ITALICS="Bold and italic tags have semantic meaning, and should <strong>not</strong> be used to highlight entire paragraphs. Bolded text should be used to provide strong <strong>emphasis</strong> on a word or phrase. Italics should be used to highlight proper names (i.e. book and article titles), foreign words, quotes. Long quotes should be formatted as a blockquote."
PLG_SYSTEM_JOOA11Y_QA_BAD_LINK="Bad link found. Link appears to point to a development environment. This link points to: <strong>%(el)</strong>"
PLG_SYSTEM_JOOA11Y_QA_BLOCKQUOTE_MESSAGE="Is this a heading? <strong>%(bqHeadingText)</strong>"
PLG_SYSTEM_JOOA11Y_QA_BLOCKQUOTE_MESSAGE_TIP="Blockquotes should be used for quotes only. If this is intended to be a heading, change this blockquote to a semantic heading (e.g. Heading 2 or Heading 3)."
PLG_SYSTEM_JOOA11Y_QA_FAKE_HEADING="Is this a heading? <strong>%(boldtext)</strong>"
PLG_SYSTEM_JOOA11Y_QA_FAKE_HEADING_INFO="A line of bold text might look like a heading, but someone using a screen reader cannot tell that it is important or jump to its content. Bolded text should never replace semantic headings (Heading 2 to Heading 6)."
PLG_SYSTEM_JOOA11Y_QA_PAGE_LANGUAGE_MESSAGE="Page language not declared! Please <a href=\"https://www.w3.org/International/questions/qa-html-language-declarations\" target=\"_blank\">declare language on HTML tag.</a>"
PLG_SYSTEM_JOOA11Y_QA_PDF_COUNT="PDFs are considered web content and must be made accessible as well. PDFs often contain issues for people who use screen readers (missing structural tags or missing form field labels) and people who have low vision (text does not reflow when enlarged). <ul><li>If this is a form, consider using an accessible HTML form as an alternative.</li><li>If this is a document, consider converting it into a web page.</li></ul><br>Otherwise, please check <strong>%(pdfCount)</strong> <a href=\"https://www.adobe.com/accessibility/products/acrobat/using-acrobat-pro-accessibility-checker.html\" target=\"_blank\">PDF(s) for accessibility in Acrobat DC.</a>"
PLG_SYSTEM_JOOA11Y_QA_SHOULD_BE_LIST="Are you trying to create a list? Possible list item found: <strong>%(firstPrefix)</strong>"
PLG_SYSTEM_JOOA11Y_QA_SHOULD_BE_LIST_TIP="Make sure to use semantic lists by using the bullet or number formatting buttons instead. When using a semantic list, assistive technologies are able to convey information such as the total number of items and the relative position of each item in the list. Learn more about <a href=\"https://www.w3.org/WAI/tutorials/page-structure/content/#lists\" target=\"_blank\">semantic lists.</a>"
PLG_SYSTEM_JOOA11Y_QA_UPPERCASE_WARNING="Found all caps. Some screen readers may interpret all caps text as an acronym and will read each letter individually. Additionally, some people find all caps more difficult to read and it may give the appearance of SHOUTING."
;Tables
PLG_SYSTEM_JOOA11Y_TABLES_EMPTY_HEADING="Empty table header found! Table headers should <em>never</em> be empty. It is important to designate row and/or column headers to convey their relationship. This information provides context to people who use assistive technology. Please keep in mind that tables should be used for tabular data only."
PLG_SYSTEM_JOOA11Y_TABLES_EMPTY_HEADING_INFO="Learn more about <a href=\"https://www.w3.org/WAI/tutorials/tables/\" target=\"_blank\">accessible tables.</a>"
PLG_SYSTEM_JOOA11Y_TABLES_MISSING_HEADINGS="Missing table headers! Accessible tables need HTML markup that indicates header cells and data cells which defines their relationship. This information provides context to people who use assistive technology. Tables should be used for tabular data only."
PLG_SYSTEM_JOOA11Y_TABLES_MISSING_HEADINGS_INFO="Learn more about <a href=\"https://www.w3.org/WAI/tutorials/tables/\" target=\"_blank\">accessible tables.</a>"
PLG_SYSTEM_JOOA11Y_TABLES_SEMANTIC_HEADING="Semantic headings such as Heading 2 or Heading 3 should only be used for sections of content; <strong>not</strong> in HTML tables. Indicate table headings using the <strong>th</strong> element instead."
PLG_SYSTEM_JOOA11Y_TABLES_SEMANTIC_HEADING_INFO="Learn more about <a href=\"https://www.w3.org/WAI/tutorials/tables/\" target=\"_blank\">accessible tables.</a>"

View File

@ -0,0 +1,7 @@
; Joomla! Project
; (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
; License GNU General Public License version 2 or later; see LICENSE.txt
; Note : All ini files need to be saved as UTF-8
PLG_SYSTEM_JOOA11Y="System - Joomla Accessibility Checker"
PLG_SYSTEM_JOOA11Y_XML_DESCRIPTION="The Joomla Accessibility Checker visually highlights common accessibility and usability issues. Geared towards content authors, the plugin identifies errors or warnings and provides guidance on how to fix them."

View File

@ -480,6 +480,7 @@ JGLOBAL_INTRO_TEXT="Intro Text"
JGLOBAL_ISFREESOFTWARE="%s is free software released under the <a href=\"https://www.gnu.org/licenses/gpl-2.0.html\" target=\"_blank\">GNU General Public License</a>."
JGLOBAL_ITEM_FEATURE="Feature Item"
JGLOBAL_ITEM_UNFEATURE="Unfeature Item"
JGLOBAL_JOOA11Y="Accessibility Check"
JGLOBAL_KEEP_TYPING="Keep typing ..."
JGLOBAL_LANGUAGE_VERSION_NOT_PLATFORM="Language pack does not match this Joomla! version. Some strings may be missing and will be displayed in English."
JGLOBAL_LEARN_MORE="Learn More"

View File

@ -5,7 +5,6 @@
// Vue
"plugin:vue/vue3-recommended"
],
"parser": "vue-eslint-parser",
"parserOptions": {
"sourceType": "module"
},

View File

@ -427,6 +427,10 @@
],
"licenseFilename": "LICENSE.txt"
},
"joomla-a11y-checker": {
"name": "joomla-a11y-checker",
"licenseFilename": "LICENSE.md"
},
"joomla-ui-custom-elements": {
"name": "joomla-custom-elements",
"js": {

View File

@ -0,0 +1,37 @@
{
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
"name": "plg_system_jooa11y",
"version": "4.0.0",
"description": "Joomla CMS",
"license": "GPL-2.0-or-later",
"assets": [
{
"name": "plg_system_jooa11y.jooa11y-es5",
"type": "script",
"uri": "plg_system_jooa11y/jooa11y-es5.min.js",
"dependencies": [
"core"
],
"attributes": {
"defer": true,
"nomodule": true
}
},
{
"name": "plg_system_jooa11y.jooa11y",
"type": "script",
"uri": "plg_system_jooa11y/jooa11y.min.js",
"dependencies": [
"plg_system_jooa11y.jooa11y-es5"
],
"attributes": {
"type": "module"
}
},
{
"name": "plg_system_jooa11y.jooa11y",
"type": "style",
"uri": "plg_system_jooa11y/jooa11y.min.css"
}
]
}

View File

@ -0,0 +1,17 @@
import { Jooa11y, Lang } from 'joomla-a11y-checker/dist/js/joomla-a11y-checker.esm.js';
if (!Joomla) {
throw new Error('Joomla API is not properly initialised');
}
const stringPrefix = 'PLG_SYSTEM_JOOA11Y_';
Lang.translate = (string) => Joomla.Text._(stringPrefix + string, string);
const options = Joomla.getOptions('jooa11yOptions');
window.addEventListener('load', () => {
// Instantiate
const checker = new Jooa11y(options);
checker.doInitialCheck();
});

View File

@ -0,0 +1 @@
@import "node_modules/joomla-a11y-checker/dist/css/joomla-a11y-checker";

View File

@ -328,26 +328,27 @@ INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`,
(0, 'plg_system_fields', 'plugin', 'fields', 'system', 0, 1, 1, 0, 1, '', '', '', 5, 0),
(0, 'plg_system_highlight', 'plugin', 'highlight', 'system', 0, 1, 1, 0, 1, '', '', '', 6, 0),
(0, 'plg_system_httpheaders', 'plugin', 'httpheaders', 'system', 0, 1, 1, 0, 1, '', '{}', '', 7, 0),
(0, 'plg_system_languagecode', 'plugin', 'languagecode', 'system', 0, 0, 1, 0, 1, '', '', '', 8, 0),
(0, 'plg_system_languagefilter', 'plugin', 'languagefilter', 'system', 0, 0, 1, 0, 1, '', '', '', 9, 0),
(0, 'plg_system_log', 'plugin', 'log', 'system', 0, 1, 1, 0, 1, '', '', '', 10, 0),
(0, 'plg_system_logout', 'plugin', 'logout', 'system', 0, 1, 1, 0, 1, '', '', '', 11, 0),
(0, 'plg_system_logrotation', 'plugin', 'logrotation', 'system', 0, 1, 1, 0, 1, '', '{}', '', 12, 0),
(0, 'plg_system_privacyconsent', 'plugin', 'privacyconsent', 'system', 0, 0, 1, 0, 1, '', '{}', '', 13, 0),
(0, 'plg_system_redirect', 'plugin', 'redirect', 'system', 0, 0, 1, 0, 1, '', '', '', 14, 0),
(0, 'plg_system_remember', 'plugin', 'remember', 'system', 0, 1, 1, 0, 1, '', '', '', 15, 0),
(0, 'plg_system_schedulerunner', 'plugin', 'schedulerunner', 'system', 0, 1, 1, 0, 0, '', '{}', '', 15, 0),
(0, 'plg_system_sef', 'plugin', 'sef', 'system', 0, 1, 1, 0, 1, '', '', '', 16, 0),
(0, 'plg_system_sessiongc', 'plugin', 'sessiongc', 'system', 0, 1, 1, 0, 1, '', '', '', 17, 0),
(0, 'plg_system_skipto', 'plugin', 'skipto', 'system', 0, 1, 1, 0, 1, '', '{}', '', 18, 0),
(0, 'plg_system_stats', 'plugin', 'stats', 'system', 0, 1, 1, 0, 1, '', '', '', 19, 0),
(0, 'plg_system_jooa11y', 'plugin', 'jooa11y', 'system', 0, 1, 1, 0, 1, '', '', '', 8, 0),
(0, 'plg_system_languagecode', 'plugin', 'languagecode', 'system', 0, 0, 1, 0, 1, '', '', '', 9, 0),
(0, 'plg_system_languagefilter', 'plugin', 'languagefilter', 'system', 0, 0, 1, 0, 1, '', '', '', 10, 0),
(0, 'plg_system_log', 'plugin', 'log', 'system', 0, 1, 1, 0, 1, '', '', '', 11, 0),
(0, 'plg_system_logout', 'plugin', 'logout', 'system', 0, 1, 1, 0, 1, '', '', '', 12, 0),
(0, 'plg_system_logrotation', 'plugin', 'logrotation', 'system', 0, 1, 1, 0, 1, '', '{}', '', 13, 0),
(0, 'plg_system_privacyconsent', 'plugin', 'privacyconsent', 'system', 0, 0, 1, 0, 1, '', '{}', '', 14, 0),
(0, 'plg_system_redirect', 'plugin', 'redirect', 'system', 0, 0, 1, 0, 1, '', '', '', 15, 0),
(0, 'plg_system_remember', 'plugin', 'remember', 'system', 0, 1, 1, 0, 1, '', '', '', 16, 0),
(0, 'plg_system_schedulerunner', 'plugin', 'schedulerunner', 'system', 0, 1, 1, 0, 0, '', '{}', '', 17, 0),
(0, 'plg_system_sef', 'plugin', 'sef', 'system', 0, 1, 1, 0, 1, '', '', '', 18, 0),
(0, 'plg_system_sessiongc', 'plugin', 'sessiongc', 'system', 0, 1, 1, 0, 1, '', '', '', 19, 0),
(0, 'plg_system_skipto', 'plugin', 'skipto', 'system', 0, 1, 1, 0, 1, '', '{}', '', 20, 0),
(0, 'plg_system_stats', 'plugin', 'stats', 'system', 0, 1, 1, 0, 1, '', '', '', 21, 0),
(0, 'plg_system_tasknotification', 'plugin', 'tasknotification', 'system', 0, 1, 1, 0, 1, '', '', '', 22, 0),
(0, 'plg_system_updatenotification', 'plugin', 'updatenotification', 'system', 0, 1, 1, 0, 1, '', '', '', 20, 0),
(0, 'plg_system_webauthn', 'plugin', 'webauthn', 'system', 0, 1, 1, 0, 1, '', '{}', '', 21, 0),
(0, 'plg_task_checkfiles', 'plugin', 'checkfiles', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0),
(0, 'plg_task_demotasks', 'plugin', 'demotasks', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0),
(0, 'plg_task_requests', 'plugin', 'requests', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0),
(0, 'plg_task_sitestatus', 'plugin', 'sitestatus', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0),
(0, 'plg_system_updatenotification', 'plugin', 'updatenotification', 'system', 0, 1, 1, 0, 1, '', '', '', 23, 0),
(0, 'plg_system_webauthn', 'plugin', 'webauthn', 'system', 0, 1, 1, 0, 1, '', '{}', '', 23, 0),
(0, 'plg_task_checkfiles', 'plugin', 'checkfiles', 'task', 0, 1, 1, 0, 0, '', '{}', '', 1, 0),
(0, 'plg_task_demotasks', 'plugin', 'demotasks', 'task', 0, 1, 1, 0, 0, '', '{}', '', 2, 0),
(0, 'plg_task_requests', 'plugin', 'requests', 'task', 0, 1, 1, 0, 0, '', '{}', '', 3, 0),
(0, 'plg_task_sitestatus', 'plugin', 'sitestatus', 'task', 0, 1, 1, 0, 0, '', '{}', '', 4, 0),
(0, 'plg_twofactorauth_totp', 'plugin', 'totp', 'twofactorauth', 0, 0, 1, 0, 1, '', '', '', 1, 0),
(0, 'plg_twofactorauth_yubikey', 'plugin', 'yubikey', 'twofactorauth', 0, 0, 1, 0, 1, '', '', '', 2, 0),
(0, 'plg_user_contactcreator', 'plugin', 'contactcreator', 'user', 0, 0, 1, 0, 1, '', '{"autowebpage":"","category":"4","autopublish":"0"}', '', 1, 0),

View File

@ -334,26 +334,27 @@ INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder",
(0, 'plg_system_fields', 'plugin', 'fields', 'system', 0, 1, 1, 0, 1, '', '', '', 5, 0),
(0, 'plg_system_highlight', 'plugin', 'highlight', 'system', 0, 1, 1, 0, 1, '', '', '', 6, 0),
(0, 'plg_system_httpheaders', 'plugin', 'httpheaders', 'system', 0, 1, 1, 0, 1, '', '{}', '', 7, 0),
(0, 'plg_system_languagecode', 'plugin', 'languagecode', 'system', 0, 0, 1, 0, 1, '', '', '', 8, 0),
(0, 'plg_system_languagefilter', 'plugin', 'languagefilter', 'system', 0, 0, 1, 0, 1, '', '', '', 9, 0),
(0, 'plg_system_log', 'plugin', 'log', 'system', 0, 1, 1, 0, 1, '', '', '', 10, 0),
(0, 'plg_system_logout', 'plugin', 'logout', 'system', 0, 1, 1, 0, 1, '', '', '', 11, 0),
(0, 'plg_system_logrotation', 'plugin', 'logrotation', 'system', 0, 1, 1, 0, 1, '', '{}', '', 12, 0),
(0, 'plg_system_privacyconsent', 'plugin', 'privacyconsent', 'system', 0, 0, 1, 0, 1, '', '{}', '', 13, 0),
(0, 'plg_system_redirect', 'plugin', 'redirect', 'system', 0, 0, 1, 0, 1, '', '', '', 14, 0),
(0, 'plg_system_remember', 'plugin', 'remember', 'system', 0, 1, 1, 0, 1, '', '', '', 15, 0),
(0, 'plg_system_schedulerunner', 'plugin', 'schedulerunner', 'system', 0, 1, 1, 0, 0, '', '{}', '', 15, 0),
(0, 'plg_system_sef', 'plugin', 'sef', 'system', 0, 1, 1, 0, 1, '', '', '', 16, 0),
(0, 'plg_system_sessiongc', 'plugin', 'sessiongc', 'system', 0, 1, 1, 0, 1, '', '', '', 17, 0),
(0, 'plg_system_skipto', 'plugin', 'skipto', 'system', 0, 1, 1, 0, 1, '', '{}', '', 18, 0),
(0, 'plg_system_stats', 'plugin', 'stats', 'system', 0, 1, 1, 0, 1, '', '', '', 19, 0),
(0, 'plg_system_jooa11y', 'plugin', 'jooa11y', 'system', 0, 1, 1, 0, 1, '', '', '', 8, 0),
(0, 'plg_system_languagecode', 'plugin', 'languagecode', 'system', 0, 0, 1, 0, 1, '', '', '', 9, 0),
(0, 'plg_system_languagefilter', 'plugin', 'languagefilter', 'system', 0, 0, 1, 0, 1, '', '', '', 10, 0),
(0, 'plg_system_log', 'plugin', 'log', 'system', 0, 1, 1, 0, 1, '', '', '', 11, 0),
(0, 'plg_system_logout', 'plugin', 'logout', 'system', 0, 1, 1, 0, 1, '', '', '', 12, 0),
(0, 'plg_system_logrotation', 'plugin', 'logrotation', 'system', 0, 1, 1, 0, 1, '', '{}', '', 13, 0),
(0, 'plg_system_privacyconsent', 'plugin', 'privacyconsent', 'system', 0, 0, 1, 0, 1, '', '{}', '', 14, 0),
(0, 'plg_system_redirect', 'plugin', 'redirect', 'system', 0, 0, 1, 0, 1, '', '', '', 15, 0),
(0, 'plg_system_remember', 'plugin', 'remember', 'system', 0, 1, 1, 0, 1, '', '', '', 16, 0),
(0, 'plg_system_schedulerunner', 'plugin', 'schedulerunner', 'system', 0, 1, 1, 0, 0, '', '{}', '', 17, 0),
(0, 'plg_system_sef', 'plugin', 'sef', 'system', 0, 1, 1, 0, 1, '', '', '', 18, 0),
(0, 'plg_system_sessiongc', 'plugin', 'sessiongc', 'system', 0, 1, 1, 0, 1, '', '', '', 19, 0),
(0, 'plg_system_skipto', 'plugin', 'skipto', 'system', 0, 1, 1, 0, 1, '', '{}', '', 20, 0),
(0, 'plg_system_stats', 'plugin', 'stats', 'system', 0, 1, 1, 0, 1, '', '', '', 21, 0),
(0, 'plg_system_tasknotification', 'plugin', 'tasknotification', 'system', 0, 1, 1, 0, 1, '', '', '', 22, 0),
(0, 'plg_system_updatenotification', 'plugin', 'updatenotification', 'system', 0, 1, 1, 0, 1, '', '', '', 20, 0),
(0, 'plg_system_webauthn', 'plugin', 'webauthn', 'system', 0, 1, 1, 0, 1, '', '{}', '', 21, 0),
(0, 'plg_task_checkfiles', 'plugin', 'checkfiles', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0),
(0, 'plg_task_demotasks', 'plugin', 'demotasks', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0),
(0, 'plg_task_requests', 'plugin', 'requests', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0),
(0, 'plg_task_sitestatus', 'plugin', 'sitestatus', 'task', 0, 1, 1, 0, 0, '', '{}', '', 15, 0),
(0, 'plg_system_updatenotification', 'plugin', 'updatenotification', 'system', 0, 1, 1, 0, 1, '', '', '', 23, 0),
(0, 'plg_system_webauthn', 'plugin', 'webauthn', 'system', 0, 1, 1, 0, 1, '', '{}', '', 23, 0),
(0, 'plg_task_checkfiles', 'plugin', 'checkfiles', 'task', 0, 1, 1, 0, 0, '', '{}', '', 1, 0),
(0, 'plg_task_demotasks', 'plugin', 'demotasks', 'task', 0, 1, 1, 0, 0, '', '{}', '', 2, 0),
(0, 'plg_task_requests', 'plugin', 'requests', 'task', 0, 1, 1, 0, 0, '', '{}', '', 3, 0),
(0, 'plg_task_sitestatus', 'plugin', 'sitestatus', 'task', 0, 1, 1, 0, 0, '', '{}', '', 4, 0),
(0, 'plg_twofactorauth_totp', 'plugin', 'totp', 'twofactorauth', 0, 0, 1, 0, 1, '', '', '', 1, 0),
(0, 'plg_twofactorauth_yubikey', 'plugin', 'yubikey', 'twofactorauth', 0, 0, 1, 0, 1, '', '', '', 2, 0),
(0, 'plg_user_contactcreator', 'plugin', 'contactcreator', 'user', 0, 0, 1, 0, 1, '', '{"autowebpage":"","category":"4","autopublish":"0"}', '', 1, 0),

View File

@ -317,6 +317,7 @@ JGLOBAL_HITS_DESC="Hits descending"
JGLOBAL_ICON_SEP="|"
JGLOBAL_INHERIT="Inherit"
JGLOBAL_INTRO_TEXT="Intro Text"
JGLOBAL_JOOA11Y="Accessibility Check"
JGLOBAL_KEEP_TYPING="Keep typing ..."
JGLOBAL_LEARN_MORE="Learn More"
JGLOBAL_LEFT="Left"

View File

@ -73,6 +73,38 @@ trait CoreButtonsTrait
return $button;
}
/**
* Writes a jooa11y accessibility checker button for a given option (opens a popup window).
*
* @param string $url The url to open
* @param string $text The text of button.
* @param bool $newWindow Whether to open the preview in _blank or just a modal
*
* @return PopupButton|LinkButton
*
* @since __DEPLOY_VERSION__
*/
public function jooa11y(string $url, string $text = 'JGLOBAL_JOOA11Y', $newWindow = false)
{
if ($newWindow === true)
{
$button = $this->linkButton('jooa11y-link', $text)
->url($url)
->attributes(['target' => '_blank'])
->icon('icon-universal-access');
}
else
{
$button = $this->popupButton('jooa11y-preview', $text)
->url($url)
->iframeWidth(640)
->iframeHeight(480)
->icon('icon-universal-access');
}
return $button;
}
/**
* Writes a help button for a given option (opens a popup window).
*

View File

@ -133,6 +133,27 @@ abstract class ToolbarHelper
$bar->appendButton('Popup', $icon, 'Preview', $url . '&task=preview', 640, 480, $bodyHeight, $modalWidth);
}
/**
* Writes a jooa11y accessibility checker button for a given option (opens a popup window).
*
* @param string $url The url to open
* @param bool $updateEditors Unused
* @param string $icon The image to display.
* @param integer $bodyHeight The body height of the preview popup
* @param integer $modalWidth The modal width of the preview popup
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public static function jooa11y($url = '', $updateEditors = false, $icon = 'icon-universal-access', $bodyHeight = null, $modalWidth = null)
{
$bar = Toolbar::getInstance('toolbar');
// Add a button.
$bar->appendButton('Popup', $icon, 'Preview', $url . '&task=preview', 640, 480, $bodyHeight, $modalWidth);
}
/**
* Writes a help button for a given option (opens a popup window).
*

9075
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -45,6 +45,7 @@
"diff": "^4.0.2",
"dragula": "3.7.2",
"focus-visible": "^5.2.0",
"joomla-a11y-checker": "https://github.com/joomla-projects/joomla-a11y-checker/tarball/joomla",
"joomla-ui-custom-elements": "0.2.0",
"jquery": "^3.6.0",
"jquery-migrate": "^3.3.2",
@ -78,7 +79,7 @@
"eslint": "^7.25.0",
"eslint-config-airbnb-base": "^14.2.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-vue": "^7.9.0",
"eslint-plugin-vue": "^8.2.0",
"fs-extra": "^9.1.0",
"ini": "^1.3.8",
"jasmine-core": "^3.7.1",

View File

@ -0,0 +1,273 @@
<?php
/**
* @package Joomla.Plugin
* @subpackage System.jooa11y
*
* @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Application\CMSApplicationInterface;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\Event\SubscriberInterface;
/**
* Jooa11y plugin to add an accessibility checker
*
* @since __DEPLOY_VERSION__
*/
class PlgSystemJooa11y extends CMSPlugin implements SubscriberInterface
{
/**
* Application object.
*
* @var CMSApplicationInterface
* @since __DEPLOY_VERSION__
*/
protected $app;
/**
* Affects constructor behavior. If true, language files will be loaded automatically.
*
* @var boolean
* @since __DEPLOY_VERSION__
*/
protected $autoloadLanguage = true;
/**
* Subscribe to certain events
*
* @return string[] An array of event mappings
*
* @since __DEPLOY_VERSION__
*
* @throws Exception
*/
public static function getSubscribedEvents(): array
{
$mapping = [];
// Only trigger in frontend
if (Factory::getApplication()->isClient('site'))
{
$mapping['onBeforeCompileHead'] = 'initJooa11y';
}
return $mapping;
}
/**
* Method to check if the current user is allowed to see the debug information or not.
*
* @return boolean True if access is allowed.
*
* @since __DEPLOY_VERSION__
*/
private function isAuthorisedDisplayChecker(): bool
{
static $result;
if (is_bool($result))
{
return $result;
}
// If the user is not allowed to view the output then end here.
$filterGroups = (array) $this->params->get('filter_groups', []);
if (!empty($filterGroups))
{
$userGroups = $this->app->getIdentity()->get('groups');
if (!array_intersect($filterGroups, $userGroups))
{
$result = false;
return $result;
}
}
$result = true;
return $result;
}
/**
* Add the checker.
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public function initJooa11y()
{
// Check if we are in a preview modal or the plugin has enforced loading
$showJooa11y = $this->app->input->get('jooa11y', $this->params->get('showAlways', 0));
// Load the checker if authorised
if (!$showJooa11y || !$this->isAuthorisedDisplayChecker())
{
return;
}
// Get the document object.
$document = $this->app->getDocument();
// Determine if it is an LTR or RTL language
$direction = Factory::getLanguage()->isRtl() ? 'right' : 'left';
// Detect the current active language
$lang = Factory::getLanguage()->getTag();
// Add the language constants
$constants = [
'PLG_SYSTEM_JOOA11Y_ALERT_CLOSE',
'PLG_SYSTEM_JOOA11Y_ALERT_TEXT',
'PLG_SYSTEM_JOOA11Y_AVG_WORD_PER_SENTENCE',
'PLG_SYSTEM_JOOA11Y_COMPLEX_WORDS',
'PLG_SYSTEM_JOOA11Y_CONTAINER_LABEL',
'PLG_SYSTEM_JOOA11Y_CONTRAST',
'PLG_SYSTEM_JOOA11Y_CONTRAST_ERROR_INPUT_MESSAGE',
'PLG_SYSTEM_JOOA11Y_CONTRAST_ERROR_INPUT_MESSAGE_INFO',
'PLG_SYSTEM_JOOA11Y_CONTRAST_ERROR_MESSAGE',
'PLG_SYSTEM_JOOA11Y_CONTRAST_ERROR_MESSAGE_INFO',
'PLG_SYSTEM_JOOA11Y_CONTRAST_WARNING_MESSAGE',
'PLG_SYSTEM_JOOA11Y_CONTRAST_WARNING_MESSAGE_INFO',
'PLG_SYSTEM_JOOA11Y_DARK_MODE',
'PLG_SYSTEM_JOOA11Y_DIFFICULT_READABILITY',
'PLG_SYSTEM_JOOA11Y_EMBED_AUDIO',
'PLG_SYSTEM_JOOA11Y_EMBED_GENERAL_WARNING',
'PLG_SYSTEM_JOOA11Y_EMBED_MISSING_TITLE',
'PLG_SYSTEM_JOOA11Y_EMBED_VIDEO',
'PLG_SYSTEM_JOOA11Y_ERROR',
'PLG_SYSTEM_JOOA11Y_FAIRLY_DIFFICULT_READABILITY',
'PLG_SYSTEM_JOOA11Y_FILE_TYPE_WARNING',
'PLG_SYSTEM_JOOA11Y_FILE_TYPE_WARNING_TIP',
'PLG_SYSTEM_JOOA11Y_FORM_LABELS',
'PLG_SYSTEM_JOOA11Y_GOOD',
'PLG_SYSTEM_JOOA11Y_GOOD_READABILITY',
'PLG_SYSTEM_JOOA11Y_HEADING_EMPTY',
'PLG_SYSTEM_JOOA11Y_HEADING_EMPTY_WITH_IMAGE',
'PLG_SYSTEM_JOOA11Y_HEADING_FIRST',
'PLG_SYSTEM_JOOA11Y_HEADING_LONG',
'PLG_SYSTEM_JOOA11Y_HEADING_LONG_INFO',
'PLG_SYSTEM_JOOA11Y_HEADING_MISSING_ONE',
'PLG_SYSTEM_JOOA11Y_HEADING_NON_CONSECUTIVE_LEVEL',
'PLG_SYSTEM_JOOA11Y_HIDE_OUTLINE',
'PLG_SYSTEM_JOOA11Y_HIDE_SETTINGS',
'PLG_SYSTEM_JOOA11Y_HYPERLINK_ALT_LENGTH_MESSAGE',
'PLG_SYSTEM_JOOA11Y_HYPERLINK_ALT_LENGTH_MESSAGE_INFO',
'PLG_SYSTEM_JOOA11Y_LABELS_ARIA_LABEL_INPUT_MESSAGE',
'PLG_SYSTEM_JOOA11Y_LABELS_ARIA_LABEL_INPUT_MESSAGE_INFO',
'PLG_SYSTEM_JOOA11Y_LABELS_INPUT_RESET_MESSAGE',
'PLG_SYSTEM_JOOA11Y_LABELS_INPUT_RESET_MESSAGE_TIP',
'PLG_SYSTEM_JOOA11Y_LABELS_MISSING_IMAGE_INPUT_MESSAGE',
'PLG_SYSTEM_JOOA11Y_LABELS_MISSING_LABEL_MESSAGE',
'PLG_SYSTEM_JOOA11Y_LABELS_NO_FOR_ATTRIBUTE_MESSAGE',
'PLG_SYSTEM_JOOA11Y_LABELS_NO_FOR_ATTRIBUTE_MESSAGE_INFO',
'PLG_SYSTEM_JOOA11Y_LANG_CODE',
'PLG_SYSTEM_JOOA11Y_LINKS_ADVANCED',
'PLG_SYSTEM_JOOA11Y_LINK_ALT_HAS_BAD_WORD_MESSAGE',
'PLG_SYSTEM_JOOA11Y_LINK_ALT_HAS_BAD_WORD_MESSAGE_INFO',
'PLG_SYSTEM_JOOA11Y_LINK_ALT_HAS_SUS_WORD_MESSAGE',
'PLG_SYSTEM_JOOA11Y_LINK_ALT_HAS_SUS_WORD_MESSAGE_INFO',
'PLG_SYSTEM_JOOA11Y_LINK_ALT_PLACEHOLDER_MESSAGE',
'PLG_SYSTEM_JOOA11Y_LINK_ALT_TOO_LONG_MESSAGE',
'PLG_SYSTEM_JOOA11Y_LINK_ALT_TOO_LONG_MESSAGE_INFO',
'PLG_SYSTEM_JOOA11Y_LINK_ANCHOR_LINK_AND_ALT_MESSAGE',
'PLG_SYSTEM_JOOA11Y_LINK_ANCHOR_LINK_AND_ALT_MESSAGE_INFO',
'PLG_SYSTEM_JOOA11Y_LINK_BEST_PRACTICES',
'PLG_SYSTEM_JOOA11Y_LINK_BEST_PRACTICES_DETAILS',
'PLG_SYSTEM_JOOA11Y_LINK_DECORATIVE_MESSAGE',
'PLG_SYSTEM_JOOA11Y_LINK_EMPTY',
'PLG_SYSTEM_JOOA11Y_LINK_EMPTY_LINK_NO_LABEL',
'PLG_SYSTEM_JOOA11Y_LINK_HYPERLINKED_IMAGE_ARIA_HIDDEN',
'PLG_SYSTEM_JOOA11Y_LINK_IDENTICAL_NAME',
'PLG_SYSTEM_JOOA11Y_LINK_IDENTICAL_NAME_TIP',
'PLG_SYSTEM_JOOA11Y_LINK_IMAGE_BAD_ALT_MESSAGE',
'PLG_SYSTEM_JOOA11Y_LINK_IMAGE_BAD_ALT_MESSAGE_INFO',
'PLG_SYSTEM_JOOA11Y_LINK_IMAGE_LINK_ALT_TEXT_MESSAGE',
'PLG_SYSTEM_JOOA11Y_LINK_IMAGE_LINK_ALT_TEXT_MESSAGE_INFO',
'PLG_SYSTEM_JOOA11Y_LINK_IMAGE_LINK_NULL_ALT_NO_TEXT_MESSAGE',
'PLG_SYSTEM_JOOA11Y_LINK_IMAGE_PLACEHOLDER_ALT_MESSAGE',
'PLG_SYSTEM_JOOA11Y_LINK_IMAGE_SUS_ALT_MESSAGE',
'PLG_SYSTEM_JOOA11Y_LINK_IMAGE_SUS_ALT_MESSAGE_INFO',
'PLG_SYSTEM_JOOA11Y_LINK_LABEL',
'PLG_SYSTEM_JOOA11Y_LINK_LINK_HAS_ALT_MESSAGE',
'PLG_SYSTEM_JOOA11Y_LINK_PASS_ALT',
'PLG_SYSTEM_JOOA11Y_LINK_STOPWORD',
'PLG_SYSTEM_JOOA11Y_LINK_STOPWORD_TIP',
'PLG_SYSTEM_JOOA11Y_LINK_URL',
'PLG_SYSTEM_JOOA11Y_LINK_URL_TIP',
'PLG_SYSTEM_JOOA11Y_MAIN_TOGGLE_LABEL',
'PLG_SYSTEM_JOOA11Y_MISSING_ALT_LINK_BUT_HAS_TEXT_MESSAGE',
'PLG_SYSTEM_JOOA11Y_MISSING_ALT_LINK_MESSAGE',
'PLG_SYSTEM_JOOA11Y_MISSING_ALT_MESSAGE',
'PLG_SYSTEM_JOOA11Y_NEW_TAB_WARNING',
'PLG_SYSTEM_JOOA11Y_NEW_TAB_WARNING_TIP',
'PLG_SYSTEM_JOOA11Y_OFF',
'PLG_SYSTEM_JOOA11Y_ON',
'PLG_SYSTEM_JOOA11Y_PAGE_OUTLINE',
'PLG_SYSTEM_JOOA11Y_PANEL_HEADING_MISSING_ONE',
'PLG_SYSTEM_JOOA11Y_PANEL_STATUS_1',
'PLG_SYSTEM_JOOA11Y_PANEL_STATUS_10',
'PLG_SYSTEM_JOOA11Y_PANEL_STATUS_11',
'PLG_SYSTEM_JOOA11Y_PANEL_STATUS_12',
'PLG_SYSTEM_JOOA11Y_PANEL_STATUS_2',
'PLG_SYSTEM_JOOA11Y_PANEL_STATUS_3',
'PLG_SYSTEM_JOOA11Y_PANEL_STATUS_4',
'PLG_SYSTEM_JOOA11Y_PANEL_STATUS_5',
'PLG_SYSTEM_JOOA11Y_PANEL_STATUS_6',
'PLG_SYSTEM_JOOA11Y_PANEL_STATUS_7',
'PLG_SYSTEM_JOOA11Y_PANEL_STATUS_8',
'PLG_SYSTEM_JOOA11Y_PANEL_STATUS_9',
'PLG_SYSTEM_JOOA11Y_QA_BAD_ITALICS',
'PLG_SYSTEM_JOOA11Y_QA_BAD_LINK',
'PLG_SYSTEM_JOOA11Y_QA_BLOCKQUOTE_MESSAGE',
'PLG_SYSTEM_JOOA11Y_QA_BLOCKQUOTE_MESSAGE_TIP',
'PLG_SYSTEM_JOOA11Y_QA_FAKE_HEADING',
'PLG_SYSTEM_JOOA11Y_QA_FAKE_HEADING_INFO',
'PLG_SYSTEM_JOOA11Y_QA_PAGE_LANGUAGE_MESSAGE',
'PLG_SYSTEM_JOOA11Y_QA_PDF_COUNT',
'PLG_SYSTEM_JOOA11Y_QA_SHOULD_BE_LIST',
'PLG_SYSTEM_JOOA11Y_QA_SHOULD_BE_LIST_TIP',
'PLG_SYSTEM_JOOA11Y_QA_UPPERCASE_WARNING',
'PLG_SYSTEM_JOOA11Y_READABILITY',
'PLG_SYSTEM_JOOA11Y_READABILITY_NOT_ENOUGH_CONTENT_MESSAGE',
'PLG_SYSTEM_JOOA11Y_READABILITY_NO_P_OR_LI_MESSAGE',
'PLG_SYSTEM_JOOA11Y_SETTINGS',
'PLG_SYSTEM_JOOA11Y_SHORTCUT_SR',
'PLG_SYSTEM_JOOA11Y_SHORTCUT_TOOLTIP',
'PLG_SYSTEM_JOOA11Y_SHOW_OUTLINE',
'PLG_SYSTEM_JOOA11Y_SHOW_SETTINGS',
'PLG_SYSTEM_JOOA11Y_TABLES_EMPTY_HEADING',
'PLG_SYSTEM_JOOA11Y_TABLES_EMPTY_HEADING_INFO',
'PLG_SYSTEM_JOOA11Y_TABLES_MISSING_HEADINGS',
'PLG_SYSTEM_JOOA11Y_TABLES_MISSING_HEADINGS_INFO',
'PLG_SYSTEM_JOOA11Y_TABLES_SEMANTIC_HEADING',
'PLG_SYSTEM_JOOA11Y_TABLES_SEMANTIC_HEADING_INFO',
'PLG_SYSTEM_JOOA11Y_TOTAL_WORDS',
'PLG_SYSTEM_JOOA11Y_VERY_DIFFICULT_READABILITY',
'PLG_SYSTEM_JOOA11Y_WARNING',
];
foreach ($constants as $constant)
{
Text::script($constant);
}
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa*/
$wa = $document->getWebAssetManager();
$wa->getRegistry()->addRegistryFile('media/plg_system_jooa11y/joomla.asset.json');
$wa->useScript('plg_system_jooa11y.jooa11y')
->useStyle('plg_system_jooa11y.jooa11y');
return true;
}
}

View File

@ -0,0 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" group="system" method="upgrade">
<name>plg_system_jooa11y</name>
<author>Joomla! Project</author>
<creationDate>November 2021</creationDate>
<copyright>(C) 2021 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>admin@joomla.org</authorEmail>
<authorUrl>www.joomla.org</authorUrl>
<version>4.1.0</version>
<description>PLG_SYSTEM_JOOA11Y_XML_DESCRIPTION</description>
<files>
<filename plugin="jooa11y">jooa11y.php</filename>
</files>
<languages>
<language tag="en-GB">language/en-GB/plg_system_jooa11y.ini</language>
<language tag="en-GB">language/en-GB/plg_system_jooa11y.sys.ini</language>
</languages>
<config>
<fields name="params">
<fieldset name="basic">
<field
name="showAlways"
type="radio"
label="PLG_SYSTEM_JOOA11Y_FIELD_SHOW_ALWAYS"
description="PLG_SYSTEM_JOOA11Y_FIELD_SHOW_ALWAYS_DESC"
layout="joomla.form.field.radio.switcher"
default="0"
filter="integer"
>
<option value="0">JOFF</option>
<option value="1">JON</option>
</field>
<field
name="checkRoot"
type="text"
label="PLG_SYSTEM_JOOA11Y_FIELD_CHECK_ROOT"
description="PLG_SYSTEM_JOOA11Y_FIELD_CHECK_ROOT_DESC"
default="main"
filter="string"
/>
<field
name="readabilityRoot"
type="text"
label="PLG_SYSTEM_JOOA11Y_FIELD_READABILITY_ROOT"
description="PLG_SYSTEM_JOOA11Y_FIELD_READABILITY_ROOT_DESC"
default="main"
filter="string"
/>
<field
name="containerIgnore"
type="text"
label="PLG_SYSTEM_JOOA11Y_FIELD_CONTAINER_IGNORE"
description="PLG_SYSTEM_JOOA11Y_FIELD_CONTAINER_IGNORE_DESC"
filter="string"
/>
</fieldset>
</fields>
</config>
</extension>