2015-08-24 20:22:07 +00:00
|
|
|
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
|
|
|
Vast Development Method
|
|
|
|
/-------------------------------------------------------------------------------------------------------/
|
|
|
|
|
2015-12-29 19:39:38 +00:00
|
|
|
@version 1.0.5
|
2016-02-21 00:07:38 +00:00
|
|
|
@build 21st February, 2016
|
2015-12-03 02:17:44 +00:00
|
|
|
@created 5th August, 2015
|
2015-08-24 20:22:07 +00:00
|
|
|
@package Demo
|
|
|
|
@subpackage help_document.js
|
|
|
|
@author Llewellyn van der Merwe <https://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
|
|
|
|
____ _____ _____ __ __ __ __ ___ _____ __ __ ____ _____ _ _ ____ _ _ ____
|
|
|
|
(_ _)( _ )( _ )( \/ )( ) /__\ / __)( _ )( \/ )( _ \( _ )( \( )( ___)( \( )(_ _)
|
|
|
|
.-_)( )(_)( )(_)( ) ( )(__ /(__)\ ( (__ )(_)( ) ( )___/ )(_)( ) ( )__) ) ( )(
|
|
|
|
\____) (_____)(_____)(_/\/\_)(____)(__)(__) \___)(_____)(_/\/\_)(__) (_____)(_)\_)(____)(_)\_) (__)
|
|
|
|
|
|
|
|
/------------------------------------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
// Some Global Values
|
2016-02-21 00:36:34 +00:00
|
|
|
jform_rFatqiXZFW_required = false;
|
|
|
|
jform_HAWbtQeCUi_required = false;
|
|
|
|
jform_OpisjiAVIQ_required = false;
|
|
|
|
jform_dZCesMspHY_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
|
|
|
|
// Initial Script
|
|
|
|
jQuery(document).ready(function()
|
|
|
|
{
|
2016-02-21 00:36:34 +00:00
|
|
|
var location_befnCXD = jQuery("#jform_location input[type='radio']:checked").val();
|
|
|
|
befnCXD(location_befnCXD);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2016-02-21 00:36:34 +00:00
|
|
|
var location_RcmOskk = jQuery("#jform_location input[type='radio']:checked").val();
|
|
|
|
RcmOskk(location_RcmOskk);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2016-02-21 00:36:34 +00:00
|
|
|
var type_rFatqiX = jQuery("#jform_type").val();
|
|
|
|
rFatqiX(type_rFatqiX);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2016-02-21 00:36:34 +00:00
|
|
|
var type_HAWbtQe = jQuery("#jform_type").val();
|
|
|
|
HAWbtQe(type_HAWbtQe);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2016-02-21 00:36:34 +00:00
|
|
|
var type_OpisjiA = jQuery("#jform_type").val();
|
|
|
|
OpisjiA(type_OpisjiA);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2016-02-21 00:36:34 +00:00
|
|
|
var target_dZCesMs = jQuery("#jform_target input[type='radio']:checked").val();
|
|
|
|
dZCesMs(target_dZCesMs);
|
2015-08-24 20:22:07 +00:00
|
|
|
});
|
|
|
|
|
2016-02-21 00:36:34 +00:00
|
|
|
// the befnCXD function
|
|
|
|
function befnCXD(location_befnCXD)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-21 00:36:34 +00:00
|
|
|
if (location_befnCXD == 1)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
jQuery('#jform_admin_view').closest('.control-group').show();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_admin_view').closest('.control-group').hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-21 00:36:34 +00:00
|
|
|
// the RcmOskk function
|
|
|
|
function RcmOskk(location_RcmOskk)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-21 00:36:34 +00:00
|
|
|
if (location_RcmOskk == 2)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
jQuery('#jform_site_view').closest('.control-group').show();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_site_view').closest('.control-group').hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-21 00:36:34 +00:00
|
|
|
// the rFatqiX function
|
|
|
|
function rFatqiX(type_rFatqiX)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2016-02-21 00:36:34 +00:00
|
|
|
if (isSet(type_rFatqiX) && type_rFatqiX.constructor !== Array)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2016-02-21 00:36:34 +00:00
|
|
|
var temp_rFatqiX = type_rFatqiX;
|
|
|
|
var type_rFatqiX = [];
|
|
|
|
type_rFatqiX.push(temp_rFatqiX);
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2016-02-21 00:36:34 +00:00
|
|
|
else if (!isSet(type_rFatqiX))
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2016-02-21 00:36:34 +00:00
|
|
|
var type_rFatqiX = [];
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2016-02-21 00:36:34 +00:00
|
|
|
var type = type_rFatqiX.some(type_rFatqiX_SomeFunc);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
// set this function logic
|
|
|
|
if (type)
|
|
|
|
{
|
|
|
|
jQuery('#jform_url').closest('.control-group').show();
|
2016-02-21 00:36:34 +00:00
|
|
|
if (jform_rFatqiXZFW_required)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('url',0);
|
|
|
|
jQuery('#jform_url').prop('required','required');
|
|
|
|
jQuery('#jform_url').attr('aria-required',true);
|
|
|
|
jQuery('#jform_url').addClass('required');
|
2016-02-21 00:36:34 +00:00
|
|
|
jform_rFatqiXZFW_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_url').closest('.control-group').hide();
|
2016-02-21 00:36:34 +00:00
|
|
|
if (!jform_rFatqiXZFW_required)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('url',1);
|
|
|
|
jQuery('#jform_url').removeAttr('required');
|
|
|
|
jQuery('#jform_url').removeAttr('aria-required');
|
|
|
|
jQuery('#jform_url').removeClass('required');
|
2016-02-21 00:36:34 +00:00
|
|
|
jform_rFatqiXZFW_required = true;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-21 00:36:34 +00:00
|
|
|
// the rFatqiX Some function
|
|
|
|
function type_rFatqiX_SomeFunc(type_rFatqiX)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-21 00:36:34 +00:00
|
|
|
if (type_rFatqiX == 3)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-02-21 00:36:34 +00:00
|
|
|
// the HAWbtQe function
|
|
|
|
function HAWbtQe(type_HAWbtQe)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2016-02-21 00:36:34 +00:00
|
|
|
if (isSet(type_HAWbtQe) && type_HAWbtQe.constructor !== Array)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2016-02-21 00:36:34 +00:00
|
|
|
var temp_HAWbtQe = type_HAWbtQe;
|
|
|
|
var type_HAWbtQe = [];
|
|
|
|
type_HAWbtQe.push(temp_HAWbtQe);
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2016-02-21 00:36:34 +00:00
|
|
|
else if (!isSet(type_HAWbtQe))
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2016-02-21 00:36:34 +00:00
|
|
|
var type_HAWbtQe = [];
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2016-02-21 00:36:34 +00:00
|
|
|
var type = type_HAWbtQe.some(type_HAWbtQe_SomeFunc);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
// set this function logic
|
|
|
|
if (type)
|
|
|
|
{
|
|
|
|
jQuery('#jform_article').closest('.control-group').show();
|
2016-02-21 00:36:34 +00:00
|
|
|
if (jform_HAWbtQeCUi_required)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('article',0);
|
|
|
|
jQuery('#jform_article').prop('required','required');
|
|
|
|
jQuery('#jform_article').attr('aria-required',true);
|
|
|
|
jQuery('#jform_article').addClass('required');
|
2016-02-21 00:36:34 +00:00
|
|
|
jform_HAWbtQeCUi_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_article').closest('.control-group').hide();
|
2016-02-21 00:36:34 +00:00
|
|
|
if (!jform_HAWbtQeCUi_required)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('article',1);
|
|
|
|
jQuery('#jform_article').removeAttr('required');
|
|
|
|
jQuery('#jform_article').removeAttr('aria-required');
|
|
|
|
jQuery('#jform_article').removeClass('required');
|
2016-02-21 00:36:34 +00:00
|
|
|
jform_HAWbtQeCUi_required = true;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-21 00:36:34 +00:00
|
|
|
// the HAWbtQe Some function
|
|
|
|
function type_HAWbtQe_SomeFunc(type_HAWbtQe)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-21 00:36:34 +00:00
|
|
|
if (type_HAWbtQe == 1)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-02-21 00:36:34 +00:00
|
|
|
// the OpisjiA function
|
|
|
|
function OpisjiA(type_OpisjiA)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2016-02-21 00:36:34 +00:00
|
|
|
if (isSet(type_OpisjiA) && type_OpisjiA.constructor !== Array)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2016-02-21 00:36:34 +00:00
|
|
|
var temp_OpisjiA = type_OpisjiA;
|
|
|
|
var type_OpisjiA = [];
|
|
|
|
type_OpisjiA.push(temp_OpisjiA);
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2016-02-21 00:36:34 +00:00
|
|
|
else if (!isSet(type_OpisjiA))
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2016-02-21 00:36:34 +00:00
|
|
|
var type_OpisjiA = [];
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2016-02-21 00:36:34 +00:00
|
|
|
var type = type_OpisjiA.some(type_OpisjiA_SomeFunc);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
// set this function logic
|
|
|
|
if (type)
|
|
|
|
{
|
|
|
|
jQuery('#jform_content-lbl').closest('.control-group').show();
|
2016-02-21 00:36:34 +00:00
|
|
|
if (jform_OpisjiAVIQ_required)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('content',0);
|
|
|
|
jQuery('#jform_content').prop('required','required');
|
|
|
|
jQuery('#jform_content').attr('aria-required',true);
|
|
|
|
jQuery('#jform_content').addClass('required');
|
2016-02-21 00:36:34 +00:00
|
|
|
jform_OpisjiAVIQ_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_content-lbl').closest('.control-group').hide();
|
2016-02-21 00:36:34 +00:00
|
|
|
if (!jform_OpisjiAVIQ_required)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('content',1);
|
|
|
|
jQuery('#jform_content').removeAttr('required');
|
|
|
|
jQuery('#jform_content').removeAttr('aria-required');
|
|
|
|
jQuery('#jform_content').removeClass('required');
|
2016-02-21 00:36:34 +00:00
|
|
|
jform_OpisjiAVIQ_required = true;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-21 00:36:34 +00:00
|
|
|
// the OpisjiA Some function
|
|
|
|
function type_OpisjiA_SomeFunc(type_OpisjiA)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-21 00:36:34 +00:00
|
|
|
if (type_OpisjiA == 2)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-02-21 00:36:34 +00:00
|
|
|
// the dZCesMs function
|
|
|
|
function dZCesMs(target_dZCesMs)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-21 00:36:34 +00:00
|
|
|
if (target_dZCesMs == 1)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
jQuery('#jform_groups').closest('.control-group').show();
|
2016-02-21 00:36:34 +00:00
|
|
|
if (jform_dZCesMspHY_required)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('groups',0);
|
|
|
|
jQuery('#jform_groups').prop('required','required');
|
|
|
|
jQuery('#jform_groups').attr('aria-required',true);
|
|
|
|
jQuery('#jform_groups').addClass('required');
|
2016-02-21 00:36:34 +00:00
|
|
|
jform_dZCesMspHY_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_groups').closest('.control-group').hide();
|
2016-02-21 00:36:34 +00:00
|
|
|
if (!jform_dZCesMspHY_required)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('groups',1);
|
|
|
|
jQuery('#jform_groups').removeAttr('required');
|
|
|
|
jQuery('#jform_groups').removeAttr('aria-required');
|
|
|
|
jQuery('#jform_groups').removeClass('required');
|
2016-02-21 00:36:34 +00:00
|
|
|
jform_dZCesMspHY_required = true;
|
2015-08-24 20:22:07 +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;
|
|
|
|
}
|