2015-08-24 20:22:07 +00:00
|
|
|
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
|
|
|
Vast Development Method
|
|
|
|
/-------------------------------------------------------------------------------------------------------/
|
|
|
|
|
2015-12-03 02:17:44 +00:00
|
|
|
@version 1.0.4
|
|
|
|
@build 3rd December, 2015
|
|
|
|
@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
|
2015-12-03 02:17:44 +00:00
|
|
|
jform_XvephxzImu_required = false;
|
|
|
|
jform_yFWFBjoUSy_required = false;
|
|
|
|
jform_revjpJkdku_required = false;
|
|
|
|
jform_MhQPsZtPMB_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
|
|
|
|
// Initial Script
|
|
|
|
jQuery(document).ready(function()
|
|
|
|
{
|
2015-12-03 02:17:44 +00:00
|
|
|
var location_sLnxlWV = jQuery("#jform_location input[type='radio']:checked").val();
|
|
|
|
sLnxlWV(location_sLnxlWV);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2015-12-03 02:17:44 +00:00
|
|
|
var location_fqbSveC = jQuery("#jform_location input[type='radio']:checked").val();
|
|
|
|
fqbSveC(location_fqbSveC);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2015-12-03 02:17:44 +00:00
|
|
|
var type_Xvephxz = jQuery("#jform_type").val();
|
|
|
|
Xvephxz(type_Xvephxz);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2015-12-03 02:17:44 +00:00
|
|
|
var type_yFWFBjo = jQuery("#jform_type").val();
|
|
|
|
yFWFBjo(type_yFWFBjo);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2015-12-03 02:17:44 +00:00
|
|
|
var type_revjpJk = jQuery("#jform_type").val();
|
|
|
|
revjpJk(type_revjpJk);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2015-12-03 02:17:44 +00:00
|
|
|
var target_MhQPsZt = jQuery("#jform_target input[type='radio']:checked").val();
|
|
|
|
MhQPsZt(target_MhQPsZt);
|
2015-08-24 20:22:07 +00:00
|
|
|
});
|
|
|
|
|
2015-12-03 02:17:44 +00:00
|
|
|
// the sLnxlWV function
|
|
|
|
function sLnxlWV(location_sLnxlWV)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2015-12-03 02:17:44 +00:00
|
|
|
if (location_sLnxlWV == 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();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-03 02:17:44 +00:00
|
|
|
// the fqbSveC function
|
|
|
|
function fqbSveC(location_fqbSveC)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2015-12-03 02:17:44 +00:00
|
|
|
if (location_fqbSveC == 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();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-03 02:17:44 +00:00
|
|
|
// the Xvephxz function
|
|
|
|
function Xvephxz(type_Xvephxz)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2015-12-03 02:17:44 +00:00
|
|
|
if (isSet(type_Xvephxz) && type_Xvephxz.constructor !== Array)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2015-12-03 02:17:44 +00:00
|
|
|
var temp_Xvephxz = type_Xvephxz;
|
|
|
|
var type_Xvephxz = [];
|
|
|
|
type_Xvephxz.push(temp_Xvephxz);
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2015-12-03 02:17:44 +00:00
|
|
|
else if (!isSet(type_Xvephxz))
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2015-12-03 02:17:44 +00:00
|
|
|
var type_Xvephxz = [];
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2015-12-03 02:17:44 +00:00
|
|
|
var type = type_Xvephxz.some(type_Xvephxz_SomeFunc);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
// set this function logic
|
|
|
|
if (type)
|
|
|
|
{
|
|
|
|
jQuery('#jform_url').closest('.control-group').show();
|
2015-12-03 02:17:44 +00:00
|
|
|
if (jform_XvephxzImu_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');
|
2015-12-03 02:17:44 +00:00
|
|
|
jform_XvephxzImu_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_url').closest('.control-group').hide();
|
2015-12-03 02:17:44 +00:00
|
|
|
if (!jform_XvephxzImu_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');
|
2015-12-03 02:17:44 +00:00
|
|
|
jform_XvephxzImu_required = true;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-03 02:17:44 +00:00
|
|
|
// the Xvephxz Some function
|
|
|
|
function type_Xvephxz_SomeFunc(type_Xvephxz)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2015-12-03 02:17:44 +00:00
|
|
|
if (type_Xvephxz == 3)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-12-03 02:17:44 +00:00
|
|
|
// the yFWFBjo function
|
|
|
|
function yFWFBjo(type_yFWFBjo)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2015-12-03 02:17:44 +00:00
|
|
|
if (isSet(type_yFWFBjo) && type_yFWFBjo.constructor !== Array)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2015-12-03 02:17:44 +00:00
|
|
|
var temp_yFWFBjo = type_yFWFBjo;
|
|
|
|
var type_yFWFBjo = [];
|
|
|
|
type_yFWFBjo.push(temp_yFWFBjo);
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2015-12-03 02:17:44 +00:00
|
|
|
else if (!isSet(type_yFWFBjo))
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2015-12-03 02:17:44 +00:00
|
|
|
var type_yFWFBjo = [];
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2015-12-03 02:17:44 +00:00
|
|
|
var type = type_yFWFBjo.some(type_yFWFBjo_SomeFunc);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
// set this function logic
|
|
|
|
if (type)
|
|
|
|
{
|
|
|
|
jQuery('#jform_article').closest('.control-group').show();
|
2015-12-03 02:17:44 +00:00
|
|
|
if (jform_yFWFBjoUSy_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');
|
2015-12-03 02:17:44 +00:00
|
|
|
jform_yFWFBjoUSy_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_article').closest('.control-group').hide();
|
2015-12-03 02:17:44 +00:00
|
|
|
if (!jform_yFWFBjoUSy_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');
|
2015-12-03 02:17:44 +00:00
|
|
|
jform_yFWFBjoUSy_required = true;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-03 02:17:44 +00:00
|
|
|
// the yFWFBjo Some function
|
|
|
|
function type_yFWFBjo_SomeFunc(type_yFWFBjo)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2015-12-03 02:17:44 +00:00
|
|
|
if (type_yFWFBjo == 1)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-12-03 02:17:44 +00:00
|
|
|
// the revjpJk function
|
|
|
|
function revjpJk(type_revjpJk)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2015-12-03 02:17:44 +00:00
|
|
|
if (isSet(type_revjpJk) && type_revjpJk.constructor !== Array)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2015-12-03 02:17:44 +00:00
|
|
|
var temp_revjpJk = type_revjpJk;
|
|
|
|
var type_revjpJk = [];
|
|
|
|
type_revjpJk.push(temp_revjpJk);
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2015-12-03 02:17:44 +00:00
|
|
|
else if (!isSet(type_revjpJk))
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2015-12-03 02:17:44 +00:00
|
|
|
var type_revjpJk = [];
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2015-12-03 02:17:44 +00:00
|
|
|
var type = type_revjpJk.some(type_revjpJk_SomeFunc);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
// set this function logic
|
|
|
|
if (type)
|
|
|
|
{
|
|
|
|
jQuery('#jform_content-lbl').closest('.control-group').show();
|
2015-12-03 02:17:44 +00:00
|
|
|
if (jform_revjpJkdku_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');
|
2015-12-03 02:17:44 +00:00
|
|
|
jform_revjpJkdku_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_content-lbl').closest('.control-group').hide();
|
2015-12-03 02:17:44 +00:00
|
|
|
if (!jform_revjpJkdku_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');
|
2015-12-03 02:17:44 +00:00
|
|
|
jform_revjpJkdku_required = true;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-03 02:17:44 +00:00
|
|
|
// the revjpJk Some function
|
|
|
|
function type_revjpJk_SomeFunc(type_revjpJk)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2015-12-03 02:17:44 +00:00
|
|
|
if (type_revjpJk == 2)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-12-03 02:17:44 +00:00
|
|
|
// the MhQPsZt function
|
|
|
|
function MhQPsZt(target_MhQPsZt)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2015-12-03 02:17:44 +00:00
|
|
|
if (target_MhQPsZt == 1)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
jQuery('#jform_groups').closest('.control-group').show();
|
2015-12-03 02:17:44 +00:00
|
|
|
if (jform_MhQPsZtPMB_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');
|
2015-12-03 02:17:44 +00:00
|
|
|
jform_MhQPsZtPMB_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_groups').closest('.control-group').hide();
|
2015-12-03 02:17:44 +00:00
|
|
|
if (!jform_MhQPsZtPMB_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');
|
2015-12-03 02:17:44 +00:00
|
|
|
jform_MhQPsZtPMB_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;
|
|
|
|
}
|