2016-01-30 20:28:43 +00:00
|
|
|
/*--------------------------------------------------------------------------------------------------------| www.vdm.io |------/
|
|
|
|
__ __ _ _____ _ _ __ __ _ _ _
|
|
|
|
\ \ / / | | | __ \ | | | | | \/ | | | | | | |
|
|
|
|
\ \ / /_ _ ___| |_ | | | | _____ _____| | ___ _ __ _ __ ___ ___ _ __ | |_ | \ / | ___| |_| |__ ___ __| |
|
|
|
|
\ \/ / _` / __| __| | | | |/ _ \ \ / / _ \ |/ _ \| '_ \| '_ ` _ \ / _ \ '_ \| __| | |\/| |/ _ \ __| '_ \ / _ \ / _` |
|
|
|
|
\ / (_| \__ \ |_ | |__| | __/\ V / __/ | (_) | |_) | | | | | | __/ | | | |_ | | | | __/ |_| | | | (_) | (_| |
|
|
|
|
\/ \__,_|___/\__| |_____/ \___| \_/ \___|_|\___/| .__/|_| |_| |_|\___|_| |_|\__| |_| |_|\___|\__|_| |_|\___/ \__,_|
|
|
|
|
| |
|
|
|
|
|_|
|
|
|
|
/-------------------------------------------------------------------------------------------------------------------------------/
|
|
|
|
|
2016-03-01 18:44:13 +00:00
|
|
|
@version 2.1.1
|
|
|
|
@build 1st March, 2016
|
2016-01-30 20:28:43 +00:00
|
|
|
@created 30th April, 2015
|
|
|
|
@package Component Builder
|
|
|
|
@subpackage field.js
|
|
|
|
@author Llewellyn van der Merwe <https://www.vdm.io/joomla-component-builder>
|
|
|
|
@my wife Roline van der Merwe <http://www.vdm.io/>
|
|
|
|
@copyright Copyright (C) 2015. All Rights Reserved
|
|
|
|
@license GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
|
|
|
|
|
|
|
|
Builds Complex Joomla Components
|
|
|
|
|
|
|
|
/-----------------------------------------------------------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
// Some Global Values
|
2016-02-26 13:57:30 +00:00
|
|
|
jform_vvvvvyrvyn_required = false;
|
|
|
|
jform_vvvvvysvyo_required = false;
|
|
|
|
jform_vvvvvytvyp_required = false;
|
|
|
|
jform_vvvvvywvyq_required = false;
|
|
|
|
jform_vvvvvyxvyr_required = false;
|
|
|
|
jform_vvvvvyyvys_required = false;
|
|
|
|
jform_vvvvvyzvyt_required = false;
|
2016-01-30 20:28:43 +00:00
|
|
|
|
|
|
|
// Initial Script
|
|
|
|
jQuery(document).ready(function()
|
|
|
|
{
|
2016-02-26 13:57:30 +00:00
|
|
|
var datalenght_vvvvvyr = jQuery("#jform_datalenght").val();
|
|
|
|
vvvvvyr(datalenght_vvvvvyr);
|
2016-01-30 20:28:43 +00:00
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
var datadefault_vvvvvys = jQuery("#jform_datadefault").val();
|
|
|
|
vvvvvys(datadefault_vvvvvys);
|
2016-01-30 20:28:43 +00:00
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
var datatype_vvvvvyt = jQuery("#jform_datatype").val();
|
|
|
|
vvvvvyt(datatype_vvvvvyt);
|
2016-01-30 20:28:43 +00:00
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
var store_vvvvvyu = jQuery("#jform_store").val();
|
|
|
|
var datatype_vvvvvyu = jQuery("#jform_datatype").val();
|
|
|
|
vvvvvyu(store_vvvvvyu,datatype_vvvvvyu);
|
2016-01-30 20:28:43 +00:00
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
var add_css_view_vvvvvyw = jQuery("#jform_add_css_view input[type='radio']:checked").val();
|
|
|
|
vvvvvyw(add_css_view_vvvvvyw);
|
2016-01-30 20:28:43 +00:00
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
var add_css_views_vvvvvyx = jQuery("#jform_add_css_views input[type='radio']:checked").val();
|
|
|
|
vvvvvyx(add_css_views_vvvvvyx);
|
2016-01-30 20:28:43 +00:00
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
var add_javascript_view_footer_vvvvvyy = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val();
|
|
|
|
vvvvvyy(add_javascript_view_footer_vvvvvyy);
|
2016-01-30 20:28:43 +00:00
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
var add_javascript_views_footer_vvvvvyz = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val();
|
|
|
|
vvvvvyz(add_javascript_views_footer_vvvvvyz);
|
2016-01-30 20:28:43 +00:00
|
|
|
});
|
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
// the vvvvvyr function
|
|
|
|
function vvvvvyr(datalenght_vvvvvyr)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
2016-02-26 13:57:30 +00:00
|
|
|
if (isSet(datalenght_vvvvvyr) && datalenght_vvvvvyr.constructor !== Array)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
2016-02-26 13:57:30 +00:00
|
|
|
var temp_vvvvvyr = datalenght_vvvvvyr;
|
|
|
|
var datalenght_vvvvvyr = [];
|
|
|
|
datalenght_vvvvvyr.push(temp_vvvvvyr);
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
2016-02-26 13:57:30 +00:00
|
|
|
else if (!isSet(datalenght_vvvvvyr))
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
2016-02-26 13:57:30 +00:00
|
|
|
var datalenght_vvvvvyr = [];
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
2016-02-26 13:57:30 +00:00
|
|
|
var datalenght = datalenght_vvvvvyr.some(datalenght_vvvvvyr_SomeFunc);
|
2016-01-30 20:28:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
// set this function logic
|
|
|
|
if (datalenght)
|
|
|
|
{
|
|
|
|
jQuery('#jform_datalenght_other').closest('.control-group').show();
|
2016-02-26 13:57:30 +00:00
|
|
|
if (jform_vvvvvyrvyn_required)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('datalenght_other',0);
|
|
|
|
jQuery('#jform_datalenght_other').prop('required','required');
|
|
|
|
jQuery('#jform_datalenght_other').attr('aria-required',true);
|
|
|
|
jQuery('#jform_datalenght_other').addClass('required');
|
2016-02-26 13:57:30 +00:00
|
|
|
jform_vvvvvyrvyn_required = false;
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_datalenght_other').closest('.control-group').hide();
|
2016-02-26 13:57:30 +00:00
|
|
|
if (!jform_vvvvvyrvyn_required)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('datalenght_other',1);
|
|
|
|
jQuery('#jform_datalenght_other').removeAttr('required');
|
|
|
|
jQuery('#jform_datalenght_other').removeAttr('aria-required');
|
|
|
|
jQuery('#jform_datalenght_other').removeClass('required');
|
2016-02-26 13:57:30 +00:00
|
|
|
jform_vvvvvyrvyn_required = true;
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
// the vvvvvyr Some function
|
|
|
|
function datalenght_vvvvvyr_SomeFunc(datalenght_vvvvvyr)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-26 13:57:30 +00:00
|
|
|
if (datalenght_vvvvvyr == 'Other')
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
// the vvvvvys function
|
|
|
|
function vvvvvys(datadefault_vvvvvys)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
2016-02-26 13:57:30 +00:00
|
|
|
if (isSet(datadefault_vvvvvys) && datadefault_vvvvvys.constructor !== Array)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
2016-02-26 13:57:30 +00:00
|
|
|
var temp_vvvvvys = datadefault_vvvvvys;
|
|
|
|
var datadefault_vvvvvys = [];
|
|
|
|
datadefault_vvvvvys.push(temp_vvvvvys);
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
2016-02-26 13:57:30 +00:00
|
|
|
else if (!isSet(datadefault_vvvvvys))
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
2016-02-26 13:57:30 +00:00
|
|
|
var datadefault_vvvvvys = [];
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
2016-02-26 13:57:30 +00:00
|
|
|
var datadefault = datadefault_vvvvvys.some(datadefault_vvvvvys_SomeFunc);
|
2016-01-30 20:28:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
// set this function logic
|
|
|
|
if (datadefault)
|
|
|
|
{
|
|
|
|
jQuery('#jform_datadefault_other').closest('.control-group').show();
|
2016-02-26 13:57:30 +00:00
|
|
|
if (jform_vvvvvysvyo_required)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('datadefault_other',0);
|
|
|
|
jQuery('#jform_datadefault_other').prop('required','required');
|
|
|
|
jQuery('#jform_datadefault_other').attr('aria-required',true);
|
|
|
|
jQuery('#jform_datadefault_other').addClass('required');
|
2016-02-26 13:57:30 +00:00
|
|
|
jform_vvvvvysvyo_required = false;
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_datadefault_other').closest('.control-group').hide();
|
2016-02-26 13:57:30 +00:00
|
|
|
if (!jform_vvvvvysvyo_required)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('datadefault_other',1);
|
|
|
|
jQuery('#jform_datadefault_other').removeAttr('required');
|
|
|
|
jQuery('#jform_datadefault_other').removeAttr('aria-required');
|
|
|
|
jQuery('#jform_datadefault_other').removeClass('required');
|
2016-02-26 13:57:30 +00:00
|
|
|
jform_vvvvvysvyo_required = true;
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
// the vvvvvys Some function
|
|
|
|
function datadefault_vvvvvys_SomeFunc(datadefault_vvvvvys)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-26 13:57:30 +00:00
|
|
|
if (datadefault_vvvvvys == 'Other')
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
// the vvvvvyt function
|
|
|
|
function vvvvvyt(datatype_vvvvvyt)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
2016-02-26 13:57:30 +00:00
|
|
|
if (isSet(datatype_vvvvvyt) && datatype_vvvvvyt.constructor !== Array)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
2016-02-26 13:57:30 +00:00
|
|
|
var temp_vvvvvyt = datatype_vvvvvyt;
|
|
|
|
var datatype_vvvvvyt = [];
|
|
|
|
datatype_vvvvvyt.push(temp_vvvvvyt);
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
2016-02-26 13:57:30 +00:00
|
|
|
else if (!isSet(datatype_vvvvvyt))
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
2016-02-26 13:57:30 +00:00
|
|
|
var datatype_vvvvvyt = [];
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
2016-02-26 13:57:30 +00:00
|
|
|
var datatype = datatype_vvvvvyt.some(datatype_vvvvvyt_SomeFunc);
|
2016-01-30 20:28:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
// set this function logic
|
|
|
|
if (datatype)
|
|
|
|
{
|
|
|
|
jQuery('#jform_store').closest('.control-group').show();
|
2016-02-26 13:57:30 +00:00
|
|
|
if (jform_vvvvvytvyp_required)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('store',0);
|
|
|
|
jQuery('#jform_store').prop('required','required');
|
|
|
|
jQuery('#jform_store').attr('aria-required',true);
|
|
|
|
jQuery('#jform_store').addClass('required');
|
2016-02-26 13:57:30 +00:00
|
|
|
jform_vvvvvytvyp_required = false;
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_store').closest('.control-group').hide();
|
2016-02-26 13:57:30 +00:00
|
|
|
if (!jform_vvvvvytvyp_required)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('store',1);
|
|
|
|
jQuery('#jform_store').removeAttr('required');
|
|
|
|
jQuery('#jform_store').removeAttr('aria-required');
|
|
|
|
jQuery('#jform_store').removeClass('required');
|
2016-02-26 13:57:30 +00:00
|
|
|
jform_vvvvvytvyp_required = true;
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
// the vvvvvyt Some function
|
|
|
|
function datatype_vvvvvyt_SomeFunc(datatype_vvvvvyt)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-26 13:57:30 +00:00
|
|
|
if (datatype_vvvvvyt == 'CHAR' || datatype_vvvvvyt == 'VARCHAR' || datatype_vvvvvyt == 'TEXT' || datatype_vvvvvyt == 'MEDIUMTEXT' || datatype_vvvvvyt == 'LONGTEXT')
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
// the vvvvvyu function
|
|
|
|
function vvvvvyu(store_vvvvvyu,datatype_vvvvvyu)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
2016-02-26 13:57:30 +00:00
|
|
|
if (isSet(store_vvvvvyu) && store_vvvvvyu.constructor !== Array)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
2016-02-26 13:57:30 +00:00
|
|
|
var temp_vvvvvyu = store_vvvvvyu;
|
|
|
|
var store_vvvvvyu = [];
|
|
|
|
store_vvvvvyu.push(temp_vvvvvyu);
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
2016-02-26 13:57:30 +00:00
|
|
|
else if (!isSet(store_vvvvvyu))
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
2016-02-26 13:57:30 +00:00
|
|
|
var store_vvvvvyu = [];
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
2016-02-26 13:57:30 +00:00
|
|
|
var store = store_vvvvvyu.some(store_vvvvvyu_SomeFunc);
|
2016-01-30 20:28:43 +00:00
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
if (isSet(datatype_vvvvvyu) && datatype_vvvvvyu.constructor !== Array)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
2016-02-26 13:57:30 +00:00
|
|
|
var temp_vvvvvyu = datatype_vvvvvyu;
|
|
|
|
var datatype_vvvvvyu = [];
|
|
|
|
datatype_vvvvvyu.push(temp_vvvvvyu);
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
2016-02-26 13:57:30 +00:00
|
|
|
else if (!isSet(datatype_vvvvvyu))
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
2016-02-26 13:57:30 +00:00
|
|
|
var datatype_vvvvvyu = [];
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
2016-02-26 13:57:30 +00:00
|
|
|
var datatype = datatype_vvvvvyu.some(datatype_vvvvvyu_SomeFunc);
|
2016-01-30 20:28:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
// set this function logic
|
|
|
|
if (store && datatype)
|
|
|
|
{
|
|
|
|
jQuery('.note_vdm_encryption').closest('.control-group').show();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('.note_vdm_encryption').closest('.control-group').hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
// the vvvvvyu Some function
|
|
|
|
function store_vvvvvyu_SomeFunc(store_vvvvvyu)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-26 13:57:30 +00:00
|
|
|
if (store_vvvvvyu == 4)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
// the vvvvvyu Some function
|
|
|
|
function datatype_vvvvvyu_SomeFunc(datatype_vvvvvyu)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-26 13:57:30 +00:00
|
|
|
if (datatype_vvvvvyu == 'CHAR' || datatype_vvvvvyu == 'VARCHAR' || datatype_vvvvvyu == 'TEXT' || datatype_vvvvvyu == 'MEDIUMTEXT' || datatype_vvvvvyu == 'LONGTEXT')
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
// the vvvvvyw function
|
|
|
|
function vvvvvyw(add_css_view_vvvvvyw)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-26 13:57:30 +00:00
|
|
|
if (add_css_view_vvvvvyw == 1)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
jQuery('#jform_css_view').closest('.control-group').show();
|
2016-02-26 13:57:30 +00:00
|
|
|
if (jform_vvvvvywvyq_required)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('css_view',0);
|
|
|
|
jQuery('#jform_css_view').prop('required','required');
|
|
|
|
jQuery('#jform_css_view').attr('aria-required',true);
|
|
|
|
jQuery('#jform_css_view').addClass('required');
|
2016-02-26 13:57:30 +00:00
|
|
|
jform_vvvvvywvyq_required = false;
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_css_view').closest('.control-group').hide();
|
2016-02-26 13:57:30 +00:00
|
|
|
if (!jform_vvvvvywvyq_required)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('css_view',1);
|
|
|
|
jQuery('#jform_css_view').removeAttr('required');
|
|
|
|
jQuery('#jform_css_view').removeAttr('aria-required');
|
|
|
|
jQuery('#jform_css_view').removeClass('required');
|
2016-02-26 13:57:30 +00:00
|
|
|
jform_vvvvvywvyq_required = true;
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
// the vvvvvyx function
|
|
|
|
function vvvvvyx(add_css_views_vvvvvyx)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-26 13:57:30 +00:00
|
|
|
if (add_css_views_vvvvvyx == 1)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
jQuery('#jform_css_views').closest('.control-group').show();
|
2016-02-26 13:57:30 +00:00
|
|
|
if (jform_vvvvvyxvyr_required)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('css_views',0);
|
|
|
|
jQuery('#jform_css_views').prop('required','required');
|
|
|
|
jQuery('#jform_css_views').attr('aria-required',true);
|
|
|
|
jQuery('#jform_css_views').addClass('required');
|
2016-02-26 13:57:30 +00:00
|
|
|
jform_vvvvvyxvyr_required = false;
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_css_views').closest('.control-group').hide();
|
2016-02-26 13:57:30 +00:00
|
|
|
if (!jform_vvvvvyxvyr_required)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('css_views',1);
|
|
|
|
jQuery('#jform_css_views').removeAttr('required');
|
|
|
|
jQuery('#jform_css_views').removeAttr('aria-required');
|
|
|
|
jQuery('#jform_css_views').removeClass('required');
|
2016-02-26 13:57:30 +00:00
|
|
|
jform_vvvvvyxvyr_required = true;
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
// the vvvvvyy function
|
|
|
|
function vvvvvyy(add_javascript_view_footer_vvvvvyy)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-26 13:57:30 +00:00
|
|
|
if (add_javascript_view_footer_vvvvvyy == 1)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
jQuery('#jform_javascript_view_footer').closest('.control-group').show();
|
2016-02-26 13:57:30 +00:00
|
|
|
if (jform_vvvvvyyvys_required)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('javascript_view_footer',0);
|
|
|
|
jQuery('#jform_javascript_view_footer').prop('required','required');
|
|
|
|
jQuery('#jform_javascript_view_footer').attr('aria-required',true);
|
|
|
|
jQuery('#jform_javascript_view_footer').addClass('required');
|
2016-02-26 13:57:30 +00:00
|
|
|
jform_vvvvvyyvys_required = false;
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_javascript_view_footer').closest('.control-group').hide();
|
2016-02-26 13:57:30 +00:00
|
|
|
if (!jform_vvvvvyyvys_required)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('javascript_view_footer',1);
|
|
|
|
jQuery('#jform_javascript_view_footer').removeAttr('required');
|
|
|
|
jQuery('#jform_javascript_view_footer').removeAttr('aria-required');
|
|
|
|
jQuery('#jform_javascript_view_footer').removeClass('required');
|
2016-02-26 13:57:30 +00:00
|
|
|
jform_vvvvvyyvys_required = true;
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-26 13:57:30 +00:00
|
|
|
// the vvvvvyz function
|
|
|
|
function vvvvvyz(add_javascript_views_footer_vvvvvyz)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-26 13:57:30 +00:00
|
|
|
if (add_javascript_views_footer_vvvvvyz == 1)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
jQuery('#jform_javascript_views_footer').closest('.control-group').show();
|
2016-02-26 13:57:30 +00:00
|
|
|
if (jform_vvvvvyzvyt_required)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('javascript_views_footer',0);
|
|
|
|
jQuery('#jform_javascript_views_footer').prop('required','required');
|
|
|
|
jQuery('#jform_javascript_views_footer').attr('aria-required',true);
|
|
|
|
jQuery('#jform_javascript_views_footer').addClass('required');
|
2016-02-26 13:57:30 +00:00
|
|
|
jform_vvvvvyzvyt_required = false;
|
2016-01-30 20:28:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_javascript_views_footer').closest('.control-group').hide();
|
2016-02-26 13:57:30 +00:00
|
|
|
if (!jform_vvvvvyzvyt_required)
|
2016-01-30 20:28:43 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('javascript_views_footer',1);
|
|
|
|
jQuery('#jform_javascript_views_footer').removeAttr('required');
|
|
|
|
jQuery('#jform_javascript_views_footer').removeAttr('aria-required');
|
|
|
|
jQuery('#jform_javascript_views_footer').removeClass('required');
|
2016-02-26 13:57:30 +00:00
|
|
|
jform_vvvvvyzvyt_required = true;
|
2016-01-30 20:28:43 +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;
|
|
|
|
}
|
|
|
|
|
|
|
|
function getFieldOptions_server(fieldId){
|
|
|
|
var getUrl = "index.php?option=com_componentbuilder&task=ajax.fieldOptions&format=json";
|
|
|
|
if(token.length > 0 && fieldId > 0){
|
|
|
|
var request = 'token='+token+'&id='+fieldId;
|
|
|
|
}
|
|
|
|
return jQuery.ajax({
|
|
|
|
type: 'GET',
|
|
|
|
url: getUrl,
|
|
|
|
dataType: 'jsonp',
|
|
|
|
data: request,
|
|
|
|
jsonp: 'callback'
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
function getFieldOptions(id,setValue){
|
|
|
|
getFieldOptions_server(id).done(function(result) {
|
|
|
|
if(result.values){
|
|
|
|
if(setValue){
|
|
|
|
jQuery('textarea#jform_xml').val(result.values);
|
|
|
|
}
|
|
|
|
jQuery('#help').remove();
|
|
|
|
jQuery('.helpNote').append('<div id="help" style="margin: 10px;">'+result.description+'<br />'+result.values_description+'</div>');
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|