diff --git a/administrator/components/com_categories/layouts/joomla/form/field/categoryedit.php b/administrator/components/com_categories/layouts/joomla/form/field/categoryedit.php index 97c87c0b9d80a..3766e3b7ab319 100644 --- a/administrator/components/com_categories/layouts/joomla/form/field/categoryedit.php +++ b/administrator/components/com_categories/layouts/joomla/form/field/categoryedit.php @@ -144,7 +144,7 @@ Text::script('JGLOBAL_SELECT_NO_RESULTS_MATCH'); Text::script('JGLOBAL_SELECT_PRESS_TO_SELECT'); -Factory::getDocument()->getWebAssetManager()->enableAsset('choicesjs'); +Factory::getDocument()->getWebAssetManager()->usePreset('choicesjs'); HTMLHelper::_('webcomponent', 'system/fields/joomla-field-fancy-select.min.js', ['version' => 'auto', 'relative' => true]); ?> diff --git a/administrator/components/com_modules/layouts/joomla/form/field/modulespositionedit.php b/administrator/components/com_modules/layouts/joomla/form/field/modulespositionedit.php index 4c525894a45c1..b44a532c05833 100644 --- a/administrator/components/com_modules/layouts/joomla/form/field/modulespositionedit.php +++ b/administrator/components/com_modules/layouts/joomla/form/field/modulespositionedit.php @@ -72,7 +72,7 @@ Text::script('JGLOBAL_SELECT_NO_RESULTS_MATCH'); Text::script('JGLOBAL_SELECT_PRESS_TO_SELECT'); -Factory::getDocument()->getWebAssetManager()->enableAsset('choicesjs'); +Factory::getDocument()->getWebAssetManager()->usePreset('choicesjs'); HTMLHelper::_('webcomponent', 'system/fields/joomla-field-fancy-select.min.js', ['version' => 'auto', 'relative' => true]); ?> diff --git a/administrator/components/com_modules/tmpl/modules/default_batch_body.php b/administrator/components/com_modules/tmpl/modules/default_batch_body.php index 8d7e80a67da2d..68358c9010956 100644 --- a/administrator/components/com_modules/tmpl/modules/default_batch_body.php +++ b/administrator/components/com_modules/tmpl/modules/default_batch_body.php @@ -31,7 +31,7 @@ Text::script('JGLOBAL_SELECT_NO_RESULTS_MATCH'); Text::script('JGLOBAL_SELECT_PRESS_TO_SELECT'); -$this->document->getWebAssetManager()->enableAsset('choicesjs'); +$this->document->getWebAssetManager()->usePreset('choicesjs'); HTMLHelper::_('webcomponent', 'system/fields/joomla-field-fancy-select.min.js', ['version' => 'auto', 'relative' => true]); ?> diff --git a/administrator/templates/atum/component.php b/administrator/templates/atum/component.php index 29c9d247e1696..d176c0809113d 100644 --- a/administrator/templates/atum/component.php +++ b/administrator/templates/atum/component.php @@ -10,7 +10,6 @@ defined('_JEXEC') or die; use Joomla\CMS\Factory; -use Joomla\CMS\HTML\HTMLHelper; /** @var JDocumentHtml $this */ @@ -18,17 +17,13 @@ $wa = $this->getWebAssetManager(); // Enable assets -$wa->enableAsset('template.atum.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')); -$wa->enableAsset('fontawesome-free'); +$wa->useStyle('template.atum.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')) + ->useStyle('template.active.language') + ->useStyle('template.user'); -// Load specific language related CSS -HTMLHelper::_('stylesheet', 'administrator/language/' . $lang->getTag() . '/' . $lang->getTag() . '.css', ['version' => 'auto']); +// Override 'template.active' asset to set correct ltr/rtl dependency +$wa->registerStyle('template.active', '', [], [], ['template.atum.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')]); -// Load custom stylesheet if available -HTMLHelper::_('stylesheet', 'custom.css', ['version' => 'auto', 'relative' => true]); - -// TODO: remove the following line whenever the assets are fixed to respect the overrides -HTMLHelper::_('stylesheet', 'vendor/choicesjs/choices.css', ['version' => 'auto', 'relative' => true]); ?> diff --git a/administrator/templates/atum/error_full.php b/administrator/templates/atum/error_full.php index 1f4b5da13961f..f4a77b1941b2a 100644 --- a/administrator/templates/atum/error_full.php +++ b/administrator/templates/atum/error_full.php @@ -46,18 +46,12 @@ $logoSmallAlt = htmlspecialchars($this->params->get('altSmallLogo', ''), ENT_COMPAT, 'UTF-8'); // Enable assets -$wa->enableAsset('template.atum.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')); +$wa->usePreset('template.atum.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')) + ->useStyle('template.active.language') + ->useStyle('template.user'); -// Load specific language related CSS -HTMLHelper::_('stylesheet', 'administrator/language/' . $lang->getTag() . '/' . $lang->getTag() . '.css', ['version' => 'auto']); -$wa->enableAsset('fontawesome-free'); - -// Load customer stylesheet if available -HTMLHelper::_('stylesheet', 'custom.css', array('version' => 'auto', 'relative' => true)); - -// Load specific template related JS -// TODO: Adapt refactored build tools pt.2 @see https://issues.joomla.org/tracker/joomla-cms/23786 -HTMLHelper::_('script', 'media/templates/' . $this->template . '/js/template.min.js', ['version' => 'auto']); +// Override 'template.active' asset to set correct ltr/rtl dependency +$wa->registerStyle('template.active', '', [], [], ['template.atum.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')]); // Set some meta data $this->setMetaData('viewport', 'width=device-width, initial-scale=1'); diff --git a/administrator/templates/atum/error_login.php b/administrator/templates/atum/error_login.php index d95929fbb7f35..648a04bc86ef4 100644 --- a/administrator/templates/atum/error_login.php +++ b/administrator/templates/atum/error_login.php @@ -45,18 +45,12 @@ $logoSmallAlt = htmlspecialchars($this->params->get('altSmallLogo', ''), ENT_COMPAT, 'UTF-8'); // Enable assets -$wa->enableAsset('template.atum.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')); +$wa->usePreset('template.atum.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')) + ->useStyle('template.active.language') + ->useStyle('template.user'); -// Load specific language related CSS -HTMLHelper::_('stylesheet', 'administrator/language/' . $lang->getTag() . '/' . $lang->getTag() . '.css', ['version' => 'auto']); -$wa->enableAsset('fontawesome-free'); - -// Load customer stylesheet if available -HTMLHelper::_('stylesheet', 'custom.css', array('version' => 'auto', 'relative' => true)); - -// Load specific template related JS -// TODO: Adapt refactored build tools pt.2 @see https://issues.joomla.org/tracker/joomla-cms/23786 -HTMLHelper::_('script', 'media/templates/' . $this->template . '/js/template.min.js', ['version' => 'auto']); +// Override 'template.active' asset to set correct ltr/rtl dependency +$wa->registerStyle('template.active', '', [], [], ['template.atum.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')]); // Set some meta data $this->setMetaData('viewport', 'width=device-width, initial-scale=1'); diff --git a/administrator/templates/atum/index.php b/administrator/templates/atum/index.php index 641b3ace5414c..d1e6a3c4ca91c 100644 --- a/administrator/templates/atum/index.php +++ b/administrator/templates/atum/index.php @@ -52,21 +52,12 @@ $logoSmallAlt = htmlspecialchars($this->params->get('altSmallLogo', ''), ENT_COMPAT, 'UTF-8'); // Enable assets -$wa->enableAsset('template.atum.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')); -$wa->enableAsset('fontawesome-free'); +$wa->usePreset('template.atum.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')) + ->useStyle('template.active.language') + ->useStyle('template.user'); -// Load specific language related CSS -HTMLHelper::_('stylesheet', 'administrator/language/' . $lang->getTag() . '/' . $lang->getTag() . '.css', ['version' => 'auto']); - -// Load customer stylesheet if available -HTMLHelper::_('stylesheet', 'custom.css', array('version' => 'auto', 'relative' => true)); - -// TODO: remove the following line whenever the assets are fixed to respect the ovverides -HTMLHelper::_('stylesheet', 'vendor/choicesjs/choices.css', array('version' => 'auto', 'relative' => true)); - -// Load specific template related JS -// TODO: Adapt refactored build tools pt.2 @see https://issues.joomla.org/tracker/joomla-cms/23786 -HTMLHelper::_('script', 'media/templates/' . $this->template . '/js/template.min.js', ['version' => 'auto']); +// Override 'template.active' asset to set correct ltr/rtl dependency +$wa->registerStyle('template.active', '', [], [], ['template.atum.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')]); // Set some meta data $this->setMetaData('viewport', 'width=device-width, initial-scale=1'); diff --git a/administrator/templates/atum/joomla.asset.json b/administrator/templates/atum/joomla.asset.json index 9ab3012ebc336..344b459e723ca 100644 --- a/administrator/templates/atum/joomla.asset.json +++ b/administrator/templates/atum/joomla.asset.json @@ -6,40 +6,75 @@ "license": "GPL-2.0-or-later", "assets": [ { - "name": "template.atum.base", + "name": "template.atum.ltr", + "type": "style", + "uri": "template.min.css", "dependencies": [ - "core", - "bootstrap.js.bundle", - "css-vars-ponyfill", - "focus-visible" + "fontawesome" ] }, { - "name": "template.atum.ltr", - "dependencies": ["template.atum.base"], - "css": [ - "template.min.css", - "user.css" + "name": "template.atum.rtl", + "type": "style", + "uri": "template-rtl.min.css", + "dependencies": [ + "fontawesome" ] }, { - "name": "template.atum.rtl", - "dependencies": ["template.atum.base"], - "css": [ - "template-rtl.min.css", - "user.css" + "name": "template.active.language", + "type": "style", + "uri": "", + "class": "LangActiveAssetItem", + "client": "administrator" + }, + { + "name": "template.user", + "type": "style", + "uri": "user.css" + }, + { + "name": "template.atum", + "type": "script", + "uri": "templates/atum/template.min.js", + "dependencies": [ + "core" + ] + }, + { + "name": "template.active", + "type": "script", + "uri": "", + "description": "A dummy asset to allow extensions to use it as a dependency to active template", + "dependencies": [ + "template.atum" + ] + }, + { + "name": "template.atum.base", + "type": "preset", + "dependencies": [ + "core#script", + "bootstrap.js.bundle#script", + "css-vars-ponyfill#script", + "focus-visible#script", + "template.atum#script" ] }, { - "name": "bootstrap.css", - "css": [ - "bootstrap.min.css" + "name": "template.atum.ltr", + "type": "preset", + "dependencies": [ + "template.atum.base", + "template.atum.ltr#style" ] }, { - "name": "fontawesome-free", - "css": [ - "vendor/fontawesome-free/fontawesome.min.css" + "name": "template.atum.rtl", + "type": "preset", + "dependencies": [ + "template.atum.base", + "template.atum.rtl#style" ] } ] diff --git a/administrator/templates/atum/login.php b/administrator/templates/atum/login.php index 1dd89fae5690f..9b3d978b6aac1 100644 --- a/administrator/templates/atum/login.php +++ b/administrator/templates/atum/login.php @@ -48,18 +48,12 @@ $logoSmallAlt = htmlspecialchars($this->params->get('altSmallLogo', ''), ENT_COMPAT, 'UTF-8'); // Enable assets -$wa->enableAsset('template.atum.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')); +$wa->usePreset('template.atum.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')) + ->useStyle('template.active.language') + ->useStyle('template.user'); -// Load specific language related CSS -HTMLHelper::_('stylesheet', 'administrator/language/' . $lang->getTag() . '/' . $lang->getTag() . '.css', ['version' => 'auto']); -$wa->enableAsset('fontawesome-free'); - -// Load customer stylesheet if available -HTMLHelper::_('stylesheet', 'custom.css', array('version' => 'auto', 'relative' => true)); - -// Load specific template related JS -// TODO: Adapt refactored build tools pt.2 @see https://issues.joomla.org/tracker/joomla-cms/23786 -HTMLHelper::_('script', 'media/templates/' . $this->template . '/js/template.min.js', ['version' => 'auto']); +// Override 'template.active' asset to set correct ltr/rtl dependency +$wa->registerStyle('template.active', '', [], [], ['template.atum.' . ($this->direction === 'rtl' ? 'rtl' : 'ltr')]); // Set some meta data $this->setMetaData('viewport', 'width=device-width, initial-scale=1'); diff --git a/build/build-modules-js/init.es6.js b/build/build-modules-js/init.es6.js index 41b375e776455..cfd3e3faf5622 100644 --- a/build/build-modules-js/init.es6.js +++ b/build/build-modules-js/init.es6.js @@ -266,49 +266,23 @@ const copyFiles = (options) => { package: packageName, name: assetInfo.name || vendorName, version: moduleOptions.version, + type: assetInfo.type, }; if (assetInfo.dependencies && assetInfo.dependencies.length) { registryItem.dependencies = assetInfo.dependencies; } - // Update path for JS and CSS files - if (assetInfo.js && assetInfo.js.length) { - registryItem.js = []; + // Update path to file + if (assetInfo.uri && (assetInfo.type === 'script' || assetInfo.type === 'style' || assetInfo.type === 'webcomponent')) { + let itemPath = assetInfo.uri; - assetInfo.js.forEach((assetJS) => { - let itemPath = assetJS; + // Check for external path + if (itemPath.indexOf('http://') !== 0 && itemPath.indexOf('https://') !== 0 && itemPath.indexOf('//') !== 0) { + itemPath = `vendor/${vendorName}/${itemPath}`; + } - // Check for external path - if (itemPath.indexOf('http://') !== 0 && itemPath.indexOf('https://') !== 0 && itemPath.indexOf('//') !== 0) { - itemPath = `media/vendor/${vendorName}/js/${itemPath}`; - } - registryItem.js.push(itemPath); - - // Check if there are any attribute to this file, then update the path - if (assetInfo.attribute && assetInfo.attribute[assetJS]) { - registryItem.attribute[itemPath] = assetInfo.attribute[assetJS]; - } - }); - } - - if (assetInfo.css && assetInfo.css.length) { - registryItem.css = []; - - assetInfo.css.forEach((assetCSS) => { - let itemPath = assetCSS; - - // Check for external path - if (itemPath.indexOf('http://') !== 0 && itemPath.indexOf('https://') !== 0 && itemPath.indexOf('//') !== 0) { - itemPath = `media/vendor/${vendorName}/css/${itemPath}`; - } - registryItem.css.push(itemPath); - - // Check if there are any attribute to this file, then update the path - if (assetInfo.attribute && assetInfo.attribute[assetCSS]) { - registryItem.attribute[itemPath] = assetInfo.attribute[assetCSS]; - } - }); + registryItem.uri = itemPath; } registry.assets.push(registryItem); diff --git a/build/build-modules-js/settings.json b/build/build-modules-js/settings.json index 6568251dd3d81..a489e4e58010b 100644 --- a/build/build-modules-js/settings.json +++ b/build/build-modules-js/settings.json @@ -16,9 +16,22 @@ }, "provideAssets": [ { - "name": null, - "js": ["awesomplete.min.js"], - "css": ["awesomplete.css"] + "name": "awesomplete", + "type": "style", + "uri": "awesomplete.css" + }, + { + "name": "awesomplete", + "type": "script", + "uri": "awesomplete.min.js" + }, + { + "name": "awesomplete", + "type": "preset", + "dependencies": [ + "awesomplete#style", + "awesomplete#script" + ] } ], "dependencies": [], @@ -52,23 +65,27 @@ }, "provideAssets": [ { - "name": "bootstrap.js", - "js": ["bootstrap.min.js"], - "dependencies": ["jquery"] + "name": "bootstrap.css", + "type": "style", + "uri": "bootstrap.min.css" }, { - "name": "bootstrap.js.bundle", - "js": ["bootstrap.bundle.min.js"], - "dependencies": ["jquery"] + "name": "bootstrap.css.grid", + "type": "style", + "uri": "bootstrap-grid.min.css", + "dependencies": ["bootstrap.css"] }, { - "name": "bootstrap.css", - "css": ["bootstrap.min.css"] + "name": "bootstrap.js", + "type": "script", + "uri": "bootstrap.min.js", + "dependencies": ["jquery"] }, { - "name": "bootstrap.css.grid", - "css": ["bootstrap-grid.min.css"], - "dependencies": ["bootstrap.css"] + "name": "bootstrap.js.bundle", + "type": "script", + "uri": "bootstrap.bundle.min.js", + "dependencies": ["jquery"] } ], "dependencies": [], @@ -86,9 +103,22 @@ }, "provideAssets": [ { - "name": null, - "js": ["cropper.min.js"], - "css": ["cropper.min.css"] + "name": "cropperjs", + "type": "style", + "uri": "cropper.min.css" + }, + { + "name": "cropperjs", + "type": "script", + "uri": "cropper.min.js" + }, + { + "name": "cropperjs", + "type": "preset", + "dependencies": [ + "cropperjs#style", + "cropperjs#script" + ] } ], "dependencies": [], @@ -106,11 +136,24 @@ }, "provideAssets": [ { - "name": null, - "js": ["choices.min.js"], - "css": ["choices.min.css"] + "name": "choicesjs", + "type": "style", + "uri": "choices.min.css" + }, + { + "name": "choicesjs", + "type": "script", + "uri": "choices.min.js" + }, + { + "name": "choicesjs", + "type": "preset", + "dependencies": [ + "choicesjs#style", + "choicesjs#script" + ] } - ], + ], "dependencies": [], "licenseFilename": "LICENSE" }, @@ -122,8 +165,9 @@ }, "provideAssets": [ { - "name": null, - "js": ["diff.js"] + "name": "diff", + "type": "script", + "uri": "diff.js" } ], "dependencies": [], @@ -141,9 +185,22 @@ }, "provideAssets": [ { - "name": null, - "js": ["dragula.min.js"], - "css": ["dragula.min.css"] + "name": "dragula", + "type": "style", + "uri": "dragula.min.css" + }, + { + "name": "dragula", + "type": "script", + "uri": "dragula.min.js" + }, + { + "name": "dragula", + "type": "preset", + "dependencies": [ + "dragula#style", + "dragula#script" + ] } ], "dependencies": [], @@ -158,8 +215,9 @@ }, "provideAssets": [ { - "name": null, - "js": ["focus-visible.min.js"] + "name": "focus-visible", + "type": "script", + "uri": "focus-visible.min.js" } ], "dependencies": [], @@ -186,8 +244,9 @@ }, "provideAssets": [ { - "name": null, - "css": ["fontawesome.min.css"] + "name": "fontawesome", + "type": "style", + "uri": "fontawesome.min.css" } ], "dependencies": [], @@ -204,8 +263,9 @@ }, "provideAssets": [ { - "name": null, - "js": ["jquery.min.js"] + "name": "jquery", + "type": "script", + "uri": "jquery.min.js" } ], "dependencies": [], @@ -219,8 +279,9 @@ }, "provideAssets": [ { - "name": null, - "js": ["jquery-migrate.min.js"], + "name": "jquery-migrate", + "type": "script", + "uri": "jquery-migrate.min.js", "dependencies": ["jquery"] } ], @@ -247,6 +308,28 @@ "dist/css/joomla-tab.css": "css/joomla-tab.css", "dist/css/joomla-tab.min.css": "css/joomla-tab.min.css" }, + "provideAssets": [ + { + "name": "joomla-alert", + "type": "style", + "uri": "joomla-alert.min.css" + }, + { + "name": "joomla-tab", + "type": "style", + "uri": "joomla-tab.min.css" + }, + { + "name": "joomla-alert", + "type": "webcomponent", + "uri": "joomla-alert.min.js" + }, + { + "name": "joomla-tab", + "type": "webcomponent", + "uri": "joomla-tab.min.js" + } + ], "dependencies": [], "licenseFilename": "LICENSE" }, @@ -283,8 +366,9 @@ }, "provideAssets": [ { - "name": null, - "js": ["punycode.js"] + "name": "punycode", + "type": "script", + "uri": "punycode.js" } ], "dependencies": [], @@ -304,10 +388,23 @@ }, "provideAssets": [ { - "name": null, - "js": ["jquery.minicolors.min.js"], - "css": ["jquery.minicolors.css"], + "name": "minicolors", + "type": "style", + "uri": "jquery.minicolors.css" + }, + { + "name": "minicolors", + "type": "script", + "uri": "jquery.minicolors.min.js", "dependencies": ["jquery"] + }, + { + "name": "minicolors", + "type": "preset", + "dependencies": [ + "minicolors#style", + "minicolors#script" + ] } ], "dependencies": [ @@ -344,8 +441,9 @@ }, "provideAssets": [ { - "name": null, - "js": ["css-vars-ponyfill.min.js"] + "name": "css-vars-ponyfill", + "type": "script", + "uri": "css-vars-ponyfill.min.js" } ] }, @@ -361,10 +459,25 @@ }, "provideAssets": [ { - "name": null, - "js": ["chosen.jquery.js"], - "css": ["chosen.css"], - "dependencies": ["jquery"] + "name": "chosen", + "type": "style", + "uri": "chosen.css" + }, + { + "name": "chosen", + "type": "script", + "uri": "chosen.jquery.js", + "dependencies": [ + "jquery" + ] + }, + { + "name": "chosen", + "type": "preset", + "dependencies": [ + "chosen#style", + "chosen#script" + ] } ] }, @@ -397,11 +510,29 @@ }, "provideAssets": [ { - "name": null, - "js": [ - "qrcode.js", - "qrcode_SJIS.js", - "qrcode_UTF8.js" + "name": "qrcode", + "type": "script", + "uri": "qrcode.js" + }, + { + "name": "qrcode_SJIS", + "type": "script", + "uri": "qrcode_SJIS.js", + "dependencies": ["qrcode"] + }, + { + "name": "qrcode_UTF8", + "type": "script", + "uri": "qrcode_UTF8.js", + "dependencies": ["qrcode"] + }, + { + "name": "qrcode", + "type": "preset", + "dependencies": [ + "qrcode#script", + "qrcode_SJIS#script", + "qrcode_UTF8#script" ] } ] diff --git a/build/media_source/legacy/joomla.asset.json b/build/media_source/legacy/joomla.asset.json index aed808576aa96..5718db7e75ac1 100644 --- a/build/media_source/legacy/joomla.asset.json +++ b/build/media_source/legacy/joomla.asset.json @@ -7,30 +7,27 @@ "assets": [ { "name": "jquery-noconflict", + "type": "script", "dependencies": [ "jquery" ], - "js": [ - "media/legacy/js/jquery-noconflict.min.js" - ] + "uri": "legacy/jquery-noconflict.min.js" }, { "name": "jquery.ui.core", + "type": "script", "dependencies": [ "jquery" ], - "js": [ - "media/vendor/jquery-ui/js/jquery.ui.core.js" - ] + "uri": "vendor/jquery-ui/jquery.ui.core.js" }, { "name": "jquery.ui.sortable", + "type": "script", "dependencies": [ "jquery.ui.core" ], - "js": [ - "media/vendor/jquery-ui/js/jquery.ui.sortable.js" - ] + "uri": "vendor/jquery-ui/jquery.ui.sortable.js" } ] } diff --git a/build/media_source/system/joomla.asset.json b/build/media_source/system/joomla.asset.json index 689910f031ffd..5bfc2260bd13b 100644 --- a/build/media_source/system/joomla.asset.json +++ b/build/media_source/system/joomla.asset.json @@ -7,66 +7,82 @@ "assets": [ { "name": "core", + "type": "script", "class": "CoreAssetItem", - "js": [ - "media/system/js/core.min.js" - ] + "uri": "system/core.min.js" }, { "name": "keepalive", + "type": "script", "class": "KeepaliveAssetItem", "dependencies": [ "core" ], - "js": [ - "media/system/js/keepalive.min.js" - ] + "uri": "system/keepalive.min.js" + }, + { + "name": "template.active", + "type": "style", + "uri": "", + "description": "A dummy asset to allow to extensions to use it as dependency to active template" + }, + { + "name": "template.active", + "type": "script", + "uri": "", + "description": "A dummy asset to allow to extensions to use it as dependency to active template" }, { "name": "multiselect", + "type": "script", "dependencies": [ "core" ], - "js": [ - "media/system/js/multiselect.min.js" - ] + "uri": "system/multiselect.min.js" }, { "name": "searchtools", + "type": "script", "dependencies": [ "core" ], - "js": [ - "media/system/js/searchtools.min.js" - ], - "css": [ - "system/searchtools.css" + "uri": "system/searchtools.min.js" + }, + { + "name": "searchtools", + "type": "style", + "uri": "system/searchtools.css" + }, + { + "name": "searchtools", + "type": "preset", + "dependencies": [ + "searchtools#style", + "searchtools#script" ] }, { "name": "showon", + "type": "script", "dependencies": [ "core" ], - "js": [ - "media/system/js/showon.min.js" - ] + "uri": "system/showon.min.js" }, { "name": "switcher", - "css": [ - "media/system/css/fields/switcher.min.css" - ] + "type": "style", + "uri": "media/system/css/fields/switcher.min.css" }, { - "name": "fields.validate", + "name": "form.validate", + "type": "script", + "class": "FormValidateAssetItem", "dependencies": [ "core", "punycode" ], - "js": [ - "media/system/js/fields/validate.min.js" - ] + "uri": "media/system/js/fields/validate.min.js" } ] } diff --git a/components/com_finder/tmpl/search/default_form.php b/components/com_finder/tmpl/search/default_form.php index 9fc621ef4d70c..91ebe6533d0f2 100644 --- a/components/com_finder/tmpl/search/default_form.php +++ b/components/com_finder/tmpl/search/default_form.php @@ -18,7 +18,7 @@ */ if ($this->params->get('show_autosuggest', 1)) { - $this->document->getWebAssetManager()->enableAsset('awesomplete'); + $this->document->getWebAssetManager()->usePreset('awesomplete'); $this->document->addScriptOptions('finder-search', array('url' => Route::_('index.php?option=com_finder&task=suggestions.suggest&format=json&tmpl=component'))); } diff --git a/layouts/joomla/content/icons.php b/layouts/joomla/content/icons.php index bd8e23a34b270..df977b85611ff 100644 --- a/layouts/joomla/content/icons.php +++ b/layouts/joomla/content/icons.php @@ -19,7 +19,7 @@
- getDocument()->getWebAssetManager()->enableAsset('bootstrap.js.bundle'); ?> + getDocument()->getWebAssetManager()->useScript('bootstrap.js.bundle'); ?>