From ae1c89a15d139d085171a9733c49e495ddb571b1 Mon Sep 17 00:00:00 2001 From: aB0t Date: Thu, 1 Aug 2024 23:00:32 +0200 Subject: [PATCH] Release of v4.0.2-beta3 Add more pure JS to the dynamic get area. --- CHANGELOG.md | 7 +- ComponentbuilderInstallerScript.php | 2 +- README.md | 6 +- admin/README.txt | 6 +- .../tmpl/admin_fields_conditions/default.php | 3 +- admin/tmpl/admin_fields_relations/default.php | 3 +- admin/tmpl/admin_view/default.php | 3 +- admin/tmpl/class_extends/default.php | 3 +- admin/tmpl/class_method/default.php | 3 +- admin/tmpl/class_property/default.php | 3 +- admin/tmpl/compiler/default.php | 3 +- admin/tmpl/component_dashboard/default.php | 3 +- admin/tmpl/components_routers/default.php | 3 +- admin/tmpl/custom_admin_view/default.php | 3 +- admin/tmpl/custom_code/default.php | 3 +- admin/tmpl/dynamic_get/default.php | 15 +- admin/tmpl/dynamic_gets/default.php | 29 --- admin/tmpl/field/default.php | 3 +- admin/tmpl/fieldtype/default.php | 3 +- admin/tmpl/get_snippets/default.php | 3 +- .../default.php | 3 +- admin/tmpl/joomla_component/default.php | 3 +- admin/tmpl/joomla_module/default.php | 3 +- admin/tmpl/joomla_plugin/default.php | 3 +- admin/tmpl/language_translation/default.php | 3 +- admin/tmpl/layout/default.php | 3 +- admin/tmpl/library/default.php | 3 +- admin/tmpl/placeholder/default.php | 3 +- admin/tmpl/power/default.php | 3 +- admin/tmpl/site_view/default.php | 3 +- admin/tmpl/template/default.php | 3 +- admin/tmpl/validation_rule/default.php | 3 +- componentbuilder.xml | 4 +- componentbuilder_update_server.xml | 6 +- media/js/admin_view.js | 8 +- media/js/custom_admin_view.js | 8 +- media/js/dynamic_get.js | 231 +++++++++--------- media/js/field.js | 8 +- media/js/joomla_module.js | 8 +- media/js/joomla_plugin.js | 8 +- media/js/library.js | 8 +- media/js/power.js | 8 +- media/js/site_view.js | 8 +- 43 files changed, 238 insertions(+), 210 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 17a2091a4..99581206e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,11 @@ -# v4.0.2-beta2 +# v4.0.2-beta3 -- Fix dynamicGet so that the table values will load again. #1155 +- Add more pure JS to the dynamic get area. # v4.0.2-beta -- Fix abstract schema class function check default index warring +- Fix abstract schema class function check default index warring +- Fix dynamicGet so that the table values will load again. #1155 # v4.0.2-alpha diff --git a/ComponentbuilderInstallerScript.php b/ComponentbuilderInstallerScript.php index 414aa5449..efbe401d3 100644 --- a/ComponentbuilderInstallerScript.php +++ b/ComponentbuilderInstallerScript.php @@ -3270,7 +3270,7 @@ class Com_ComponentbuilderInstallerScript implements InstallerScriptInterface echo '
-

Upgrade to Version 4.0.2-beta2 Was Successful! Let us know if anything is not working as expected.

'; +

Upgrade to Version 4.0.2-beta3 Was Successful! Let us know if anything is not working as expected.

