Skip to content

Commit 9ef2b8c

Browse files
Release 1.10.0
1 parent 87fab33 commit 9ef2b8c

File tree

26 files changed

+732
-188
lines changed

26 files changed

+732
-188
lines changed

com_jdbuilder/jdbuilder.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
<extension type="component" version="3.0" method="upgrade">
33
<name>JD Builder</name>
44
<element>com_jdbuilder</element>
5-
<creationDate>Aug 2020</creationDate>
5+
<creationDate>Oct 2020</creationDate>
66
<copyright>Copyright (C) 2020 Joomdev, Inc. All rights reserved.</copyright>
77
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
88
<author>Team Joomdev</author>
99
<authorEmail>[email protected]</authorEmail>
1010
<authorUrl>https://www.joomdev.com</authorUrl>
11-
<version>1.9.0</version>
11+
<version>1.10.0</version>
1212
<description>{jdbcomdesc}</description>
1313
<install> <!-- Runs on install -->
1414
<sql>

com_jdbuilder_j4/jdbuilder.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
<extension type="component" version="4.0" method="upgrade" client="site">
33
<name>JD Builder</name>
44
<element>com_jdbuilder</element>
5-
<creationDate>Aug 2020</creationDate>
5+
<creationDate>Oct 2020</creationDate>
66
<copyright>Copyright (C) 2020 Joomdev, Inc. All rights reserved.</copyright>
77
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
88
<author>Team Joomdev</author>
99
<authorEmail>[email protected]</authorEmail>
1010
<authorUrl>https://www.joomdev.com</authorUrl>
11-
<version>1.8.0</version>
11+
<version>1.10.0</version>
1212
<description>{jdbcomdesc}</description>
1313
<namespace>Joomdev\Component\JDBuilder</namespace>
1414

mod_jdbuilder/mod_jdbuilder.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<extension type="module" version="3.1" client="site" method="upgrade">
33
<name>JD Builder Module</name>
4-
<creationDate>Aug 2020</creationDate>
4+
<creationDate>Oct 2020</creationDate>
55
<author>Team Joomdev</author>
66
<authorEmail>[email protected]</authorEmail>
77
<authorUrl>https://www.joomdev.com</authorUrl>
88
<copyright>Copyright (C) 2020 Joomdev, Inc. All rights reserved.</copyright>
99
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
10-
<version>1.9.0</version>
10+
<version>1.10.0</version>
1111
<description>This Module allows you to create your own Module using the JD Builder.</description>
1212
<files>
1313
<filename>mod_jdbuilder.xml</filename>

pkg_jdbuilder.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<packager>Team JoomDev</packager>
77
<packagerurl>https://www.joomdev.com</packagerurl>
88
<author>Team JoomDev</author>
9-
<creationDate>Aug 2020</creationDate>
10-
<version>1.9.0</version>
9+
<creationDate>Oct 2020</creationDate>
10+
<version>1.10.0</version>
1111
<url>https://www.joomdev.com</url>
1212
<copyright>Copyright (C) 2020 Joomdev, Inc. All rights reserved.</copyright>
1313
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>

plg_jdbuilder/elements/icon-list/icon-list.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<element type="icon-list">
33
<title>Icon List</title>
44
<icon>media/jdbuilder/images/icons/elements/icon-list.svg</icon>
5-
<creationDate>Aug 2020</creationDate>
5+
<creationDate>Oct 2020</creationDate>
66
<author>JoomDev</author>
77
<authorEmail>[email protected]</authorEmail>
88
<authorUrl>https://www.joomdev.com</authorUrl>
@@ -20,6 +20,12 @@
2020
<form>
2121
<field name="icon" width="3" type="icon" label="JDB_ICON" default="" />
2222
<field name="text" width="9" type="text" label="JDB_TEXT" default="" />
23+
<field name="link" type="text" label="JDB_LINK_LABEL" default="#">
24+
</field>
25+
<field name="linkTargetBlank" type="switch" label="JDB_LINK_TARGET_LBL" default="false" showon="params.link!=''">
26+
</field>
27+
<field name="linkNoFollow" type="switch" label="JDB_LINK_NOFOLLOW_LBL" default="false" showon="params.link!=''">
28+
</field>
2329
</form>
2430
</field>
2531

