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
10 changes: 4 additions & 6 deletions administrator/components/com_modules/tmpl/module/edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

/** @var \Joomla\Component\Modules\Administrator\View\Module\HtmlView $this */

HTMLHelper::_('behavior.combobox');

$hasContent = isset($this->item->xml->customContent);
$hasContentFieldName = 'content';

Expand All @@ -39,10 +37,10 @@

$this->getDocument()->addScriptOptions('module-edit', ['itemId' => $this->item->id, 'state' => (int) $this->item->id == 0 ? 'Add' : 'Edit']);

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->getDocument()->getWebAssetManager();
$wa->useScript('keepalive')
->useScript('form.validate');
$this->getDocument()->getWebAssetManager()
->useScript('keepalive')
->useScript('form.validate')
->useScript('awesomplete');

$input = Factory::getApplication()->getInput();

Expand Down
13 changes: 9 additions & 4 deletions administrator/components/com_templates/tmpl/template/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,21 @@

/** @var \Joomla\Component\Templates\Administrator\View\Template\HtmlView $this */

HTMLHelper::_('behavior.multiselect', 'updateForm');
HTMLHelper::_('bootstrap.modal');
$app = Factory::getApplication();
$doc = $app->getDocument();

// Pass the required options to the javascript
$doc->addScriptOptions('js-multiselect', ['formName' => 'updateForm']);

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->getDocument()->getWebAssetManager();
$input = Factory::getApplication()->getInput();
$wa = $doc->getWebAssetManager();
$input = $app->getInput();

// Enable assets
$wa->useScript('form.validate')
->useScript('keepalive')
->useScript('bootstrap.modal')
->useScript('multiselect')
->useScript('com_templates.admin-template-toggle-switch')
->useScript('com_templates.admin-templates')
->useStyle('com_templates.admin-templates');
Expand Down
12 changes: 5 additions & 7 deletions components/com_config/tmpl/modules/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@

defined('_JEXEC') or die;

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;

HTMLHelper::_('behavior.combobox');

/** @var \Joomla\Component\Config\Site\View\Modules\HtmlView $this */
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->getDocument()->getWebAssetManager();
$wa->useScript('keepalive')

$this->getDocument()->getWebAssetManager()
->useScript('keepalive')
->useScript('form.validate')
->useScript('com_config.modules');
->useScript('com_config.modules')
->useScript('awesomplete');

$editorText = false;
$moduleXml = JPATH_SITE . '/modules/' . $this->item['module'] . '/' . $this->item['module'] . '.xml';
Expand Down
4 changes: 2 additions & 2 deletions layouts/joomla/form/field/combo.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

extract($displayData);

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Factory;

/**
* Layout variables
Expand Down Expand Up @@ -45,7 +45,7 @@
* @var array $dataAttributes Miscellaneous data attribute for eg, data-*.
*/

HTMLHelper::_('behavior.combobox');
Factory::getApplication()->getDocument()->getWebAssetManager()->usePreset('awesomplete');

$attr = '';

Expand Down
2 changes: 1 addition & 1 deletion libraries/src/HTML/Helpers/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public static function sort($title, $order, $direction = 'asc', $selected = '',
*/
public static function checkall($name = 'checkall-toggle', $action = 'Joomla.checkAll(this)')
{
HTMLHelper::_('behavior.core');
Factory::getApplication()->getDocument()->getWebAssetManager()->useScript('core');

return '<input class="form-check-input" autocomplete="off" type="checkbox" name="' . $name . '" value="" title="' . Text::_('JGLOBAL_CHECK_ALL') . '" onclick="' . $action . '">';
}
Expand Down
6 changes: 3 additions & 3 deletions libraries/src/Language/Text.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
namespace Joomla\CMS\Language;

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
Expand Down Expand Up @@ -351,7 +350,8 @@ public static function script($string = null, $jsSafe = false, $interpretBackSla

// Add the string to the array if not null.
if ($string !== null) {
$doc = Factory::getDocument();
$app = Factory::getApplication();
$doc = $app->getDocument();

// Get previously added strings
$strings = $doc->getScriptOptions('joomla.jtext');
Expand All @@ -362,7 +362,7 @@ public static function script($string = null, $jsSafe = false, $interpretBackSla
static::$strings[$key] = $strings[$key];

// Load core.js dependency
HTMLHelper::_('behavior.core');
$doc->getWebAssetManager()->useScript('core');

// Update Joomla.Text script options
$doc->addScriptOptions('joomla.jtext', $strings, false);
Expand Down
Loading