- md5
- d19332dac433debeebd652ec6bdf75d8
- sha1
- 9a72ea724c5f4ae45242c45ff7bc8109b2228aaa
- sha256
- e0e2c3812d115628a6377b28259a17aad635b3a0de481acf88caeb06c3c30182
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
/**
* @copyright Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
Joomla = window.Joomla || {};
(() => {
'use strict';
const options = Joomla.getOptions('menus-edit-modules');
if (options) {
window.viewLevels = options.viewLevels;
window.menuId = parseInt(options.itemId, 10);
}
document.addEventListener('DOMContentLoaded', () => {
const baseLink = 'index.php?option=com_modules&client_id=0&task=module.edit&tmpl=component&view=module&layout=modal&id=';
const assigned1 = document.getElementById('jform_toggle_modules_assigned1');
const assigned0 = document.getElementById('jform_toggle_modules_assigned0');
const published1 = document.getElementById('jform_toggle_modules_published1');
const published0 = document.getElementById('jform_toggle_modules_published0');
const linkElements = [].slice.call(document.getElementsByClassName('module-edit-link'));
const elements = [].slice.call(document.querySelectorAll('#moduleEditModal .modal-footer .btn'));
if (assigned1) {
assigned1.addEventListener('click', () => {
const list = [].slice.call(document.querySelectorAll('tr.no'));
list.forEach((item) => {
item.style.display = 'table-row';
});
});
}
if (assigned0) {
assigned0.addEventListener('click', () => {
const list = [].slice.call(document.querySelectorAll('tr.no'));
list.forEach((item) => {
item.style.display = 'none';
});
});
}
if (published1) {
published1.addEventListener('click', () => {
const list = [].slice.call(document.querySelectorAll('.table tr.unpublished'));
list.forEach((item) => {
item.style.display = 'table-row';
});
});
}
if (published0) {
published0.addEventListener('click', () => {
const list = [].slice.call(document.querySelectorAll('.table tr.unpublished'));
list.forEach((item) => {
item.style.display = 'none';
});
});
}
if (linkElements.length) {
linkElements.forEach((linkElement) => {
linkElement.addEventListener('click', (event) => {
const link = baseLink + event.target.getAttribute('data-moduleId');
const modal = document.getElementById('moduleEditModal');
modal.addEventListener('show.bs.modal', (ev) => {
const iFrame = document.createElement('iframe');
iFrame.src = link;
iFrame.setAttribute('class', 'class="iframe jviewport-height70"');
const body = ev.target.querySelector('.modal-body');
body.innerHTML = '';
body.appendChild(iFrame);
});
});
});
}
if (elements.length) {
elements.forEach((element) => {
element.addEventListener('click', (event) => {
const target = event.target.getAttribute('data-target');
if (target) {
const iframe = document.querySelector('#moduleEditModal iframe');
iframe.contents().querySelector(target).click();
}
});
});
}
});
})();
The same content is in 2 releases, Joomla 4.0.0-alpha5 to 4.0.0-alpha6. See them all, or every version of this file.