plg_jdbuilder/elements/icon-list/tmpl/default.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
items.forEach(function (item) {
1212
if (item.text != '' || item.icon != '') {
13-
html.push(`<li class="jdb-iconlist-item">${item.icon ? `<span class="jdb-iconlist-icon"><i class="${item.icon}"></i></span>` : ``}<span class="jdb-iconlist-text">${item.text}</span></li>`);
13+
html.push(`<li class="jdb-iconlist-item">${item.icon ? `<span class="jdb-iconlist-icon"><i class="${item.icon}"></i></span>` : ``}${(item.link ? `<a class="jdb-iconlist-text" href="${item.link}"${item.linkTargetBlank ? ' target="_blank"' : ''}${item.linkNoFollow ? ' rel="nofollow"' : ''}>` : '<span class="jdb-iconlist-text">')}${item.text}${(item.link ? '</a>' : '</span>')}</li>`);
1414
}
1515
});
1616

@@ -37,12 +37,14 @@
3737

3838
var alignment = element.params.get('list_alignment', null);
3939

40-
JDBRenderer.DEVICES.forEach(function (_deviceObj) {
41-
if (_deviceObj.key in alignment) {
42-
ListContainer.addCss('text-align', alignment[_deviceObj.key], _deviceObj.type);
43-
ListItem.addCss('justify-content', alignment[_deviceObj.key] == 'left' ? 'flex-start' : (alignment[_deviceObj.key] == 'right' ? 'flex-end' : 'center'), _deviceObj.type);
44-
}
45-
});
40+
if (alignment != null) {
41+
JDBRenderer.DEVICES.forEach(function (_deviceObj) {
42+
if (_deviceObj.key in alignment) {
43+
ListContainer.addCss('text-align', alignment[_deviceObj.key], _deviceObj.type);
44+
ListItem.addCss('justify-content', alignment[_deviceObj.key] == 'left' ? 'flex-start' : (alignment[_deviceObj.key] == 'right' ? 'flex-end' : 'center'), _deviceObj.type);
45+
}
46+
});
47+
}
4648

4749

4850
var space_between = element.params.get('list_space_between', null);

plg_jdbuilder/elements/icon-list/tmpl/default.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
if (!empty($item->icon)) {
2121
\JDPageBuilder\Builder::loadFontLibraryByIcon($item->icon);
2222
}
23-
$html[] = "<li class=\"jdb-iconlist-item\">" . ($item->icon ? "<span class=\"jdb-iconlist-icon\"><i class=\"{$item->icon}\"></i></span>" : "") . "<span class=\"jdb-iconlist-text\">{$item->text}</span></li>";
23+
$html[] = "<li class=\"jdb-iconlist-item\">" . ($item->icon ? "<span class=\"jdb-iconlist-icon\"><i class=\"{$item->icon}\"></i></span>" : "") . (!empty(@$item->link) ? '<a class="jdb-iconlist-text" href="' . $item->link . '"' . (@$item->linkTargetBlank ? ' target="_blank"' : '') . '' . (@$item->linkNoFollow ? ' rel="nofollow"' : '') . '>' : '<span class="jdb-iconlist-text">') . "{$item->text}" . (!empty(@$item->link) ? '</a>' : '</span>') . "</li>";
2424
}
2525
}
2626

plg_jdbuilder/elements/inner-row/inner-row.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@
8383
<option value="">JDB_INHERIT</option>
8484
<option value="cover">JDB_BACKGROUND_SIZE_COVER</option>
8585
<option value="contain">JDB_BACKGROUND_SIZE_CONTAIN</option>
86+
<option value="custom">JDB_CUSTOM</option>
87+
</field>
88+
89+
<field type="slider" name="backgroundWidth" label="Background Width" description="" default='{"value":100,"unit":"%"}' max="1600" min="0" units="px,%,vw" showon="params.background=='image'[AND]params.backgroundImage!=''[AND]params.backgroundSize=='custom'" group="background" responsive="true">
8690
</field>
8791

