Improved the list view builder area in the new assistant area.

This commit is contained in:
Llewellyn van der Merwe 2020-01-12 07:22:19 +02:00
parent 5fa49f1bca
commit a31f09aaa3
No known key found for this signature in database
GPG Key ID: CAD7B16D27AF28C5
6 changed files with 62 additions and 19 deletions

View File

@ -144,11 +144,11 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 11th January, 2020 + *Last Build*: 12th January, 2020
+ *Version*: 2.10.10 + *Version*: 2.10.10
+ *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **281402** + *Line count*: **281445**
+ *Field count*: **1505** + *Field count*: **1505**
+ *File count*: **1769** + *File count*: **1769**
+ *Folder count*: **280** + *Folder count*: **280**

View File

@ -144,11 +144,11 @@ TODO
+ *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com) + *Author*: [Llewellyn van der Merwe](mailto:llewellyn@joomlacomponentbuilder.com)
+ *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder) + *Name*: [Component Builder](https://github.com/vdm-io/Joomla-Component-Builder)
+ *First Build*: 30th April, 2015 + *First Build*: 30th April, 2015
+ *Last Build*: 11th January, 2020 + *Last Build*: 12th January, 2020
+ *Version*: 2.10.10 + *Version*: 2.10.10
+ *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved. + *Copyright*: Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
+ *License*: GNU General Public License version 2 or later; see LICENSE.txt + *License*: GNU General Public License version 2 or later; see LICENSE.txt
+ *Line count*: **281402** + *Line count*: **281445**
+ *Field count*: **1505** + *Field count*: **1505**
+ *File count*: **1769** + *File count*: **1769**
+ *Folder count*: **280** + *Folder count*: **280**

View File

@ -1431,6 +1431,7 @@ COM_COMPONENTBUILDER_BGET_THE_KEY_FROM_SB_FOR_A_SSA="<b>Get the key from %s</b>
COM_COMPONENTBUILDER_BIMAGESB_NOT_MOVED_TO_CORRECT_LOCATION="<b>Images</b> not moved to correct location!" COM_COMPONENTBUILDER_BIMAGESB_NOT_MOVED_TO_CORRECT_LOCATION="<b>Images</b> not moved to correct location!"
COM_COMPONENTBUILDER_BMULTIPLE_FIELD_REPEATABLE_MODEB_IDS_MISMATCH_IN_BFIELDSB_AND_WAS_EMREMOVEDEM_FROM_THE_FIELD="<b>Multiple Field (repeatable mode)</b> id:%s mismatch in <b>field:%s</b>, and was <em>removed</em> from the field." COM_COMPONENTBUILDER_BMULTIPLE_FIELD_REPEATABLE_MODEB_IDS_MISMATCH_IN_BFIELDSB_AND_WAS_EMREMOVEDEM_FROM_THE_FIELD="<b>Multiple Field (repeatable mode)</b> id:%s mismatch in <b>field:%s</b>, and was <em>removed</em> from the field."
COM_COMPONENTBUILDER_BOILERPLATE_PLUGIN_S_DATA_COULD_NOT_BE_SAVED="Boilerplate (plugin - %s) data could not be saved" COM_COMPONENTBUILDER_BOILERPLATE_PLUGIN_S_DATA_COULD_NOT_BE_SAVED="Boilerplate (plugin - %s) data could not be saved"
COM_COMPONENTBUILDER_BOTH="Both"
COM_COMPONENTBUILDER_BSBS_IN_BSB_HAS_ID_MISMATCH_SO_THE_BSB_WAS_REMOVED="<b>%s</b>->%s in <b>%s</b> has id mismatch. So the <b>%s</b> was removed!" COM_COMPONENTBUILDER_BSBS_IN_BSB_HAS_ID_MISMATCH_SO_THE_BSB_WAS_REMOVED="<b>%s</b>->%s in <b>%s</b> has id mismatch. So the <b>%s</b> was removed!"
COM_COMPONENTBUILDER_BSB_COULD_NOT_BE_IMPORTEDS="<b>%s</b> could not be imported%s" COM_COMPONENTBUILDER_BSB_COULD_NOT_BE_IMPORTEDS="<b>%s</b> could not be imported%s"
COM_COMPONENTBUILDER_BSB_HAS_BEEN_IMPORTED="<b>%s</b> has been imported!" COM_COMPONENTBUILDER_BSB_HAS_BEEN_IMPORTED="<b>%s</b> has been imported!"

View File

@ -21,12 +21,53 @@ defined('_JEXEC') or die('Restricted access');
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var active_view = 'view0'; var active_view = 'view0';
var created_fields = {};
jQuery(document).on('subform-row-add', function(event, row){
setFieldNames();
setListViewFieldOptions();
});
function setJCBuilder(area, view, target){ function setJCBuilder(area, view, target){
// set the active view // set the active view
active_view = view; active_view = view;
console.log(active_view); // build fields
console.log(jQuery(area).attr('id')); if (target == 2){
console.log(target); setFieldNames();
setListViewFieldOptions();
}
}
function setListViewFieldOptions(){
// build fields
if (created_fields.hasOwnProperty(active_view)){
jQuery('#modal-listview-' + active_view).find('.list_view_field_option').each(function( i, field ) {
// get field ID
var field_id = jQuery(field).attr('id');
// get the value selected
var selected_value = jQuery("#" + field_id + " option:selected").val();
// clear the options out
jQuery("#" + field_id).find('option').remove().end();
// add inactive value
jQuery('#' + field_id).append('<option value="0">' + Joomla.JText._('COM_COMPONENTBUILDER_INACTIVE_COLUMN') + '</option>');
// add fields available
jQuery.each( created_fields[active_view], function( id, name ) {
jQuery('#'+ field_id).append('<option value="' + name + '">' + name + '</option>');
});
jQuery('#' + field_id).val(selected_value);
jQuery('#' + field_id).trigger('liszt:updated');
});
}
}
function setFieldNames(){
// always reset
created_fields[active_view] = {};
// build fields
jQuery('#modal-fields-' + active_view).find('.field_name').each(function( i, field ) {
// get field name ID
var field_name_id = jQuery(field).attr('id');
// get the value selected
var field_name_value = jQuery("#" + field_name_id).val();
// add/update field
created_fields[active_view][field_name_id] = field_name_value;
});
} }
function setFieldTypeOptions(obj){ function setFieldTypeOptions(obj){
// get type id // get type id

View File

@ -206,7 +206,7 @@ class ComponentbuilderViewAssistant extends JViewLegacy
'label' => 'COM_COMPONENTBUILDER_FIELD_NAME', 'label' => 'COM_COMPONENTBUILDER_FIELD_NAME',
'size' => '40', 'size' => '40',
'maxlength' => '150', 'maxlength' => '150',
'class' => 'text_area', 'class' => 'text_area field_name',
'hint' => 'COM_COMPONENTBUILDER_FIELD_NAME', 'hint' => 'COM_COMPONENTBUILDER_FIELD_NAME',
'filter' => 'STRING' 'filter' => 'STRING'
); );
@ -394,12 +394,12 @@ class ComponentbuilderViewAssistant extends JViewLegacy
'description' => 'COM_COMPONENTBUILDER_AREA', 'description' => 'COM_COMPONENTBUILDER_AREA',
'required' => true, 'required' => true,
'class' => 'list_class', 'class' => 'list_class',
'default' => '1' 'default' => '3'
); );
// load the subform attributes // load the subform attributes
ComponentbuilderHelper::xmlAddAttributes($targetXML, $targetAttribute); ComponentbuilderHelper::xmlAddAttributes($targetXML, $targetAttribute);
// add the options // add the options
ComponentbuilderHelper::xmlAddOptions($targetXML, array(1 => 'COM_COMPONENTBUILDER_ADMIN', 2 => 'COM_COMPONENTBUILDER_SITE')); ComponentbuilderHelper::xmlAddOptions($targetXML, array(3 => 'COM_COMPONENTBUILDER_BOTH', 1 => 'COM_COMPONENTBUILDER_ADMIN', 2 => 'COM_COMPONENTBUILDER_SITE'));
// now add the fields to the child form // now add the fields to the child form
ComponentbuilderHelper::xmlAppend($sub_childform, $targetXML); ComponentbuilderHelper::xmlAppend($sub_childform, $targetXML);
@ -412,7 +412,7 @@ class ComponentbuilderViewAssistant extends JViewLegacy
'label' => 'COM_COMPONENTBUILDER_FIRSTTITLE_COLUMN', 'label' => 'COM_COMPONENTBUILDER_FIRSTTITLE_COLUMN',
'multiple' => false, 'multiple' => false,
'required' => true, 'required' => true,
'class' => 'list_class' 'class' => 'list_class list_view_field_option'
); );
// load the subform attributes // load the subform attributes
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute); ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
@ -430,7 +430,7 @@ class ComponentbuilderViewAssistant extends JViewLegacy
'label' => 'COM_COMPONENTBUILDER_SECOND_COLUMN', 'label' => 'COM_COMPONENTBUILDER_SECOND_COLUMN',
'multiple' => false, 'multiple' => false,
'required' => false, 'required' => false,
'class' => 'list_class' 'class' => 'list_class list_view_field_option'
); );
// load the subform attributes // load the subform attributes
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute); ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
@ -448,7 +448,7 @@ class ComponentbuilderViewAssistant extends JViewLegacy
'label' => 'COM_COMPONENTBUILDER_THIRD_COLUMN', 'label' => 'COM_COMPONENTBUILDER_THIRD_COLUMN',
'multiple' => false, 'multiple' => false,
'required' => false, 'required' => false,
'class' => 'list_class' 'class' => 'list_class list_view_field_option'
); );
// load the subform attributes // load the subform attributes
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute); ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
@ -466,7 +466,7 @@ class ComponentbuilderViewAssistant extends JViewLegacy
'label' => 'COM_COMPONENTBUILDER_FORTH_COLUMN', 'label' => 'COM_COMPONENTBUILDER_FORTH_COLUMN',
'multiple' => false, 'multiple' => false,
'required' => false, 'required' => false,
'class' => 'list_class' 'class' => 'list_class list_view_field_option'
); );
// load the subform attributes // load the subform attributes
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute); ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
@ -484,7 +484,7 @@ class ComponentbuilderViewAssistant extends JViewLegacy
'label' => 'COM_COMPONENTBUILDER_FIFTH_COLUMN', 'label' => 'COM_COMPONENTBUILDER_FIFTH_COLUMN',
'multiple' => false, 'multiple' => false,
'required' => false, 'required' => false,
'class' => 'list_class' 'class' => 'list_class list_view_field_option'
); );
// load the subform attributes // load the subform attributes
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute); ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
@ -502,7 +502,7 @@ class ComponentbuilderViewAssistant extends JViewLegacy
'label' => 'COM_COMPONENTBUILDER_SITH_COLUMN', 'label' => 'COM_COMPONENTBUILDER_SITH_COLUMN',
'multiple' => false, 'multiple' => false,
'required' => false, 'required' => false,
'class' => 'list_class' 'class' => 'list_class list_view_field_option'
); );
// load the subform attributes // load the subform attributes
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute); ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
@ -520,7 +520,7 @@ class ComponentbuilderViewAssistant extends JViewLegacy
'label' => 'COM_COMPONENTBUILDER_SEVENT_COLUMN', 'label' => 'COM_COMPONENTBUILDER_SEVENT_COLUMN',
'multiple' => false, 'multiple' => false,
'required' => false, 'required' => false,
'class' => 'list_class' 'class' => 'list_class list_view_field_option'
); );
// load the subform attributes // load the subform attributes
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute); ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
@ -538,7 +538,7 @@ class ComponentbuilderViewAssistant extends JViewLegacy
'label' => 'COM_COMPONENTBUILDER_EIGHT_COLUMN', 'label' => 'COM_COMPONENTBUILDER_EIGHT_COLUMN',
'multiple' => false, 'multiple' => false,
'required' => false, 'required' => false,
'class' => 'list_class' 'class' => 'list_class list_view_field_option'
); );
// load the subform attributes // load the subform attributes
ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute); ComponentbuilderHelper::xmlAddAttributes($nameXML, $nameAttribute);
@ -743,6 +743,7 @@ class ComponentbuilderViewAssistant extends JViewLegacy
JText::script('COM_COMPONENTBUILDER_PROPERTY_VALUE_IS_MANDATORY'); JText::script('COM_COMPONENTBUILDER_PROPERTY_VALUE_IS_MANDATORY');
JText::script('COM_COMPONENTBUILDER_PROPERTY_VALUE_IS_TRANSLATABLE'); JText::script('COM_COMPONENTBUILDER_PROPERTY_VALUE_IS_TRANSLATABLE');
JText::script('COM_COMPONENTBUILDER_NOT_AVAILABLE'); JText::script('COM_COMPONENTBUILDER_NOT_AVAILABLE');
JText::script('COM_COMPONENTBUILDER_INACTIVE_COLUMN');
// Set the local plans array // Set the local plans array
$this->document->addScriptDeclaration("var local_plans = '';"); $this->document->addScriptDeclaration("var local_plans = '';");
// add the document default css file // add the document default css file

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<extension type="component" version="3.2" method="upgrade"> <extension type="component" version="3.2" method="upgrade">
<name>COM_COMPONENTBUILDER</name> <name>COM_COMPONENTBUILDER</name>
<creationDate>11th January, 2020</creationDate> <creationDate>12th January, 2020</creationDate>
<author>Llewellyn van der Merwe</author> <author>Llewellyn van der Merwe</author>
<authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail> <authorEmail>llewellyn@joomlacomponentbuilder.com</authorEmail>
<authorUrl>http://www.joomlacomponentbuilder.com</authorUrl> <authorUrl>http://www.joomlacomponentbuilder.com</authorUrl>