2018-05-18 06:28:27 +00:00
|
|
|
/**
|
|
|
|
* @package Joomla.Component.Builder
|
|
|
|
*
|
|
|
|
* @created 30th April, 2015
|
|
|
|
* @author Llewellyn van der Merwe <http://www.joomlacomponentbuilder.com>
|
|
|
|
* @github Joomla Component Builder <https://github.com/vdm-io/Joomla-Component-Builder>
|
2019-02-23 13:28:54 +00:00
|
|
|
* @copyright Copyright (C) 2015 - 2019 Vast Development Method. All rights reserved.
|
2018-05-18 06:28:27 +00:00
|
|
|
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
|
|
|
*/
|
2017-11-11 22:18:13 +00:00
|
|
|
|
2017-11-26 00:29:08 +00:00
|
|
|
// Some Global Values
|
2019-07-28 21:48:42 +00:00
|
|
|
jform_vvvvwblvxj_required = false;
|
|
|
|
jform_vvvvwbrvxk_required = false;
|
2017-11-26 00:29:08 +00:00
|
|
|
|
|
|
|
// Initial Script
|
|
|
|
jQuery(document).ready(function()
|
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
var how_vvvvwbk = jQuery("#jform_how").val();
|
|
|
|
vvvvwbk(how_vvvvwbk);
|
2019-07-15 20:00:46 +00:00
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
var how_vvvvwbl = jQuery("#jform_how").val();
|
|
|
|
vvvvwbl(how_vvvvwbl);
|
2019-07-15 20:00:46 +00:00
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
var how_vvvvwbm = jQuery("#jform_how").val();
|
|
|
|
vvvvwbm(how_vvvvwbm);
|
2019-07-15 20:00:46 +00:00
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
var how_vvvvwbn = jQuery("#jform_how").val();
|
|
|
|
vvvvwbn(how_vvvvwbn);
|
2019-07-15 20:00:46 +00:00
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
var how_vvvvwbo = jQuery("#jform_how").val();
|
|
|
|
vvvvwbo(how_vvvvwbo);
|
2019-07-19 02:17:15 +00:00
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
var how_vvvvwbp = jQuery("#jform_how").val();
|
|
|
|
vvvvwbp(how_vvvvwbp);
|
2019-07-19 02:17:15 +00:00
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
var how_vvvvwbq = jQuery("#jform_how").val();
|
|
|
|
vvvvwbq(how_vvvvwbq);
|
2019-07-19 02:17:15 +00:00
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
var type_vvvvwbr = jQuery("#jform_type input[type='radio']:checked").val();
|
|
|
|
vvvvwbr(type_vvvvwbr);
|
2019-06-12 20:36:05 +00:00
|
|
|
});
|
2018-07-06 13:46:30 +00:00
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
// the vvvvwbk function
|
|
|
|
function vvvvwbk(how_vvvvwbk)
|
2018-07-06 13:46:30 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
if (isSet(how_vvvvwbk) && how_vvvvwbk.constructor !== Array)
|
2018-07-06 13:46:30 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
var temp_vvvvwbk = how_vvvvwbk;
|
|
|
|
var how_vvvvwbk = [];
|
|
|
|
how_vvvvwbk.push(temp_vvvvwbk);
|
2018-07-06 13:46:30 +00:00
|
|
|
}
|
2019-07-28 21:48:42 +00:00
|
|
|
else if (!isSet(how_vvvvwbk))
|
2018-07-06 13:46:30 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
var how_vvvvwbk = [];
|
2018-07-06 13:46:30 +00:00
|
|
|
}
|
2019-07-28 21:48:42 +00:00
|
|
|
var how = how_vvvvwbk.some(how_vvvvwbk_SomeFunc);
|
2018-07-06 13:46:30 +00:00
|
|
|
|
|
|
|
|
2018-08-14 08:25:46 +00:00
|
|
|
// set this function logic
|
|
|
|
if (how)
|
|
|
|
{
|
2019-06-12 20:36:05 +00:00
|
|
|
jQuery('#jform_addconditions-lbl').closest('.control-group').show();
|
2018-08-14 08:25:46 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-06-12 20:36:05 +00:00
|
|
|
jQuery('#jform_addconditions-lbl').closest('.control-group').hide();
|
2018-08-14 08:25:46 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
// the vvvvwbk Some function
|
|
|
|
function how_vvvvwbk_SomeFunc(how_vvvvwbk)
|
2018-08-14 08:25:46 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2019-07-28 21:48:42 +00:00
|
|
|
if (how_vvvvwbk == 2)
|
2018-08-14 08:25:46 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
// the vvvvwbl function
|
|
|
|
function vvvvwbl(how_vvvvwbl)
|
2018-08-14 08:25:46 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
if (isSet(how_vvvvwbl) && how_vvvvwbl.constructor !== Array)
|
2018-08-14 08:25:46 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
var temp_vvvvwbl = how_vvvvwbl;
|
|
|
|
var how_vvvvwbl = [];
|
|
|
|
how_vvvvwbl.push(temp_vvvvwbl);
|
2018-08-14 08:25:46 +00:00
|
|
|
}
|
2019-07-28 21:48:42 +00:00
|
|
|
else if (!isSet(how_vvvvwbl))
|
2018-08-14 08:25:46 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
var how_vvvvwbl = [];
|
2018-08-14 08:25:46 +00:00
|
|
|
}
|
2019-07-28 21:48:42 +00:00
|
|
|
var how = how_vvvvwbl.some(how_vvvvwbl_SomeFunc);
|
2018-08-14 08:25:46 +00:00
|
|
|
|
|
|
|
|
2018-08-23 01:37:42 +00:00
|
|
|
// set this function logic
|
|
|
|
if (how)
|
|
|
|
{
|
2019-06-12 20:36:05 +00:00
|
|
|
jQuery('#jform_php_setdocument').closest('.control-group').show();
|
|
|
|
// add required attribute to php_setdocument field
|
2019-07-28 21:48:42 +00:00
|
|
|
if (jform_vvvvwblvxj_required)
|
2019-06-12 20:36:05 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('php_setdocument',0);
|
|
|
|
jQuery('#jform_php_setdocument').prop('required','required');
|
|
|
|
jQuery('#jform_php_setdocument').attr('aria-required',true);
|
|
|
|
jQuery('#jform_php_setdocument').addClass('required');
|
2019-07-28 21:48:42 +00:00
|
|
|
jform_vvvvwblvxj_required = false;
|
2019-06-12 20:36:05 +00:00
|
|
|
}
|
2018-08-23 01:37:42 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-06-12 20:36:05 +00:00
|
|
|
jQuery('#jform_php_setdocument').closest('.control-group').hide();
|
|
|
|
// remove required attribute from php_setdocument field
|
2019-07-28 21:48:42 +00:00
|
|
|
if (!jform_vvvvwblvxj_required)
|
2019-06-12 20:36:05 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('php_setdocument',1);
|
|
|
|
jQuery('#jform_php_setdocument').removeAttr('required');
|
|
|
|
jQuery('#jform_php_setdocument').removeAttr('aria-required');
|
|
|
|
jQuery('#jform_php_setdocument').removeClass('required');
|
2019-07-28 21:48:42 +00:00
|
|
|
jform_vvvvwblvxj_required = true;
|
2019-06-12 20:36:05 +00:00
|
|
|
}
|
2018-08-23 01:37:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
// the vvvvwbl Some function
|
|
|
|
function how_vvvvwbl_SomeFunc(how_vvvvwbl)
|
2018-08-23 01:37:42 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2019-07-28 21:48:42 +00:00
|
|
|
if (how_vvvvwbl == 3)
|
2018-08-23 01:37:42 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
// the vvvvwbm function
|
|
|
|
function vvvvwbm(how_vvvvwbm)
|
2018-08-23 01:37:42 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
if (isSet(how_vvvvwbm) && how_vvvvwbm.constructor !== Array)
|
2018-08-23 01:37:42 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
var temp_vvvvwbm = how_vvvvwbm;
|
|
|
|
var how_vvvvwbm = [];
|
|
|
|
how_vvvvwbm.push(temp_vvvvwbm);
|
2018-08-23 01:37:42 +00:00
|
|
|
}
|
2019-07-28 21:48:42 +00:00
|
|
|
else if (!isSet(how_vvvvwbm))
|
2018-08-23 01:37:42 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
var how_vvvvwbm = [];
|
2018-08-23 01:37:42 +00:00
|
|
|
}
|
2019-07-28 21:48:42 +00:00
|
|
|
var how = how_vvvvwbm.some(how_vvvvwbm_SomeFunc);
|
2018-08-23 01:37:42 +00:00
|
|
|
|
|
|
|
|
2019-01-29 14:43:27 +00:00
|
|
|
// set this function logic
|
|
|
|
if (how)
|
|
|
|
{
|
2019-06-12 20:36:05 +00:00
|
|
|
jQuery('.note_display_library_config').closest('.control-group').show();
|
2019-01-29 14:43:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-06-12 20:36:05 +00:00
|
|
|
jQuery('.note_display_library_config').closest('.control-group').hide();
|
2019-01-29 14:43:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
// the vvvvwbm Some function
|
|
|
|
function how_vvvvwbm_SomeFunc(how_vvvvwbm)
|
2019-01-29 14:43:27 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2019-07-28 21:48:42 +00:00
|
|
|
if (how_vvvvwbm == 2 || how_vvvvwbm == 3)
|
2019-01-29 14:43:27 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
// the vvvvwbn function
|
|
|
|
function vvvvwbn(how_vvvvwbn)
|
2019-01-29 14:43:27 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
if (isSet(how_vvvvwbn) && how_vvvvwbn.constructor !== Array)
|
2019-01-29 14:43:27 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
var temp_vvvvwbn = how_vvvvwbn;
|
|
|
|
var how_vvvvwbn = [];
|
|
|
|
how_vvvvwbn.push(temp_vvvvwbn);
|
2019-01-29 14:43:27 +00:00
|
|
|
}
|
2019-07-28 21:48:42 +00:00
|
|
|
else if (!isSet(how_vvvvwbn))
|
2019-01-29 14:43:27 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
var how_vvvvwbn = [];
|
2019-01-29 14:43:27 +00:00
|
|
|
}
|
2019-07-28 21:48:42 +00:00
|
|
|
var how = how_vvvvwbn.some(how_vvvvwbn_SomeFunc);
|
2019-01-29 14:43:27 +00:00
|
|
|
|
|
|
|
|
2019-05-15 17:39:27 +00:00
|
|
|
// set this function logic
|
|
|
|
if (how)
|
|
|
|
{
|
2019-06-12 20:36:05 +00:00
|
|
|
jQuery('.note_display_library_files_folders_urls').closest('.control-group').show();
|
2019-05-15 17:39:27 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-06-12 20:36:05 +00:00
|
|
|
jQuery('.note_display_library_files_folders_urls').closest('.control-group').hide();
|
2019-05-15 17:39:27 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
// the vvvvwbn Some function
|
|
|
|
function how_vvvvwbn_SomeFunc(how_vvvvwbn)
|
2019-05-15 17:39:27 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2019-07-28 21:48:42 +00:00
|
|
|
if (how_vvvvwbn == 1 || how_vvvvwbn == 2 || how_vvvvwbn == 3)
|
2019-05-15 17:39:27 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
// the vvvvwbo function
|
|
|
|
function vvvvwbo(how_vvvvwbo)
|
2019-05-15 17:39:27 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
if (isSet(how_vvvvwbo) && how_vvvvwbo.constructor !== Array)
|
2019-05-15 17:39:27 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
var temp_vvvvwbo = how_vvvvwbo;
|
|
|
|
var how_vvvvwbo = [];
|
|
|
|
how_vvvvwbo.push(temp_vvvvwbo);
|
2019-05-15 17:39:27 +00:00
|
|
|
}
|
2019-07-28 21:48:42 +00:00
|
|
|
else if (!isSet(how_vvvvwbo))
|
2019-05-15 17:39:27 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
var how_vvvvwbo = [];
|
2019-05-15 17:39:27 +00:00
|
|
|
}
|
2019-07-28 21:48:42 +00:00
|
|
|
var how = how_vvvvwbo.some(how_vvvvwbo_SomeFunc);
|
2019-05-15 17:39:27 +00:00
|
|
|
|
|
|
|
|
2019-06-12 20:06:19 +00:00
|
|
|
// set this function logic
|
|
|
|
if (how)
|
|
|
|
{
|
2019-06-12 20:36:05 +00:00
|
|
|
jQuery('.note_no_behaviour_one').closest('.control-group').show();
|
|
|
|
jQuery('.note_no_behaviour_three').closest('.control-group').show();
|
|
|
|
jQuery('.note_no_behaviour_two').closest('.control-group').show();
|
2019-06-12 20:06:19 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2019-06-12 20:36:05 +00:00
|
|
|
jQuery('.note_no_behaviour_one').closest('.control-group').hide();
|
|
|
|
jQuery('.note_no_behaviour_three').closest('.control-group').hide();
|
|
|
|
jQuery('.note_no_behaviour_two').closest('.control-group').hide();
|
2019-06-12 20:06:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
// the vvvvwbo Some function
|
|
|
|
function how_vvvvwbo_SomeFunc(how_vvvvwbo)
|
2019-06-12 20:06:19 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2019-07-28 21:48:42 +00:00
|
|
|
if (how_vvvvwbo == 0)
|
2019-06-12 20:06:19 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
// the vvvvwbp function
|
|
|
|
function vvvvwbp(how_vvvvwbp)
|
2019-06-12 20:06:19 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
if (isSet(how_vvvvwbp) && how_vvvvwbp.constructor !== Array)
|
2019-06-12 20:06:19 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
var temp_vvvvwbp = how_vvvvwbp;
|
|
|
|
var how_vvvvwbp = [];
|
|
|
|
how_vvvvwbp.push(temp_vvvvwbp);
|
2019-06-12 20:06:19 +00:00
|
|
|
}
|
2019-07-28 21:48:42 +00:00
|
|
|
else if (!isSet(how_vvvvwbp))
|
2019-06-12 20:06:19 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
var how_vvvvwbp = [];
|
2019-06-12 20:06:19 +00:00
|
|
|
}
|
2019-07-28 21:48:42 +00:00
|
|
|
var how = how_vvvvwbp.some(how_vvvvwbp_SomeFunc);
|
2019-06-12 20:06:19 +00:00
|
|
|
|
|
|
|
|
2019-06-12 20:36:05 +00:00
|
|
|
// set this function logic
|
|
|
|
if (how)
|
|
|
|
{
|
|
|
|
jQuery('.note_yes_behaviour_one').closest('.control-group').show();
|
|
|
|
jQuery('.note_yes_behaviour_two').closest('.control-group').show();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('.note_yes_behaviour_one').closest('.control-group').hide();
|
|
|
|
jQuery('.note_yes_behaviour_two').closest('.control-group').hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
// the vvvvwbp Some function
|
|
|
|
function how_vvvvwbp_SomeFunc(how_vvvvwbp)
|
2019-06-12 20:36:05 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2019-07-28 21:48:42 +00:00
|
|
|
if (how_vvvvwbp == 1)
|
2019-06-12 20:36:05 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
// the vvvvwbq function
|
|
|
|
function vvvvwbq(how_vvvvwbq)
|
2019-06-12 20:36:05 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
if (isSet(how_vvvvwbq) && how_vvvvwbq.constructor !== Array)
|
2019-06-12 20:36:05 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
var temp_vvvvwbq = how_vvvvwbq;
|
|
|
|
var how_vvvvwbq = [];
|
|
|
|
how_vvvvwbq.push(temp_vvvvwbq);
|
2019-06-12 20:36:05 +00:00
|
|
|
}
|
2019-07-28 21:48:42 +00:00
|
|
|
else if (!isSet(how_vvvvwbq))
|
2019-06-12 20:36:05 +00:00
|
|
|
{
|
2019-07-28 21:48:42 +00:00
|
|
|
var how_vvvvwbq = [];
|
2019-06-12 20:36:05 +00:00
|
|
|
}
|
2019-07-28 21:48:42 +00:00
|
|
|
var how = how_vvvvwbq.some(how_vvvvwbq_SomeFunc);
|
2019-06-12 20:36:05 +00:00
|
|
|
|
|
|
|
|
2017-12-10 19:17:26 +00:00
|
|
|
// set this function logic
|
|
|
|
if (how)
|
|
|
|
{
|
|
|
|
jQuery('.note_build_in_behaviour_one').closest('.control-group').show();
|
|
|
|
jQuery('.note_build_in_behaviour_three').closest('.control-group').show();
|
|
|
|
jQuery('.note_build_in_behaviour_two').closest('.control-group').show();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('.note_build_in_behaviour_one').closest('.control-group').hide();
|
|
|
|
jQuery('.note_build_in_behaviour_three').closest('.control-group').hide();
|
|
|
|
jQuery('.note_build_in_behaviour_two').closest('.control-group').hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
// the vvvvwbq Some function
|
|
|
|
function how_vvvvwbq_SomeFunc(how_vvvvwbq)
|
2017-12-10 19:17:26 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2019-07-28 21:48:42 +00:00
|
|
|
if (how_vvvvwbq == 4)
|
2017-12-10 19:17:26 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-07-28 21:48:42 +00:00
|
|
|
// the vvvvwbr function
|
|
|
|
function vvvvwbr(type_vvvvwbr)
|
2017-12-03 18:09:04 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2019-07-28 21:48:42 +00:00
|
|
|
if (type_vvvvwbr == 2)
|
2017-12-03 18:09:04 +00:00
|
|
|
{
|
|
|
|
jQuery('#jform_libraries').closest('.control-group').show();
|
2018-09-10 11:04:52 +00:00
|
|
|
// add required attribute to libraries field
|
2019-07-28 21:48:42 +00:00
|
|
|
if (jform_vvvvwbrvxk_required)
|
2017-12-03 18:09:04 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('libraries',0);
|
|
|
|
jQuery('#jform_libraries').prop('required','required');
|
|
|
|
jQuery('#jform_libraries').attr('aria-required',true);
|
|
|
|
jQuery('#jform_libraries').addClass('required');
|
2019-07-28 21:48:42 +00:00
|
|
|
jform_vvvvwbrvxk_required = false;
|
2017-12-03 18:09:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_libraries').closest('.control-group').hide();
|
2018-09-10 11:04:52 +00:00
|
|
|
// remove required attribute from libraries field
|
2019-07-28 21:48:42 +00:00
|
|
|
if (!jform_vvvvwbrvxk_required)
|
2017-12-03 18:09:04 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('libraries',1);
|
|
|
|
jQuery('#jform_libraries').removeAttr('required');
|
|
|
|
jQuery('#jform_libraries').removeAttr('aria-required');
|
|
|
|
jQuery('#jform_libraries').removeClass('required');
|
2019-07-28 21:48:42 +00:00
|
|
|
jform_vvvvwbrvxk_required = true;
|
2017-12-03 18:09:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-11-26 00:29:08 +00:00
|
|
|
// update required fields
|
|
|
|
function updateFieldRequired(name,status)
|
|
|
|
{
|
|
|
|
var not_required = jQuery('#jform_not_required').val();
|
|
|
|
|
|
|
|
if(status == 1)
|
|
|
|
{
|
|
|
|
if (isSet(not_required) && not_required != 0)
|
|
|
|
{
|
|
|
|
not_required = not_required+','+name;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
not_required = ','+name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (isSet(not_required) && not_required != 0)
|
|
|
|
{
|
|
|
|
not_required = not_required.replace(','+name,'');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
jQuery('#jform_not_required').val(not_required);
|
|
|
|
}
|
|
|
|
|
|
|
|
// the isSet function
|
|
|
|
function isSet(val)
|
|
|
|
{
|
|
|
|
if ((val != undefined) && (val != null) && 0 !== val.length){
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2018-03-11 02:44:43 +00:00
|
|
|
|
2017-11-26 00:29:08 +00:00
|
|
|
jQuery(document).ready(function()
|
|
|
|
{
|
2018-01-15 15:54:05 +00:00
|
|
|
// get the linked details
|
|
|
|
getLinked();
|
2017-11-26 00:29:08 +00:00
|
|
|
// now load the displays
|
|
|
|
getAjaxDisplay('library_config');
|
|
|
|
getAjaxDisplay('library_files_folders_urls');
|
2019-01-31 21:44:21 +00:00
|
|
|
|
|
|
|
// check and load all the customcode edit buttons
|
|
|
|
setTimeout(getEditCustomCodeButtons, 300);
|
2017-11-26 00:29:08 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
function addData(result,where){
|
|
|
|
jQuery(result).insertAfter(jQuery(where).closest('.control-group'));
|
|
|
|
}
|
2019-01-31 21:44:21 +00:00
|
|
|
|
|
|
|
function getAjaxDisplay(type){
|
|
|
|
getAjaxDisplay_server(type).done(function(result) {
|
|
|
|
if (result) {
|
|
|
|
jQuery('#display_'+type).html(result);
|
|
|
|
}
|
|
|
|
// set button
|
|
|
|
addButtonID(type,'header_'+type+'_buttons', 2); // <-- little edit button
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function getAjaxDisplay_server(type){
|
2019-07-08 16:05:54 +00:00
|
|
|
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getAjaxDisplay&format=json&raw=true&vdm="+vastDevMod);
|
2019-01-31 21:44:21 +00:00
|
|
|
if (token.length > 0 && type.length > 0) {
|
2019-07-08 16:05:54 +00:00
|
|
|
var request = token+'=1&type=' + type;
|
2019-01-31 21:44:21 +00:00
|
|
|
}
|
|
|
|
return jQuery.ajax({
|
|
|
|
type: 'GET',
|
|
|
|
url: getUrl,
|
|
|
|
dataType: 'json',
|
|
|
|
data: request,
|
|
|
|
jsonp: false
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function getFieldSelectOptions_server(fieldId){
|
2019-07-08 16:05:54 +00:00
|
|
|
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.fieldSelectOptions&format=json&raw=true");
|
2019-01-31 21:44:21 +00:00
|
|
|
if (token.length > 0 && fieldId > 0) {
|
2019-07-08 16:05:54 +00:00
|
|
|
var request = token+'=1&id='+fieldId;
|
2019-01-31 21:44:21 +00:00
|
|
|
}
|
|
|
|
return jQuery.ajax({
|
|
|
|
type: 'GET',
|
|
|
|
url: getUrl,
|
|
|
|
dataType: 'json',
|
|
|
|
data: request,
|
|
|
|
jsonp: false
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function getFieldSelectOptions(fieldKey){
|
|
|
|
// first check if the field is set
|
|
|
|
if(jQuery("#jform_addconditions__addconditions"+fieldKey+"__option_field").length) {
|
|
|
|
var fieldId = jQuery("#jform_addconditions__addconditions"+fieldKey+"__option_field option:selected").val();
|
|
|
|
getFieldSelectOptions_server(fieldId).done(function(result) {
|
|
|
|
if(result) {
|
|
|
|
jQuery('textarea#jform_addconditions__addconditions'+fieldKey+'__field_options').val(result);
|
|
|
|
} else {
|
|
|
|
jQuery('textarea#jform_addconditions__addconditions'+fieldKey+'__field_options').val('');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function getEditCustomCodeButtons_server(id){
|
2019-07-08 16:05:54 +00:00
|
|
|
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
2019-01-31 21:44:21 +00:00
|
|
|
if(token.length > 0 && id > 0){
|
2019-07-08 16:05:54 +00:00
|
|
|
var request = token+'=1&id='+id+'&return_here='+return_here;
|
2019-01-31 21:44:21 +00:00
|
|
|
}
|
|
|
|
return jQuery.ajax({
|
|
|
|
type: 'GET',
|
|
|
|
url: getUrl,
|
|
|
|
dataType: 'json',
|
|
|
|
data: request,
|
|
|
|
jsonp: false
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function getEditCustomCodeButtons(){
|
|
|
|
// get the id
|
|
|
|
id = jQuery("#jform_id").val();
|
|
|
|
getEditCustomCodeButtons_server(id).done(function(result) {
|
|
|
|
if(isObject(result)){
|
|
|
|
jQuery.each(result, function( field, buttons ) {
|
2019-05-15 22:50:45 +00:00
|
|
|
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
2019-01-31 21:44:21 +00:00
|
|
|
jQuery.each(buttons, function( name, button ) {
|
|
|
|
jQuery(".control-customcode-buttons-"+field).append(button);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
// check object is not empty
|
|
|
|
function isObject(obj) {
|
|
|
|
for(var prop in obj) {
|
|
|
|
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
2018-02-27 12:17:38 +00:00
|
|
|
|
2017-11-26 00:29:08 +00:00
|
|
|
function addButtonID_server(type, size){
|
2018-12-29 14:56:06 +00:00
|
|
|
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButtonID&format=json&raw=true&vdm="+vastDevMod);
|
2017-11-26 00:29:08 +00:00
|
|
|
if(token.length > 0 && type.length > 0 && size > 0){
|
2019-07-08 16:05:54 +00:00
|
|
|
var request = token+'=1&type='+type+'&size='+size;
|
2017-11-26 00:29:08 +00:00
|
|
|
}
|
|
|
|
return jQuery.ajax({
|
|
|
|
type: 'GET',
|
|
|
|
url: getUrl,
|
2018-12-29 14:56:06 +00:00
|
|
|
dataType: 'json',
|
2017-11-26 00:29:08 +00:00
|
|
|
data: request,
|
2018-12-29 14:56:06 +00:00
|
|
|
jsonp: false
|
2017-11-26 00:29:08 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
function addButtonID(type, where, size){
|
|
|
|
addButtonID_server(type, size).done(function(result) {
|
|
|
|
if(result){
|
|
|
|
if (2 == size) {
|
|
|
|
jQuery('#'+where).html(result);
|
|
|
|
} else {
|
|
|
|
addData(result, '#jform_'+where);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2018-02-27 12:17:38 +00:00
|
|
|
}
|
|
|
|
|
2018-03-28 09:46:14 +00:00
|
|
|
function addButton_server(type, size){
|
2018-12-29 14:56:06 +00:00
|
|
|
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getButton&format=json&raw=true&vdm="+vastDevMod);
|
2017-11-26 00:29:08 +00:00
|
|
|
if(token.length > 0 && type.length > 0){
|
2019-07-08 16:05:54 +00:00
|
|
|
var request = token+'=1&type='+type+'&size='+size;
|
2017-11-26 00:29:08 +00:00
|
|
|
}
|
|
|
|
return jQuery.ajax({
|
|
|
|
type: 'GET',
|
|
|
|
url: getUrl,
|
2018-12-29 14:56:06 +00:00
|
|
|
dataType: 'json',
|
2017-11-26 00:29:08 +00:00
|
|
|
data: request,
|
2018-12-29 14:56:06 +00:00
|
|
|
jsonp: false
|
2017-11-26 00:29:08 +00:00
|
|
|
});
|
|
|
|
}
|
2018-03-28 09:46:14 +00:00
|
|
|
function addButton(type, where, size){
|
|
|
|
// just to insure that default behaviour still works
|
|
|
|
size = typeof size !== 'undefined' ? size : 1;
|
|
|
|
addButton_server(type, size).done(function(result) {
|
2017-11-26 00:29:08 +00:00
|
|
|
if(result){
|
2018-03-28 09:46:14 +00:00
|
|
|
if (2 == size) {
|
|
|
|
jQuery('#'+where).html(result);
|
|
|
|
} else {
|
|
|
|
addData(result, '#jform_'+where);
|
|
|
|
}
|
2017-11-26 00:29:08 +00:00
|
|
|
}
|
|
|
|
})
|
2018-02-27 12:17:38 +00:00
|
|
|
}
|
|
|
|
|
2018-01-15 15:54:05 +00:00
|
|
|
function getLinked_server(type){
|
2019-07-08 16:05:54 +00:00
|
|
|
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getLinked&format=json&raw=true&vdm="+vastDevMod);
|
2018-01-15 15:54:05 +00:00
|
|
|
if(token.length > 0 && type > 0){
|
2019-07-08 16:05:54 +00:00
|
|
|
var request = token+'=1&type='+type;
|
2018-01-15 15:54:05 +00:00
|
|
|
}
|
|
|
|
return jQuery.ajax({
|
|
|
|
type: 'GET',
|
|
|
|
url: getUrl,
|
2018-12-29 14:56:06 +00:00
|
|
|
dataType: 'json',
|
2018-01-15 15:54:05 +00:00
|
|
|
data: request,
|
2018-12-29 14:56:06 +00:00
|
|
|
jsonp: false
|
2018-01-15 15:54:05 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function getLinked(){
|
|
|
|
getLinked_server(1).done(function(result) {
|
|
|
|
if(result){
|
|
|
|
jQuery('#display_linked_to').html(result);
|
|
|
|
}
|
|
|
|
});
|
2017-11-26 00:29:08 +00:00
|
|
|
}
|