diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-10-13.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-10-13.sql new file mode 100644 index 0000000000000..7ee5febc76b6c --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2020-10-13.sql @@ -0,0 +1,4 @@ +INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES +(0, 'plg_editors-xtd_achecker', 'plugin', 'achecker', 'editors-xtd', 0, 1, 1, 0, 1, '', '', '', 0, NULL, 0, 0), +(0, 'plg_system_achecker', 'plugin', 'achecker', 'system', 1, 1, 1, 0, 1, '', '', '', 0, NULL, 0, 0); + diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-10-13.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-10-13.sql new file mode 100644 index 0000000000000..358e155a3465b --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2020-10-13.sql @@ -0,0 +1,3 @@ +INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "checked_out", "checked_out_time", "ordering", "state") VALUES +(0, 'plg_editors-xtd_achecker', 'plugin', 'achecker', 'editors-xtd', 0, 1, 1, 0, 1, '', '', '', 0, NULL, 0, 0), +(0, 'plg_system_achecker', 'plugin', 'achecker', 'system', 1, 1, 1, 0, 1, '', '', '', 0, NULL, 0, 0); diff --git a/administrator/language/en-GB/plg_editors-xtd_achecker.ini b/administrator/language/en-GB/plg_editors-xtd_achecker.ini new file mode 100644 index 0000000000000..842c62bf922c3 --- /dev/null +++ b/administrator/language/en-GB/plg_editors-xtd_achecker.ini @@ -0,0 +1,8 @@ +; Joomla! Project +; Copyright (C) 2005 - 2020 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt +; Note : All ini files need to be saved as UTF-8 + +PLG_EDITORS-XTD_ACHECKER="Button - Accessibility Check" +PLG_EDITORS-XTD_ACHECKER_BUTTON_ACCESSIBILITY="Accessibility" +PLG_EDITORS-XTD_ACHECKER_XML_DESCRIPTION="Provides a button to enable an accessibility check for the content." diff --git a/administrator/language/en-GB/plg_editors-xtd_achecker.sys.ini b/administrator/language/en-GB/plg_editors-xtd_achecker.sys.ini new file mode 100644 index 0000000000000..ad730e4a027af --- /dev/null +++ b/administrator/language/en-GB/plg_editors-xtd_achecker.sys.ini @@ -0,0 +1,7 @@ +; Joomla! Project +; Copyright (C) 2005 - 2020 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt +; Note : All ini files need to be saved as UTF-8 + +PLG_EDITORS-XTD_ACHECKER="Button - Accessibility Check" +PLG_EDITORS-XTD_ACHECKER_XML_DESCRIPTION="Provides a button to enable an accessibility check for the content." diff --git a/administrator/language/en-GB/plg_system_achecker.sys.ini b/administrator/language/en-GB/plg_system_achecker.sys.ini new file mode 100644 index 0000000000000..d337686abd489 --- /dev/null +++ b/administrator/language/en-GB/plg_system_achecker.sys.ini @@ -0,0 +1,7 @@ +; Joomla! Project +; Copyright (C) 2005 - 2020 Open Source Matters. All rights reserved. +; License GNU General Public License version 2 or later; see LICENSE.txt, see LICENSE.php +; Note : All ini files need to be saved as UTF-8 + +PLG_SYSTEM_ACHECKER="System - Accessibility Checker" +PLG_SYSTEM_ACHECKER_XML_DESCRIPTION="This plugin adds the ability to perform an accessibility check on a page of your site." diff --git a/administrator/templates/atum/scss/blocks/_icons.scss b/administrator/templates/atum/scss/blocks/_icons.scss index 76b6a34e93fff..2cd112def2c8a 100644 --- a/administrator/templates/atum/scss/blocks/_icons.scss +++ b/administrator/templates/atum/scss/blocks/_icons.scss @@ -79,6 +79,11 @@ content: "\f1aa"; } +.icon-accessible::before { + font-family: "Font Awesome 5 Brands"; + content: "\f368"; +} + .icon-shield-alt::before { content: "\f3ed"; } diff --git a/build/build-modules-js/settings.json b/build/build-modules-js/settings.json index 276c31954dd8f..5b4fb89436c9a 100644 --- a/build/build-modules-js/settings.json +++ b/build/build-modules-js/settings.json @@ -238,6 +238,37 @@ "dependencies": [], "licenseFilename": "LICENSE.md" }, + "html_codesniffer": { + "name": "html_codesniffer", + "js": { + "build/HTMLCS.js": "js/HTMLCS.js" + }, + "css": { + "build/HTMLCS.css": "css/HTMLCS.css" + }, + "filesExtra": { + "build/Images": "css/Images", + "Standards": "Standards", + "Translations": "Translations" + }, + "provideAssets": [ + { + "name": "html_codesniffer", + "type": "script", + "uri": "HTMLCS.js", + "attributes": { + "defer": true + } + }, + { + "name": "html_codesniffer", + "type": "style", + "uri": "HTMLCS.css" + } + ], + "dependencies": [], + "licenseFilename": "licence.txt" + }, "roboto-fontface": { "name": "roboto-fontface", "filesExtra": { diff --git a/build/media_source/system/scss/_icomoon.scss b/build/media_source/system/scss/_icomoon.scss index 0ba5bdfcf9f52..33ed47db2d305 100644 --- a/build/media_source/system/scss/_icomoon.scss +++ b/build/media_source/system/scss/_icomoon.scss @@ -29,6 +29,10 @@ @extend .#{$fa-css-prefix}-joomla:before; } +.icon-accessible::before { + @extend .#{$fa-css-prefix}-accessible-icon:before; +} + .icon-chevron-up::before, .icon-uparrow::before, .icon-arrow-up::before { diff --git a/installation/sql/mysql/base.sql b/installation/sql/mysql/base.sql index 791c500bd857b..86e313d001ec4 100644 --- a/installation/sql/mysql/base.sql +++ b/installation/sql/mysql/base.sql @@ -249,6 +249,7 @@ INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, (0, 'plg_editors_codemirror', 'plugin', 'codemirror', 'editors', 0, 1, 1, 0, 1, '', '{"lineNumbers":"1","lineWrapping":"1","matchTags":"1","matchBrackets":"1","marker-gutter":"1","autoCloseTags":"1","autoCloseBrackets":"1","autoFocus":"1","theme":"default","tabmode":"indent"}', '', 1, 0), (0, 'plg_editors_none', 'plugin', 'none', 'editors', 0, 1, 1, 1, 1, '', '', '', 2, 0), (0, 'plg_editors_tinymce', 'plugin', 'tinymce', 'editors', 0, 1, 1, 0, 1, '', '{"configuration":{"toolbars":{"2":{"toolbar1":["bold","underline","strikethrough","|","undo","redo","|","bullist","numlist","|","pastetext"]},"1":{"menu":["edit","insert","view","format","table","tools"],"toolbar1":["bold","italic","underline","strikethrough","|","alignleft","aligncenter","alignright","alignjustify","|","formatselect","|","bullist","numlist","|","outdent","indent","|","undo","redo","|","link","unlink","anchor","code","|","hr","table","|","subscript","superscript","|","charmap","pastetext","preview"]},"0":{"menu":["edit","insert","view","format","table","tools"],"toolbar1":["bold","italic","underline","strikethrough","|","alignleft","aligncenter","alignright","alignjustify","|","styleselect","|","formatselect","fontselect","fontsizeselect","|","searchreplace","|","bullist","numlist","|","outdent","indent","|","undo","redo","|","link","unlink","anchor","image","|","code","|","forecolor","backcolor","|","fullscreen","|","table","|","subscript","superscript","|","charmap","emoticons","media","hr","ltr","rtl","|","cut","copy","paste","pastetext","|","visualchars","visualblocks","nonbreaking","blockquote","template","|","print","preview","codesample","insertdatetime","removeformat"]}},"setoptions":{"2":{"access":["1"],"skin":"0","skin_admin":"0","mobile":"0","drag_drop":"1","path":"","entity_encoding":"raw","lang_mode":"1","text_direction":"ltr","content_css":"1","content_css_custom":"","relative_urls":"1","newlines":"0","use_config_textfilters":"0","invalid_elements":"script,applet,iframe","valid_elements":"","extended_elements":"","resizing":"1","resize_horizontal":"1","element_path":"1","wordcount":"1","image_advtab":"0","advlist":"1","autosave":"1","contextmenu":"1","custom_plugin":"","custom_button":""},"1":{"access":["6","2"],"skin":"0","skin_admin":"0","mobile":"0","drag_drop":"1","path":"","entity_encoding":"raw","lang_mode":"1","text_direction":"ltr","content_css":"1","content_css_custom":"","relative_urls":"1","newlines":"0","use_config_textfilters":"0","invalid_elements":"script,applet,iframe","valid_elements":"","extended_elements":"","resizing":"1","resize_horizontal":"1","element_path":"1","wordcount":"1","image_advtab":"0","advlist":"1","autosave":"1","contextmenu":"1","custom_plugin":"","custom_button":""},"0":{"access":["7","4","8"],"skin":"0","skin_admin":"0","mobile":"0","drag_drop":"1","path":"","entity_encoding":"raw","lang_mode":"1","text_direction":"ltr","content_css":"1","content_css_custom":"","relative_urls":"1","newlines":"0","use_config_textfilters":"0","invalid_elements":"script,applet,iframe","valid_elements":"","extended_elements":"","resizing":"1","resize_horizontal":"1","element_path":"1","wordcount":"1","image_advtab":"1","advlist":"1","autosave":"1","contextmenu":"1","custom_plugin":"","custom_button":""}}},"sets_amount":3,"html_height":"550","html_width":"750"}', '', 3, 0), +(0, 'plg_editors-xtd_achecker', 'plugin', 'achecker', 'editors-xtd', 0, 1, 1, 0, 1, '', '', '', 5, 0), (0, 'plg_editors-xtd_article', 'plugin', 'article', 'editors-xtd', 0, 1, 1, 0, 1, '', '', '', 1, 0), (0, 'plg_editors-xtd_image', 'plugin', 'image', 'editors-xtd', 0, 1, 1, 0, 1, '', '', '', 2, 0), (0, 'plg_editors-xtd_pagebreak', 'plugin', 'pagebreak', 'editors-xtd', 0, 1, 1, 0, 1, '', '', '', 3, 0), @@ -362,7 +363,8 @@ INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, (0, 'plg_system_webauthn', 'plugin', 'webauthn', 'system', 0, 1, 1, 0, 1, '', '{}', '', 0, 0), (0, 'plg_workflow_publishing', 'plugin', 'publishing', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 0, 0), (0, 'plg_workflow_featuring', 'plugin', 'featuring', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 0, 0), -(0, 'plg_workflow_notification', 'plugin', 'notification', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 0, 0); +(0, 'plg_workflow_notification', 'plugin', 'notification', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 0, 0), +(0, 'plg_system_achecker', 'plugin', 'achecker', 'system', 1, 1, 1, 0, 1, '', '', '', 0, 0); -- Templates INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`) VALUES diff --git a/installation/sql/postgresql/base.sql b/installation/sql/postgresql/base.sql index efbdc57eb826b..71f8d97c95e31 100644 --- a/installation/sql/postgresql/base.sql +++ b/installation/sql/postgresql/base.sql @@ -255,6 +255,7 @@ INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", (0, 'plg_editors_codemirror', 'plugin', 'codemirror', 'editors', 0, 1, 1, 0, 1, '', '{"lineNumbers":"1","lineWrapping":"1","matchTags":"1","matchBrackets":"1","marker-gutter":"1","autoCloseTags":"1","autoCloseBrackets":"1","autoFocus":"1","theme":"default","tabmode":"indent"}', '', 1, 0), (0, 'plg_editors_none', 'plugin', 'none', 'editors', 0, 1, 1, 1, 1, '', '', '', 2, 0), (0, 'plg_editors_tinymce', 'plugin', 'tinymce', 'editors', 0, 1, 1, 0, 1, '', '{"configuration":{"toolbars":{"2":{"toolbar1":["bold","underline","strikethrough","|","undo","redo","|","bullist","numlist","|","pastetext"]},"1":{"menu":["edit","insert","view","format","table","tools"],"toolbar1":["bold","italic","underline","strikethrough","|","alignleft","aligncenter","alignright","alignjustify","|","formatselect","|","bullist","numlist","|","outdent","indent","|","undo","redo","|","link","unlink","anchor","code","|","hr","table","|","subscript","superscript","|","charmap","pastetext","preview"]},"0":{"menu":["edit","insert","view","format","table","tools"],"toolbar1":["bold","italic","underline","strikethrough","|","alignleft","aligncenter","alignright","alignjustify","|","styleselect","|","formatselect","fontselect","fontsizeselect","|","searchreplace","|","bullist","numlist","|","outdent","indent","|","undo","redo","|","link","unlink","anchor","image","|","code","|","forecolor","backcolor","|","fullscreen","|","table","|","subscript","superscript","|","charmap","emoticons","media","hr","ltr","rtl","|","cut","copy","paste","pastetext","|","visualchars","visualblocks","nonbreaking","blockquote","template","|","print","preview","codesample","insertdatetime","removeformat"]}},"setoptions":{"2":{"access":["1"],"skin":"0","skin_admin":"0","mobile":"0","drag_drop":"1","path":"","entity_encoding":"raw","lang_mode":"1","text_direction":"ltr","content_css":"1","content_css_custom":"","relative_urls":"1","newlines":"0","use_config_textfilters":"0","invalid_elements":"script,applet,iframe","valid_elements":"","extended_elements":"","resizing":"1","resize_horizontal":"1","element_path":"1","wordcount":"1","image_advtab":"0","advlist":"1","autosave":"1","contextmenu":"1","custom_plugin":"","custom_button":""},"1":{"access":["6","2"],"skin":"0","skin_admin":"0","mobile":"0","drag_drop":"1","path":"","entity_encoding":"raw","lang_mode":"1","text_direction":"ltr","content_css":"1","content_css_custom":"","relative_urls":"1","newlines":"0","use_config_textfilters":"0","invalid_elements":"script,applet,iframe","valid_elements":"","extended_elements":"","resizing":"1","resize_horizontal":"1","element_path":"1","wordcount":"1","image_advtab":"0","advlist":"1","autosave":"1","contextmenu":"1","custom_plugin":"","custom_button":""},"0":{"access":["7","4","8"],"skin":"0","skin_admin":"0","mobile":"0","drag_drop":"1","path":"","entity_encoding":"raw","lang_mode":"1","text_direction":"ltr","content_css":"1","content_css_custom":"","relative_urls":"1","newlines":"0","use_config_textfilters":"0","invalid_elements":"script,applet,iframe","valid_elements":"","extended_elements":"","resizing":"1","resize_horizontal":"1","element_path":"1","wordcount":"1","image_advtab":"1","advlist":"1","autosave":"1","contextmenu":"1","custom_plugin":"","custom_button":""}}},"sets_amount":3,"html_height":"550","html_width":"750"}', '', 3, 0), +(0, 'plg_editors-xtd_achecker', 'plugin', 'achecker', 'editors-xtd', 0, 1, 1, 0, 1, '', '', '', 5, 0), (0, 'plg_editors-xtd_article', 'plugin', 'article', 'editors-xtd', 0, 1, 1, 0, 1, '', '', '', 1, 0), (0, 'plg_editors-xtd_image', 'plugin', 'image', 'editors-xtd', 0, 1, 1, 0, 1, '', '', '', 2, 0), (0, 'plg_editors-xtd_pagebreak', 'plugin', 'pagebreak', 'editors-xtd', 0, 1, 1, 0, 1, '', '', '', 3, 0), @@ -368,7 +369,8 @@ INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", (0, 'plg_system_webauthn', 'plugin', 'webauthn', 'system', 0, 1, 1, 0, 1, '', '{}', '', 0, 0), (0, 'plg_workflow_publishing', 'plugin', 'publishing', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 0, 0), (0, 'plg_workflow_featuring', 'plugin', 'featuring', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 0, 0), -(0, 'plg_workflow_notification', 'plugin', 'notification', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 0, 0); +(0, 'plg_workflow_notification', 'plugin', 'notification', 'workflow', 0, 1, 1, 0, 1, '', '{}', '', 0, 0), +(0, 'plg_system_achecker', 'plugin', 'achecker', 'system', 1, 1, 1, 0, 1, '', '', '', 0, 0); -- Templates INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") VALUES diff --git a/libraries/src/Extension/ExtensionHelper.php b/libraries/src/Extension/ExtensionHelper.php index 7608645feb041..e4eebb698d3e8 100644 --- a/libraries/src/Extension/ExtensionHelper.php +++ b/libraries/src/Extension/ExtensionHelper.php @@ -194,6 +194,7 @@ class ExtensionHelper array('plugin', 'tinymce', 'editors', 0), // Core plugin extensions - editors xtd + array('plugin', 'achecker', 'editors-xtd', 0), array('plugin', 'article', 'editors-xtd', 0), array('plugin', 'contact', 'editors-xtd', 0), array('plugin', 'fields', 'editors-xtd', 0), @@ -270,6 +271,7 @@ class ExtensionHelper // Core plugin extensions - system array('plugin', 'accessibility', 'system', 0), + array('plugin', 'achecker', 'system', 0), array('plugin', 'actionlogs', 'system', 0), array('plugin', 'cache', 'system', 0), array('plugin', 'debug', 'system', 0), diff --git a/package-lock.json b/package-lock.json index 665f72c5849b8..f1ea1dfdefdb0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7490,6 +7490,11 @@ "integrity": "sha512-1qYz89hW3lFDEazhjW0yVAV87lw8lVkrJocr72XmBkMKsoSVJCQx3W8BXsC7hO2qAt8BoVjYjtAcZ9perqGnNg==", "dev": true }, + "html_codesniffer": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/html_codesniffer/-/html_codesniffer-2.5.1.tgz", + "integrity": "sha512-vcz0yAaX/OaV6sdNHuT9alBOKkSxYb8h5Yq26dUqgi7XmCgGUSa7U9PiY1PBXQFMjKv1wVPs5/QzHlGuxPDUGg==" + }, "htmlescape": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz", diff --git a/package.json b/package.json index 29c3c794f19a4..7ccf3666d51db 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "dragula": "3.7.2", "file-saver": "^2.0.2", "focus-visible": "^5.1.0", + "html_codesniffer": "^2.5.1", "joomla-ui-custom-elements": "0.0.38", "jquery": "^3.5", "jquery-migrate": "^3.3.1", diff --git a/plugins/editors-xtd/achecker/achecker.php b/plugins/editors-xtd/achecker/achecker.php new file mode 100644 index 0000000000000..040ec14001094 --- /dev/null +++ b/plugins/editors-xtd/achecker/achecker.php @@ -0,0 +1,76 @@ +app->getDocument(); + $doc->getWebAssetManager() + ->useScript('html_codesniffer') + ->useStyle('html_codesniffer') + ->addInlineScript( + 'button.addEventListener("achecker", function() {HTMLCSAuditor.run(\'WCAG2AA\', null);});', + ['name' => 'inline.plg.system.achecker'], + ['type' => 'module'], + ['html_codesniffer'] + ); + + $button = new CMSObject; + $button->modal = false; + $button->text = Text::_('PLG_EDITORS-XTD_ACHECKER_BUTTON_ACCESSIBILITY'); + $button->name = 'accessible'; + $button->iconSVG = ''; + $button->onclick = 'achecker'; + return $button; + } +} diff --git a/plugins/editors-xtd/achecker/achecker.xml b/plugins/editors-xtd/achecker/achecker.xml new file mode 100644 index 0000000000000..07f7219bab1e6 --- /dev/null +++ b/plugins/editors-xtd/achecker/achecker.xml @@ -0,0 +1,19 @@ + + + plg_editors-xtd_achecker + Joomla! Project + October 2020 + Copyright (C) 2005 - 2020 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 4.0.0 + PLG_EDITORS-XTD_ACHECKER_XML_DESCRIPTION + + achecker.php + + + plg_editors-xtd_achecker.ini + plg_editors-xtd_achecker.sys.ini + + diff --git a/plugins/system/achecker/achecker.php b/plugins/system/achecker/achecker.php new file mode 100644 index 0000000000000..6422467b5576f --- /dev/null +++ b/plugins/system/achecker/achecker.php @@ -0,0 +1,72 @@ +app->isClient('site')) + { + return; + } + + // Thiis plugin is for html only + $document = $this->app->getDocument(); + + if ($document->getType() !== 'html') + { + return; + } + + $document->getWebAssetManager() + ->useScript('html_codesniffer') + ->useStyle('html_codesniffer') + ->addInlineScript( + 'window.addEventListener("load", function() {HTMLCSAuditor.run(\'WCAG2AA\', null);});', + ['name' => 'inline.plg.system.achecker'], + ['type' => 'module'], + ['html_codesniffer'] + ); + } +} diff --git a/plugins/system/achecker/achecker.xml b/plugins/system/achecker/achecker.xml new file mode 100644 index 0000000000000..d5f617dea7a36 --- /dev/null +++ b/plugins/system/achecker/achecker.xml @@ -0,0 +1,19 @@ + + + plg_system_achecker + Joomla! Project + 2020-19-13 + (C) 2005 - 2020 Open Source Matters. All rights reserved. + GNU General Public License version 2 or later; see LICENSE.txt + admin@joomla.org + www.joomla.org + 4.0.0 + PLG_SYSTEM_ACHECKER_XML_DESCRIPTION + + achecker.php + + + language/en-GB/plg_system_achecker.ini + language/en-GB/plg_system_achecker.sys.ini + +