Skip to content
Closed
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: 3 additions & 1 deletion administrator/templates/atum/component.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
<!DOCTYPE html>
<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
<jdoc:include type="head" />
<jdoc:include type="metas" />
<jdoc:include type="styles" />
<jdoc:include type="scripts" />
</head>
<body class="contentpane component">
<jdoc:include type="message" />
Expand Down
2 changes: 1 addition & 1 deletion administrator/templates/atum/error_full.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
<head>
<jdoc:include type="metas" />
<jdoc:include type="styles" />
<jdoc:include type="scripts" />
</head>

<body class="admin <?php echo $option . ' view-' . $view . ' layout-' . $layout . ($task ? ' task-' . $task : '') . ($monochrome ? ' monochrome' : ''); ?>">
Expand Down Expand Up @@ -196,6 +197,5 @@
</div>
</div>
<jdoc:include type="modules" name="debug" style="none" />
<jdoc:include type="scripts" />
</body>
</html>
2 changes: 1 addition & 1 deletion administrator/templates/atum/error_login.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
<head>
<jdoc:include type="metas" />
<jdoc:include type="styles" />
<jdoc:include type="scripts" />
</head>

<body class="admin <?php echo $option . ' view-' . $view . ' layout-' . $layout . ($task ? ' task-' . $task : '') . ($monochrome ? ' monochrome' : ''); ?>">
Expand Down Expand Up @@ -168,6 +169,5 @@
</div>
</div>
<jdoc:include type="modules" name="debug" style="none" />
<jdoc:include type="scripts" />
</body>
</html>
2 changes: 1 addition & 1 deletion administrator/templates/atum/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<head>
<jdoc:include type="metas" />
<jdoc:include type="styles" />
<jdoc:include type="scripts" />
</head>

<body class="admin <?php echo $option . ' view-' . $view . ' layout-' . $layout . ($task ? ' task-' . $task : '') . ($monochrome || $a11y_mono ? ' monochrome' : '') . ($a11y_contrast ? ' a11y_contrast' : '') . ($a11y_highlight ? ' a11y_highlight' : ''); ?>">
Expand Down Expand Up @@ -178,6 +179,5 @@
</div>
</div>
<jdoc:include type="modules" name="debug" style="none" />
<jdoc:include type="scripts" />
</body>
</html>
2 changes: 1 addition & 1 deletion administrator/templates/atum/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
<head>
<jdoc:include type="metas" />
<jdoc:include type="styles" />
<jdoc:include type="scripts" />
</head>

