diff --git a/administrator/language/en-GB/plg_system_accessibility.ini b/administrator/language/en-GB/plg_system_accessibility.ini index 3f96fc6e19d61..ab33e9f8e9585 100644 --- a/administrator/language/en-GB/plg_system_accessibility.ini +++ b/administrator/language/en-GB/plg_system_accessibility.ini @@ -6,16 +6,24 @@ PLG_SYSTEM_ACCESSIBILITY="System - Additional Accessibility Features" PLG_SYSTEM_ACCESSIBILITY_CLOSE="Close" PLG_SYSTEM_ACCESSIBILITY_CURSOR="Big Cursor" +PLG_SYSTEM_ACCESSIBILITY_DECREASE_LINE_HEIGHT="Decrease Line Height" PLG_SYSTEM_ACCESSIBILITY_DECREASE_SPACING="Decrease Text Spacing" PLG_SYSTEM_ACCESSIBILITY_DECREASE_TEXT="Decrease Text Size" +PLG_SYSTEM_ACCESSIBILITY_DISABLE_ANIMATIONS="Disable Animations" PLG_SYSTEM_ACCESSIBILITY_EMOJIS="Icons" PLG_SYSTEM_ACCESSIBILITY_EMOJIS_FALSE="Use Google Material Font" PLG_SYSTEM_ACCESSIBILITY_EMOJIS_TRUE="Use Emojis" PLG_SYSTEM_ACCESSIBILITY_GREY="Grey Hues" +PLG_SYSTEM_ACCESSIBILITY_INCREASE_LINE_HEIGHT="Increase Line Height" PLG_SYSTEM_ACCESSIBILITY_INCREASE_SPACING="Increase Text Spacing" PLG_SYSTEM_ACCESSIBILITY_INCREASE_TEXT="Increase Text Size" PLG_SYSTEM_ACCESSIBILITY_INVERT_COLORS="Invert Colours" PLG_SYSTEM_ACCESSIBILITY_MENU_TITLE="Accessibility Options" +PLG_SYSTEM_ACCESSIBILITY_POSITION="Position" +PLG_SYSTEM_ACCESSIBILITY_POSITION_BOTTOM_LEFT="Bottom Left" +PLG_SYSTEM_ACCESSIBILITY_POSITION_BOTTOM_RIGHT="Bottom Right" +PLG_SYSTEM_ACCESSIBILITY_POSITION_TOP_LEFT="Top Left" +PLG_SYSTEM_ACCESSIBILITY_POSITION_TOP_RIGHT="Top Right" PLG_SYSTEM_ACCESSIBILITY_READING="Reading Guide" PLG_SYSTEM_ACCESSIBILITY_RESET="Reset" PLG_SYSTEM_ACCESSIBILITY_SECTION="Site Section" diff --git a/build/build-modules-js/init/minify-vendor.es6.js b/build/build-modules-js/init/minify-vendor.es6.js index 1825228b02aab..fbeb0c2119c25 100644 --- a/build/build-modules-js/init/minify-vendor.es6.js +++ b/build/build-modules-js/init/minify-vendor.es6.js @@ -19,11 +19,11 @@ const folders = [ let allFiles = []; const noMinified = [ - 'accessibility.min.js', 'short-and-sweet.min.js', ]; const alreadyMinified = [ + 'media/vendor/accessibility/js/main.bundle.js', 'media/vendor/webcomponentsjs/js/webcomponents-bundle.js', 'media/vendor/debugbar/vendor/highlightjs/highlight.pack.js', ]; diff --git a/build/build-modules-js/settings.json b/build/build-modules-js/settings.json index dec47f07cb27b..844d409401aed 100644 --- a/build/build-modules-js/settings.json +++ b/build/build-modules-js/settings.json @@ -667,13 +667,14 @@ "name": "accessibility", "licenseFilename": "LICENSE", "js": { - "dist/accessibility.min.js": "js/accessibility.min.js" + "dist/main.bundle.js": "js/main.bundle.js", + "dist/main.bundle.js.map": "js/main.bundle.js.map" }, "provideAssets": [ { "name": "accessibility", "type": "script", - "uri": "accessibility.min.js", + "uri": "main.bundle.js", "attributes": { "defer": true } diff --git a/installation/sql/mysql/base.sql b/installation/sql/mysql/base.sql index a6d0885b6cf1c..94143224d36b8 100644 --- a/installation/sql/mysql/base.sql +++ b/installation/sql/mysql/base.sql @@ -326,7 +326,7 @@ INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, (0, 'plg_quickicon_phpversioncheck', 'plugin', 'phpversioncheck', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 6, 0), (0, 'plg_sampledata_blog', 'plugin', 'blog', 'sampledata', 0, 1, 1, 0, 1, '', '', '', 1, 0), (0, 'plg_sampledata_multilang', 'plugin', 'multilang', 'sampledata', 0, 1, 1, 0, 1, '', '', '', 2, 0), -(0, 'plg_system_accessibility', 'plugin', 'accessibility', 'system', 0, 0, 1, 0, 1, '', '{}', '', 1, 0), +(0, 'plg_system_accessibility', 'plugin', 'accessibility', 'system', 0, 0, 1, 0, 1, '', '{"section":"administrator","useEmojis":"true","position":"bottom_left"}', '', 1, 0), (0, 'plg_system_actionlogs', 'plugin', 'actionlogs', 'system', 0, 1, 1, 0, 1, '', '{}', '', 2, 0), (0, 'plg_system_cache', 'plugin', 'cache', 'system', 0, 0, 1, 0, 1, '', '{"browsercache":"0","cachetime":"15"}', '', 3, 0), (0, 'plg_system_debug', 'plugin', 'debug', 'system', 0, 1, 1, 0, 1, '', '{"profile":"1","queries":"1","memory":"1","language_files":"1","language_strings":"1","strip-first":"1","strip-prefix":"","strip-suffix":""}', '', 4, 0), diff --git a/installation/sql/postgresql/base.sql b/installation/sql/postgresql/base.sql index fec3f4a14b4fa..c56d5fe3bc952 100644 --- a/installation/sql/postgresql/base.sql +++ b/installation/sql/postgresql/base.sql @@ -332,7 +332,7 @@ INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", (0, 'plg_quickicon_phpversioncheck', 'plugin', 'phpversioncheck', 'quickicon', 0, 1, 1, 0, 1, '', '', '', 6, 0), (0, 'plg_sampledata_blog', 'plugin', 'blog', 'sampledata', 0, 1, 1, 0, 1, '', '', '', 1, 0), (0, 'plg_sampledata_multilang', 'plugin', 'multilang', 'sampledata', 0, 1, 1, 0, 1, '', '', '', 2, 0), -(0, 'plg_system_accessibility', 'plugin', 'accessibility', 'system', 0, 0, 1, 0, 1, '', '{}', '', 1, 0), +(0, 'plg_system_accessibility', 'plugin', 'accessibility', 'system', 0, 0, 1, 0, 1, '', '{"section":"administrator","useEmojis":"true","position":"bottom_left"}', '', 1, 0), (0, 'plg_system_actionlogs', 'plugin', 'actionlogs', 'system', 0, 1, 1, 0, 1, '', '{}', '', 2, 0), (0, 'plg_system_cache', 'plugin', 'cache', 'system', 0, 0, 1, 0, 1, '', '{"browsercache":"0","cachetime":"15"}', '', 3, 0), (0, 'plg_system_debug', 'plugin', 'debug', 'system', 0, 1, 1, 0, 1, '', '{"profile":"1","queries":"1","memory":"1","language_files":"1","language_strings":"1","strip-first":"1","strip-prefix":"","strip-suffix":""}', '', 4, 0), diff --git a/package-lock.json b/package-lock.json index e1785cb6e3baf..fd8400d226ae8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@joomla/joomla-a11y-checker": "^1.0.0", "@popperjs/core": "^2.11.0", "@webcomponents/webcomponentsjs": "^2.6.0", - "accessibility": "^3.0.14", + "accessibility": "^4.5.3", "awesomplete": "^1.1.5", "bootstrap": "~5.1.3", "choices.js": "^9.0.1", @@ -2339,9 +2339,9 @@ "integrity": "sha512-j161Z9oiy8k74vchdrQGihfSp7QulrTclCUiPo0D7JF6/RjpXAmB0ThlTAFlSElkgqg0vdFgNAXaX9ZHZy25wQ==" }, "node_modules/accessibility": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/accessibility/-/accessibility-3.0.17.tgz", - "integrity": "sha512-rQx2I1FE4Vd4Ejzd/PvXkSFYqQ0agUa26m9iSXcDkbQUmR81J7De/EmjYCh7dfcMVKbII1fsA7weQI4yJrE5QA==" + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/accessibility/-/accessibility-4.5.3.tgz", + "integrity": "sha512-wxZSw6amThBS1hWVhs0LPUwEHsmGbochciBZ9UTgQtb7Cf7Qj4UcF6iI9Am6aMG62Of9444fylCU/aakOAI3Zg==" }, "node_modules/acorn": { "version": "8.8.0", @@ -11073,9 +11073,9 @@ "integrity": "sha512-j161Z9oiy8k74vchdrQGihfSp7QulrTclCUiPo0D7JF6/RjpXAmB0ThlTAFlSElkgqg0vdFgNAXaX9ZHZy25wQ==" }, "accessibility": { - "version": "3.0.17", - "resolved": "https://registry.npmjs.org/accessibility/-/accessibility-3.0.17.tgz", - "integrity": "sha512-rQx2I1FE4Vd4Ejzd/PvXkSFYqQ0agUa26m9iSXcDkbQUmR81J7De/EmjYCh7dfcMVKbII1fsA7weQI4yJrE5QA==" + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/accessibility/-/accessibility-4.5.3.tgz", + "integrity": "sha512-wxZSw6amThBS1hWVhs0LPUwEHsmGbochciBZ9UTgQtb7Cf7Qj4UcF6iI9Am6aMG62Of9444fylCU/aakOAI3Zg==" }, "acorn": { "version": "8.8.0", diff --git a/package.json b/package.json index 02af4dd925789..86673e1a3b0a5 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@joomla/joomla-a11y-checker": "^1.0.0", "@popperjs/core": "^2.11.0", "@webcomponents/webcomponentsjs": "^2.6.0", - "accessibility": "^3.0.14", + "accessibility": "^4.5.3", "awesomplete": "^1.1.5", "bootstrap": "~5.1.3", "choices.js": "^9.0.1", diff --git a/plugins/system/accessibility/accessibility.php b/plugins/system/accessibility/accessibility.php index 8e518ee5f9ed1..14a25f2cad873 100644 --- a/plugins/system/accessibility/accessibility.php +++ b/plugins/system/accessibility/accessibility.php @@ -68,6 +68,9 @@ public function onBeforeCompileHead() // Detect the current active language $lang = Factory::getLanguage()->getTag(); + //detect the position + $position = $this->params->get('position', 'bottom_left'); + /** * Add strings for translations in Javascript. * Reference https://ranbuch.github.io/accessibility/ @@ -90,10 +93,17 @@ public function onBeforeCompileHead() 'speechToText' => Text::_('PLG_SYSTEM_ACCESSIBILITY_STT'), 'resetTitle' => Text::_('PLG_SYSTEM_ACCESSIBILITY_RESET'), 'closeTitle' => Text::_('PLG_SYSTEM_ACCESSIBILITY_CLOSE'), + 'disableAnimations' => Text::_('PLG_SYSTEM_ACCESSIBILITY_DISABLE_ANIMATIONS'), + 'increaseLineHeight' => Text::_('PLG_SYSTEM_ACCESSIBILITY_INCREASE_LINE_HEIGHT'), + 'decreaseLineHeight' => Text::_('PLG_SYSTEM_ACCESSIBILITY_DECREASE_LINE_HEIGHT') ], 'icon' => [ 'position' => [ - $direction => [ + (($position == 'top_right') || ($position == 'top_left')) ? 'top' : 'bottom' => [ + 'size' => '50', + 'units' => 'px', + ], + (($position == 'top_right') || ($position == 'bottom_right')) ? 'right' : 'left' => [ 'size' => '0', 'units' => 'px', ], @@ -104,8 +114,10 @@ public function onBeforeCompileHead() 'enabled' => true, 'helpTitles' => true, ], - 'textToSpeechLang' => [$lang], - 'speechToTextLang' => [$lang], + 'language' => [ + 'textToSpeechLang' => $lang, + 'speechToTextLang' => $lang + ] ] ); diff --git a/plugins/system/accessibility/accessibility.xml b/plugins/system/accessibility/accessibility.xml index 2df632e26cbc9..dbba37a265e6c 100644 --- a/plugins/system/accessibility/accessibility.xml +++ b/plugins/system/accessibility/accessibility.xml @@ -40,6 +40,18 @@ + + + + + +