Skip to content
Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions administrator/language/en-GB/plg_system_accessibility.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion build/build-modules-js/init/minify-vendor.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];
Expand Down
5 changes: 3 additions & 2 deletions build/build-modules-js/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
28 changes: 25 additions & 3 deletions plugins/system/accessibility/accessibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,19 @@ public function onBeforeCompileHead()
// Detect the current active language
$lang = Factory::getLanguage()->getTag();

//detect the position
$position = $this->params->get('position');

if ($direction == 'right') {
if ($position == 'top_right' || $position == 'bottom_right') {
$position = preg_replace('/_.*/', '', $position);
$position = $position . '_left';
} else {
$position = preg_replace('/_.*/', '', $position);
$position = $position . '_right';
}
}

/**
* Add strings for translations in Javascript.
* Reference https://ranbuch.github.io/accessibility/
Expand All @@ -90,10 +103,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',
],
Expand All @@ -104,8 +124,10 @@ public function onBeforeCompileHead()
'enabled' => true,
'helpTitles' => true,
],
'textToSpeechLang' => [$lang],
'speechToTextLang' => [$lang],
'language' => [
'textToSpeechLang' => $lang,
'speechToTextLang' => $lang
]
]
);

Expand Down
12 changes: 12 additions & 0 deletions plugins/system/accessibility/accessibility.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@
<option value="true">PLG_SYSTEM_ACCESSIBILITY_EMOJIS_TRUE</option>
<option value="false">PLG_SYSTEM_ACCESSIBILITY_EMOJIS_FALSE</option>
</field>
<field
name="position"
type="list"
label="PLG_SYSTEM_ACCESSIBILITY_POSITION"
default="bottom_left"
validate="options"
>
<option value="bottom_left">PLG_SYSTEM_ACCESSIBILITY_POSITION_BOTTOM_LEFT</option>
<option value="bottom_right">PLG_SYSTEM_ACCESSIBILITY_POSITION_BOTTOM_RIGHT</option>
<option value="top_left">PLG_SYSTEM_ACCESSIBILITY_POSITION_TOP_LEFT</option>
<option value="top_right">PLG_SYSTEM_ACCESSIBILITY_POSITION_TOP_RIGHT</option>
</field>
</fieldset>
</fields>
</config>
Expand Down