diff --git a/astroid/astroid-framework/assets/vendor/astroid/js/script.js b/astroid/astroid-framework/assets/vendor/astroid/js/script.js
index da51db99..b39fe6b3 100644
--- a/astroid/astroid-framework/assets/vendor/astroid/js/script.js
+++ b/astroid/astroid-framework/assets/vendor/astroid/js/script.js
@@ -15,8 +15,18 @@
return;
}
$('.astroid-mobile-menu').astroidMobileMenu();
- $('#astroid-offcanvas').find('ul.menu').astroidMobileMenu();
$('.astroid-mobile-menu').removeClass('d-none');
+ };
+ var initOffcanvasMenu = function () {
+ if (!$('#astroid-offcanvas').length) {
+ return;
+ }
+ $('#astroid-offcanvas').find('ul.menu').astroidMobileMenu();
+ };
+ var initSidebarMenu = function () {
+ if (!$('.astroid-sidebar-menu').length) {
+ return;
+ }
$('.astroid-sidebar-menu .nav-item-caret').click(function () {
$(this).parent('li').siblings('li').children('ul').slideUp();
$(this).parent('li').siblings('li').children('.nav-item-caret').removeClass('open');
@@ -223,6 +233,8 @@
var docReady = function () {
initDisplay();
initMobileMenu();
+ initOffcanvasMenu();
+ initSidebarMenu();
//initMegamenu();
//initSubmenu();
initBackToTop();
diff --git a/astroid/astroid-framework/assets/vendor/astroid/scss/_mobilemenu.scss b/astroid/astroid-framework/assets/vendor/astroid/scss/_mobilemenu.scss
index 4c0e5b2c..0c6abde3 100644
--- a/astroid/astroid-framework/assets/vendor/astroid/scss/_mobilemenu.scss
+++ b/astroid/astroid-framework/assets/vendor/astroid/scss/_mobilemenu.scss
@@ -86,6 +86,40 @@ $menu-indicator-width: 60px !default;
padding: 15px;
}
+ .menu-item.divider.parent {
+ position: relative;
+
+ span.separator~.menu-indicator {
+ &:before {
+ position: absolute;
+ content: '';
+ width: 100%;
+ height: 100%;
+ top: 0;
+ left: 0;
+ }
+
+ border-left: 0;
+ }
+ }
+
+ .menu-item.nav-item-divider.nav-item-parent {
+ position: relative;
+
+ a.item-link-separator~.menu-indicator {
+ &:before {
+ position: absolute;
+ content: '';
+ width: 100%;
+ height: 100%;
+ top: 0;
+ left: 0;
+ }
+
+ border-left: 0;
+ }
+ }
+
.menu-item .menu-indicator {
width: $menu-indicator-width;
text-align: center;
diff --git a/astroid/astroid-framework/astroid.xml b/astroid/astroid-framework/astroid.xml
index a59376fc..ae6792d9 100644
--- a/astroid/astroid-framework/astroid.xml
+++ b/astroid/astroid-framework/astroid.xml
@@ -3,8 +3,8 @@
' . Framework::getDocument()->beutifyURL($matches[1][$key]) . '
');
+ Framework::getReporter('Lazy Load Images')->add('' . $document->beutifyURL($matches[1][$key]) . '
');
}
if (!isset($imageMap[md5($matches[1][$key])])) {
diff --git a/astroid/astroid-framework/framework/library/astroid/Component/Menu.php b/astroid/astroid-framework/framework/library/astroid/Component/Menu.php
index 2f7121de..7a20acdf 100644
--- a/astroid/astroid-framework/framework/library/astroid/Component/Menu.php
+++ b/astroid/astroid-framework/framework/library/astroid/Component/Menu.php
@@ -15,7 +15,7 @@
if (ASTROID_JOOMLA_VERSION == 3) {
\JLoader::register('ModMenuHelper', JPATH_SITE . '/modules/mod_menu/helper.php');
- \JLoader::registerAlias('MenuHelper', 'ModMenuHelper');
+ //\JLoader::registerAlias('MenuHelper', 'ModMenuHelper');
} else {
\JLoader::registerAlias('MenuHelper', '\\Joomla\\Module\\Menu\\Site\\Helper\\MenuHelper');
}
@@ -46,10 +46,10 @@ public static function getMenu($menutype = '', $nav_class = [], $logo = null, $l
$menu_params = new \JRegistry();
$menu_params->loadString($header_menu_params);
- $list = \MenuHelper::getList($menu_params);
- $base = \MenuHelper::getBase($menu_params);
- $active = \MenuHelper::getActive($menu_params);
- $default = \MenuHelper::getDefault();
+ $list = \ModMenuHelper::getList($menu_params);
+ $base = \ModMenuHelper::getBase($menu_params);
+ $active = \ModMenuHelper::getActive($menu_params);
+ $default = \ModMenuHelper::getDefault();
$active_id = $active->id;
$default_id = $default->id;
@@ -573,10 +573,10 @@ public static function getMobileMenu($menutype = '', $nav_class = [])
$menu_params = new \JRegistry();
$menu_params->loadString($header_menu_params);
- $list = \MenuHelper::getList($menu_params);
- $base = \MenuHelper::getBase($menu_params);
- $active = \MenuHelper::getActive($menu_params);
- $default = \MenuHelper::getDefault();
+ $list = \ModMenuHelper::getList($menu_params);
+ $base = \ModMenuHelper::getBase($menu_params);
+ $active = \ModMenuHelper::getActive($menu_params);
+ $default = \ModMenuHelper::getDefault();
$active_id = $active->id;
$default_id = $default->id;
diff --git a/astroid/astroid-framework/framework/library/astroid/Component/Utility.php b/astroid/astroid-framework/framework/library/astroid/Component/Utility.php
index 0e99acec..4a8e9da5 100644
--- a/astroid/astroid-framework/framework/library/astroid/Component/Utility.php
+++ b/astroid/astroid-framework/framework/library/astroid/Component/Utility.php
@@ -223,7 +223,7 @@ public static function colors()
// Dropdown Menu
$dropdown = Style::addCssBySelector('.megamenu-container', 'background-color', $params->get('dropdown_bg_color', ''));
-
+
$submenuDropdown = Style::addCssBySelector('.megamenu-container .nav-submenu .nav-submenu', 'background-color', $params->get('dropdown_bg_color', ''));
Style::addCssBySelector('.has-megamenu.open .arrow', 'border-bottom-color', $params->get('dropdown_bg_color', ''));
@@ -321,13 +321,46 @@ public static function custom()
$document->addCustomTag($params->get('trackingcode', ''));
$document->addStyleDeclaration($params->get('customcss', ''));
- $document->addStyleSheet(explode("\n", $params->get('customcssfiles', '')));
+
+ $customcssfiles = explode("\n", $params->get('customcssfiles'));
+
+ foreach ($customcssfiles as $customcssfile) {
+ @list($file, $shift) = \explode('|', $customcssfile);
+ $shift = $shift ? $shift : 0;
+ $document->addStyleSheet($file, ['rel' => 'stylesheet', 'type' => 'text/css'], $shift);
+ }
$document->addScriptdeclaration($params->get('customjs', ''));
$document->addScript(explode("\n", $params->get('customjsfiles', '')));
$document->addCustomTag($params->get('beforehead', ''));
$document->addCustomTag($params->get('beforebody', ''), 'body');
+
+ // Page level custom code
+ $app = \JFactory::getApplication();
+ $itemid = $app->input->get('Itemid', '', 'INT');
+ if (empty($itemid)) return false;
+
+ $menu = $app->getMenu();
+ $item = $menu->getItem($itemid);
+ $params = $item->getParams();
+
+ $document->addCustomTag($params->get('astroid_trackingcode', ''));
+ $document->addStyleDeclaration($params->get('astroid_customcss', ''));
+
+ $customcssfiles = explode("\n", $params->get('astroid_customcssfiles'));
+
+ foreach ($customcssfiles as $customcssfile) {
+ @list($file, $shift) = \explode('|', $customcssfile);
+ $shift = $shift ? $shift : 0;
+ $document->addStyleSheet($file, ['rel' => 'stylesheet', 'type' => 'text/css'], $shift);
+ }
+
+ $document->addScriptdeclaration($params->get('astroid_customjs', ''));
+ $document->addScript(explode("\n", $params->get('astroid_customjsfiles', '')));
+
+ $document->addCustomTag($params->get('astroid_beforehead', ''));
+ $document->addCustomTag($params->get('astroid_beforebody', ''), 'body');
}
public static function error()
@@ -358,4 +391,4 @@ public static function error()
}
$bodyStyle->render();
}
-}
\ No newline at end of file
+}
diff --git a/astroid/astroid-framework/framework/library/astroid/Document.php b/astroid/astroid-framework/framework/library/astroid/Document.php
index ac499dc6..6f0ab9fc 100644
--- a/astroid/astroid-framework/framework/library/astroid/Document.php
+++ b/astroid/astroid-framework/framework/library/astroid/Document.php
@@ -30,6 +30,7 @@ class Document
protected $minify_html = false;
protected static $_fontawesome = false;
protected static $_layout_paths = [];
+ protected $type = null;
public function __construct()
{
@@ -38,11 +39,18 @@ public function __construct()
$this->minify_js = $params->get('minify_js', false);
$this->minify_html = $params->get('minify_html', false);
+ $doc = \JFactory::getDocument();
+ $this->type = $doc->getType();
$template = Framework::getTemplate();
$this->addLayoutPath(JPATH_SITE . '/templates/' . $template->template . '/html/frontend/');
}
+ public function getType()
+ {
+ return $this->type;
+ }
+
public function addLayoutPath($path)
{
self::$_layout_paths[] = $path;
@@ -104,17 +112,15 @@ public function compress()
$app = \JFactory::getApplication();
$body = $app->getBody();
- if ($this->minify_css) {
- $body = $this->minifyCSS($body);
- }
+ // Stop Minification for RSSFeeds and other doc types.
+ if ($this->type == 'feed') $this->minify_css = $this->minify_js = $this->minify_html = false;
- if ($this->minify_js && !$this->isFrontendEditing()) {
- $body = $this->minifyJS($body);
- }
+ if ($this->minify_css) $body = $this->minifyCSS($body);
- if ($this->minify_html) {
- $body = $this->minifyHTML($body);
- }
+ if ($this->minify_js && !$this->isFrontendEditing()) $body = $this->minifyJS($body);
+
+ if ($this->minify_html) $body = $this->minifyHTML($body);
+
$app->setBody($body);
}
@@ -499,6 +505,11 @@ public function position($position, $style = 'none')
return $return;
}
+ public function hasModule($position, $module)
+ {
+ return in_array($module, array_column(\JModuleHelper::getModules($position), 'module'));
+ }
+
public function loadModule($content)
{
// Expression to search for(module Position)
@@ -779,7 +790,7 @@ public function addStyleDeclaration($content, $device = 'desktop')
$this->_styles[$device][] = trim($content);
}
- public function addStyleSheet($url, $attribs = ['rel' => 'stylesheet', 'type' => 'text/css'])
+ public function addStyleSheet($url, $attribs = ['rel' => 'stylesheet', 'type' => 'text/css'], $shifted = 0)
{
if (!is_array($url)) {
$url = [$url];
@@ -792,7 +803,7 @@ public function addStyleSheet($url, $attribs = ['rel' => 'stylesheet', 'type' =>
}
foreach ($url as $u) {
if (!empty(trim($u))) {
- $stylesheet = ['url' => $u, 'attribs' => $attribs];
+ $stylesheet = ['url' => $u, 'attribs' => $attribs, 'shifted' => $shifted];
$this->_stylesheets[md5($u)] = $stylesheet;
}
}
@@ -814,15 +825,31 @@ public function loadFontAwesome()
Helper\Font::loadFontAwesome();
}
+ public function moveFile(&$array, $a, $b)
+ {
+ $out = array_splice($array, $a, 1);
+ array_splice($array, $b, 0, $out);
+ }
+
public function getStylesheets()
{
+ $keys = array_keys($this->_stylesheets);
+
+ foreach ($keys as $index => $key) {
+ if ($this->_stylesheets[$key]['shifted']) {
+ $newindex = $index + $this->_stylesheets[$key]['shifted'];
+ $this->moveFile($keys, $index, $newindex);
+ }
+ }
+
$content = '';
- foreach ($this->_stylesheets as $stylesheet) {
+ foreach ($keys as $key) {
+ $stylesheet = $this->_stylesheets[$key];
$content .= ' $value) {
$content .= ' ' . $prop . '="' . $value . '"';
}
- $content .= ' />';
+ $content .= ' />' . "\n";
}
return $content;
}
diff --git a/astroid/astroid-framework/framework/library/astroid/Helper/Client.php b/astroid/astroid-framework/framework/library/astroid/Helper/Client.php
index c72a6ed3..3d14eb09 100644
--- a/astroid/astroid-framework/framework/library/astroid/Helper/Client.php
+++ b/astroid/astroid-framework/framework/library/astroid/Helper/Client.php
@@ -169,6 +169,7 @@ public function onContentPrepareForm($form, $data)
$form->loadFile('menu', false);
$form->loadFile('banner', false);
$form->loadFile('og', false);
+ $form->loadFile('custom', false);
$loaded = true;
}
diff --git a/astroid/astroid-framework/framework/library/astroid/Helper/Constants.php b/astroid/astroid-framework/framework/library/astroid/Helper/Constants.php
index 13ec9350..8ca02c2c 100644
--- a/astroid/astroid-framework/framework/library/astroid/Helper/Constants.php
+++ b/astroid/astroid-framework/framework/library/astroid/Helper/Constants.php
@@ -13,7 +13,7 @@
class Constants
{
- public static $astroid_version = '2.4.3';
+ public static $astroid_version = '2.4.4';
public static $fontawesome_version = '5.14.0';
public static $animatecss_version = '3.7.0';
public static $forum_link = 'https://www.joomdev.com/forum/astroid-framework';
diff --git a/astroid/astroid-framework/framework/library/astroid/Helper/Head.php b/astroid/astroid-framework/framework/library/astroid/Helper/Head.php
index 1ce4ba89..90cd83eb 100644
--- a/astroid/astroid-framework/framework/library/astroid/Helper/Head.php
+++ b/astroid/astroid-framework/framework/library/astroid/Helper/Head.php
@@ -10,6 +10,7 @@
namespace Astroid\Helper;
use Astroid\Framework;
+use Astroid\Helper;
defined('_JEXEC') or die;
@@ -42,11 +43,13 @@ public static function scripts()
$app = \JFactory::getApplication();
$layout = $app->input->get('layout', '', 'STRING');
- if ($layout !== 'edit') {
+ $getPluginParams = Helper::getPluginParams();
+
+ if ($layout !== 'edit' && $getPluginParams->get('astroid_bootstrap_js', 1)) {
$document->addScript('vendor/bootstrap/js/popper.min.js', 'body');
$document->addScript('vendor/bootstrap/js/bootstrap.min.js', 'body');
}
-
+
$document->addScript('vendor/jquery/jquery.noConflict.js', 'body');
}
diff --git a/astroid/astroid-framework/language/en-GB/en-GB.astroid.ini b/astroid/astroid-framework/language/en-GB/en-GB.astroid.ini
index 0d08152b..cc5740de 100644
--- a/astroid/astroid-framework/language/en-GB/en-GB.astroid.ini
+++ b/astroid/astroid-framework/language/en-GB/en-GB.astroid.ini
@@ -380,7 +380,7 @@ TPL_ASTROID_CUSTOM_CUSTOM_SCRIPT_LABEL="Custom JS"
TPL_ASTROID_CUSTOM_CUSTOM_SCRIPT_FILES_LABEL="Custom JS Files"
TPL_ASTROID_CUSTOM_CUSTOM_SCRIPT_DESC="You can add custom javascript code here. Do not include <script> tags."
TPL_ASTROID_CUSTOM_CUSTOM_SCRIPT_FILE_DESC="You can include javascript files by adding file path per line. script.js
OR https://www.somewebsite.com/script.js
."
-TPL_ASTROID_CUSTOM_CUSTOM_CSS_FILES_DESC="You can include css files by adding file path per line. You can use Full URL of the CSS file, or path of the CSS file relative to the Joomla root directory.styles.css
OR https://www.somewebsite.com/styles.css
."
+TPL_ASTROID_CUSTOM_CUSTOM_CSS_FILES_DESC="You can include css files by adding file path per line. You can use Full URL of the CSS file, or path of the CSS file relative to the Joomla root directory.styles.css
OR https://www.somewebsite.com/styles.css
YOUR_CSS_FILE.css|-1
(to shift up by 1)YOUR_CSS_FILE.css|2
(to shift down by 2)"
; Social Profile Tab
TPL_ASTROID_SOCIAL_STYLE="Style"
@@ -592,6 +592,7 @@ ASTROID_ARTICLE_TYPE_OPTIONS_TITLE_LABEL=" Blog Options"
ASTROID_ARTICLE_CATEGORY_BLOG_OPTIONS_TITLE_LABEL=" Single Blog Options"
ASTROID_ARTICLE_OPEN_GRAPH_TITLE_LABEL=" Open Graph"
+ASTROID_CUSTOMCODE_OPTIONS_TITLE_LABEL=" Custom Code"
ASTROID_BANNER_ENABLE_LABEL="Enable Banner"
ASTROID_BANNER_ENABLE_TITLE_LABEL="Enable Banner Title"
ASTROID_BANNER_ENABLE_BANNNER_DESC="Enable the banner to show a custom header on your page."
@@ -862,6 +863,7 @@ TPL_ASTROID_OPTIONS_DEFAULT_FONT_WARNING="Default font family will be applied on
ASTROID_LOAD_FONTAWESOME="Font Awesome Loading"
ASTROID_LOAD_FONTAWESOME_DESC="Select whether font awesome assets should be loaded locally or via CDN. Loading via CDN would help speed up your website and local loading can be useful for local development."
ASTROID_ENABLE_SHORTCUT_LABEL="Keyboard Shortcuts"
+ASTROID_ENABLE_BOOTSTRAP_JS_LABEL="Enable Bootstrap JS"
ASTROID_ENABLE_SHORTCUT_DESC="Select whether you'd like to enable keyboard shortcuts for the Astroid backend, available shortcuts are listed here https://docs.joomdev.com/article/hotkeys/"
;Media
diff --git a/astroid/astroid-framework/plugins/astroid/astroid.xml b/astroid/astroid-framework/plugins/astroid/astroid.xml
index db8c11fd..76d53d06 100644
--- a/astroid/astroid-framework/plugins/astroid/astroid.xml
+++ b/astroid/astroid-framework/plugins/astroid/astroid.xml
@@ -2,8 +2,8 @@