diff --git a/administrator/components/com_associations/src/Field/Modal/AssociationField.php b/administrator/components/com_associations/src/Field/Modal/AssociationField.php index e68292c596f38..f19fec5f14024 100644 --- a/administrator/components/com_associations/src/Field/Modal/AssociationField.php +++ b/administrator/components/com_associations/src/Field/Modal/AssociationField.php @@ -81,7 +81,6 @@ protected function getInput() $html[] = '' . ' ' . Text::_('JCLEAR') . ''; diff --git a/administrator/components/com_associations/src/View/Association/HtmlView.php b/administrator/components/com_associations/src/View/Association/HtmlView.php index b5964d93e9a19..2bae288ecb1c4 100644 --- a/administrator/components/com_associations/src/View/Association/HtmlView.php +++ b/administrator/components/com_associations/src/View/Association/HtmlView.php @@ -388,15 +388,13 @@ protected function addToolbar(): void ); $toolbar = $this->getDocument()->getToolbar(); - $toolbar->customButton('reference') - ->html(''); - - $toolbar->customButton('target') - ->html(''); + $toolbar->standardButton('reference', 'COM_ASSOCIATIONS_SAVE_REFERENCE', 'reference') + ->icon('icon-save') + ->buttonClass('btn btn-success'); + + $toolbar->standardButton('target', 'COM_ASSOCIATIONS_SAVE_TARGET', 'target') + ->icon('icon-save') + ->buttonClass('btn btn-success'); if ($this->typeName === 'category' || $this->extensionName === 'com_menus' || $this->save2copy === true) { $toolbar->standardButton('copy', 'COM_ASSOCIATIONS_COPY_REFERENCE', 'copy') diff --git a/administrator/components/com_content/src/View/Articles/HtmlView.php b/administrator/components/com_content/src/View/Articles/HtmlView.php index 272d89a947dff..b522bbc942e06 100644 --- a/administrator/components/com_content/src/View/Articles/HtmlView.php +++ b/administrator/components/com_content/src/View/Articles/HtmlView.php @@ -212,18 +212,14 @@ protected function addToolbar() ->text('COM_CONTENT_RUN_TRANSITIONS') ->buttonClass('text-center py-2 h3'); - $cmd = "Joomla.submitbutton('articles.runTransition');"; - $messages = "{error: [Joomla.Text._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST')]}"; - $alert = 'Joomla.renderMessages(' . $messages . ')'; - $cmd = 'if (document.adminForm.boxchecked.value == 0) { ' . $alert . ' } else { ' . $cmd . ' }'; - foreach ($this->transitions as $transition) { $transitionValue = (int) ($transition['value'] ?? 0); - $childBar->standardButton('transition', $transition['text']) + $childBar->standardButton('transition', $transition['text'], 'articles.runTransition') ->buttonClass('transition-' . $transitionValue) ->icon('icon-project-diagram') - ->onclick('document.adminForm.transition_id.value=' . $transitionValue . ';' . $cmd); + ->listCheck(true) + ->attributes(['data-transition-id' => $transitionValue]); } $childBar->separatorButton('transition-separator'); diff --git a/administrator/components/com_finder/src/View/Indexer/HtmlView.php b/administrator/components/com_finder/src/View/Indexer/HtmlView.php index c50e40e931423..d91947da80586 100644 --- a/administrator/components/com_finder/src/View/Indexer/HtmlView.php +++ b/administrator/components/com_finder/src/View/Indexer/HtmlView.php @@ -75,8 +75,7 @@ protected function addToolbar() ->icon('icon-arrow-' . ($this->getLanguage()->isRtl() ? 'right' : 'left')) ->url(Route::_('index.php?option=com_finder&view=index')); - $toolbar->standardButton('index', 'COM_FINDER_INDEX') - ->icon('icon-play') - ->onclick('Joomla.debugIndexing();'); + $toolbar->basicButton('index', 'COM_FINDER_INDEX') + ->icon('icon-play'); } } diff --git a/administrator/components/com_modules/layouts/toolbar/cancelselect.php b/administrator/components/com_modules/layouts/toolbar/cancelselect.php index 7637060854cd8..99b14a9b1d593 100644 --- a/administrator/components/com_modules/layouts/toolbar/cancelselect.php +++ b/administrator/components/com_modules/layouts/toolbar/cancelselect.php @@ -15,7 +15,7 @@ $text = Text::_('JTOOLBAR_CANCEL'); ?> - + diff --git a/administrator/components/com_modules/src/View/Modules/HtmlView.php b/administrator/components/com_modules/src/View/Modules/HtmlView.php index b610a5a593426..3b3b8bb79377a 100644 --- a/administrator/components/com_modules/src/View/Modules/HtmlView.php +++ b/administrator/components/com_modules/src/View/Modules/HtmlView.php @@ -16,6 +16,7 @@ use Joomla\CMS\Language\Multilanguage; use Joomla\CMS\MVC\Model\ListModel; use Joomla\CMS\MVC\View\ListView; +use Joomla\CMS\Router\Route; use Joomla\CMS\Session\Session; // phpcs:disable PSR1.Files.SideEffects @@ -168,8 +169,10 @@ protected function addToolbar() $canCreate = $canDo->get('core.create'); if ($canCreate) { - $this->getDocument()->getToolbar()->standardButton('new', 'JTOOLBAR_NEW') - ->onclick("location.href='index.php?option=com_modules&view=select&client_id=" . $this->clientId . "'"); + $this->getDocument()->getToolbar()->linkButton('new', 'JTOOLBAR_NEW') + ->url(Route::_('index.php?option=com_modules&view=select&client_id=' . (int) $this->clientId)) + ->buttonClass('btn btn-success') + ->icon('icon-new'); } // Prevent showing default add button diff --git a/administrator/components/com_users/src/View/Method/HtmlView.php b/administrator/components/com_users/src/View/Method/HtmlView.php index 55b96ebfa07da..6e7c1f75dd266 100644 --- a/administrator/components/com_users/src/View/Method/HtmlView.php +++ b/administrator/components/com_users/src/View/Method/HtmlView.php @@ -175,11 +175,11 @@ function ($x) { if ($this->isAdmin && $this->getLayout() === 'edit') { $button = (new BasicButton('user-mfa-edit-save')) ->text($this->renderOptions['submit_text']) - ->icon($this->renderOptions['submit_icon']) - ->onclick('document.getElementById(\'user-mfa-edit-save\').click()'); + ->icon($this->renderOptions['submit_icon']); if ($this->renderOptions['show_submit'] || $this->isEditExisting) { $toolbar->appendButton($button); + $this->getDocument()->getWebAssetManager()->useScript('com_users.two-factor-edit'); } $button = (new LinkButton('user-mfa-edit-cancel')) diff --git a/layouts/joomla/button/transition-button.php b/layouts/joomla/button/transition-button.php index 60f09fda75978..5b47503521829 100644 --- a/layouts/joomla/button/transition-button.php +++ b/layouts/joomla/button/transition-button.php @@ -8,6 +8,7 @@ * @license GNU General Public License version 2 or later; see LICENSE.txt */ +use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; @@ -27,6 +28,8 @@ * @var array $options */ +Factory::getApplication()->getDocument()->getWebAssetManager()->useScript('list-view'); + $disabled = empty($options['transitions']) || !empty($options['disabled']); $id = $options['id']; $tipTitle = $options['tip_title']; @@ -35,12 +38,9 @@ $task = $options['task']; ?> - @@ -67,9 +67,11 @@ $attribs = [ 'id' => 'transition-select_' . (int) $row ?? '', 'list.attr' => [ - 'class' => 'form-select form-select-sm w-auto', - 'onchange' => "this.form.transition_id.value=this.value;Joomla.listItemTask('" . $checkboxName . $this->escape($row ?? '') . "', '" . $task . "')"] - ]; + 'class' => 'js-grid-item-transition-action form-select form-select-sm w-auto', + 'data-item-id' => $this->escape($checkboxName . ($row ?? '')), + 'data-item-task' => $this->escape($task), + ], + ]; echo HTMLHelper::_('select.genericlist', $transitions, '', $attribs); ?> diff --git a/media_source/com_associations/js/sidebyside.es6.js b/media_source/com_associations/js/sidebyside.es6.js index 682bc148e8352..bca0e182161c0 100644 --- a/media_source/com_associations/js/sidebyside.es6.js +++ b/media_source/com_associations/js/sidebyside.es6.js @@ -23,9 +23,11 @@ const createOption = (value, text) => { return option; }; -// Attach behaviour to toggle button. +// Attach behaviour to toggle button and clear association button. document.body.addEventListener('click', ({ target }) => { - if (target.id === 'toggle-left-panel') { + if (target.closest('#remove-assoc')) { + Joomla.submitbutton('undo-association'); + } else if (target.id === 'toggle-left-panel') { const referenceHide = target.getAttribute('data-hide-reference'); const referenceShow = target.getAttribute('data-show-reference'); diff --git a/media_source/com_finder/js/debug.es6.js b/media_source/com_finder/js/debug.es6.js index c77de5b1c2d8a..4fc9d782d6324 100644 --- a/media_source/com_finder/js/debug.es6.js +++ b/media_source/com_finder/js/debug.es6.js @@ -62,4 +62,10 @@ // @todo use directly the Joomla.finderIndexer() instead of the Indexer()!!! document.addEventListener('DOMContentLoaded', () => { window.Indexer = Joomla.finderIndexer(); + + const indexButton = document.getElementById('toolbar-index'); + + if (indexButton) { + indexButton.addEventListener('click', () => Joomla.debugIndexing()); + } }); diff --git a/media_source/com_users/joomla.asset.json b/media_source/com_users/joomla.asset.json index a89b882c82641..8d11820749367 100644 --- a/media_source/com_users/joomla.asset.json +++ b/media_source/com_users/joomla.asset.json @@ -27,6 +27,17 @@ "type": "module" } }, + { + "name": "com_users.two-factor-edit", + "type": "script", + "uri": "com_users/two-factor-edit.min.js", + "dependencies": [ + "core" + ], + "attributes": { + "type": "module" + } + }, { "name": "com_users.two-factor-list", "type": "script", diff --git a/media_source/com_users/js/two-factor-edit.es6.js b/media_source/com_users/js/two-factor-edit.es6.js new file mode 100644 index 0000000000000..9e7eb8f81c182 --- /dev/null +++ b/media_source/com_users/js/two-factor-edit.es6.js @@ -0,0 +1,23 @@ +/** + * @copyright (C) 2026 Open Source Matters, Inc. + * @license GNU General Public License version 2 or later; see LICENSE.txt + */ + +(() => { + 'use strict'; + + document.addEventListener('DOMContentLoaded', () => { + const elSaveButton = document.getElementById('user-mfa-edit-save'); + + // Capture the admin toolbar save button, make it click the inline save button + document.querySelectorAll('.button-user-mfa-edit-save').forEach((elButton) => { + elButton.addEventListener('click', (e) => { + e.preventDefault(); + + if (elSaveButton) { + elSaveButton.click(); + } + }); + }); + }); +})(); diff --git a/media_source/com_workflow/js/admin-items-workflow-buttons.es6.js b/media_source/com_workflow/js/admin-items-workflow-buttons.es6.js index 471bca63cfcb3..4582b97cc9c4e 100644 --- a/media_source/com_workflow/js/admin-items-workflow-buttons.es6.js +++ b/media_source/com_workflow/js/admin-items-workflow-buttons.es6.js @@ -42,6 +42,17 @@ Joomla.toggleAllNextElements = (element, className) => { return; } + // Set the transition to run before the toolbar button submits the list form. This listens in the + // capture phase: joomla-toolbar-button submits from its own click listener on the inner button. + dropDownBtn.addEventListener('click', ({ target }) => { + const button = target.closest('[data-transition-id]'); + const form = document.getElementById('adminForm'); + + if (button && form && form.transition_id) { + form.transition_id.value = button.dataset.transitionId; + } + }, true); + const headline = dropDownBtn.querySelector('.button-transition-headline'); const separator = dropDownBtn.querySelector('.button-transition-separator'); const itemList = document.querySelector('table.itemList');