diff --git a/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-03-09.sql b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-03-09.sql new file mode 100644 index 0000000000000..fc86f2c8f2b57 --- /dev/null +++ b/administrator/components/com_admin/sql/updates/mysql/4.0.0-2019-03-09.sql @@ -0,0 +1,2 @@ +INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `manifest_cache`, `params`, `checked_out`, `checked_out_time`, `ordering`, `state`) VALUES +(496, 0, 'plg_system_skipto', 'plugin', 'skipto', 'system', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0), diff --git a/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-09.sql b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-09.sql new file mode 100644 index 0000000000000..63e91294ec52e --- /dev/null +++ b/administrator/components/com_admin/sql/updates/postgresql/4.0.0-2019-03-09.sql @@ -0,0 +1,2 @@ +INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "manifest_cache", "params", "checked_out", "checked_out_time", "ordering", "state") VALUES +(496, 0, 'plg_system_skipto', 'plugin', 'skipto', 'system', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0), diff --git a/administrator/language/en-GB/en-GB.plg_system_skipto.ini b/administrator/language/en-GB/en-GB.plg_system_skipto.ini new file mode 100644 index 0000000000000..de56fdff67456 --- /dev/null +++ b/administrator/language/en-GB/en-GB.plg_system_skipto.ini @@ -0,0 +1,16 @@ +; Joomla! Project +; Copyright (C) 2005 - 2019 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_SKIPTO="System - Skip-To Navigation" +PLG_SYSTEM_SKIPTO_CONTENT="Content" +PLG_SYSTEM_SKIPTO_PAGE_OUTLINE="Page Outline" +PLG_SYSTEM_SKIPTO_SECTION="Site Section" +PLG_SYSTEM_SKIPTO_SECTION_ADMIN="Administrator (Backend)" +PLG_SYSTEM_SKIPTO_SECTION_BOTH="Both" +PLG_SYSTEM_SKIPTO_SECTION_SITE="Site (Frontend)" +PLG_SYSTEM_SKIPTO_SKIP_TO="Skip To" +PLG_SYSTEM_SKIPTO_SKIP_TO_AND_PAGE_OUTLINE="Skip To and Page Outline" +PLG_SYSTEM_SKIPTO_SKIP_TO_KEYBOARD="Skip To Keyboard Navigation" +PLG_SYSTEM_SKIPTO_XML_DESCRIPTION="The plugin creates a dropdown menu consisting of the links to the important places on a given web page. This makes it easier for keyboard and screen reader users to quickly jump to the desired location by simply choosing it from the list of options." diff --git a/administrator/language/en-GB/en-GB.plg_system_skipto.sys.ini b/administrator/language/en-GB/en-GB.plg_system_skipto.sys.ini new file mode 100644 index 0000000000000..e089881a56635 --- /dev/null +++ b/administrator/language/en-GB/en-GB.plg_system_skipto.sys.ini @@ -0,0 +1,7 @@ +; Joomla! Project +; Copyright (C) 2005 - 2019 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_SKIPTO="System - Skip-To Navigation" +PLG_SYSTEM_SKIPTO_XML_DESCRIPTION="The plugin creates a dropdown menu consisting of the links to the important places on a given web page. This makes it easier for keyboard and screen reader users to quickly jump to the desired location by simply choosing it from the list of options." diff --git a/build/build-modules-js/settings.json b/build/build-modules-js/settings.json index 994b0885b7da0..af6ca3c2fdc8b 100644 --- a/build/build-modules-js/settings.json +++ b/build/build-modules-js/settings.json @@ -372,6 +372,17 @@ "dist/metismenujs.min.js": "js/metismenujs.min.js", "dist/metismenujs.min.js.map": "js/metismenujs.min.js.map" } + }, + "skipto": { + "name": "skipto", + "licenseFilename": "LICENSE.md", + "js": { + "src/js/skipTo.js": "js/skipTo.js", + "src/js/dropMenu.js": "js/dropMenu.js" + }, + "css": { + "src/css/SkipTo.css": "css/SkipTo.css" + } } }, "errorPages": { diff --git a/installation/sql/mysql/joomla.sql b/installation/sql/mysql/joomla.sql index 85bc46ceba93e..707c74923f2a8 100644 --- a/installation/sql/mysql/joomla.sql +++ b/installation/sql/mysql/joomla.sql @@ -684,6 +684,7 @@ INSERT INTO `#__extensions` (`extension_id`, `package_id`, `name`, `type`, `elem (494, 0, 'plg_extension_finder', 'plugin', 'finder', 'extension', 0, 1, 1, 0, '', '', 0, '0000-00-00 00:00:00', 0, 0), (495, 0, 'plg_api-authentication_basic', 'plugin', 'basic', 'api-authentication', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0), (496, 0, 'plg_webservices_content', 'plugin', 'content', 'webservices', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0), +(497, 0, 'plg_system_skipto', 'plugin', 'skipto', 'system', 0, 1, 1, 0, '', '{}', 0, '0000-00-00 00:00:00', 0, 0), (509, 0, 'atum', 'template', 'atum', '', 1, 1, 1, 0, '', '', 0, '0000-00-00 00:00:00', 0, 0), (510, 0, 'cassiopeia', 'template', 'cassiopeia', '', 0, 1, 1, 0, '', '{"logoFile":"","fluidContainer":"0","sidebarLeftWidth":"3","sidebarRightWidth":"3"}', 0, '0000-00-00 00:00:00', 0, 0), (600, 802, 'English (en-GB)', 'language', 'en-GB', '', 0, 1, 1, 1, '', '', 0, '0000-00-00 00:00:00', 0, 0), diff --git a/installation/sql/postgresql/joomla.sql b/installation/sql/postgresql/joomla.sql index d0ab155e77ce4..8412f7251cc74 100644 --- a/installation/sql/postgresql/joomla.sql +++ b/installation/sql/postgresql/joomla.sql @@ -693,6 +693,7 @@ INSERT INTO "#__extensions" ("extension_id", "package_id", "name", "type", "elem (494, 0, 'plg_extension_finder', 'plugin', 'finder', 'extension', 0, 1, 1, 0, '', '', 0, '1970-01-01 00:00:00', 0, 0), (495, 0, 'plg_api-authentication_basic', 'plugin', 'basic', 'api-authentication', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0), (496, 0, 'plg_webservices_content', 'plugin', 'content', 'webservices', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0), +(497, 0, 'plg_system_skipto', 'plugin', 'skipto', 'system', 0, 1, 1, 0, '', '{}', 0, '1970-01-01 00:00:00', 0, 0), (509, 0, 'atum', 'template', 'atum', '', 1, 1, 1, 0, '', '', 0, '1970-01-01 00:00:00', 0, 0), (510, 0, 'cassiopeia', 'template', 'cassiopeia', '', 0, 1, 1, 0, '', '{"logoFile":"","fluidContainer":"0","sidebarLeftWidth":"3","sidebarRightWidth":"3"}', 0, '1970-01-01 00:00:00', 0, 0), (600, 802, 'English (en-GB)', 'language', 'en-GB', '', 0, 1, 1, 1, '', '', 0, '1970-01-01 00:00:00', 0, 0), diff --git a/package.json b/package.json index 152911d1a812d..744feeed48186 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "metismenujs": "^1.0.3", "popper.js": "^1.14.3", "punycode": "1.4.1", + "skipto": "^2.0.3", "tinymce": "4.8.3" }, "devDependencies": { diff --git a/plugins/system/skipto/skipto.php b/plugins/system/skipto/skipto.php new file mode 100644 index 0000000000000..601c49e34b793 --- /dev/null +++ b/plugins/system/skipto/skipto.php @@ -0,0 +1,108 @@ +params->get('section_skipto', 2); + $current_section = 0; + + try + { + $app = $this->app; + + if ($this->app->isClient('administrator')) + { + $current_section = 2; + } + elseif ($this->app->isClient('site')) + { + $current_section = 1; + } + } + catch (Exception $exc) + { + $current_section = 0; + } + + if (!($current_section && $section)) + { + return; + } + + // TODO remove this line when bug is fixed + $this->loadLanguage(); + + // Get the document object. + $document = $this->app->getDocument(); + + // Add strings for translations in Javascript. + $document->addScriptOptions( + 'skipto-settings', + [ + 'settings' => [ + 'skipTo' => [ + 'buttonDivRole' => 'navigation', + 'buttonDivLabel' => Text::_('PLG_SYSTEM_SKIPTO_SKIP_TO_KEYBOARD'), + 'buttonLabel' => Text::_('PLG_SYSTEM_SKIPTO_SKIP_TO'), + 'buttonDivTitle' => '', + 'menuLabel' => Text::_('PLG_SYSTEM_SKIPTO_SKIP_TO_AND_PAGE_OUTLINE'), + 'landmarksLabel' => Text::_('PLG_SYSTEM_SKIPTO_SKIP_TO'), + 'headingsLabel' => Text::_('PLG_SYSTEM_SKIPTO_PAGE_OUTLINE'), + 'contentLabel' => Text::_('PLG_SYSTEM_SKIPTO_CONTENT'), + ] + ] + ] + ); + + HTMLHelper::_('script', 'vendor/skipto/dropMenu.js', ['version' => 'auto', 'relative' => true], ['defer' => true]); + HTMLHelper::_('script', 'vendor/skipto/skipTo.js', ['version' => 'auto', 'relative' => true], ['defer' => true]); + HTMLHelper::_('stylesheet', 'vendor/skipto/SkipTo.css', ['version' => 'auto', 'relative' => true]); + + $document->addScriptDeclaration("document.addEventListener('DOMContentLoaded', function() { + window.SkipToConfig = Joomla.getOptions('skipto-settings'); + window.skipToMenuInit(); + });"); + } +} diff --git a/plugins/system/skipto/skipto.xml b/plugins/system/skipto/skipto.xml new file mode 100644 index 0000000000000..261dd395609bd --- /dev/null +++ b/plugins/system/skipto/skipto.xml @@ -0,0 +1,36 @@ + + + plg_system_skipto + Joomla! Project + 2019-2-27 + (C) 2005 - 2019 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_SKIPTO_XML_DESCRIPTION + + skipto.php + + + language/en-GB/en-GB.plg_system_skipto.ini + language/en-GB/en-GB.plg_system_skipto.sys.ini + + + +
+ + + + + +
+
+
+
\ No newline at end of file