Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
4 changes: 4 additions & 0 deletions administrator/components/com_admin/script.php
Original file line number Diff line number Diff line change
Expand Up @@ -6226,6 +6226,10 @@ public function deleteUnexistingFiles($dryRun = false, $suppressOutput = false)
'/libraries/vendor/joomla/controller',
// Joomla 4.0 Beta 5
'/plugins/content/imagelazyload',
// Joomla 4.0 Beta 6
'/media/vendor/skipto/js/skipTo.js',
'/media/vendor/skipto/js/dropMenu.js',
'/media/vendor/skipto/css/SkipTo.css'
);

$status['files_checked'] = $files;
Expand Down
24 changes: 20 additions & 4 deletions administrator/language/en-GB/plg_system_skipto.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,29 @@
; 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_ACCESS_KEY_NOT_SUPPORTED="The use of Access keys is not supported on this browser."
PLG_SYSTEM_SKIPTO_HEADING="Page Outline"
PLG_SYSTEM_SKIPTO_HEADING_LEVEL="Heading level"
; next line begins with a space. $m is count, %n is total
PLG_SYSTEM_SKIPTO_HEADING_MOFN=" ($m of $n)"
PLG_SYSTEM_SKIPTO_HEADING_NONE="No headings to skip to"
PLG_SYSTEM_SKIPTO_LANDMARK_ASIDE="Aside"
PLG_SYSTEM_SKIPTO_LANDMARK_FOOTER="Footer"
PLG_SYSTEM_SKIPTO_LANDMARK_FORM="Form"
PLG_SYSTEM_SKIPTO_LANDMARK_HEADER="Header"
PLG_SYSTEM_SKIPTO_LANDMARK="Landmarks"
PLG_SYSTEM_SKIPTO_LANDMARK_MAIN="Main"
PLG_SYSTEM_SKIPTO_LANDMARK_NAV="Navigation"
PLG_SYSTEM_SKIPTO_LANDMARK_NONE="No landmarks to skip to"
PLG_SYSTEM_SKIPTO_LANDMARK_REGION="Region"
PLG_SYSTEM_SKIPTO_LANDMARK_SEARCH="Search"
PLG_SYSTEM_SKIPTO_MENU="Landmarks and 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_TITLE="Keyboard Navigation"
; do not translate $key
PLG_SYSTEM_SKIPTO_TITLE_WITH_ACCCESS_KEY="Keyboard Navigation - Access key is $key"
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 choosing it from the list of options."
23 changes: 4 additions & 19 deletions build/build-modules-js/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -548,30 +548,15 @@
"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"
"compiled/js/skipto.js": "js/skipto.js",
"compiled/js/skipto.min.js": "js/skipto.min.js",
"compiled/js/skipto.min.js.map": "js/skipto.min.js.map"
},
"provideAssets": [
{
"name": "skipto",
"type": "style",
"uri": "SkipTo.css"
},
{
"name": "skipto.dropmenu",
"type": "script",
"uri": "dropMenu.js",
"attributes": {
"defer": true
}
},
{
"name": "skipto",
"type": "script",
"uri": "skipTo.js",
"uri": "skipto.min.js",
"attributes": {
"defer": true
}
Expand Down
6 changes: 3 additions & 3 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 @@ -54,7 +54,7 @@
"qrcode-generator": "^1.4.4",
"roboto-fontface": "^0.10.0",
"short-and-sweet": "^1.0.2",
"skipto": "^2.1.1",
"skipto": "^4.0.0",
"tinymce": "^5.6.1",
"vue": "^2.6.12",
"vue-focus-lock": "^1.3.2",
Expand Down
66 changes: 43 additions & 23 deletions plugins/system/skipto/skipto.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @package Joomla.Plugin
* @subpackage System.skipto
*
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
* @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

Expand All @@ -29,7 +29,7 @@ class PlgSystemSkipto extends CMSPlugin
protected $app;

/**
* Add the CSS and JavaScript for the skipto navigation menu.
* Add the skipto navigation menu.
*
* @return void
*
Expand All @@ -52,41 +52,61 @@ public function onAfterDispatch()
return;
}

// Are we in a modal?
if ($this->app->input->get('tmpl', '', 'cmd') === 'component')
{
return;
}

// Load language file.
$this->loadLanguage();

// Add strings for translations in JavaScript.
// Add plugin settings and 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'),
// The following string begins with a space
'contentLabel' => ' ' . Text::_('PLG_SYSTEM_SKIPTO_CONTENT'),
// Feature switches
'enableActions' => false,
'enableHeadingLevelShortcuts' => false,

// Customization of button and menu
'accesskey' => '9',
'displayOption' => 'popup',

// Button labels and messages
'accesskeyNotSupported' => Text::_('PLG_SYSTEM_SKIPTO_ACCESS_KEY_NOT_SUPPORTED'),
'buttonTitle' => Text::_('PLG_SYSTEM_SKIPTO_TITLE'),
'buttonTitleWithAccesskey' => Text::_('PLG_SYSTEM_SKIPTO_TITLE_WITH_ACCCESS_KEY'),
'buttonLabel' => Text::_('PLG_SYSTEM_SKIPTO_SKIP_TO'),

// Menu labels and messages
'landmarkGroupLabel' => Text::_('PLG_SYSTEM_SKIPTO_LANDMARK'),
'headingGroupLabel' => Text::_('PLG_SYSTEM_SKIPTO_HEADING'),
'mofnGroupLabel' => Text::_('PLG_SYSTEM_SKIPTO_HEADING_MOFN'),
'headingLevelLabel' => Text::_('PLG_SYSTEM_SKIPTO_HEADING_LEVEL'),
'mainLabel' => Text::_('PLG_SYSTEM_SKIPTO_LANDMARK_MAIN'),
'searchLabel' => Text::_('PLG_SYSTEM_SKIPTO_LANDMARK_SEARCH'),
'navLabel' => Text::_('PLG_SYSTEM_SKIPTO_LANDMARK_NAV'),
'regionLabel' => Text::_('PLG_SYSTEM_SKIPTO_LANDMARK_REGION'),
'asideLabel' => Text::_('PLG_SYSTEM_SKIPTO_LANDMARK_ASIDE'),
'footerLabel' => Text::_('PLG_SYSTEM_SKIPTO_LANDMARK_FOOTER'),
'headerLabel' => Text::_('PLG_SYSTEM_SKIPTO_LANDMARK_HEADER'),
'formLabel' => Text::_('PLG_SYSTEM_SKIPTO_LANDMARK_FORM'),
'msgNoLandmarksFound' => Text::_('PLG_SYSTEM_SKIPTO_LANDMARK_NONE'),
'msgNoHeadingsFound' => Text::_('PLG_SYSTEM_SKIPTO_HEADING_NONE'),

// Selectors for landmark and headings sections
'headings' => 'h1, h2, h3',
'landmarks' => 'main, nav, search, aside, header, footer, form',
]
]
]
);

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $document->getWebAssetManager();
$wa->useStyle('skipto')
->useScript('skipto.dropmenu')
->useScript('skipto')
->addInlineScript(
'document.addEventListener(\'DOMContentLoaded\', function() {'
. 'window.SkipToConfig = Joomla.getOptions(\'skipto-settings\');'
. 'window.skipToMenuInit();});',
[],
['type' => 'module'],
['skipto']
);
$wa->useScript('skipto');
}
}
8 changes: 4 additions & 4 deletions plugins/system/skipto/skipto.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<extension type="plugin" group="system" method="upgrade">
<name>plg_system_skipto</name>
<author>Joomla! Project</author>
<creationDate>February 2019</creationDate>
<creationDate>February 2020</creationDate>
<copyright>(C) 2019 Open Source Matters, Inc.</copyright>
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
<authorEmail>admin@joomla.org</authorEmail>
Expand All @@ -13,8 +13,8 @@
<filename plugin="skipto">skipto.php</filename>
</files>
<languages>
<language tag="en-GB">language/en-GB/en-GB.plg_system_skipto.ini</language>
<language tag="en-GB">language/en-GB/en-GB.plg_system_skipto.sys.ini</language>
<language tag="en-GB">language/en-GB/plg_system_skipto.ini</language>
<language tag="en-GB">language/en-GB/plg_system_skipto.sys.ini</language>
</languages>
<config>
<fields name="params">
Expand All @@ -33,4 +33,4 @@
</fieldset>
</fields>
</config>
</extension>
</extension>