mirror of
https://github.com/joomla/joomla-cms.git
synced 2024-06-30 17:13:41 +00:00
[4.0] WebAsset for modules (#28423)
This commit is contained in:
parent
6016e0a49b
commit
1c392c66fd
|
@ -13,11 +13,13 @@ use Joomla\CMS\HTML\HTMLHelper;
|
|||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
HTMLHelper::_('behavior.core');
|
||||
HTMLHelper::_('behavior.formvalidator');
|
||||
HTMLHelper::_('behavior.keepalive');
|
||||
HTMLHelper::_('script', 'system/fields/passwordview.min.js', ['version' => 'auto', 'relative' => true]);
|
||||
HTMLHelper::_('script', 'mod_login/admin-login.min.js', ['version' => 'auto', 'relative' => true]);
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $app->getDocument()->getWebAssetManager();
|
||||
$wa->useScript('core')
|
||||
->useScript('form.validate')
|
||||
->useScript('keepalive')
|
||||
->useScript('field.passwordview')
|
||||
->registerAndUseScript('mod_login.admin', 'mod_login/admin-login.min.js', [], ['defer' => true], ['core', 'form.validate']);
|
||||
|
||||
Text::script('JSHOWPASSWORD');
|
||||
Text::script('JHIDEPASSWORD');
|
||||
|
|
|
@ -13,8 +13,9 @@ use Joomla\CMS\HTML\HTMLHelper;
|
|||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
HTMLHelper::_('bootstrap.framework');
|
||||
HTMLHelper::_('script', 'mod_multilangstatus/admin-multilangstatus.min.js', array('version' => 'auto', 'relative' => true));
|
||||
$app->getDocument()->getWebAssetManager()
|
||||
->registerAndUseScript('mod_multilangstatus.admin', 'mod_multilangstatus/admin-multilangstatus.min.js', [], ['defer' => true]);
|
||||
|
||||
?>
|
||||
|
||||
<div class="header-item-content multilanguage">
|
||||
|
|
|
@ -12,7 +12,9 @@ defined('_JEXEC') or die;
|
|||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
HTMLHelper::_('script', 'mod_quickicon/quickicon.min.js', ['version' => 'auto', 'relative' => true]);
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $app->getDocument()->getWebAssetManager();
|
||||
$wa->registerAndUseScript('mod_quickicon', 'mod_quickicon/quickicon.min.js', [], ['defer' => true]);
|
||||
|
||||
$html = HTMLHelper::_('icons.buttons', $buttons);
|
||||
?>
|
||||
|
|
|
@ -9,13 +9,11 @@
|
|||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
HTMLHelper::_('bootstrap.framework');
|
||||
HTMLHelper::_('form.csrf');
|
||||
HTMLHelper::_('script', 'mod_sampledata/sampledata-process.js', ['version' => 'auto', 'relative' => true]);
|
||||
$app->getDocument()->getWebAssetManager()
|
||||
->registerAndUseScript('mod_sampledata', 'mod_sampledata/sampledata-process.js', [], ['defer' => true], ['core']);
|
||||
|
||||
Text::script('MOD_SAMPLEDATA_CONFIRM_START');
|
||||
Text::script('MOD_SAMPLEDATA_ITEM_ALREADY_PROCESSED');
|
||||
|
|
|
@ -110,6 +110,17 @@
|
|||
"dragula"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "field.passwordview",
|
||||
"type": "script",
|
||||
"uri": "system/fields/passwordview.min.js",
|
||||
"attributes": {
|
||||
"defer": true
|
||||
},
|
||||
"dependencies": [
|
||||
"core"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "webcomponent.field-fancy-select",
|
||||
"type": "script",
|
||||
|
|
|
@ -9,15 +9,13 @@
|
|||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
HTMLHelper::_('behavior.core');
|
||||
|
||||
Text::script('MOD_FINDER_SEARCH_VALUE', true);
|
||||
|
||||
HTMLHelper::_('stylesheet', 'com_finder/finder.css', array('version' => 'auto', 'relative' => true));
|
||||
HTMLHelper::_('script', 'com_finder/finder.js', array('version' => 'auto', 'relative' => true));
|
||||
$this->document->getWebAssetManager()
|
||||
->registerAndUseStyle('com_finder', 'com_finder/finder.css')
|
||||
->registerAndUseScript('com_finder', 'com_finder/finder.js', [], ['defer' => true], ['core']);
|
||||
|
||||
?>
|
||||
<div class="com-finder finder">
|
||||
|
|
|
@ -9,10 +9,10 @@
|
|||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
HTMLHelper::_('script', 'com_wrapper/iframe-height.min.js', array('version' => 'auto', 'relative' => true));
|
||||
$this->document->getWebAssetManager()
|
||||
->registerAndUseScript('com_wrapper.iframe', 'com_wrapper/iframe-height.min.js', [], ['defer' => true]);
|
||||
|
||||
?>
|
||||
<div class="com-wrapper contentpane">
|
||||
|
|
|
@ -43,7 +43,9 @@ else
|
|||
$output .= $input;
|
||||
}
|
||||
|
||||
HTMLHelper::_('script', 'com_finder/finder.js', array('version' => 'auto', 'relative' => true));
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $app->getDocument()->getWebAssetManager();
|
||||
$wa->registerAndUseScript('com_finder', 'com_finder/finder.js', [], ['defer' => true]);
|
||||
|
||||
Text::script('MOD_FINDER_SEARCH_VALUE', true);
|
||||
|
||||
|
@ -52,7 +54,7 @@ Text::script('MOD_FINDER_SEARCH_VALUE', true);
|
|||
*/
|
||||
if ($params->get('show_autosuggest', 1))
|
||||
{
|
||||
$app->getDocument()->getWebAssetManager()->usePreset('awesomplete');
|
||||
$wa->usePreset('awesomplete');
|
||||
$app->getDocument()->addScriptOptions('finder-search', array('url' => Route::_('index.php?option=com_finder&task=suggestions.suggest&format=json&tmpl=component')));
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -12,7 +12,9 @@ defined('_JEXEC') or die;
|
|||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Uri\Uri;
|
||||
|
||||
HTMLHelper::_('stylesheet', 'mod_languages/template.css', array('version' => 'auto', 'relative' => true));
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $app->getDocument()->getWebAssetManager();
|
||||
$wa->registerAndUseStyle('mod_languages', 'mod_languages/template.css');
|
||||
|
||||
?>
|
||||
<div class="mod-languages">
|
||||
|
|
|
@ -15,9 +15,10 @@ use Joomla\CMS\Language\Text;
|
|||
use Joomla\CMS\Plugin\PluginHelper;
|
||||
use Joomla\CMS\Router\Route;
|
||||
|
||||
HTMLHelper::_('behavior.core');
|
||||
HTMLHelper::_('behavior.keepalive');
|
||||
HTMLHelper::_('script', 'system/fields/passwordview.min.js', array('version' => 'auto', 'relative' => true));
|
||||
$app->getDocument()->getWebAssetManager()
|
||||
->useScript('core')
|
||||
->useScript('keepalive')
|
||||
->useScript('field.passwordview');
|
||||
|
||||
Text::script('JSHOWPASSWORD');
|
||||
Text::script('JHIDEPASSWORD');
|
||||
|
|
|
@ -10,9 +10,10 @@
|
|||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\Helper\ModuleHelper;
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
|
||||
HTMLHelper::_('script', 'mod_menu/menu.min.js', array('version' => 'auto', 'relative' => true));
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $app->getDocument()->getWebAssetManager();
|
||||
$wa->registerAndUseScript('mod_menu', 'mod_menu/menu.min.js', [], ['defer' => true]);
|
||||
|
||||
$id = '';
|
||||
|
||||
|
|
|
@ -9,10 +9,12 @@
|
|||
|
||||
defined('_JEXEC') or die;
|
||||
|
||||
use Joomla\CMS\HTML\HTMLHelper;
|
||||
use Joomla\CMS\Language\Text;
|
||||
|
||||
HTMLHelper::_('script', 'com_wrapper/iframe-height.min.js', array('version' => 'auto', 'relative' => true));
|
||||
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $app->getDocument()->getWebAssetManager();
|
||||
$wa->registerAndUseScript('com_wrapper.iframe', 'com_wrapper/iframe-height.min.js', [], ['defer' => true]);
|
||||
|
||||
?>
|
||||
<iframe <?php echo $load; ?>
|
||||
id="blockrandom-<?php echo $id; ?>"
|
||||
|
|
Loading…
Reference in New Issue
Block a user