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-20 20:19:24 +00:00
|
|
|
@build 20th 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-20 20:19:24 +00:00
|
|
|
jform_KBdlcVRWwj_required = false;
|
|
|
|
jform_dweMHUwWAb_required = false;
|
|
|
|
jform_pnuDTOlQhG_required = false;
|
|
|
|
jform_dObkcfdSaH_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
|
|
|
|
// Initial Script
|
|
|
|
jQuery(document).ready(function()
|
|
|
|
{
|
2016-02-20 20:19:24 +00:00
|
|
|
var location_uyLnUzq = jQuery("#jform_location input[type='radio']:checked").val();
|
|
|
|
uyLnUzq(location_uyLnUzq);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2016-02-20 20:19:24 +00:00
|
|
|
var location_ywPZpnl = jQuery("#jform_location input[type='radio']:checked").val();
|
|
|
|
ywPZpnl(location_ywPZpnl);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2016-02-20 20:19:24 +00:00
|
|
|
var type_KBdlcVR = jQuery("#jform_type").val();
|
|
|
|
KBdlcVR(type_KBdlcVR);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2016-02-20 20:19:24 +00:00
|
|
|
var type_dweMHUw = jQuery("#jform_type").val();
|
|
|
|
dweMHUw(type_dweMHUw);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2016-02-20 20:19:24 +00:00
|
|
|
var type_pnuDTOl = jQuery("#jform_type").val();
|
|
|
|
pnuDTOl(type_pnuDTOl);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
2016-02-20 20:19:24 +00:00
|
|
|
var target_dObkcfd = jQuery("#jform_target input[type='radio']:checked").val();
|
|
|
|
dObkcfd(target_dObkcfd);
|
2015-08-24 20:22:07 +00:00
|
|
|
});
|
|
|
|
|
2016-02-20 20:19:24 +00:00
|
|
|
// the uyLnUzq function
|
|
|
|
function uyLnUzq(location_uyLnUzq)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-20 20:19:24 +00:00
|
|
|
if (location_uyLnUzq == 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-20 20:19:24 +00:00
|
|
|
// the ywPZpnl function
|
|
|
|
function ywPZpnl(location_ywPZpnl)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-20 20:19:24 +00:00
|
|
|
if (location_ywPZpnl == 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-20 20:19:24 +00:00
|
|
|
// the KBdlcVR function
|
|
|
|
function KBdlcVR(type_KBdlcVR)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2016-02-20 20:19:24 +00:00
|
|
|
if (isSet(type_KBdlcVR) && type_KBdlcVR.constructor !== Array)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2016-02-20 20:19:24 +00:00
|
|
|
var temp_KBdlcVR = type_KBdlcVR;
|
|
|
|
var type_KBdlcVR = [];
|
|
|
|
type_KBdlcVR.push(temp_KBdlcVR);
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2016-02-20 20:19:24 +00:00
|
|
|
else if (!isSet(type_KBdlcVR))
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2016-02-20 20:19:24 +00:00
|
|
|
var type_KBdlcVR = [];
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2016-02-20 20:19:24 +00:00
|
|
|
var type = type_KBdlcVR.some(type_KBdlcVR_SomeFunc);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
// set this function logic
|
|
|
|
if (type)
|
|
|
|
{
|
|
|
|
jQuery('#jform_url').closest('.control-group').show();
|
2016-02-20 20:19:24 +00:00
|
|
|
if (jform_KBdlcVRWwj_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-20 20:19:24 +00:00
|
|
|
jform_KBdlcVRWwj_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_url').closest('.control-group').hide();
|
2016-02-20 20:19:24 +00:00
|
|
|
if (!jform_KBdlcVRWwj_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-20 20:19:24 +00:00
|
|
|
jform_KBdlcVRWwj_required = true;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-20 20:19:24 +00:00
|
|
|
// the KBdlcVR Some function
|
|
|
|
function type_KBdlcVR_SomeFunc(type_KBdlcVR)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-20 20:19:24 +00:00
|
|
|
if (type_KBdlcVR == 3)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-02-20 20:19:24 +00:00
|
|
|
// the dweMHUw function
|
|
|
|
function dweMHUw(type_dweMHUw)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2016-02-20 20:19:24 +00:00
|
|
|
if (isSet(type_dweMHUw) && type_dweMHUw.constructor !== Array)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2016-02-20 20:19:24 +00:00
|
|
|
var temp_dweMHUw = type_dweMHUw;
|
|
|
|
var type_dweMHUw = [];
|
|
|
|
type_dweMHUw.push(temp_dweMHUw);
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2016-02-20 20:19:24 +00:00
|
|
|
else if (!isSet(type_dweMHUw))
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2016-02-20 20:19:24 +00:00
|
|
|
var type_dweMHUw = [];
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2016-02-20 20:19:24 +00:00
|
|
|
var type = type_dweMHUw.some(type_dweMHUw_SomeFunc);
|
2015-08-24 20:22:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
// set this function logic
|
|
|
|
if (type)
|
|
|
|
{
|
|
|
|
jQuery('#jform_article').closest('.control-group').show();
|
2016-02-20 20:19:24 +00:00
|
|
|
if (jform_dweMHUwWAb_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-20 20:19:24 +00:00
|
|
|
jform_dweMHUwWAb_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_article').closest('.control-group').hide();
|
2016-02-20 20:19:24 +00:00
|
|
|
if (!jform_dweMHUwWAb_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-20 20:19:24 +00:00
|
|
|
jform_dweMHUwWAb_required = true;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-20 20:19:24 +00:00
|
|
|
// the dweMHUw Some function
|
|
|
|
function type_dweMHUw_SomeFunc(type_dweMHUw)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-20 20:19:24 +00:00
|
|
|
if (type_dweMHUw == 1)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-02-20 20:19:24 +00:00
|
|
|
// the pnuDTOl function
|
|
|
|
function pnuDTOl(type_pnuDTOl)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2016-02-20 20:19:24 +00:00
|
|
|
if (isSet(type_pnuDTOl) && type_pnuDTOl.constructor !== Array)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2016-02-20 20:19:24 +00:00
|
|
|
var temp_pnuDTOl = type_pnuDTOl;
|
|
|
|
var type_pnuDTOl = [];
|
|
|
|
type_pnuDTOl.push(temp_pnuDTOl);
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2016-02-20 20:19:24 +00:00
|
|
|
else if (!isSet(type_pnuDTOl))
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
2016-02-20 20:19:24 +00:00
|
|
|
var type_pnuDTOl = [];
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
2016-02-20 20:19:24 +00:00
|
|
|
var type = type_pnuDTOl.some(type_pnuDTOl_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-20 20:19:24 +00:00
|
|
|
if (jform_pnuDTOlQhG_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-20 20:19:24 +00:00
|
|
|
jform_pnuDTOlQhG_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_content-lbl').closest('.control-group').hide();
|
2016-02-20 20:19:24 +00:00
|
|
|
if (!jform_pnuDTOlQhG_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-20 20:19:24 +00:00
|
|
|
jform_pnuDTOlQhG_required = true;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-20 20:19:24 +00:00
|
|
|
// the pnuDTOl Some function
|
|
|
|
function type_pnuDTOl_SomeFunc(type_pnuDTOl)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-20 20:19:24 +00:00
|
|
|
if (type_pnuDTOl == 2)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2016-02-20 20:19:24 +00:00
|
|
|
// the dObkcfd function
|
|
|
|
function dObkcfd(target_dObkcfd)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
// set the function logic
|
2016-02-20 20:19:24 +00:00
|
|
|
if (target_dObkcfd == 1)
|
2015-08-24 20:22:07 +00:00
|
|
|
{
|
|
|
|
jQuery('#jform_groups').closest('.control-group').show();
|
2016-02-20 20:19:24 +00:00
|
|
|
if (jform_dObkcfdSaH_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-20 20:19:24 +00:00
|
|
|
jform_dObkcfdSaH_required = false;
|
2015-08-24 20:22:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_groups').closest('.control-group').hide();
|
2016-02-20 20:19:24 +00:00
|
|
|
if (!jform_dObkcfdSaH_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-20 20:19:24 +00:00
|
|
|
jform_dObkcfdSaH_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;
|
|
|
|
}
|