Stable release of v3.2.0-beta1
Move beta to main repo. Fix #1053 so that the right and left tabs display correctly in Joomla 4&5.
This commit is contained in:
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -40,4 +40,4 @@ function getFieldSelectOptions(fieldKey){
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -73,42 +73,53 @@ function _isSet(val)
|
||||
return false;
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -20,7 +20,7 @@ jform_vvvvwabvwq_required = false;
|
||||
jform_vvvvwabvwr_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var add_css_view_vvvvvyw = jQuery("#jform_add_css_view input[type='radio']:checked").val();
|
||||
vvvvvyw(add_css_view_vvvvvyw);
|
||||
@ -758,7 +758,7 @@ function vvvvwad(add_custom_button_vvvvwad)
|
||||
// update fields required
|
||||
function updateFieldRequired(name, status) {
|
||||
// check if not_required exist
|
||||
if (jQuery('#jform_not_required').length > 0) {
|
||||
if (document.getElementById('jform_not_required')) {
|
||||
var not_required = jQuery('#jform_not_required').val().split(",");
|
||||
|
||||
if(status == 1)
|
||||
@ -985,43 +985,54 @@ function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
||||
function addButtonID_server(type, size){
|
||||
@ -1082,4 +1093,4 @@ function getLinked(){
|
||||
jQuery('#display_linked_to').html(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -19,41 +19,52 @@ jQuery(document).ready(function()
|
||||
setTimeout(getEditCustomCodeButtons, 300);
|
||||
});
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
jform_vvvvwchvxk_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var extension_type_vvvvwch = jQuery("#jform_extension_type").val();
|
||||
vvvvwch(extension_type_vvvvwch);
|
||||
@ -77,7 +77,7 @@ function extension_type_vvvvwch_SomeFunc(extension_type_vvvvwch)
|
||||
// update fields required
|
||||
function updateFieldRequired(name, status) {
|
||||
// check if not_required exist
|
||||
if (jQuery('#jform_not_required').length > 0) {
|
||||
if (document.getElementById('jform_not_required')) {
|
||||
var not_required = jQuery('#jform_not_required').val().split(",");
|
||||
|
||||
if(status == 1)
|
||||
@ -134,41 +134,52 @@ jQuery(document).ready(function()
|
||||
setTimeout(getEditCustomCodeButtons, 300);
|
||||
});
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
@ -12,7 +12,7 @@
|
||||
jform_vvvvwcgvxj_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var extension_type_vvvvwcg = jQuery("#jform_extension_type").val();
|
||||
vvvvwcg(extension_type_vvvvwcg);
|
||||
@ -77,7 +77,7 @@ function extension_type_vvvvwcg_SomeFunc(extension_type_vvvvwcg)
|
||||
// update fields required
|
||||
function updateFieldRequired(name, status) {
|
||||
// check if not_required exist
|
||||
if (jQuery('#jform_not_required').length > 0) {
|
||||
if (document.getElementById('jform_not_required')) {
|
||||
var not_required = jQuery('#jform_not_required').val().split(",");
|
||||
|
||||
if(status == 1)
|
||||
@ -134,41 +134,52 @@ jQuery(document).ready(function()
|
||||
setTimeout(getEditCustomCodeButtons, 300);
|
||||
});
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -17,41 +17,52 @@ jQuery(document).ready(function()
|
||||
getEditCustomCodeButtons();
|
||||
});
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
67
media/js/component_router.js
Normal file
67
media/js/component_router.js
Normal file
@ -0,0 +1,67 @@
|
||||
/**
|
||||
* @package Joomla.Component.Builder
|
||||
*
|
||||
* @created 30th April, 2015
|
||||
* @author Llewellyn van der Merwe <https://dev.vdm.io>
|
||||
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
|
||||
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// check and load all the customcode edit buttons
|
||||
setTimeout(getEditCustomCodeButtons, 300);
|
||||
});
|
||||
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var add_php_view_vvvvwae = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvwae(add_php_view_vvvvwae);
|
||||
@ -397,41 +397,52 @@ function setSnippets(array){
|
||||
jQuery('#jform_snippet').trigger('liszt:updated');
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ jform_vvvvwcdvxh_required = false;
|
||||
jform_vvvvwcdvxi_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var target_vvvvwcc = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
vvvvwcc(target_vvvvwcc);
|
||||
@ -181,7 +181,7 @@ function vvvvwcf(type_vvvvwcf,target_vvvvwcf)
|
||||
// update fields required
|
||||
function updateFieldRequired(name, status) {
|
||||
// check if not_required exist
|
||||
if (jQuery('#jform_not_required').length > 0) {
|
||||
if (document.getElementById('jform_not_required')) {
|
||||
var not_required = jQuery('#jform_not_required').val().split(",");
|
||||
|
||||
if(status == 1)
|
||||
@ -372,41 +372,52 @@ function usedin_server(functioName, ide, target){
|
||||
}
|
||||
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ jform_vvvvwbyvxd_required = false;
|
||||
jform_vvvvwbzvxe_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var gettype_vvvvwbb = jQuery("#jform_gettype").val();
|
||||
vvvvwbb(gettype_vvvvwbb);
|
||||
@ -1352,7 +1352,7 @@ function gettype_vvvvwcb_SomeFunc(gettype_vvvvwcb)
|
||||
// update fields required
|
||||
function updateFieldRequired(name, status) {
|
||||
// check if not_required exist
|
||||
if (jQuery('#jform_not_required').length > 0) {
|
||||
if (document.getElementById('jform_not_required')) {
|
||||
var not_required = jQuery('#jform_not_required').val().split(",");
|
||||
|
||||
if(status == 1)
|
||||
@ -1609,43 +1609,54 @@ function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
||||
function getLinked(){
|
||||
@ -1654,4 +1665,4 @@ function getLinked(){
|
||||
jQuery('#display_linked_to').html(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -17,7 +17,7 @@ jform_vvvvwdgvxs_required = false;
|
||||
jform_vvvvwdgvxt_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var datalenght_vvvvwda = jQuery("#jform_datalenght").val();
|
||||
vvvvwda(datalenght_vvvvwda);
|
||||
@ -479,7 +479,7 @@ function vvvvwdk(add_javascript_views_footer_vvvvwdk)
|
||||
// update fields required
|
||||
function updateFieldRequired(name, status) {
|
||||
// check if not_required exist
|
||||
if (jQuery('#jform_not_required').length > 0) {
|
||||
if (document.getElementById('jform_not_required')) {
|
||||
var not_required = jQuery('#jform_not_required').val().split(",");
|
||||
|
||||
if(status == 1)
|
||||
@ -881,41 +881,52 @@ function addButton(type, where, size){
|
||||
})
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ jform_vvvvwdyvya_required = false;
|
||||
jform_vvvvwdyvyb_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var datalenght_vvvvwdl = jQuery("#jform_datalenght").val();
|
||||
var has_defaults_vvvvwdl = jQuery("#jform_has_defaults input[type='radio']:checked").val();
|
||||
@ -849,7 +849,7 @@ function vvvvwdy(has_defaults_vvvvwdy)
|
||||
// update fields required
|
||||
function updateFieldRequired(name, status) {
|
||||
// check if not_required exist
|
||||
if (jQuery('#jform_not_required').length > 0) {
|
||||
if (document.getElementById('jform_not_required')) {
|
||||
var not_required = jQuery('#jform_not_required').val().split(",");
|
||||
|
||||
if(status == 1)
|
||||
@ -904,41 +904,52 @@ jQuery(document).ready(function($)
|
||||
getEditCustomCodeButtons();
|
||||
});
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
@ -16,7 +16,7 @@ jform_vvvvwemvyq_required = false;
|
||||
jform_vvvvweovyr_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var location_vvvvwej = jQuery("#jform_location input[type='radio']:checked").val();
|
||||
vvvvwej(location_vvvvwej);
|
||||
@ -286,7 +286,7 @@ function vvvvweo(target_vvvvweo)
|
||||
// update fields required
|
||||
function updateFieldRequired(name, status) {
|
||||
// check if not_required exist
|
||||
if (jQuery('#jform_not_required').length > 0) {
|
||||
if (document.getElementById('jform_not_required')) {
|
||||
var not_required = jQuery('#jform_not_required').val().split(",");
|
||||
|
||||
if(status == 1)
|
||||
@ -332,4 +332,4 @@ function isSet(val)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ jform_vvvvvxavwb_required = false;
|
||||
jform_vvvvvxavwc_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var add_php_helper_admin_vvvvvvv = jQuery("#jform_add_php_helper_admin input[type='radio']:checked").val();
|
||||
vvvvvvv(add_php_helper_admin_vvvvvvv);
|
||||
@ -729,7 +729,7 @@ function translation_tool_vvvvvxa_SomeFunc(translation_tool_vvvvvxa)
|
||||
// update fields required
|
||||
function updateFieldRequired(name, status) {
|
||||
// check if not_required exist
|
||||
if (jQuery('#jform_not_required').length > 0) {
|
||||
if (document.getElementById('jform_not_required')) {
|
||||
var not_required = jQuery('#jform_not_required').val().split(",");
|
||||
|
||||
if(status == 1)
|
||||
@ -913,43 +913,54 @@ function dasboardSwitch(value){
|
||||
}
|
||||
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
||||
function addButtonID_server(type, size){
|
||||
@ -1002,4 +1013,4 @@ function addButton(type, where, size){
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ jform_vvvvvxsvwe_required = false;
|
||||
jform_vvvvvxtvwf_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var add_class_helper_vvvvvxb = jQuery("#jform_add_class_helper").val();
|
||||
vvvvvxb(add_class_helper_vvvvvxb);
|
||||
@ -479,7 +479,7 @@ function vvvvvxw(addreadme_vvvvvxw)
|
||||
// update fields required
|
||||
function updateFieldRequired(name, status) {
|
||||
// check if not_required exist
|
||||
if (jQuery('#jform_not_required').length > 0) {
|
||||
if (document.getElementById('jform_not_required')) {
|
||||
var not_required = jQuery('#jform_not_required').val().split(",");
|
||||
|
||||
if(status == 1)
|
||||
@ -672,43 +672,54 @@ function removeCodeFromEditor(code_string, editor_id){
|
||||
}
|
||||
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
||||
function getSnippetDetails(id){
|
||||
@ -803,4 +814,4 @@ function setSnippets(array){
|
||||
jQuery('#jform_snippet').append('<option value="">'+create_a_snippet+'</option>');
|
||||
}
|
||||
jQuery('#jform_snippet').trigger('liszt:updated');
|
||||
}
|
||||
}
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -14,7 +14,7 @@ jform_vvvvvyqvwh_required = false;
|
||||
jform_vvvvvyrvwi_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var class_extends_vvvvvxx = jQuery("#jform_class_extends").val();
|
||||
var joomla_plugin_group_vvvvvxx = jQuery("#jform_joomla_plugin_group").val();
|
||||
@ -615,7 +615,7 @@ function vvvvvyu(addreadme_vvvvvyu)
|
||||
// update fields required
|
||||
function updateFieldRequired(name, status) {
|
||||
// check if not_required exist
|
||||
if (jQuery('#jform_not_required').length > 0) {
|
||||
if (document.getElementById('jform_not_required')) {
|
||||
var not_required = jQuery('#jform_not_required').val().split(",");
|
||||
|
||||
if(status == 1)
|
||||
@ -1099,41 +1099,52 @@ function getLinked(){
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -45,4 +45,4 @@ function addButton(type, where, size){
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var add_php_view_vvvvwba = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvwba(add_php_view_vvvvwba);
|
||||
@ -69,43 +69,54 @@ function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
||||
function getSnippetDetails(id){
|
||||
@ -253,4 +264,4 @@ function setSnippets(array){
|
||||
jQuery('#jform_snippet').append('<option value="">'+create_a_snippet+'</option>');
|
||||
}
|
||||
jQuery('#jform_snippet').trigger('liszt:updated');
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ jform_vvvvwcyvxm_required = false;
|
||||
jform_vvvvwcyvxn_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var how_vvvvwci = jQuery("#jform_how").val();
|
||||
var target_vvvvwci = jQuery("#jform_target input[type='radio']:checked").val();
|
||||
@ -798,7 +798,7 @@ function vvvvwcz(target_vvvvwcz)
|
||||
// update fields required
|
||||
function updateFieldRequired(name, status) {
|
||||
// check if not_required exist
|
||||
if (jQuery('#jform_not_required').length > 0) {
|
||||
if (document.getElementById('jform_not_required')) {
|
||||
var not_required = jQuery('#jform_not_required').val().split(",");
|
||||
|
||||
if(status == 1)
|
||||
@ -911,43 +911,54 @@ function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
||||
function addButtonID_server(type, size){
|
||||
@ -1008,4 +1019,4 @@ function getLinked(){
|
||||
jQuery('#display_linked_to').html(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -120,4 +120,4 @@ function placedin_server(placeholder, ide, target){
|
||||
jsonp: false
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var add_head_vvvvvyv = jQuery("#jform_add_head input[type='radio']:checked").val();
|
||||
vvvvvyv(add_head_vvvvvyv);
|
||||
@ -39,8 +39,7 @@ function isSet(val)
|
||||
}
|
||||
|
||||
|
||||
jQuery(document).ready(function()
|
||||
{
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// get the linked details
|
||||
getLinked();
|
||||
// load the active array values
|
||||
@ -473,41 +472,52 @@ function getLinked(){
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ jform_vvvvwedvyk_required = false;
|
||||
jform_vvvvwefvyl_required = false;
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var protocol_vvvvwdz = jQuery("#jform_protocol").val();
|
||||
vvvvwdz(protocol_vvvvwdz);
|
||||
@ -542,7 +542,7 @@ function authentication_vvvvweh_SomeFunc(authentication_vvvvweh)
|
||||
// update fields required
|
||||
function updateFieldRequired(name, status) {
|
||||
// check if not_required exist
|
||||
if (jQuery('#jform_not_required').length > 0) {
|
||||
if (document.getElementById('jform_not_required')) {
|
||||
var not_required = jQuery('#jform_not_required').val().split(",");
|
||||
|
||||
if(status == 1)
|
||||
@ -588,4 +588,4 @@ function isSet(val)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var add_php_view_vvvvwao = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvwao(add_php_view_vvvvwao);
|
||||
@ -438,41 +438,52 @@ function setSnippets(array){
|
||||
jQuery('#jform_snippet').trigger('liszt:updated');
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -8,4 +8,4 @@
|
||||
* @license GNU General Public License version 2 or later; see LICENSE.txt
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
// Initial Script
|
||||
jQuery(document).ready(function()
|
||||
document.addEventListener('DOMContentLoaded', function()
|
||||
{
|
||||
var add_php_view_vvvvwaz = jQuery("#jform_add_php_view input[type='radio']:checked").val();
|
||||
vvvvwaz(add_php_view_vvvvwaz);
|
||||
@ -69,43 +69,54 @@ function getCodeFrom_server(id, type, type_name, callingName) {
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
||||
function getSnippetDetails(id){
|
||||
@ -265,4 +276,4 @@ function setSnippets(array){
|
||||
jQuery('#jform_snippet').append('<option value="">'+create_a_snippet+'</option>');
|
||||
}
|
||||
jQuery('#jform_snippet').trigger('liszt:updated');
|
||||
}
|
||||
}
|
||||
|
@ -97,41 +97,52 @@ function checkRuleName_server(ruleName, ide){
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons_server(id){
|
||||
function getEditCustomCodeButtons_server(id) {
|
||||
var getUrl = JRouter("index.php?option=com_componentbuilder&task=ajax.getEditCustomCodeButtons&format=json&raw=true&vdm="+vastDevMod);
|
||||
if(token.length > 0 && id > 0){
|
||||
var request = token+'=1&id='+id+'&return_here='+return_here;
|
||||
let requestParams = '';
|
||||
if (token.length > 0 && id > 0) {
|
||||
requestParams = token+'=1&id='+id+'&return_here='+return_here;
|
||||
}
|
||||
return jQuery.ajax({
|
||||
type: 'GET',
|
||||
url: getUrl,
|
||||
dataType: 'json',
|
||||
data: request,
|
||||
jsonp: false
|
||||
// Construct URL with parameters for GET request
|
||||
const urlWithParams = getUrl + '&' + requestParams;
|
||||
|
||||
// Using the Fetch API for the GET request
|
||||
return fetch(urlWithParams, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}).then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Network response was not ok');
|
||||
}
|
||||
return response.json();
|
||||
});
|
||||
}
|
||||
|
||||
function getEditCustomCodeButtons(){
|
||||
// get the id
|
||||
id = jQuery("#jform_id").val();
|
||||
getEditCustomCodeButtons_server(id).done(function(result) {
|
||||
if(isObject(result)){
|
||||
jQuery.each(result, function( field, buttons ) {
|
||||
jQuery('<div class="control-group"><div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div></div>').insertBefore(".control-wrapper-"+ field);
|
||||
jQuery.each(buttons, function( name, button ) {
|
||||
jQuery(".control-customcode-buttons-"+field).append(button);
|
||||
function getEditCustomCodeButtons() {
|
||||
// Get the id using pure JavaScript
|
||||
const id = document.querySelector("#jform_id").value;
|
||||
getEditCustomCodeButtons_server(id).then(function(result) {
|
||||
if (typeof result === 'object') {
|
||||
Object.entries(result).forEach(([field, buttons]) => {
|
||||
// Creating the div element for buttons
|
||||
const div = document.createElement('div');
|
||||
div.className = 'control-group';
|
||||
div.innerHTML = '<div class="control-label"><label>Add/Edit Customcode</label></div><div class="controls control-customcode-buttons-'+field+'"></div>';
|
||||
|
||||
// Insert the div before .control-wrapper-{field}
|
||||
const insertBeforeElement = document.querySelector(".control-wrapper-"+field);
|
||||
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;
|
||||
});
|
||||
});
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// check object is not empty
|
||||
function isObject(obj) {
|
||||
for(var prop in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, prop)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user