Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 0 additions & 3 deletions administrator/templates/atum/component.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@

$lang = Factory::getLanguage();

// Alerts
HTMLHelper::_('webcomponent', 'vendor/joomla-custom-elements/joomla-alert.min.js', ['relative' => true, 'version' => 'auto', 'detectBrowser' => false, 'detectDebug' => false]);

// Add JavaScript Frameworks
HTMLHelper::_('bootstrap.framework');
HTMLHelper::_('script', 'vendor/focus-visible/focus-visible.min.js', ['version' => 'auto', 'relative' => true]);
Expand Down
3 changes: 0 additions & 3 deletions administrator/templates/atum/error_full.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@
// Load custom CSS file
HTMLHelper::_('stylesheet', 'user.css', array('version' => 'auto', 'relative' => true));

// Alerts
HTMLHelper::_('webcomponent', 'vendor/joomla-custom-elements/joomla-alert.min.js', ['relative' => true, 'version' => 'auto', 'detectBrowser' => false, 'detectDebug' => false]);

// Load specific language related CSS
HTMLHelper::_('stylesheet', 'administrator/language/' . $lang->getTag() . '/' . $lang->getTag() . '.css', array('version' => 'auto'));

Expand Down
4 changes: 0 additions & 4 deletions administrator/templates/atum/error_login.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
HTMLHelper::_('stylesheet', 'font-awesome.min.css', ['version' => 'auto', 'relative' => true]);
HTMLHelper::_('stylesheet', 'template' . ($this->direction === 'rtl' ? '-rtl' : '') . '.min.css', ['version' => 'auto', 'relative' => true]);

// Alerts
HTMLHelper::_('webcomponent', 'vendor/joomla-custom-elements/joomla-alert.min.js', ['relative' => true, 'version' => 'auto']);


// Load custom CSS file
HTMLHelper::_('stylesheet', 'user.css', array('version' => 'auto', 'relative' => true));

Expand Down
7 changes: 3 additions & 4 deletions administrator/templates/atum/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,16 @@
HTMLHelper::_('bootstrap.framework');
HTMLHelper::_('script', 'vendor/focus-visible/focus-visible.min.js', ['version' => 'auto', 'relative' => true]);

// Load template CSS file
// Load the dependencies CSS files
HTMLHelper::_('stylesheet', 'bootstrap.css', ['version' => 'auto', 'relative' => true]);
HTMLHelper::_('stylesheet', 'font-awesome.css', ['version' => 'auto', 'relative' => true]);

// Load the template CSS file
HTMLHelper::_('stylesheet', 'template' . ($this->direction === 'rtl' ? '-rtl' : '') . '.css', ['version' => 'auto', 'relative' => true]);

// Load custom CSS file
HTMLHelper::_('stylesheet', 'user.css', array('version' => 'auto', 'relative' => true));

// Alerts
HTMLHelper::_('webcomponent', 'vendor/joomla-custom-elements/joomla-alert.min.js', ['relative' => true, 'version' => 'auto', 'detectBrowser' => false, 'detectDebug' => false]);

// Load specific language related CSS
HTMLHelper::_('stylesheet', 'administrator/language/' . $lang->getTag() . '/' . $lang->getTag() . '.css', array('version' => 'auto'));

Expand Down
4 changes: 0 additions & 4 deletions administrator/templates/atum/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@
HTMLHelper::_('stylesheet', 'font-awesome.css', ['version' => 'auto', 'relative' => true]);
HTMLHelper::_('stylesheet', 'template' . ($this->direction === 'rtl' ? '-rtl' : '') . '.css', ['version' => 'auto', 'relative' => true]);

// Alerts
HTMLHelper::_('webcomponent', 'vendor/joomla-custom-elements/joomla-alert.min.js', ['relative' => true, 'version' => 'auto']);


// Load custom CSS file
HTMLHelper::_('stylesheet', 'user.css', array('version' => 'auto', 'relative' => true));

Expand Down
3 changes: 3 additions & 0 deletions layouts/joomla/system/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
defined('JPATH_BASE') or die;

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

$msgList = $displayData['msgList'];
Expand All @@ -26,6 +27,8 @@
'message' => 'success'
];

// Alerts progressive enhancement
HTMLHelper::_('webcomponent', 'vendor/joomla-custom-elements/joomla-alert.min.js', ['relative' => true, 'version' => 'auto', 'detectBrowser' => false, 'detectDebug' => false]);
?>
<div id="system-message-container">
<div id="system-message">
Expand Down
2 changes: 1 addition & 1 deletion libraries/src/Document/HtmlDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -760,7 +760,7 @@ protected function _parseTemplate()
$name = $attribs['name'] ?? null;

// Separate buffers to be executed first and last
if ($type == 'module' || $type == 'modules')
if ($type === 'module' || $type === 'modules' || $type === 'message')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@wilsonge @mbabker @laoneo was there some specific reason we postponed the loading of the alerts? Do I miss something here?

Copy link
Contributor

Choose a reason for hiding this comment

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

You need to execute the modules (so they can add stylesheets etc) before you can add the scripts and stylesheets into the body I would guess

Copy link
Contributor

Choose a reason for hiding this comment

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

Careful: This is altering the execution sequence. At present, a module that calls $app->enqueueMessage() will have the message rendered correctly on the page. Correct me if I'm wrong, but with this change the message will only be rendered if the module jdoc is below the message jdoc on the page (since they're executed in reverse order of their position).

{
$template_tags_first[$matches[0][$i]] = array('type' => $type, 'name' => $name, 'attribs' => $attribs);
}
Expand Down
3 changes: 0 additions & 3 deletions templates/cassiopeia/error.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@
// Load custom CSS file
HTMLHelper::_('stylesheet', 'user.css', array('version' => 'auto', 'relative' => true));

// Alerts progressive enhancement
HTMLHelper::_('webcomponent', 'vendor/joomla-custom-elements/joomla-alert.min.js', ['relative' => true, 'version' => 'auto', 'detectBrowser' => false, 'detectDebug' => false]);

// Load specific language related CSS
HTMLHelper::_('stylesheet', 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css', array('version' => 'auto'));

Expand Down
3 changes: 0 additions & 3 deletions templates/cassiopeia/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,6 @@
// Load custom CSS file
HTMLHelper::_('stylesheet', 'user.css', array('version' => 'auto', 'relative' => true));

// Alerts progressive enhancement
HTMLHelper::_('webcomponent', 'vendor/joomla-custom-elements/joomla-alert.min.js', ['relative' => true, 'version' => 'auto', 'detectBrowser' => false, 'detectDebug' => false]);

// Load specific language related CSS
HTMLHelper::_('stylesheet', 'language/' . $lang->getTag() . '/' . $lang->getTag() . '.css', array('version' => 'auto'));

Expand Down
6 changes: 0 additions & 6 deletions templates/cassiopeia/offline.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,10 @@
// Add JavaScript Frameworks
HTMLHelper::_('behavior.core');

// Add template js
HTMLHelper::_('script', 'template.js', ['version' => 'auto', 'relative' => true]);

// Add Stylesheets
HTMLHelper::_('stylesheet', 'template.css', ['version' => 'auto', 'relative' => true]);
HTMLHelper::_('stylesheet', 'offline.css', ['version' => 'auto', 'relative' => true]);

// Alerts progressive enhancement
HTMLHelper::_('webcomponent', 'vendor/joomla-custom-elements/joomla-alert.min.js', ['relative' => true, 'version' => 'auto', 'detectBrowser' => false, 'detectDebug' => false]);

// Template color
if ($this->params->get('templateColor'))
{
Expand Down