2015-11-30 21:30:54 +00:00
|
|
|
/*----------------------------------------------------------------------------------| www.vdm.io |----/
|
|
|
|
Vast Development Method
|
|
|
|
/-------------------------------------------------------------------------------------------------------/
|
|
|
|
|
|
|
|
@version 1.2.9
|
|
|
|
@build 30th November, 2015
|
|
|
|
@created 22nd October, 2015
|
|
|
|
@package Sermon Distributor
|
|
|
|
@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-11-30 23:45:26 +00:00
|
|
|
jform_jfXdjKEkcj_required = false;
|
|
|
|
jform_neiBLaklKG_required = false;
|
|
|
|
jform_SWAPKmPZHb_required = false;
|
|
|
|
jform_dOgbQmLwDI_required = false;
|
2015-11-30 21:30:54 +00:00
|
|
|
|
|
|
|
// Initial Script
|
|
|
|
jQuery(document).ready(function()
|
|
|
|
{
|
2015-11-30 23:45:26 +00:00
|
|
|
var location_HJpAkRW = jQuery("#jform_location input[type='radio']:checked").val();
|
|
|
|
HJpAkRW(location_HJpAkRW);
|
2015-11-30 21:30:54 +00:00
|
|
|
|
2015-11-30 23:45:26 +00:00
|
|
|
var location_MTapnld = jQuery("#jform_location input[type='radio']:checked").val();
|
|
|
|
MTapnld(location_MTapnld);
|
2015-11-30 21:30:54 +00:00
|
|
|
|
2015-11-30 23:45:26 +00:00
|
|
|
var type_jfXdjKE = jQuery("#jform_type").val();
|
|
|
|
jfXdjKE(type_jfXdjKE);
|
2015-11-30 21:30:54 +00:00
|
|
|
|
2015-11-30 23:45:26 +00:00
|
|
|
var type_neiBLak = jQuery("#jform_type").val();
|
|
|
|
neiBLak(type_neiBLak);
|
2015-11-30 21:30:54 +00:00
|
|
|
|
2015-11-30 23:45:26 +00:00
|
|
|
var type_SWAPKmP = jQuery("#jform_type").val();
|
|
|
|
SWAPKmP(type_SWAPKmP);
|
2015-11-30 21:30:54 +00:00
|
|
|
|
2015-11-30 23:45:26 +00:00
|
|
|
var target_dOgbQmL = jQuery("#jform_target input[type='radio']:checked").val();
|
|
|
|
dOgbQmL(target_dOgbQmL);
|
2015-11-30 21:30:54 +00:00
|
|
|
});
|
|
|
|
|
2015-11-30 23:45:26 +00:00
|
|
|
// the HJpAkRW function
|
|
|
|
function HJpAkRW(location_HJpAkRW)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
2015-11-30 23:45:26 +00:00
|
|
|
// [8000] set the function logic
|
|
|
|
if (location_HJpAkRW == 1)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
|
|
|
jQuery('#jform_admin_view').closest('.control-group').show();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_admin_view').closest('.control-group').hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-30 23:45:26 +00:00
|
|
|
// the MTapnld function
|
|
|
|
function MTapnld(location_MTapnld)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
2015-11-30 23:45:26 +00:00
|
|
|
// [8000] set the function logic
|
|
|
|
if (location_MTapnld == 2)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
|
|
|
jQuery('#jform_site_view').closest('.control-group').show();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_site_view').closest('.control-group').hide();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-30 23:45:26 +00:00
|
|
|
// the jfXdjKE function
|
|
|
|
function jfXdjKE(type_jfXdjKE)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
2015-11-30 23:45:26 +00:00
|
|
|
if (isSet(type_jfXdjKE) && type_jfXdjKE.constructor !== Array)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
2015-11-30 23:45:26 +00:00
|
|
|
var temp_jfXdjKE = type_jfXdjKE;
|
|
|
|
var type_jfXdjKE = [];
|
|
|
|
type_jfXdjKE.push(temp_jfXdjKE);
|
2015-11-30 21:30:54 +00:00
|
|
|
}
|
2015-11-30 23:45:26 +00:00
|
|
|
else if (!isSet(type_jfXdjKE))
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
2015-11-30 23:45:26 +00:00
|
|
|
var type_jfXdjKE = [];
|
2015-11-30 21:30:54 +00:00
|
|
|
}
|
2015-11-30 23:45:26 +00:00
|
|
|
var type = type_jfXdjKE.some(type_jfXdjKE_SomeFunc);
|
2015-11-30 21:30:54 +00:00
|
|
|
|
|
|
|
|
2015-11-30 23:45:26 +00:00
|
|
|
// [7978] set this function logic
|
2015-11-30 21:30:54 +00:00
|
|
|
if (type)
|
|
|
|
{
|
|
|
|
jQuery('#jform_url').closest('.control-group').show();
|
2015-11-30 23:45:26 +00:00
|
|
|
if (jform_jfXdjKEkcj_required)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('url',0);
|
|
|
|
jQuery('#jform_url').prop('required','required');
|
|
|
|
jQuery('#jform_url').attr('aria-required',true);
|
|
|
|
jQuery('#jform_url').addClass('required');
|
2015-11-30 23:45:26 +00:00
|
|
|
jform_jfXdjKEkcj_required = false;
|
2015-11-30 21:30:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_url').closest('.control-group').hide();
|
2015-11-30 23:45:26 +00:00
|
|
|
if (!jform_jfXdjKEkcj_required)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('url',1);
|
|
|
|
jQuery('#jform_url').removeAttr('required');
|
|
|
|
jQuery('#jform_url').removeAttr('aria-required');
|
|
|
|
jQuery('#jform_url').removeClass('required');
|
2015-11-30 23:45:26 +00:00
|
|
|
jform_jfXdjKEkcj_required = true;
|
2015-11-30 21:30:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-30 23:45:26 +00:00
|
|
|
// the jfXdjKE Some function
|
|
|
|
function type_jfXdjKE_SomeFunc(type_jfXdjKE)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
2015-11-30 23:45:26 +00:00
|
|
|
// [7965] set the function logic
|
|
|
|
if (type_jfXdjKE == 3)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-11-30 23:45:26 +00:00
|
|
|
// the neiBLak function
|
|
|
|
function neiBLak(type_neiBLak)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
2015-11-30 23:45:26 +00:00
|
|
|
if (isSet(type_neiBLak) && type_neiBLak.constructor !== Array)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
2015-11-30 23:45:26 +00:00
|
|
|
var temp_neiBLak = type_neiBLak;
|
|
|
|
var type_neiBLak = [];
|
|
|
|
type_neiBLak.push(temp_neiBLak);
|
2015-11-30 21:30:54 +00:00
|
|
|
}
|
2015-11-30 23:45:26 +00:00
|
|
|
else if (!isSet(type_neiBLak))
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
2015-11-30 23:45:26 +00:00
|
|
|
var type_neiBLak = [];
|
2015-11-30 21:30:54 +00:00
|
|
|
}
|
2015-11-30 23:45:26 +00:00
|
|
|
var type = type_neiBLak.some(type_neiBLak_SomeFunc);
|
2015-11-30 21:30:54 +00:00
|
|
|
|
|
|
|
|
2015-11-30 23:45:26 +00:00
|
|
|
// [7978] set this function logic
|
2015-11-30 21:30:54 +00:00
|
|
|
if (type)
|
|
|
|
{
|
|
|
|
jQuery('#jform_article').closest('.control-group').show();
|
2015-11-30 23:45:26 +00:00
|
|
|
if (jform_neiBLaklKG_required)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('article',0);
|
|
|
|
jQuery('#jform_article').prop('required','required');
|
|
|
|
jQuery('#jform_article').attr('aria-required',true);
|
|
|
|
jQuery('#jform_article').addClass('required');
|
2015-11-30 23:45:26 +00:00
|
|
|
jform_neiBLaklKG_required = false;
|
2015-11-30 21:30:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_article').closest('.control-group').hide();
|
2015-11-30 23:45:26 +00:00
|
|
|
if (!jform_neiBLaklKG_required)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('article',1);
|
|
|
|
jQuery('#jform_article').removeAttr('required');
|
|
|
|
jQuery('#jform_article').removeAttr('aria-required');
|
|
|
|
jQuery('#jform_article').removeClass('required');
|
2015-11-30 23:45:26 +00:00
|
|
|
jform_neiBLaklKG_required = true;
|
2015-11-30 21:30:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-30 23:45:26 +00:00
|
|
|
// the neiBLak Some function
|
|
|
|
function type_neiBLak_SomeFunc(type_neiBLak)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
2015-11-30 23:45:26 +00:00
|
|
|
// [7965] set the function logic
|
|
|
|
if (type_neiBLak == 1)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-11-30 23:45:26 +00:00
|
|
|
// the SWAPKmP function
|
|
|
|
function SWAPKmP(type_SWAPKmP)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
2015-11-30 23:45:26 +00:00
|
|
|
if (isSet(type_SWAPKmP) && type_SWAPKmP.constructor !== Array)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
2015-11-30 23:45:26 +00:00
|
|
|
var temp_SWAPKmP = type_SWAPKmP;
|
|
|
|
var type_SWAPKmP = [];
|
|
|
|
type_SWAPKmP.push(temp_SWAPKmP);
|
2015-11-30 21:30:54 +00:00
|
|
|
}
|
2015-11-30 23:45:26 +00:00
|
|
|
else if (!isSet(type_SWAPKmP))
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
2015-11-30 23:45:26 +00:00
|
|
|
var type_SWAPKmP = [];
|
2015-11-30 21:30:54 +00:00
|
|
|
}
|
2015-11-30 23:45:26 +00:00
|
|
|
var type = type_SWAPKmP.some(type_SWAPKmP_SomeFunc);
|
2015-11-30 21:30:54 +00:00
|
|
|
|
|
|
|
|
2015-11-30 23:45:26 +00:00
|
|
|
// [7978] set this function logic
|
2015-11-30 21:30:54 +00:00
|
|
|
if (type)
|
|
|
|
{
|
|
|
|
jQuery('#jform_content-lbl').closest('.control-group').show();
|
2015-11-30 23:45:26 +00:00
|
|
|
if (jform_SWAPKmPZHb_required)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('content',0);
|
|
|
|
jQuery('#jform_content').prop('required','required');
|
|
|
|
jQuery('#jform_content').attr('aria-required',true);
|
|
|
|
jQuery('#jform_content').addClass('required');
|
2015-11-30 23:45:26 +00:00
|
|
|
jform_SWAPKmPZHb_required = false;
|
2015-11-30 21:30:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_content-lbl').closest('.control-group').hide();
|
2015-11-30 23:45:26 +00:00
|
|
|
if (!jform_SWAPKmPZHb_required)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('content',1);
|
|
|
|
jQuery('#jform_content').removeAttr('required');
|
|
|
|
jQuery('#jform_content').removeAttr('aria-required');
|
|
|
|
jQuery('#jform_content').removeClass('required');
|
2015-11-30 23:45:26 +00:00
|
|
|
jform_SWAPKmPZHb_required = true;
|
2015-11-30 21:30:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-11-30 23:45:26 +00:00
|
|
|
// the SWAPKmP Some function
|
|
|
|
function type_SWAPKmP_SomeFunc(type_SWAPKmP)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
2015-11-30 23:45:26 +00:00
|
|
|
// [7965] set the function logic
|
|
|
|
if (type_SWAPKmP == 2)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-11-30 23:45:26 +00:00
|
|
|
// the dOgbQmL function
|
|
|
|
function dOgbQmL(target_dOgbQmL)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
2015-11-30 23:45:26 +00:00
|
|
|
// [8000] set the function logic
|
|
|
|
if (target_dOgbQmL == 1)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
|
|
|
jQuery('#jform_groups').closest('.control-group').show();
|
2015-11-30 23:45:26 +00:00
|
|
|
if (jform_dOgbQmLwDI_required)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('groups',0);
|
|
|
|
jQuery('#jform_groups').prop('required','required');
|
|
|
|
jQuery('#jform_groups').attr('aria-required',true);
|
|
|
|
jQuery('#jform_groups').addClass('required');
|
2015-11-30 23:45:26 +00:00
|
|
|
jform_dOgbQmLwDI_required = false;
|
2015-11-30 21:30:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
jQuery('#jform_groups').closest('.control-group').hide();
|
2015-11-30 23:45:26 +00:00
|
|
|
if (!jform_dOgbQmLwDI_required)
|
2015-11-30 21:30:54 +00:00
|
|
|
{
|
|
|
|
updateFieldRequired('groups',1);
|
|
|
|
jQuery('#jform_groups').removeAttr('required');
|
|
|
|
jQuery('#jform_groups').removeAttr('aria-required');
|
|
|
|
jQuery('#jform_groups').removeClass('required');
|
2015-11-30 23:45:26 +00:00
|
|
|
jform_dOgbQmLwDI_required = true;
|
2015-11-30 21:30:54 +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;
|
|
|
|
}
|