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
21 changes: 18 additions & 3 deletions build/build-modules-js/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,12 @@
"provideAssets": [
{
"name": null,
"js": ["jquery.min.js"]
"js": ["jquery.min.js"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not do these kind of changes un its own pr in the main repo?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that true, I even have plan to do it for whole jquery.php
but I have include it here, because without this your pull not work

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, no, sorry, I confused with settings.json
settings.json changes must be here, because we going to add attribute (defer:fase) to jquery.min.js, which already exist in settings.json

"attribute": {
"jquery.min.js": {
"defer": false
}
}
}
],
"dependencies": [],
Expand All @@ -274,7 +279,12 @@
{
"name": null,
"js": ["jquery-migrate.min.js"],
"dependencies": ["jquery"]
"dependencies": ["jquery"],
"attribute": {
"jquery-migrate.min.js": {
"defer": false
}
}
}
],
"dependencies": [
Expand Down Expand Up @@ -398,7 +408,12 @@
"provideAssets": [
{
"name": null,
"js": ["css-vars-ponyfill.min.js"]
"js": ["css-vars-ponyfill.min.js"],
"attribute": {
"css-vars-ponyfill.min.js": {
"defer": false
}
}
}
]
},
Expand Down
7 changes: 6 additions & 1 deletion build/media/legacy/joomla.asset.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@
],
"js": [
"media/legacy/js/jquery-noconflict.min.js"
]
],
"attribute": {
"media/legacy/js/jquery-noconflict.min.js": {
"defer": false
}
}
}
}
}
15 changes: 6 additions & 9 deletions libraries/cms/html/jquery.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ abstract class JHtmlJquery
* @return void
*
* @since 3.0
*
* @deprecated 5.0 Use $app->getDocument()->getWebAssetManager()->enableAsset('jquery')
*/
public static function framework($noConflict = true, $debug = null, $migrate = false)
{
Expand All @@ -48,24 +50,19 @@ public static function framework($noConflict = true, $debug = null, $migrate = f
return;
}

// If no debugging value is set, use the configuration setting
if ($debug === null)
{
$debug = (boolean) Factory::getApplication()->get('debug');
}

HTMLHelper::_('script', 'vendor/jquery/jquery.min.js', array('version' => 'auto', 'relative' => true, 'detectDebug' => $debug), ['defer' => false]);
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->enableAsset('jquery');

// Check if we are loading in noConflict
if ($noConflict)
{
HTMLHelper::_('script', 'legacy/jquery-noconflict.min.js', array('version' => 'auto', 'relative' => true), ['defer' => false]);
$wa->enableAsset('jquery-noconflict');
}

// Check if we are loading Migrate
if ($migrate)
{
HTMLHelper::_('script', 'vendor/jquery-migrate/jquery-migrate.min.js', array('version' => 'auto', 'relative' => true, 'detectDebug' => $debug), ['defer' => false]);
$wa->enableAsset('jquery-migrate');
}

static::$loaded[__METHOD__] = true;
Expand Down