From a6cdafb31f757a1c729060bf48e1e17ee8d8f2cc Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Wed, 12 Feb 2020 16:27:32 +0200 Subject: [PATCH] Started adding grapesJS to assistant area for the site view builder. --- README.md | 8 ++++---- admin/README.txt | 8 ++++---- admin/helpers/compiler/b_Structure.php | 4 ++-- admin/helpers/compiler/c_Fields.php | 5 ++++- admin/helpers/compiler/f_Infusion.php | 1 + .../en-GB/en-GB.com_componentbuilder.ini | 2 +- admin/sql/install.mysql.utf8.sql | 3 ++- .../assistant/tmpl/default_jcbviewsplan.php | 20 +++++++++++++++++++ admin/views/assistant/view.html.php | 11 +++++++--- componentbuilder.xml | 3 ++- media/grapejs/css/grapes.min.css | 4 ++++ .../css/grapesjs-preset-webpage.min.css | 1 + media/grapejs/css/index.html | 1 + media/grapejs/index.html | 1 + media/grapejs/js/grapes.min.js | 11 ++++++++++ .../grapejs/js/grapesjs-preset-webpage.min.js | 15 ++++++++++++++ media/grapejs/js/index.html | 1 + 17 files changed, 82 insertions(+), 17 deletions(-) create mode 100644 media/grapejs/css/grapes.min.css create mode 100644 media/grapejs/css/grapesjs-preset-webpage.min.css create mode 100644 media/grapejs/css/index.html create mode 100644 media/grapejs/index.html create mode 100644 media/grapejs/js/grapes.min.js create mode 100644 media/grapejs/js/grapesjs-preset-webpage.min.js create mode 100644 media/grapejs/js/index.html diff --git a/README.md b/README.md index 9fe20249c..36c6149a8 100644 --- a/README.md +++ b/README.md @@ -144,14 +144,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 9th February, 2020 ++ *Last Build*: 12th February, 2020 + *Version*: 2.10.11 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **281319** ++ *Line count*: **281346** + *Field count*: **1505** -+ *File count*: **1770** -+ *Folder count*: **280** ++ *File count*: **1777** ++ *Folder count*: **283** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/README.txt b/admin/README.txt index 9fe20249c..36c6149a8 100644 --- a/admin/README.txt +++ b/admin/README.txt @@ -144,14 +144,14 @@ TODO + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *First Build*: 30th April, 2015 -+ *Last Build*: 9th February, 2020 ++ *Last Build*: 12th February, 2020 + *Version*: 2.10.11 + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *License*: GNU General Public License version 2 or later; see LICENSE.txt -+ *Line count*: **281319** ++ *Line count*: **281346** + *Field count*: **1505** -+ *File count*: **1770** -+ *Folder count*: **280** ++ *File count*: **1777** ++ *Folder count*: **283** > This **component** was build with a [Joomla](https://extensions.joomla.org/extension/component-builder/) [Automated Component Builder](http://joomlacomponentbuilder.com). > Developed by [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) diff --git a/admin/helpers/compiler/b_Structure.php b/admin/helpers/compiler/b_Structure.php index 176504f15..b78d1d693 100644 --- a/admin/helpers/compiler/b_Structure.php +++ b/admin/helpers/compiler/b_Structure.php @@ -1811,7 +1811,7 @@ class Structure extends Get // check files exist if (JFile::exists($this->componentPath . '/admin/models/fields/' . $field['type_name'] . '.php')) { - // move the custom field + // copy the custom field JFile::copy($this->componentPath . '/admin/models/fields/' . $field['type_name'] . '.php', $path . '/fields/' . $field['type_name'] . '.php'); } // do this just once @@ -1823,7 +1823,7 @@ class Structure extends Get // check files exist if (JFile::exists($this->componentPath . '/admin/models/rules/' . $this->validationLinkedFields[$field['field']] . '.php')) { - // move the custom field + // copy the custom field JFile::copy($this->componentPath . '/admin/models/rules/' . $this->validationLinkedFields[$field['field']] . '.php', $path . '/rules/' . $this->validationLinkedFields[$field['field']] . '.php'); } // do this just once diff --git a/admin/helpers/compiler/c_Fields.php b/admin/helpers/compiler/c_Fields.php index 0b520c995..9754adf52 100644 --- a/admin/helpers/compiler/c_Fields.php +++ b/admin/helpers/compiler/c_Fields.php @@ -3140,7 +3140,10 @@ class Fields extends Structure public function setCustomFieldTypeFile($data, $view_name_list, $view_name_single) { // make sure it is not already been build or if it is prime - if (isset($data['custom']) && isset($data['custom']['extends']) && ((isset($data['custom']['prime_php']) && $data['custom']['prime_php'] == 1) || !isset($this->fileContentDynamic['customfield_' . $data['type']]) || !ComponentbuilderHelper::checkArray($this->fileContentDynamic['customfield_' . $data['type']]))) + if (isset($data['custom']) && isset($data['custom']['extends']) + && ((isset($data['custom']['prime_php']) && $data['custom']['prime_php'] == 1) + || !isset($this->fileContentDynamic['customfield_' . $data['type']]) + || !ComponentbuilderHelper::checkArray($this->fileContentDynamic['customfield_' . $data['type']]))) { // set J prefix $jprefix = 'J'; diff --git a/admin/helpers/compiler/f_Infusion.php b/admin/helpers/compiler/f_Infusion.php index 0c358ed86..27529d3e4 100644 --- a/admin/helpers/compiler/f_Infusion.php +++ b/admin/helpers/compiler/f_Infusion.php @@ -695,6 +695,7 @@ class Infusion extends Interpretation // CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT <<>> $this->fileContentDynamic[$view['settings']->code][$this->hhh . 'CUSTOM_ADMIN_SUBMITBUTTON_SCRIPT' . $this->hhh] = $this->setCustomViewSubmitButtonScript($view); + // setup the templates $this->setCustomViewTemplateBody($view); diff --git a/admin/language/en-GB/en-GB.com_componentbuilder.ini b/admin/language/en-GB/en-GB.com_componentbuilder.ini index 79a0d3204..b5ef27907 100644 --- a/admin/language/en-GB/en-GB.com_componentbuilder.ini +++ b/admin/language/en-GB/en-GB.com_componentbuilder.ini @@ -5530,7 +5530,6 @@ COM_COMPONENTBUILDER_ISOLATE="Isolate" COM_COMPONENTBUILDER_ISSUE="issue" COM_COMPONENTBUILDER_IS_NOT_ONLY_FOUR_LISTRADIOCHECKBOXES="Is Not (only 4 list/radio/checkboxes)" COM_COMPONENTBUILDER_IS_ONLY_FOUR_LISTRADIOCHECKBOXES="Is (only 4 list/radio/checkboxes)" -COM_COMPONENTBUILDER_ITEM_DISPLAY="Item Display" COM_COMPONENTBUILDER_IWEBSITEI_BSB="Website: %s" COM_COMPONENTBUILDER_JCB_COMMUNITY="JCB Community" COM_COMPONENTBUILDER_JCB_COMMUNITY_PACKAGES="JCB Community Packages" @@ -8152,6 +8151,7 @@ COM_COMPONENTBUILDER_SHOW_ONLY="Show Only" COM_COMPONENTBUILDER_SHOW_TOGGLE="Show Toggle" COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_BIMPORT_PROCESSB_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_BDOES_NOTB_HAVE_THE_KEY_THEY_CAN_SEE_BWHERE_TO_GET_ITB="Since the owner details are displayed during import process before adding the key, this way if the user/dev does not have the key they can see where to get it." COM_COMPONENTBUILDER_SINCE_THE_OWNER_DETAILS_ARE_DISPLAYED_DURING_IMPORT_PROCESS_BEFORE_ADDING_THE_KEY_THIS_WAY_IF_THE_USERDEV_DOES_NOT_HAVE_THE_KEY_THEY_CAN_SEE_WHERE_TO_GET_IT="Since the owner details are displayed during import process before adding the key, this way if the user/dev does not have the key they can see where to get it." +COM_COMPONENTBUILDER_SINGLE_ITEM_DISPLAY_EDITOR_OF_THE_SITE_VIEW="Single item display editor of the site view" COM_COMPONENTBUILDER_SITE="Site" COM_COMPONENTBUILDER_SITE_VIEW="Site View" COM_COMPONENTBUILDER_SITE_VIEWS="Site Views" diff --git a/admin/sql/install.mysql.utf8.sql b/admin/sql/install.mysql.utf8.sql index 008e50342..1d3f38082 100644 --- a/admin/sql/install.mysql.utf8.sql +++ b/admin/sql/install.mysql.utf8.sql @@ -2414,7 +2414,8 @@ INSERT INTO `#__componentbuilder_library_config` (`id`, `addconfig`, `library`, INSERT INTO `#__componentbuilder_library_files_folders_urls` (`id`, `addfiles`, `addfolders`, `addurls`, `library`, `params`, `published`, `created`, `modified`, `version`, `hits`, `ordering`) VALUES (2, '', '', '{\"addurls0\":{\"url\":\"https:\\/\\/maxcdn.bootstrapcdn.com\\/bootstrap\\/4.0.0-alpha.6\\/js\\/bootstrap.min.js\",\"type\":\"2\"},\"addurls1\":{\"url\":\"https:\\/\\/maxcdn.bootstrapcdn.com\\/bootstrap\\/4.0.0-alpha.6\\/css\\/bootstrap.min.css\",\"type\":\"2\"}}', 2, '', 1, '2017-11-25 16:17:36', '2018-05-02 23:29:05', 11, '', 2), (3, '', '', '{\"addurls0\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/uikit\\/3.0.0-rc.16\\/js\\/uikit.min.js\",\"type\":\"2\"},\"addurls2\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/uikit\\/3.0.0-rc.16\\/js\\/uikit-icons.min.js\",\"type\":\"2\"},\"addurls4\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/uikit\\/3.0.0-rc.16\\/css\\/uikit.min.css\",\"type\":\"2\"}}', 3, '', 1, '2017-11-25 21:47:40', '2018-09-19 14:22:09', 10, '', 3), -(4, '{}', '{\"addfolders0\":{\"folder\":\"file_icon_vectors\",\"path\":\"\\/media\\/vector\",\"rename\":\"1\"}}', '{}', 7, '', 1, '2019-10-03 09:24:30', '2019-10-03 09:25:39', 2, '', 4); +(4, '{}', '{\"addfolders0\":{\"folder\":\"file_icon_vectors\",\"path\":\"\\/media\\/vector\",\"rename\":\"1\"}}', '{}', 7, '', 1, '2019-10-03 09:24:30', '2019-10-03 09:25:39', 2, '', 4), +(5, '{}', '{}', '{\"addurls0\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/grapesjs\\/0.14.15\\/css\\/grapes.min.css\",\"type\":2},\"addurls2\":{\"url\":\"https:\\/\\/raw.githubusercontent.com\\/artf\\/grapesjs-preset-webpage\\/master\\/dist\\/grapesjs-preset-webpage.min.css\",\"type\":2},\"addurls1\":{\"url\":\"https:\\/\\/cdnjs.cloudflare.com\\/ajax\\/libs\\/grapesjs\\/0.14.15\\/grapes.min.js\",\"type\":2},\"addurls3\":{\"url\":\"https:\\/\\/raw.githubusercontent.com\\/artf\\/grapesjs-preset-webpage\\/master\\/dist\\/grapesjs-preset-webpage.min.js\",\"type\":2}}', 8, '', 1, '2020-02-10 21:34:33', '2020-02-12 13:57:06', 4, '', 5); CREATE TABLE IF NOT EXISTS `#__componentbuilder_external_code` ( diff --git a/admin/views/assistant/tmpl/default_jcbviewsplan.php b/admin/views/assistant/tmpl/default_jcbviewsplan.php index a11ea16ea..455b9c45d 100644 --- a/admin/views/assistant/tmpl/default_jcbviewsplan.php +++ b/admin/views/assistant/tmpl/default_jcbviewsplan.php @@ -21,6 +21,8 @@ defined('_JEXEC') or die('Restricted access');