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
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
Text::script('NOTICE');
Text::script('MESSAGE');

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();

// Load the tooltip behavior.
HTMLHelper::_('behavior.formvalidator');
HTMLHelper::_('behavior.keepalive');
Expand Down Expand Up @@ -65,7 +68,7 @@

<?php $dataShowOn = ''; ?>
<?php if (!empty($fieldSet->showon)) : ?>
<?php HTMLHelper::_('script', 'system/showon.min.js', array('version' => 'auto', 'relative' => true)); ?>
<?php $wa->useScript('showon'); ?>
<?php $dataShowOn = ' data-showon=\'' . json_encode(FormHelper::parseShowOnConditions($fieldSet->showon, $this->formControl)) . '\''; ?>
<?php endif; ?>

Expand Down
24 changes: 24 additions & 0 deletions build/media_source/legacy/joomla.asset.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,30 @@
"jquery"
],
"uri": "legacy/jquery-noconflict.min.js"
},
{
"name": "joomla.frontediting",
"type": "style",
"uri": "system/frontediting.css"
},
{
"name": "joomla.frontediting",
"type": "script",
"dependencies": [
"jquery"
],
"uri": "legacy/frontediting.min.js",
"attributes": {
"defer": true
}
},
{
"name": "joomla.frontediting",
"type": "preset",
"dependencies": [
"joomla.frontediting#style",
"joomla.frontediting#script"
]
}
]
}
65 changes: 64 additions & 1 deletion build/media_source/system/joomla.asset.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@
"dependencies": [
"core"
],
"uri": "system/showon.min.js"
"uri": "system/showon.min.js",
"attributes": {
"defer": true
}
},
{
"name": "switcher",
Expand Down Expand Up @@ -121,6 +124,66 @@
"core"
]
},
{
"name": "field.passwordstrength",
"type": "script",
"uri": "system/fields/passwordstrength.min.js",
"attributes": {
"defer": true
},
"dependencies": [
"core",
"form.validate"
]
},
{
"name": "field.calendar",
"type": "style",
"uri": "system/fields/calendar.css"
},
{
"name": "field.calendar-rtl",
"type": "style",
"uri": "system/fields/calendar-rtl.css"
},
{
"name": "field.calendar.locale",
"type": "script",
"uri": ""
},
{
"name": "field.calendar.helper",
"type": "script",
"uri": ""
},
{
"name": "field.calendar",
"type": "script",
"uri": "system/fields/calendar.min.js",
"attributes": {
"defer": true
},
"dependencies": [
"field.calendar.locale",
"field.calendar.helper"
]
},
{
"name": "field.color-slider",
"type": "script",
"uri": "system/fields/joomla-field-color-slider.min.js",
"attributes": {
"defer": true
}
},
{
"name": "joomla.batch-language",
"type": "script",
"uri": "layouts/joomla/html/batch/batch-language.min.js",
"attributes": {
"defer": true
}
},
{
"name": "webcomponent.field-fancy-select",
"type": "script",
Expand Down
5 changes: 3 additions & 2 deletions components/com_contact/layouts/joomla/form/renderfield.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

defined('_JEXEC') or die;

use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;

extract($displayData);
Expand All @@ -24,7 +23,9 @@

if (!empty($options['showonEnabled']))
{
HTMLHelper::_('script', 'system/showon.min.js', array('version' => 'auto', 'relative' => true));
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->document->getWebAssetManager();
$wa->useScript('showon');
}

$class = empty($options['class']) ? '' : ' ' . $options['class'];
Expand Down
7 changes: 5 additions & 2 deletions layouts/joomla/content/options_default.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@

defined('JPATH_BASE') or die;

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

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

?>

Expand All @@ -26,7 +29,7 @@
<?php $datashowon = ''; ?>
<?php $groupClass = $field->type === 'Spacer' ? ' field-spacer' : ''; ?>
<?php if ($field->showon) : ?>
<?php HTMLHelper::_('script', 'system/showon.min.js', array('version' => 'auto', 'relative' => true)); ?>
<?php $wa->useScript('showon'); ?>
<?php $datashowon = ' data-showon=\'' . json_encode(FormHelper::parseShowOnConditions($field->showon, $field->formControl, $field->group)) . '\''; ?>
<?php endif; ?>

Expand Down
5 changes: 3 additions & 2 deletions layouts/joomla/edit/frontediting_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
// Load stylesheet and javascript to head:
HTMLHelper::_('bootstrap.popover');

HTMLHelper::_('stylesheet', 'legacy/frontediting.css', array('version' => 'auto', 'relative' => true));
HTMLHelper::_('script', 'legacy/frontediting.min.js', array('version' => 'auto', 'relative' => true));
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->usePreset('joomla.frontediting');
}
15 changes: 7 additions & 8 deletions layouts/joomla/form/field/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@
defined('JPATH_BASE') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\Utilities\ArrayHelper;