8892
<field type="list" search="false" name="backgroundAttachment" label="JDB_BACKGROUND_ATTACHMENT" group="background" showon="params.background=='image'[AND]params.backgroundImage!=''" width="6" default="">
@@ -101,6 +105,13 @@
101105
<option value="center top">JDB_BACKGROUND_POSITION_CENTER_TOP</option>
102106
<option value="center center">JDB_BACKGROUND_POSITION_LABEL_CENTER_CENTER</option>
103107
<option value="center bottom">JDB_BACKGROUND_POSITION_CENTER_BOTTOM</option>
108+
<option value="custom">JDB_CUSTOM</option>
109+
</field>
110+
111+
<field type="slider" name="backgroundXPosition" label="JDB_BACKGROUND_OVERLAY_X_POSITION" default='{"value":0,"unit":"px"}' max="1600" min="-1600" units="px,%,vw" showon="params.backgroundPosition=='custom'" group="background" responsive="true">
112+
</field>
113+
114+
<field type="slider" name="backgroundYPosition" label="JDB_BACKGROUND_OVERLAY_Y_POSITION" default='{"value":0,"unit":"px"}' max="1600" min="-1600" units="px,%,vh" showon="params.backgroundPosition=='custom'" group="background" responsive="true">
104115
</field>
105116

106117
<!-- Background Video -->

plg_jdbuilder/jdbuilder.php

Lines changed: 18 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@ public function onAfterRoute()
4343
\JDPageBuilder\Helper::loadLanguage();
4444

4545
$style = '.jdb-version-label{padding: 0px 8px; display: inline-block; background: #84d155; border-radius: 100px;margin: 0px 5px;color: #fff;font-weight: bold;line-height: 16px;font-size: 10px;vertical-align: baseline;position: relative;top: -2px;}';
46-
$docuemnt = \JFactory::getDocument();
47-
$docuemnt->addStyleDeclaration($style);
46+
$document = \JFactory::getDocument();
47+
$document->addStyleDeclaration($style);
48+
}
49+
50+
if (!$this->app->isClient('administrator')) {
51+
\JDPageBuilder\Builder::beforeRenderHead();
4852
}
4953
}
5054

@@ -66,8 +70,6 @@ public function onAfterDispatch()
6670
$jdfinderdoc->addScript(Juri::root() . 'media/jdbuilder/js/jdfinder.js', ['version' => JDB_MEDIA_VERSION]);
6771
$jdfinderdoc->addScriptDeclaration(" var jdfinderSearch = '$jdfinderBaseURL';");
6872
}
69-
// $document = JFactory::getDocument();
70-
// $document->addScriptDeclaration("var _JDB = {};");
7173
}
7274

7375
public function onBeforeRender()
@@ -158,48 +160,21 @@ public function onAfterRender()
158160
if (!$this->app->isClient('administrator') || !$this->isValidView()) {
159161
return;
160162
}
161-
if ($this->isPageEdit()) {
162-
$id = $this->app->input->get('id', 0, 'INT');
163-
$this->addBuilder($id);
164-
return;
165-
}
166163
if ($this->isModuleEdit()) {
167164
$this->addBodyClass();
168165
}
169166
}
170167

