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
|
|
|
|
@build 29th December, 2015
|
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
|
2015-12-29 19:39:38 +00:00
|
|
|
jform_hCmROoyRik_required = false;
|
|
|
|
jform_SPnilgyKTR_required = false;
|
|
|
|
jform_qYufgfpRHo_required = false;
|
|
|
|
jform_pMRKFEUXwb_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
|
|
|
|
// Initial Script
|
|
|
|
jQuery(document).ready(function()
|
|
|
|
{
|
2015-12-29 19:39:38 +00:00
|
|
|
var location_qNsMhBK = jQuery("#jform_location input[type='radio']:checked").val();
|
|
|
|
qNsMhBK(location_qNsMhBK);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2015-12-29 19:39:38 +00:00
|
|
|
var location_gFpJuTv = jQuery("#jform_location input[type='radio']:checked").val();
|
|
|
|
gFpJuTv(location_gFpJuTv);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2015-12-29 19:39:38 +00:00
|
|
|
var type_hCmROoy = jQuery("#jform_type").val();
|
|
|
|
hCmROoy(type_hCmROoy);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2015-12-29 19:39:38 +00:00
|
|
|
var type_SPnilgy = jQuery("#jform_type").val();
|
|
|
|
SPnilgy(type_SPnilgy);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2015-12-29 19:39:38 +00:00
|
|
|
var type_qYufgfp = jQuery("#jform_type").val();
|
|
|
|
qYufgfp(type_qYufgfp);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2015-12-29 19:39:38 +00:00
|
|
|
var target_pMRKFEU = jQuery("#jform_target input[type='radio']:checked").val();
|
|
|
|
pMRKFEU(target_pMRKFEU);
|
2015-08-24 20:22:07 +00:00
|
|
|
});
|
|
|
|
|
2015-12-29 19:39:38 +00:00
|
|
|
// the qNsMhBK function
|
|
|
|
function qNsMhBK(location_qNsMhBK)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2015-12-29 19:39:38 +00:00
|
|
|
if (location_qNsMhBK == 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-29 19:39:38 +00:00
|
|
|
// the gFpJuTv function
|
|
|
|
function gFpJuTv(location_gFpJuTv)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2015-12-29 19:39:38 +00:00
|
|
|
if (location_gFpJuTv == 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-29 19:39:38 +00:00
|
|
|
// the hCmROoy function
|
|
|
|
function hCmROoy(type_hCmROoy)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2015-12-29 19:39:38 +00:00
|
|
|
if (isSet(type_hCmROoy) && type_hCmROoy.constructor !== Array)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2015-12-29 19:39:38 +00:00
|
|
|
var temp_hCmROoy = type_hCmROoy;
|
|
|
|
var type_hCmROoy = [];
|
|
|
|
type_hCmROoy.push(temp_hCmROoy);
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2015-12-29 19:39:38 +00:00
|
|
|
else if (!isSet(type_hCmROoy))
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2015-12-29 19:39:38 +00:00
|
|
|
var type_hCmROoy = [];
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2015-12-29 19:39:38 +00:00
|
|
|
var type = type_hCmROoy.some(type_hCmROoy_SomeFunc);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
// set this function logic
|
|
|
|
if (type)
|
|
|
|
{
|
|
|
|
jQuery('#jform_url').closest('.control-group').show();
|
2015-12-29 19:39:38 +00:00
|
|
|
if (jform_hCmROoyRik_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-29 19:39:38 +00:00
|
|
|
jform_hCmROoyRik_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_url').closest('.control-group').hide();
|
2015-12-29 19:39:38 +00:00
|
|
|
if (!jform_hCmROoyRik_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-29 19:39:38 +00:00
|
|
|
jform_hCmROoyRik_required = true;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-29 19:39:38 +00:00
|
|
|
// the hCmROoy Some function
|
|
|
|
function type_hCmROoy_SomeFunc(type_hCmROoy)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2015-12-29 19:39:38 +00:00
|
|
|
if (type_hCmROoy == 3)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-12-29 19:39:38 +00:00
|
|
|
// the SPnilgy function
|
|
|
|
function SPnilgy(type_SPnilgy)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2015-12-29 19:39:38 +00:00
|
|
|
if (isSet(type_SPnilgy) && type_SPnilgy.constructor !== Array)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2015-12-29 19:39:38 +00:00
|
|
|
var temp_SPnilgy = type_SPnilgy;
|
|
|
|
var type_SPnilgy = [];
|
|
|
|
type_SPnilgy.push(temp_SPnilgy);
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2015-12-29 19:39:38 +00:00
|
|
|
else if (!isSet(type_SPnilgy))
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2015-12-29 19:39:38 +00:00
|
|
|
var type_SPnilgy = [];
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2015-12-29 19:39:38 +00:00
|
|
|
var type = type_SPnilgy.some(type_SPnilgy_SomeFunc);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
// set this function logic
|
|
|
|
if (type)
|
|
|
|
{
|
|
|
|
jQuery('#jform_article').closest('.control-group').show();
|
2015-12-29 19:39:38 +00:00
|
|
|
if (jform_SPnilgyKTR_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-29 19:39:38 +00:00
|
|
|
jform_SPnilgyKTR_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_article').closest('.control-group').hide();
|
2015-12-29 19:39:38 +00:00
|
|
|
if (!jform_SPnilgyKTR_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-29 19:39:38 +00:00
|
|
|
jform_SPnilgyKTR_required = true;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-29 19:39:38 +00:00
|
|
|
// the SPnilgy Some function
|
|
|
|
function type_SPnilgy_SomeFunc(type_SPnilgy)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2015-12-29 19:39:38 +00:00
|
|
|
if (type_SPnilgy == 1)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-12-29 19:39:38 +00:00
|
|
|
// the qYufgfp function
|
|
|
|
function qYufgfp(type_qYufgfp)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2015-12-29 19:39:38 +00:00
|
|
|
if (isSet(type_qYufgfp) && type_qYufgfp.constructor !== Array)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2015-12-29 19:39:38 +00:00
|
|
|
var temp_qYufgfp = type_qYufgfp;
|
|
|
|
var type_qYufgfp = [];
|
|
|
|
type_qYufgfp.push(temp_qYufgfp);
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2015-12-29 19:39:38 +00:00
|
|
|
else if (!isSet(type_qYufgfp))
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2015-12-29 19:39:38 +00:00
|
|
|
var type_qYufgfp = [];
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2015-12-29 19:39:38 +00:00
|
|
|
var type = type_qYufgfp.some(type_qYufgfp_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-29 19:39:38 +00:00
|
|
|
if (jform_qYufgfpRHo_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-29 19:39:38 +00:00
|
|
|
jform_qYufgfpRHo_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_content-lbl').closest('.control-group').hide();
|
2015-12-29 19:39:38 +00:00
|
|
|
if (!jform_qYufgfpRHo_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-29 19:39:38 +00:00
|
|
|
jform_qYufgfpRHo_required = true;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-29 19:39:38 +00:00
|
|
|
// the qYufgfp Some function
|
|
|
|
function type_qYufgfp_SomeFunc(type_qYufgfp)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2015-12-29 19:39:38 +00:00
|
|
|
if (type_qYufgfp == 2)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-12-29 19:39:38 +00:00
|
|
|
// the pMRKFEU function
|
|
|
|
function pMRKFEU(target_pMRKFEU)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2015-12-29 19:39:38 +00:00
|
|
|
if (target_pMRKFEU == 1)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
jQuery('#jform_groups').closest('.control-group').show();
|
2015-12-29 19:39:38 +00:00
|
|
|
if (jform_pMRKFEUXwb_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-29 19:39:38 +00:00
|
|
|
jform_pMRKFEUXwb_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_groups').closest('.control-group').hide();
|
2015-12-29 19:39:38 +00:00
|
|
|
if (!jform_pMRKFEUXwb_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-29 19:39:38 +00:00
|
|
|
jform_pMRKFEUXwb_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;
|
|
|
|
}
|