-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #816 from templaza/v3
v3.1.5
- Loading branch information
Showing
14 changed files
with
177 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<?php | ||
|
||
/** | ||
* @package Astroid Framework | ||
* @author Astroid Framework Team https://astroidframe.work | ||
* @copyright Copyright (C) 2023 AstroidFrame.work. | ||
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 or Later | ||
* DO NOT MODIFY THIS FILE DIRECTLY AS IT WILL BE OVERWRITTEN IN THE NEXT UPDATE | ||
* You can easily override all files under /astroid/ folder. | ||
* Just copy the file to JROOT/templates/YOUR_ASTROID_TEMPLATE/astroid/elements/module_position/module_position.php folder to create and override | ||
*/ | ||
|
||
// No direct access. | ||
defined('_JEXEC') or die; | ||
|
||
use Astroid\Framework; | ||
use Astroid\Helper; | ||
use Joomla\CMS\Factory; | ||
|
||
extract($displayData); | ||
$document = Framework::getDocument(); | ||
$astroid_libs = json_decode($params->get('astroid_libs', '[]'), true); | ||
if (count($astroid_libs)) { | ||
foreach ($astroid_libs as $lib) { | ||
switch ($lib['value']) { | ||
case 'gsap': | ||
$document->loadGSAP(); | ||
break; | ||
case 'gsap.Flip': | ||
$document->loadGSAP('Flip'); | ||
break; | ||
case 'fancybox': | ||
$document->loadFancyBox(); | ||
break; | ||
case 'masonry': | ||
$document->loadMasonry(); | ||
break; | ||
case 'slick': | ||
$document->loadSlick(); | ||
break; | ||
case 'imagesloaded': | ||
$document->loadImagesLoaded(); | ||
break; | ||
} | ||
} | ||
} | ||
$wa = Factory::getApplication()->getDocument()->getWebAssetManager(); | ||
$external_css = $params->get('external_css', ''); | ||
if (!empty($external_css)) { | ||
$external_css = json_decode($external_css); | ||
if (count($external_css)) { | ||
foreach ($external_css as $key => $css) { | ||
$css_params = Helper::loadParams($css->params); | ||
$wa->registerAndUseStyle($element->id.'.css-'.$key, $css_params->get('url', '')); | ||
} | ||
} | ||
} | ||
$external_js = $params->get('external_js', ''); | ||
if (!empty($external_js)) { | ||
$external_js = json_decode($external_js); | ||
if (count($external_js)) { | ||
foreach ($external_js as $key => $js) { | ||
$js_params = Helper::loadParams($js->params); | ||
$wa->registerAndUseScript($element->id.'.js-'.$key, $js_params->get('url', '')); | ||
} | ||
} | ||
} | ||
echo $params->get('custom_html', ''); | ||
$custom_css = $params->get('custom_css', ''); | ||
$custom_js = $params->get('custom_js', ''); | ||
if (!empty($custom_css)) { | ||
$wa->addInlineStyle($custom_css); | ||
} | ||
if (!empty($custom_js)) { | ||
$wa->addInlineScript($custom_js); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<element> | ||
<title>ASTROID_WIDGET_CODEPEN_LABEL</title> | ||
<description>ASTROID_WIDGET_CODEPEN_LABEL</description> | ||
<icon>fa-brands fa-codepen</icon> | ||
<category>ASTROID_ELEMENT_CATEGORY_ADVANCED,ASTROID_ELEMENT_CATEGORY_UTILITY</category> | ||
<element_type>widget</element_type> | ||
<form> | ||
<fields> | ||
<fieldset name="general-settings" label="TPL_ASTROID_GENERAL_SETTINGS_LABEL" addfieldpath="/libraries/astroid/framework/fields"> | ||
<field astroidgroup="general" name="code_selector" type="astroidradio" width="full" default="html"> | ||
<option value="html">ASTROID_WIDGET_CODEPEN_HTML_LABEL</option> | ||
<option value="css">ASTROID_WIDGET_CODEPEN_CSS_LABEL</option> | ||
<option value="js">ASTROID_WIDGET_CODEPEN_JS_LABEL</option> | ||
</field> | ||
<field astroidgroup="general" ngShow="[code_selector]=='html'" code="html" name="custom_html" type="astroidtextarea" label="ASTROID_WIDGET_CODEPEN_CUSTOM_HTML_LABEL" description="ASTROID_WIDGET_CODEPEN_CUSTOM_HTML_LABEL"/> | ||
<field astroidgroup="general" ngShow="[code_selector]=='css'" code="css" name="custom_css" type="astroidtextarea" label="ASTROID_WIDGET_CODEPEN_CUSTOM_CSS_LABEL" description="ASTROID_WIDGET_CODEPEN_CUSTOM_CSS_LABEL"/> | ||
<field astroidgroup="general" ngShow="[code_selector]=='js'" code="javascript" name="custom_js" type="astroidtextarea" label="ASTROID_WIDGET_CODEPEN_CUSTOM_JS_LABEL" description="ASTROID_WIDGET_CODEPEN_CUSTOM_JS_LABEL"/> | ||
<field astroidgroup="general" ngShow="[code_selector]=='js'" name="astroid_libs" type="astroidmultiselect" label="ASTROID_LIBRARIES" default="[]" description="ASTROID_LIBRARIES_DESC" hint="ASTROID_LIBRARIES_HINT"> | ||
<option value="gsap">GSAP</option> | ||
<option value="gsap.Flip">GSAP.Flip</option> | ||
<option value="fancybox">FancyBox</option> | ||
<option value="masonry">Masonry</option> | ||
<option value="slick">Slick</option> | ||
<option value="imagesloaded">Images Loaded</option> | ||
</field> | ||
<field astroidgroup="general" ngShow="[code_selector]=='js'" name="external_js" as-index="url" type="astroidsubform" label="ASTROID_WIDGET_CODEPEN_EXTERNAL_JS_LABEL"> | ||
<form> | ||
<fields> | ||
<fieldset name="general-settings" label="TPL_ASTROID_GENERAL_SETTINGS_LABEL"> | ||
<field type="astroidtext" class="form-control" label="ASTROID_WIDGET_CODEPEN_EXTERNAL_JS_URL_LABEL" name="url"/> | ||
</fieldset> | ||
</fields> | ||
</form> | ||
</field> | ||
<field astroidgroup="general" ngShow="[code_selector]=='css'" name="external_css" as-index="url" type="astroidsubform" label="ASTROID_WIDGET_CODEPEN_EXTERNAL_CSS_LABEL"> | ||
<form> | ||
<fields> | ||
<fieldset name="general-settings" label="TPL_ASTROID_GENERAL_SETTINGS_LABEL"> | ||
<field type="astroidtext" class="form-control" label="ASTROID_WIDGET_CODEPEN_EXTERNAL_CSS_URL_LABEL" name="url"/> | ||
</fieldset> | ||
</fields> | ||
</form> | ||
</field> | ||
</fieldset> | ||
<fieldset name="assignment-settings" label="TPL_ASTROID_ASSIGNMENT_SETTINGS_LABEL" addfieldpath="/libraries/astroid/framework/fields" articleData="false"> | ||
<field type="astroidlist" name="assignment_type" label="ASTROID_WIDGET_ASSIGN" default="1"> | ||
<option value="1">ASTROID_WIDGET_ON_ALL_PAGES</option> | ||
<option value="0">ASTROID_WIDGET_NO_PAGES</option> | ||
<option value="2">ASTROID_WIDGET_SELECTED_PAGES</option> | ||
</field> | ||
<field ngShow="[assignment_type]==2" type="astroidassignment" label="ASTROID_ASSIGN_TO_MENU_ITEM" name="assignment"/> | ||
</fieldset> | ||
</fields> | ||
</form> | ||
</element> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters