This commit is contained in:
AlexBa16
2026-06-08 15:29:52 +02:00
commit 27903eed4a
9931 changed files with 1535659 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
<!DOCTYPE html><title></title>
@@ -0,0 +1,21 @@
{
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
"name": "com_actionlogs",
"version": "4.0.0",
"description": "Joomla CMS",
"license": "GPL-2.0-or-later",
"assets": [
{
"name": "com_actionlogs.admin-actionlogs",
"type": "script",
"uri": "com_actionlogs/admin-actionlogs-default.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "3205a4"
}
]
}
@@ -0,0 +1,20 @@
/**
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
Joomla.submitbutton = task => {
if (task === 'actionlogs.exportLogs') {
Joomla.submitform(task, document.getElementById('exportForm'));
return;
}
if (task === 'actionlogs.exportSelectedLogs') {
// Get id of selected action logs item and pass it to export form hidden input
const cids = [];
document.querySelectorAll("input[name='cid[]']:checked").forEach(element => cids.push(element.value));
document.exportForm.cids.value = cids.join(',');
Joomla.submitform(task, document.getElementById('exportForm'));
return;
}
Joomla.submitform(task);
};
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/Joomla.submitbutton=o=>{if(o==="actionlogs.exportLogs"){Joomla.submitform(o,document.getElementById("exportForm"));return}if(o==="actionlogs.exportSelectedLogs"){const e=[];document.querySelectorAll("input[name='cid[]']:checked").forEach(t=>e.push(t.value)),document.exportForm.cids.value=e.join(","),Joomla.submitform(o,document.getElementById("exportForm"));return}Joomla.submitform(o)};
@@ -0,0 +1,21 @@
{
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
"name": "com_admin",
"version": "4.0.0",
"description": "Joomla CMS",
"license": "GPL-2.0-or-later",
"assets": [
{
"name": "com_admin.admin-help",
"type": "script",
"uri": "com_admin/admin-help.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "54d1ad"
}
]
}
@@ -0,0 +1,9 @@
/**
* @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
const helpIndex = document.getElementById('help-index');
if (helpIndex) {
helpIndex.querySelectorAll('a').forEach(element => element.addEventListener('click', () => window.scroll(0, 0)));
}
+4
View File
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/const helpIndex=document.getElementById("help-index");helpIndex&&helpIndex.querySelectorAll("a").forEach(e=>e.addEventListener("click",()=>window.scroll(0,0)));
Binary file not shown.
@@ -0,0 +1,62 @@
@charset "UTF-8";
.sidebyside .outer-panel {
float: inline-start;
width: 50%;
}
.sidebyside #left-panel .inner-panel, .sidebyside #right-panel .inner-panel {
padding-inline-end: 10px;
}
.sidebyside .full-width {
float: none !important;
width: 100% !important;
}
.sidebyside .full-width .inner-panel {
padding: 0 !important;
}
#reference-association, #target-association {
width: 100%;
height: 1500px;
overflow-y: auto;
border: 0 !important;
}
.sidebyside .langtarget {
float: inline-start;
}
.sidebyside .modaltarget {
float: inline-start;
margin-inline-start: .5rem;
}
.sidebyside #target-association {
margin-top: .5rem;
}
.sidebyside #reference-association {
margin-top: 3.35rem;
}
.target-text {
float: inline-start;
width: auto;
}
@media (width <= 767.98px) {
.sidebyside .outer-panel {
float: none;
width: 100%;
}
.sidebyside #reference-association {
margin-top: 0;
}
.sidebyside #left-panel .inner-panel, .sidebyside #right-panel .inner-panel {
padding: 0;
}
}
@@ -0,0 +1 @@
@charset "UTF-8";.sidebyside .outer-panel{float:inline-start;width:50%}.sidebyside #left-panel .inner-panel,.sidebyside #right-panel .inner-panel{padding-inline-end:10px}.sidebyside .full-width{float:none!important;width:100%!important}.sidebyside .full-width .inner-panel{padding:0!important}#reference-association,#target-association{width:100%;height:1500px;overflow-y:auto;border:0!important}.sidebyside .langtarget{float:inline-start}.sidebyside .modaltarget{float:inline-start;margin-inline-start:.5rem}.sidebyside #target-association{margin-top:.5rem}.sidebyside #reference-association{margin-top:3.35rem}.target-text{float:inline-start;width:auto}@media (width<=767.98px){.sidebyside .outer-panel{float:none;width:100%}.sidebyside #reference-association{margin-top:0}.sidebyside #left-panel .inner-panel,.sidebyside #right-panel .inner-panel{padding:0}}
@@ -0,0 +1,72 @@
{
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
"name": "com_associations",
"version": "4.0.0",
"description": "Joomla CMS",
"license": "GPL-2.0-or-later",
"assets": [
{
"name": "com_associations.sidebyside",
"type": "preset",
"dependencies": [
"com_associations.sidebyside#style",
"com_associations.sidebyside#script"
]
},
{
"name": "com_associations.admin-associations-default",
"type": "script",
"uri": "com_associations/admin-associations-default.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "72d110"
},
{
"name": "com_associations.admin-associations-modal",
"type": "script",
"uri": "com_associations/admin-associations-modal.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "14d673"
},
{
"name": "com_associations.associations-edit",
"type": "script",
"uri": "com_associations/associations-edit.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module",
"defer": true
},
"version": "2c1f61"
},
{
"name": "com_associations.sidebyside",
"type": "style",
"uri": "com_associations/sidebyside.min.css",
"version": "5da4fc"
},
{
"name": "com_associations.sidebyside",
"type": "script",
"uri": "com_associations/sidebyside.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "a057fe"
}
]
}
@@ -0,0 +1,16 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
Joomla.submitbutton = pressbutton => {
if (pressbutton === 'associations.purge') {
if (confirm(Joomla.Text._('COM_ASSOCIATIONS_PURGE_CONFIRM_PROMPT'))) {
Joomla.submitform(pressbutton);
} else {
return false;
}
} else {
Joomla.submitform(pressbutton);
}
return true;
};
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/Joomla.submitbutton=o=>{if(o==="associations.purge")if(confirm(Joomla.Text._("COM_ASSOCIATIONS_PURGE_CONFIRM_PROMPT")))Joomla.submitform(o);else return!1;else Joomla.submitform(o);return!0};
@@ -0,0 +1,20 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
Joomla = window.Joomla || {};
((Joomla, document) => {
document.addEventListener('DOMContentLoaded', () => {
const targetAssociation = window.parent.document.getElementById('target-association');
const links = [].slice.call(document.querySelectorAll('.select-link'));
links.forEach(item => {
item.addEventListener('click', ({
target
}) => {
targetAssociation.src = `${targetAssociation.getAttribute('data-editurl')}&task=${targetAssociation.getAttribute('data-item')}.edit&id=${parseInt(target.getAttribute('data-id'), 10)}`;
window.parent.Joomla.Modal.getCurrent().close();
});
});
});
})(Joomla, document);
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/Joomla=window.Joomla||{},((i,e)=>{e.addEventListener("DOMContentLoaded",()=>{const t=window.parent.document.getElementById("target-association");[].slice.call(e.querySelectorAll(".select-link")).forEach(a=>{a.addEventListener("click",({target:o})=>{t.src=`${t.getAttribute("data-editurl")}&task=${t.getAttribute("data-item")}.edit&id=${parseInt(o.getAttribute("data-id"),10)}`,window.parent.Joomla.Modal.getCurrent().close()})})})})(Joomla,document);
@@ -0,0 +1,198 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
Joomla = window.Joomla || {};
((Joomla, document) => {
Joomla.hideAssociation = (formControl, languageCode) => {
document.querySelectorAll('#associations .control-group').forEach(element => {
// Current selected language. Hide it
const el = element.querySelector('.control-label label');
if (el) {
const attribute = el.getAttribute('for');
if (attribute.replace(/_name$/, '') === `${formControl}_associations_${languageCode.replace('-', '_')}`) {
element.classList.add('hidden');
}
}
});
};
Joomla.showAssociationMessage = () => {
const associations = document.getElementById('fieldset-associations');
if (associations) {
const html = document.createElement('joomla-alert');
html.innerText = Joomla.Text._('JGLOBAL_ASSOC_NOT_POSSIBLE');
associations.insertAdjacentElement('afterbegin', html);
}
document.querySelectorAll('#associations .control-group').forEach(element => {
element.classList.add('hidden');
});
};
/**
* Inject associations into other association fields
*
* This function is called whenever the Ajax request within propagateAssociation() completes
* successfully.
* Its purpose is to inject the associations which have been returned in the Ajax response into
* the other association fields in the form.
* It does this by invoking the various callback functions of those association fields (i.e. the
* function which gets called whenever the administrator selects an association via the modal),
* and passing the appropriate associated record details.
*
* @param result The response from the Ajax request.
* Its structure is that generated by the JResponseJson class,
* with the data field containing the associations
* @param callbackFunctionPrefix The name of the callback function which the modal window uses
* to set the selected item as the association, but minus the
* language tag at the end
*
* @return boolean
*
* @since 3.9.0
*/
Joomla.injectAssociations = (result, callbackFunctionPrefix) => {
let functionName;
if (result.success) {
if (result.data.length !== 0) {
Object.keys(result.data).forEach(lang => {
functionName = callbackFunctionPrefix + lang.replace('-', '_');
window[functionName](result.data[lang].id, result.data[lang].title, result.data[lang].catid, null, null, lang);
});
}
if (result.message) {
Joomla.renderMessages({
notice: [result.message]
});
}
} else {
Joomla.renderMessages({
warning: [Joomla.Text._('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED')]
});
}
};
/**
* Propagate associations from this field into other association fields
*
* This function is called whenever an administrator populates an association (in the association
* modal field) and then clicks on the Propagate button.
* The purpose of this function is to find what other records (if any) are associated with the
* one which the administrator has selected, and populate the other association fields with these
* records. (Otherwise, if the administrator just clicks on Save without clicking on Propagate,
* those other associations will be deleted). It does this by finding the id of the selected
* associated record (from a hidden field) and makes an Ajax call to the server to find the other
* associations, also passing up the language of the record currently being edited, as it should
* be excluded. Once it has received from the server the other associations it calls
* injectAssociations to inject them into the other association fields within the form.
*
* @param fieldPrefix The stem of the html ids for the elements comprising the
* modal field
* @param callbackFunctionPrefix The name of the callback function which the modal window uses
* to set the selected item as the association, but minus the
* language tag at the end
*
* @return boolean
*
* @since 3.9.0
*/
Joomla.propagateAssociation = (fieldPrefix, callbackFunctionPrefix) => {
// Find the id of the record which has been set as an association
const assocId = document.getElementById(`${fieldPrefix}_id`).value;
// Find the language of the record being edited
const languageField = document.getElementById('jform_language');
const currentLang = languageField.options[languageField.selectedIndex].value;
const data = {
task: 'ajax.fetchAssociations',
format: 'json',
assocId,
excludeLang: currentLang
};
data[Joomla.getOptions('csrf.token', '')] = 1;
const queryString = Object.keys(data).reduce((a, k) => {
a.push(`${k}=${encodeURIComponent(data[k])}`);
return a;
}, []).join('&');
const url = `${document.forms.adminForm.action}&${queryString}`;
Joomla.request({
// Find the action url associated with the form - we need to add the token to this
url,
method: 'GET',
data: JSON.stringify(data),
headers: {
'Content-Type': 'application/json'
},
onSuccess: response => {
Joomla.injectAssociations(JSON.parse(response), callbackFunctionPrefix);
},
onError: () => {
Joomla.renderMessages({
warning: [Joomla.Text._('JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED')]
});
}
});
return false;
};
document.addEventListener('DOMContentLoaded', () => {
const associationsEditOptions = Joomla.getOptions('system.associations.edit');
const formControl = associationsEditOptions.formControl || 'jform';
const formControlLanguage = document.getElementById(`${formControl}_language`);
// Hide the associations tab if needed
if (parseInt(associationsEditOptions.hidden, 10) === 1) {
Joomla.showAssociationMessage();
} else if (formControlLanguage) {
// Hide only the associations for the current language
Joomla.hideAssociation(formControl, formControlLanguage.value);
}
// When changing the language
if (formControlLanguage) {
formControlLanguage.addEventListener('change', ({
target
}) => {
// Remove message if any
Joomla.removeMessages();
let existsAssociations = false;
/** For each language, remove the associations, ie,
* empty the associations fields and reset the buttons to Select/Create
*/
document.querySelectorAll('#associations .control-group').forEach(element => {
const attribute = element.querySelector('.control-label label').getAttribute('for');
const languageCode = attribute.replace('_name', '').replace('jform_associations_', '');
// Show the association fields
element.classList.remove('hidden');
// Check if there was an association selected for this language
if (!existsAssociations && document.getElementById(`${formControl}_associations_${languageCode}_id`).value !== '') {
existsAssociations = true;
}
// Call the modal clear button
let clear = document.getElementById(`${formControl}_associations_${languageCode}_clear`);
clear = clear || element.querySelector('[data-button-action="clear"]');
clear.click();
});
// If associations existed, send a warning to the user
if (existsAssociations) {
Joomla.renderMessages({
warning: [Joomla.Text._('JGLOBAL_ASSOCIATIONS_RESET_WARNING')]
});
}
// If the selected language is All hide the fields and add a message
const selectedLanguage = target.value;
if (selectedLanguage === '*') {
Joomla.showAssociationMessage();
} else {
// Else show the associations fields/buttons and hide the current selected language
Joomla.hideAssociation(formControl, selectedLanguage);
}
});
}
});
})(Joomla, document);
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/Joomla=window.Joomla||{},((e,i)=>{e.hideAssociation=(s,t)=>{i.querySelectorAll("#associations .control-group").forEach(n=>{const a=n.querySelector(".control-label label");a&&a.getAttribute("for").replace(/_name$/,"")===`${s}_associations_${t.replace("-","_")}`&&n.classList.add("hidden")})},e.showAssociationMessage=()=>{const s=i.getElementById("fieldset-associations");if(s){const t=i.createElement("joomla-alert");t.innerText=e.Text._("JGLOBAL_ASSOC_NOT_POSSIBLE"),s.insertAdjacentElement("afterbegin",t)}i.querySelectorAll("#associations .control-group").forEach(t=>{t.classList.add("hidden")})},e.injectAssociations=(s,t)=>{let n;s.success?(s.data.length!==0&&Object.keys(s.data).forEach(a=>{n=t+a.replace("-","_"),window[n](s.data[a].id,s.data[a].title,s.data[a].catid,null,null,a)}),s.message&&e.renderMessages({notice:[s.message]})):e.renderMessages({warning:[e.Text._("JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED")]})},e.propagateAssociation=(s,t)=>{const n=i.getElementById(`${s}_id`).value,a=i.getElementById("jform_language"),c=a.options[a.selectedIndex].value,o={task:"ajax.fetchAssociations",format:"json",assocId:n,excludeLang:c};o[e.getOptions("csrf.token","")]=1;const l=Object.keys(o).reduce((r,d)=>(r.push(`${d}=${encodeURIComponent(o[d])}`),r),[]).join("&"),g=`${i.forms.adminForm.action}&${l}`;return e.request({url:g,method:"GET",data:JSON.stringify(o),headers:{"Content-Type":"application/json"},onSuccess:r=>{e.injectAssociations(JSON.parse(r),t)},onError:()=>{e.renderMessages({warning:[e.Text._("JGLOBAL_ASSOCIATIONS_PROPAGATE_FAILED")]})}}),!1},i.addEventListener("DOMContentLoaded",()=>{const s=e.getOptions("system.associations.edit"),t=s.formControl||"jform",n=i.getElementById(`${t}_language`);parseInt(s.hidden,10)===1?e.showAssociationMessage():n&&e.hideAssociation(t,n.value),n&&n.addEventListener("change",({target:a})=>{e.removeMessages();let c=!1;i.querySelectorAll("#associations .control-group").forEach(l=>{const r=l.querySelector(".control-label label").getAttribute("for").replace("_name","").replace("jform_associations_","");l.classList.remove("hidden"),!c&&i.getElementById(`${t}_associations_${r}_id`).value!==""&&(c=!0);let d=i.getElementById(`${t}_associations_${r}_clear`);d=d||l.querySelector('[data-button-action="clear"]'),d.click()}),c&&e.renderMessages({warning:[e.Text._("JGLOBAL_ASSOCIATIONS_RESET_WARNING")]});const o=a.value;o==="*"?e.showAssociationMessage():e.hideAssociation(t,o)})})})(Joomla,document);
@@ -0,0 +1,373 @@
/**
* @copyright (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
if (!Joomla) {
throw new Error('Joomla API is not properly initialised');
}
const hideElements = ids => {
ids.forEach(id => {
const element = document.getElementById(id);
if (element) {
element.classList.add('hidden');
}
});
};
const createOption = (value, text) => {
const option = document.createElement('option');
option.value = value;
option.innerText = text;
return option;
};
// Attach behaviour to toggle button.
document.body.addEventListener('click', ({
target
}) => {
if (target.id === 'toggle-left-panel') {
const referenceHide = target.getAttribute('data-hide-reference');
const referenceShow = target.getAttribute('data-show-reference');
if (target.innerText === referenceHide) {
target.innerText = referenceShow;
} else {
target.innerText = referenceHide;
}
document.getElementById('left-panel').classList.toggle('hidden');
document.getElementById('right-panel').classList.toggle('full-width');
}
});
// Attach behaviour to language selector change event.
document.body.addEventListener('change', ({
target
}) => {
if (target.id === 'jform_itemlanguage') {
const targetIframe = document.getElementById('target-association');
const selected = target.value;
// Populate the data attributes and load the the edit page in target frame.
if (selected !== '' && typeof selected !== 'undefined') {
targetIframe.setAttribute('data-action', selected.split(':')[2]);
targetIframe.setAttribute('data-id', selected.split(':')[1]);
targetIframe.setAttribute('data-language', selected.split(':')[0]);
// Iframe load start, show Joomla loading layer.
document.body.appendChild(document.createElement('joomla-core-loader'));
// Load the target frame.
targetIframe.src = `${targetIframe.getAttribute('data-editurl')}&task=${targetIframe.getAttribute('data-item')}.${targetIframe.getAttribute('data-action')}&id=${targetIframe.getAttribute('data-id')}`;
} else {
// Reset the data attributes and no item to load.
hideElements(['toolbar-target', 'toolbar-copy', 'select-change', 'remove-assoc']);
targetIframe.setAttribute('data-action', '');
targetIframe.setAttribute('data-id', '0');
targetIframe.setAttribute('data-language', '');
targetIframe.src = '';
}
}
});
// Attach behaviour to reference frame load event.
document.getElementById('reference-association').addEventListener('load', ({
target
}) => {
// Waiting until the reference has loaded before loading the target to avoid race conditions
let targetURL = Joomla.getOptions('targetSrc', false);
if (targetURL) {
targetURL = targetURL.split('&amp;').join('&');
document.getElementById('target-association').setAttribute('src', targetURL);
Joomla.loadOptions({
targetSrc: false
});
return;
}
// Load Target Pane AFTER reference pane has loaded to prevent session conflict with checkout
document.getElementById('target-association').setAttribute('src', document.getElementById('target-association').getAttribute('src'));
const content = target.contentDocument.body || target.contentWindow.document.body;
// If copy button used
if (content.querySelector('#jform_id') && content.querySelector('#jform_id').value !== target.getAttribute('data-id')) {
const targetAssociation = document.getElementById('target-association');
targetAssociation.src = `${targetAssociation.getAttribute('data-editurl')}&task=${targetAssociation.getAttribute('data-item')}.edit&id=${content.querySelector('#jform_id').value}`;
target.src = `${target.getAttribute('data-editurl')}&task=${target.getAttribute('data-item')}.edit&id=${target.getAttribute('data-id')}`;
}
// Disable language field.
if (content.querySelector('#jform_language')) {
content.querySelector('#jform_language').setAttribute('disabled', 'disabled');
}
// Remove modal buttons on the reference
const associationBtn = content.querySelector('#associations .btn');
if (associationBtn) {
associationBtn.remove();
}
const itemLanguageOptions = document.querySelectorAll('#jform_itemlanguage option');
if (itemLanguageOptions) {
itemLanguageOptions.forEach(option => {
const parse = option.value.split(':');
if (typeof parse[0] !== 'undefined') {
// - For modal association selectors.
const langAssociation = parse[0].replace(/-/, '_');
const langAssociationId = content.querySelector(`#jform_associations_${langAssociation}_id`);
if (langAssociationId && langAssociationId.value === '') {
const referenceAssociation = document.getElementById('reference-association');
if (referenceAssociation.hasAttribute('data-no-assoc')) {
content.querySelector(`#jform_associations_${langAssociation}_name`).value = referenceAssociation.getAttribute('data-no-assoc');
}
}
}
});
}
// Iframe load finished, hide Joomla loading layer.
const spinner = document.querySelector('joomla-core-loader');
if (spinner) {
spinner.parentNode.removeChild(spinner);
}
});
// Attach behaviour to target frame load event.
document.getElementById('target-association').addEventListener('load', ({
target
}) => {
// We need to check if we are not loading a blank iframe.
if (target.getAttribute('src') !== '') {
document.getElementById('toolbar-target').classList.remove('hidden');
const toolbarCopy = document.getElementById('toolbar-copy');
if (toolbarCopy) {
toolbarCopy.classList.remove('hidden');
}
document.getElementById('select-change').classList.remove('hidden');
const targetLanguage = target.getAttribute('data-language');
const targetId = target.getAttribute('data-id');
const content = target.contentDocument.body || target.contentWindow.document.body;
const targetLoadedId = content.querySelector('#jform_id').value || '0';
const reference = document.getElementById('reference-association');
// Remove modal buttons on the target
// content.querySelector('a[href="#associations"]').parentNode.querySelector('.btn').forEach(btn => btn.remove());
// content.querySelector('#associations .btn').forEach(btn => btn.remove());
// Always show General tab first if associations tab is selected on the reference
const associations = content.querySelector('#associations');
if (associations && associations.classList.contains('active')) {
content.querySelector('a[href="#associations"]').parentNode.classList.remove('active');
associations.classList.remove('active');
content.querySelector('.nav-tabs li').classList.add('active');
content.querySelector('.tab-content .tab-pane').classList.add('active');
}
// Update language field with the selected language and them disable it.
if (content.querySelector('#jform_language')) {
content.querySelector('#jform_language').value = targetLanguage;
content.querySelector('#jform_language').setAttribute('disabled', 'disabled');
}
// If we are creating a new association (before save) we need to add the new association.
if (targetLoadedId === '0') {
document.getElementById('select-change-text').innerHTML = Joomla.sanitizeHtml(document.getElementById('select-change').getAttribute('data-select'));
} else {
// If we are editing an association.
// Show change language button
document.getElementById('select-change-text').innerHTML = Joomla.sanitizeHtml(document.getElementById('select-change').getAttribute('data-change'));
document.getElementById('remove-assoc').classList.remove('hidden');
document.getElementById('remove-assoc').classList.add('toolbar-copy');
// Add the id to list of items to check in on close.
const currentIdList = document.getElementById('target-id').value;
const updatedList = currentIdList === '' ? targetLoadedId : `${currentIdList},${targetLoadedId}`;
document.getElementById('target-id').value = updatedList;
// If we created a new association (after save).
if (targetLoadedId !== targetId) {
// Refresh the language selector with the new id (used after save).
const languageSelector = document.querySelector(`#jform_itemlanguage option[value^="${targetLanguage}:${targetId}:add"]`);
if (languageSelector) {
languageSelector.value = `${targetLanguage}:${targetLoadedId}:edit`;
}
// Update main frame data-id attribute (used after save).
target.setAttribute('data-id', targetLoadedId);
target.setAttribute('data-action', 'edit');
}
// Update the reference item associations tab.
const referenceContent = reference.contentDocument.body || reference.contentWindow.document.body;
const languageCode = targetLanguage.replace(/-/, '_');
const title = content.querySelector(`#jform_${reference.getAttribute('data-title')}`).value;
// - For modal association selectors.
const referenceContentId = referenceContent.querySelector(`#jform_associations_${languageCode}_id`);
if (referenceContentId) {
referenceContentId.value = targetLoadedId;
}
const referenceContentName = referenceContent.querySelector(`#jform_associations_${languageCode}_name`);
if (referenceContentName) {
referenceContentName.value = title;
}
// - For chosen association selectors (menus).
const referenceContentDropdown = referenceContent.querySelector(`#jform_associations_${languageCode}`);
if (referenceContentDropdown) {
referenceContentDropdown.appendChild(createOption(targetLoadedId, title));
referenceContentDropdown.value = targetLoadedId;
}
}
// Update the target item associations tab.
const referenceId = reference.getAttribute('data-id');
const referenceLanguageCode = reference.getAttribute('data-language').replace(/-/, '_');
const referenceTitle = reference.getAttribute('data-title-value');
// - For modal association selectors.
const targetContentId = content.querySelector(`#jform_associations_${referenceLanguageCode}_id`);
if (targetContentId) {
targetContentId.value = referenceId;
}
const targetContentName = content.querySelector(`#jform_associations_${referenceLanguageCode}_name`);
if (targetContentName) {
targetContentName.value = referenceTitle;
}
// - For chosen association selectors (menus).
let chosenField = content.querySelector(`#jform_associations_${referenceLanguageCode}`);
if (chosenField) {
chosenField.appendChild(createOption(referenceId, referenceTitle));
chosenField.value = referenceId;
}
document.querySelectorAll('#jform_itemlanguage option').forEach(option => {
const parse = option.value.split(':');
if (typeof parse[1] !== 'undefined' && parse[1] !== '0') {
// - For modal association selectors.
const langAssociation = parse[0].replace(/-/, '_');
const formAssociationId = content.querySelector(`#jform_associations_${langAssociation}_id`);
if (formAssociationId) {
content.querySelector(`#jform_associations_${langAssociation}_id`).value = parse[1];
}
// - For chosen association selectors (menus).
chosenField = content.querySelector(`#jform_associations_${langAssociation}`);
if (chosenField) {
chosenField.appendChild(createOption(parse[1], ''));
chosenField.value = parse[1];
}
}
});
// Iframe load finished, hide Joomla loading layer.
const spinner = document.querySelector('joomla-core-loader');
if (spinner) {
spinner.parentNode.removeChild(spinner);
}
}
});
// Save button actions, replacing the default Joomla.submitbutton() with custom function.
Joomla.submitbutton = task => {
// Using close button, normal joomla submit.
if (task === 'association.cancel') {
Joomla.submitform(task);
} else if (task === 'copy') {
document.body.appendChild(document.createElement('joomla-core-loader'));
const targetLang = document.getElementById('target-association').getAttribute('data-language');
const referlangInput = window.frames['reference-association'].document.getElementById('jform_language');
// Set target language, to get correct content language in the copy
referlangInput.removeAttribute('disabled');
referlangInput.value = targetLang;
window.frames['reference-association'].Joomla.submitbutton(`${document.getElementById('adminForm').getAttribute('data-associatedview')}.save2copy`);
} else if (task === 'undo-association') {
// Undo association
const referenceEl = document.getElementById('reference-association');
const targetEl = document.getElementById('target-association');
const referenceLang = referenceEl.getAttribute('data-language').replace(/-/, '_');
const targetLang = targetEl.getAttribute('data-language').replace(/-/, '_');
const reference = referenceEl.contentDocument.body || referenceEl.contentWindow.document.body;
const target = targetEl.contentDocument.body || targetEl.contentWindow.document.body;
// Remove it on the reference
// - For modal association selectors.
const referenceAssocId = reference.querySelector(`#jform_associations_${targetLang}_id`);
if (referenceAssocId) {
referenceAssocId.value = '';
}
const referenceAssocName = reference.querySelector(`#jform_associations_${targetLang}_name`);
if (referenceAssocName) {
referenceAssocName.value = '';
}
// - For chosen association selectors (menus).
const referenceAssoc = reference.querySelector(`#jform_associations_${targetLang}`);
if (referenceAssoc) {
referenceAssoc.value = '';
}
// Remove it on the target
document.querySelectorAll('#jform_itemlanguage option').forEach(option => {
let lang = option.value.split(':')[0];
if (lang) {
lang = lang.replace(/-/, '_');
const formAssociationId = target.querySelector(`#jform_associations_${lang}_id`);
if (formAssociationId) {
// - For modal association selectors.
formAssociationId.value = '';
}
const formAssociation = target.querySelector(`#jform_associations_${lang}`);
if (formAssociation) {
// - For chosen association selectors (menus).
formAssociation.value = '';
}
}
});
// Same as above but reference language is not in the selector
// - For modal association selectors.
const targetAssocId = target.querySelector(`#jform_associations_${referenceLang}_id`);
if (targetAssocId) {
targetAssocId.value = '';
}
const targetAssocName = target.querySelector(`#jform_associations_${referenceLang}_name`);
if (targetAssocName) {
targetAssocName.value = '';
}
// - For chosen association selectors (menus).
const targetAssoc = target.querySelector(`#jform_associations_${referenceLang}`);
if (targetAssoc) {
targetAssoc.value = '';
}
// Reset switcher after removing association
const currentLangSelect = document.getElementById('jform_itemlanguage');
const currentSwitcher = currentLangSelect.value;
const currentLang = targetLang.replace(/_/, '-');
const itemLanguageItem = document.querySelector(`#jform_itemlanguage option[value="${currentSwitcher}"]`);
if (itemLanguageItem) {
itemLanguageItem.value = `${currentLang}:0:add`;
}
currentLangSelect.value = '';
currentLangSelect.dispatchEvent(new CustomEvent('change', {
bubbles: true,
cancelable: true
}));
// Save one of the items to confirm action
Joomla.submitbutton('reference');
} else {
// Saving target or reference, send the save action to the target/reference iframe.
// We need to re-enable the language field to save.
const el = document.getElementById(`${task}-association`);
const content = el.contentDocument.body || el.contentWindow.document.body;
const languageButton = content.querySelector('#jform_language');
if (languageButton) {
languageButton.removeAttribute('disabled');
}
window.frames[`${task}-association`].Joomla.submitbutton(`${document.getElementById('adminForm').getAttribute('data-associatedview')}.apply`);
}
return false;
};
hideElements(['toolbar-target', 'toolbar-copy']);
File diff suppressed because one or more lines are too long
@@ -0,0 +1,21 @@
{
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
"name": "com_banners",
"version": "4.0.0",
"description": "Joomla CMS",
"license": "GPL-2.0-or-later",
"assets": [
{
"name": "com_banners.admin-banner-edit",
"type": "script",
"uri": "com_banners/admin-banner-edit.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "c414d8"
}
]
}
@@ -0,0 +1,39 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
(document => {
const updateBannerFields = value => {
const imgWrapper = document.getElementById('image');
const custom = document.getElementById('custom');
switch (value) {
case '0':
// Image
imgWrapper.classList.remove('hidden');
custom.classList.add('hidden');
break;
case '1':
// Custom
imgWrapper.classList.add('hidden');
custom.classList.remove('hidden');
break;
// Do nothing
}
};
document.addEventListener('DOMContentLoaded', () => {
const jformType = document.getElementById('jform_type');
if (jformType) {
// Hide/show parameters initially
updateBannerFields(jformType.value);
// Hide/show parameters when the type has been selected
jformType.addEventListener('change', ({
target
}) => {
updateBannerFields(target.value);
});
}
});
})(document);
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/(s=>{const d=e=>{const t=s.getElementById("image"),a=s.getElementById("custom");switch(e){case"0":t.classList.remove("hidden"),a.classList.add("hidden");break;case"1":t.classList.add("hidden"),a.classList.remove("hidden");break}};s.addEventListener("DOMContentLoaded",()=>{const e=s.getElementById("jform_type");e&&(d(e.value),e.addEventListener("change",({target:t})=>{d(t.value)}))})})(document);
@@ -0,0 +1,21 @@
{
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
"name": "com_cache",
"version": "4.0.0",
"description": "Joomla CMS",
"license": "GPL-2.0-or-later",
"assets": [
{
"name": "com_cache.admin-cache",
"type": "script",
"uri": "com_cache/admin-cache-default.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "f33074"
}
]
}
@@ -0,0 +1,14 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
Joomla = window.Joomla || {};
((document, Joomla) => {
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.cache-entry').forEach(el => el.addEventListener('click', ({
currentTarget
}) => Joomla.isChecked(currentTarget.checked)));
});
})(document, Joomla);
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/Joomla=window.Joomla||{},((e,o)=>{e.addEventListener("DOMContentLoaded",()=>{e.querySelectorAll(".cache-entry").forEach(c=>c.addEventListener("click",({currentTarget:d})=>o.isChecked(d.checked)))})})(document,Joomla);
@@ -0,0 +1,21 @@
@charset "UTF-8";
.com-content-categories__item {
border-bottom: 1px solid #dfe3e7;
}
.com-content-categories__item-title-wrapper {
flex-wrap: wrap;
justify-content: space-between;
padding: .5rem 0;
display: flex;
}
.com-content-categories__children {
border-top: 1px solid #dfe3e7;
flex-basis: 100%;
padding-inline-start: 1.5rem;
}
.com-content-categories__children .com-content-categories__item:last-child {
border-bottom: none;
}
@@ -0,0 +1 @@
@charset "UTF-8";.com-content-categories__item{border-bottom:1px solid #dfe3e7}.com-content-categories__item-title-wrapper{flex-wrap:wrap;justify-content:space-between;padding:.5rem 0;display:flex}.com-content-categories__children{border-top:1px solid #dfe3e7;flex-basis:100%;padding-inline-start:1.5rem}.com-content-categories__children .com-content-categories__item:last-child{border-bottom:none}
@@ -0,0 +1,35 @@
{
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
"name": "com_categories",
"version": "4.0.0",
"description": "Joomla CMS",
"license": "GPL-2.0-or-later",
"assets": [
{
"name": "com_categories.shared-categories-accordion",
"type": "preset",
"dependencies": [
"com_categories.shared-categories-accordion#style",
"com_categories.shared-categories-accordion#script"
]
},
{
"name": "com_categories.shared-categories-accordion",
"type": "script",
"uri": "com_categories/shared-categories-accordion.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "587c3d"
},
{
"name": "com_categories.shared-categories-accordion",
"type": "style",
"uri": "com_categories/shared-categories-accordion.min.css",
"version": "0dc781"
}
]
}
@@ -0,0 +1,38 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
if (!Joomla || !Joomla.Text) {
throw new Error('core.js was not properly initialised');
}
// Selectors used by this script
const buttonsSelector = '[id^=category-btn-]';
/**
* Handle the category toggle button click event
* @param event
*/
const handleCategoryToggleButtonClick = ({
currentTarget
}) => {
const button = currentTarget;
const icon = button.querySelector('span');
// Toggle icon class
icon.classList.toggle('icon-plus');
icon.classList.toggle('icon-minus');
// Toggle aria label, aria-expanded
const ariaLabel = button.getAttribute('aria-label');
const ariaExpanded = button.getAttribute('aria-expanded');
button.setAttribute('aria-label', ariaLabel === Joomla.Text._('JGLOBAL_EXPAND_CATEGORIES') ? Joomla.Text._('JGLOBAL_COLLAPSE_CATEGORIES') : Joomla.Text._('JGLOBAL_EXPAND_CATEGORIES'));
button.setAttribute('aria-expanded', ariaExpanded === 'false' ? 'true' : 'false');
const {
categoryId
} = button.dataset;
const target = document.getElementById(`category-${categoryId}`);
target.toggleAttribute('hidden');
};
document.querySelectorAll(buttonsSelector).forEach(button => button.addEventListener('click', handleCategoryToggleButtonClick));
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/if(!Joomla||!Joomla.Text)throw new Error("core.js was not properly initialised");const buttonsSelector="[id^=category-btn-]",handleCategoryToggleButtonClick=({currentTarget:e})=>{const t=e,o=t.querySelector("span");o.classList.toggle("icon-plus"),o.classList.toggle("icon-minus");const a=t.getAttribute("aria-label"),r=t.getAttribute("aria-expanded");t.setAttribute("aria-label",a===Joomla.Text._("JGLOBAL_EXPAND_CATEGORIES")?Joomla.Text._("JGLOBAL_COLLAPSE_CATEGORIES"):Joomla.Text._("JGLOBAL_EXPAND_CATEGORIES")),t.setAttribute("aria-expanded",r==="false"?"true":"false");const{categoryId:l}=t.dataset;document.getElementById(`category-${l}`).toggleAttribute("hidden")};document.querySelectorAll(buttonsSelector).forEach(e=>e.addEventListener("click",handleCategoryToggleButtonClick));
@@ -0,0 +1,57 @@
{
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
"name": "com_config",
"version": "4.0.0",
"description": "Joomla CMS",
"license": "GPL-2.0-or-later",
"assets": [
{
"name": "com_config.config",
"type": "script",
"uri": "com_config/config-default.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "752453"
},
{
"name": "com_config.modules",
"type": "script",
"uri": "com_config/modules-default.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "a96b5d"
},
{
"name": "com_config.templates",
"type": "script",
"uri": "com_config/templates-default.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "8e4ec9"
},
{
"name": "com_config.filters",
"type": "script",
"uri": "com_config/config-filters.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "2cad91"
}
]
}
@@ -0,0 +1,36 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
((document, submitForm) => {
// Selectors used by this script
const buttonDataSelector = 'data-submit-task';
/**
* Submit the task
* @param task
* @param form
*/
const submitTask = (task, form) => {
if (task === 'config.cancel' || document.formvalidator.isValid(form)) {
submitForm(task, form);
}
};
/**
* Register events
*/
const registerEvents = () => {
document.querySelectorAll(`[${buttonDataSelector}]`).forEach(button => {
button.addEventListener('click', e => {
e.preventDefault();
const task = e.currentTarget.getAttribute(buttonDataSelector);
submitTask(task, e.currentTarget.form);
});
});
};
document.addEventListener('DOMContentLoaded', () => {
registerEvents();
});
})(document, Joomla.submitform);
+4
View File
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/((r,n)=>{const a="data-submit-task",o=(e,t)=>{(e==="config.cancel"||r.formvalidator.isValid(t))&&n(e,t)},s=()=>{r.querySelectorAll(`[${a}]`).forEach(e=>{e.addEventListener("click",t=>{t.preventDefault();const c=t.currentTarget.getAttribute(a);o(c,t.currentTarget.form)})})};r.addEventListener("DOMContentLoaded",()=>{s()})})(document,Joomla.submitform);
@@ -0,0 +1,24 @@
/**
* @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
const recursiveApplyChanges = id => {
document.querySelectorAll(`#filter-config select[data-parent="${id}"]`).forEach(child => {
recursiveApplyChanges(child.dataset.id);
child.value = 'NONE';
});
};
const applyChanges = event => {
const currentElement = event.currentTarget;
const currentFilter = currentElement.options[currentElement.selectedIndex].value;
if (currentFilter === 'NONE') {
const childs = document.querySelectorAll(`#filter-config select[data-parent="${currentElement.dataset.id}"]`);
if (childs.length && window.confirm(Joomla.Text._('COM_CONFIG_TEXT_FILTERS_NOTE'))) {
childs.forEach(child => {
recursiveApplyChanges(child.dataset.id);
child.value = 'NONE';
});
}
}
};
document.querySelectorAll('#filter-config select').forEach(select => select.addEventListener('change', applyChanges));
+4
View File
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/const recursiveApplyChanges=t=>{document.querySelectorAll(`#filter-config select[data-parent="${t}"]`).forEach(e=>{recursiveApplyChanges(e.dataset.id),e.value="NONE"})},applyChanges=t=>{const e=t.currentTarget;if(e.options[e.selectedIndex].value==="NONE"){const r=document.querySelectorAll(`#filter-config select[data-parent="${e.dataset.id}"]`);r.length&&window.confirm(Joomla.Text._("COM_CONFIG_TEXT_FILTERS_NOTE"))&&r.forEach(n=>{recursiveApplyChanges(n.dataset.id),n.value="NONE"})}};document.querySelectorAll("#filter-config select").forEach(t=>t.addEventListener("change",applyChanges));
@@ -0,0 +1,36 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
((document, submitForm) => {
// Selectors used by this script
const buttonDataSelector = 'data-submit-task';
/**
* Submit the task
* @param task
* @param form
*/
const submitTask = (task, form) => {
if (task === 'modules.cancel' || document.formvalidator.isValid(form)) {
submitForm(task, form);
}
};
/**
* Register events
*/
const registerEvents = () => {
document.querySelectorAll(`[${buttonDataSelector}]`).forEach(button => {
button.addEventListener('click', e => {
e.preventDefault();
const task = e.currentTarget.getAttribute(buttonDataSelector);
submitTask(task, e.currentTarget.form);
});
});
};
document.addEventListener('DOMContentLoaded', () => {
registerEvents();
});
})(document, Joomla.submitform);
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/((r,n)=>{const a="data-submit-task",o=(e,t)=>{(e==="modules.cancel"||r.formvalidator.isValid(t))&&n(e,t)},s=()=>{r.querySelectorAll(`[${a}]`).forEach(e=>{e.addEventListener("click",t=>{t.preventDefault();const c=t.currentTarget.getAttribute(a);o(c,t.currentTarget.form)})})};r.addEventListener("DOMContentLoaded",()=>{s()})})(document,Joomla.submitform);
@@ -0,0 +1,36 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
((document, submitForm) => {
// Selectors used by this script
const buttonDataSelector = 'data-submit-task';
/**
* Submit the task
* @param task
* @param form
*/
const submitTask = (task, form) => {
if (task === 'templates.cancel' || document.formvalidator.isValid(form)) {
submitForm(task, form);
}
};
/**
* Register events
*/
const registerEvents = () => {
document.querySelectorAll(`[${buttonDataSelector}]`).forEach(button => {
button.addEventListener('click', e => {
e.preventDefault();
const task = e.currentTarget.getAttribute(buttonDataSelector);
submitTask(task, e.currentTarget.form);
});
});
};
document.addEventListener('DOMContentLoaded', () => {
registerEvents();
});
})(document, Joomla.submitform);
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/((a,n)=>{const r="data-submit-task",s=(e,t)=>{(e==="templates.cancel"||a.formvalidator.isValid(t))&&n(e,t)},o=()=>{a.querySelectorAll(`[${r}]`).forEach(e=>{e.addEventListener("click",t=>{t.preventDefault();const c=t.currentTarget.getAttribute(r);s(c,t.currentTarget.form)})})};a.addEventListener("DOMContentLoaded",()=>{o()})})(document,Joomla.submitform);
@@ -0,0 +1,35 @@
{
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
"name": "com_contact",
"version": "4.0.0",
"description": "Joomla CMS",
"license": "GPL-2.0-or-later",
"assets": [
{
"name": "com_contact.admin-contacts-modal",
"type": "script",
"uri": "com_contact/admin-contacts-modal.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"deprecated": true,
"deprecatedMsg": "Use postMessage() directly or with help of [modal-content-select] asset. To post the modal selection.",
"version": "1400c3"
},
{
"name": "com_contact.contacts-list",
"type": "script",
"uri": "com_contact/contacts-list.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "f53819"
}
]
}
@@ -0,0 +1,57 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
(() => {
// Use a JoomlaExpectingPostMessage flag to be able to distinct legacy methods
if (window.parent.JoomlaExpectingPostMessage) {
return;
}
/**
* Javascript to insert the link
* View element calls jSelectContact when a contact is clicked
* jSelectContact creates the link tag, sends it to the editor,
* and closes the select frame.
*/
window.jSelectContact = (id, title, catid, object, link, lang) => {
console.warn('Method jSelectContact() is deprecated. Use postMessage() instead.');
let hreflang = '';
if (!Joomla.getOptions('xtd-contacts')) {
return false;
}
const {
editor
} = Joomla.getOptions('xtd-contacts');
if (lang !== '') {
hreflang = `hreflang = "${lang}"`;
}
const tag = `<a ${hreflang} href="${link}">${title}</a>`;
window.parent.Joomla.editors.instances[editor].replaceSelection(tag);
if (window.parent.Joomla.Modal && window.parent.Joomla.Modal.getCurrent()) {
window.parent.Joomla.Modal.getCurrent().close();
}
return true;
};
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.select-link').forEach(element => {
// Listen for click event
element.addEventListener('click', event => {
event.preventDefault();
const functionName = event.target.getAttribute('data-function');
if (functionName === 'jSelectContact' && window[functionName]) {
// Used in xtd_contacts
window[functionName](event.target.getAttribute('data-id'), event.target.getAttribute('data-title'), null, null, event.target.getAttribute('data-uri'), event.target.getAttribute('data-language'), null);
} else if (window.parent[functionName]) {
// Used in com_menus
window.parent[functionName](event.target.getAttribute('data-id'), event.target.getAttribute('data-title'), null, null, event.target.getAttribute('data-uri'), event.target.getAttribute('data-language'), null);
}
if (window.parent.Joomla.Modal && window.parent.Joomla.Modal.getCurrent()) {
window.parent.Joomla.Modal.getCurrent().close();
}
});
});
});
})();
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/window.parent.JoomlaExpectingPostMessage||(window.jSelectContact=(a,t,e,d,r,o)=>{console.warn("Method jSelectContact() is deprecated. Use postMessage() instead.");let n="";if(!Joomla.getOptions("xtd-contacts"))return!1;const{editor:i}=Joomla.getOptions("xtd-contacts");o!==""&&(n=`hreflang = "${o}"`);const l=`<a ${n} href="${r}">${t}</a>`;return window.parent.Joomla.editors.instances[i].replaceSelection(l),window.parent.Joomla.Modal&&window.parent.Joomla.Modal.getCurrent()&&window.parent.Joomla.Modal.getCurrent().close(),!0},document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".select-link").forEach(a=>{a.addEventListener("click",t=>{t.preventDefault();const e=t.target.getAttribute("data-function");e==="jSelectContact"&&window[e]?window[e](t.target.getAttribute("data-id"),t.target.getAttribute("data-title"),null,null,t.target.getAttribute("data-uri"),t.target.getAttribute("data-language"),null):window.parent[e]&&window.parent[e](t.target.getAttribute("data-id"),t.target.getAttribute("data-title"),null,null,t.target.getAttribute("data-uri"),t.target.getAttribute("data-language"),null),window.parent.Joomla.Modal&&window.parent.Joomla.Modal.getCurrent()&&window.parent.Joomla.Modal.getCurrent().close()})})}));
@@ -0,0 +1,21 @@
/**
* @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
(document => {
const onClick = () => {
const form = document.getElementById('adminForm');
document.getElementById('filter-search').value = '';
form.submit();
};
const onBoot = () => {
const form = document.getElementById('adminForm');
const element = form.querySelector('button[type="reset"]');
if (element) {
element.addEventListener('click', onClick);
}
document.removeEventListener('DOMContentLoaded', onBoot);
};
document.addEventListener('DOMContentLoaded', onBoot);
})(document);
+4
View File
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/(e=>{const r=()=>{const n=e.getElementById("adminForm");e.getElementById("filter-search").value="",n.submit()},t=()=>{const o=e.getElementById("adminForm").querySelector('button[type="reset"]');o&&o.addEventListener("click",r),e.removeEventListener("DOMContentLoaded",t)};e.addEventListener("DOMContentLoaded",t)})(document);
@@ -0,0 +1,108 @@
{
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
"name": "com_content",
"version": "4.0.0",
"description": "Joomla CMS",
"license": "GPL-2.0-or-later",
"assets": [
{
"name": "com_content.admin-article-pagebreak",
"type": "script",
"uri": "com_content/admin-article-pagebreak.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module",
"defer": true
},
"version": "214a47"
},
{
"name": "com_content.admin-article-readmore",
"type": "script",
"uri": "com_content/admin-article-readmore.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "27b7c1"
},
{
"name": "com_content.admin-articles-batch",
"type": "script",
"uri": "com_content/admin-articles-default-batch-footer.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "f382dd"
},
{
"name": "com_content.admin-articles-stage",
"type": "script",
"uri": "com_content/admin-articles-default-stage-footer.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "09d5c2"
},
{
"name": "com_content.admin-articles-modal",
"type": "script",
"uri": "com_content/admin-articles-modal.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"deprecated": true,
"deprecatedMsg": "Use postMessage() directly or with help of [modal-content-select] asset. To post the modal selection.",
"version": "509ba1"
},
{
"name": "com_content.form-edit",
"type": "script",
"uri": "com_content/form-edit.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "9c9433"
},
{
"name": "com_content.articles-list",
"type": "script",
"uri": "com_content/articles-list.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "f53819"
},
{
"name": "com_content.articles-status",
"type": "script",
"uri": "com_content/articles-status.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "31fff5"
}
]
}
@@ -0,0 +1,26 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
(() => {
window.insertPagebreak = editor => {
// Get the pagebreak title
let title = document.getElementById('title').value;
if (!window.parent.Joomla.getOptions('xtd-pagebreak')) {
// Something went wrong!
window.parent.Joomla.Modal.getCurrent().close();
return false;
}
// Get the pagebreak toc alias -- not inserting for now don't know which attribute to use..
let alt = document.getElementById('alt').value;
title = title !== '' ? `title="${title}"` : '';
alt = alt !== '' ? `alt="${alt}"` : '';
const tag = `<hr class="system-pagebreak" ${title} ${alt}>`;
window.parent.Joomla.editors.instances[editor].replaceSelection(tag);
window.parent.Joomla.Modal.getCurrent().close();
return false;
};
})();
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/window.insertPagebreak=a=>{let e=document.getElementById("title").value;if(!window.parent.Joomla.getOptions("xtd-pagebreak"))return window.parent.Joomla.Modal.getCurrent().close(),!1;let t=document.getElementById("alt").value;e=e!==""?`title="${e}"`:"",t=t!==""?`alt="${t}"`:"";const l=`<hr class="system-pagebreak" ${e} ${t}>`;return window.parent.Joomla.editors.instances[a].replaceSelection(l),window.parent.Joomla.Modal.getCurrent().close(),!1};
@@ -0,0 +1,29 @@
import { JoomlaEditor, JoomlaEditorButton } from 'editor-api';
import JoomlaDialog from 'joomla.dialog';
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
const insertReadmoreHandler = editor => {
const content = editor.getValue();
if (!content) {
editor.replaceSelection('<hr id="system-readmore">');
} else if (content && !content.match(/<hr\s+id=("|')system-readmore("|')\s*\/*>/i)) {
editor.replaceSelection('<hr id="system-readmore">');
} else {
JoomlaDialog.alert(Joomla.Text._('PLG_READMORE_ALREADY_EXISTS'));
}
};
// @TODO: Remove in Joomla 6
window.insertReadmore = () => {
console.warn('Method window.insertReadmore() is deprecated, use button action "insert-readmore."');
const editor = JoomlaEditor.getActive();
if (!editor) {
throw new Error('An active editor are not available');
}
insertReadmoreHandler(editor);
};
JoomlaEditorButton.registerAction('insert-readmore', insertReadmoreHandler);
@@ -0,0 +1,4 @@
import{JoomlaEditor as t,JoomlaEditorButton as i}from"editor-api";import a from"joomla.dialog";/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/const r=e=>{const o=e.getValue();o?o&&!o.match(/<hr\s+id=("|')system-readmore("|')\s*\/*>/i)?e.replaceSelection('<hr id="system-readmore">'):a.alert(Joomla.Text._("PLG_READMORE_ALREADY_EXISTS")):e.replaceSelection('<hr id="system-readmore">')};window.insertReadmore=()=>{console.warn('Method window.insertReadmore() is deprecated, use button action "insert-readmore."');const e=t.getActive();if(!e)throw new Error("An active editor are not available");r(e)},i.registerAction("insert-readmore",r);
@@ -0,0 +1,33 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
((document, submitForm) => {
// Selectors used by this script
const buttonDataSelector = 'data-submit-task';
const formId = 'adminForm';
/**
* Submit the task
* @param task
*/
const submitTask = task => {
const form = document.getElementById(formId);
if (form && task === 'article.batch') {
submitForm(task, form);
}
};
// Register events
document.addEventListener('DOMContentLoaded', () => {
const button = document.getElementById('batch-submit-button-id');
if (button) {
button.addEventListener('click', e => {
const task = e.target.getAttribute(buttonDataSelector);
submitTask(task);
return false;
});
}
});
})(document, Joomla.submitform);
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/((n,o)=>{const a="data-submit-task",s="adminForm",i=t=>{const e=n.getElementById(s);e&&t==="article.batch"&&o(t,e)};n.addEventListener("DOMContentLoaded",()=>{const t=n.getElementById("batch-submit-button-id");t&&t.addEventListener("click",e=>{const r=e.target.getAttribute(a);return i(r),!1})})})(document,Joomla.submitform);
@@ -0,0 +1,32 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
((document, submitForm) => {
// Selectors used by this script
const buttonDataSelector = 'data-submit-task';
const formId = 'adminForm';
/**
* Submit the task
* @param task
*/
const submitTask = task => {
const form = document.getElementById(formId);
if (form) {
submitForm(task, form);
}
};
// Register events
document.addEventListener('DOMContentLoaded', () => {
const button = document.getElementById('stage-submit-button-id');
if (button) {
button.addEventListener('click', e => {
const task = e.target.getAttribute(buttonDataSelector);
submitTask(task);
});
}
});
})(document, Joomla.submitform);
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/((n,o)=>{const s="data-submit-task",a="adminForm",i=t=>{const e=n.getElementById(a);e&&o(t,e)};n.addEventListener("DOMContentLoaded",()=>{const t=n.getElementById("stage-submit-button-id");t&&t.addEventListener("click",e=>{const d=e.target.getAttribute(s);i(d)})})})(document,Joomla.submitform);
@@ -0,0 +1,52 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
(() => {
// Use a JoomlaExpectingPostMessage flag to be able to distinct legacy methods
if (window.parent.JoomlaExpectingPostMessage) {
return;
}
/**
* Javascript to insert the link
* View element calls jSelectArticle when an article is clicked
* jSelectArticle creates the link tag, sends it to the editor,
* and closes the select frame.
* */
window.jSelectArticle = (id, title, catid, object, link, lang) => {
console.warn('Method jSelectArticle() is deprecated. Use postMessage() instead.');
if (!Joomla.getOptions('xtd-articles')) {
return;
}
const {
editor
} = Joomla.getOptions('xtd-articles');
const tag = `<a href="${link}"${lang !== '' ? ` hreflang="${lang}"` : ''}>${title}</a>`;
window.parent.Joomla.editors.instances[editor].replaceSelection(tag);
if (window.parent.Joomla.Modal && window.parent.Joomla.Modal.getCurrent()) {
window.parent.Joomla.Modal.getCurrent().close();
}
};
document.querySelectorAll('.select-link').forEach(element => {
// Listen for click event
element.addEventListener('click', event => {
event.preventDefault();
const {
target
} = event;
const functionName = target.getAttribute('data-function');
if (functionName === 'jSelectArticle' && window[functionName]) {
// Used in xtd_contacts
window[functionName](target.getAttribute('data-id'), target.getAttribute('data-title'), target.getAttribute('data-cat-id'), null, target.getAttribute('data-uri'), target.getAttribute('data-language'));
} else if (window.parent[functionName]) {
// Used in com_menus
window.parent[functionName](target.getAttribute('data-id'), target.getAttribute('data-title'), target.getAttribute('data-cat-id'), null, target.getAttribute('data-uri'), target.getAttribute('data-language'));
}
if (window.parent.Joomla.Modal && window.parent.Joomla.Modal.getCurrent()) {
window.parent.Joomla.Modal.getCurrent().close();
}
});
});
})();
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/window.parent.JoomlaExpectingPostMessage||(window.jSelectArticle=(o,a,t,e,n,i)=>{if(console.warn("Method jSelectArticle() is deprecated. Use postMessage() instead."),!Joomla.getOptions("xtd-articles"))return;const{editor:r}=Joomla.getOptions("xtd-articles"),d=`<a href="${n}"${i!==""?` hreflang="${i}"`:""}>${a}</a>`;window.parent.Joomla.editors.instances[r].replaceSelection(d),window.parent.Joomla.Modal&&window.parent.Joomla.Modal.getCurrent()&&window.parent.Joomla.Modal.getCurrent().close()},document.querySelectorAll(".select-link").forEach(o=>{o.addEventListener("click",a=>{a.preventDefault();const{target:t}=a,e=t.getAttribute("data-function");e==="jSelectArticle"&&window[e]?window[e](t.getAttribute("data-id"),t.getAttribute("data-title"),t.getAttribute("data-cat-id"),null,t.getAttribute("data-uri"),t.getAttribute("data-language")):window.parent[e]&&window.parent[e](t.getAttribute("data-id"),t.getAttribute("data-title"),t.getAttribute("data-cat-id"),null,t.getAttribute("data-uri"),t.getAttribute("data-language")),window.parent.Joomla.Modal&&window.parent.Joomla.Modal.getCurrent()&&window.parent.Joomla.Modal.getCurrent().close()})}));
@@ -0,0 +1,21 @@
/**
* @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
(document => {
const onClick = () => {
const form = document.getElementById('adminForm');
document.getElementById('filter-search').value = '';
form.submit();
};
const onBoot = () => {
const form = document.getElementById('adminForm');
const element = form.querySelector('button[type="reset"]');
if (element) {
element.addEventListener('click', onClick);
}
document.removeEventListener('DOMContentLoaded', onBoot);
};
document.addEventListener('DOMContentLoaded', onBoot);
})(document);
+4
View File
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2020 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/(e=>{const r=()=>{const n=e.getElementById("adminForm");e.getElementById("filter-search").value="",n.submit()},t=()=>{const o=e.getElementById("adminForm").querySelector('button[type="reset"]');o&&o.addEventListener("click",r),e.removeEventListener("DOMContentLoaded",t)};e.addEventListener("DOMContentLoaded",t)})(document);
@@ -0,0 +1,13 @@
/**
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
(() => {
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.article-status').forEach(element => {
element.addEventListener('click', event => event.stopPropagation());
});
});
})();
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2022 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".article-status").forEach(e=>{e.addEventListener("click",t=>t.stopPropagation())})});
@@ -0,0 +1,32 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
((document, submitForm) => {
// Selectors used by this script
const buttonDataSelector = 'data-submit-task';
const formId = 'adminForm';
/**
* Submit the task
* @param task
*/
const submitTask = task => {
const form = document.getElementById(formId);
if (task === 'article.cancel' || document.formvalidator.isValid(form)) {
submitForm(task, form);
}
};
// Register events
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll(`[${buttonDataSelector}]`).forEach(button => {
button.addEventListener('click', e => {
e.preventDefault();
const task = button.getAttribute(buttonDataSelector);
submitTask(task);
});
});
});
})(document, Joomla.submitform);
+4
View File
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/((e,r)=>{const o="data-submit-task",i="adminForm",n=t=>{const a=e.getElementById(i);(t==="article.cancel"||e.formvalidator.isValid(a))&&r(t,a)};e.addEventListener("DOMContentLoaded",()=>{e.querySelectorAll(`[${o}]`).forEach(t=>{t.addEventListener("click",a=>{a.preventDefault();const s=t.getAttribute(o);n(s)})})})})(document,Joomla.submitform);
Binary file not shown.
@@ -0,0 +1,46 @@
{
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
"name": "com_contenthistory",
"version": "4.0.0",
"description": "Joomla CMS",
"license": "GPL-2.0-or-later",
"assets": [
{
"name": "com_contenthistory.admin-history-versions",
"type": "script",
"uri": "",
"deprecated": true,
"dependencies": [
"core"
],
"attributes": {
"type": "module"
}
},
{
"name": "com_contenthistory.admin-compare-compare",
"type": "script",
"uri": "com_contenthistory/admin-compare-compare.min.js",
"dependencies": [
"core",
"diff"
],
"attributes": {
"type": "module"
},
"version": "a8bb66"
},
{
"name": "com_contenthistory.admin-history-modal",
"type": "script",
"uri": "com_contenthistory/admin-history-modal.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "6e466b"
}
]
}
@@ -0,0 +1,42 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
(() => {
// This method is used to decode HTML entities
const decodeHtml = html => {
const textarea = document.createElement('textarea');
textarea.innerHTML = Joomla.sanitizeHtml(html);
return textarea.value;
};
const compare = (original, changed) => {
const display = changed.nextElementSibling;
const diff = window.Diff.diffWords(original.innerHTML, changed.innerHTML);
const fragment = document.createDocumentFragment();
diff.forEach(part => {
let color = '';
if (part.added) {
color = '#a6f3a6';
}
if (part.removed) {
color = '#f8cbcb';
}
// @todo use the tag MARK here not SPAN
const span = document.createElement('span');
span.style.backgroundColor = color;
span.style.borderRadius = '.2rem';
span.appendChild(document.createTextNode(decodeHtml(part.value)));
fragment.appendChild(span);
});
display.appendChild(fragment);
};
const onBoot = () => {
document.querySelectorAll('.original').forEach(fragment => compare(fragment, fragment.nextElementSibling));
// Cleanup
document.removeEventListener('DOMContentLoaded', onBoot);
};
document.addEventListener('DOMContentLoaded', onBoot);
})();
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/(()=>{const r=e=>{const n=document.createElement("textarea");return n.innerHTML=Joomla.sanitizeHtml(e),n.value},i=(e,n)=>{const l=n.nextElementSibling,m=window.Diff.diffWords(e.innerHTML,n.innerHTML),c=document.createDocumentFragment();m.forEach(o=>{let d="";o.added&&(d="#a6f3a6"),o.removed&&(d="#f8cbcb");const t=document.createElement("span");t.style.backgroundColor=d,t.style.borderRadius=".2rem",t.appendChild(document.createTextNode(r(o.value))),c.appendChild(t)}),l.appendChild(c)},a=()=>{document.querySelectorAll(".original").forEach(e=>i(e,e.nextElementSibling)),document.removeEventListener("DOMContentLoaded",a)};document.addEventListener("DOMContentLoaded",a)})();
@@ -0,0 +1,72 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
((document, Joomla) => {
if (!Joomla || typeof Joomla.Text._ !== 'function') {
throw new Error('core.js was not properly initialised');
}
document.addEventListener('DOMContentLoaded', () => {
document.getElementById('toolbar-load').addEventListener('click', () => {
const toolbarLoad = document.getElementById('toolbar-load');
if (!toolbarLoad.disabled) {
const ids = document.querySelectorAll('input[id*="cb"]:checked');
if (ids.length === 1) {
// Add version item id to URL
const url = `${toolbarLoad.childNodes[1].getAttribute('data-url')}&version_id=${ids[0].value}`;
if (window.parent && url) {
window.parent.location = url;
}
} else {
Joomla.renderMessages({
error: [Joomla.Text._('COM_CONTENTHISTORY_BUTTON_SELECT_ONE_VERSION')]
});
}
}
return false;
});
document.getElementById('toolbar-preview').addEventListener('click', () => {
const toolbarPreview = document.getElementById('toolbar-preview');
if (!toolbarPreview.disabled) {
const windowSizeArray = ['width=800, height=600, resizable=yes, scrollbars=yes'];
const ids = document.querySelectorAll('input[id*="cb"]:checked');
if (ids.length === 1) {
// Add version item id to URL
const url = `${toolbarPreview.childNodes[1].getAttribute('data-url')}&version_id=${ids[0].value}`;
if (window.parent && url) {
window.open(url, '', windowSizeArray.toString());
}
} else {
Joomla.renderMessages({
error: [Joomla.Text._('COM_CONTENTHISTORY_BUTTON_SELECT_ONE_VERSION')]
});
}
}
return false;
});
document.getElementById('toolbar-compare').addEventListener('click', () => {
const toolbarCompare = document.getElementById('toolbar-compare');
if (!toolbarCompare.disabled) {
const windowSizeArray = ['width=1000, height=600, resizable=yes, scrollbars=yes'];
const ids = document.querySelectorAll('input[id*="cb"]:checked');
if (ids.length === 0) {
Joomla.renderMessages({
error: [Joomla.Text._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST')]
});
} else if (ids.length === 2) {
// Add version item ids to URL
const url = `${toolbarCompare.childNodes[1].getAttribute('data-url')}&id1=${ids[0].value}&id2=${ids[1].value}`;
if (window.parent && url) {
window.open(url, '', windowSizeArray.toString());
}
} else {
Joomla.renderMessages({
error: [Joomla.Text._('COM_CONTENTHISTORY_BUTTON_SELECT_TWO_VERSIONS')]
});
}
}
return false;
});
});
})(document, Joomla);
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/((e,r)=>{if(!r||typeof r.Text._!="function")throw new Error("core.js was not properly initialised");e.addEventListener("DOMContentLoaded",()=>{e.getElementById("toolbar-load").addEventListener("click",()=>{const i=e.getElementById("toolbar-load");if(!i.disabled){const s=e.querySelectorAll('input[id*="cb"]:checked');if(s.length===1){const t=`${i.childNodes[1].getAttribute("data-url")}&version_id=${s[0].value}`;window.parent&&t&&(window.parent.location=t)}else r.renderMessages({error:[r.Text._("COM_CONTENTHISTORY_BUTTON_SELECT_ONE_VERSION")]})}return!1}),e.getElementById("toolbar-preview").addEventListener("click",()=>{const i=e.getElementById("toolbar-preview");if(!i.disabled){const s=["width=800, height=600, resizable=yes, scrollbars=yes"],t=e.querySelectorAll('input[id*="cb"]:checked');if(t.length===1){const l=`${i.childNodes[1].getAttribute("data-url")}&version_id=${t[0].value}`;window.parent&&l&&window.open(l,"",s.toString())}else r.renderMessages({error:[r.Text._("COM_CONTENTHISTORY_BUTTON_SELECT_ONE_VERSION")]})}return!1}),e.getElementById("toolbar-compare").addEventListener("click",()=>{const i=e.getElementById("toolbar-compare");if(!i.disabled){const s=["width=1000, height=600, resizable=yes, scrollbars=yes"],t=e.querySelectorAll('input[id*="cb"]:checked');if(t.length===0)r.renderMessages({error:[r.Text._("JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST")]});else if(t.length===2){const l=`${i.childNodes[1].getAttribute("data-url")}&id1=${t[0].value}&id2=${t[1].value}`;window.parent&&l&&window.open(l,"",s.toString())}else r.renderMessages({error:[r.Text._("COM_CONTENTHISTORY_BUTTON_SELECT_TWO_VERSIONS")]})}return!1})})})(document,Joomla);
@@ -0,0 +1,45 @@
{
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
"name": "com_cpanel",
"version": "4.0.0",
"description": "Joomla CMS",
"license": "GPL-2.0-or-later",
"assets": [
{
"name": "com_cpanel.admin-addmodule",
"type": "script",
"uri": "",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"deprecated": true
},
{
"name": "com_cpanel.admin-cpanel",
"type": "script",
"uri": "com_cpanel/admin-cpanel-default.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "5ca2c9"
},
{
"name": "com_cpanel.admin-system-loader",
"type": "script",
"uri": "com_cpanel/admin-system-loader.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "70012e"
}
]
}
@@ -0,0 +1,100 @@
/**
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* Debounce
* https://gist.github.com/nmsdvid/8807205
*
* @param { function } callback The callback function to be executed
* @param { int } time The time to wait before firing the callback
* @param { int } interval The interval
*/
const debounce = (callback, time = 250, interval) => (...args) => clearTimeout(interval, interval = setTimeout(callback, time, ...args));
((window, document, Joomla) => {
Joomla.unpublishModule = element => {
// Get variables
const baseUrl = 'index.php?option=com_modules&task=modules.unpublish&format=json';
const id = element.getAttribute('data-module-id');
Joomla.request({
url: `${baseUrl}&cid=${id}`,
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
onSuccess: () => {
const wrapper = element.closest('.module-wrapper');
wrapper.parentNode.removeChild(wrapper);
Joomla.renderMessages({
message: [Joomla.Text._('COM_CPANEL_UNPUBLISH_MODULE_SUCCESS')]
});
},
onError: () => {
Joomla.renderMessages({
error: [Joomla.Text._('COM_CPANEL_UNPUBLISH_MODULE_ERROR')]
});
}
});
};
const onBoot = () => {
const cpanelModules = document.getElementById('content');
if (cpanelModules) {
cpanelModules.querySelectorAll('.unpublish-module').forEach(link => {
link.addEventListener('click', ({
target
}) => Joomla.unpublishModule(target));
});
}
// Cleanup
document.removeEventListener('DOMContentLoaded', onBoot);
};
// Initialise
document.addEventListener('DOMContentLoaded', onBoot);
// Masonry layout for cpanel cards
const MasonryLayout = {
$gridBox: null,
gridAutoRows: 0,
gridRowGap: 10,
// Calculate "grid-row-end" property
resizeGridItem($cell, rowHeight, rowGap) {
const $content = $cell.querySelector('.card');
if ($content) {
const contentHeight = $content.getBoundingClientRect().height + rowGap;
const rowSpan = Math.ceil(contentHeight / (rowHeight + rowGap));
$cell.style.gridRowEnd = `span ${rowSpan}`;
}
},
// Check a size of every cell in the grid
resizeAllGridItems() {
const $gridCells = [].slice.call(this.$gridBox.children);
$gridCells.forEach($cell => this.resizeGridItem($cell, this.gridAutoRows, this.gridRowGap));
},
initialise() {
this.$gridBox = document.querySelector('#cpanel-modules .card-columns');
const gridStyle = window.getComputedStyle(this.$gridBox);
this.gridAutoRows = parseInt(gridStyle.getPropertyValue('grid-auto-rows'), 10) || this.gridAutoRows;
this.gridRowGap = parseInt(gridStyle.getPropertyValue('grid-row-gap'), 10) || this.gridRowGap;
this.resizeAllGridItems();
// Recheck the layout after all content (fonts and images) is loaded.
window.addEventListener('load', () => this.resizeAllGridItems());
// Recheck the layout when the menu is toggled
window.addEventListener('joomla:menu-toggle', () => {
// 300ms is animation time, need to wait for the animation to end
setTimeout(() => this.resizeAllGridItems(), 330);
});
// Watch on window resize
window.addEventListener('resize', debounce(() => this.resizeAllGridItems(), 50));
}
};
// Initialise Masonry layout at the very beginning, to avoid jumping.
// We can do this because the script is deferred.
MasonryLayout.initialise();
})(window, document, window.Joomla);
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/const debounce=(i,r=250,t)=>(...d)=>clearTimeout(t,t=setTimeout(i,r,...d));((i,r,t)=>{t.unpublishModule=e=>{const s="index.php?option=com_modules&task=modules.unpublish&format=json",o=e.getAttribute("data-module-id");t.request({url:`${s}&cid=${o}`,method:"POST",headers:{"Content-Type":"application/json"},onSuccess:()=>{const n=e.closest(".module-wrapper");n.parentNode.removeChild(n),t.renderMessages({message:[t.Text._("COM_CPANEL_UNPUBLISH_MODULE_SUCCESS")]})},onError:()=>{t.renderMessages({error:[t.Text._("COM_CPANEL_UNPUBLISH_MODULE_ERROR")]})}})};const d=()=>{const e=r.getElementById("content");e&&e.querySelectorAll(".unpublish-module").forEach(s=>{s.addEventListener("click",({target:o})=>t.unpublishModule(o))}),r.removeEventListener("DOMContentLoaded",d)};r.addEventListener("DOMContentLoaded",d),{$gridBox:null,gridAutoRows:0,gridRowGap:10,resizeGridItem(e,s,o){const n=e.querySelector(".card");if(n){const l=n.getBoundingClientRect().height+o,a=Math.ceil(l/(s+o));e.style.gridRowEnd=`span ${a}`}},resizeAllGridItems(){[].slice.call(this.$gridBox.children).forEach(s=>this.resizeGridItem(s,this.gridAutoRows,this.gridRowGap))},initialise(){this.$gridBox=r.querySelector("#cpanel-modules .card-columns");const e=i.getComputedStyle(this.$gridBox);this.gridAutoRows=parseInt(e.getPropertyValue("grid-auto-rows"),10)||this.gridAutoRows,this.gridRowGap=parseInt(e.getPropertyValue("grid-row-gap"),10)||this.gridRowGap,this.resizeAllGridItems(),i.addEventListener("load",()=>this.resizeAllGridItems()),i.addEventListener("joomla:menu-toggle",()=>{setTimeout(()=>this.resizeAllGridItems(),330)}),i.addEventListener("resize",debounce(()=>this.resizeAllGridItems(),50))}}.initialise()})(window,document,window.Joomla);
@@ -0,0 +1,54 @@
/**
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
((document, Joomla) => {
const init = () => {
// Cleanup
window.removeEventListener('load', init);
// Get the elements
const elements = document.querySelectorAll('.system-counter');
if (elements.length) {
elements.forEach(element => {
const badgeurl = element.getAttribute('data-url');
if (badgeurl && Joomla && Joomla.request && typeof Joomla.request === 'function') {
Joomla.enqueueRequest({
url: badgeurl,
method: 'POST',
promise: true
}).then(xhr => {
const resp = xhr.responseText;
let response;
try {
response = JSON.parse(resp);
} catch (error) {
throw new Error('Failed to parse JSON');
}
if (response.error || !response.success) {
element.classList.remove('icon-spin', 'icon-spinner');
element.classList.add('text-danger', 'icon-remove');
} else if (response.data) {
const elem = document.createElement('span');
elem.classList.add('float-end', 'badge', 'bg-warning', 'text-dark');
elem.innerHTML = Joomla.sanitizeHtml(response.data);
element.parentNode.replaceChild(elem, element);
} else {
element.classList.remove('icon-spin', 'icon-spinner');
element.classList.add('icon-check', 'text-success');
}
}).catch(() => {
element.classList.remove('icon-spin', 'icon-spinner');
element.classList.add('text-danger', 'icon-remove');
});
}
});
}
};
// Give some times to the layout and other scripts to settle their stuff
window.addEventListener('load', () => {
setTimeout(init, 300);
});
})(document, Joomla);
@@ -0,0 +1,4 @@
/**
* @copyright (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/((n,s)=>{const i=()=>{window.removeEventListener("load",i);const c=n.querySelectorAll(".system-counter");c.length&&c.forEach(e=>{const a=e.getAttribute("data-url");a&&s&&s.request&&typeof s.request=="function"&&s.enqueueRequest({url:a,method:"POST",promise:!0}).then(o=>{const d=o.responseText;let t;try{t=JSON.parse(d)}catch{throw new Error("Failed to parse JSON")}if(t.error||!t.success)e.classList.remove("icon-spin","icon-spinner"),e.classList.add("text-danger","icon-remove");else if(t.data){const r=n.createElement("span");r.classList.add("float-end","badge","bg-warning","text-dark"),r.innerHTML=s.sanitizeHtml(t.data),e.parentNode.replaceChild(r,e)}else e.classList.remove("icon-spin","icon-spinner"),e.classList.add("icon-check","text-success")}).catch(()=>{e.classList.remove("icon-spin","icon-spinner"),e.classList.add("text-danger","icon-remove")})})};window.addEventListener("load",()=>{setTimeout(i,300)})})(document,Joomla);
@@ -0,0 +1,71 @@
{
"$schema": "https://developer.joomla.org/schemas/json-schema/web_assets.json",
"name": "com_fields",
"version": "4.0.0",
"description": "Joomla CMS",
"license": "GPL-2.0-or-later",
"assets": [
{
"name": "com_fields.admin-field-edit",
"type": "script",
"uri": "com_fields/admin-field-edit.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "f3c19c"
},
{
"name": "com_fields.admin-field-typehaschanged",
"type": "script",
"uri": "com_fields/admin-field-typehaschanged.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "1fbf0a"
},
{
"name": "com_fields.admin-field-changecontext",
"type": "script",
"uri": "com_fields/admin-field-changecontext.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "8abe08"
},
{
"name": "com_fields.admin-fields-batch",
"type": "script",
"uri": "com_fields/admin-fields-default-batch.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"version": "eebfc6"
},
{
"name": "com_fields.admin-fields-modal",
"type": "script",
"uri": "com_fields/admin-fields-modal.min.js",
"dependencies": [
"core"
],
"attributes": {
"type": "module"
},
"deprecated": true,
"deprecatedMsg": "Use postMessage() directly or with help of [modal-content-select] asset. To post the modal selection.",
"version": "be088f"
}
]
}

Some files were not shown because too many files have changed in this diff Show More