Release of v5.1.0
Add [AllowDynamicProperties] in the base view class for J5. Move the _prepareDocument above the display call in the base view class. Remove all backward compatibility issues, so JCB will not need the [Backward Compatibility] plugin to run. Added new import powers for custom import of spreadsheets. Move the setDocument and _prepareDocument above the display in the site view and custom admin view. Update the trashhelper layout to work in Joomla 5. Add AllowDynamicProperties (Joomla 4+5) to view class to allow Custom Dynamic Get methods to work without issues. Fix Save failed issue in dynamicGet. #1148. Move all [TEXT, EDITOR, TEXTAREA] fields from [NOT NULL] to [NULL]. Add the DateHelper class and improve the date methods. Add simple SessionHelper class. Add first classes for the new import engine. Improve the [VDM Registry] to be Joomla Registry Compatible. Move all registries to the [VDM Registry] class. Fix Checked Out to be null and not 0. (#1194). Fix created_by, modified_by, checked_out fields in the compiler of the SQL. (#1194). Update all core date fields in table class. (#1188). Update created_by, modified_by, checked_out fields in table class. Implementation of the decentralized Super-Power CORE repository network. (#1190). Fix the noticeboard to display Llewellyn's Joomla Social feed. Started compiling JCB5 on Joomla 5 with PHP 8.2. Add init_defaults option for dynamic form selection setup (to int new items with default values dynamically). Update all JCB 5 tables to utf8mb4_unicode_ci collation if misaligned. Move all internal ID linking to GUID inside of JCB 5. Updated the admin-tab-fields in add-fields view. #1205. Remove Custom Import Tab from admin view. Improved the customcode and placeholder search features.
This commit is contained in:
@@ -16,61 +16,75 @@ jQuery(document).ready(function()
|
||||
// check and load all the customcode edit buttons
|
||||
getEditCustomCodeButtons();
|
||||
});
|
||||
// little script to set the value
|
||||
|
||||
// the isSet function
|
||||
function _isSet(value) {
|
||||
return value !== undefined && value !== null && value !== '';
|
||||
}
|
||||
|
||||
// Function to set the value
|
||||
function getCodeGlueOptions(field) {
|
||||
// get the ID
|
||||
var id = jQuery(field).attr('id');
|
||||
// Get the ID
|
||||
var id = field.id;
|
||||
var target = id.split('__');
|
||||
//set the subID
|
||||
var subID = target[0]+'__'+target[1];
|
||||
// get listfield value
|
||||
var listfield = jQuery('#'+subID+'__listfield').val();
|
||||
// get type value
|
||||
var type = jQuery('#'+subID+'__join_type').val();
|
||||
// get area value
|
||||
var area = jQuery('#'+subID+'__area').val();
|
||||
// check that values are set
|
||||
|
||||
// Set the subID
|
||||
var subID = target[0] + '__' + target[1];
|
||||
|
||||
// Get listfield value
|
||||
var listfield = document.getElementById(subID + '__listfield')?.value || '';
|
||||
// Get type value
|
||||
var type = document.getElementById(subID + '__join_type')?.value || '';
|
||||
// Get area value
|
||||
var area = document.getElementById(subID + '__area')?.value || '';
|
||||
|
||||
// Check that values are set
|
||||
if (_isSet(listfield) && _isSet(type) && _isSet(area)) {
|
||||
// get joinfields values
|
||||
var joinfields = jQuery('#'+subID+'__joinfields').val();
|
||||
// get codeGlueOptions
|
||||
getCodeGlueOptions_server(listfield, joinfields, type, area).done(function(result) {
|
||||
if(result){
|
||||
jQuery('#'+subID+'__set').val(result);
|
||||
} else {
|
||||
jQuery('#'+subID+'__set').val('');
|
||||
}
|
||||
});
|
||||
// Get joinfields values
|
||||
var joinfields = document.getElementById(subID + '__joinfields')?.value || '';
|
||||
|
||||
// Fetch CodeGlueOptions
|
||||
getCodeGlueOptions_server(listfield, joinfields, type, area)
|
||||
.then(result => {
|
||||
document.getElementById(subID + '__set').value = result || '';
|
||||
})
|
||||
.catch(() => {
|
||||
document.getElementById(subID + '__set').value = '';
|
||||
});
|
||||
} else {
|
||||
jQuery('#'+subID+'__set').val('');
|
||||
document.getElementById(subID + '__set').value = '';
|
||||
}
|
||||
}
|
||||
|
||||
function getCodeGlueOptions_server(listfield, joinfields, type, area){
|
||||
// Function to fetch data from the server
|
||||
function getCodeGlueOptions_server(listfield, joinfields, type, area) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getCodeGlueOptions&format=json");
|
||||
// make sure the joinfields are set
|
||||
|
||||
// Ensure joinfields is set
|
||||
if (!_isSet(joinfields)) {
|
||||
joinfields = 'none';
|
||||
}
|
||||
if(token.length > 0 && listfield > 0 && type > 0 && area > 0) {
|
||||
var request = token+'=1&listfield='+listfield+'&type='+type+'&area='+area+'&joinfields='+joinfields;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'jsonp',
|
||||
data: request,
|
||||
jsonp: 'callback'
|
||||
});
|
||||
}
|
||||
|
||||
// the isSet function
|
||||
function _isSet(val)
|
||||
{
|
||||
if ((val != undefined) && (val != null) && 0 !== val.length){
|
||||
return true;
|
||||
if (typeof token !== 'undefined' && token.length > 0 && listfield.length > 0 && type > 0 && area > 0) {
|
||||
var params = new URLSearchParams({
|
||||
[token]: '1',
|
||||
listfield: listfield,
|
||||
type: type,
|
||||
area: area,
|
||||
joinfields: joinfields
|
||||
});
|
||||
|
||||
return fetch(getUrl + '&' + params.toString(), {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Accept': 'application/json'
|
||||
}
|
||||
})
|
||||
.then(response => response.json())
|
||||
.catch(() => null);
|
||||
}
|
||||
return false;
|
||||
|
||||
return Promise.resolve(null);
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
@@ -109,12 +123,16 @@ function getEditCustomCodeButtons() {
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
if (insertBeforeElement) {
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
}
|
||||
|
||||
// Adding buttons to the div
|
||||
Object.entries(buttons).forEach(([name, button]) => {
|
||||
const controlsDiv = document.querySelector(".control-customcode-buttons-"+field);
|
||||
controlsDiv.innerHTML += button;
|
||||
if (controlsDiv) {
|
||||
controlsDiv.innerHTML += button;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -10,13 +10,6 @@
|
||||
|
||||
// Some Global Values
|
||||
jform_vvvvvybvwa_required = false;
|
||||
jform_vvvvvygvwb_required = false;
|
||||
jform_vvvvvygvwc_required = false;
|
||||
jform_vvvvvygvwd_required = false;
|
||||
jform_vvvvvygvwe_required = false;
|
||||
jform_vvvvvygvwf_required = false;
|
||||
jform_vvvvvygvwg_required = false;
|
||||
jform_vvvvvygvwh_required = false;
|
||||
|
||||
// Initial Script
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
@@ -110,14 +103,8 @@ document.addEventListener('DOMContentLoaded', function()
|
||||
var add_sql_vvvvvye = jQuery("#jform_add_sql input[type='radio']:checked").val();
|
||||
vvvvvye(source_vvvvvye,add_sql_vvvvvye);
|
||||
|
||||
var add_custom_import_vvvvvyg = jQuery("#jform_add_custom_import input[type='radio']:checked").val();
|
||||
vvvvvyg(add_custom_import_vvvvvyg);
|
||||
|
||||
var add_custom_import_vvvvvyh = jQuery("#jform_add_custom_import input[type='radio']:checked").val();
|
||||
vvvvvyh(add_custom_import_vvvvvyh);
|
||||
|
||||
var add_custom_button_vvvvvyi = jQuery("#jform_add_custom_button input[type='radio']:checked").val();
|
||||
vvvvvyi(add_custom_button_vvvvvyi);
|
||||
var add_custom_button_vvvvvyg = jQuery("#jform_add_custom_button input[type='radio']:checked").val();
|
||||
vvvvvyg(add_custom_button_vvvvvyg);
|
||||
});
|
||||
|
||||
// the vvvvvxb function
|
||||
@@ -547,178 +534,10 @@ function vvvvvye(source_vvvvvye,add_sql_vvvvvye)
|
||||
}
|
||||
|
||||
// the vvvvvyg function
|
||||
function vvvvvyg(add_custom_import_vvvvvyg)
|
||||
function vvvvvyg(add_custom_button_vvvvvyg)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_custom_import_vvvvvyg == 1)
|
||||
{
|
||||
jQuery('#jform_html_import_view').closest('.control-group').show();
|
||||
// add required attribute to html_import_view field
|
||||
if (jform_vvvvvygvwb_required)
|
||||
{
|
||||
updateFieldRequired('html_import_view',0);
|
||||
jQuery('#jform_html_import_view').prop('required','required');
|
||||
jQuery('#jform_html_import_view').attr('aria-required',true);
|
||||
jQuery('#jform_html_import_view').addClass('required');
|
||||
jform_vvvvvygvwb_required = false;
|
||||
}
|
||||
jQuery('.note_advanced_import').closest('.control-group').show();
|
||||
jQuery('#jform_php_import_display').closest('.control-group').show();
|
||||
// add required attribute to php_import_display field
|
||||
if (jform_vvvvvygvwc_required)
|
||||
{
|
||||
updateFieldRequired('php_import_display',0);
|
||||
jQuery('#jform_php_import_display').prop('required','required');
|
||||
jQuery('#jform_php_import_display').attr('aria-required',true);
|
||||
jQuery('#jform_php_import_display').addClass('required');
|
||||
jform_vvvvvygvwc_required = false;
|
||||
}
|
||||
jQuery('#jform_php_import_ext').closest('.control-group').show();
|
||||
// add required attribute to php_import_ext field
|
||||
if (jform_vvvvvygvwd_required)
|
||||
{
|
||||
updateFieldRequired('php_import_ext',0);
|
||||
jQuery('#jform_php_import_ext').prop('required','required');
|
||||
jQuery('#jform_php_import_ext').attr('aria-required',true);
|
||||
jQuery('#jform_php_import_ext').addClass('required');
|
||||
jform_vvvvvygvwd_required = false;
|
||||
}
|
||||
jQuery('#jform_php_import_headers').closest('.control-group').show();
|
||||
// add required attribute to php_import_headers field
|
||||
if (jform_vvvvvygvwe_required)
|
||||
{
|
||||
updateFieldRequired('php_import_headers',0);
|
||||
jQuery('#jform_php_import_headers').prop('required','required');
|
||||
jQuery('#jform_php_import_headers').attr('aria-required',true);
|
||||
jQuery('#jform_php_import_headers').addClass('required');
|
||||
jform_vvvvvygvwe_required = false;
|
||||
}
|
||||
jQuery('#jform_php_import').closest('.control-group').show();
|
||||
// add required attribute to php_import field
|
||||
if (jform_vvvvvygvwf_required)
|
||||
{
|
||||
updateFieldRequired('php_import',0);
|
||||
jQuery('#jform_php_import').prop('required','required');
|
||||
jQuery('#jform_php_import').attr('aria-required',true);
|
||||
jQuery('#jform_php_import').addClass('required');
|
||||
jform_vvvvvygvwf_required = false;
|
||||
}
|
||||
jQuery('#jform_php_import_save').closest('.control-group').show();
|
||||
// add required attribute to php_import_save field
|
||||
if (jform_vvvvvygvwg_required)
|
||||
{
|
||||
updateFieldRequired('php_import_save',0);
|
||||
jQuery('#jform_php_import_save').prop('required','required');
|
||||
jQuery('#jform_php_import_save').attr('aria-required',true);
|
||||
jQuery('#jform_php_import_save').addClass('required');
|
||||
jform_vvvvvygvwg_required = false;
|
||||
}
|
||||
jQuery('#jform_php_import_setdata').closest('.control-group').show();
|
||||
// add required attribute to php_import_setdata field
|
||||
if (jform_vvvvvygvwh_required)
|
||||
{
|
||||
updateFieldRequired('php_import_setdata',0);
|
||||
jQuery('#jform_php_import_setdata').prop('required','required');
|
||||
jQuery('#jform_php_import_setdata').attr('aria-required',true);
|
||||
jQuery('#jform_php_import_setdata').addClass('required');
|
||||
jform_vvvvvygvwh_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_html_import_view').closest('.control-group').hide();
|
||||
// remove required attribute from html_import_view field
|
||||
if (!jform_vvvvvygvwb_required)
|
||||
{
|
||||
updateFieldRequired('html_import_view',1);
|
||||
jQuery('#jform_html_import_view').removeAttr('required');
|
||||
jQuery('#jform_html_import_view').removeAttr('aria-required');
|
||||
jQuery('#jform_html_import_view').removeClass('required');
|
||||
jform_vvvvvygvwb_required = true;
|
||||
}
|
||||
jQuery('.note_advanced_import').closest('.control-group').hide();
|
||||
jQuery('#jform_php_import_display').closest('.control-group').hide();
|
||||
// remove required attribute from php_import_display field
|
||||
if (!jform_vvvvvygvwc_required)
|
||||
{
|
||||
updateFieldRequired('php_import_display',1);
|
||||
jQuery('#jform_php_import_display').removeAttr('required');
|
||||
jQuery('#jform_php_import_display').removeAttr('aria-required');
|
||||
jQuery('#jform_php_import_display').removeClass('required');
|
||||
jform_vvvvvygvwc_required = true;
|
||||
}
|
||||
jQuery('#jform_php_import_ext').closest('.control-group').hide();
|
||||
// remove required attribute from php_import_ext field
|
||||
if (!jform_vvvvvygvwd_required)
|
||||
{
|
||||
updateFieldRequired('php_import_ext',1);
|
||||
jQuery('#jform_php_import_ext').removeAttr('required');
|
||||
jQuery('#jform_php_import_ext').removeAttr('aria-required');
|
||||
jQuery('#jform_php_import_ext').removeClass('required');
|
||||
jform_vvvvvygvwd_required = true;
|
||||
}
|
||||
jQuery('#jform_php_import_headers').closest('.control-group').hide();
|
||||
// remove required attribute from php_import_headers field
|
||||
if (!jform_vvvvvygvwe_required)
|
||||
{
|
||||
updateFieldRequired('php_import_headers',1);
|
||||
jQuery('#jform_php_import_headers').removeAttr('required');
|
||||
jQuery('#jform_php_import_headers').removeAttr('aria-required');
|
||||
jQuery('#jform_php_import_headers').removeClass('required');
|
||||
jform_vvvvvygvwe_required = true;
|
||||
}
|
||||
jQuery('#jform_php_import').closest('.control-group').hide();
|
||||
// remove required attribute from php_import field
|
||||
if (!jform_vvvvvygvwf_required)
|
||||
{
|
||||
updateFieldRequired('php_import',1);
|
||||
jQuery('#jform_php_import').removeAttr('required');
|
||||
jQuery('#jform_php_import').removeAttr('aria-required');
|
||||
jQuery('#jform_php_import').removeClass('required');
|
||||
jform_vvvvvygvwf_required = true;
|
||||
}
|
||||
jQuery('#jform_php_import_save').closest('.control-group').hide();
|
||||
// remove required attribute from php_import_save field
|
||||
if (!jform_vvvvvygvwg_required)
|
||||
{
|
||||
updateFieldRequired('php_import_save',1);
|
||||
jQuery('#jform_php_import_save').removeAttr('required');
|
||||
jQuery('#jform_php_import_save').removeAttr('aria-required');
|
||||
jQuery('#jform_php_import_save').removeClass('required');
|
||||
jform_vvvvvygvwg_required = true;
|
||||
}
|
||||
jQuery('#jform_php_import_setdata').closest('.control-group').hide();
|
||||
// remove required attribute from php_import_setdata field
|
||||
if (!jform_vvvvvygvwh_required)
|
||||
{
|
||||
updateFieldRequired('php_import_setdata',1);
|
||||
jQuery('#jform_php_import_setdata').removeAttr('required');
|
||||
jQuery('#jform_php_import_setdata').removeAttr('aria-required');
|
||||
jQuery('#jform_php_import_setdata').removeClass('required');
|
||||
jform_vvvvvygvwh_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyh function
|
||||
function vvvvvyh(add_custom_import_vvvvvyh)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_custom_import_vvvvvyh == 0)
|
||||
{
|
||||
jQuery('.note_beginner_import').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_beginner_import').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyi function
|
||||
function vvvvvyi(add_custom_button_vvvvvyi)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_custom_button_vvvvvyi == 1)
|
||||
if (add_custom_button_vvvvvyg == 1)
|
||||
{
|
||||
jQuery('#jform_custom_button-lbl').closest('.control-group').show();
|
||||
jQuery('#jform_php_controller-lbl').closest('.control-group').show();
|
||||
@@ -944,8 +763,11 @@ function getDynamicScripts(id){
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
if (token.length > 0 && getCodeFrom_isValidId(id) && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
} else {
|
||||
console.error('There was a issue with the values passed to the [getCodeFrom_server] method and we could not make the Ajax call.');
|
||||
return;
|
||||
}
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
@@ -965,6 +787,17 @@ function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
function getCodeFrom_isValidId(id) {
|
||||
if (typeof id === 'number') {
|
||||
// Check if it's a positive integer
|
||||
return Number.isInteger(id) && id > 0;
|
||||
} else if (typeof id === 'string') {
|
||||
// Check if it's a string of length > 30
|
||||
return id.length > 30;
|
||||
}
|
||||
// If neither a number nor a string, return false
|
||||
return false;
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
@@ -1002,12 +835,16 @@ function getEditCustomCodeButtons() {
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
if (insertBeforeElement) {
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
}
|
||||
|
||||
// Adding buttons to the div
|
||||
Object.entries(buttons).forEach(([name, button]) => {
|
||||
const controlsDiv = document.querySelector(".control-customcode-buttons-"+field);
|
||||
controlsDiv.innerHTML += button;
|
||||
if (controlsDiv) {
|
||||
controlsDiv.innerHTML += button;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -55,12 +55,16 @@ function getEditCustomCodeButtons() {
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
if (insertBeforeElement) {
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
}
|
||||
|
||||
// Adding buttons to the div
|
||||
Object.entries(buttons).forEach(([name, button]) => {
|
||||
const controlsDiv = document.querySelector(".control-customcode-buttons-"+field);
|
||||
controlsDiv.innerHTML += button;
|
||||
if (controlsDiv) {
|
||||
controlsDiv.innerHTML += button;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -9,29 +9,29 @@
|
||||
*/
|
||||
|
||||
// Some Global Values
|
||||
jform_vvvvwamvxa_required = false;
|
||||
jform_vvvvwakvwt_required = false;
|
||||
|
||||
// Initial Script
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var extension_type_vvvvwam = jQuery("#jform_extension_type").val();
|
||||
vvvvwam(extension_type_vvvvwam);
|
||||
var extension_type_vvvvwak = jQuery("#jform_extension_type").val();
|
||||
vvvvwak(extension_type_vvvvwak);
|
||||
});
|
||||
|
||||
// the vvvvwam function
|
||||
function vvvvwam(extension_type_vvvvwam)
|
||||
// the vvvvwak function
|
||||
function vvvvwak(extension_type_vvvvwak)
|
||||
{
|
||||
if (isSet(extension_type_vvvvwam) && extension_type_vvvvwam.constructor !== Array)
|
||||
if (isSet(extension_type_vvvvwak) && extension_type_vvvvwak.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwam = extension_type_vvvvwam;
|
||||
var extension_type_vvvvwam = [];
|
||||
extension_type_vvvvwam.push(temp_vvvvwam);
|
||||
var temp_vvvvwak = extension_type_vvvvwak;
|
||||
var extension_type_vvvvwak = [];
|
||||
extension_type_vvvvwak.push(temp_vvvvwak);
|
||||
}
|
||||
else if (!isSet(extension_type_vvvvwam))
|
||||
else if (!isSet(extension_type_vvvvwak))
|
||||
{
|
||||
var extension_type_vvvvwam = [];
|
||||
var extension_type_vvvvwak = [];
|
||||
}
|
||||
var extension_type = extension_type_vvvvwam.some(extension_type_vvvvwam_SomeFunc);
|
||||
var extension_type = extension_type_vvvvwak.some(extension_type_vvvvwak_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
@@ -39,35 +39,35 @@ function vvvvwam(extension_type_vvvvwam)
|
||||
{
|
||||
jQuery('#jform_joomla_plugin_group').closest('.control-group').show();
|
||||
// add required attribute to joomla_plugin_group field
|
||||
if (jform_vvvvwamvxa_required)
|
||||
if (jform_vvvvwakvwt_required)
|
||||
{
|
||||
updateFieldRequired('joomla_plugin_group',0);
|
||||
jQuery('#jform_joomla_plugin_group').prop('required','required');
|
||||
jQuery('#jform_joomla_plugin_group').attr('aria-required',true);
|
||||
jQuery('#jform_joomla_plugin_group').addClass('required');
|
||||
jform_vvvvwamvxa_required = false;
|
||||
jform_vvvvwakvwt_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_joomla_plugin_group').closest('.control-group').hide();
|
||||
// remove required attribute from joomla_plugin_group field
|
||||
if (!jform_vvvvwamvxa_required)
|
||||
if (!jform_vvvvwakvwt_required)
|
||||
{
|
||||
updateFieldRequired('joomla_plugin_group',1);
|
||||
jQuery('#jform_joomla_plugin_group').removeAttr('required');
|
||||
jQuery('#jform_joomla_plugin_group').removeAttr('aria-required');
|
||||
jQuery('#jform_joomla_plugin_group').removeClass('required');
|
||||
jform_vvvvwamvxa_required = true;
|
||||
jform_vvvvwakvwt_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwam Some function
|
||||
function extension_type_vvvvwam_SomeFunc(extension_type_vvvvwam)
|
||||
// the vvvvwak Some function
|
||||
function extension_type_vvvvwak_SomeFunc(extension_type_vvvvwak)
|
||||
{
|
||||
// set the function logic
|
||||
if (extension_type_vvvvwam == 'plugins' || extension_type_vvvvwam == 'plugin')
|
||||
if (extension_type_vvvvwak == 'plugins' || extension_type_vvvvwak == 'plugin')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -170,12 +170,16 @@ function getEditCustomCodeButtons() {
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
if (insertBeforeElement) {
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
}
|
||||
|
||||
// Adding buttons to the div
|
||||
Object.entries(buttons).forEach(([name, button]) => {
|
||||
const controlsDiv = document.querySelector(".control-customcode-buttons-"+field);
|
||||
controlsDiv.innerHTML += button;
|
||||
if (controlsDiv) {
|
||||
controlsDiv.innerHTML += button;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -9,29 +9,29 @@
|
||||
*/
|
||||
|
||||
// Some Global Values
|
||||
jform_vvvvwalvwz_required = false;
|
||||
jform_vvvvwajvws_required = false;
|
||||
|
||||
// Initial Script
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var extension_type_vvvvwal = jQuery("#jform_extension_type").val();
|
||||
vvvvwal(extension_type_vvvvwal);
|
||||
var extension_type_vvvvwaj = jQuery("#jform_extension_type").val();
|
||||
vvvvwaj(extension_type_vvvvwaj);
|
||||
});
|
||||
|
||||
// the vvvvwal function
|
||||
function vvvvwal(extension_type_vvvvwal)
|
||||
// the vvvvwaj function
|
||||
function vvvvwaj(extension_type_vvvvwaj)
|
||||
{
|
||||
if (isSet(extension_type_vvvvwal) && extension_type_vvvvwal.constructor !== Array)
|
||||
if (isSet(extension_type_vvvvwaj) && extension_type_vvvvwaj.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwal = extension_type_vvvvwal;
|
||||
var extension_type_vvvvwal = [];
|
||||
extension_type_vvvvwal.push(temp_vvvvwal);
|
||||
var temp_vvvvwaj = extension_type_vvvvwaj;
|
||||
var extension_type_vvvvwaj = [];
|
||||
extension_type_vvvvwaj.push(temp_vvvvwaj);
|
||||
}
|
||||
else if (!isSet(extension_type_vvvvwal))
|
||||
else if (!isSet(extension_type_vvvvwaj))
|
||||
{
|
||||
var extension_type_vvvvwal = [];
|
||||
var extension_type_vvvvwaj = [];
|
||||
}
|
||||
var extension_type = extension_type_vvvvwal.some(extension_type_vvvvwal_SomeFunc);
|
||||
var extension_type = extension_type_vvvvwaj.some(extension_type_vvvvwaj_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
@@ -39,35 +39,35 @@ function vvvvwal(extension_type_vvvvwal)
|
||||
{
|
||||
jQuery('#jform_joomla_plugin_group').closest('.control-group').show();
|
||||
// add required attribute to joomla_plugin_group field
|
||||
if (jform_vvvvwalvwz_required)
|
||||
if (jform_vvvvwajvws_required)
|
||||
{
|
||||
updateFieldRequired('joomla_plugin_group',0);
|
||||
jQuery('#jform_joomla_plugin_group').prop('required','required');
|
||||
jQuery('#jform_joomla_plugin_group').attr('aria-required',true);
|
||||
jQuery('#jform_joomla_plugin_group').addClass('required');
|
||||
jform_vvvvwalvwz_required = false;
|
||||
jform_vvvvwajvws_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_joomla_plugin_group').closest('.control-group').hide();
|
||||
// remove required attribute from joomla_plugin_group field
|
||||
if (!jform_vvvvwalvwz_required)
|
||||
if (!jform_vvvvwajvws_required)
|
||||
{
|
||||
updateFieldRequired('joomla_plugin_group',1);
|
||||
jQuery('#jform_joomla_plugin_group').removeAttr('required');
|
||||
jQuery('#jform_joomla_plugin_group').removeAttr('aria-required');
|
||||
jQuery('#jform_joomla_plugin_group').removeClass('required');
|
||||
jform_vvvvwalvwz_required = true;
|
||||
jform_vvvvwajvws_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwal Some function
|
||||
function extension_type_vvvvwal_SomeFunc(extension_type_vvvvwal)
|
||||
// the vvvvwaj Some function
|
||||
function extension_type_vvvvwaj_SomeFunc(extension_type_vvvvwaj)
|
||||
{
|
||||
// set the function logic
|
||||
if (extension_type_vvvvwal == 'plugins' || extension_type_vvvvwal == 'plugin')
|
||||
if (extension_type_vvvvwaj == 'plugins' || extension_type_vvvvwaj == 'plugin')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -170,12 +170,16 @@ function getEditCustomCodeButtons() {
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
if (insertBeforeElement) {
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
}
|
||||
|
||||
// Adding buttons to the div
|
||||
Object.entries(buttons).forEach(([name, button]) => {
|
||||
const controlsDiv = document.querySelector(".control-customcode-buttons-"+field);
|
||||
controlsDiv.innerHTML += button;
|
||||
if (controlsDiv) {
|
||||
controlsDiv.innerHTML += button;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -53,12 +53,16 @@ function getEditCustomCodeButtons() {
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
if (insertBeforeElement) {
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
}
|
||||
|
||||
// Adding buttons to the div
|
||||
Object.entries(buttons).forEach(([name, button]) => {
|
||||
const controlsDiv = document.querySelector(".control-customcode-buttons-"+field);
|
||||
controlsDiv.innerHTML += button;
|
||||
if (controlsDiv) {
|
||||
controlsDiv.innerHTML += button;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -52,12 +52,16 @@ function getEditCustomCodeButtons() {
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
if (insertBeforeElement) {
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
}
|
||||
|
||||
// Adding buttons to the div
|
||||
Object.entries(buttons).forEach(([name, button]) => {
|
||||
const controlsDiv = document.querySelector(".control-customcode-buttons-"+field);
|
||||
controlsDiv.innerHTML += button;
|
||||
if (controlsDiv) {
|
||||
controlsDiv.innerHTML += button;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -11,42 +11,42 @@
|
||||
// Initial Script
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var add_php_view_vvvvvyj = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvvyj(add_php_view_vvvvvyj);
|
||||
var add_php_view_vvvvvyh = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvvyh(add_php_view_vvvvvyh);
|
||||
|
||||
var add_php_jview_display_vvvvvyk = jQuery("#jform_add_php_jview_display input[type='radio']:checked").val();
|
||||
vvvvvyk(add_php_jview_display_vvvvvyk);
|
||||
var add_php_jview_display_vvvvvyi = jQuery("#jform_add_php_jview_display input[type='radio']:checked").val();
|
||||
vvvvvyi(add_php_jview_display_vvvvvyi);
|
||||
|
||||
var add_php_jview_vvvvvyl = jQuery("#jform_add_php_jview input[type='radio']:checked").val();
|
||||
vvvvvyl(add_php_jview_vvvvvyl);
|
||||
var add_php_jview_vvvvvyj = jQuery("#jform_add_php_jview input[type='radio']:checked").val();
|
||||
vvvvvyj(add_php_jview_vvvvvyj);
|
||||
|
||||
var add_php_document_vvvvvym = jQuery("#jform_add_php_document input[type='radio']:checked").val();
|
||||
vvvvvym(add_php_document_vvvvvym);
|
||||
var add_php_document_vvvvvyk = jQuery("#jform_add_php_document input[type='radio']:checked").val();
|
||||
vvvvvyk(add_php_document_vvvvvyk);
|
||||
|
||||
var add_css_document_vvvvvyn = jQuery("#jform_add_css_document input[type='radio']:checked").val();
|
||||
vvvvvyn(add_css_document_vvvvvyn);
|
||||
var add_css_document_vvvvvyl = jQuery("#jform_add_css_document input[type='radio']:checked").val();
|
||||
vvvvvyl(add_css_document_vvvvvyl);
|
||||
|
||||
var add_javascript_file_vvvvvyo = jQuery("#jform_add_javascript_file input[type='radio']:checked").val();
|
||||
vvvvvyo(add_javascript_file_vvvvvyo);
|
||||
var add_javascript_file_vvvvvym = jQuery("#jform_add_javascript_file input[type='radio']:checked").val();
|
||||
vvvvvym(add_javascript_file_vvvvvym);
|
||||
|
||||
var add_js_document_vvvvvyp = jQuery("#jform_add_js_document input[type='radio']:checked").val();
|
||||
vvvvvyp(add_js_document_vvvvvyp);
|
||||
var add_js_document_vvvvvyn = jQuery("#jform_add_js_document input[type='radio']:checked").val();
|
||||
vvvvvyn(add_js_document_vvvvvyn);
|
||||
|
||||
var add_custom_button_vvvvvyq = jQuery("#jform_add_custom_button input[type='radio']:checked").val();
|
||||
vvvvvyq(add_custom_button_vvvvvyq);
|
||||
var add_custom_button_vvvvvyo = jQuery("#jform_add_custom_button input[type='radio']:checked").val();
|
||||
vvvvvyo(add_custom_button_vvvvvyo);
|
||||
|
||||
var add_css_vvvvvyr = jQuery("#jform_add_css input[type='radio']:checked").val();
|
||||
vvvvvyr(add_css_vvvvvyr);
|
||||
var add_css_vvvvvyp = jQuery("#jform_add_css input[type='radio']:checked").val();
|
||||
vvvvvyp(add_css_vvvvvyp);
|
||||
|
||||
var add_php_ajax_vvvvvys = jQuery("#jform_add_php_ajax input[type='radio']:checked").val();
|
||||
vvvvvys(add_php_ajax_vvvvvys);
|
||||
var add_php_ajax_vvvvvyq = jQuery("#jform_add_php_ajax input[type='radio']:checked").val();
|
||||
vvvvvyq(add_php_ajax_vvvvvyq);
|
||||
});
|
||||
|
||||
// the vvvvvyj function
|
||||
function vvvvvyj(add_php_view_vvvvvyj)
|
||||
// the vvvvvyh function
|
||||
function vvvvvyh(add_php_view_vvvvvyh)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_view_vvvvvyj == 1)
|
||||
if (add_php_view_vvvvvyh == 1)
|
||||
{
|
||||
jQuery('#jform_php_view-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -56,11 +56,11 @@ function vvvvvyj(add_php_view_vvvvvyj)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyk function
|
||||
function vvvvvyk(add_php_jview_display_vvvvvyk)
|
||||
// the vvvvvyi function
|
||||
function vvvvvyi(add_php_jview_display_vvvvvyi)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_jview_display_vvvvvyk == 1)
|
||||
if (add_php_jview_display_vvvvvyi == 1)
|
||||
{
|
||||
jQuery('#jform_php_jview_display-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -70,11 +70,11 @@ function vvvvvyk(add_php_jview_display_vvvvvyk)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyl function
|
||||
function vvvvvyl(add_php_jview_vvvvvyl)
|
||||
// the vvvvvyj function
|
||||
function vvvvvyj(add_php_jview_vvvvvyj)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_jview_vvvvvyl == 1)
|
||||
if (add_php_jview_vvvvvyj == 1)
|
||||
{
|
||||
jQuery('#jform_php_jview-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -84,11 +84,11 @@ function vvvvvyl(add_php_jview_vvvvvyl)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvym function
|
||||
function vvvvvym(add_php_document_vvvvvym)
|
||||
// the vvvvvyk function
|
||||
function vvvvvyk(add_php_document_vvvvvyk)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_document_vvvvvym == 1)
|
||||
if (add_php_document_vvvvvyk == 1)
|
||||
{
|
||||
jQuery('#jform_php_document-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -98,11 +98,11 @@ function vvvvvym(add_php_document_vvvvvym)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyn function
|
||||
function vvvvvyn(add_css_document_vvvvvyn)
|
||||
// the vvvvvyl function
|
||||
function vvvvvyl(add_css_document_vvvvvyl)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_css_document_vvvvvyn == 1)
|
||||
if (add_css_document_vvvvvyl == 1)
|
||||
{
|
||||
jQuery('#jform_css_document-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -112,11 +112,11 @@ function vvvvvyn(add_css_document_vvvvvyn)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyo function
|
||||
function vvvvvyo(add_javascript_file_vvvvvyo)
|
||||
// the vvvvvym function
|
||||
function vvvvvym(add_javascript_file_vvvvvym)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_javascript_file_vvvvvyo == 1)
|
||||
if (add_javascript_file_vvvvvym == 1)
|
||||
{
|
||||
jQuery('#jform_javascript_file-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -126,11 +126,11 @@ function vvvvvyo(add_javascript_file_vvvvvyo)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyp function
|
||||
function vvvvvyp(add_js_document_vvvvvyp)
|
||||
// the vvvvvyn function
|
||||
function vvvvvyn(add_js_document_vvvvvyn)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_js_document_vvvvvyp == 1)
|
||||
if (add_js_document_vvvvvyn == 1)
|
||||
{
|
||||
jQuery('#jform_js_document-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -140,11 +140,11 @@ function vvvvvyp(add_js_document_vvvvvyp)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyq function
|
||||
function vvvvvyq(add_custom_button_vvvvvyq)
|
||||
// the vvvvvyo function
|
||||
function vvvvvyo(add_custom_button_vvvvvyo)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_custom_button_vvvvvyq == 1)
|
||||
if (add_custom_button_vvvvvyo == 1)
|
||||
{
|
||||
jQuery('#jform_custom_button-lbl').closest('.control-group').show();
|
||||
jQuery('#jform_php_controller-lbl').closest('.control-group').show();
|
||||
@@ -158,11 +158,11 @@ function vvvvvyq(add_custom_button_vvvvvyq)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyr function
|
||||
function vvvvvyr(add_css_vvvvvyr)
|
||||
// the vvvvvyp function
|
||||
function vvvvvyp(add_css_vvvvvyp)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_css_vvvvvyr == 1)
|
||||
if (add_css_vvvvvyp == 1)
|
||||
{
|
||||
jQuery('#jform_css-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -172,11 +172,11 @@ function vvvvvyr(add_css_vvvvvyr)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvys function
|
||||
function vvvvvys(add_php_ajax_vvvvvys)
|
||||
// the vvvvvyq function
|
||||
function vvvvvyq(add_php_ajax_vvvvvyq)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_ajax_vvvvvys == 1)
|
||||
if (add_php_ajax_vvvvvyq == 1)
|
||||
{
|
||||
jQuery('#jform_ajax_input-lbl').closest('.control-group').show();
|
||||
jQuery('#jform_php_ajaxmethod-lbl').closest('.control-group').show();
|
||||
@@ -208,8 +208,11 @@ jQuery(document).ready(function()
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
if (token.length > 0 && getCodeFrom_isValidId(id) && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
} else {
|
||||
console.error('There was a issue with the values passed to the [getCodeFrom_server] method and we could not make the Ajax call.');
|
||||
return;
|
||||
}
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
@@ -229,6 +232,17 @@ function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
function getCodeFrom_isValidId(id) {
|
||||
if (typeof id === 'number') {
|
||||
// Check if it's a positive integer
|
||||
return Number.isInteger(id) && id > 0;
|
||||
} else if (typeof id === 'string') {
|
||||
// Check if it's a string of length > 30
|
||||
return id.length > 30;
|
||||
}
|
||||
// If neither a number nor a string, return false
|
||||
return false;
|
||||
}
|
||||
|
||||
function getLinked() {
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) {
|
||||
@@ -275,69 +289,99 @@ function getSnippetDetails(id){
|
||||
})
|
||||
}
|
||||
|
||||
function getDynamicValues_server(dynamicId){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json");
|
||||
if(token.length > 0 && dynamicId > 0){
|
||||
var request = token+'=1&view=custom_admin_view&id='+dynamicId;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'jsonp',
|
||||
data: request,
|
||||
jsonp: 'callback'
|
||||
});
|
||||
function getDynamicValuesServer(dynamicId) {
|
||||
var getUrl = 'index.php?option=com_componentbuilder&task=ajax.getDynamicValues&raw=true&format=json';
|
||||
if (token.length > 0 && (dynamicId > 0 || dynamicId.length > 0)) {
|
||||
var request = token + '=1&view=custom_admin_view&id=' + dynamicId;
|
||||
}
|
||||
|
||||
return fetch(getUrl + '&' + request, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
}
|
||||
})
|
||||
.then(response => response.json());
|
||||
}
|
||||
|
||||
function getDynamicValues(id){
|
||||
getDynamicValues_server(id).done(function(result) {
|
||||
if(result){
|
||||
jQuery('#dynamic_values').remove();
|
||||
jQuery('.dynamic_values').append('<div id="dynamic_values">'+result+'</div>');
|
||||
// make sure the code bocks are active
|
||||
jQuery("code").click(function() {
|
||||
jQuery(this).selText().addClass("selected");
|
||||
});
|
||||
}
|
||||
})
|
||||
function getDynamicValues(id) {
|
||||
getDynamicValuesServer(id).then(function(result) {
|
||||
if (result) {
|
||||
var dynamicValuesElement = document.getElementById('dynamic_values');
|
||||
if (dynamicValuesElement) {
|
||||
dynamicValuesElement.remove();
|
||||
}
|
||||
document.querySelector('.dynamic_values').insertAdjacentHTML('beforeend', '<div id="dynamic_values">' + result + '</div>');
|
||||
|
||||
// Event listener for code blocks
|
||||
document.querySelectorAll("code").forEach(function(codeBlock) {
|
||||
codeBlock.addEventListener("click", function() {
|
||||
codeBlock.selText(); // Call the custom selText function
|
||||
codeBlock.classList.add("selected"); // Add the "selected" class
|
||||
});
|
||||
});
|
||||
}
|
||||
}).catch(function(error) {
|
||||
console.error('Error fetching dynamic values:', error);
|
||||
});
|
||||
}
|
||||
|
||||
function getLayoutDetails_server(id){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'jsonp',
|
||||
data: request,
|
||||
jsonp: 'callback'
|
||||
});
|
||||
function getLayoutDetails_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json&raw=true&vdm=" + vastDevMod);
|
||||
var request = '';
|
||||
|
||||
// Ensure token and id are present
|
||||
if (token.length > 0 && id > 0) {
|
||||
request = token + '=1&id=' + id;
|
||||
}
|
||||
|
||||
// Return a fetch promise (fetch does not support JSONP, so I assume the server can return JSON)
|
||||
return fetch(getUrl + '&' + request, {
|
||||
method: 'GET'
|
||||
})
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
throw new Error("Network response was not ok");
|
||||
}
|
||||
return response.json(); // Assuming the server returns JSON
|
||||
});
|
||||
}
|
||||
|
||||
function getLayoutDetails(id){
|
||||
getLayoutDetails_server(id).done(function(result) {
|
||||
if(result){
|
||||
jQuery('#details').append(result);
|
||||
// make sure the code bocks are active
|
||||
jQuery("code").click(function() {
|
||||
jQuery(this).selText().addClass("selected");
|
||||
});
|
||||
}
|
||||
})
|
||||
function getLayoutDetails(id) {
|
||||
getLayoutDetails_server(id)
|
||||
.then(function(result) {
|
||||
if (result) {
|
||||
document.querySelector('#details').insertAdjacentHTML('beforeend', result);
|
||||
|
||||
// Re-enable code block text selection functionality
|
||||
document.querySelectorAll("code").forEach(function(codeBlock) {
|
||||
codeBlock.addEventListener("click", function() {
|
||||
codeBlock.selText();
|
||||
codeBlock.classList.add("selected");
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getTemplateDetails(id){
|
||||
getCodeFrom_server(id, 'type', 'type', 'templateDetails').then(function(result) {
|
||||
if(result){
|
||||
jQuery('#details').append(result);
|
||||
// make sure the code bocks are active
|
||||
jQuery("code").click(function() {
|
||||
jQuery(this).selText().addClass("selected");
|
||||
});
|
||||
}
|
||||
})
|
||||
function getTemplateDetails(id) {
|
||||
getCodeFrom_server(id, 'type', 'type', 'templateDetails').then(function(result) {
|
||||
if (result) {
|
||||
document.querySelector('#details').insertAdjacentHTML('beforeend', result);
|
||||
|
||||
// Re-enable code block text selection functionality
|
||||
document.querySelectorAll("code").forEach(function(codeBlock) {
|
||||
codeBlock.addEventListener("click", function() {
|
||||
codeBlock.selText();
|
||||
codeBlock.classList.add("selected");
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// set snippets that are on the page
|
||||
@@ -435,12 +479,16 @@ function getEditCustomCodeButtons() {
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
if (insertBeforeElement) {
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
}
|
||||
|
||||
// Adding buttons to the div
|
||||
Object.entries(buttons).forEach(([name, button]) => {
|
||||
const controlsDiv = document.querySelector(".control-customcode-buttons-"+field);
|
||||
controlsDiv.innerHTML += button;
|
||||
if (controlsDiv) {
|
||||
controlsDiv.innerHTML += button;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -9,44 +9,44 @@
|
||||
*/
|
||||
|
||||
// Some Global Values
|
||||
jform_vvvvwahvwv_required = false;
|
||||
jform_vvvvwaivww_required = false;
|
||||
jform_vvvvwaivwx_required = false;
|
||||
jform_vvvvwaivwy_required = false;
|
||||
jform_vvvvwafvwo_required = false;
|
||||
jform_vvvvwagvwp_required = false;
|
||||
jform_vvvvwagvwq_required = false;
|
||||
jform_vvvvwagvwr_required = false;
|
||||
|
||||
// Initial Script
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var target_vvvvwaf = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwaf(target_vvvvwaf);
|
||||
|
||||
var target_vvvvwag = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwag(target_vvvvwag);
|
||||
|
||||
var target_vvvvwah = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwah(target_vvvvwah);
|
||||
var type_vvvvwah = jQuery("#jform_type input[type='radio']:checked").val();
|
||||
vvvvwah(target_vvvvwah,type_vvvvwah);
|
||||
|
||||
var type_vvvvwai = jQuery("#jform_type input[type='radio']:checked").val();
|
||||
var target_vvvvwai = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwai(target_vvvvwai);
|
||||
|
||||
var target_vvvvwaj = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
var type_vvvvwaj = jQuery("#jform_type input[type='radio']:checked").val();
|
||||
vvvvwaj(target_vvvvwaj,type_vvvvwaj);
|
||||
|
||||
var type_vvvvwak = jQuery("#jform_type input[type='radio']:checked").val();
|
||||
var target_vvvvwak = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwak(type_vvvvwak,target_vvvvwak);
|
||||
vvvvwai(type_vvvvwai,target_vvvvwai);
|
||||
});
|
||||
|
||||
// the vvvvwah function
|
||||
function vvvvwah(target_vvvvwah)
|
||||
// the vvvvwaf function
|
||||
function vvvvwaf(target_vvvvwaf)
|
||||
{
|
||||
// set the function logic
|
||||
if (target_vvvvwah == 2)
|
||||
if (target_vvvvwaf == 2)
|
||||
{
|
||||
jQuery('#jform_function_name').closest('.control-group').show();
|
||||
// add required attribute to function_name field
|
||||
if (jform_vvvvwahvwv_required)
|
||||
if (jform_vvvvwafvwo_required)
|
||||
{
|
||||
updateFieldRequired('function_name',0);
|
||||
jQuery('#jform_function_name').prop('required','required');
|
||||
jQuery('#jform_function_name').attr('aria-required',true);
|
||||
jQuery('#jform_function_name').addClass('required');
|
||||
jform_vvvvwahvwv_required = false;
|
||||
jform_vvvvwafvwo_required = false;
|
||||
}
|
||||
jQuery('.note_jcb_placeholder').closest('.control-group').show();
|
||||
jQuery('#jform_system_name').closest('.control-group').show();
|
||||
@@ -55,102 +55,102 @@ function vvvvwah(target_vvvvwah)
|
||||
{
|
||||
jQuery('#jform_function_name').closest('.control-group').hide();
|
||||
// remove required attribute from function_name field
|
||||
if (!jform_vvvvwahvwv_required)
|
||||
if (!jform_vvvvwafvwo_required)
|
||||
{
|
||||
updateFieldRequired('function_name',1);
|
||||
jQuery('#jform_function_name').removeAttr('required');
|
||||
jQuery('#jform_function_name').removeAttr('aria-required');
|
||||
jQuery('#jform_function_name').removeClass('required');
|
||||
jform_vvvvwahvwv_required = true;
|
||||
jform_vvvvwafvwo_required = true;
|
||||
}
|
||||
jQuery('.note_jcb_placeholder').closest('.control-group').hide();
|
||||
jQuery('#jform_system_name').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwai function
|
||||
function vvvvwai(target_vvvvwai)
|
||||
// the vvvvwag function
|
||||
function vvvvwag(target_vvvvwag)
|
||||
{
|
||||
// set the function logic
|
||||
if (target_vvvvwai == 1)
|
||||
if (target_vvvvwag == 1)
|
||||
{
|
||||
jQuery('#jform_component').closest('.control-group').show();
|
||||
// add required attribute to component field
|
||||
if (jform_vvvvwaivww_required)
|
||||
if (jform_vvvvwagvwp_required)
|
||||
{
|
||||
updateFieldRequired('component',0);
|
||||
jQuery('#jform_component').prop('required','required');
|
||||
jQuery('#jform_component').attr('aria-required',true);
|
||||
jQuery('#jform_component').addClass('required');
|
||||
jform_vvvvwaivww_required = false;
|
||||
jform_vvvvwagvwp_required = false;
|
||||
}
|
||||
jQuery('#jform_path').closest('.control-group').show();
|
||||
// add required attribute to path field
|
||||
if (jform_vvvvwaivwx_required)
|
||||
if (jform_vvvvwagvwq_required)
|
||||
{
|
||||
updateFieldRequired('path',0);
|
||||
jQuery('#jform_path').prop('required','required');
|
||||
jQuery('#jform_path').attr('aria-required',true);
|
||||
jQuery('#jform_path').addClass('required');
|
||||
jform_vvvvwaivwx_required = false;
|
||||
jform_vvvvwagvwq_required = false;
|
||||
}
|
||||
jQuery('#jform_from_line').closest('.control-group').show();
|
||||
jQuery('#jform_hashtarget').closest('.control-group').show();
|
||||
jQuery('#jform_to_line').closest('.control-group').show();
|
||||
jQuery('#jform_type').closest('.control-group').show();
|
||||
// add required attribute to type field
|
||||
if (jform_vvvvwaivwy_required)
|
||||
if (jform_vvvvwagvwr_required)
|
||||
{
|
||||
updateFieldRequired('type',0);
|
||||
jQuery('#jform_type').prop('required','required');
|
||||
jQuery('#jform_type').attr('aria-required',true);
|
||||
jQuery('#jform_type').addClass('required');
|
||||
jform_vvvvwaivwy_required = false;
|
||||
jform_vvvvwagvwr_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_component').closest('.control-group').hide();
|
||||
// remove required attribute from component field
|
||||
if (!jform_vvvvwaivww_required)
|
||||
if (!jform_vvvvwagvwp_required)
|
||||
{
|
||||
updateFieldRequired('component',1);
|
||||
jQuery('#jform_component').removeAttr('required');
|
||||
jQuery('#jform_component').removeAttr('aria-required');
|
||||
jQuery('#jform_component').removeClass('required');
|
||||
jform_vvvvwaivww_required = true;
|
||||
jform_vvvvwagvwp_required = true;
|
||||
}
|
||||
jQuery('#jform_path').closest('.control-group').hide();
|
||||
// remove required attribute from path field
|
||||
if (!jform_vvvvwaivwx_required)
|
||||
if (!jform_vvvvwagvwq_required)
|
||||
{
|
||||
updateFieldRequired('path',1);
|
||||
jQuery('#jform_path').removeAttr('required');
|
||||
jQuery('#jform_path').removeAttr('aria-required');
|
||||
jQuery('#jform_path').removeClass('required');
|
||||
jform_vvvvwaivwx_required = true;
|
||||
jform_vvvvwagvwq_required = true;
|
||||
}
|
||||
jQuery('#jform_from_line').closest('.control-group').hide();
|
||||
jQuery('#jform_hashtarget').closest('.control-group').hide();
|
||||
jQuery('#jform_to_line').closest('.control-group').hide();
|
||||
jQuery('#jform_type').closest('.control-group').hide();
|
||||
// remove required attribute from type field
|
||||
if (!jform_vvvvwaivwy_required)
|
||||
if (!jform_vvvvwagvwr_required)
|
||||
{
|
||||
updateFieldRequired('type',1);
|
||||
jQuery('#jform_type').removeAttr('required');
|
||||
jQuery('#jform_type').removeAttr('aria-required');
|
||||
jQuery('#jform_type').removeClass('required');
|
||||
jform_vvvvwaivwy_required = true;
|
||||
jform_vvvvwagvwr_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwaj function
|
||||
function vvvvwaj(target_vvvvwaj,type_vvvvwaj)
|
||||
// the vvvvwah function
|
||||
function vvvvwah(target_vvvvwah,type_vvvvwah)
|
||||
{
|
||||
// set the function logic
|
||||
if (target_vvvvwaj == 1 && type_vvvvwaj == 1)
|
||||
if (target_vvvvwah == 1 && type_vvvvwah == 1)
|
||||
{
|
||||
jQuery('#jform_hashendtarget').closest('.control-group').show();
|
||||
jQuery('#jform_to_line').closest('.control-group').show();
|
||||
@@ -162,11 +162,11 @@ function vvvvwaj(target_vvvvwaj,type_vvvvwaj)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwak function
|
||||
function vvvvwak(type_vvvvwak,target_vvvvwak)
|
||||
// the vvvvwai function
|
||||
function vvvvwai(type_vvvvwai,target_vvvvwai)
|
||||
{
|
||||
// set the function logic
|
||||
if (type_vvvvwak == 1 && target_vvvvwak == 1)
|
||||
if (type_vvvvwai == 1 && target_vvvvwai == 1)
|
||||
{
|
||||
jQuery('#jform_hashendtarget').closest('.control-group').show();
|
||||
jQuery('#jform_to_line').closest('.control-group').show();
|
||||
@@ -321,56 +321,165 @@ function checkFunctionName_server(functioName, ide){
|
||||
}
|
||||
|
||||
|
||||
// check where this Function is used
|
||||
/**
|
||||
* Checks where a given function is used by iterating through a list of numeric targets (0–29).
|
||||
* For each target, it calls usedin_server() concurrently and updates the UI based on the responses.
|
||||
*
|
||||
* @param {string} functioName - The functioName parameter to send to the server.
|
||||
* @param {string|number} ide - The identifier to send.
|
||||
*/
|
||||
function usedin(functioName, ide) {
|
||||
var found = false;
|
||||
jQuery('#before-usedin').hide();
|
||||
jQuery('#note-usedin-not').hide();
|
||||
jQuery('#note-usedin-found').hide();
|
||||
jQuery('#loading-usedin').show();
|
||||
var targets = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v']; // if you update this, also update (below 21) & [customcode-codeUsedInHtmlNote]!
|
||||
var targetNumber = 21;
|
||||
var run = 0;
|
||||
var usedinChecker = setInterval(function(){
|
||||
var target = targets[run];
|
||||
usedin_server(functioName, ide, target).done(function(used) {
|
||||
if (used.in) {
|
||||
jQuery('#usedin-'+used.id).show();
|
||||
jQuery('#area-'+used.id).html(used.in);
|
||||
jQuery.UIkit.notify({message: used.in, timeout: 5000, status: 'success', pos: 'top-right'});
|
||||
found = true;
|
||||
} else {
|
||||
jQuery('#usedin-'+target).hide();
|
||||
}
|
||||
if (run == targetNumber) {
|
||||
jQuery('#loading-usedin').hide();
|
||||
if (found) {
|
||||
jQuery('#note-usedin-found').show();
|
||||
} else {
|
||||
jQuery('#note-usedin-not').show();
|
||||
}
|
||||
}
|
||||
});
|
||||
if (run == targetNumber) {
|
||||
clearInterval(usedinChecker);
|
||||
let found = false;
|
||||
|
||||
// Helper functions to show/hide elements by ID.
|
||||
const hideElement = (id) => {
|
||||
const el = document.getElementById(id);
|
||||
if (el) {
|
||||
el.style.display = 'none';
|
||||
}
|
||||
};
|
||||
|
||||
const showElement = (id) => {
|
||||
const el = document.getElementById(id);
|
||||
if (el) {
|
||||
el.style.display = 'block';
|
||||
}
|
||||
};
|
||||
|
||||
// Hide initial UI elements.
|
||||
hideElement('before-usedin');
|
||||
hideElement('note-usedin-not');
|
||||
hideElement('note-usedin-found');
|
||||
showElement('loading-usedin');
|
||||
|
||||
// Create a targets array of 30 integers (0 to 29).
|
||||
const targets = Array.from({ length: 30 }, (_, i) => i);
|
||||
|
||||
// Map each target to a promise that makes an AJAX call.
|
||||
const promises = targets.map((target) => {
|
||||
return usedin_server(functioName, ide, target)
|
||||
.then((used) => {
|
||||
if (used && used.in) {
|
||||
// Check if the element with id "usedin-{used.id}" exists.
|
||||
let funcElement = document.getElementById('usedin-' + used.id);
|
||||
if (!funcElement) {
|
||||
// Create the main container div.
|
||||
funcElement = document.createElement('div');
|
||||
funcElement.id = 'usedin-' + used.id;
|
||||
|
||||
// Create the header element with the area name.
|
||||
const header = document.createElement('h2');
|
||||
header.textContent = used.area_name;
|
||||
|
||||
// Create the inner div element that will contain the result.
|
||||
const innerDiv = document.createElement('div');
|
||||
innerDiv.id = 'area-' + used.id;
|
||||
|
||||
// Append the header and inner div to the main element.
|
||||
funcElement.appendChild(header);
|
||||
funcElement.appendChild(innerDiv);
|
||||
|
||||
// Append this element to the container with id "usedin-targets".
|
||||
const container = document.getElementById('usedin-targets');
|
||||
if (container) {
|
||||
container.appendChild(funcElement);
|
||||
} else {
|
||||
console.error(
|
||||
"Container with id 'usedin-targets' not found. Appending to document.body instead."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure the element is visible.
|
||||
showElement('usedin-' + used.id);
|
||||
|
||||
// Update the inner div's content with the response.
|
||||
const areaEl = document.getElementById('area-' + used.id);
|
||||
if (areaEl) {
|
||||
areaEl.innerHTML = used.in;
|
||||
}
|
||||
|
||||
// Notify the user using UIkit.notification if available, otherwise log to the console.
|
||||
if (typeof UIkit !== 'undefined' && UIkit.notify) {
|
||||
UIkit.notify({
|
||||
message: used.in,
|
||||
timeout: 5000,
|
||||
status: 'success',
|
||||
pos: 'top-right'
|
||||
});
|
||||
} else {
|
||||
console.log('Notification:', used.in);
|
||||
}
|
||||
found = true;
|
||||
} else {
|
||||
// If no valid response, hide the element with id "usedin-{target}".
|
||||
hideElement('usedin-' + target);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error in usedin_server for target ' + target + ':', error);
|
||||
});
|
||||
});
|
||||
|
||||
// Once all Ajax calls are completed, update the UI accordingly.
|
||||
Promise.all(promises).then(() => {
|
||||
hideElement('loading-usedin');
|
||||
if (found) {
|
||||
showElement('note-usedin-found');
|
||||
} else {
|
||||
showElement('note-usedin-not');
|
||||
}
|
||||
run++;
|
||||
}, 800);
|
||||
}
|
||||
function usedin_server(functioName, ide, target){
|
||||
var getUrl = "index.php?option=com_componentbuilder&task=ajax.usedin&format=json";
|
||||
if(token.length > 0){
|
||||
var request = token+'=1&functioName='+functioName+'&id='+ide+'&target='+target+'&raw=true&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an AJAX GET request to the server with the specified parameters.
|
||||
* The function builds a URL with query parameters and returns a promise
|
||||
* that resolves with the JSON response.
|
||||
*
|
||||
* @param {string} functioName - The functioName to send with the request.
|
||||
* @param {string|number} ide - The identifier to send.
|
||||
* @param {string|number} target - The target functioName to send.
|
||||
*
|
||||
* @returns {Promise<Object>} - A promise that resolves to the JSON response.
|
||||
*/
|
||||
function usedin_server(functioName, ide, target) {
|
||||
// Check if the global variable 'token' exists and has a non-empty functioName.
|
||||
// 'token', 'functioName', and 'return_here' are assumed to be defined elsewhere in your code.
|
||||
if (token && token.length > 0) {
|
||||
var request =
|
||||
token +
|
||||
'=1&functioName=' +
|
||||
functioName +
|
||||
'&id=' +
|
||||
ide +
|
||||
'&target=' +
|
||||
target +
|
||||
'&raw=true&return_here=' +
|
||||
return_here;
|
||||
} else {
|
||||
console.error(
|
||||
'There was a issue with the functioNames passed to the [usedin_server] method and we could not make the Ajax call.'
|
||||
);
|
||||
return Promise.reject(new Error('Invalid token or parameters.'));
|
||||
}
|
||||
|
||||
// Base URL for the AJAX request.
|
||||
const baseUrl = `index.php?option=com_componentbuilder&task=ajax.usedin&format=json&${request}`;
|
||||
|
||||
// Use the Fetch API to perform a GET request.
|
||||
return fetch(baseUrl, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Accept": "application/json"
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! Status: ${response.status}`);
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
@@ -408,12 +517,16 @@ function getEditCustomCodeButtons() {
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
if (insertBeforeElement) {
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
}
|
||||
|
||||
// Adding buttons to the div
|
||||
Object.entries(buttons).forEach(([name, button]) => {
|
||||
const controlsDiv = document.querySelector(".control-customcode-buttons-"+field);
|
||||
controlsDiv.innerHTML += button;
|
||||
if (controlsDiv) {
|
||||
controlsDiv.innerHTML += button;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -9,58 +9,58 @@
|
||||
*/
|
||||
|
||||
// Some Global Values
|
||||
jform_vvvvwbfvxe_required = false;
|
||||
jform_vvvvwbgvxf_required = false;
|
||||
jform_vvvvwbhvxg_required = false;
|
||||
jform_vvvvwbivxh_required = false;
|
||||
jform_vvvvwblvxi_required = false;
|
||||
jform_vvvvwblvxj_required = false;
|
||||
jform_vvvvwbdvwx_required = false;
|
||||
jform_vvvvwbevwy_required = false;
|
||||
jform_vvvvwbfvwz_required = false;
|
||||
jform_vvvvwbgvxa_required = false;
|
||||
jform_vvvvwbjvxb_required = false;
|
||||
jform_vvvvwbjvxc_required = false;
|
||||
|
||||
// Initial Script
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var datalenght_vvvvwbf = jQuery("#jform_datalenght").val();
|
||||
vvvvwbf(datalenght_vvvvwbf);
|
||||
var datalenght_vvvvwbd = jQuery("#jform_datalenght").val();
|
||||
vvvvwbd(datalenght_vvvvwbd);
|
||||
|
||||
var datadefault_vvvvwbg = jQuery("#jform_datadefault").val();
|
||||
vvvvwbg(datadefault_vvvvwbg);
|
||||
var datadefault_vvvvwbe = jQuery("#jform_datadefault").val();
|
||||
vvvvwbe(datadefault_vvvvwbe);
|
||||
|
||||
var datatype_vvvvwbh = jQuery("#jform_datatype").val();
|
||||
vvvvwbh(datatype_vvvvwbh);
|
||||
var datatype_vvvvwbf = jQuery("#jform_datatype").val();
|
||||
vvvvwbf(datatype_vvvvwbf);
|
||||
|
||||
var datatype_vvvvwbi = jQuery("#jform_datatype").val();
|
||||
vvvvwbi(datatype_vvvvwbi);
|
||||
var datatype_vvvvwbg = jQuery("#jform_datatype").val();
|
||||
vvvvwbg(datatype_vvvvwbg);
|
||||
|
||||
var store_vvvvwbl = jQuery("#jform_store").val();
|
||||
vvvvwbl(store_vvvvwbl);
|
||||
var store_vvvvwbj = jQuery("#jform_store").val();
|
||||
vvvvwbj(store_vvvvwbj);
|
||||
|
||||
var add_css_view_vvvvwbm = jQuery("#jform_add_css_view input[type='radio']:checked").val();
|
||||
vvvvwbm(add_css_view_vvvvwbm);
|
||||
var add_css_view_vvvvwbk = jQuery("#jform_add_css_view input[type='radio']:checked").val();
|
||||
vvvvwbk(add_css_view_vvvvwbk);
|
||||
|
||||
var add_css_views_vvvvwbn = jQuery("#jform_add_css_views input[type='radio']:checked").val();
|
||||
vvvvwbn(add_css_views_vvvvwbn);
|
||||
var add_css_views_vvvvwbl = jQuery("#jform_add_css_views input[type='radio']:checked").val();
|
||||
vvvvwbl(add_css_views_vvvvwbl);
|
||||
|
||||
var add_javascript_view_footer_vvvvwbo = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val();
|
||||
vvvvwbo(add_javascript_view_footer_vvvvwbo);
|
||||
var add_javascript_view_footer_vvvvwbm = jQuery("#jform_add_javascript_view_footer input[type='radio']:checked").val();
|
||||
vvvvwbm(add_javascript_view_footer_vvvvwbm);
|
||||
|
||||
var add_javascript_views_footer_vvvvwbp = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val();
|
||||
vvvvwbp(add_javascript_views_footer_vvvvwbp);
|
||||
var add_javascript_views_footer_vvvvwbn = jQuery("#jform_add_javascript_views_footer input[type='radio']:checked").val();
|
||||
vvvvwbn(add_javascript_views_footer_vvvvwbn);
|
||||
});
|
||||
|
||||
// the vvvvwbf function
|
||||
function vvvvwbf(datalenght_vvvvwbf)
|
||||
// the vvvvwbd function
|
||||
function vvvvwbd(datalenght_vvvvwbd)
|
||||
{
|
||||
if (isSet(datalenght_vvvvwbf) && datalenght_vvvvwbf.constructor !== Array)
|
||||
if (isSet(datalenght_vvvvwbd) && datalenght_vvvvwbd.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwbf = datalenght_vvvvwbf;
|
||||
var datalenght_vvvvwbf = [];
|
||||
datalenght_vvvvwbf.push(temp_vvvvwbf);
|
||||
var temp_vvvvwbd = datalenght_vvvvwbd;
|
||||
var datalenght_vvvvwbd = [];
|
||||
datalenght_vvvvwbd.push(temp_vvvvwbd);
|
||||
}
|
||||
else if (!isSet(datalenght_vvvvwbf))
|
||||
else if (!isSet(datalenght_vvvvwbd))
|
||||
{
|
||||
var datalenght_vvvvwbf = [];
|
||||
var datalenght_vvvvwbd = [];
|
||||
}
|
||||
var datalenght = datalenght_vvvvwbf.some(datalenght_vvvvwbf_SomeFunc);
|
||||
var datalenght = datalenght_vvvvwbd.some(datalenght_vvvvwbd_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
@@ -68,55 +68,55 @@ function vvvvwbf(datalenght_vvvvwbf)
|
||||
{
|
||||
jQuery('#jform_datalenght_other').closest('.control-group').show();
|
||||
// add required attribute to datalenght_other field
|
||||
if (jform_vvvvwbfvxe_required)
|
||||
if (jform_vvvvwbdvwx_required)
|
||||
{
|
||||
updateFieldRequired('datalenght_other',0);
|
||||
jQuery('#jform_datalenght_other').prop('required','required');
|
||||
jQuery('#jform_datalenght_other').attr('aria-required',true);
|
||||
jQuery('#jform_datalenght_other').addClass('required');
|
||||
jform_vvvvwbfvxe_required = false;
|
||||
jform_vvvvwbdvwx_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_datalenght_other').closest('.control-group').hide();
|
||||
// remove required attribute from datalenght_other field
|
||||
if (!jform_vvvvwbfvxe_required)
|
||||
if (!jform_vvvvwbdvwx_required)
|
||||
{
|
||||
updateFieldRequired('datalenght_other',1);
|
||||
jQuery('#jform_datalenght_other').removeAttr('required');
|
||||
jQuery('#jform_datalenght_other').removeAttr('aria-required');
|
||||
jQuery('#jform_datalenght_other').removeClass('required');
|
||||
jform_vvvvwbfvxe_required = true;
|
||||
jform_vvvvwbdvwx_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwbf Some function
|
||||
function datalenght_vvvvwbf_SomeFunc(datalenght_vvvvwbf)
|
||||
// the vvvvwbd Some function
|
||||
function datalenght_vvvvwbd_SomeFunc(datalenght_vvvvwbd)
|
||||
{
|
||||
// set the function logic
|
||||
if (datalenght_vvvvwbf == 'Other')
|
||||
if (datalenght_vvvvwbd == 'Other')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwbg function
|
||||
function vvvvwbg(datadefault_vvvvwbg)
|
||||
// the vvvvwbe function
|
||||
function vvvvwbe(datadefault_vvvvwbe)
|
||||
{
|
||||
if (isSet(datadefault_vvvvwbg) && datadefault_vvvvwbg.constructor !== Array)
|
||||
if (isSet(datadefault_vvvvwbe) && datadefault_vvvvwbe.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwbg = datadefault_vvvvwbg;
|
||||
var datadefault_vvvvwbg = [];
|
||||
datadefault_vvvvwbg.push(temp_vvvvwbg);
|
||||
var temp_vvvvwbe = datadefault_vvvvwbe;
|
||||
var datadefault_vvvvwbe = [];
|
||||
datadefault_vvvvwbe.push(temp_vvvvwbe);
|
||||
}
|
||||
else if (!isSet(datadefault_vvvvwbg))
|
||||
else if (!isSet(datadefault_vvvvwbe))
|
||||
{
|
||||
var datadefault_vvvvwbg = [];
|
||||
var datadefault_vvvvwbe = [];
|
||||
}
|
||||
var datadefault = datadefault_vvvvwbg.some(datadefault_vvvvwbg_SomeFunc);
|
||||
var datadefault = datadefault_vvvvwbe.some(datadefault_vvvvwbe_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
@@ -124,55 +124,55 @@ function vvvvwbg(datadefault_vvvvwbg)
|
||||
{
|
||||
jQuery('#jform_datadefault_other').closest('.control-group').show();
|
||||
// add required attribute to datadefault_other field
|
||||
if (jform_vvvvwbgvxf_required)
|
||||
if (jform_vvvvwbevwy_required)
|
||||
{
|
||||
updateFieldRequired('datadefault_other',0);
|
||||
jQuery('#jform_datadefault_other').prop('required','required');
|
||||
jQuery('#jform_datadefault_other').attr('aria-required',true);
|
||||
jQuery('#jform_datadefault_other').addClass('required');
|
||||
jform_vvvvwbgvxf_required = false;
|
||||
jform_vvvvwbevwy_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_datadefault_other').closest('.control-group').hide();
|
||||
// remove required attribute from datadefault_other field
|
||||
if (!jform_vvvvwbgvxf_required)
|
||||
if (!jform_vvvvwbevwy_required)
|
||||
{
|
||||
updateFieldRequired('datadefault_other',1);
|
||||
jQuery('#jform_datadefault_other').removeAttr('required');
|
||||
jQuery('#jform_datadefault_other').removeAttr('aria-required');
|
||||
jQuery('#jform_datadefault_other').removeClass('required');
|
||||
jform_vvvvwbgvxf_required = true;
|
||||
jform_vvvvwbevwy_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwbg Some function
|
||||
function datadefault_vvvvwbg_SomeFunc(datadefault_vvvvwbg)
|
||||
// the vvvvwbe Some function
|
||||
function datadefault_vvvvwbe_SomeFunc(datadefault_vvvvwbe)
|
||||
{
|
||||
// set the function logic
|
||||
if (datadefault_vvvvwbg == 'Other')
|
||||
if (datadefault_vvvvwbe == 'Other')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwbh function
|
||||
function vvvvwbh(datatype_vvvvwbh)
|
||||
// the vvvvwbf function
|
||||
function vvvvwbf(datatype_vvvvwbf)
|
||||
{
|
||||
if (isSet(datatype_vvvvwbh) && datatype_vvvvwbh.constructor !== Array)
|
||||
if (isSet(datatype_vvvvwbf) && datatype_vvvvwbf.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwbh = datatype_vvvvwbh;
|
||||
var datatype_vvvvwbh = [];
|
||||
datatype_vvvvwbh.push(temp_vvvvwbh);
|
||||
var temp_vvvvwbf = datatype_vvvvwbf;
|
||||
var datatype_vvvvwbf = [];
|
||||
datatype_vvvvwbf.push(temp_vvvvwbf);
|
||||
}
|
||||
else if (!isSet(datatype_vvvvwbh))
|
||||
else if (!isSet(datatype_vvvvwbf))
|
||||
{
|
||||
var datatype_vvvvwbh = [];
|
||||
var datatype_vvvvwbf = [];
|
||||
}
|
||||
var datatype = datatype_vvvvwbh.some(datatype_vvvvwbh_SomeFunc);
|
||||
var datatype = datatype_vvvvwbf.some(datatype_vvvvwbf_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
@@ -181,13 +181,13 @@ function vvvvwbh(datatype_vvvvwbh)
|
||||
jQuery('#jform_datadefault').closest('.control-group').show();
|
||||
jQuery('#jform_indexes').closest('.control-group').show();
|
||||
// add required attribute to indexes field
|
||||
if (jform_vvvvwbhvxg_required)
|
||||
if (jform_vvvvwbfvwz_required)
|
||||
{
|
||||
updateFieldRequired('indexes',0);
|
||||
jQuery('#jform_indexes').prop('required','required');
|
||||
jQuery('#jform_indexes').attr('aria-required',true);
|
||||
jQuery('#jform_indexes').addClass('required');
|
||||
jform_vvvvwbhvxg_required = false;
|
||||
jform_vvvvwbfvwz_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -195,42 +195,42 @@ function vvvvwbh(datatype_vvvvwbh)
|
||||
jQuery('#jform_datadefault').closest('.control-group').hide();
|
||||
jQuery('#jform_indexes').closest('.control-group').hide();
|
||||
// remove required attribute from indexes field
|
||||
if (!jform_vvvvwbhvxg_required)
|
||||
if (!jform_vvvvwbfvwz_required)
|
||||
{
|
||||
updateFieldRequired('indexes',1);
|
||||
jQuery('#jform_indexes').removeAttr('required');
|
||||
jQuery('#jform_indexes').removeAttr('aria-required');
|
||||
jQuery('#jform_indexes').removeClass('required');
|
||||
jform_vvvvwbhvxg_required = true;
|
||||
jform_vvvvwbfvwz_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwbh Some function
|
||||
function datatype_vvvvwbh_SomeFunc(datatype_vvvvwbh)
|
||||
// the vvvvwbf Some function
|
||||
function datatype_vvvvwbf_SomeFunc(datatype_vvvvwbf)
|
||||
{
|
||||
// set the function logic
|
||||
if (datatype_vvvvwbh == 'CHAR' || datatype_vvvvwbh == 'VARCHAR' || datatype_vvvvwbh == 'DATETIME' || datatype_vvvvwbh == 'DATE' || datatype_vvvvwbh == 'TIME' || datatype_vvvvwbh == 'INT' || datatype_vvvvwbh == 'TINYINT' || datatype_vvvvwbh == 'BIGINT' || datatype_vvvvwbh == 'FLOAT' || datatype_vvvvwbh == 'DECIMAL' || datatype_vvvvwbh == 'DOUBLE')
|
||||
if (datatype_vvvvwbf == 'CHAR' || datatype_vvvvwbf == 'VARCHAR' || datatype_vvvvwbf == 'DATETIME' || datatype_vvvvwbf == 'DATE' || datatype_vvvvwbf == 'TIME' || datatype_vvvvwbf == 'INT' || datatype_vvvvwbf == 'TINYINT' || datatype_vvvvwbf == 'BIGINT' || datatype_vvvvwbf == 'FLOAT' || datatype_vvvvwbf == 'DECIMAL' || datatype_vvvvwbf == 'DOUBLE')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwbi function
|
||||
function vvvvwbi(datatype_vvvvwbi)
|
||||
// the vvvvwbg function
|
||||
function vvvvwbg(datatype_vvvvwbg)
|
||||
{
|
||||
if (isSet(datatype_vvvvwbi) && datatype_vvvvwbi.constructor !== Array)
|
||||
if (isSet(datatype_vvvvwbg) && datatype_vvvvwbg.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwbi = datatype_vvvvwbi;
|
||||
var datatype_vvvvwbi = [];
|
||||
datatype_vvvvwbi.push(temp_vvvvwbi);
|
||||
var temp_vvvvwbg = datatype_vvvvwbg;
|
||||
var datatype_vvvvwbg = [];
|
||||
datatype_vvvvwbg.push(temp_vvvvwbg);
|
||||
}
|
||||
else if (!isSet(datatype_vvvvwbi))
|
||||
else if (!isSet(datatype_vvvvwbg))
|
||||
{
|
||||
var datatype_vvvvwbi = [];
|
||||
var datatype_vvvvwbg = [];
|
||||
}
|
||||
var datatype = datatype_vvvvwbi.some(datatype_vvvvwbi_SomeFunc);
|
||||
var datatype = datatype_vvvvwbg.some(datatype_vvvvwbg_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
@@ -238,55 +238,55 @@ function vvvvwbi(datatype_vvvvwbi)
|
||||
{
|
||||
jQuery('#jform_datalenght').closest('.control-group').show();
|
||||
// add required attribute to datalenght field
|
||||
if (jform_vvvvwbivxh_required)
|
||||
if (jform_vvvvwbgvxa_required)
|
||||
{
|
||||
updateFieldRequired('datalenght',0);
|
||||
jQuery('#jform_datalenght').prop('required','required');
|
||||
jQuery('#jform_datalenght').attr('aria-required',true);
|
||||
jQuery('#jform_datalenght').addClass('required');
|
||||
jform_vvvvwbivxh_required = false;
|
||||
jform_vvvvwbgvxa_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_datalenght').closest('.control-group').hide();
|
||||
// remove required attribute from datalenght field
|
||||
if (!jform_vvvvwbivxh_required)
|
||||
if (!jform_vvvvwbgvxa_required)
|
||||
{
|
||||
updateFieldRequired('datalenght',1);
|
||||
jQuery('#jform_datalenght').removeAttr('required');
|
||||
jQuery('#jform_datalenght').removeAttr('aria-required');
|
||||
jQuery('#jform_datalenght').removeClass('required');
|
||||
jform_vvvvwbivxh_required = true;
|
||||
jform_vvvvwbgvxa_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwbi Some function
|
||||
function datatype_vvvvwbi_SomeFunc(datatype_vvvvwbi)
|
||||
// the vvvvwbg Some function
|
||||
function datatype_vvvvwbg_SomeFunc(datatype_vvvvwbg)
|
||||
{
|
||||
// set the function logic
|
||||
if (datatype_vvvvwbi == 'CHAR' || datatype_vvvvwbi == 'VARCHAR' || datatype_vvvvwbi == 'INT' || datatype_vvvvwbi == 'TINYINT' || datatype_vvvvwbi == 'BIGINT' || datatype_vvvvwbi == 'FLOAT' || datatype_vvvvwbi == 'DECIMAL' || datatype_vvvvwbi == 'DOUBLE')
|
||||
if (datatype_vvvvwbg == 'CHAR' || datatype_vvvvwbg == 'VARCHAR' || datatype_vvvvwbg == 'INT' || datatype_vvvvwbg == 'TINYINT' || datatype_vvvvwbg == 'BIGINT' || datatype_vvvvwbg == 'FLOAT' || datatype_vvvvwbg == 'DECIMAL' || datatype_vvvvwbg == 'DOUBLE')
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwbl function
|
||||
function vvvvwbl(store_vvvvwbl)
|
||||
// the vvvvwbj function
|
||||
function vvvvwbj(store_vvvvwbj)
|
||||
{
|
||||
if (isSet(store_vvvvwbl) && store_vvvvwbl.constructor !== Array)
|
||||
if (isSet(store_vvvvwbj) && store_vvvvwbj.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwbl = store_vvvvwbl;
|
||||
var store_vvvvwbl = [];
|
||||
store_vvvvwbl.push(temp_vvvvwbl);
|
||||
var temp_vvvvwbj = store_vvvvwbj;
|
||||
var store_vvvvwbj = [];
|
||||
store_vvvvwbj.push(temp_vvvvwbj);
|
||||
}
|
||||
else if (!isSet(store_vvvvwbl))
|
||||
else if (!isSet(store_vvvvwbj))
|
||||
{
|
||||
var store_vvvvwbl = [];
|
||||
var store_vvvvwbj = [];
|
||||
}
|
||||
var store = store_vvvvwbl.some(store_vvvvwbl_SomeFunc);
|
||||
var store = store_vvvvwbj.some(store_vvvvwbj_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
@@ -297,23 +297,23 @@ function vvvvwbl(store_vvvvwbl)
|
||||
jQuery('.note_expert_field_save_mode').closest('.control-group').show();
|
||||
jQuery('#jform_on_get_model_field').closest('.control-group').show();
|
||||
// add required attribute to on_get_model_field field
|
||||
if (jform_vvvvwblvxi_required)
|
||||
if (jform_vvvvwbjvxb_required)
|
||||
{
|
||||
updateFieldRequired('on_get_model_field',0);
|
||||
jQuery('#jform_on_get_model_field').prop('required','required');
|
||||
jQuery('#jform_on_get_model_field').attr('aria-required',true);
|
||||
jQuery('#jform_on_get_model_field').addClass('required');
|
||||
jform_vvvvwblvxi_required = false;
|
||||
jform_vvvvwbjvxb_required = false;
|
||||
}
|
||||
jQuery('#jform_on_save_model_field').closest('.control-group').show();
|
||||
// add required attribute to on_save_model_field field
|
||||
if (jform_vvvvwblvxj_required)
|
||||
if (jform_vvvvwbjvxc_required)
|
||||
{
|
||||
updateFieldRequired('on_save_model_field',0);
|
||||
jQuery('#jform_on_save_model_field').prop('required','required');
|
||||
jQuery('#jform_on_save_model_field').attr('aria-required',true);
|
||||
jQuery('#jform_on_save_model_field').addClass('required');
|
||||
jform_vvvvwblvxj_required = false;
|
||||
jform_vvvvwbjvxc_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -323,43 +323,43 @@ function vvvvwbl(store_vvvvwbl)
|
||||
jQuery('.note_expert_field_save_mode').closest('.control-group').hide();
|
||||
jQuery('#jform_on_get_model_field').closest('.control-group').hide();
|
||||
// remove required attribute from on_get_model_field field
|
||||
if (!jform_vvvvwblvxi_required)
|
||||
if (!jform_vvvvwbjvxb_required)
|
||||
{
|
||||
updateFieldRequired('on_get_model_field',1);
|
||||
jQuery('#jform_on_get_model_field').removeAttr('required');
|
||||
jQuery('#jform_on_get_model_field').removeAttr('aria-required');
|
||||
jQuery('#jform_on_get_model_field').removeClass('required');
|
||||
jform_vvvvwblvxi_required = true;
|
||||
jform_vvvvwbjvxb_required = true;
|
||||
}
|
||||
jQuery('#jform_on_save_model_field').closest('.control-group').hide();
|
||||
// remove required attribute from on_save_model_field field
|
||||
if (!jform_vvvvwblvxj_required)
|
||||
if (!jform_vvvvwbjvxc_required)
|
||||
{
|
||||
updateFieldRequired('on_save_model_field',1);
|
||||
jQuery('#jform_on_save_model_field').removeAttr('required');
|
||||
jQuery('#jform_on_save_model_field').removeAttr('aria-required');
|
||||
jQuery('#jform_on_save_model_field').removeClass('required');
|
||||
jform_vvvvwblvxj_required = true;
|
||||
jform_vvvvwbjvxc_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwbl Some function
|
||||
function store_vvvvwbl_SomeFunc(store_vvvvwbl)
|
||||
// the vvvvwbj Some function
|
||||
function store_vvvvwbj_SomeFunc(store_vvvvwbj)
|
||||
{
|
||||
// set the function logic
|
||||
if (store_vvvvwbl == 6)
|
||||
if (store_vvvvwbj == 6)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwbm function
|
||||
function vvvvwbm(add_css_view_vvvvwbm)
|
||||
// the vvvvwbk function
|
||||
function vvvvwbk(add_css_view_vvvvwbk)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_css_view_vvvvwbm == 1)
|
||||
if (add_css_view_vvvvwbk == 1)
|
||||
{
|
||||
jQuery('#jform_css_view-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -369,11 +369,11 @@ function vvvvwbm(add_css_view_vvvvwbm)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwbn function
|
||||
function vvvvwbn(add_css_views_vvvvwbn)
|
||||
// the vvvvwbl function
|
||||
function vvvvwbl(add_css_views_vvvvwbl)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_css_views_vvvvwbn == 1)
|
||||
if (add_css_views_vvvvwbl == 1)
|
||||
{
|
||||
jQuery('#jform_css_views-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -383,11 +383,11 @@ function vvvvwbn(add_css_views_vvvvwbn)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwbo function
|
||||
function vvvvwbo(add_javascript_view_footer_vvvvwbo)
|
||||
// the vvvvwbm function
|
||||
function vvvvwbm(add_javascript_view_footer_vvvvwbm)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_javascript_view_footer_vvvvwbo == 1)
|
||||
if (add_javascript_view_footer_vvvvwbm == 1)
|
||||
{
|
||||
jQuery('#jform_javascript_view_footer-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -397,11 +397,11 @@ function vvvvwbo(add_javascript_view_footer_vvvvwbo)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwbp function
|
||||
function vvvvwbp(add_javascript_views_footer_vvvvwbp)
|
||||
// the vvvvwbn function
|
||||
function vvvvwbn(add_javascript_views_footer_vvvvwbn)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_javascript_views_footer_vvvvwbp == 1)
|
||||
if (add_javascript_views_footer_vvvvwbn == 1)
|
||||
{
|
||||
jQuery('#jform_javascript_views_footer-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -760,8 +760,11 @@ function dbChecker(type){
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
if (token.length > 0 && getCodeFrom_isValidId(id) && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
} else {
|
||||
console.error('There was a issue with the values passed to the [getCodeFrom_server] method and we could not make the Ajax call.');
|
||||
return;
|
||||
}
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
@@ -781,6 +784,17 @@ function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
function getCodeFrom_isValidId(id) {
|
||||
if (typeof id === 'number') {
|
||||
// Check if it's a positive integer
|
||||
return Number.isInteger(id) && id > 0;
|
||||
} else if (typeof id === 'string') {
|
||||
// Check if it's a string of length > 30
|
||||
return id.length > 30;
|
||||
}
|
||||
// If neither a number nor a string, return false
|
||||
return false;
|
||||
}
|
||||
|
||||
function getLinked() {
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) {
|
||||
@@ -855,12 +869,16 @@ function getEditCustomCodeButtons() {
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
if (insertBeforeElement) {
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
}
|
||||
|
||||
// Adding buttons to the div
|
||||
Object.entries(buttons).forEach(([name, button]) => {
|
||||
const controlsDiv = document.querySelector(".control-customcode-buttons-"+field);
|
||||
controlsDiv.innerHTML += button;
|
||||
if (controlsDiv) {
|
||||
controlsDiv.innerHTML += button;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -9,98 +9,210 @@
|
||||
*/
|
||||
|
||||
// Some Global Values
|
||||
jform_vvvvwcovyc_required = false;
|
||||
jform_vvvvwcpvyd_required = false;
|
||||
jform_vvvvwcqvye_required = false;
|
||||
jform_vvvvwcrvyf_required = false;
|
||||
jform_vvvvwctvyg_required = false;
|
||||
jform_vvvvwcmvxv_required = false;
|
||||
jform_vvvvwcnvxw_required = false;
|
||||
jform_vvvvwcovxx_required = false;
|
||||
jform_vvvvwcpvxy_required = false;
|
||||
jform_vvvvwcrvxz_required = false;
|
||||
|
||||
// Initial Script
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var location_vvvvwco = jQuery("#jform_location input[type='radio']:checked").val();
|
||||
vvvvwco(location_vvvvwco);
|
||||
var location_vvvvwcm = jQuery("#jform_location input[type='radio']:checked").val();
|
||||
vvvvwcm(location_vvvvwcm);
|
||||
|
||||
var location_vvvvwcp = jQuery("#jform_location input[type='radio']:checked").val();
|
||||
vvvvwcp(location_vvvvwcp);
|
||||
var location_vvvvwcn = jQuery("#jform_location input[type='radio']:checked").val();
|
||||
vvvvwcn(location_vvvvwcn);
|
||||
|
||||
var type_vvvvwco = jQuery("#jform_type").val();
|
||||
vvvvwco(type_vvvvwco);
|
||||
|
||||
var type_vvvvwcp = jQuery("#jform_type").val();
|
||||
vvvvwcp(type_vvvvwcp);
|
||||
|
||||
var type_vvvvwcq = jQuery("#jform_type").val();
|
||||
vvvvwcq(type_vvvvwcq);
|
||||
|
||||
var type_vvvvwcr = jQuery("#jform_type").val();
|
||||
vvvvwcr(type_vvvvwcr);
|
||||
|
||||
var type_vvvvwcs = jQuery("#jform_type").val();
|
||||
vvvvwcs(type_vvvvwcs);
|
||||
|
||||
var target_vvvvwct = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwct(target_vvvvwct);
|
||||
var target_vvvvwcr = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwcr(target_vvvvwcr);
|
||||
});
|
||||
|
||||
// the vvvvwco function
|
||||
function vvvvwco(location_vvvvwco)
|
||||
// the vvvvwcm function
|
||||
function vvvvwcm(location_vvvvwcm)
|
||||
{
|
||||
// set the function logic
|
||||
if (location_vvvvwco == 1)
|
||||
if (location_vvvvwcm == 1)
|
||||
{
|
||||
jQuery('#jform_admin_view').closest('.control-group').show();
|
||||
// add required attribute to admin_view field
|
||||
if (jform_vvvvwcovyc_required)
|
||||
if (jform_vvvvwcmvxv_required)
|
||||
{
|
||||
updateFieldRequired('admin_view',0);
|
||||
jQuery('#jform_admin_view').prop('required','required');
|
||||
jQuery('#jform_admin_view').attr('aria-required',true);
|
||||
jQuery('#jform_admin_view').addClass('required');
|
||||
jform_vvvvwcovyc_required = false;
|
||||
jform_vvvvwcmvxv_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_admin_view').closest('.control-group').hide();
|
||||
// remove required attribute from admin_view field
|
||||
if (!jform_vvvvwcovyc_required)
|
||||
if (!jform_vvvvwcmvxv_required)
|
||||
{
|
||||
updateFieldRequired('admin_view',1);
|
||||
jQuery('#jform_admin_view').removeAttr('required');
|
||||
jQuery('#jform_admin_view').removeAttr('aria-required');
|
||||
jQuery('#jform_admin_view').removeClass('required');
|
||||
jform_vvvvwcovyc_required = true;
|
||||
jform_vvvvwcmvxv_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwcp function
|
||||
function vvvvwcp(location_vvvvwcp)
|
||||
// the vvvvwcn function
|
||||
function vvvvwcn(location_vvvvwcn)
|
||||
{
|
||||
// set the function logic
|
||||
if (location_vvvvwcp == 2)
|
||||
if (location_vvvvwcn == 2)
|
||||
{
|
||||
jQuery('#jform_site_view').closest('.control-group').show();
|
||||
// add required attribute to site_view field
|
||||
if (jform_vvvvwcpvyd_required)
|
||||
if (jform_vvvvwcnvxw_required)
|
||||
{
|
||||
updateFieldRequired('site_view',0);
|
||||
jQuery('#jform_site_view').prop('required','required');
|
||||
jQuery('#jform_site_view').attr('aria-required',true);
|
||||
jQuery('#jform_site_view').addClass('required');
|
||||
jform_vvvvwcpvyd_required = false;
|
||||
jform_vvvvwcnvxw_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_site_view').closest('.control-group').hide();
|
||||
// remove required attribute from site_view field
|
||||
if (!jform_vvvvwcpvyd_required)
|
||||
if (!jform_vvvvwcnvxw_required)
|
||||
{
|
||||
updateFieldRequired('site_view',1);
|
||||
jQuery('#jform_site_view').removeAttr('required');
|
||||
jQuery('#jform_site_view').removeAttr('aria-required');
|
||||
jQuery('#jform_site_view').removeClass('required');
|
||||
jform_vvvvwcpvyd_required = true;
|
||||
jform_vvvvwcnvxw_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwco function
|
||||
function vvvvwco(type_vvvvwco)
|
||||
{
|
||||
if (isSet(type_vvvvwco) && type_vvvvwco.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwco = type_vvvvwco;
|
||||
var type_vvvvwco = [];
|
||||
type_vvvvwco.push(temp_vvvvwco);
|
||||
}
|
||||
else if (!isSet(type_vvvvwco))
|
||||
{
|
||||
var type_vvvvwco = [];
|
||||
}
|
||||
var type = type_vvvvwco.some(type_vvvvwco_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (type)
|
||||
{
|
||||
jQuery('#jform_url').closest('.control-group').show();
|
||||
// add required attribute to url field
|
||||
if (jform_vvvvwcovxx_required)
|
||||
{
|
||||
updateFieldRequired('url',0);
|
||||
jQuery('#jform_url').prop('required','required');
|
||||
jQuery('#jform_url').attr('aria-required',true);
|
||||
jQuery('#jform_url').addClass('required');
|
||||
jform_vvvvwcovxx_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_url').closest('.control-group').hide();
|
||||
// remove required attribute from url field
|
||||
if (!jform_vvvvwcovxx_required)
|
||||
{
|
||||
updateFieldRequired('url',1);
|
||||
jQuery('#jform_url').removeAttr('required');
|
||||
jQuery('#jform_url').removeAttr('aria-required');
|
||||
jQuery('#jform_url').removeClass('required');
|
||||
jform_vvvvwcovxx_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwco Some function
|
||||
function type_vvvvwco_SomeFunc(type_vvvvwco)
|
||||
{
|
||||
// set the function logic
|
||||
if (type_vvvvwco == 3)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwcp function
|
||||
function vvvvwcp(type_vvvvwcp)
|
||||
{
|
||||
if (isSet(type_vvvvwcp) && type_vvvvwcp.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwcp = type_vvvvwcp;
|
||||
var type_vvvvwcp = [];
|
||||
type_vvvvwcp.push(temp_vvvvwcp);
|
||||
}
|
||||
else if (!isSet(type_vvvvwcp))
|
||||
{
|
||||
var type_vvvvwcp = [];
|
||||
}
|
||||
var type = type_vvvvwcp.some(type_vvvvwcp_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (type)
|
||||
{
|
||||
jQuery('#jform_article').closest('.control-group').show();
|
||||
// add required attribute to article field
|
||||
if (jform_vvvvwcpvxy_required)
|
||||
{
|
||||
updateFieldRequired('article',0);
|
||||
jQuery('#jform_article').prop('required','required');
|
||||
jQuery('#jform_article').attr('aria-required',true);
|
||||
jQuery('#jform_article').addClass('required');
|
||||
jform_vvvvwcpvxy_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_article').closest('.control-group').hide();
|
||||
// remove required attribute from article field
|
||||
if (!jform_vvvvwcpvxy_required)
|
||||
{
|
||||
updateFieldRequired('article',1);
|
||||
jQuery('#jform_article').removeAttr('required');
|
||||
jQuery('#jform_article').removeAttr('aria-required');
|
||||
jQuery('#jform_article').removeClass('required');
|
||||
jform_vvvvwcpvxy_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwcp Some function
|
||||
function type_vvvvwcp_SomeFunc(type_vvvvwcp)
|
||||
{
|
||||
// set the function logic
|
||||
if (type_vvvvwcp == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwcq function
|
||||
function vvvvwcq(type_vvvvwcq)
|
||||
{
|
||||
@@ -117,118 +229,6 @@ function vvvvwcq(type_vvvvwcq)
|
||||
var type = type_vvvvwcq.some(type_vvvvwcq_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (type)
|
||||
{
|
||||
jQuery('#jform_url').closest('.control-group').show();
|
||||
// add required attribute to url field
|
||||
if (jform_vvvvwcqvye_required)
|
||||
{
|
||||
updateFieldRequired('url',0);
|
||||
jQuery('#jform_url').prop('required','required');
|
||||
jQuery('#jform_url').attr('aria-required',true);
|
||||
jQuery('#jform_url').addClass('required');
|
||||
jform_vvvvwcqvye_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_url').closest('.control-group').hide();
|
||||
// remove required attribute from url field
|
||||
if (!jform_vvvvwcqvye_required)
|
||||
{
|
||||
updateFieldRequired('url',1);
|
||||
jQuery('#jform_url').removeAttr('required');
|
||||
jQuery('#jform_url').removeAttr('aria-required');
|
||||
jQuery('#jform_url').removeClass('required');
|
||||
jform_vvvvwcqvye_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwcq Some function
|
||||
function type_vvvvwcq_SomeFunc(type_vvvvwcq)
|
||||
{
|
||||
// set the function logic
|
||||
if (type_vvvvwcq == 3)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwcr function
|
||||
function vvvvwcr(type_vvvvwcr)
|
||||
{
|
||||
if (isSet(type_vvvvwcr) && type_vvvvwcr.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwcr = type_vvvvwcr;
|
||||
var type_vvvvwcr = [];
|
||||
type_vvvvwcr.push(temp_vvvvwcr);
|
||||
}
|
||||
else if (!isSet(type_vvvvwcr))
|
||||
{
|
||||
var type_vvvvwcr = [];
|
||||
}
|
||||
var type = type_vvvvwcr.some(type_vvvvwcr_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (type)
|
||||
{
|
||||
jQuery('#jform_article').closest('.control-group').show();
|
||||
// add required attribute to article field
|
||||
if (jform_vvvvwcrvyf_required)
|
||||
{
|
||||
updateFieldRequired('article',0);
|
||||
jQuery('#jform_article').prop('required','required');
|
||||
jQuery('#jform_article').attr('aria-required',true);
|
||||
jQuery('#jform_article').addClass('required');
|
||||
jform_vvvvwcrvyf_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_article').closest('.control-group').hide();
|
||||
// remove required attribute from article field
|
||||
if (!jform_vvvvwcrvyf_required)
|
||||
{
|
||||
updateFieldRequired('article',1);
|
||||
jQuery('#jform_article').removeAttr('required');
|
||||
jQuery('#jform_article').removeAttr('aria-required');
|
||||
jQuery('#jform_article').removeClass('required');
|
||||
jform_vvvvwcrvyf_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwcr Some function
|
||||
function type_vvvvwcr_SomeFunc(type_vvvvwcr)
|
||||
{
|
||||
// set the function logic
|
||||
if (type_vvvvwcr == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwcs function
|
||||
function vvvvwcs(type_vvvvwcs)
|
||||
{
|
||||
if (isSet(type_vvvvwcs) && type_vvvvwcs.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwcs = type_vvvvwcs;
|
||||
var type_vvvvwcs = [];
|
||||
type_vvvvwcs.push(temp_vvvvwcs);
|
||||
}
|
||||
else if (!isSet(type_vvvvwcs))
|
||||
{
|
||||
var type_vvvvwcs = [];
|
||||
}
|
||||
var type = type_vvvvwcs.some(type_vvvvwcs_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (type)
|
||||
{
|
||||
@@ -240,45 +240,45 @@ function vvvvwcs(type_vvvvwcs)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwcs Some function
|
||||
function type_vvvvwcs_SomeFunc(type_vvvvwcs)
|
||||
// the vvvvwcq Some function
|
||||
function type_vvvvwcq_SomeFunc(type_vvvvwcq)
|
||||
{
|
||||
// set the function logic
|
||||
if (type_vvvvwcs == 2)
|
||||
if (type_vvvvwcq == 2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwct function
|
||||
function vvvvwct(target_vvvvwct)
|
||||
// the vvvvwcr function
|
||||
function vvvvwcr(target_vvvvwcr)
|
||||
{
|
||||
// set the function logic
|
||||
if (target_vvvvwct == 1)
|
||||
if (target_vvvvwcr == 1)
|
||||
{
|
||||
jQuery('#jform_groups').closest('.control-group').show();
|
||||
// add required attribute to groups field
|
||||
if (jform_vvvvwctvyg_required)
|
||||
if (jform_vvvvwcrvxz_required)
|
||||
{
|
||||
updateFieldRequired('groups',0);
|
||||
jQuery('#jform_groups').prop('required','required');
|
||||
jQuery('#jform_groups').attr('aria-required',true);
|
||||
jQuery('#jform_groups').addClass('required');
|
||||
jform_vvvvwctvyg_required = false;
|
||||
jform_vvvvwcrvxz_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_groups').closest('.control-group').hide();
|
||||
// remove required attribute from groups field
|
||||
if (!jform_vvvvwctvyg_required)
|
||||
if (!jform_vvvvwcrvxz_required)
|
||||
{
|
||||
updateFieldRequired('groups',1);
|
||||
jQuery('#jform_groups').removeAttr('required');
|
||||
jQuery('#jform_groups').removeAttr('aria-required');
|
||||
jQuery('#jform_groups').removeClass('required');
|
||||
jform_vvvvwctvyg_required = true;
|
||||
jform_vvvvwcrvxz_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -544,12 +544,16 @@ function getEditCustomCodeButtons() {
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
if (insertBeforeElement) {
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
}
|
||||
|
||||
// Adding buttons to the div
|
||||
Object.entries(buttons).forEach(([name, button]) => {
|
||||
const controlsDiv = document.querySelector(".control-customcode-buttons-"+field);
|
||||
controlsDiv.innerHTML += button;
|
||||
if (controlsDiv) {
|
||||
controlsDiv.innerHTML += button;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -250,8 +250,11 @@ function getLinked() {
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
if (token.length > 0 && getCodeFrom_isValidId(id) && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
} else {
|
||||
console.error('There was a issue with the values passed to the [getCodeFrom_server] method and we could not make the Ajax call.');
|
||||
return;
|
||||
}
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
@@ -271,6 +274,17 @@ function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
function getCodeFrom_isValidId(id) {
|
||||
if (typeof id === 'number') {
|
||||
// Check if it's a positive integer
|
||||
return Number.isInteger(id) && id > 0;
|
||||
} else if (typeof id === 'string') {
|
||||
// Check if it's a string of length > 30
|
||||
return id.length > 30;
|
||||
}
|
||||
// If neither a number nor a string, return false
|
||||
return false;
|
||||
}
|
||||
|
||||
function addCodeToEditor(code_string, editor_id, merge, merge_target){
|
||||
if (Joomla.editors.instances.hasOwnProperty(editor_id)) {
|
||||
@@ -388,12 +402,16 @@ function getEditCustomCodeButtons() {
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
if (insertBeforeElement) {
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
}
|
||||
|
||||
// Adding buttons to the div
|
||||
Object.entries(buttons).forEach(([name, button]) => {
|
||||
const controlsDiv = document.querySelector(".control-customcode-buttons-"+field);
|
||||
controlsDiv.innerHTML += button;
|
||||
if (controlsDiv) {
|
||||
controlsDiv.innerHTML += button;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -292,8 +292,11 @@ jQuery(document).ready(function()
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
if (token.length > 0 && getCodeFrom_isValidId(id) && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
} else {
|
||||
console.error('There was a issue with the values passed to the [getCodeFrom_server] method and we could not make the Ajax call.');
|
||||
return;
|
||||
}
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
@@ -313,6 +316,17 @@ function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
function getCodeFrom_isValidId(id) {
|
||||
if (typeof id === 'number') {
|
||||
// Check if it's a positive integer
|
||||
return Number.isInteger(id) && id > 0;
|
||||
} else if (typeof id === 'string') {
|
||||
// Check if it's a string of length > 30
|
||||
return id.length > 30;
|
||||
}
|
||||
// If neither a number nor a string, return false
|
||||
return false;
|
||||
}
|
||||
|
||||
// set selection the options
|
||||
selectionMemory = {'property':{},'method':{}};
|
||||
@@ -746,12 +760,16 @@ function getEditCustomCodeButtons() {
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
if (insertBeforeElement) {
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
}
|
||||
|
||||
// Adding buttons to the div
|
||||
Object.entries(buttons).forEach(([name, button]) => {
|
||||
const controlsDiv = document.querySelector(".control-customcode-buttons-"+field);
|
||||
controlsDiv.innerHTML += button;
|
||||
if (controlsDiv) {
|
||||
controlsDiv.innerHTML += button;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -11,15 +11,15 @@
|
||||
// Initial Script
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var add_php_view_vvvvvzf = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvvzf(add_php_view_vvvvvzf);
|
||||
var add_php_view_vvvvvzd = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvvzd(add_php_view_vvvvvzd);
|
||||
});
|
||||
|
||||
// the vvvvvzf function
|
||||
function vvvvvzf(add_php_view_vvvvvzf)
|
||||
// the vvvvvzd function
|
||||
function vvvvvzd(add_php_view_vvvvvzd)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_view_vvvvvzf == 1)
|
||||
if (add_php_view_vvvvvzd == 1)
|
||||
{
|
||||
jQuery('#jform_php_view-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -39,16 +39,18 @@ function isSet(val)
|
||||
}
|
||||
|
||||
|
||||
jQuery(document).ready(function($)
|
||||
{
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
// check and load all the custom code edit buttons
|
||||
getEditCustomCodeButtons();
|
||||
});
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
if (token.length > 0 && getCodeFrom_isValidId(id) && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
} else {
|
||||
console.error('There was a issue with the values passed to the [getCodeFrom_server] method and we could not make the Ajax call.');
|
||||
return;
|
||||
}
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
@@ -68,6 +70,17 @@ function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
function getCodeFrom_isValidId(id) {
|
||||
if (typeof id === 'number') {
|
||||
// Check if it's a positive integer
|
||||
return Number.isInteger(id) && id > 0;
|
||||
} else if (typeof id === 'string') {
|
||||
// Check if it's a string of length > 30
|
||||
return id.length > 30;
|
||||
}
|
||||
// If neither a number nor a string, return false
|
||||
return false;
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
@@ -105,12 +118,16 @@ function getEditCustomCodeButtons() {
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
if (insertBeforeElement) {
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
}
|
||||
|
||||
// Adding buttons to the div
|
||||
Object.entries(buttons).forEach(([name, button]) => {
|
||||
const controlsDiv = document.querySelector(".control-customcode-buttons-"+field);
|
||||
controlsDiv.innerHTML += button;
|
||||
if (controlsDiv) {
|
||||
controlsDiv.innerHTML += button;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -154,58 +171,84 @@ function getSnippetDetails(id){
|
||||
})
|
||||
}
|
||||
|
||||
function getDynamicValues_server(dynamicId){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json");
|
||||
if(token.length > 0 && dynamicId > 0){
|
||||
var request = token+'=1&view=layout&id='+dynamicId;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'jsonp',
|
||||
data: request,
|
||||
jsonp: 'callback'
|
||||
});
|
||||
function getDynamicValuesServer(dynamicId) {
|
||||
var getUrl = 'index.php?option=com_componentbuilder&task=ajax.getDynamicValues&raw=true&format=json';
|
||||
if (token.length > 0 && (dynamicId > 0 || dynamicId.length > 0)) {
|
||||
var request = token + '=1&view=layout&id=' + dynamicId;
|
||||
}
|
||||
|
||||
return fetch(getUrl + '&' + request, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
}
|
||||
})
|
||||
.then(response => response.json());
|
||||
}
|
||||
|
||||
function getDynamicValues(id){
|
||||
getDynamicValues_server(id).done(function(result) {
|
||||
if(result){
|
||||
jQuery('#dynamic_values').remove();
|
||||
jQuery('.dynamic_values').append('<div id="dynamic_values">'+result+'</div>');
|
||||
// make sure the code bocks are active
|
||||
jQuery("code").click(function() {
|
||||
jQuery(this).selText().addClass("selected");
|
||||
});
|
||||
}
|
||||
})
|
||||
function getDynamicValues(id) {
|
||||
getDynamicValuesServer(id).then(function(result) {
|
||||
if (result) {
|
||||
var dynamicValuesElement = document.getElementById('dynamic_values');
|
||||
if (dynamicValuesElement) {
|
||||
dynamicValuesElement.remove();
|
||||
}
|
||||
document.querySelector('.dynamic_values').insertAdjacentHTML('beforeend', '<div id="dynamic_values">' + result + '</div>');
|
||||
|
||||
// Event listener for code blocks
|
||||
document.querySelectorAll("code").forEach(function(codeBlock) {
|
||||
codeBlock.addEventListener("click", function() {
|
||||
codeBlock.selText(); // Call the custom selText function
|
||||
codeBlock.classList.add("selected"); // Add the "selected" class
|
||||
});
|
||||
});
|
||||
}
|
||||
}).catch(function(error) {
|
||||
console.error('Error fetching dynamic values:', error);
|
||||
});
|
||||
}
|
||||
|
||||
function getLayoutDetails_server(id){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'jsonp',
|
||||
data: request,
|
||||
jsonp: 'callback'
|
||||
});
|
||||
function getLayoutDetails_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json&raw=true&vdm=" + vastDevMod);
|
||||
var request = '';
|
||||
|
||||
// Ensure token and id are present
|
||||
if (token.length > 0 && id > 0) {
|
||||
request = token + '=1&id=' + id;
|
||||
}
|
||||
|
||||
// Return a fetch promise (fetch does not support JSONP, so I assume the server can return JSON)
|
||||
return fetch(getUrl + '&' + request, {
|
||||
method: 'GET'
|
||||
})
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
throw new Error("Network response was not ok");
|
||||
}
|
||||
return response.json(); // Assuming the server returns JSON
|
||||
});
|
||||
}
|
||||
|
||||
function getLayoutDetails(id){
|
||||
getLayoutDetails_server(id).done(function(result) {
|
||||
if(result){
|
||||
jQuery('#details').append(result);
|
||||
// make sure the code bocks are active
|
||||
jQuery("code").click(function() {
|
||||
jQuery(this).selText().addClass("selected");
|
||||
});
|
||||
}
|
||||
})
|
||||
function getLayoutDetails(id) {
|
||||
getLayoutDetails_server(id)
|
||||
.then(function(result) {
|
||||
if (result) {
|
||||
document.querySelector('#details').insertAdjacentHTML('beforeend', result);
|
||||
|
||||
// Re-enable code block text selection functionality
|
||||
document.querySelectorAll("code").forEach(function(codeBlock) {
|
||||
codeBlock.addEventListener("click", function() {
|
||||
codeBlock.selText();
|
||||
codeBlock.classList.add("selected");
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// set snippets that are on the page
|
||||
var snippetIds = [];
|
||||
|
@@ -9,13 +9,17 @@
|
||||
*/
|
||||
|
||||
// Some Global Values
|
||||
jform_vvvvwapvxb_required = false;
|
||||
jform_vvvvwbdvxc_required = false;
|
||||
jform_vvvvwbdvxd_required = false;
|
||||
jform_vvvvwanvwu_required = false;
|
||||
jform_vvvvwbbvwv_required = false;
|
||||
jform_vvvvwbbvww_required = false;
|
||||
|
||||
// Initial Script
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var how_vvvvwal = jQuery("#jform_how").val();
|
||||
var target_vvvvwal = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwal(how_vvvvwal,target_vvvvwal);
|
||||
|
||||
var how_vvvvwan = jQuery("#jform_how").val();
|
||||
var target_vvvvwan = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwan(how_vvvvwan,target_vvvvwan);
|
||||
@@ -32,6 +36,10 @@ document.addEventListener('DOMContentLoaded', function()
|
||||
var target_vvvvwat = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwat(how_vvvvwat,target_vvvvwat);
|
||||
|
||||
var target_vvvvwau = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
var how_vvvvwau = jQuery("#jform_how").val();
|
||||
vvvvwau(target_vvvvwau,how_vvvvwau);
|
||||
|
||||
var how_vvvvwav = jQuery("#jform_how").val();
|
||||
var target_vvvvwav = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwav(how_vvvvwav,target_vvvvwav);
|
||||
@@ -48,25 +56,78 @@ document.addEventListener('DOMContentLoaded', function()
|
||||
var how_vvvvway = jQuery("#jform_how").val();
|
||||
vvvvway(target_vvvvway,how_vvvvway);
|
||||
|
||||
var how_vvvvwaz = jQuery("#jform_how").val();
|
||||
var target_vvvvwaz = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwaz(how_vvvvwaz,target_vvvvwaz);
|
||||
|
||||
var target_vvvvwba = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
var how_vvvvwba = jQuery("#jform_how").val();
|
||||
vvvvwba(target_vvvvwba,how_vvvvwba);
|
||||
var type_vvvvwaz = jQuery("#jform_type input[type='radio']:checked").val();
|
||||
vvvvwaz(target_vvvvwaz,type_vvvvwaz);
|
||||
|
||||
var target_vvvvwbb = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
var type_vvvvwbb = jQuery("#jform_type input[type='radio']:checked").val();
|
||||
vvvvwbb(target_vvvvwbb,type_vvvvwbb);
|
||||
vvvvwbb(target_vvvvwbb);
|
||||
|
||||
var target_vvvvwbd = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwbd(target_vvvvwbd);
|
||||
|
||||
var target_vvvvwbe = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwbe(target_vvvvwbe);
|
||||
var target_vvvvwbc = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwbc(target_vvvvwbc);
|
||||
});
|
||||
|
||||
// the vvvvwal function
|
||||
function vvvvwal(how_vvvvwal,target_vvvvwal)
|
||||
{
|
||||
if (isSet(how_vvvvwal) && how_vvvvwal.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwal = how_vvvvwal;
|
||||
var how_vvvvwal = [];
|
||||
how_vvvvwal.push(temp_vvvvwal);
|
||||
}
|
||||
else if (!isSet(how_vvvvwal))
|
||||
{
|
||||
var how_vvvvwal = [];
|
||||
}
|
||||
var how = how_vvvvwal.some(how_vvvvwal_SomeFunc);
|
||||
|
||||
if (isSet(target_vvvvwal) && target_vvvvwal.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwal = target_vvvvwal;
|
||||
var target_vvvvwal = [];
|
||||
target_vvvvwal.push(temp_vvvvwal);
|
||||
}
|
||||
else if (!isSet(target_vvvvwal))
|
||||
{
|
||||
var target_vvvvwal = [];
|
||||
}
|
||||
var target = target_vvvvwal.some(target_vvvvwal_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (how && target)
|
||||
{
|
||||
jQuery('#jform_addconditions-lbl').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_addconditions-lbl').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwal Some function
|
||||
function how_vvvvwal_SomeFunc(how_vvvvwal)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwal == 2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwal Some function
|
||||
function target_vvvvwal_SomeFunc(target_vvvvwal)
|
||||
{
|
||||
// set the function logic
|
||||
if (target_vvvvwal == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwan function
|
||||
function vvvvwan(how_vvvvwan,target_vvvvwan)
|
||||
{
|
||||
@@ -98,11 +159,29 @@ function vvvvwan(how_vvvvwan,target_vvvvwan)
|
||||
// set this function logic
|
||||
if (how && target)
|
||||
{
|
||||
jQuery('#jform_addconditions-lbl').closest('.control-group').show();
|
||||
jQuery('#jform_php_setdocument').closest('.control-group').show();
|
||||
// add required attribute to php_setdocument field
|
||||
if (jform_vvvvwanvwu_required)
|
||||
{
|
||||
updateFieldRequired('php_setdocument',0);
|
||||
jQuery('#jform_php_setdocument').prop('required','required');
|
||||
jQuery('#jform_php_setdocument').attr('aria-required',true);
|
||||
jQuery('#jform_php_setdocument').addClass('required');
|
||||
jform_vvvvwanvwu_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_addconditions-lbl').closest('.control-group').hide();
|
||||
jQuery('#jform_php_setdocument').closest('.control-group').hide();
|
||||
// remove required attribute from php_setdocument field
|
||||
if (!jform_vvvvwanvwu_required)
|
||||
{
|
||||
updateFieldRequired('php_setdocument',1);
|
||||
jQuery('#jform_php_setdocument').removeAttr('required');
|
||||
jQuery('#jform_php_setdocument').removeAttr('aria-required');
|
||||
jQuery('#jform_php_setdocument').removeClass('required');
|
||||
jform_vvvvwanvwu_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +189,7 @@ function vvvvwan(how_vvvvwan,target_vvvvwan)
|
||||
function how_vvvvwan_SomeFunc(how_vvvvwan)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwan == 2)
|
||||
if (how_vvvvwan == 3)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -159,29 +238,11 @@ function vvvvwap(how_vvvvwap,target_vvvvwap)
|
||||
// set this function logic
|
||||
if (how && target)
|
||||
{
|
||||
jQuery('#jform_php_setdocument').closest('.control-group').show();
|
||||
// add required attribute to php_setdocument field
|
||||
if (jform_vvvvwapvxb_required)
|
||||
{
|
||||
updateFieldRequired('php_setdocument',0);
|
||||
jQuery('#jform_php_setdocument').prop('required','required');
|
||||
jQuery('#jform_php_setdocument').attr('aria-required',true);
|
||||
jQuery('#jform_php_setdocument').addClass('required');
|
||||
jform_vvvvwapvxb_required = false;
|
||||
}
|
||||
jQuery('.note_display_library_config').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_php_setdocument').closest('.control-group').hide();
|
||||
// remove required attribute from php_setdocument field
|
||||
if (!jform_vvvvwapvxb_required)
|
||||
{
|
||||
updateFieldRequired('php_setdocument',1);
|
||||
jQuery('#jform_php_setdocument').removeAttr('required');
|
||||
jQuery('#jform_php_setdocument').removeAttr('aria-required');
|
||||
jQuery('#jform_php_setdocument').removeClass('required');
|
||||
jform_vvvvwapvxb_required = true;
|
||||
}
|
||||
jQuery('.note_display_library_config').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,7 +250,7 @@ function vvvvwap(how_vvvvwap,target_vvvvwap)
|
||||
function how_vvvvwap_SomeFunc(how_vvvvwap)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwap == 3)
|
||||
if (how_vvvvwap == 2 || how_vvvvwap == 3)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -238,11 +299,11 @@ function vvvvwar(how_vvvvwar,target_vvvvwar)
|
||||
// set this function logic
|
||||
if (how && target)
|
||||
{
|
||||
jQuery('.note_display_library_config').closest('.control-group').show();
|
||||
jQuery('.note_display_library_files_folders_urls').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_display_library_config').closest('.control-group').hide();
|
||||
jQuery('.note_display_library_files_folders_urls').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -250,7 +311,7 @@ function vvvvwar(how_vvvvwar,target_vvvvwar)
|
||||
function how_vvvvwar_SomeFunc(how_vvvvwar)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwar == 2 || how_vvvvwar == 3)
|
||||
if (how_vvvvwar == 1 || how_vvvvwar == 2 || how_vvvvwar == 3)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -299,11 +360,15 @@ function vvvvwat(how_vvvvwat,target_vvvvwat)
|
||||
// set this function logic
|
||||
if (how && target)
|
||||
{
|
||||
jQuery('.note_display_library_files_folders_urls').closest('.control-group').show();
|
||||
jQuery('.note_no_behaviour_one').closest('.control-group').show();
|
||||
jQuery('.note_no_behaviour_three').closest('.control-group').show();
|
||||
jQuery('.note_no_behaviour_two').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_display_library_files_folders_urls').closest('.control-group').hide();
|
||||
jQuery('.note_no_behaviour_one').closest('.control-group').hide();
|
||||
jQuery('.note_no_behaviour_three').closest('.control-group').hide();
|
||||
jQuery('.note_no_behaviour_two').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -311,7 +376,7 @@ function vvvvwat(how_vvvvwat,target_vvvvwat)
|
||||
function how_vvvvwat_SomeFunc(how_vvvvwat)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwat == 1 || how_vvvvwat == 2 || how_vvvvwat == 3)
|
||||
if (how_vvvvwat == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -329,6 +394,71 @@ function target_vvvvwat_SomeFunc(target_vvvvwat)
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwau function
|
||||
function vvvvwau(target_vvvvwau,how_vvvvwau)
|
||||
{
|
||||
if (isSet(target_vvvvwau) && target_vvvvwau.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwau = target_vvvvwau;
|
||||
var target_vvvvwau = [];
|
||||
target_vvvvwau.push(temp_vvvvwau);
|
||||
}
|
||||
else if (!isSet(target_vvvvwau))
|
||||
{
|
||||
var target_vvvvwau = [];
|
||||
}
|
||||
var target = target_vvvvwau.some(target_vvvvwau_SomeFunc);
|
||||
|
||||
if (isSet(how_vvvvwau) && how_vvvvwau.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwau = how_vvvvwau;
|
||||
var how_vvvvwau = [];
|
||||
how_vvvvwau.push(temp_vvvvwau);
|
||||
}
|
||||
else if (!isSet(how_vvvvwau))
|
||||
{
|
||||
var how_vvvvwau = [];
|
||||
}
|
||||
var how = how_vvvvwau.some(how_vvvvwau_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (target && how)
|
||||
{
|
||||
jQuery('.note_no_behaviour_one').closest('.control-group').show();
|
||||
jQuery('.note_no_behaviour_three').closest('.control-group').show();
|
||||
jQuery('.note_no_behaviour_two').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_no_behaviour_one').closest('.control-group').hide();
|
||||
jQuery('.note_no_behaviour_three').closest('.control-group').hide();
|
||||
jQuery('.note_no_behaviour_two').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwau Some function
|
||||
function target_vvvvwau_SomeFunc(target_vvvvwau)
|
||||
{
|
||||
// set the function logic
|
||||
if (target_vvvvwau == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwau Some function
|
||||
function how_vvvvwau_SomeFunc(how_vvvvwau)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwau == 0)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwav function
|
||||
function vvvvwav(how_vvvvwav,target_vvvvwav)
|
||||
{
|
||||
@@ -360,15 +490,13 @@ function vvvvwav(how_vvvvwav,target_vvvvwav)
|
||||
// set this function logic
|
||||
if (how && target)
|
||||
{
|
||||
jQuery('.note_no_behaviour_one').closest('.control-group').show();
|
||||
jQuery('.note_no_behaviour_three').closest('.control-group').show();
|
||||
jQuery('.note_no_behaviour_two').closest('.control-group').show();
|
||||
jQuery('.note_yes_behaviour_one').closest('.control-group').show();
|
||||
jQuery('.note_yes_behaviour_two').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_no_behaviour_one').closest('.control-group').hide();
|
||||
jQuery('.note_no_behaviour_three').closest('.control-group').hide();
|
||||
jQuery('.note_no_behaviour_two').closest('.control-group').hide();
|
||||
jQuery('.note_yes_behaviour_one').closest('.control-group').hide();
|
||||
jQuery('.note_yes_behaviour_two').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -376,7 +504,7 @@ function vvvvwav(how_vvvvwav,target_vvvvwav)
|
||||
function how_vvvvwav_SomeFunc(how_vvvvwav)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwav == 0)
|
||||
if (how_vvvvwav == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -425,15 +553,13 @@ function vvvvwaw(target_vvvvwaw,how_vvvvwaw)
|
||||
// set this function logic
|
||||
if (target && how)
|
||||
{
|
||||
jQuery('.note_no_behaviour_one').closest('.control-group').show();
|
||||
jQuery('.note_no_behaviour_three').closest('.control-group').show();
|
||||
jQuery('.note_no_behaviour_two').closest('.control-group').show();
|
||||
jQuery('.note_yes_behaviour_one').closest('.control-group').show();
|
||||
jQuery('.note_yes_behaviour_two').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_no_behaviour_one').closest('.control-group').hide();
|
||||
jQuery('.note_no_behaviour_three').closest('.control-group').hide();
|
||||
jQuery('.note_no_behaviour_two').closest('.control-group').hide();
|
||||
jQuery('.note_yes_behaviour_one').closest('.control-group').hide();
|
||||
jQuery('.note_yes_behaviour_two').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,7 +578,7 @@ function target_vvvvwaw_SomeFunc(target_vvvvwaw)
|
||||
function how_vvvvwaw_SomeFunc(how_vvvvwaw)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwaw == 0)
|
||||
if (how_vvvvwaw == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -490,13 +616,15 @@ function vvvvwax(how_vvvvwax,target_vvvvwax)
|
||||
// set this function logic
|
||||
if (how && target)
|
||||
{
|
||||
jQuery('.note_yes_behaviour_one').closest('.control-group').show();
|
||||
jQuery('.note_yes_behaviour_two').closest('.control-group').show();
|
||||
jQuery('.note_build_in_behaviour_one').closest('.control-group').show();
|
||||
jQuery('.note_build_in_behaviour_three').closest('.control-group').show();
|
||||
jQuery('.note_build_in_behaviour_two').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_yes_behaviour_one').closest('.control-group').hide();
|
||||
jQuery('.note_yes_behaviour_two').closest('.control-group').hide();
|
||||
jQuery('.note_build_in_behaviour_one').closest('.control-group').hide();
|
||||
jQuery('.note_build_in_behaviour_three').closest('.control-group').hide();
|
||||
jQuery('.note_build_in_behaviour_two').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -504,7 +632,7 @@ function vvvvwax(how_vvvvwax,target_vvvvwax)
|
||||
function how_vvvvwax_SomeFunc(how_vvvvwax)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwax == 1)
|
||||
if (how_vvvvwax == 4)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -553,13 +681,15 @@ function vvvvway(target_vvvvway,how_vvvvway)
|
||||
// set this function logic
|
||||
if (target && how)
|
||||
{
|
||||
jQuery('.note_yes_behaviour_one').closest('.control-group').show();
|
||||
jQuery('.note_yes_behaviour_two').closest('.control-group').show();
|
||||
jQuery('.note_build_in_behaviour_one').closest('.control-group').show();
|
||||
jQuery('.note_build_in_behaviour_three').closest('.control-group').show();
|
||||
jQuery('.note_build_in_behaviour_two').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_yes_behaviour_one').closest('.control-group').hide();
|
||||
jQuery('.note_yes_behaviour_two').closest('.control-group').hide();
|
||||
jQuery('.note_build_in_behaviour_one').closest('.control-group').hide();
|
||||
jQuery('.note_build_in_behaviour_three').closest('.control-group').hide();
|
||||
jQuery('.note_build_in_behaviour_two').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -578,7 +708,7 @@ function target_vvvvway_SomeFunc(target_vvvvway)
|
||||
function how_vvvvway_SomeFunc(how_vvvvway)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvway == 1)
|
||||
if (how_vvvvway == 4)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -586,140 +716,10 @@ function how_vvvvway_SomeFunc(how_vvvvway)
|
||||
}
|
||||
|
||||
// the vvvvwaz function
|
||||
function vvvvwaz(how_vvvvwaz,target_vvvvwaz)
|
||||
{
|
||||
if (isSet(how_vvvvwaz) && how_vvvvwaz.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwaz = how_vvvvwaz;
|
||||
var how_vvvvwaz = [];
|
||||
how_vvvvwaz.push(temp_vvvvwaz);
|
||||
}
|
||||
else if (!isSet(how_vvvvwaz))
|
||||
{
|
||||
var how_vvvvwaz = [];
|
||||
}
|
||||
var how = how_vvvvwaz.some(how_vvvvwaz_SomeFunc);
|
||||
|
||||
if (isSet(target_vvvvwaz) && target_vvvvwaz.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwaz = target_vvvvwaz;
|
||||
var target_vvvvwaz = [];
|
||||
target_vvvvwaz.push(temp_vvvvwaz);
|
||||
}
|
||||
else if (!isSet(target_vvvvwaz))
|
||||
{
|
||||
var target_vvvvwaz = [];
|
||||
}
|
||||
var target = target_vvvvwaz.some(target_vvvvwaz_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (how && target)
|
||||
{
|
||||
jQuery('.note_build_in_behaviour_one').closest('.control-group').show();
|
||||
jQuery('.note_build_in_behaviour_three').closest('.control-group').show();
|
||||
jQuery('.note_build_in_behaviour_two').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_build_in_behaviour_one').closest('.control-group').hide();
|
||||
jQuery('.note_build_in_behaviour_three').closest('.control-group').hide();
|
||||
jQuery('.note_build_in_behaviour_two').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwaz Some function
|
||||
function how_vvvvwaz_SomeFunc(how_vvvvwaz)
|
||||
function vvvvwaz(target_vvvvwaz,type_vvvvwaz)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwaz == 4)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwaz Some function
|
||||
function target_vvvvwaz_SomeFunc(target_vvvvwaz)
|
||||
{
|
||||
// set the function logic
|
||||
if (target_vvvvwaz == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwba function
|
||||
function vvvvwba(target_vvvvwba,how_vvvvwba)
|
||||
{
|
||||
if (isSet(target_vvvvwba) && target_vvvvwba.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwba = target_vvvvwba;
|
||||
var target_vvvvwba = [];
|
||||
target_vvvvwba.push(temp_vvvvwba);
|
||||
}
|
||||
else if (!isSet(target_vvvvwba))
|
||||
{
|
||||
var target_vvvvwba = [];
|
||||
}
|
||||
var target = target_vvvvwba.some(target_vvvvwba_SomeFunc);
|
||||
|
||||
if (isSet(how_vvvvwba) && how_vvvvwba.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwba = how_vvvvwba;
|
||||
var how_vvvvwba = [];
|
||||
how_vvvvwba.push(temp_vvvvwba);
|
||||
}
|
||||
else if (!isSet(how_vvvvwba))
|
||||
{
|
||||
var how_vvvvwba = [];
|
||||
}
|
||||
var how = how_vvvvwba.some(how_vvvvwba_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (target && how)
|
||||
{
|
||||
jQuery('.note_build_in_behaviour_one').closest('.control-group').show();
|
||||
jQuery('.note_build_in_behaviour_three').closest('.control-group').show();
|
||||
jQuery('.note_build_in_behaviour_two').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_build_in_behaviour_one').closest('.control-group').hide();
|
||||
jQuery('.note_build_in_behaviour_three').closest('.control-group').hide();
|
||||
jQuery('.note_build_in_behaviour_two').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwba Some function
|
||||
function target_vvvvwba_SomeFunc(target_vvvvwba)
|
||||
{
|
||||
// set the function logic
|
||||
if (target_vvvvwba == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwba Some function
|
||||
function how_vvvvwba_SomeFunc(how_vvvvwba)
|
||||
{
|
||||
// set the function logic
|
||||
if (how_vvvvwba == 4)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwbb function
|
||||
function vvvvwbb(target_vvvvwbb,type_vvvvwbb)
|
||||
{
|
||||
// set the function logic
|
||||
if (target_vvvvwbb == 1 && type_vvvvwbb == 2)
|
||||
if (target_vvvvwaz == 1 && type_vvvvwaz == 2)
|
||||
{
|
||||
jQuery('#jform_libraries').closest('.control-group').show();
|
||||
}
|
||||
@@ -729,63 +729,63 @@ function vvvvwbb(target_vvvvwbb,type_vvvvwbb)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwbd function
|
||||
function vvvvwbd(target_vvvvwbd)
|
||||
// the vvvvwbb function
|
||||
function vvvvwbb(target_vvvvwbb)
|
||||
{
|
||||
// set the function logic
|
||||
if (target_vvvvwbd == 1)
|
||||
if (target_vvvvwbb == 1)
|
||||
{
|
||||
jQuery('#jform_how').closest('.control-group').show();
|
||||
// add required attribute to how field
|
||||
if (jform_vvvvwbdvxc_required)
|
||||
if (jform_vvvvwbbvwv_required)
|
||||
{
|
||||
updateFieldRequired('how',0);
|
||||
jQuery('#jform_how').prop('required','required');
|
||||
jQuery('#jform_how').attr('aria-required',true);
|
||||
jQuery('#jform_how').addClass('required');
|
||||
jform_vvvvwbdvxc_required = false;
|
||||
jform_vvvvwbbvwv_required = false;
|
||||
}
|
||||
jQuery('#jform_type').closest('.control-group').show();
|
||||
// add required attribute to type field
|
||||
if (jform_vvvvwbdvxd_required)
|
||||
if (jform_vvvvwbbvww_required)
|
||||
{
|
||||
updateFieldRequired('type',0);
|
||||
jQuery('#jform_type').prop('required','required');
|
||||
jQuery('#jform_type').attr('aria-required',true);
|
||||
jQuery('#jform_type').addClass('required');
|
||||
jform_vvvvwbdvxd_required = false;
|
||||
jform_vvvvwbbvww_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_how').closest('.control-group').hide();
|
||||
// remove required attribute from how field
|
||||
if (!jform_vvvvwbdvxc_required)
|
||||
if (!jform_vvvvwbbvwv_required)
|
||||
{
|
||||
updateFieldRequired('how',1);
|
||||
jQuery('#jform_how').removeAttr('required');
|
||||
jQuery('#jform_how').removeAttr('aria-required');
|
||||
jQuery('#jform_how').removeClass('required');
|
||||
jform_vvvvwbdvxc_required = true;
|
||||
jform_vvvvwbbvwv_required = true;
|
||||
}
|
||||
jQuery('#jform_type').closest('.control-group').hide();
|
||||
// remove required attribute from type field
|
||||
if (!jform_vvvvwbdvxd_required)
|
||||
if (!jform_vvvvwbbvww_required)
|
||||
{
|
||||
updateFieldRequired('type',1);
|
||||
jQuery('#jform_type').removeAttr('required');
|
||||
jQuery('#jform_type').removeAttr('aria-required');
|
||||
jQuery('#jform_type').removeClass('required');
|
||||
jform_vvvvwbdvxd_required = true;
|
||||
jform_vvvvwbbvww_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwbe function
|
||||
function vvvvwbe(target_vvvvwbe)
|
||||
// the vvvvwbc function
|
||||
function vvvvwbc(target_vvvvwbc)
|
||||
{
|
||||
// set the function logic
|
||||
if (target_vvvvwbe == 2)
|
||||
if (target_vvvvwbc == 2)
|
||||
{
|
||||
jQuery('.note_yes_behaviour_library').closest('.control-group').show();
|
||||
}
|
||||
@@ -889,8 +889,11 @@ function getFieldSelectOptions(fieldKey){
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
if (token.length > 0 && getCodeFrom_isValidId(id) && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
} else {
|
||||
console.error('There was a issue with the values passed to the [getCodeFrom_server] method and we could not make the Ajax call.');
|
||||
return;
|
||||
}
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
@@ -910,6 +913,17 @@ function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
function getCodeFrom_isValidId(id) {
|
||||
if (typeof id === 'number') {
|
||||
// Check if it's a positive integer
|
||||
return Number.isInteger(id) && id > 0;
|
||||
} else if (typeof id === 'string') {
|
||||
// Check if it's a string of length > 30
|
||||
return id.length > 30;
|
||||
}
|
||||
// If neither a number nor a string, return false
|
||||
return false;
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
@@ -947,12 +961,16 @@ function getEditCustomCodeButtons() {
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
if (insertBeforeElement) {
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
}
|
||||
|
||||
// Adding buttons to the div
|
||||
Object.entries(buttons).forEach(([name, button]) => {
|
||||
const controlsDiv = document.querySelector(".control-customcode-buttons-"+field);
|
||||
controlsDiv.innerHTML += button;
|
||||
if (controlsDiv) {
|
||||
controlsDiv.innerHTML += button;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -71,53 +71,162 @@ function checkPlaceholderName_server(placeholderName, ide){
|
||||
}
|
||||
|
||||
|
||||
// check where this Function is used
|
||||
/**
|
||||
* Checks where a given function is used by iterating through a list of numeric targets (0–29).
|
||||
* For each target, it calls placedin_server() concurrently and updates the UI based on the responses.
|
||||
*
|
||||
* @param {string} placeholder - The placeholder parameter to send to the server.
|
||||
* @param {string|number} ide - The identifier to send.
|
||||
*/
|
||||
function placedin(placeholder, ide) {
|
||||
var found = false;
|
||||
jQuery('#before-placedin').hide();
|
||||
jQuery('#note-placedin-not').hide();
|
||||
jQuery('#note-placedin-found').hide();
|
||||
jQuery('#loading-placedin').show();
|
||||
var targets = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v']; // if you update this, also update (below 21) & [customcode-codeUsedInHtmlNote]!
|
||||
var targetNumber = 21;
|
||||
var run = 0;
|
||||
var placedinChecker = setInterval(function(){
|
||||
var target = targets[run];
|
||||
placedin_server(placeholder, ide, target).done(function(used) {
|
||||
if (used.in) {
|
||||
jQuery('#placedin-'+used.id).show();
|
||||
jQuery('#area-'+used.id).html(used.in);
|
||||
jQuery.UIkit.notify({message: used.in, timeout: 5000, status: 'success', pos: 'top-right'});
|
||||
found = true;
|
||||
} else {
|
||||
jQuery('#placedin-'+target).hide();
|
||||
}
|
||||
if (run == targetNumber) {
|
||||
jQuery('#loading-placedin').hide();
|
||||
if (found) {
|
||||
jQuery('#note-placedin-found').show();
|
||||
} else {
|
||||
jQuery('#note-placedin-not').show();
|
||||
}
|
||||
}
|
||||
});
|
||||
if (run == targetNumber) {
|
||||
clearInterval(placedinChecker);
|
||||
let found = false;
|
||||
|
||||
// Helper functions to show/hide elements by ID.
|
||||
const hideElement = (id) => {
|
||||
const el = document.getElementById(id);
|
||||
if (el) {
|
||||
el.style.display = 'none';
|
||||
}
|
||||
};
|
||||
|
||||
const showElement = (id) => {
|
||||
const el = document.getElementById(id);
|
||||
if (el) {
|
||||
el.style.display = 'block';
|
||||
}
|
||||
};
|
||||
|
||||
// Hide initial UI elements.
|
||||
hideElement('before-placedin');
|
||||
hideElement('note-placedin-not');
|
||||
hideElement('note-placedin-found');
|
||||
showElement('loading-placedin');
|
||||
|
||||
// Create a targets array of 30 integers (0 to 29).
|
||||
const targets = Array.from({ length: 30 }, (_, i) => i);
|
||||
|
||||
// Map each target to a promise that makes an AJAX call.
|
||||
const promises = targets.map((target) => {
|
||||
return placedin_server(placeholder, ide, target)
|
||||
.then((used) => {
|
||||
if (used && used.in) {
|
||||
// Check if the element with id "placedin-{used.id}" exists.
|
||||
let funcElement = document.getElementById('placedin-' + used.id);
|
||||
if (!funcElement) {
|
||||
// Create the main container div.
|
||||
funcElement = document.createElement('div');
|
||||
funcElement.id = 'placedin-' + used.id;
|
||||
|
||||
// Create the header element with the area name.
|
||||
const header = document.createElement('h2');
|
||||
header.textContent = used.area_name;
|
||||
|
||||
// Create the inner div element that will contain the result.
|
||||
const innerDiv = document.createElement('div');
|
||||
innerDiv.id = 'area-' + used.id;
|
||||
|
||||
// Append the header and inner div to the main element.
|
||||
funcElement.appendChild(header);
|
||||
funcElement.appendChild(innerDiv);
|
||||
|
||||
// Append this element to the container with id "placedin-targets".
|
||||
const container = document.getElementById('placedin-targets');
|
||||
if (container) {
|
||||
container.appendChild(funcElement);
|
||||
} else {
|
||||
console.error(
|
||||
"Container with id 'placedin-targets' not found. Appending to document.body instead."
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Ensure the element is visible.
|
||||
showElement('placedin-' + used.id);
|
||||
|
||||
// Update the inner div's content with the response.
|
||||
const areaEl = document.getElementById('area-' + used.id);
|
||||
if (areaEl) {
|
||||
areaEl.innerHTML = used.in;
|
||||
}
|
||||
|
||||
// Notify the user using UIkit.notification if available, otherwise log to the console.
|
||||
if (typeof UIkit !== 'undefined' && UIkit.notify) {
|
||||
UIkit.notify({
|
||||
message: used.in,
|
||||
timeout: 5000,
|
||||
status: 'success',
|
||||
pos: 'top-right'
|
||||
});
|
||||
} else {
|
||||
console.log('Notification:', used.in);
|
||||
}
|
||||
found = true;
|
||||
} else {
|
||||
// If no valid response, hide the element with id "placedin-{target}".
|
||||
hideElement('placedin-' + target);
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error in placedin_server for target ' + target + ':', error);
|
||||
});
|
||||
});
|
||||
|
||||
// Once all Ajax calls are completed, update the UI accordingly.
|
||||
Promise.all(promises).then(() => {
|
||||
hideElement('loading-placedin');
|
||||
if (found) {
|
||||
showElement('note-placedin-found');
|
||||
} else {
|
||||
showElement('note-placedin-not');
|
||||
}
|
||||
run++;
|
||||
}, 800);
|
||||
}
|
||||
function placedin_server(placeholder, ide, target){
|
||||
var getUrl = "index.php?option=com_componentbuilder&task=ajax.placedin&format=json";
|
||||
if(token.length > 0){
|
||||
var request = token+'=1&placeholder='+placeholder+'&id='+ide+'&target='+target+'&raw=true&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Sends an AJAX GET request to the server with the specified parameters.
|
||||
* The function builds a URL with query parameters and returns a promise
|
||||
* that resolves with the JSON response.
|
||||
*
|
||||
* @param {string} placeholder - The placeholder to send with the request.
|
||||
* @param {string|number} ide - The identifier to send.
|
||||
* @param {string|number} target - The target placeholder to send.
|
||||
*
|
||||
* @returns {Promise<Object>} - A promise that resolves to the JSON response.
|
||||
*/
|
||||
function placedin_server(placeholder, ide, target) {
|
||||
// Check if the global variable 'token' exists and has a non-empty placeholder.
|
||||
// 'token', 'functioName', and 'return_here' are assumed to be defined elsewhere in your code.
|
||||
if (token && token.length > 0) {
|
||||
var request =
|
||||
token +
|
||||
'=1&placeholder=' +
|
||||
placeholder +
|
||||
'&id=' +
|
||||
ide +
|
||||
'&target=' +
|
||||
target +
|
||||
'&raw=true&return_here=' +
|
||||
return_here;
|
||||
} else {
|
||||
console.error(
|
||||
'There was a issue with the placeholders passed to the [placedin_server] method and we could not make the Ajax call.'
|
||||
);
|
||||
return Promise.reject(new Error('Invalid token or parameters.'));
|
||||
}
|
||||
|
||||
// Base URL for the AJAX request.
|
||||
const baseUrl = `index.php?option=com_componentbuilder&task=ajax.placedin&format=json&${request}`;
|
||||
|
||||
// Use the Fetch API to perform a GET request.
|
||||
return fetch(baseUrl, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
"Accept": "application/json"
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error(`HTTP error! Status: ${response.status}`);
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
@@ -56,8 +56,11 @@ document.addEventListener('DOMContentLoaded', function() {
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
if (token.length > 0 && getCodeFrom_isValidId(id) && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
} else {
|
||||
console.error('There was a issue with the values passed to the [getCodeFrom_server] method and we could not make the Ajax call.');
|
||||
return;
|
||||
}
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
@@ -77,6 +80,17 @@ function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
function getCodeFrom_isValidId(id) {
|
||||
if (typeof id === 'number') {
|
||||
// Check if it's a positive integer
|
||||
return Number.isInteger(id) && id > 0;
|
||||
} else if (typeof id === 'string') {
|
||||
// Check if it's a string of length > 30
|
||||
return id.length > 30;
|
||||
}
|
||||
// If neither a number nor a string, return false
|
||||
return false;
|
||||
}
|
||||
|
||||
// set selection the options
|
||||
selectionMemory = {'property':{},'method':{}};
|
||||
@@ -510,12 +524,16 @@ function getEditCustomCodeButtons() {
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
if (insertBeforeElement) {
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
}
|
||||
|
||||
// Adding buttons to the div
|
||||
Object.entries(buttons).forEach(([name, button]) => {
|
||||
const controlsDiv = document.querySelector(".control-customcode-buttons-"+field);
|
||||
controlsDiv.innerHTML += button;
|
||||
if (controlsDiv) {
|
||||
controlsDiv.innerHTML += button;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -9,24 +9,28 @@
|
||||
*/
|
||||
|
||||
// Some Global Values
|
||||
jform_vvvvwcevxt_required = false;
|
||||
jform_vvvvwcevxu_required = false;
|
||||
jform_vvvvwcevxv_required = false;
|
||||
jform_vvvvwcevxw_required = false;
|
||||
jform_vvvvwcevxx_required = false;
|
||||
jform_vvvvwcfvxy_required = false;
|
||||
jform_vvvvwcgvxz_required = false;
|
||||
jform_vvvvwcivya_required = false;
|
||||
jform_vvvvwckvyb_required = false;
|
||||
jform_vvvvwccvxm_required = false;
|
||||
jform_vvvvwccvxn_required = false;
|
||||
jform_vvvvwccvxo_required = false;
|
||||
jform_vvvvwccvxp_required = false;
|
||||
jform_vvvvwccvxq_required = false;
|
||||
jform_vvvvwcdvxr_required = false;
|
||||
jform_vvvvwcevxs_required = false;
|
||||
jform_vvvvwcgvxt_required = false;
|
||||
jform_vvvvwcivxu_required = false;
|
||||
|
||||
// Initial Script
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var protocol_vvvvwce = jQuery("#jform_protocol").val();
|
||||
vvvvwce(protocol_vvvvwce);
|
||||
var protocol_vvvvwcc = jQuery("#jform_protocol").val();
|
||||
vvvvwcc(protocol_vvvvwcc);
|
||||
|
||||
var protocol_vvvvwcf = jQuery("#jform_protocol").val();
|
||||
vvvvwcf(protocol_vvvvwcf);
|
||||
var protocol_vvvvwcd = jQuery("#jform_protocol").val();
|
||||
vvvvwcd(protocol_vvvvwcd);
|
||||
|
||||
var protocol_vvvvwce = jQuery("#jform_protocol").val();
|
||||
var authentication_vvvvwce = jQuery("#jform_authentication").val();
|
||||
vvvvwce(protocol_vvvvwce,authentication_vvvvwce);
|
||||
|
||||
var protocol_vvvvwcg = jQuery("#jform_protocol").val();
|
||||
var authentication_vvvvwcg = jQuery("#jform_authentication").val();
|
||||
@@ -39,14 +43,206 @@ document.addEventListener('DOMContentLoaded', function()
|
||||
var protocol_vvvvwck = jQuery("#jform_protocol").val();
|
||||
var authentication_vvvvwck = jQuery("#jform_authentication").val();
|
||||
vvvvwck(protocol_vvvvwck,authentication_vvvvwck);
|
||||
|
||||
var protocol_vvvvwcm = jQuery("#jform_protocol").val();
|
||||
var authentication_vvvvwcm = jQuery("#jform_authentication").val();
|
||||
vvvvwcm(protocol_vvvvwcm,authentication_vvvvwcm);
|
||||
});
|
||||
|
||||
// the vvvvwcc function
|
||||
function vvvvwcc(protocol_vvvvwcc)
|
||||
{
|
||||
if (isSet(protocol_vvvvwcc) && protocol_vvvvwcc.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwcc = protocol_vvvvwcc;
|
||||
var protocol_vvvvwcc = [];
|
||||
protocol_vvvvwcc.push(temp_vvvvwcc);
|
||||
}
|
||||
else if (!isSet(protocol_vvvvwcc))
|
||||
{
|
||||
var protocol_vvvvwcc = [];
|
||||
}
|
||||
var protocol = protocol_vvvvwcc.some(protocol_vvvvwcc_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (protocol)
|
||||
{
|
||||
jQuery('#jform_authentication').closest('.control-group').show();
|
||||
// add required attribute to authentication field
|
||||
if (jform_vvvvwccvxm_required)
|
||||
{
|
||||
updateFieldRequired('authentication',0);
|
||||
jQuery('#jform_authentication').prop('required','required');
|
||||
jQuery('#jform_authentication').attr('aria-required',true);
|
||||
jQuery('#jform_authentication').addClass('required');
|
||||
jform_vvvvwccvxm_required = false;
|
||||
}
|
||||
jQuery('#jform_host').closest('.control-group').show();
|
||||
// add required attribute to host field
|
||||
if (jform_vvvvwccvxn_required)
|
||||
{
|
||||
updateFieldRequired('host',0);
|
||||
jQuery('#jform_host').prop('required','required');
|
||||
jQuery('#jform_host').attr('aria-required',true);
|
||||
jQuery('#jform_host').addClass('required');
|
||||
jform_vvvvwccvxn_required = false;
|
||||
}
|
||||
jQuery('#jform_port').closest('.control-group').show();
|
||||
// add required attribute to port field
|
||||
if (jform_vvvvwccvxo_required)
|
||||
{
|
||||
updateFieldRequired('port',0);
|
||||
jQuery('#jform_port').prop('required','required');
|
||||
jQuery('#jform_port').attr('aria-required',true);
|
||||
jQuery('#jform_port').addClass('required');
|
||||
jform_vvvvwccvxo_required = false;
|
||||
}
|
||||
jQuery('#jform_path').closest('.control-group').show();
|
||||
// add required attribute to path field
|
||||
if (jform_vvvvwccvxp_required)
|
||||
{
|
||||
updateFieldRequired('path',0);
|
||||
jQuery('#jform_path').prop('required','required');
|
||||
jQuery('#jform_path').attr('aria-required',true);
|
||||
jQuery('#jform_path').addClass('required');
|
||||
jform_vvvvwccvxp_required = false;
|
||||
}
|
||||
jQuery('.note_ssh_security').closest('.control-group').show();
|
||||
jQuery('#jform_username').closest('.control-group').show();
|
||||
// add required attribute to username field
|
||||
if (jform_vvvvwccvxq_required)
|
||||
{
|
||||
updateFieldRequired('username',0);
|
||||
jQuery('#jform_username').prop('required','required');
|
||||
jQuery('#jform_username').attr('aria-required',true);
|
||||
jQuery('#jform_username').addClass('required');
|
||||
jform_vvvvwccvxq_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_authentication').closest('.control-group').hide();
|
||||
// remove required attribute from authentication field
|
||||
if (!jform_vvvvwccvxm_required)
|
||||
{
|
||||
updateFieldRequired('authentication',1);
|
||||
jQuery('#jform_authentication').removeAttr('required');
|
||||
jQuery('#jform_authentication').removeAttr('aria-required');
|
||||
jQuery('#jform_authentication').removeClass('required');
|
||||
jform_vvvvwccvxm_required = true;
|
||||
}
|
||||
jQuery('#jform_host').closest('.control-group').hide();
|
||||
// remove required attribute from host field
|
||||
if (!jform_vvvvwccvxn_required)
|
||||
{
|
||||
updateFieldRequired('host',1);
|
||||
jQuery('#jform_host').removeAttr('required');
|
||||
jQuery('#jform_host').removeAttr('aria-required');
|
||||
jQuery('#jform_host').removeClass('required');
|
||||
jform_vvvvwccvxn_required = true;
|
||||
}
|
||||
jQuery('#jform_port').closest('.control-group').hide();
|
||||
// remove required attribute from port field
|
||||
if (!jform_vvvvwccvxo_required)
|
||||
{
|
||||
updateFieldRequired('port',1);
|
||||
jQuery('#jform_port').removeAttr('required');
|
||||
jQuery('#jform_port').removeAttr('aria-required');
|
||||
jQuery('#jform_port').removeClass('required');
|
||||
jform_vvvvwccvxo_required = true;
|
||||
}
|
||||
jQuery('#jform_path').closest('.control-group').hide();
|
||||
// remove required attribute from path field
|
||||
if (!jform_vvvvwccvxp_required)
|
||||
{
|
||||
updateFieldRequired('path',1);
|
||||
jQuery('#jform_path').removeAttr('required');
|
||||
jQuery('#jform_path').removeAttr('aria-required');
|
||||
jQuery('#jform_path').removeClass('required');
|
||||
jform_vvvvwccvxp_required = true;
|
||||
}
|
||||
jQuery('.note_ssh_security').closest('.control-group').hide();
|
||||
jQuery('#jform_username').closest('.control-group').hide();
|
||||
// remove required attribute from username field
|
||||
if (!jform_vvvvwccvxq_required)
|
||||
{
|
||||
updateFieldRequired('username',1);
|
||||
jQuery('#jform_username').removeAttr('required');
|
||||
jQuery('#jform_username').removeAttr('aria-required');
|
||||
jQuery('#jform_username').removeClass('required');
|
||||
jform_vvvvwccvxq_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwcc Some function
|
||||
function protocol_vvvvwcc_SomeFunc(protocol_vvvvwcc)
|
||||
{
|
||||
// set the function logic
|
||||
if (protocol_vvvvwcc == 2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwcd function
|
||||
function vvvvwcd(protocol_vvvvwcd)
|
||||
{
|
||||
if (isSet(protocol_vvvvwcd) && protocol_vvvvwcd.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwcd = protocol_vvvvwcd;
|
||||
var protocol_vvvvwcd = [];
|
||||
protocol_vvvvwcd.push(temp_vvvvwcd);
|
||||
}
|
||||
else if (!isSet(protocol_vvvvwcd))
|
||||
{
|
||||
var protocol_vvvvwcd = [];
|
||||
}
|
||||
var protocol = protocol_vvvvwcd.some(protocol_vvvvwcd_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (protocol)
|
||||
{
|
||||
jQuery('.note_ftp_signature').closest('.control-group').show();
|
||||
jQuery('#jform_signature').closest('.control-group').show();
|
||||
// add required attribute to signature field
|
||||
if (jform_vvvvwcdvxr_required)
|
||||
{
|
||||
updateFieldRequired('signature',0);
|
||||
jQuery('#jform_signature').prop('required','required');
|
||||
jQuery('#jform_signature').attr('aria-required',true);
|
||||
jQuery('#jform_signature').addClass('required');
|
||||
jform_vvvvwcdvxr_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_ftp_signature').closest('.control-group').hide();
|
||||
jQuery('#jform_signature').closest('.control-group').hide();
|
||||
// remove required attribute from signature field
|
||||
if (!jform_vvvvwcdvxr_required)
|
||||
{
|
||||
updateFieldRequired('signature',1);
|
||||
jQuery('#jform_signature').removeAttr('required');
|
||||
jQuery('#jform_signature').removeAttr('aria-required');
|
||||
jQuery('#jform_signature').removeClass('required');
|
||||
jform_vvvvwcdvxr_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwcd Some function
|
||||
function protocol_vvvvwcd_SomeFunc(protocol_vvvvwcd)
|
||||
{
|
||||
// set the function logic
|
||||
if (protocol_vvvvwcd == 1)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwce function
|
||||
function vvvvwce(protocol_vvvvwce)
|
||||
function vvvvwce(protocol_vvvvwce,authentication_vvvvwce)
|
||||
{
|
||||
if (isSet(protocol_vvvvwce) && protocol_vvvvwce.constructor !== Array)
|
||||
{
|
||||
@@ -60,114 +256,44 @@ function vvvvwce(protocol_vvvvwce)
|
||||
}
|
||||
var protocol = protocol_vvvvwce.some(protocol_vvvvwce_SomeFunc);
|
||||
|
||||
if (isSet(authentication_vvvvwce) && authentication_vvvvwce.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwce = authentication_vvvvwce;
|
||||
var authentication_vvvvwce = [];
|
||||
authentication_vvvvwce.push(temp_vvvvwce);
|
||||
}
|
||||
else if (!isSet(authentication_vvvvwce))
|
||||
{
|
||||
var authentication_vvvvwce = [];
|
||||
}
|
||||
var authentication = authentication_vvvvwce.some(authentication_vvvvwce_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (protocol)
|
||||
if (protocol && authentication)
|
||||
{
|
||||
jQuery('#jform_authentication').closest('.control-group').show();
|
||||
// add required attribute to authentication field
|
||||
if (jform_vvvvwcevxt_required)
|
||||
jQuery('#jform_password').closest('.control-group').show();
|
||||
// add required attribute to password field
|
||||
if (jform_vvvvwcevxs_required)
|
||||
{
|
||||
updateFieldRequired('authentication',0);
|
||||
jQuery('#jform_authentication').prop('required','required');
|
||||
jQuery('#jform_authentication').attr('aria-required',true);
|
||||
jQuery('#jform_authentication').addClass('required');
|
||||
jform_vvvvwcevxt_required = false;
|
||||
}
|
||||
jQuery('#jform_host').closest('.control-group').show();
|
||||
// add required attribute to host field
|
||||
if (jform_vvvvwcevxu_required)
|
||||
{
|
||||
updateFieldRequired('host',0);
|
||||
jQuery('#jform_host').prop('required','required');
|
||||
jQuery('#jform_host').attr('aria-required',true);
|
||||
jQuery('#jform_host').addClass('required');
|
||||
jform_vvvvwcevxu_required = false;
|
||||
}
|
||||
jQuery('#jform_port').closest('.control-group').show();
|
||||
// add required attribute to port field
|
||||
if (jform_vvvvwcevxv_required)
|
||||
{
|
||||
updateFieldRequired('port',0);
|
||||
jQuery('#jform_port').prop('required','required');
|
||||
jQuery('#jform_port').attr('aria-required',true);
|
||||
jQuery('#jform_port').addClass('required');
|
||||
jform_vvvvwcevxv_required = false;
|
||||
}
|
||||
jQuery('#jform_path').closest('.control-group').show();
|
||||
// add required attribute to path field
|
||||
if (jform_vvvvwcevxw_required)
|
||||
{
|
||||
updateFieldRequired('path',0);
|
||||
jQuery('#jform_path').prop('required','required');
|
||||
jQuery('#jform_path').attr('aria-required',true);
|
||||
jQuery('#jform_path').addClass('required');
|
||||
jform_vvvvwcevxw_required = false;
|
||||
}
|
||||
jQuery('.note_ssh_security').closest('.control-group').show();
|
||||
jQuery('#jform_username').closest('.control-group').show();
|
||||
// add required attribute to username field
|
||||
if (jform_vvvvwcevxx_required)
|
||||
{
|
||||
updateFieldRequired('username',0);
|
||||
jQuery('#jform_username').prop('required','required');
|
||||
jQuery('#jform_username').attr('aria-required',true);
|
||||
jQuery('#jform_username').addClass('required');
|
||||
jform_vvvvwcevxx_required = false;
|
||||
updateFieldRequired('password',0);
|
||||
jQuery('#jform_password').prop('required','required');
|
||||
jQuery('#jform_password').attr('aria-required',true);
|
||||
jQuery('#jform_password').addClass('required');
|
||||
jform_vvvvwcevxs_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_authentication').closest('.control-group').hide();
|
||||
// remove required attribute from authentication field
|
||||
if (!jform_vvvvwcevxt_required)
|
||||
jQuery('#jform_password').closest('.control-group').hide();
|
||||
// remove required attribute from password field
|
||||
if (!jform_vvvvwcevxs_required)
|
||||
{
|
||||
updateFieldRequired('authentication',1);
|
||||
jQuery('#jform_authentication').removeAttr('required');
|
||||
jQuery('#jform_authentication').removeAttr('aria-required');
|
||||
jQuery('#jform_authentication').removeClass('required');
|
||||
jform_vvvvwcevxt_required = true;
|
||||
}
|
||||
jQuery('#jform_host').closest('.control-group').hide();
|
||||
// remove required attribute from host field
|
||||
if (!jform_vvvvwcevxu_required)
|
||||
{
|
||||
updateFieldRequired('host',1);
|
||||
jQuery('#jform_host').removeAttr('required');
|
||||
jQuery('#jform_host').removeAttr('aria-required');
|
||||
jQuery('#jform_host').removeClass('required');
|
||||
jform_vvvvwcevxu_required = true;
|
||||
}
|
||||
jQuery('#jform_port').closest('.control-group').hide();
|
||||
// remove required attribute from port field
|
||||
if (!jform_vvvvwcevxv_required)
|
||||
{
|
||||
updateFieldRequired('port',1);
|
||||
jQuery('#jform_port').removeAttr('required');
|
||||
jQuery('#jform_port').removeAttr('aria-required');
|
||||
jQuery('#jform_port').removeClass('required');
|
||||
jform_vvvvwcevxv_required = true;
|
||||
}
|
||||
jQuery('#jform_path').closest('.control-group').hide();
|
||||
// remove required attribute from path field
|
||||
if (!jform_vvvvwcevxw_required)
|
||||
{
|
||||
updateFieldRequired('path',1);
|
||||
jQuery('#jform_path').removeAttr('required');
|
||||
jQuery('#jform_path').removeAttr('aria-required');
|
||||
jQuery('#jform_path').removeClass('required');
|
||||
jform_vvvvwcevxw_required = true;
|
||||
}
|
||||
jQuery('.note_ssh_security').closest('.control-group').hide();
|
||||
jQuery('#jform_username').closest('.control-group').hide();
|
||||
// remove required attribute from username field
|
||||
if (!jform_vvvvwcevxx_required)
|
||||
{
|
||||
updateFieldRequired('username',1);
|
||||
jQuery('#jform_username').removeAttr('required');
|
||||
jQuery('#jform_username').removeAttr('aria-required');
|
||||
jQuery('#jform_username').removeClass('required');
|
||||
jform_vvvvwcevxx_required = true;
|
||||
updateFieldRequired('password',1);
|
||||
jQuery('#jform_password').removeAttr('required');
|
||||
jQuery('#jform_password').removeAttr('aria-required');
|
||||
jQuery('#jform_password').removeClass('required');
|
||||
jform_vvvvwcevxs_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -183,58 +309,11 @@ function protocol_vvvvwce_SomeFunc(protocol_vvvvwce)
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwcf function
|
||||
function vvvvwcf(protocol_vvvvwcf)
|
||||
{
|
||||
if (isSet(protocol_vvvvwcf) && protocol_vvvvwcf.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwcf = protocol_vvvvwcf;
|
||||
var protocol_vvvvwcf = [];
|
||||
protocol_vvvvwcf.push(temp_vvvvwcf);
|
||||
}
|
||||
else if (!isSet(protocol_vvvvwcf))
|
||||
{
|
||||
var protocol_vvvvwcf = [];
|
||||
}
|
||||
var protocol = protocol_vvvvwcf.some(protocol_vvvvwcf_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (protocol)
|
||||
{
|
||||
jQuery('.note_ftp_signature').closest('.control-group').show();
|
||||
jQuery('#jform_signature').closest('.control-group').show();
|
||||
// add required attribute to signature field
|
||||
if (jform_vvvvwcfvxy_required)
|
||||
{
|
||||
updateFieldRequired('signature',0);
|
||||
jQuery('#jform_signature').prop('required','required');
|
||||
jQuery('#jform_signature').attr('aria-required',true);
|
||||
jQuery('#jform_signature').addClass('required');
|
||||
jform_vvvvwcfvxy_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('.note_ftp_signature').closest('.control-group').hide();
|
||||
jQuery('#jform_signature').closest('.control-group').hide();
|
||||
// remove required attribute from signature field
|
||||
if (!jform_vvvvwcfvxy_required)
|
||||
{
|
||||
updateFieldRequired('signature',1);
|
||||
jQuery('#jform_signature').removeAttr('required');
|
||||
jQuery('#jform_signature').removeAttr('aria-required');
|
||||
jQuery('#jform_signature').removeClass('required');
|
||||
jform_vvvvwcfvxy_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwcf Some function
|
||||
function protocol_vvvvwcf_SomeFunc(protocol_vvvvwcf)
|
||||
// the vvvvwce Some function
|
||||
function authentication_vvvvwce_SomeFunc(authentication_vvvvwce)
|
||||
{
|
||||
// set the function logic
|
||||
if (protocol_vvvvwcf == 1)
|
||||
if (authentication_vvvvwce == 1 || authentication_vvvvwce == 3 || authentication_vvvvwce == 5)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -272,28 +351,28 @@ function vvvvwcg(protocol_vvvvwcg,authentication_vvvvwcg)
|
||||
// set this function logic
|
||||
if (protocol && authentication)
|
||||
{
|
||||
jQuery('#jform_password').closest('.control-group').show();
|
||||
// add required attribute to password field
|
||||
if (jform_vvvvwcgvxz_required)
|
||||
jQuery('#jform_private').closest('.control-group').show();
|
||||
// add required attribute to private field
|
||||
if (jform_vvvvwcgvxt_required)
|
||||
{
|
||||
updateFieldRequired('password',0);
|
||||
jQuery('#jform_password').prop('required','required');
|
||||
jQuery('#jform_password').attr('aria-required',true);
|
||||
jQuery('#jform_password').addClass('required');
|
||||
jform_vvvvwcgvxz_required = false;
|
||||
updateFieldRequired('private',0);
|
||||
jQuery('#jform_private').prop('required','required');
|
||||
jQuery('#jform_private').attr('aria-required',true);
|
||||
jQuery('#jform_private').addClass('required');
|
||||
jform_vvvvwcgvxt_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_password').closest('.control-group').hide();
|
||||
// remove required attribute from password field
|
||||
if (!jform_vvvvwcgvxz_required)
|
||||
jQuery('#jform_private').closest('.control-group').hide();
|
||||
// remove required attribute from private field
|
||||
if (!jform_vvvvwcgvxt_required)
|
||||
{
|
||||
updateFieldRequired('password',1);
|
||||
jQuery('#jform_password').removeAttr('required');
|
||||
jQuery('#jform_password').removeAttr('aria-required');
|
||||
jQuery('#jform_password').removeClass('required');
|
||||
jform_vvvvwcgvxz_required = true;
|
||||
updateFieldRequired('private',1);
|
||||
jQuery('#jform_private').removeAttr('required');
|
||||
jQuery('#jform_private').removeAttr('aria-required');
|
||||
jQuery('#jform_private').removeClass('required');
|
||||
jform_vvvvwcgvxt_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -313,7 +392,7 @@ function protocol_vvvvwcg_SomeFunc(protocol_vvvvwcg)
|
||||
function authentication_vvvvwcg_SomeFunc(authentication_vvvvwcg)
|
||||
{
|
||||
// set the function logic
|
||||
if (authentication_vvvvwcg == 1 || authentication_vvvvwcg == 3 || authentication_vvvvwcg == 5)
|
||||
if (authentication_vvvvwcg == 2 || authentication_vvvvwcg == 3)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -351,28 +430,28 @@ function vvvvwci(protocol_vvvvwci,authentication_vvvvwci)
|
||||
// set this function logic
|
||||
if (protocol && authentication)
|
||||
{
|
||||
jQuery('#jform_private').closest('.control-group').show();
|
||||
// add required attribute to private field
|
||||
if (jform_vvvvwcivya_required)
|
||||
jQuery('#jform_private_key').closest('.control-group').show();
|
||||
// add required attribute to private_key field
|
||||
if (jform_vvvvwcivxu_required)
|
||||
{
|
||||
updateFieldRequired('private',0);
|
||||
jQuery('#jform_private').prop('required','required');
|
||||
jQuery('#jform_private').attr('aria-required',true);
|
||||
jQuery('#jform_private').addClass('required');
|
||||
jform_vvvvwcivya_required = false;
|
||||
updateFieldRequired('private_key',0);
|
||||
jQuery('#jform_private_key').prop('required','required');
|
||||
jQuery('#jform_private_key').attr('aria-required',true);
|
||||
jQuery('#jform_private_key').addClass('required');
|
||||
jform_vvvvwcivxu_required = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_private').closest('.control-group').hide();
|
||||
// remove required attribute from private field
|
||||
if (!jform_vvvvwcivya_required)
|
||||
jQuery('#jform_private_key').closest('.control-group').hide();
|
||||
// remove required attribute from private_key field
|
||||
if (!jform_vvvvwcivxu_required)
|
||||
{
|
||||
updateFieldRequired('private',1);
|
||||
jQuery('#jform_private').removeAttr('required');
|
||||
jQuery('#jform_private').removeAttr('aria-required');
|
||||
jQuery('#jform_private').removeClass('required');
|
||||
jform_vvvvwcivya_required = true;
|
||||
updateFieldRequired('private_key',1);
|
||||
jQuery('#jform_private_key').removeAttr('required');
|
||||
jQuery('#jform_private_key').removeAttr('aria-required');
|
||||
jQuery('#jform_private_key').removeClass('required');
|
||||
jform_vvvvwcivxu_required = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -392,7 +471,7 @@ function protocol_vvvvwci_SomeFunc(protocol_vvvvwci)
|
||||
function authentication_vvvvwci_SomeFunc(authentication_vvvvwci)
|
||||
{
|
||||
// set the function logic
|
||||
if (authentication_vvvvwci == 2 || authentication_vvvvwci == 3)
|
||||
if (authentication_vvvvwci == 4 || authentication_vvvvwci == 5)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -430,29 +509,11 @@ function vvvvwck(protocol_vvvvwck,authentication_vvvvwck)
|
||||
// set this function logic
|
||||
if (protocol && authentication)
|
||||
{
|
||||
jQuery('#jform_private_key').closest('.control-group').show();
|
||||
// add required attribute to private_key field
|
||||
if (jform_vvvvwckvyb_required)
|
||||
{
|
||||
updateFieldRequired('private_key',0);
|
||||
jQuery('#jform_private_key').prop('required','required');
|
||||
jQuery('#jform_private_key').attr('aria-required',true);
|
||||
jQuery('#jform_private_key').addClass('required');
|
||||
jform_vvvvwckvyb_required = false;
|
||||
}
|
||||
jQuery('#jform_secret').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_private_key').closest('.control-group').hide();
|
||||
// remove required attribute from private_key field
|
||||
if (!jform_vvvvwckvyb_required)
|
||||
{
|
||||
updateFieldRequired('private_key',1);
|
||||
jQuery('#jform_private_key').removeAttr('required');
|
||||
jQuery('#jform_private_key').removeAttr('aria-required');
|
||||
jQuery('#jform_private_key').removeClass('required');
|
||||
jform_vvvvwckvyb_required = true;
|
||||
}
|
||||
jQuery('#jform_secret').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -471,68 +532,7 @@ function protocol_vvvvwck_SomeFunc(protocol_vvvvwck)
|
||||
function authentication_vvvvwck_SomeFunc(authentication_vvvvwck)
|
||||
{
|
||||
// set the function logic
|
||||
if (authentication_vvvvwck == 4 || authentication_vvvvwck == 5)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwcm function
|
||||
function vvvvwcm(protocol_vvvvwcm,authentication_vvvvwcm)
|
||||
{
|
||||
if (isSet(protocol_vvvvwcm) && protocol_vvvvwcm.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwcm = protocol_vvvvwcm;
|
||||
var protocol_vvvvwcm = [];
|
||||
protocol_vvvvwcm.push(temp_vvvvwcm);
|
||||
}
|
||||
else if (!isSet(protocol_vvvvwcm))
|
||||
{
|
||||
var protocol_vvvvwcm = [];
|
||||
}
|
||||
var protocol = protocol_vvvvwcm.some(protocol_vvvvwcm_SomeFunc);
|
||||
|
||||
if (isSet(authentication_vvvvwcm) && authentication_vvvvwcm.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvwcm = authentication_vvvvwcm;
|
||||
var authentication_vvvvwcm = [];
|
||||
authentication_vvvvwcm.push(temp_vvvvwcm);
|
||||
}
|
||||
else if (!isSet(authentication_vvvvwcm))
|
||||
{
|
||||
var authentication_vvvvwcm = [];
|
||||
}
|
||||
var authentication = authentication_vvvvwcm.some(authentication_vvvvwcm_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
if (protocol && authentication)
|
||||
{
|
||||
jQuery('#jform_secret').closest('.control-group').show();
|
||||
}
|
||||
else
|
||||
{
|
||||
jQuery('#jform_secret').closest('.control-group').hide();
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvwcm Some function
|
||||
function protocol_vvvvwcm_SomeFunc(protocol_vvvvwcm)
|
||||
{
|
||||
// set the function logic
|
||||
if (protocol_vvvvwcm == 2)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// the vvvvwcm Some function
|
||||
function authentication_vvvvwcm_SomeFunc(authentication_vvvvwcm)
|
||||
{
|
||||
// set the function logic
|
||||
if (authentication_vvvvwcm == 2 || authentication_vvvvwcm == 3 || authentication_vvvvwcm == 4 || authentication_vvvvwcm == 5)
|
||||
if (authentication_vvvvwck == 2 || authentication_vvvvwck == 3 || authentication_vvvvwck == 4 || authentication_vvvvwck == 5)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@@ -11,45 +11,45 @@
|
||||
// Initial Script
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var add_php_view_vvvvvyt = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvvyt(add_php_view_vvvvvyt);
|
||||
var add_php_view_vvvvvyr = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvvyr(add_php_view_vvvvvyr);
|
||||
|
||||
var add_php_jview_display_vvvvvyu = jQuery("#jform_add_php_jview_display input[type='radio']:checked").val();
|
||||
vvvvvyu(add_php_jview_display_vvvvvyu);
|
||||
var add_php_jview_display_vvvvvys = jQuery("#jform_add_php_jview_display input[type='radio']:checked").val();
|
||||
vvvvvys(add_php_jview_display_vvvvvys);
|
||||
|
||||
var add_php_jview_vvvvvyv = jQuery("#jform_add_php_jview input[type='radio']:checked").val();
|
||||
vvvvvyv(add_php_jview_vvvvvyv);
|
||||
var add_php_jview_vvvvvyt = jQuery("#jform_add_php_jview input[type='radio']:checked").val();
|
||||
vvvvvyt(add_php_jview_vvvvvyt);
|
||||
|
||||
var add_php_document_vvvvvyw = jQuery("#jform_add_php_document input[type='radio']:checked").val();
|
||||
vvvvvyw(add_php_document_vvvvvyw);
|
||||
var add_php_document_vvvvvyu = jQuery("#jform_add_php_document input[type='radio']:checked").val();
|
||||
vvvvvyu(add_php_document_vvvvvyu);
|
||||
|
||||
var add_css_document_vvvvvyx = jQuery("#jform_add_css_document input[type='radio']:checked").val();
|
||||
vvvvvyx(add_css_document_vvvvvyx);
|
||||
var add_css_document_vvvvvyv = jQuery("#jform_add_css_document input[type='radio']:checked").val();
|
||||
vvvvvyv(add_css_document_vvvvvyv);
|
||||
|
||||
var add_javascript_file_vvvvvyy = jQuery("#jform_add_javascript_file input[type='radio']:checked").val();
|
||||
vvvvvyy(add_javascript_file_vvvvvyy);
|
||||
var add_javascript_file_vvvvvyw = jQuery("#jform_add_javascript_file input[type='radio']:checked").val();
|
||||
vvvvvyw(add_javascript_file_vvvvvyw);
|
||||
|
||||
var add_js_document_vvvvvyz = jQuery("#jform_add_js_document input[type='radio']:checked").val();
|
||||
vvvvvyz(add_js_document_vvvvvyz);
|
||||
var add_js_document_vvvvvyx = jQuery("#jform_add_js_document input[type='radio']:checked").val();
|
||||
vvvvvyx(add_js_document_vvvvvyx);
|
||||
|
||||
var add_css_vvvvvza = jQuery("#jform_add_css input[type='radio']:checked").val();
|
||||
vvvvvza(add_css_vvvvvza);
|
||||
var add_css_vvvvvyy = jQuery("#jform_add_css input[type='radio']:checked").val();
|
||||
vvvvvyy(add_css_vvvvvyy);
|
||||
|
||||
var add_php_ajax_vvvvvzb = jQuery("#jform_add_php_ajax input[type='radio']:checked").val();
|
||||
vvvvvzb(add_php_ajax_vvvvvzb);
|
||||
var add_php_ajax_vvvvvyz = jQuery("#jform_add_php_ajax input[type='radio']:checked").val();
|
||||
vvvvvyz(add_php_ajax_vvvvvyz);
|
||||
|
||||
var add_custom_button_vvvvvzc = jQuery("#jform_add_custom_button input[type='radio']:checked").val();
|
||||
vvvvvzc(add_custom_button_vvvvvzc);
|
||||
var add_custom_button_vvvvvza = jQuery("#jform_add_custom_button input[type='radio']:checked").val();
|
||||
vvvvvza(add_custom_button_vvvvvza);
|
||||
|
||||
var button_position_vvvvvzd = jQuery("#jform_button_position").val();
|
||||
vvvvvzd(button_position_vvvvvzd);
|
||||
var button_position_vvvvvzb = jQuery("#jform_button_position").val();
|
||||
vvvvvzb(button_position_vvvvvzb);
|
||||
});
|
||||
|
||||
// the vvvvvyt function
|
||||
function vvvvvyt(add_php_view_vvvvvyt)
|
||||
// the vvvvvyr function
|
||||
function vvvvvyr(add_php_view_vvvvvyr)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_view_vvvvvyt == 1)
|
||||
if (add_php_view_vvvvvyr == 1)
|
||||
{
|
||||
jQuery('#jform_php_view-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -59,11 +59,11 @@ function vvvvvyt(add_php_view_vvvvvyt)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyu function
|
||||
function vvvvvyu(add_php_jview_display_vvvvvyu)
|
||||
// the vvvvvys function
|
||||
function vvvvvys(add_php_jview_display_vvvvvys)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_jview_display_vvvvvyu == 1)
|
||||
if (add_php_jview_display_vvvvvys == 1)
|
||||
{
|
||||
jQuery('#jform_php_jview_display-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -73,11 +73,11 @@ function vvvvvyu(add_php_jview_display_vvvvvyu)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyv function
|
||||
function vvvvvyv(add_php_jview_vvvvvyv)
|
||||
// the vvvvvyt function
|
||||
function vvvvvyt(add_php_jview_vvvvvyt)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_jview_vvvvvyv == 1)
|
||||
if (add_php_jview_vvvvvyt == 1)
|
||||
{
|
||||
jQuery('#jform_php_jview-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -87,11 +87,11 @@ function vvvvvyv(add_php_jview_vvvvvyv)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyw function
|
||||
function vvvvvyw(add_php_document_vvvvvyw)
|
||||
// the vvvvvyu function
|
||||
function vvvvvyu(add_php_document_vvvvvyu)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_document_vvvvvyw == 1)
|
||||
if (add_php_document_vvvvvyu == 1)
|
||||
{
|
||||
jQuery('#jform_php_document-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -101,11 +101,11 @@ function vvvvvyw(add_php_document_vvvvvyw)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyx function
|
||||
function vvvvvyx(add_css_document_vvvvvyx)
|
||||
// the vvvvvyv function
|
||||
function vvvvvyv(add_css_document_vvvvvyv)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_css_document_vvvvvyx == 1)
|
||||
if (add_css_document_vvvvvyv == 1)
|
||||
{
|
||||
jQuery('#jform_css_document-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -115,11 +115,11 @@ function vvvvvyx(add_css_document_vvvvvyx)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyy function
|
||||
function vvvvvyy(add_javascript_file_vvvvvyy)
|
||||
// the vvvvvyw function
|
||||
function vvvvvyw(add_javascript_file_vvvvvyw)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_javascript_file_vvvvvyy == 1)
|
||||
if (add_javascript_file_vvvvvyw == 1)
|
||||
{
|
||||
jQuery('#jform_javascript_file-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -129,11 +129,11 @@ function vvvvvyy(add_javascript_file_vvvvvyy)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvyz function
|
||||
function vvvvvyz(add_js_document_vvvvvyz)
|
||||
// the vvvvvyx function
|
||||
function vvvvvyx(add_js_document_vvvvvyx)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_js_document_vvvvvyz == 1)
|
||||
if (add_js_document_vvvvvyx == 1)
|
||||
{
|
||||
jQuery('#jform_js_document-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -143,11 +143,11 @@ function vvvvvyz(add_js_document_vvvvvyz)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvza function
|
||||
function vvvvvza(add_css_vvvvvza)
|
||||
// the vvvvvyy function
|
||||
function vvvvvyy(add_css_vvvvvyy)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_css_vvvvvza == 1)
|
||||
if (add_css_vvvvvyy == 1)
|
||||
{
|
||||
jQuery('#jform_css-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -157,11 +157,11 @@ function vvvvvza(add_css_vvvvvza)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvzb function
|
||||
function vvvvvzb(add_php_ajax_vvvvvzb)
|
||||
// the vvvvvyz function
|
||||
function vvvvvyz(add_php_ajax_vvvvvyz)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_ajax_vvvvvzb == 1)
|
||||
if (add_php_ajax_vvvvvyz == 1)
|
||||
{
|
||||
jQuery('#jform_ajax_input-lbl').closest('.control-group').show();
|
||||
jQuery('#jform_php_ajaxmethod-lbl').closest('.control-group').show();
|
||||
@@ -173,11 +173,11 @@ function vvvvvzb(add_php_ajax_vvvvvzb)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvzc function
|
||||
function vvvvvzc(add_custom_button_vvvvvzc)
|
||||
// the vvvvvza function
|
||||
function vvvvvza(add_custom_button_vvvvvza)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_custom_button_vvvvvzc == 1)
|
||||
if (add_custom_button_vvvvvza == 1)
|
||||
{
|
||||
jQuery('#jform_custom_button-lbl').closest('.control-group').show();
|
||||
jQuery('#jform_php_controller-lbl').closest('.control-group').show();
|
||||
@@ -191,20 +191,20 @@ function vvvvvzc(add_custom_button_vvvvvzc)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvzd function
|
||||
function vvvvvzd(button_position_vvvvvzd)
|
||||
// the vvvvvzb function
|
||||
function vvvvvzb(button_position_vvvvvzb)
|
||||
{
|
||||
if (isSet(button_position_vvvvvzd) && button_position_vvvvvzd.constructor !== Array)
|
||||
if (isSet(button_position_vvvvvzb) && button_position_vvvvvzb.constructor !== Array)
|
||||
{
|
||||
var temp_vvvvvzd = button_position_vvvvvzd;
|
||||
var button_position_vvvvvzd = [];
|
||||
button_position_vvvvvzd.push(temp_vvvvvzd);
|
||||
var temp_vvvvvzb = button_position_vvvvvzb;
|
||||
var button_position_vvvvvzb = [];
|
||||
button_position_vvvvvzb.push(temp_vvvvvzb);
|
||||
}
|
||||
else if (!isSet(button_position_vvvvvzd))
|
||||
else if (!isSet(button_position_vvvvvzb))
|
||||
{
|
||||
var button_position_vvvvvzd = [];
|
||||
var button_position_vvvvvzb = [];
|
||||
}
|
||||
var button_position = button_position_vvvvvzd.some(button_position_vvvvvzd_SomeFunc);
|
||||
var button_position = button_position_vvvvvzb.some(button_position_vvvvvzb_SomeFunc);
|
||||
|
||||
|
||||
// set this function logic
|
||||
@@ -218,11 +218,11 @@ function vvvvvzd(button_position_vvvvvzd)
|
||||
}
|
||||
}
|
||||
|
||||
// the vvvvvzd Some function
|
||||
function button_position_vvvvvzd_SomeFunc(button_position_vvvvvzd)
|
||||
// the vvvvvzb Some function
|
||||
function button_position_vvvvvzb_SomeFunc(button_position_vvvvvzb)
|
||||
{
|
||||
// set the function logic
|
||||
if (button_position_vvvvvzd == 5)
|
||||
if (button_position_vvvvvzb == 5)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -249,8 +249,11 @@ jQuery(document).ready(function()
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
if (token.length > 0 && getCodeFrom_isValidId(id) && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
} else {
|
||||
console.error('There was a issue with the values passed to the [getCodeFrom_server] method and we could not make the Ajax call.');
|
||||
return;
|
||||
}
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
@@ -270,6 +273,17 @@ function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
function getCodeFrom_isValidId(id) {
|
||||
if (typeof id === 'number') {
|
||||
// Check if it's a positive integer
|
||||
return Number.isInteger(id) && id > 0;
|
||||
} else if (typeof id === 'string') {
|
||||
// Check if it's a string of length > 30
|
||||
return id.length > 30;
|
||||
}
|
||||
// If neither a number nor a string, return false
|
||||
return false;
|
||||
}
|
||||
|
||||
function getLinked() {
|
||||
getCodeFrom_server(1, 'type', 'type', 'getLinked').then(function(result) {
|
||||
@@ -316,69 +330,99 @@ function getSnippetDetails(id){
|
||||
})
|
||||
}
|
||||
|
||||
function getDynamicValues_server(dynamicId){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json");
|
||||
if(token.length > 0 && dynamicId > 0){
|
||||
var request = token+'=1&view=site_view&id='+dynamicId;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'jsonp',
|
||||
data: request,
|
||||
jsonp: 'callback'
|
||||
});
|
||||
function getDynamicValuesServer(dynamicId) {
|
||||
var getUrl = 'index.php?option=com_componentbuilder&task=ajax.getDynamicValues&raw=true&format=json';
|
||||
if (token.length > 0 && (dynamicId > 0 || dynamicId.length > 0)) {
|
||||
var request = token + '=1&view=site_view&id=' + dynamicId;
|
||||
}
|
||||
|
||||
return fetch(getUrl + '&' + request, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
}
|
||||
})
|
||||
.then(response => response.json());
|
||||
}
|
||||
|
||||
function getDynamicValues(id){
|
||||
getDynamicValues_server(id).done(function(result) {
|
||||
if(result){
|
||||
jQuery('#dynamic_values').remove();
|
||||
jQuery('.dynamic_values').append('<div id="dynamic_values">'+result+'</div>');
|
||||
// make sure the code bocks are active
|
||||
jQuery("code").click(function() {
|
||||
jQuery(this).selText().addClass("selected");
|
||||
});
|
||||
}
|
||||
})
|
||||
function getDynamicValues(id) {
|
||||
getDynamicValuesServer(id).then(function(result) {
|
||||
if (result) {
|
||||
var dynamicValuesElement = document.getElementById('dynamic_values');
|
||||
if (dynamicValuesElement) {
|
||||
dynamicValuesElement.remove();
|
||||
}
|
||||
document.querySelector('.dynamic_values').insertAdjacentHTML('beforeend', '<div id="dynamic_values">' + result + '</div>');
|
||||
|
||||
// Event listener for code blocks
|
||||
document.querySelectorAll("code").forEach(function(codeBlock) {
|
||||
codeBlock.addEventListener("click", function() {
|
||||
codeBlock.selText(); // Call the custom selText function
|
||||
codeBlock.classList.add("selected"); // Add the "selected" class
|
||||
});
|
||||
});
|
||||
}
|
||||
}).catch(function(error) {
|
||||
console.error('Error fetching dynamic values:', error);
|
||||
});
|
||||
}
|
||||
|
||||
function getLayoutDetails_server(id){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'jsonp',
|
||||
data: request,
|
||||
jsonp: 'callback'
|
||||
});
|
||||
function getLayoutDetails_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json&raw=true&vdm=" + vastDevMod);
|
||||
var request = '';
|
||||
|
||||
// Ensure token and id are present
|
||||
if (token.length > 0 && id > 0) {
|
||||
request = token + '=1&id=' + id;
|
||||
}
|
||||
|
||||
// Return a fetch promise (fetch does not support JSONP, so I assume the server can return JSON)
|
||||
return fetch(getUrl + '&' + request, {
|
||||
method: 'GET'
|
||||
})
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
throw new Error("Network response was not ok");
|
||||
}
|
||||
return response.json(); // Assuming the server returns JSON
|
||||
});
|
||||
}
|
||||
|
||||
function getLayoutDetails(id){
|
||||
getLayoutDetails_server(id).done(function(result) {
|
||||
if(result){
|
||||
jQuery('#details').append(result);
|
||||
// make sure the code bocks are active
|
||||
jQuery("code").click(function() {
|
||||
jQuery(this).selText().addClass("selected");
|
||||
});
|
||||
}
|
||||
})
|
||||
function getLayoutDetails(id) {
|
||||
getLayoutDetails_server(id)
|
||||
.then(function(result) {
|
||||
if (result) {
|
||||
document.querySelector('#details').insertAdjacentHTML('beforeend', result);
|
||||
|
||||
// Re-enable code block text selection functionality
|
||||
document.querySelectorAll("code").forEach(function(codeBlock) {
|
||||
codeBlock.addEventListener("click", function() {
|
||||
codeBlock.selText();
|
||||
codeBlock.classList.add("selected");
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getTemplateDetails(id){
|
||||
getCodeFrom_server(id, 'type', 'type', 'templateDetails').then(function(result) {
|
||||
if(result){
|
||||
jQuery('#details').append(result);
|
||||
// make sure the code bocks are active
|
||||
jQuery("code").click(function() {
|
||||
jQuery(this).selText().addClass("selected");
|
||||
});
|
||||
}
|
||||
})
|
||||
function getTemplateDetails(id) {
|
||||
getCodeFrom_server(id, 'type', 'type', 'templateDetails').then(function(result) {
|
||||
if (result) {
|
||||
document.querySelector('#details').insertAdjacentHTML('beforeend', result);
|
||||
|
||||
// Re-enable code block text selection functionality
|
||||
document.querySelectorAll("code").forEach(function(codeBlock) {
|
||||
codeBlock.addEventListener("click", function() {
|
||||
codeBlock.selText();
|
||||
codeBlock.classList.add("selected");
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// set snippets that are on the page
|
||||
@@ -476,12 +520,16 @@ function getEditCustomCodeButtons() {
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
if (insertBeforeElement) {
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
}
|
||||
|
||||
// Adding buttons to the div
|
||||
Object.entries(buttons).forEach(([name, button]) => {
|
||||
const controlsDiv = document.querySelector(".control-customcode-buttons-"+field);
|
||||
controlsDiv.innerHTML += button;
|
||||
if (controlsDiv) {
|
||||
controlsDiv.innerHTML += button;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@@ -11,15 +11,15 @@
|
||||
// Initial Script
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var add_php_view_vvvvvze = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvvze(add_php_view_vvvvvze);
|
||||
var add_php_view_vvvvvzc = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvvzc(add_php_view_vvvvvzc);
|
||||
});
|
||||
|
||||
// the vvvvvze function
|
||||
function vvvvvze(add_php_view_vvvvvze)
|
||||
// the vvvvvzc function
|
||||
function vvvvvzc(add_php_view_vvvvvzc)
|
||||
{
|
||||
// set the function logic
|
||||
if (add_php_view_vvvvvze == 1)
|
||||
if (add_php_view_vvvvvzc == 1)
|
||||
{
|
||||
jQuery('#jform_php_view-lbl').closest('.control-group').show();
|
||||
}
|
||||
@@ -39,16 +39,18 @@ function isSet(val)
|
||||
}
|
||||
|
||||
|
||||
jQuery(document).ready(function($)
|
||||
{
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
// check and load all the custom code edit buttons
|
||||
getEditCustomCodeButtons();
|
||||
});
|
||||
|
||||
function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
var url = "index.php?option=com_componentbuilder&task=ajax." + callingName + "&format=json&raw=true&vdm="+vastDevMod;
|
||||
if (token.length > 0 && id > 0 && type.length > 0) {
|
||||
if (token.length > 0 && getCodeFrom_isValidId(id) && type.length > 0) {
|
||||
url += '&' + token + '=1&' + type_name + '=' + type + '&id=' + id;
|
||||
} else {
|
||||
console.error('There was a issue with the values passed to the [getCodeFrom_server] method and we could not make the Ajax call.');
|
||||
return;
|
||||
}
|
||||
var getUrl = JRouter(url);
|
||||
return fetch(getUrl, {
|
||||
@@ -68,6 +70,17 @@ function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
function getCodeFrom_isValidId(id) {
|
||||
if (typeof id === 'number') {
|
||||
// Check if it's a positive integer
|
||||
return Number.isInteger(id) && id > 0;
|
||||
} else if (typeof id === 'string') {
|
||||
// Check if it's a string of length > 30
|
||||
return id.length > 30;
|
||||
}
|
||||
// If neither a number nor a string, return false
|
||||
return false;
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
@@ -105,12 +118,16 @@ function getEditCustomCodeButtons() {
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
if (insertBeforeElement) {
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
}
|
||||
|
||||
// Adding buttons to the div
|
||||
Object.entries(buttons).forEach(([name, button]) => {
|
||||
const controlsDiv = document.querySelector(".control-customcode-buttons-"+field);
|
||||
controlsDiv.innerHTML += button;
|
||||
if (controlsDiv) {
|
||||
controlsDiv.innerHTML += button;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -154,69 +171,99 @@ function getSnippetDetails(id){
|
||||
})
|
||||
}
|
||||
|
||||
function getDynamicValues_server(dynamicId){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getDynamicValues&format=json");
|
||||
if(token.length > 0 && dynamicId > 0){
|
||||
var request = token+'=1&view=template&id='+dynamicId;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'jsonp',
|
||||
data: request,
|
||||
jsonp: 'callback'
|
||||
});
|
||||
function getDynamicValuesServer(dynamicId) {
|
||||
var getUrl = 'index.php?option=com_componentbuilder&task=ajax.getDynamicValues&raw=true&format=json';
|
||||
if (token.length > 0 && (dynamicId > 0 || dynamicId.length > 0)) {
|
||||
var request = token + '=1&view=template&id=' + dynamicId;
|
||||
}
|
||||
|
||||
return fetch(getUrl + '&' + request, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
}
|
||||
})
|
||||
.then(response => response.json());
|
||||
}
|
||||
|
||||
function getDynamicValues(id){
|
||||
getDynamicValues_server(id).done(function(result) {
|
||||
if(result){
|
||||
jQuery('#dynamic_values').remove();
|
||||
jQuery('.dynamic_values').append('<div id="dynamic_values">'+result+'</div>');
|
||||
// make sure the code bocks are active
|
||||
jQuery("code").click(function() {
|
||||
jQuery(this).selText().addClass("selected");
|
||||
});
|
||||
}
|
||||
})
|
||||
function getDynamicValues(id) {
|
||||
getDynamicValuesServer(id).then(function(result) {
|
||||
if (result) {
|
||||
var dynamicValuesElement = document.getElementById('dynamic_values');
|
||||
if (dynamicValuesElement) {
|
||||
dynamicValuesElement.remove();
|
||||
}
|
||||
document.querySelector('.dynamic_values').insertAdjacentHTML('beforeend', '<div id="dynamic_values">' + result + '</div>');
|
||||
|
||||
// Event listener for code blocks
|
||||
document.querySelectorAll("code").forEach(function(codeBlock) {
|
||||
codeBlock.addEventListener("click", function() {
|
||||
codeBlock.selText(); // Call the custom selText function
|
||||
codeBlock.classList.add("selected"); // Add the "selected" class
|
||||
});
|
||||
});
|
||||
}
|
||||
}).catch(function(error) {
|
||||
console.error('Error fetching dynamic values:', error);
|
||||
});
|
||||
}
|
||||
|
||||
function getLayoutDetails_server(id){
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'jsonp',
|
||||
data: request,
|
||||
jsonp: 'callback'
|
||||
});
|
||||
function getLayoutDetails_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getLayoutDetails&format=json&raw=true&vdm=" + vastDevMod);
|
||||
var request = '';
|
||||
|
||||
// Ensure token and id are present
|
||||
if (token.length > 0 && id > 0) {
|
||||
request = token + '=1&id=' + id;
|
||||
}
|
||||
|
||||
// Return a fetch promise (fetch does not support JSONP, so I assume the server can return JSON)
|
||||
return fetch(getUrl + '&' + request, {
|
||||
method: 'GET'
|
||||
})
|
||||
.then(function(response) {
|
||||
if (!response.ok) {
|
||||
throw new Error("Network response was not ok");
|
||||
}
|
||||
return response.json(); // Assuming the server returns JSON
|
||||
});
|
||||
}
|
||||
|
||||
function getLayoutDetails(id){
|
||||
getLayoutDetails_server(id).done(function(result) {
|
||||
if(result){
|
||||
jQuery('#details').append(result);
|
||||
// make sure the code bocks are active
|
||||
jQuery("code").click(function() {
|
||||
jQuery(this).selText().addClass("selected");
|
||||
});
|
||||
}
|
||||
})
|
||||
function getLayoutDetails(id) {
|
||||
getLayoutDetails_server(id)
|
||||
.then(function(result) {
|
||||
if (result) {
|
||||
document.querySelector('#details').insertAdjacentHTML('beforeend', result);
|
||||
|
||||
// Re-enable code block text selection functionality
|
||||
document.querySelectorAll("code").forEach(function(codeBlock) {
|
||||
codeBlock.addEventListener("click", function() {
|
||||
codeBlock.selText();
|
||||
codeBlock.classList.add("selected");
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(function(error) {
|
||||
console.error('There was a problem with the fetch operation:', error);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function getTemplateDetails(id){
|
||||
getCodeFrom_server(id, 'type', 'type', 'templateDetails').then(function(result) {
|
||||
if(result){
|
||||
jQuery('#details').append(result);
|
||||
// make sure the code bocks are active
|
||||
jQuery("code").click(function() {
|
||||
jQuery(this).selText().addClass("selected");
|
||||
});
|
||||
}
|
||||
})
|
||||
function getTemplateDetails(id) {
|
||||
getCodeFrom_server(id, 'type', 'type', 'templateDetails').then(function(result) {
|
||||
if (result) {
|
||||
document.querySelector('#details').insertAdjacentHTML('beforeend', result);
|
||||
|
||||
// Re-enable code block text selection functionality
|
||||
document.querySelectorAll("code").forEach(function(codeBlock) {
|
||||
codeBlock.addEventListener("click", function() {
|
||||
codeBlock.selText();
|
||||
codeBlock.classList.add("selected");
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// set snippets that are on the page
|
||||
|
@@ -133,12 +133,16 @@ function getEditCustomCodeButtons() {
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
if (insertBeforeElement) {
|
||||
insertBeforeElement.parentNode.insertBefore(div, insertBeforeElement);
|
||||
}
|
||||
|
||||
// Adding buttons to the div
|
||||
Object.entries(buttons).forEach(([name, button]) => {
|
||||
const controlsDiv = document.querySelector(".control-customcode-buttons-"+field);
|
||||
controlsDiv.innerHTML += button;
|
||||
if (controlsDiv) {
|
||||
controlsDiv.innerHTML += button;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user