<body class="admin <?php echo $option . ' view-' . $view . ' layout-' . $layout . ($task ? ' task-' . $task : '') . ($monochrome ? ' monochrome' : ''); ?>">
Expand Down Expand Up @@ -140,6 +141,5 @@
</div>
</div>
<jdoc:include type="modules" name="debug" style="none" />
<jdoc:include type="scripts" />
</body>
</html>
15 changes: 10 additions & 5 deletions build/build-modules-js/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,17 @@
"type": "script",
"uri": "bootstrap.min.js",
"dependencies": [
"jquery"
"jquery",
"jquery-noconflict"
]
},
{
"name": "bootstrap.js.bundle",
"type": "script",
"uri": "bootstrap.bundle.min.js",
"dependencies": [
"jquery"
"jquery",
"jquery-noconflict"
]
}
],
Expand Down Expand Up @@ -418,7 +420,8 @@
"type": "script",
"uri": "jquery.minicolors.min.js",
"dependencies": [
"jquery"
"jquery",
"jquery-noconflict"
],
"attributes": {
"defer": true
Expand All @@ -434,7 +437,8 @@
}
],
"dependencies": [
"jquery"
"jquery",
"jquery-noconflict"
],
"licenseFilename": "LICENSE.md"
},
Expand Down Expand Up @@ -478,7 +482,8 @@
"type": "script",
"uri": "chosen.jquery.js",
"dependencies": [
"jquery"
"jquery",
"jquery-noconflict"
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion build/media_source/com_associations/joomla.asset.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
"uri": "com_associations/sidebyside.min.js",
"dependencies": [
"core",
"jquery"
"jquery",
"jquery-noconflict"
],
"attributes": {
"defer": true
Expand Down
6 changes: 4 additions & 2 deletions build/media_source/com_finder/joomla.asset.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"uri": "com_finder/finder-edit.min.js",
"dependencies": [
"core",
"jquery"
"jquery",
"jquery-noconflict"
],
"attributes": {
"defer": true
Expand All @@ -55,7 +56,8 @@
"uri": "com_finder/index.min.js",
"dependencies": [
"core",
"jquery"
"jquery",
"jquery-noconflict"
],
"attributes": {
"defer": true
Expand Down
1 change: 1 addition & 0 deletions build/media_source/com_joomlaupdate/joomla.asset.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"dependencies": [
"core",
"jquery",
"jquery-noconflict",
"com_joomlaupdate.encryption"
],
"attributes": {
Expand Down
3 changes: 2 additions & 1 deletion build/media_source/com_menus/joomla.asset.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@
"uri": "com_menus/admin-menus-default.min.js",
"dependencies": [
"core",
"jquery"
"jquery",
"jquery-noconflict"
],
"attributes": {
"defer": true
Expand Down
6 changes: 4 additions & 2 deletions build/media_source/legacy/joomla.asset.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"name": "joomla.frontediting",
"type": "script",
"dependencies": [
"jquery"
"jquery",
"jquery-noconflict"
],
"uri": "legacy/frontediting.min.js",
"attributes": {
Expand All @@ -41,7 +42,8 @@
"name": "joomla.treeselectmenu",
"type": "script",
"dependencies": [
"jquery"
"jquery",
"jquery-noconflict"
],
"uri": "legacy/treeselectmenu.min.js",
"attributes": {
Expand Down
8 changes: 8 additions & 0 deletions libraries/src/Document/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,14 @@ public function addScript($url, $options = array(), $attribs = array())
$attribs['type'] = 'text/javascript';
}

// Default to defer.
if ((!isset($attribs['type']) || $attribs['type'] !== 'module')
&& (!isset($attribs['defer']) || $attribs['defer'] !== false)
&& !isset($attribs['async']))
{
$attribs['defer'] = '';
}

$this->_scripts[$url] = isset($this->_scripts[$url]) ? array_replace($this->_scripts[$url], $attribs) : $attribs;
$this->_scripts[$url]['options'] = isset($this->_scripts[$url]['options']) ? array_replace($this->_scripts[$url]['options'], $options) : $options;

Expand Down
52 changes: 26 additions & 26 deletions libraries/src/Document/HtmlDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ class HtmlDocument extends Document
* @var array
* @since 1.7.0
*/
public $_links = array();
public $_links = [];

/**
* Array of custom tags
*
* @var array
* @since 1.7.0
*/
public $_custom = array();
public $_custom = [];

/**
* Name of the template
Expand Down Expand Up @@ -98,7 +98,7 @@ class HtmlDocument extends Document
* @var array
* @since 1.7.0
*/
protected $_template_tags = array();
protected $_template_tags = [];

/**
* Integer with caching setting
Expand All @@ -123,7 +123,7 @@ class HtmlDocument extends Document
*
* @since 1.7.0
*/
public function __construct($options = array())
public function __construct($options = [])
{
parent::__construct($options);

Expand All @@ -143,7 +143,7 @@ public function __construct($options = array())
*/
public function getHeadData()
{
$data = array();
$data = [];
$data['title'] = $this->title;
$data['description'] = $this->description;
$data['link'] = $this->link;
Expand Down Expand Up @@ -203,14 +203,14 @@ public function resetHeadData($types = null)
$this->title = '';
$this->description = '';
$this->link = '';
$this->_metaTags = array();
$this->_links = array();
$this->_styleSheets = array();
$this->_style = array();
$this->_scripts = array();
$this->_script = array();
$this->_custom = array();
$this->scriptOptions = array();
$this->_metaTags = [];
$this->_links = [];
$this->_styleSheets = [];
$this->_style = [];
$this->_scripts = [];
$this->_script = [];
$this->_custom = [];
$this->scriptOptions = [];
}

if (\is_array($types))
Expand Down Expand Up @@ -256,11 +256,11 @@ private function resetHeadDatum($type)
case 'script':
case 'custom':
$realType = '_' . $type;
$this->{$realType} = array();
$this->{$realType} = [];
break;

case 'scriptOptions':
$this->{$type} = array();
$this->{$type} = [];
break;
}
}
Expand Down Expand Up @@ -325,7 +325,7 @@ public function setHeadData($data)
*
* @param array $data The document head data in array form
*
* @return HtmlDocument|null instance of $this to allow chaining or null for empty input data
* @return HtmlDocument|void instance of $this to allow chaining or null for empty input data
*
* @since 1.7.0
*/
Expand Down Expand Up @@ -451,7 +451,7 @@ public function mergeHeadData($data)
*
* @since 1.7.0
*/
public function addHeadLink($href, $relation, $relType = 'rel', $attribs = array())
public function addHeadLink($href, $relation, $relType = 'rel', $attribs = [])
{
$this->_links[$href]['relation'] = $relation;
$this->_links[$href]['relType'] = $relType;
Expand Down Expand Up @@ -539,7 +539,7 @@ public function setHtml5($state)
*
* @since 1.7.0
*/
public function getBuffer($type = null, $name = null, $attribs = array())
public function getBuffer($type = null, $name = null, $attribs = [])
{
// If no type is specified, return the whole buffer
if ($type === null)
Expand Down Expand Up @@ -569,7 +569,7 @@ public function getBuffer($type = null, $name = null, $attribs = array())
}
else
{
$options = array();
$options = [];
$options['nopathway'] = 1;
$options['nomodules'] = 1;
$options['modulemode'] = 1;
Expand Down Expand Up @@ -602,13 +602,13 @@ public function getBuffer($type = null, $name = null, $attribs = array())
*
* @since 1.7.0
*/
public function setBuffer($content, $options = array())
public function setBuffer($content, $options = [])
{
// The following code is just for backward compatibility.
if (\func_num_args() > 1 && !\is_array($options))
{
$args = \func_get_args();
$options = array();
$options = [];
$options['type'] = $args[1];
$options['name'] = $args[2] ?? null;
$options['title'] = $args[3] ?? null;
Expand All @@ -628,7 +628,7 @@ public function setBuffer($content, $options = array())
*
* @since 1.7.0
*/
public function parse($params = array())
public function parse($params = [])
{
return $this->_fetchTemplate($params)->_parseTemplate();
}
Expand All @@ -643,7 +643,7 @@ public function parse($params = array())
*
* @since 1.7.0
*/
public function render($caching = false, $params = array())
public function render($caching = false, $params = [])
{
$this->_caching = $caching;

Expand Down Expand Up @@ -785,7 +785,7 @@ protected function _loadTemplate($directory, $filename)
*
* @since 1.7.0
*/
protected function _fetchTemplate($params = array())
protected function _fetchTemplate($params = [])
{
// Check
$directory = $params['directory'] ?? 'templates';
Expand Down Expand Up @@ -841,7 +841,7 @@ protected function _fetchTemplate($params = array())
*/
protected function _parseTemplate()
{
$matches = array();
$matches = [];

if (preg_match_all('#<jdoc:include\ type="([^"]+)"(.*)\/>#iU', $this->_template, $matches))
{
Expand All @@ -853,7 +853,7 @@ protected function _parseTemplate()
for ($i = \count($matches[0]) - 1; $i >= 0; $i--)
{
$type = $matches[1][$i];
$attribs = empty($matches[2][$i]) ? array() : Utility::parseAttributes($matches[2][$i]);
$attribs = empty($matches[2][$i]) ? [] : Utility::parseAttributes($matches[2][$i]);
$name = $attribs['name'] ?? null;

// Separate buffers to be executed first and last
Expand Down
Loading