Release of v4.1.0
Add [AllowDynamicProperties] in the base view class for J5. Move the _prepareDocument above the display call in the base view class. Remove all backward compatibility issues, so JCB will not need the [Backward Compatibility] plugin to run. Added new import powers for custom import of spreadsheets. Move the setDocument and _prepareDocument above the display in the site view and custom admin view. Update the trashhelper layout to work in Joomla 5. Add AllowDynamicProperties (Joomla 4+5) to view class to allow Custom Dynamic Get methods to work without issues. Fix Save failed issue in dynamicGet. #1148. Move all [TEXT, EDITOR, TEXTAREA] fields from [NOT NULL] to [NULL]. Add the DateHelper class and improve the date methods. Add simple SessionHelper class. Add first classes for the new import engine. Improve the [VDM Registry] to be Joomla Registry Compatible. Move all registries to the [VDM Registry] class. Fix Checked Out to be null and not 0. (#1194). Fix created_by, modified_by, checked_out fields in the compiler of the SQL. (#1194). Update all core date fields in table class. (#1188). Update created_by, modified_by, checked_out fields in table class. Implementation of the decentralized Super-Power CORE repository network. (#1190). Fix the noticeboard to display Llewellyn's Joomla Social feed. Started compiling JCB4 on Joomla 5 with PHP 8.2. Add init_defaults option for dynamic form selection setup (to int new items with default values dynamically). Update all JCB 4 tables to utf8mb4_unicode_ci collation if misaligned. Move all internal ID linking to GUID inside of JCB 4. Updated the admin-tab-fields in add-fields view. #1205. Remove Custom Import Tab from admin view. Improved the customcode and placeholder search features.
This commit is contained in:
@ -528,97 +528,6 @@ class ComponentbuilderModel extends ListModel
|
||||
}
|
||||
|
||||
|
||||
public function getNoticeboard()
|
||||
{
|
||||
// get the document to load the scripts
|
||||
$document = Factory::getDocument();
|
||||
Html::_('script', "media/com_componentbuilder/js/marked.js", ['version' => 'auto']);
|
||||
$document->addScriptDeclaration('
|
||||
var token = "' . Session::getFormToken() . '";
|
||||
var noticeboard = "https://vdm.bz/componentbuilder-noticeboard-md";
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
fetch(noticeboard)
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
throw new Error("Network response was not ok");
|
||||
}
|
||||
return response.text();
|
||||
})
|
||||
.then(board => {
|
||||
if (board.length > 5) {
|
||||
document.getElementById("noticeboard-md").innerHTML = marked.parse(board);
|
||||
getIS(1, board)
|
||||
.then(result => {
|
||||
if (result) {
|
||||
document.querySelectorAll("#cpanel_tabTabs a").forEach(link => {
|
||||
if (link.href.includes("#vast_development_method") || link.href.includes("#notice_board")) {
|
||||
var textVDM = link.textContent;
|
||||
link.innerHTML = "<span class=\"label label-important vdm-new-notice\">1</span> " + textVDM;
|
||||
link.id = "vdm-new-notice";
|
||||
document.getElementById("vdm-new-notice").addEventListener("click", () => {
|
||||
getIS(2, board)
|
||||
.then(result => {
|
||||
if (result) {
|
||||
document.querySelectorAll(".vdm-new-notice").forEach(element => {
|
||||
element.style.opacity = 0;
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
document.getElementById("noticeboard-md").innerHTML = "'.Text::_('COM_COMPONENTBUILDER_ALL_IS_GOOD_PLEASE_CHECK_AGAIN_LATER').'.";
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("There was an error!", error);
|
||||
document.getElementById("noticeboard-md").innerHTML = "'.Text::_('COM_COMPONENTBUILDER_ALL_IS_GOOD_PLEASE_CHECK_AGAIN_LATER').'.";
|
||||
});
|
||||
});
|
||||
|
||||
// to check is READ/NEW
|
||||
function getIS(type, notice) {
|
||||
let getUrl = "";
|
||||
if (type === 1) {
|
||||
getUrl = "index.php?option=com_componentbuilder&task=ajax.isNew&format=json&raw=true";
|
||||
} else if (type === 2) {
|
||||
getUrl = "index.php?option=com_componentbuilder&task=ajax.isRead&format=json&raw=true";
|
||||
}
|
||||
let request = new URLSearchParams();
|
||||
if (token.length > 0 && notice.length) {
|
||||
request.append(token, "1");
|
||||
request.append("notice", notice);
|
||||
}
|
||||
return fetch(getUrl, {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/x-www-form-urlencoded;charset=UTF-8"
|
||||
},
|
||||
body: request
|
||||
}).then(response => response.json());
|
||||
}
|
||||
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
document.querySelectorAll(".loading-dots").forEach(function(loading_dots) {
|
||||
let x = 0;
|
||||
let intervalId = setInterval(function() {
|
||||
if (!loading_dots.classList.contains("loading-dots")) {
|
||||
clearInterval(intervalId);
|
||||
return;
|
||||
}
|
||||
let dots = ".".repeat(x % 8);
|
||||
loading_dots.textContent = dots;
|
||||
x++;
|
||||
}, 500);
|
||||
});
|
||||
});');
|
||||
|
||||
return '<div id="noticeboard-md">'.Text::_('COM_COMPONENTBUILDER_THE_NOTICE_BOARD_IS_LOADING').'.<span class="loading-dots">.</span></small></div>';
|
||||
}
|
||||
|
||||
public function getReadme()
|
||||
{
|
||||
$document = Factory::getDocument();
|
||||
|
Reference in New Issue
Block a user