Release of v4.1.3

This commit is contained in:
Robot committed 2026-02-18 14:46:55 +00:00
1 parent a5389f9f8b
commit ca2fcc91bd
948 files changed
+64221 -52727

No files matched your search

+120 -47
View File
@@ -36,60 +36,124 @@ $noticeboardOptions = ['vdm', 'pro'];
?>
<?php if ($this->canDo->get('compiler.access')): ?>
<script type="text/javascript">
Joomla.submitbutton = function(task) {
if (task === 'compiler.back') {
parent.history.back();
return false;
} else {
var form = document.getElementById('adminForm');
form.task.value = task;
form.submit();
}
}
</script>
<script type="text/javascript">
Joomla.submitbutton = function(task, key) {
if (task === '') {
/**
* Enhanced Joomla submit button handler for the compiler interface.
*
* Handles form submission tasks safely with DOM validation,
* smooth UI transitions, and contextual loading states.
*
* @param {string} task The Joomla task to perform.
* @param {string} [key] Optional key for install-related tasks.
*
* @return {boolean} Returns true if the form submission proceeds, false otherwise.
* @since 5.1.3
*/
Joomla.submitbutton = function (task, key = '') {
// Abort early if task is not provided
if (!task) {
console.warn('Joomla.submitbutton: No task provided.');
return false;
} else {
var component = document.getElementById('component_id').value;
var isValid = true;
}
if (component === '' && task === 'compiler.compiler') {
isValid = false;
}
if (isValid) {
document.getElementById('form').style.display = 'none';
var form = document.getElementById('adminForm');
if (task === 'compiler.installCompiledModule' || task === 'compiler.installCompiledPlugin') {
form.install_item_id.value = key;
}
form.task.value = task;
setTimeout(function() {
form.submit();
}, 100);
const form = document.getElementById('adminForm');
if (!form) {
console.error('Joomla.submitbutton: #adminForm not found.');
return false;
}
if (task === 'compiler.compiler') {
let component_name = document.querySelector("#component_id option:checked").textContent;
document.querySelectorAll(".component-name").forEach(elem => {
elem.textContent = component_name;
});
setTimeout(function() {
document.getElementById('compiler').style.display = 'block';
document.getElementById('compiling').style.display = 'block';
setTimeout(function() {
document.getElementById('compiler-spinner').style.display = 'block';
document.getElementById('compiler-notice').style.display = 'block';
}, 100);
}, 100);
} else if (task === 'compiler.clearTmp') {
document.getElementById('clear').style.display = 'block';
document.getElementById('loading').style.display = 'block';
} else if (task === 'compiler.getCompilerAnimations') {
document.getElementById('get-compiler-animations').style.display = 'block';
document.getElementById('loading').style.display = 'block';
} else {
document.getElementById('loading').style.display = 'block';
}
return true;
const componentField = document.getElementById('component_id');
const component = componentField ? componentField.value.trim() : '';
const isCompilerTask = task === 'compiler.compiler';
let isValid = true;
// Validate component selection for compilation
if (!component && isCompilerTask) {
isValid = false;
}
if (!isValid) {
document.querySelectorAll('.notice').forEach(elem => {
elem.style.display = 'block';
});
console.warn('Joomla.submitbutton: Component not selected.');
return false;
}
// Hide form while processing
const formContainer = document.getElementById('form');
if (formContainer) {
formContainer.style.display = 'none';
}
// Handle install tasks with key assignment
if (task === 'compiler.installCompiledModule' || task === 'compiler.installCompiledPlugin') {
if (form.install_item_id) {
form.install_item_id.value = key;
} else {
document.querySelectorAll('.notice').forEach(elem => {
elem.style.display = 'block';
});
return false;
console.warn('Joomla.submitbutton: install_item_id field not found.');
}
}
}
// Set the task and safely submit
form.task.value = task;
setTimeout(() => form.submit(), 100);
// UI update helper
const show = (id, delay = 0) => {
setTimeout(() => {
const el = document.getElementById(id);
if (el) el.style.display = 'block';
}, delay);
};
// Manage contextual UI loading animations
switch (task) {
case 'compiler.compiler': {
const selectedOption = document.querySelector('#component_id option:checked');
const componentName = selectedOption ? selectedOption.textContent.trim() : '';
document.querySelectorAll('.component-name').forEach(elem => {
elem.textContent = componentName;
});
show('compiler', 100);
show('compiling', 100);
show('compiler-spinner', 200);
show('compiler-notice', 200);
break;
}
case 'compiler.clearTmp':
show('clear');
show('loading');
break;
case 'compiler.getCompilerAnimations':
show('get-compiler-animations');
show('loading');
break;
default:
show('loading');
break;
}
return true;
};
// Add spindle-wheel for importations:
document.addEventListener('DOMContentLoaded', function() {
@@ -135,6 +199,14 @@ document.addEventListener('DOMContentLoaded', function() {
outerBodyDiv.appendChild(compilingDiv);
});
</script>
<?php if (empty($this->Components)): ?>
<?php echo $this->loadTemplate('nocomponentstocompile'); ?>
<form action="<?php echo Route::_('index.php?option=com_componentbuilder&view=compiler'); ?>"
method="post" name="adminForm" id="adminForm" class="form-validate" enctype="multipart/form-data">
<input type="hidden" name="task" value="" />
<?php echo Html::_('form.token'); ?>
</form>
<?php else: ?>
<div class="main-card p-md-3">
<?php if (StringHelper::check($this->SuccessMessage)): ?>
<div class="alert alert-success">
@@ -258,7 +330,8 @@ function JRouter(link) {
?>
return url+link;
}
</script>
</script>
<?php endif; ?>
<?php else: ?>
<h1><?php echo Text::_('COM_COMPONENTBUILDER_NO_ACCESS_GRANTED'); ?></h1>
<?php endif; ?>
@@ -0,0 +1,42 @@
<?php
/**
* @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
*/
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\HTML\HTMLHelper as Html;
// No direct access to this file
defined('_JEXEC') or die;
?>
<div class="container my-5">
<div class="p-5 bg-light border rounded-4 shadow-sm text-center position-relative overflow-hidden">
<div class="position-absolute top-0 start-0 w-100 h-100 bg-warning bg-opacity-10"></div>
<div class="position-relative">
<div class="mb-3">
<i class="bi bi-box-seam display-4 text-warning"></i>
</div>
<h3 class="fw-semibold mb-2"><?php echo Text::_('COM_COMPONENTBUILDER_NO_COMPONENTS_TO_COMPILE'); ?></h3>
<p class="lead text-muted mb-4">
<?php echo Text::_('COM_COMPONENTBUILDER_THERE_ARE_CURRENTLY_NO_COMPONENTS_AVAILABLE_FOR_COMPILATION'); ?><br>
<?php echo Text::_('COM_COMPONENTBUILDER_PLEASE_CREATE_ONE_OR_MORE_COMPONENTS_BEFORE_ATTEMPTING_TO_COMPILE'); ?>
</p>
<a href="index.php?option=com_componentbuilder&view=joomla_components" class="btn btn-primary btn-lg px-4">
<i class="bi bi-plus-circle me-2"></i>
<?php echo Text::_('COM_COMPONENTBUILDER_CREATE_A_COMPONENT'); ?>
</a>
</div>
</div>
<div class="mt-4">
<?php echo LayoutHelper::render('jcbnoticeboard', ['dankie' => $this->dankie]); ?>
</div>
</div>