Skip to content

Commit

Permalink
Add feature load Bootstrap JS from Astroid core on Joomla 4
Browse files Browse the repository at this point in the history
  • Loading branch information
sonvnn committed Apr 21, 2022
1 parent a2ebaed commit 6c5a21b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion framework/library/astroid/Helper/Head.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static function scripts()
$document->addScript('vendor/jquery/jquery-3.5.1.min.js', 'body');
}
if ($layout !== 'edit' && $getPluginParams->get('astroid_bootstrap_js', 1)) {
if (ASTROID_JOOMLA_VERSION < 4) {
if (ASTROID_JOOMLA_VERSION < 4 || $getPluginParams->get('astroid_load_bootstrap_js', 'core') == 'astroid') {
$document->addScript('vendor/bootstrap/js/bootstrap.bundle.min.js', 'body');
} else {
// Depends on Bootstrap
Expand Down
2 changes: 2 additions & 0 deletions language/en-GB/en-GB.astroid.ini
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,8 @@ ASTROID_LOAD_JQUERY="jQuery Library Loading"
ASTROID_LOAD_JQUERY_DESC="Select whether jQuery Library assets should be loaded Joomla Core or via Astroid Framework."
ASTROID_ENABLE_SHORTCUT_LABEL="Keyboard Shortcuts"
ASTROID_ENABLE_BOOTSTRAP_JS_LABEL="Enable Bootstrap JS"
ASTROID_LOAD_BOOTSTRAP_JS_LABEL="Bootstrap JS Library Loading"
ASTROID_LOAD_BOOTSTRAP_JS_DESC="Select whether Bootstrap Library assets should be loaded Joomla Core or via Astroid Framework."
ASTROID_ENABLE_INLINE_CSS_LABEL="Enable Inline CSS"
ASTROID_ENABLE_INLINE_CSS_DESC="Select whether custom css assets should be loaded inline or via render CSS file. Loading via inline would help speed up your website and improve CSS delivery."
ASTROID_ENABLE_SHORTCUT_DESC="Select whether you'd like to enable keyboard shortcuts for the Astroid backend, available shortcuts are listed here <a href='https://docs.joomdev.com/article/hotkeys/'>https://docs.joomdev.com/article/hotkeys/</a>"
Expand Down
10 changes: 7 additions & 3 deletions plugins/astroid/astroid.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<extension version="3.1" type="plugin" method="upgrade" group="system">
<name>Astroid Plugin</name>
<author>JoomDev/TemPlaza</author>
<creationDate>January 2022</creationDate>
<version>2.5.12</version>
<creationDate>April 2022</creationDate>
<version>2.5.16</version>
<url>https://www.astroidframework.com</url>
<copyright>Copyright (C) 2022 TemPlaza, Inc. All rights reserved.</copyright>
<license>GNU General Public License version 3 or later; see LICENSE.txt</license>
Expand All @@ -27,12 +27,16 @@
</field>
<field name="astroid_load_jquery" type="radio" default="astroid" label="ASTROID_LOAD_JQUERY" description="ASTROID_LOAD_JQUERY_DESC" class="btn-group btn-group-yesno">
<option value="astroid">Astroid</option>
<option value="core">Joomla Core</option>
<option value="core">Joomla</option>
</field>
<field name="astroid_bootstrap_js" type="radio" default="1" label="ASTROID_ENABLE_BOOTSTRAP_JS_LABEL" description="" class="btn-group btn-group-yesno">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="astroid_load_bootstrap_js" type="radio" default="core" label="ASTROID_LOAD_BOOTSTRAP_JS_LABEL" description="ASTROID_LOAD_BOOTSTRAP_JS_DESC" class="btn-group btn-group-yesno">
<option value="astroid">Astroid</option>
<option value="core">Joomla</option>
</field>
<field name="astroid_inline_css" type="radio" default="0" label="ASTROID_ENABLE_INLINE_CSS_LABEL" description="ASTROID_ENABLE_INLINE_CSS_DESC" class="btn-group btn-group-yesno">
<option value="1">JYES</option>
<option value="0">JNO</option>
Expand Down

0 comments on commit 6c5a21b

Please sign in to comment.