extract($displayData);

// Get some system objects.
$document = Factory::getDocument();
$document = Factory::getApplication()->getDocument();

/**
* Layout variables
Expand Down Expand Up @@ -94,13 +93,13 @@
$attributes = ArrayHelper::toString($attributes);
}

$cssFileExt = ($direction === 'rtl') ? '-rtl.css' : '.css';
// Redefine locale/helper assets to use correct path, and load calendar assets
$document->getWebAssetManager()
->registerAndUseScript('field.calendar.locale', $localesPath, [], ['defer' => true])
->registerAndUseScript('field.calendar.helper', $helperPath, [], ['defer' => true])
->useStyle('field.calendar' . ($direction === 'rtl' ? '-rtl' : ''))
->useScript('field.calendar');

// The static assets for the calendar
HTMLHelper::_('script', $localesPath, ['version' => 'auto', 'relative' => true]);
HTMLHelper::_('script', $helperPath, ['version' => 'auto', 'relative' => true]);
HTMLHelper::_('script', 'system/fields/calendar.min.js', ['version' => 'auto', 'relative' => true]);
HTMLHelper::_('stylesheet', 'system/fields/calendar' . $cssFileExt, ['version' => 'auto', 'relative' => true]);
?>
<div class="field-calendar">
<?php if (!$readonly && !$disabled) : ?>
Expand Down
7 changes: 4 additions & 3 deletions layouts/joomla/form/field/color/slider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

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

/**
Expand Down Expand Up @@ -64,8 +64,9 @@
$displayValues = explode(',', $display);
$allSliders = $display === 'full' || empty($display);

HTMLHelper::_('stylesheet', 'system/fields/joomla-field-color-slider.min.css', ['version' => 'auto', 'relative' => true]);
HTMLHelper::_('script', 'system/fields/joomla-field-color-slider.min.js', ['version' => 'auto', 'relative' => true]);
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('field.color-slider');

Text::script('JFIELD_COLOR_ERROR_CONVERT_HSL');
Text::script('JFIELD_COLOR_ERROR_CONVERT_HUE');
Expand Down
10 changes: 6 additions & 4 deletions layouts/joomla/form/field/password.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

defined('JPATH_BASE') or die;

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

extract($displayData);
Expand Down Expand Up @@ -47,10 +47,12 @@
* @var string $accept File types that are accepted.
*/

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

if ($meter)
{
HTMLHelper::_('behavior.formvalidator');
HTMLHelper::_('script', 'system/fields/passwordstrength.min.js', array('version' => 'auto', 'relative' => true));
$wa->useScript('field.passwordstrength');

$class = 'js-password-strength ' . $class;

Expand All @@ -60,7 +62,7 @@
}
}

HTMLHelper::_('script', 'system/fields/passwordview.min.js', array('version' => 'auto', 'relative' => true));
$wa->useScript('field.passwordview');

