-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.2] [GSoC 21] Keyboard-Shortcut Plugin #38092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 177 commits
Commits
Show all changes
208 commits
Select commit
Hold shift + click to select a range
b44ece4
Fix form label relation removed title from non active elements
Krshivam25 8d82ea4
Keboard Shortcuts Plugin Setup
Krshivam25 1bb1802
Language description
Krshivam25 d98a6e6
Added Shortcut keys for buttons
Krshivam25 ecf9491
Added more Keyboard shortcuts
Krshivam25 a77362b
Optimized code with function
Krshivam25 c0db25f
Removed Options Shortcuts and Improved Comment
Krshivam25 847a265
Improved code by adding Joomla.shortcut
Krshivam25 cd2953e
Updated actionbutton.split
Krshivam25 0ce4961
Update plugins/system/shortcut/shortcut.php
Krshivam25 a293b3e
Deleted Index.html
Krshivam25 1bd0433
Update Shortcut.js
Krshivam25 fb6c0d9
Delete index.html
Krshivam25 88d6fd4
Updated file name
Krshivam25 f072443
Rename shortcut.js to shortcut.es6.js
Krshivam25 000ee23
Update en-GB.plg_system_shortcut.ini
Krshivam25 03797b0
Update en-GB.plg_system_shortcut.ini
Krshivam25 3c51c9d
Update Copyright
HLeithner 30071b0
Update en-GB.plg_system_shortcut.ini
Krshivam25 95c7fc4
Drone
HLeithner 9b8981f
Update drone key for gsoc21_accessibility
HLeithner 2965133
Update shortcut.es6.js
Krshivam25 f96bc36
Update Shortcut.php
Krshivam25 edf6b11
Update shortcut.xml
Krshivam25 5210736
Update shortcut.php
Krshivam25 65f0fe7
Added type module
Krshivam25 386af1c
Fix conflict
Krshivam25 f0d7e1c
Merge branch '4.1-dev' of https://github.com/joomla-projects/gsoc21_a…
Krshivam25 f24b581
Fix phpcs error in shortcut.php file
Krshivam25 b223844
Updated phpcs fixes in shortcut.php
Krshivam25 96b47e0
updated comments and added @var in shortcut.php
Krshivam25 8348889
Updated Javascript-cs Fixes in shortcut.es6.js file
Krshivam25 b699d04
Revert changes in package-lock.json and package.json
Krshivam25 2c986c0
Merge branch '4.1-dev' of github.com:joomla/joomla-cms into 4.1-dev-a…
bembelimen 692b302
Added $document->addScriptOptions()
Krshivam25 4b1987c
Fix extra space in shortcut.php
Krshivam25 e34f5b8
Updated Shortcut.es6.js
Krshivam25 d764d68
Updated shortcut.php
Krshivam25 bfe158d
Updated keyboard shortcuts plugin
Krshivam25 6cb6ef1
Removed Extra Space
Krshivam25 b98e002
Updated shortcut Functionality with radio buttons
Krshivam25 e7a5d8a
Merge pull request #9 from joomla-projects/4.1-dev
bembelimen 470dfeb
Merge pull request #10 from joomla-projects/dev
bembelimen b990af8
Updated Keyboard Shortcuts with keyselect field
Krshivam25 1417be4
Added: Key combination features in modal
Krshivam25 9ac232d
Added: Restore Default and Updated Modal Pop-up
Krshivam25 5f2b7e3
Updated: shortcut.xml according coding standard.
Krshivam25 0f97b78
Removed: Jimport
Krshivam25 d3acba5
Removed: Jimport
Krshivam25 b1b7c82
Removed: Jimport
Krshivam25 1bbca23
Removed: Input Field and MySql Updated
Krshivam25 309c093
Fix: Undefined method and Updated: base.sql files
Krshivam25 aa7948d
Update: Fix codestyle in PHP and drone error fix
Krshivam25 3271ea9
Removed: Extra Column in Base.sql
Krshivam25 5d6e72d
Removed: Extra Column in Postgresql
Krshivam25 2e60e4f
Updated: keyselect.es6.js with array []
Krshivam25 7d3c64f
Updated: Fix Code Style in shortcut.xml
Krshivam25 b91e29f
Updated: Keyselect.php
Krshivam25 dd3aa28
Update: Restore Defaults button removed namespace
Krshivam25 04b38ef
Update shortcut.php
Krshivam25 52fa2f7
Updated: keyselect.es6.js modal is vertically centered
Krshivam25 e064b3b
Merge branch '4.1-dev' of github.com:joomla/joomla-cms into 4.1-dev
bembelimen 474905f
Merge branch 'dev' into gsoc
Krshivam25 fca4f51
Merge branch '4.1-dev' of github.com:joomla/joomla-cms into 4.1-dev
bembelimen b622a9d
Fixes: Keyselect and Restoredefault
Krshivam25 8e1ee53
Added Object.entries in Restoredefaults.js
Krshivam25 fda263b
Button colour is changed for Restore
Krshivam25 3299ebb
Updated: restoredefault.js
Krshivam25 f8c426a
Fix: Keyselect for meta keys
Krshivam25 6c46439
Update: Cancel Button text color changed
Krshivam25 472199b
Removed prevent default from modal
Krshivam25 acf57e5
Removed Empty _DESC
Krshivam25 d070170
Updated: Restore default added querySelector
Krshivam25 5a237ea
Removed Label in text string
Krshivam25 d657db8
Updated: XML version DEPLOY_VERSION
Krshivam25 6530c88
Updated: MAC Options in restoredefaults
Krshivam25 5b37825
Merge pull request #14 from joomla-projects/4.1-dev
bembelimen f13592e
Merge branch '4.1-dev' into gsoc
Krshivam25 132bc9d
Removed: Whitespace in keyselect
Krshivam25 a9fa0d8
Removed: PhpCS in restoredefault
Krshivam25 ec5e675
PHPCS fix in shortcut
Krshivam25 9e7679c
PHPCS code fix
Krshivam25 e6c21d5
phpcs fix
Krshivam25 e5773d4
PHPCS fix
Krshivam25 63fa7f9
PHPCS fix
Krshivam25 35e5df7
PHPCS fix
Krshivam25 20c4609
phpcs fix
Krshivam25 04f1fb8
PHPCS fix
Krshivam25 4fec5e1
PHPCS shortcut
Krshivam25 9f4618b
Merge branch 'gsoc' of https://github.com/Krshivam25/gsoc21_accessibi…
Krshivam25 52f8b40
ESlint fix in JS file
Krshivam25 34d0cf2
Removed for of loops in keyselect
Krshivam25 8b51d96
eslint keyselect
Krshivam25 1c78a6c
Eslint fix issues in Shortcut.js
Krshivam25 b87c5c0
Merge if statement in shortcut.js
Krshivam25 19b521a
Component Shortcuts
Krshivam25 52cf4b0
Component shortcut
Krshivam25 1060ee2
Component Shortcut
Krshivam25 cbb976e
Updated: XML for components
Krshivam25 78e527b
Updated: shortcut php
Krshivam25 b6697a2
Updated: keyselect.php & restoredefaults.php
Krshivam25 19c21fc
Updated: javascript files for restore default
Krshivam25 da5dccb
Removed extra space
Krshivam25 9409a82
Removed Login file
Krshivam25 a884350
Removed login file
Krshivam25 9b549a1
Revert login tmpl
bembelimen f26cbd6
Removed the Component Shortcuts and Reset is Fix
Krshivam25 4324f87
Added package Mousetrap
Krshivam25 acffa6d
changes revert
Krshivam25 88fdbb3
Revert changes
Krshivam25 5670196
Added packages in settings.json
Krshivam25 0ec44db
Added mousetrap in settings.json
Krshivam25 2bdaab6
importing mousetrap library
Krshivam25 ed7f431
Mousetrap library added
Krshivam25 a1e1e16
Updated PHP files for shortcut
Krshivam25 dbc106c
Shortcut list appears in alert
Krshivam25 3d8b905
Updated shortcut in Modal Window with esc key
Krshivam25 9011e23
Merge pull request #7 from Krshivam25/keyboard-shortcut
bembelimen 594d288
Merge pull request #8 from Krshivam25/gsoc
bembelimen 18abf8a
Merge branch 'gsoc' into keyboard-shortcut
bembelimen f6e2ca0
Merge pull request #17 from joomla-projects/keyboard-shortcut
bembelimen a8977e5
Merge branch '4.2-dev' of github.com:joomla/joomla-cms into gsoc
bembelimen 395b15e
Merge branch 'gsoc' of github.com:joomla-projects/gsoc21_accessibilit…
bembelimen 81870e9
First step of moving to hotkeys
bembelimen c479805
Merge branch '4.2-dev' of github.com:joomla/joomla-cms into shortcut
bembelimen 6f957e2
Rename language files
bembelimen 9ddb327
Merge remote-tracking branch 'Joomla/4.2-dev' into gsoc
bembelimen 74cf78d
Merge branch '4.2-dev' of github.com:joomla/joomla-cms into shortcut
bembelimen 3909e21
Merge branch 'gsoc' of github.com:joomla-projects/gsoc21_accessibilit…
bembelimen 7afd288
Fix keyselect field
bembelimen 6674e07
Add shortcut function
bembelimen f9bf842
Remove eval and add key selector only
bembelimen 3f530d8
Fix PR comments
fancyFranci d174a11
Remove unnecessary classes
fancyFranci 9b6e728
Fix text files
fancyFranci 089301c
Set h3 instead of h5 in modal
fancyFranci 4b8be66
Remove readonly attribute from new-key-input
fancyFranci cc9ca65
Remove readonly and change current-key to text
fancyFranci 1d88bb4
Remove unused stuff
fancyFranci 388d974
Add search
fancyFranci 59a8fa7
Move search button
bembelimen 9180e66
Fix styleguide
bembelimen d026f0c
Format doc and remove double class
fancyFranci 3ba8c1c
Add info text to key select modal
bembelimen c67a992
Add default options to shortcut keys
bembelimen e32e449
Refactor keyselect js and include mac
fancyFranci 0768e59
Merge branch 'gsoc' of github.com:joomla-projects/gsoc21_accessibilit…
fancyFranci 798bd8e
Use "confirm" instead of "save"
fancyFranci 2f63245
Set modifier "j"
fancyFranci e2193d3
Remove shortcut editing
fancyFranci 466c17c
Mark global hotkeys
fancyFranci 8b2629d
Add overview modal
fancyFranci 72ab7ea
Remove not working editor actions
fancyFranci f7fbdc8
Set keyboard icon and dl instead of ul
fancyFranci 7a51413
Set correct version
fancyFranci d518e90
Remove not working editor shortcuts
fancyFranci d1658eb
Improve overview list
fancyFranci ac07f6d
Generate overview with options
fancyFranci dedbdb6
Set plugin description in sys.ini too
fancyFranci b0d6420
Fix shortcut filter by allowing checkboxes
fancyFranci b42a191
Add update sql files
fancyFranci a7df0c0
Remove obsolete script texts
fancyFranci 7e9afec
Use Y-m-d format for creation date
fancyFranci 31f6270
Format event params
fancyFranci 8b7e617
Remove 'see LICENSE.php'
fancyFranci ebee01a
Fix xml spacing
fancyFranci da3f9c4
Close p-tag in description
fancyFranci acb0a0a
Close p-tag in description nr 2
fancyFranci b9f66c7
Remove 'see LICENSE.php'
fancyFranci f0bd452
Check option values in js
fancyFranci 0942d58
Update update.sql
fancyFranci 94f437a
Merge branch 'gsoc' of github.com:fancyFranci/joomla-cms into gsoc
fancyFranci 0d5d13e
Merge branch '4.2-dev' into gsoc
fancyFranci a1f99d9
Update update.sql but better
fancyFranci 36393c9
Add plugin to ExtensionHelpers coreExtensions
fancyFranci afd5f68
Merge branch '4.2-dev' of https://github.com/joomla/joomla-cms into gsoc
fancyFranci 447d52f
change plugin to service provider (#5)
heelc29 bcd90dd
Set J+F for search and add menu-collapse
fancyFranci ea594ee
Fix order in base.sql and set locked = 1
fancyFranci e955bfd
Remove importPlugin
fancyFranci 7e0e0e3
Remove Save&New shortcut
fancyFranci ea4ee0a
Merge branch '4.2-dev' into gsoc
fancyFranci 8c0c5cd
Fix base.sql for postgresql
fancyFranci 2d427d1
Merge branch 'gsoc' of github.com:fancyFranci/joomla-cms into gsoc
fancyFranci 37f63c6
Add the "J" modifier (#6)
bembelimen 7a10b79
Set default timeout to 2 seconds
fancyFranci eb7163a
Fix shortcuts
fancyFranci d369911
Change texts
fancyFranci 50945b3
Merge branch '4.2-dev' into gsoc
fancyFranci c4d7605
Update administrator/language/en-GB/plg_system_shortcut.ini
fancyFranci fd3fea2
Update administrator/language/en-GB/plg_system_shortcut.ini
fancyFranci 9d1ba03
Update administrator/language/en-GB/plg_system_shortcut.ini
fancyFranci ec13ea2
Update administrator/language/en-GB/plg_system_shortcut.sys.ini
fancyFranci b980c61
Update plugins/system/shortcut/src/Extension/Shortcut.php
fancyFranci ffc7946
Add link to dashboard
fancyFranci e8aa67b
Switch dt and dd
fancyFranci ab018aa
Set language string for "Close"
fancyFranci 2ecb161
Update plugins/system/shortcut/src/Extension/Shortcut.php
fancyFranci 71dd311
Align order of shortkeys and set <kbd>
fancyFranci a161754
Merge branch 'gsoc' of github.com:fancyFranci/joomla-cms into gsoc
fancyFranci fc0559c
Remove dots from description list
fancyFranci b886e42
Less prominent shortcut overview hint
fancyFranci acb2d83
Update administrator/language/en-GB/plg_system_shortcut.ini
fancyFranci d13e866
fix description
fancyFranci 3d520f9
Update administrator/language/en-GB/plg_system_shortcut.ini
fancyFranci 07adf8d
Update administrator/language/en-GB/plg_system_shortcut.ini
fancyFranci ba38767
Show hint only below cpanels
fancyFranci 2d6063c
Remove not needed pluginHelper
fancyFranci File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
administrator/components/com_admin/sql/updates/mysql/4.2.0-2022-06-19.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| -- See https://github.com/joomla/joomla-cms/pull/38092 | ||
| INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`) VALUES | ||
| (0, 'plg_system_shortcut', 'plugin', 'shortcut', 'system', 0, 1, 1, 0, 1, '', '', '', 0, 0); |
3 changes: 3 additions & 0 deletions
3
administrator/components/com_admin/sql/updates/postgresql/4.2.0-2022-06-19.sql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| -- See https://github.com/joomla/joomla-cms/pull/38092 | ||
| INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state") VALUES | ||
| (0, 'plg_system_shortcut', 'plugin', 'shortcut', 'system', 0, 1, 1, 0, 1, '', '', '', 0, 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| ; Joomla! Project | ||
| ; (C) 2022 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_SHORTCUT="System - Keyboard Shortcut" | ||
| PLG_SYSTEM_SHORTCUT_ACTIONS_FORM_LABEL="Form View Actions" | ||
| PLG_SYSTEM_SHORTCUT_ACTIONS_GENERAL_LABEL="General Actions" | ||
| PLG_SYSTEM_SHORTCUT_ACTIONS_LIST_LABEL="List View Actions" | ||
| PLG_SYSTEM_SHORTCUT_CORE_SHORTCUTS_TAB="Core Shortcuts" | ||
| PLG_SYSTEM_SHORTCUT_OVERVIEW_HINT="Press J + X for our keyboard shortcut overview" | ||
fancyFranci marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| PLG_SYSTEM_SHORTCUT_OVERVIEW_TITLE="Available Joomla Shortcuts" | ||
fancyFranci marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| PLG_SYSTEM_SHORTCUT_XML_DESCRIPTION="<p>Enables keyboard shortcuts on the administrator site, which can be provided by other plugins and includes directly the following list of shortcuts:</p><ul><li>Save: J + S</li><li>Cancel: J + Q</li><li>New: J + N</li><li>Save & New: J + N</li><li>Save & Close: J + W</li><li>Search: J + S</li><li>Option: J + O</li><li>Help: J + H</li><li>Overview: J + X</li></ul>" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| ; Joomla! Project | ||
| ; (C) 2022 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_SHORTCUT="System - Keyboard Shortcut" | ||
fancyFranci marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| PLG_SYSTEM_SHORTCUT_XML_DESCRIPTION="<p>Enables keyboard shortcuts on the administrator site, which can be provided by other plugins and includes directly the following list of shortcuts:</p><ul><li>Save: J + S</li><li>Cancel: J + Q</li><li>New: J + N</li><li>Save & New: J + N</li><li>Save & Close: J + W</li><li>Search: J + S</li><li>Option: J + O</li><li>Help: J + H</li><li>Overview: J + X</li></ul>" | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
139 changes: 139 additions & 0 deletions
139
build/media_source/plg_system_shortcut/js/shortcut.es6.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,139 @@ | ||
| ((document, Joomla) => { | ||
| 'use strict'; | ||
|
|
||
| if (!Joomla) { | ||
| throw new Error('Joomla API is not properly initialised'); | ||
| } | ||
|
|
||
| /* global hotkeys */ | ||
| Joomla.addShortcut = (hotkey, callback) => { | ||
| hotkeys(hotkey, (event) => { | ||
| event.preventDefault(); | ||
| event.stopPropagation(); | ||
| event.stopImmediatePropagation(); | ||
|
|
||
| callback.call(); | ||
| }); | ||
| }; | ||
|
|
||
| Joomla.addClickShortcut = (hotkey, selector) => { | ||
| Joomla.addShortcut(hotkey, () => { | ||
| const element = document.querySelector(selector); | ||
| if (element) { | ||
| element.click(); | ||
| } | ||
| }); | ||
| }; | ||
|
|
||
| Joomla.addFocusShortcut = (hotkey, selector) => { | ||
| Joomla.addShortcut(hotkey, () => { | ||
| const element = document.querySelector(selector); | ||
| if (element) { | ||
| element.focus(); | ||
| } | ||
| }); | ||
| }; | ||
|
|
||
| const setShortcutFilter = () => { | ||
| hotkeys.filter = (event) => { | ||
| const target = event.target || event.srcElement; | ||
| const { tagName } = target; | ||
|
|
||
| // Checkboxes should not block a shortcut event | ||
| if (target.type === 'checkbox') { | ||
| return true; | ||
| } | ||
| // Default hotkeys filter behavior | ||
| return !(target.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA'); | ||
| }; | ||
| }; | ||
|
|
||
| const addOverviewHint = () => { | ||
| const iconElement = document.createElement('span'); | ||
| iconElement.className = 'icon-keyboard fa-keyboard me-2'; | ||
| iconElement.setAttribute('aria-hidden', true); | ||
| const textElement = document.createElement('span'); | ||
| textElement.innerText = Joomla.Text._('PLG_SYSTEM_SHORTCUT_OVERVIEW_HINT'); | ||
| const hintElement = document.createElement('p'); | ||
| hintElement.appendChild(iconElement); | ||
| hintElement.appendChild(textElement); | ||
| const containerElement = document.createElement('section'); | ||
| containerElement.className = 'content pt-4'; | ||
| containerElement.appendChild(hintElement); | ||
| document.querySelector('.container-main').appendChild(containerElement); | ||
| }; | ||
|
|
||
| const initOverviewModal = (options) => { | ||
| const dlItems = new Map(); | ||
| Object.values(options).forEach((value) => { | ||
| if (!value.shortcut || !value.title) { | ||
| return; | ||
| } | ||
| let titles = []; | ||
| if (dlItems.has(value.shortcut)) { | ||
| titles = dlItems.get(value.shortcut); | ||
| titles.push(value.title); | ||
| } else { | ||
| titles = [value.title]; | ||
| } | ||
| dlItems.set(value.shortcut, titles); | ||
| }); | ||
|
|
||
| let dl = '<dl>'; | ||
| dlItems.forEach((titles, shortcut) => { | ||
| titles.forEach((title) => { | ||
| dl += `<dt>${title}</dt>`; | ||
| }); | ||
| dl += `<dd>${shortcut}</dd>`; | ||
| }); | ||
| dl += '</dl>'; | ||
|
|
||
| const modal = ` | ||
| <div class="modal fade" id="shortcutOverviewModal" tabindex="-1" role="dialog" data-bs-backdrop="static" aria-labelledby="shortcutOverviewModalLabel" aria-hidden="true"> | ||
| <div class="modal-dialog" role="document"> | ||
| <div class="modal-content"> | ||
| <div class="modal-header"> | ||
| <h3 id="shortcutOverviewModalLabel" class="modal-title"> | ||
| ${Joomla.Text._('PLG_SYSTEM_SHORTCUT_OVERVIEW_TITLE')} | ||
| </h3> | ||
| <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> | ||
fancyFranci marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </div> | ||
| <div class="modal-body p-3"> | ||
| <div class="mb-3"> | ||
| ${dl} | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| `; | ||
|
|
||
| document.body.insertAdjacentHTML('beforeend', modal); | ||
|
|
||
| const bootstrapModal = new bootstrap.Modal(document.getElementById('shortcutOverviewModal'), { | ||
| keyboard: true, | ||
| backdrop: true, | ||
| }); | ||
| hotkeys('J + X', () => bootstrapModal.show()); | ||
| }; | ||
|
|
||
| document.addEventListener('DOMContentLoaded', () => { | ||
| const options = Joomla.getOptions('plg_system_shortcut.shortcuts'); | ||
| Object.values(options).forEach((value) => { | ||
| if (!value.shortcut || !value.selector) { | ||
| return; | ||
| } | ||
| if (value.selector.includes('input')) { | ||
| Joomla.addFocusShortcut(value.shortcut, value.selector); | ||
| } else { | ||
| Joomla.addClickShortcut(value.shortcut, value.selector); | ||
| } | ||
| }); | ||
| // Show hint and overview on logged in backend only (not login page) | ||
| if (document.querySelector('nav')) { | ||
| initOverviewModal(options); | ||
| addOverviewHint(); | ||
| } | ||
| setShortcutFilter(); | ||
| }); | ||
| })(document, Joomla); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| <?php | ||
| /** | ||
| * @package Joomla.Plugin | ||
| * @subpackage System.shortcut | ||
| * | ||
| * @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org> | ||
| * @license GNU General Public License version 2 or later; see LICENSE.txt | ||
| */ | ||
|
|
||
| defined('_JEXEC') or die; | ||
|
|
||
| use Joomla\CMS\Extension\PluginInterface; | ||
| use Joomla\CMS\Factory; | ||
| use Joomla\CMS\Plugin\PluginHelper; | ||
| use Joomla\DI\Container; | ||
| use Joomla\DI\ServiceProviderInterface; | ||
| use Joomla\Event\DispatcherInterface; | ||
| use Joomla\Plugin\System\Shortcut\Extension\Shortcut; | ||
|
|
||
| return new class implements ServiceProviderInterface | ||
| { | ||
| /** | ||
| * Registers the service provider with a DI container. | ||
| * | ||
| * @param Container $container The DI container. | ||
| * | ||
| * @return void | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| public function register(Container $container) | ||
| { | ||
| $container->set( | ||
| PluginInterface::class, | ||
| function (Container $container) | ||
| { | ||
| $dispatcher = $container->get(DispatcherInterface::class); | ||
| $plugin = new Shortcut( | ||
| $dispatcher, | ||
| (array) PluginHelper::getPlugin('system', 'shortcut') | ||
| ); | ||
| $plugin->setApplication(Factory::getApplication()); | ||
|
|
||
| return $plugin; | ||
| } | ||
| ); | ||
| } | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <extension type="plugin" group="system" method="upgrade"> | ||
| <name>plg_system_shortcut</name> | ||
| <author>Joomla! Project</author> | ||
| <creationDate>2022-06</creationDate> | ||
| <copyright>(C) 2022 Open Source Matters, Inc.</copyright> | ||
| <license>GNU General Public License version 2 or later; see LICENSE.txt</license> | ||
| <authorEmail>[email protected]</authorEmail> | ||
| <authorUrl>www.joomla.org</authorUrl> | ||
| <version>__DEPLOY_VERSION__</version> | ||
| <description>PLG_SYSTEM_SHORTCUT_XML_DESCRIPTION</description> | ||
| <namespace path="src">Joomla\Plugin\System\Shortcut</namespace> | ||
| <media destination="plg_system_shortcut" folder="media"> | ||
| <folder>js</folder> | ||
| </media> | ||
| <files> | ||
| <folder plugin="shortcut">services</folder> | ||
| <folder>src</folder> | ||
| </files> | ||
| <languages> | ||
| <language tag="en-GB">language/en-GB/plg_system_shortcut.ini</language> | ||
| <language tag="en-GB">language/en-GB/plg_system_shortcut.sys.ini</language> | ||
| </languages> | ||
| </extension> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.