Skip to content

Commit

Permalink
[4.1] Joomla-Accessibility Checker (jooa11y). (joomla#36190)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>

* 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 18199dd"

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 378a64e.

* 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 <[email protected]>
Co-authored-by: Harald Leithner <[email protected]>
Co-authored-by: dgrammatiko <[email protected]>
Co-authored-by: Dimitris Grammatikogiannis <[email protected]>
Co-authored-by: Benjamin Trenkle <[email protected]>
Co-authored-by: Fedir Zinchuk <[email protected]>
  • Loading branch information
7 people authored Dec 29, 2021
1 parent 9a5a778 commit 1a32b68
Show file tree
Hide file tree
Showing 21 changed files with 5,687 additions and 4,600 deletions.
Original file line number Diff line number Diff line change
@@ -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);
Original file line number Diff line number Diff line change
@@ -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);
16 changes: 10 additions & 6 deletions administrator/components/com_content/src/View/Article/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
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;
Expand Down Expand Up @@ -213,16 +214,19 @@ function (Toolbar $childBar) use ($checkedOut, $itemEditable, $canDo, $user)
$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')
Expand Down
1 change: 1 addition & 0 deletions administrator/language/en-GB/joomla.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
169 changes: 169 additions & 0 deletions administrator/language/en-GB/plg_system_jooa11y.ini

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions administrator/language/en-GB/plg_system_jooa11y.sys.ini
Original file line number Diff line number Diff line change
@@ -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."
1 change: 1 addition & 0 deletions api/language/en-GB/joomla.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 0 additions & 1 deletion build/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
// Vue
"plugin:vue/vue3-recommended"
],
"parser": "vue-eslint-parser",
"parserOptions": {
"sourceType": "module"
},
Expand Down
4 changes: 4 additions & 0 deletions build/build-modules-js/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
37 changes: 37 additions & 0 deletions build/media_source/plg_system_jooa11y/joomla.asset.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
17 changes: 17 additions & 0 deletions build/media_source/plg_system_jooa11y/js/jooa11y.es6.js
Original file line number Diff line number Diff line change
@@ -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();
});
1 change: 1 addition & 0 deletions build/media_source/plg_system_jooa11y/scss/jooa11y.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@import "node_modules/joomla-a11y-checker/dist/css/joomla-a11y-checker";
39 changes: 20 additions & 19 deletions installation/sql/mysql/base.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
39 changes: 20 additions & 19 deletions installation/sql/postgresql/base.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
1 change: 1 addition & 0 deletions language/en-GB/joomla.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
32 changes: 32 additions & 0 deletions libraries/src/Toolbar/CoreButtonsTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,38 @@ public function preview(string $url, string $text = 'JGLOBAL_PREVIEW', $newWindo
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).
*
Expand Down
21 changes: 21 additions & 0 deletions libraries/src/Toolbar/ToolbarHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,27 @@ public static function preview($url = '', $updateEditors = false, $icon = 'previ
$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).
*
Expand Down
Loading

0 comments on commit 1a32b68

Please sign in to comment.