Text::script('JFIELD_PASSWORD_INDICATE_INCOMPLETE');
Text::script('JFIELD_PASSWORD_INDICATE_COMPLETE');
Expand Down
6 changes: 4 additions & 2 deletions layouts/joomla/form/renderfield.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

defined('JPATH_BASE') or die;

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

extract($displayData);

Expand All @@ -25,7 +25,9 @@

if (!empty($options['showonEnabled']))
{
HTMLHelper::_('script', 'system/showon.min.js', array('version' => 'auto', 'relative' => true));
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('showon');
}
$class = empty($options['class']) ? '' : ' ' . $options['class'];
$rel = empty($options['rel']) ? '' : ' ' . $options['rel'];
Expand Down
5 changes: 4 additions & 1 deletion layouts/joomla/html/batch/adminlanguage.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

defined('JPATH_BASE') or die;

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

Expand All @@ -18,7 +19,9 @@
* None
*/

HTMLHelper::_('script', 'layouts/joomla/html/batch/batch-language.min.js', ['version' => 'auto', 'relative' => true]);
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('joomla.batch-language');

?>
<label id="batch-language-lbl" for="batch-language-id">
Expand Down
7 changes: 6 additions & 1 deletion layouts/joomla/html/batch/item.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

defined('JPATH_BASE') or die;

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

Expand All @@ -26,7 +27,11 @@
HTMLHelper::_('select.option', 'c', Text::_('JLIB_HTML_BATCH_COPY')),
HTMLHelper::_('select.option', 'm', Text::_('JLIB_HTML_BATCH_MOVE'))
);
HTMLHelper::_('script', 'layouts/joomla/html/batch/batch-language.min.js', ['version' => 'auto', 'relative' => true]);

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('joomla.batch-language');

?>
<label id="batch-choose-action-lbl" for="batch-category-id">
<?php echo Text::_('JLIB_HTML_BATCH_MENU_LABEL'); ?>
Expand Down
5 changes: 4 additions & 1 deletion layouts/joomla/html/batch/language.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

defined('JPATH_BASE') or die;

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

Expand All @@ -18,7 +19,9 @@
* None
*/

HTMLHelper::_('script', 'layouts/joomla/html/batch/batch-language.min.js', ['version' => 'auto', 'relative' => true]);
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('joomla.batch-language');

?>
<label id="batch-language-lbl" for="batch-language-id">
Expand Down
8 changes: 6 additions & 2 deletions layouts/joomla/searchtools/default/filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,24 @@

defined('JPATH_BASE') or die;

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

$data = $displayData;

// Load the form filters
$filters = $data['view']->filterForm->getGroup('filter');

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

?>
<?php if ($filters) : ?>
<?php foreach ($filters as $fieldName => $field) : ?>
<?php if ($fieldName !== 'filter_search') : ?>
<?php $dataShowOn = ''; ?>
<?php if ($field->showon) : ?>
<?php HTMLHelper::_('script', 'system/showon.min.js', array('version' => 'auto', 'relative' => true)); ?>
<?php $wa->useScript('showon'); ?>
<?php $dataShowOn = " data-showon='" . json_encode(FormHelper::parseShowOnConditions($field->showon, $field->formControl, $field->group)) . "'"; ?>
<?php endif; ?>
<div class="js-stools-field-filter"<?php echo $dataShowOn; ?>>
Expand Down
7 changes: 5 additions & 2 deletions layouts/joomla/toolbar/containeropen.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@

defined('JPATH_BASE') or die;

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

HTMLHelper::_('script', 'legacy/toolbar.min.js', array('version' => 'auto', 'relative' => true));
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->registerAndUseScript('joomla.toolbar', 'legacy/toolbar.min.js', [], ['defer' => true], ['core']);

?>
<nav aria-label="<?php echo Text::_('JTOOLBAR'); ?>">
<div class="btn-toolbar d-flex" role="toolbar" id="<?php echo $displayData['id']; ?>">
Loading