171-
public function setLinkAndLabel()
172-
{
173-
$articleLayouts = self::$article_layouts;
174-
$body = $this->app->getBody();
175-
$body = preg_replace_callback('/(<a\s[^>]*href=")([^"]*)("[^>]*>)(.*)(<\/a>)/siU', function ($matches) use ($articleLayouts) {
176-
$html = $matches[0];
177-
if (strpos($matches[2], 'task=article.edit')) {
178-
$uri = new JUri($matches[2]);
179-
$id = (int) $uri->getVar('id');
180-
if ($uri->getVar('option') == "com_content" && in_array($id, $articleLayouts)) {
181-
$html = $matches[1] . $uri . '&jdb=1' . $matches[3] . $matches[4] . $matches[5];
182-
if (JDB_JOOMLA_VERSION == 3) {
183-
$html .= ' <span class="label label-info">JD Page</span>';
184-
} else {
185-
$html .= ' <span class="badge badge-info">JD Page</span>';
186-
}
187-
} else {
188-
$html = '<a title="' . JText::_('JDBUILDER_EDIT_TITLE') . '" class="btn btn-micro btn-sm btn-info hasTooltip" href="' . $uri . '&jdb=1' . '"><span class="icon-pencil"></span></a>';
189-
$html .= $matches[1] . $uri . $matches[3] . $matches[4] . $matches[5];
190-
}
191-
}
192-
return $html;
193-
}, $body);
194-
$this->app->setBody($body);
195-
}
196-
197168
public function onBeforeCompileHead()
198169
{
199-
$docuemnt = \JFactory::getDocument();
170+
$document = \JFactory::getDocument();
171+
172+
if (!$this->app->isClient('administrator')) {
173+
\JDPageBuilder\Builder::afterRenderHead();
174+
}
200175

201176
if (JDB_JOOMLA_VERSION == 3) {
202-
$docuemnt->addScript(JURI::root() . 'media/system/js/core.js');
177+
$document->addScript(JURI::root() . 'media/system/js/core.js');
203178
}
204179
if (!$this->app->isClient('administrator') || !$this->isValidView()) {
205180
return;
@@ -217,11 +192,11 @@ public function onBeforeCompileHead()
217192
$id = $this->app->input->get('id', 0);
218193
$style = '#jdbuilder-area{display: none;}#jdbuilder-area.active{display: block;}#jdbuilder-area.active~div{display: none;}#jdbuilder-area{position: relative;}#jdbuilder-area.loading{height: 400px; overflow: hidden}#jdbuilder-controls .btn-jdb-exit{display: none;}#jdbuilder-controls .btn-jdb-fs{display: none;}#jdbuilder-controls.active .btn-jdb-exit{display: inline-block;}#jdbuilder-controls.active .btn-jdb-edit{display: none;}#jdbuilder-controls.active .btn-jdb-fs{display: inline-block;}';
219194

220-
$docuemnt->addStyleDeclaration($style);
221-
$docuemnt->addStyleSheet('//fonts.googleapis.com/css?family=Noto+Sans:400,700');
222-
$docuemnt->addStyleSheet(JURI::root(true) . '/media/jdbuilder/css/style.min.css', ['version' => JDB_MEDIA_VERSION]);
223-
$docuemnt->addStyleSheet(JURI::root(true) . '/media/jdbuilder/css/rtl.css', ['version' => JDB_MEDIA_VERSION]);
224-
$docuemnt->addStyleSheet(JURI::root(true) . '/media/jdbuilder/js/builder/styles.css', ['version' => JDB_MEDIA_VERSION]);
195+
$document->addStyleDeclaration($style);
196+
$document->addStyleSheet('//fonts.googleapis.com/css?family=Noto+Sans:400,700');
197+
$document->addStyleSheet(JURI::root(true) . '/media/jdbuilder/css/style.min.css', ['version' => JDB_MEDIA_VERSION]);
198+
$document->addStyleSheet(JURI::root(true) . '/media/jdbuilder/css/rtl.css', ['version' => JDB_MEDIA_VERSION]);
199+
$document->addStyleSheet(JURI::root(true) . '/media/jdbuilder/js/builder/styles.css', ['version' => JDB_MEDIA_VERSION]);
225200
}
226201
}
227202

@@ -230,7 +205,7 @@ public function onBeforeCompileHead()
230205
public function isValidView()
231206
{
232207
$option = $this->app->input->get('option', '');
233-
return ($option == "com_jdbuilder" || $option == "com_content" || $option == "com_modules" || $option == 'com_advancedmodules' || $option == "com_hikashop");
208+
return ($option == "com_jdbuilder" || $option == "com_content" || $option == "com_modules" || $option == 'com_advancedmodules');
234209
}
235210

236211
public function isPageView()
@@ -481,15 +456,6 @@ public function addAdminMenu()
481456
$this->app->setBody($body);
482457
}
483458

484-
public function onContentBeforeSave($context, $article, $isNew)
485-
{
486-
if ($context == 'com_advancedmodules.module') {
487-
return $this->onExtensionBeforeSave($context, $article, $isNew);
488-
}
489-
490-
return true;
491-
}
492-
493459
public function onExtensionBeforeSave($context, $item, $isNew)
494460
{
495461
if (($context !== 'com_modules.module' && $context != 'com_advancedmodules.module') || $item->module !== 'mod_jdbuilder') {

plg_jdbuilder/jdbuilder.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<extension type="plugin" version="3.0" group="system" method="upgrade">
33
<name>System - JD Builder</name>
4-
<creationDate>Aug 2020</creationDate>
4+
<creationDate>Oct 2020</creationDate>
55
<author>Team Joomdev</author>
66
<authorEmail>[email protected]</authorEmail>
77
<authorUrl>https://www.joomdev.com</authorUrl>
88
<copyright>Copyright (C) 2020 Joomdev, Inc. All rights reserved.</copyright>
99
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
10-
<version>1.9.0</version>
10+
<version>1.10.0</version>
1111
<description>{jdbplgdesc}</description>
1212
<files>
1313
<filename plugin="jdbuilder">jdbuilder.php</filename>

0 commit comments

Comments
 (0)