'; // Add/Update component in the action logs extensions table. $this->setActionLogsExtensions(); diff --git a/README.md b/README.md index 378a47e86..dc0de5af7 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (4.0.2-beta2) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (4.0.2-beta3) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -145,10 +145,10 @@ TODO + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 + *Last Build*: 1st August, 2024 -+ *Version*: 4.0.2-beta2 ++ *Version*: 4.0.2-beta3 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **791516** ++ *Line count*: **791544** + *Field count*: **2093** + *File count*: **5505** + *Folder count*: **544** diff --git a/admin/README.txt b/admin/README.txt index 378a47e86..dc0de5af7 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -9,7 +9,7 @@ The Component Builder for [Joomla](https://extensions.joomla.org/extension/compo Whether you're a seasoned [Joomla](https://extensions.joomla.org/extension/component-builder/) developer, or have just started, Component Builder will save you lots of time and money. A real must have! -You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (4.0.2-beta2) with **ALL** its features and **ALL** concepts totally open-source and free! +You can install it quite easily and with no limitations. On [gitea](https://git.vdm.dev/joomla/Component-Builder/tags) is the latest release (4.0.2-beta3) with **ALL** its features and **ALL** concepts totally open-source and free! > Watch Quick Build of a Hello World component in [JCB on Youtube](https://www.youtube.com/watch?v=IQfsLYIeblk&list=PLQRGFI8XZ_wtGvPQZWBfDzzlERLQgpMRE&index=45) @@ -145,10 +145,10 @@ TODO + *Name*: [Component Builder](https://git.vdm.dev/joomla/Component-Builder) + *First Build*: 30th April, 2015 + *Last Build*: 1st August, 2024 -+ *Version*: 4.0.2-beta2 ++ *Version*: 4.0.2-beta3 + *Copyright*: Copyright (C) 2015 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **791516** ++ *Line count*: **791544** + *Field count*: **2093** + *File count*: **5505** + *Folder count*: **544** diff --git a/admin/tmpl/admin_fields_conditions/default.php b/admin/tmpl/admin_fields_conditions/default.php index dbf9de3cb..3075e74c4 100644 --- a/admin/tmpl/admin_fields_conditions/default.php +++ b/admin/tmpl/admin_fields_conditions/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -134,7 +135,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/admin_fields_relations/default.php b/admin/tmpl/admin_fields_relations/default.php index 7544b0c8e..87338054a 100644 --- a/admin/tmpl/admin_fields_relations/default.php +++ b/admin/tmpl/admin_fields_relations/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -112,7 +113,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/admin_view/default.php b/admin/tmpl/admin_view/default.php index 291ab3696..fed2c4026 100644 --- a/admin/tmpl/admin_view/default.php +++ b/admin/tmpl/admin_view/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -759,7 +760,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/class_extends/default.php b/admin/tmpl/class_extends/default.php index ec7c1f1f9..7f24a74a8 100644 --- a/admin/tmpl/class_extends/default.php +++ b/admin/tmpl/class_extends/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -117,7 +118,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/class_method/default.php b/admin/tmpl/class_method/default.php index 07431fe55..b95c737e5 100644 --- a/admin/tmpl/class_method/default.php +++ b/admin/tmpl/class_method/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -132,7 +133,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/class_property/default.php b/admin/tmpl/class_property/default.php index 7aae8dc4f..438abf06e 100644 --- a/admin/tmpl/class_property/default.php +++ b/admin/tmpl/class_property/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -127,7 +128,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/compiler/default.php b/admin/tmpl/compiler/default.php index ff81c9f41..de6c7fb17 100644 --- a/admin/tmpl/compiler/default.php +++ b/admin/tmpl/compiler/default.php @@ -16,6 +16,7 @@ use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; use VDM\Joomla\Utilities\StringHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -247,7 +248,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/component_dashboard/default.php b/admin/tmpl/component_dashboard/default.php index 30a99b086..4cf174be4 100644 --- a/admin/tmpl/component_dashboard/default.php +++ b/admin/tmpl/component_dashboard/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -120,7 +121,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/components_routers/default.php b/admin/tmpl/components_routers/default.php index 71c079e39..c29e1ff14 100644 --- a/admin/tmpl/components_routers/default.php +++ b/admin/tmpl/components_routers/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; // No direct access to this file defined('_JEXEC') or die; @@ -59,7 +60,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/custom_admin_view/default.php b/admin/tmpl/custom_admin_view/default.php index c5e922804..64089b724 100644 --- a/admin/tmpl/custom_admin_view/default.php +++ b/admin/tmpl/custom_admin_view/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -405,7 +406,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/custom_code/default.php b/admin/tmpl/custom_code/default.php index 6a873f7d2..eeecaba79 100644 --- a/admin/tmpl/custom_code/default.php +++ b/admin/tmpl/custom_code/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -272,7 +273,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/dynamic_get/default.php b/admin/tmpl/dynamic_get/default.php index d3f069ee3..f380120b2 100644 --- a/admin/tmpl/dynamic_get/default.php +++ b/admin/tmpl/dynamic_get/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -651,10 +652,10 @@ document.addEventListener('DOMContentLoaded', function() { // for the values the will still be set document.addEventListener('DOMContentLoaded', function() { document.addEventListener('subform-row-add', function(event) { - var row = event.detail.row; - var groupName = row.getAttribute('data-group'); - var fieldName = groupName.replace('join_', '').replace('_table', '').replace(/([0-9])/g, ''); - var fieldNr = groupName.replace(/([A-z_])/g, ''); + let row = event.detail.row; + let groupName = row.getAttribute('data-group'); + let fieldName = groupName.replace('join_', '').replace('_table', '').replace(/([0-9])/g, ''); + let fieldNr = groupName.replace(/([A-z_])/g, ''); updateSubItems(fieldName, fieldNr, '_', '_'); }); }); @@ -669,14 +670,14 @@ document.getElementById('adminForm').addEventListener('change', function(e) { document.getElementById('jform_add_php_router_parse').addEventListener('change', function() { - var valueSwitch = document.querySelector("#jform_add_php_router_parse input[type='radio']:checked").value; + let valueSwitch = document.querySelector("#jform_add_php_router_parse input[type='radio']:checked").value; getDynamicScripts(valueSwitch); }); document.getElementById('adminForm').addEventListener('change', function(e) { if (e.target && e.target.matches('#jform_select_all input[type="radio"]')) { e.preventDefault(); - var selectAll = e.target.value; + let selectAll = e.target.value; setSelectAll(selectAll); } }); @@ -688,7 +689,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/dynamic_gets/default.php b/admin/tmpl/dynamic_gets/default.php index d3cd2e989..56d85cd30 100644 --- a/admin/tmpl/dynamic_gets/default.php +++ b/admin/tmpl/dynamic_gets/default.php @@ -49,32 +49,3 @@ if ($this->saveOrder) - diff --git a/admin/tmpl/field/default.php b/admin/tmpl/field/default.php index 5b577c9a2..1b2c92175 100644 --- a/admin/tmpl/field/default.php +++ b/admin/tmpl/field/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -327,7 +328,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/fieldtype/default.php b/admin/tmpl/fieldtype/default.php index dd778011b..1dc39cf94 100644 --- a/admin/tmpl/fieldtype/default.php +++ b/admin/tmpl/fieldtype/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -531,7 +532,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/get_snippets/default.php b/admin/tmpl/get_snippets/default.php index 18e2e86fc..7997ebe2e 100644 --- a/admin/tmpl/get_snippets/default.php +++ b/admin/tmpl/get_snippets/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -246,7 +247,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/import_joomla_componentsimport/default.php b/admin/tmpl/import_joomla_componentsimport/default.php index b1bfe05f7..15b97be26 100644 --- a/admin/tmpl/import_joomla_componentsimport/default.php +++ b/admin/tmpl/import_joomla_componentsimport/default.php @@ -14,6 +14,7 @@ use Joomla\CMS\Language\Text; use Joomla\CMS\Router\Route; use Joomla\CMS\HTML\HTMLHelper as Html; use VDM\Joomla\Utilities\ArrayHelper; +use Joomla\CMS\Uri\Uri; // No direct access to this file defined('_JEXEC') or die; @@ -553,7 +554,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/joomla_component/default.php b/admin/tmpl/joomla_component/default.php index 90748d0a3..4ed1dd623 100644 --- a/admin/tmpl/joomla_component/default.php +++ b/admin/tmpl/joomla_component/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -456,7 +457,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/joomla_module/default.php b/admin/tmpl/joomla_module/default.php index b119d8524..8392060de 100644 --- a/admin/tmpl/joomla_module/default.php +++ b/admin/tmpl/joomla_module/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -439,7 +440,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/joomla_plugin/default.php b/admin/tmpl/joomla_plugin/default.php index a8443df59..5b2511358 100644 --- a/admin/tmpl/joomla_plugin/default.php +++ b/admin/tmpl/joomla_plugin/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -399,7 +400,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/language_translation/default.php b/admin/tmpl/language_translation/default.php index a16fefa62..009d9ac6c 100644 --- a/admin/tmpl/language_translation/default.php +++ b/admin/tmpl/language_translation/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -111,7 +112,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/layout/default.php b/admin/tmpl/layout/default.php index 02469e4d2..0391fea41 100644 --- a/admin/tmpl/layout/default.php +++ b/admin/tmpl/layout/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -215,7 +216,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/library/default.php b/admin/tmpl/library/default.php index a1a57450a..ba372bf85 100644 --- a/admin/tmpl/library/default.php +++ b/admin/tmpl/library/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -577,7 +578,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/placeholder/default.php b/admin/tmpl/placeholder/default.php index 77521c98d..ba5e95d17 100644 --- a/admin/tmpl/placeholder/default.php +++ b/admin/tmpl/placeholder/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -140,7 +141,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/power/default.php b/admin/tmpl/power/default.php index 5d47d5e1c..e272e3550 100644 --- a/admin/tmpl/power/default.php +++ b/admin/tmpl/power/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -168,7 +169,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/site_view/default.php b/admin/tmpl/site_view/default.php index 5ebe8b9a1..afc685e85 100644 --- a/admin/tmpl/site_view/default.php +++ b/admin/tmpl/site_view/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -423,7 +424,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/template/default.php b/admin/tmpl/template/default.php index 42a333d3d..c9b9a30df 100644 --- a/admin/tmpl/template/default.php +++ b/admin/tmpl/template/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -220,7 +221,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/admin/tmpl/validation_rule/default.php b/admin/tmpl/validation_rule/default.php index 4ac214eba..00f311ec4 100644 --- a/admin/tmpl/validation_rule/default.php +++ b/admin/tmpl/validation_rule/default.php @@ -15,6 +15,7 @@ use Joomla\CMS\HTML\HTMLHelper as Html; use Joomla\CMS\Layout\LayoutHelper; use Joomla\CMS\Router\Route; use VDM\Component\Componentbuilder\Administrator\Helper\ComponentbuilderHelper; +use Joomla\CMS\Uri\Uri; /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */ $wa = $this->getDocument()->getWebAssetManager(); @@ -145,7 +146,7 @@ function JRouter(link) { isClient('site')) { - echo 'var url = "'. \Joomla\CMS\Uri\Uri::root() . '";'; + echo 'var url = "'. Uri::root() . '";'; } else { diff --git a/componentbuilder.xml b/componentbuilder.xml index 47eb2b949..7b7381666 100644 --- a/componentbuilder.xml +++ b/componentbuilder.xml @@ -7,9 +7,9 @@ https://dev.vdm.io Copyright (C) 2015 Vast Development Method. All rights reserved. GNU General Public License version 2 or later; see LICENSE.txt - 4.0.2-beta2 + 4.0.2-beta3 Component Builder (v.4.0.2-beta2) +

Component Builder (v.4.0.2-beta3)

The Component Builder for [Joomla](https://extensions.joomla.org/extension/component-builder/) is highly advanced tool that is truly able to build extremely complex components in a fraction of the time. diff --git a/componentbuilder_update_server.xml b/componentbuilder_update_server.xml index d450ae4a6..7f537c8a8 100644 --- a/componentbuilder_update_server.xml +++ b/componentbuilder_update_server.xml @@ -80,7 +80,7 @@ 4.0.2-beta https://dev.vdm.io - https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v4.0.2-beta2.zip + https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v4.0.2-beta3.zip beta @@ -95,10 +95,10 @@ pkg_component_builder package site - 4.0.2-beta2 + 4.0.2-beta3 https://dev.vdm.io - https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v4.0.2-beta2.zip + https://git.vdm.dev/api/v1/repos/joomla/pkg-component-builder/archive/v4.0.2-beta3.zip beta diff --git a/media/js/admin_view.js b/media/js/admin_view.js index 9a4fc7283..7493d3eb5 100644 --- a/media/js/admin_view.js +++ b/media/js/admin_view.js @@ -1068,10 +1068,12 @@ function addButton(type, where, size){ }) } -function getLinked(){ +function getLinked() { getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) { - if(result){ - jQuery('#display_linked_to').html(result); + if (result.error) { + console.error(result.error); + } else if (result) { + document.getElementById('display_linked_to').innerHTML = result; } }); } diff --git a/media/js/custom_admin_view.js b/media/js/custom_admin_view.js index 7be1f8c42..70e7f7680 100644 --- a/media/js/custom_admin_view.js +++ b/media/js/custom_admin_view.js @@ -230,10 +230,12 @@ function getCodeFrom_server(id, type, type_name, callingName) { }); } -function getLinked(){ +function getLinked() { getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) { - if(result){ - jQuery('#display_linked_to').html(result); + if (result.error) { + console.error(result.error); + } else if (result) { + document.getElementById('display_linked_to').innerHTML = result; } }); } diff --git a/media/js/dynamic_get.js b/media/js/dynamic_get.js index f398ee3c1..1e5ee109c 100644 --- a/media/js/dynamic_get.js +++ b/media/js/dynamic_get.js @@ -1401,37 +1401,37 @@ function isSet(val) } -jQuery(document).ready(function() -{ +document.addEventListener('DOMContentLoaded', function() { // get the linked details getLinked(); - var valueSwitch = jQuery("#jform_add_php_router_parse input[type='radio']:checked").val(); + let valueSwitch = document.querySelector("#jform_add_php_router_parse input[type='radio']:checked").value; getDynamicScripts(valueSwitch); // check and load all the custom code edit buttons getEditCustomCodeButtons(); }); -function setSelectAll(select_all){ +function setSelectAll(select_all) { // get source type - var main_source = jQuery("#jform_main_source").val(); - if (1 == main_source) { - var key = 'view'; - } else if (2 == main_source) { - var key = 'db'; + let main_source = document.getElementById("jform_main_source").value; + let key; + if (main_source == 1) { + key = 'view'; + } else if (main_source == 2) { + key = 'db'; } else { return true; } // only continue if set if (select_all == 1) { // set default notice - jQuery("#jform_"+key+"_selection").val('a.*'); + document.getElementById("jform_" + key + "_selection").value = 'a.*'; // set the selection text area to read only - jQuery("#jform_"+key+"_selection").prop("readonly", true); + document.getElementById("jform_" + key + "_selection").readOnly = true; } else { // remove the read only from selection text area - jQuery("#jform_"+key+"_selection").prop("readonly", false); + document.getElementById("jform_" + key + "_selection").readOnly = false; // get selected options - var value_main = jQuery("#jform_"+key+"_table_main option:selected").val(); + let value_main = document.getElementById("jform_" + key + "_table_main").selectedOptions[0].value; // make sure that all fields are set as selected if (key === 'view') { getViewTableColumns(value_main, 'a', key, 3, true, '', ''); @@ -1441,144 +1441,155 @@ function setSelectAll(select_all){ } } -function getViewTableColumns_server(viewId,asKey,rowType){ - var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.viewTableColumns&format=json&raw=true"); - if (token.length > 0 && viewId > 0 && asKey.length > 0) - { - var request = token+'=1&as='+asKey+'&type='+rowType+'&id='+viewId; +function getViewTableColumns_server(viewId, asKey, rowType) { + let getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.viewTableColumns&format=json&raw=true"); + let request = ''; + if (token.length > 0 && viewId > 0 && asKey.length > 0) { + request = token + '=1&as=' + asKey + '&type=' + rowType + '&id=' + viewId; } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false + return fetch(getUrl + '&' + request, { method: 'GET' }).then(function(response) { + return response.json(); }); } -function getViewTableColumns(id, asKey, key, rowType, main, table_, nr_){ +function getViewTableColumns(id, asKey, key, rowType, main, table_, nr_) { // check if this is the main view - if (main){ - var select_all = jQuery("#jform_select_all input[type='radio']:checked").val(); + if (main) { + let select_all = document.querySelector("#jform_select_all input[type='radio']:checked").value; // do not continue if set - if (select_all == 1){ + if (select_all == 1) { setSelectAll(select_all); return true; } } - getViewTableColumns_server(id, asKey, rowType).done(function(result) { - if (result) { + getViewTableColumns_server(id, asKey, rowType).then(function(result) { + if (result.error) { + console.error(result.error); + } else if (result) { loadSelectionData(result, 'view', key, main, table_, nr_); } else { loadSelectionData(false, 'view', key, main, table_, nr_); } - }) -} - -function getDbTableColumns_server(name,asKey,rowType) -{ - var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.dbTableColumns&format=json&raw=true"); - if (token.length > 0 && name.length > 0 && asKey.length > 0) { - var request = token+'=1&as='+asKey+'&type='+rowType+'&name='+name; - } - return jQuery.ajax({ - type: 'GET', - url: getUrl, - dataType: 'json', - data: request, - jsonp: false }); } -function getDbTableColumns(name, asKey, key, rowType, main, table_, nr_){ +function getDbTableColumns_server(name, asKey, rowType) { + let getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.dbTableColumns&format=json&raw=true"); + let request = ''; + if (token.length > 0 && name.length > 0 && asKey.length > 0) { + request = token + '=1&as=' + asKey + '&type=' + rowType + '&name=' + name; + } + return fetch(getUrl + '&' + request, { method: 'GET' }).then(function(response) { + return response.json(); + }); +} + +function getDbTableColumns(name, asKey, key, rowType, main, table_, nr_) { // check if this is the main view - if (main){ - var select_all = jQuery("#jform_select_all input[type='radio']:checked").val(); + if (main) { + let select_all = document.querySelector("#jform_select_all input[type='radio']:checked").value; // do not continue if set - if (select_all == 1){ + if (select_all === 1) { setSelectAll(select_all); return true; } } - getDbTableColumns_server(name,asKey,rowType).done(function(result) { - if (result) { + getDbTableColumns_server(name, asKey, rowType).then(function(result) { + if (result.error) { + console.error(result.error); + } else if (result) { loadSelectionData(result, 'db', key, main, table_, nr_); } else { loadSelectionData(false, 'db', key, main, table_, nr_); } - }) + }); } -function loadSelectionData(result, type, key, main, table_, nr_) -{ - if (main) - { - var textArea = 'textarea#jform_'+key+'_selection'; +function loadSelectionData(result, type, key, main, table_, nr_) { + var textArea; + if (main) { + textArea = document.querySelector('textarea#jform_' + key + '_selection'); + } else { + textArea = document.querySelector('textarea#jform_join_' + type + '_table' + table_ + '_join_' + type + '_table' + key + nr_ + '_selection'); } - else - { - var textArea = 'textarea#jform_join_'+type+'_table'+table_+'_join_'+type+'_table'+key+nr_+'_selection'; - } - // no update the text area - if (result) - { - jQuery(textArea).val(result); - } - else - { - jQuery(textArea).val(''); + // update the text area + if (result) { + textArea.value = result; + } else { + textArea.value = ''; } } + function updateSubItems(fieldName, fieldNr, table_, nr_) { - if(jQuery('#jform_join_'+fieldName+'_table'+table_+'_join_'+fieldName+'_table'+fieldNr+nr_+'_'+fieldName+'_table').length) { - jQuery('#adminForm').on('change', '#jform_join_'+fieldName+'_table'+table_+'_join_'+fieldName+'_table'+fieldNr+nr_+'_'+fieldName+'_table',function (e) { - e.preventDefault(); - // get options - var value1 = jQuery("#jform_join_"+fieldName+"_table"+table_+"_join_"+fieldName+"_table"+fieldNr+nr_+"_"+fieldName+"_table option:selected").val(); - var as_value2 = jQuery("#jform_join_"+fieldName+"_table"+table_+"_join_"+fieldName+"_table"+fieldNr+nr_+"_as option:selected").val(); - var row_value1 = jQuery("#jform_join_"+fieldName+"_table"+table_+"_join_"+fieldName+"_table"+fieldNr+nr_+"_row_type option:selected").val(); - if (fieldName === 'view') { - getViewTableColumns(value1, as_value2, fieldNr, row_value1, false, table_, nr_); - } else { - getDbTableColumns(value1, as_value2, fieldNr, row_value1, false, table_, nr_); + let selector = '#jform_join_' + fieldName + '_table' + table_ + '_join_' + fieldName + '_table' + fieldNr + nr_ + '_' + fieldName + '_table'; + if (document.querySelector(selector)) { + document.getElementById('adminForm').addEventListener('change', function(e) { + if (e.target.matches(selector)) { + e.preventDefault(); + // get options + let selectElement = document.querySelector(selector); + let value1 = selectElement.options[selectElement.selectedIndex].value; + let asSelectElement = document.querySelector('#jform_join_' + fieldName + '_table' + table_ + '_join_' + fieldName + '_table' + fieldNr + nr_ + '_as'); + let as_value2 = asSelectElement.options[asSelectElement.selectedIndex].value; + let rowTypeElement = document.querySelector('#jform_join_' + fieldName + '_table' + table_ + '_join_' + fieldName + '_table' + fieldNr + nr_ + '_row_type'); + let row_value1 = rowTypeElement.options[rowTypeElement.selectedIndex].value; + if (fieldName === 'view') { + getViewTableColumns(value1, as_value2, fieldNr, row_value1, false, table_, nr_); + } else { + getDbTableColumns(value1, as_value2, fieldNr, row_value1, false, table_, nr_); + } } }); - jQuery('#adminForm').on('change', '#jform_join_'+fieldName+'_table'+table_+'_join_'+fieldName+'_table'+fieldNr+nr_+'_as',function (e) { - e.preventDefault(); - // get options - var value1 = jQuery("#jform_join_"+fieldName+"_table"+table_+"_join_"+fieldName+"_table"+fieldNr+nr_+"_"+fieldName+"_table option:selected").val(); - var as_value2 = jQuery("#jform_join_"+fieldName+"_table"+table_+"_join_"+fieldName+"_table"+fieldNr+nr_+"_as option:selected").val(); - var row_value1 = jQuery("#jform_join_"+fieldName+"_table"+table_+"_join_"+fieldName+"_table"+fieldNr+nr_+"_row_type option:selected").val(); - if (fieldName === 'view') { - getViewTableColumns(value1, as_value2, fieldNr, row_value1, false, table_, nr_); - } else { - getDbTableColumns(value1, as_value2, fieldNr, row_value1, false, table_, nr_); + + document.getElementById('adminForm').addEventListener('change', function(e) { + if (e.target.matches('#jform_join_' + fieldName + '_table' + table_ + '_join_' + fieldName + '_table' + fieldNr + nr_ + '_as')) { + e.preventDefault(); + // get options + let selectElement = document.querySelector(selector); + let value1 = selectElement.options[selectElement.selectedIndex].value; + let asSelectElement = document.querySelector('#jform_join_' + fieldName + '_table' + table_ + '_join_' + fieldName + '_table' + fieldNr + nr_ + '_as'); + let as_value2 = asSelectElement.options[asSelectElement.selectedIndex].value; + let rowTypeElement = document.querySelector('#jform_join_' + fieldName + '_table' + table_ + '_join_' + fieldName + '_table' + fieldNr + nr_ + '_row_type'); + let row_value1 = rowTypeElement.options[rowTypeElement.selectedIndex].value; + if (fieldName === 'view') { + getViewTableColumns(value1, as_value2, fieldNr, row_value1, false, table_, nr_); + } else { + getDbTableColumns(value1, as_value2, fieldNr, row_value1, false, table_, nr_); + } } }); - jQuery('#adminForm').on('change', '#jform_join_'+fieldName+'_table'+table_+'_join_'+fieldName+'_table'+fieldNr+nr_+'_row_type',function (e) { - e.preventDefault(); - // get options - var value1 = jQuery("#jform_join_"+fieldName+"_table"+table_+"_join_"+fieldName+"_table"+fieldNr+nr_+"_"+fieldName+"_table option:selected").val(); - var as_value2 = jQuery("#jform_join_"+fieldName+"_table"+table_+"_join_"+fieldName+"_table"+fieldNr+nr_+"_as option:selected").val(); - var row_value1 = jQuery("#jform_join_"+fieldName+"_table"+table_+"_join_"+fieldName+"_table"+fieldNr+nr_+"_row_type option:selected").val(); - if (fieldName === 'view') { - getViewTableColumns(value1, as_value2, fieldNr, row_value1, false, table_, nr_); - } else { - getDbTableColumns(value1, as_value2, fieldNr, row_value1, false, table_, nr_); + + document.getElementById('adminForm').addEventListener('change', function(e) { + if (e.target.matches('#jform_join_' + fieldName + '_table' + table_ + '_join_' + fieldName + '_table' + fieldNr + nr_ + '_row_type')) { + e.preventDefault(); + // get options + let selectElement = document.querySelector(selector); + let value1 = selectElement.options[selectElement.selectedIndex].value; + let asSelectElement = document.querySelector('#jform_join_' + fieldName + '_table' + table_ + '_join_' + fieldName + '_table' + fieldNr + nr_ + '_as'); + let as_value2 = asSelectElement.options[asSelectElement.selectedIndex].value; + let rowTypeElement = document.querySelector('#jform_join_' + fieldName + '_table' + table_ + '_join_' + fieldName + '_table' + fieldNr + nr_ + '_row_type'); + let row_value1 = rowTypeElement.options[rowTypeElement.selectedIndex].value; + if (fieldName === 'view') { + getViewTableColumns(value1, as_value2, fieldNr, row_value1, false, table_, nr_); + } else { + getDbTableColumns(value1, as_value2, fieldNr, row_value1, false, table_, nr_); + } } }); } } -function getDynamicScripts(id){ - if (1 == id) { +function getDynamicScripts(id) { + if (id == 1) { // get the current values - var current_router_parse = jQuery('textarea#jform_php_router_parse').val(); + let current_router_parse = document.querySelector('textarea#jform_php_router_parse').value; // set the router parse method script - if(current_router_parse.length == 0){ + if (current_router_parse.length == 0) { getCodeFrom_server(1, 'routerparse', 'type', 'getDynamicScripts').then(function(result) { - if(result){ - jQuery('textarea#jform_php_router_parse').val(result); + if (result.error) { + console.error(result.error); + } else if (result) { + document.querySelector('textarea#jform_php_router_parse').value = result; } }); } @@ -1659,10 +1670,12 @@ function getEditCustomCodeButtons() { }); } -function getLinked(){ +function getLinked() { getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) { - if(result){ - jQuery('#display_linked_to').html(result); + if (result.error) { + console.error(result.error); + } else if (result) { + document.getElementById('display_linked_to').innerHTML = result; } }); } diff --git a/media/js/field.js b/media/js/field.js index 4d7956427..ace637768 100644 --- a/media/js/field.js +++ b/media/js/field.js @@ -782,10 +782,12 @@ function getCodeFrom_server(id, type, type_name, callingName) { }); } -function getLinked(){ +function getLinked() { getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) { - if(result){ - jQuery('#display_linked_to').html(result); + if (result.error) { + console.error(result.error); + } else if (result) { + document.getElementById('display_linked_to').innerHTML = result; } }); } diff --git a/media/js/joomla_module.js b/media/js/joomla_module.js index 907fded97..4523b29a9 100644 --- a/media/js/joomla_module.js +++ b/media/js/joomla_module.js @@ -238,10 +238,12 @@ function setModuleCode() { }); } -function getLinked(){ +function getLinked() { getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) { - if(result){ - jQuery('#display_linked_to').html(result); + if (result.error) { + console.error(result.error); + } else if (result) { + document.getElementById('display_linked_to').innerHTML = result; } }); } diff --git a/media/js/joomla_plugin.js b/media/js/joomla_plugin.js index e0456ae66..0b6c1edf7 100644 --- a/media/js/joomla_plugin.js +++ b/media/js/joomla_plugin.js @@ -700,10 +700,12 @@ function removeCodeFromEditor(code_string, editor_id){ } -function getLinked(){ +function getLinked() { getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) { - if(result){ - jQuery('#display_linked_to').html(result); + if (result.error) { + console.error(result.error); + } else if (result) { + document.getElementById('display_linked_to').innerHTML = result; } }); } diff --git a/media/js/library.js b/media/js/library.js index 4bec3ef01..e17fd0e41 100644 --- a/media/js/library.js +++ b/media/js/library.js @@ -1013,10 +1013,12 @@ function addButton(type, where, size){ }) } -function getLinked(){ +function getLinked() { getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) { - if(result){ - jQuery('#display_linked_to').html(result); + if (result.error) { + console.error(result.error); + } else if (result) { + document.getElementById('display_linked_to').innerHTML = result; } }); } diff --git a/media/js/power.js b/media/js/power.js index 7ada1bb57..a38940b6f 100644 --- a/media/js/power.js +++ b/media/js/power.js @@ -464,10 +464,12 @@ function removeCodeFromEditor(code_string, editor_id){ } -function getLinked(){ +function getLinked() { getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) { - if(result){ - jQuery('#display_linked_to').html(result); + if (result.error) { + console.error(result.error); + } else if (result) { + document.getElementById('display_linked_to').innerHTML = result; } }); } diff --git a/media/js/site_view.js b/media/js/site_view.js index 674465524..dc8ab7eca 100644 --- a/media/js/site_view.js +++ b/media/js/site_view.js @@ -271,10 +271,12 @@ function getCodeFrom_server(id, type, type_name, callingName) { }); } -function getLinked(){ +function getLinked() { getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) { - if(result){ - jQuery('#display_linked_to').html(result); + if (result.error) { + console.error(result.error); + } else if (result) { + document.getElementById('display_linked_to').innerHTML = result; } }); }