__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
/**
* @copyright (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* JavaScript behavior to allow shift select in administrator grids
*/
class JMultiSelect {
constructor(container) {
this.tableEl = container;
this.formEl = container.closest('form');
this.rowSelector = 'tr[class^="row"]';
this.boxSelector = 'input[type="checkbox"][name="cid[]"]';
this.checkallToggle = this.tableEl.querySelector('[name="checkall-toggle"]');
this.prevRow = null;
// Use delegation listener, to allow dynamic tables
this.tableEl.addEventListener('click', event => {
if (!event.target.closest(this.rowSelector)) {
return;
}
this.onRowClick(event);
});
if (this.checkallToggle) {
this.checkallToggle.addEventListener('click', ({
target
}) => {
const isChecked = target.checked;
this.getRows().forEach(row => {
this.changeBg(row, isChecked);
});
});
}
}
getRows() {
return Array.from(this.tableEl.querySelectorAll(this.rowSelector));
}
// Changes the row class depends on selection
// eslint-disable-next-line class-methods-use-this
changeBg(row, isChecked) {
row.classList.toggle('row-selected', isChecked);
}
// Handle click on a row
onRowClick({
target,
shiftKey
}) {
// Do not interfere with links, buttons, inputs and other interactive elements
if (!target.matches(this.boxSelector) && target.closest('a, button, input, select, textarea, details, dialog, audio, video')) {
return;
}
// Get clicked row and checkbox in it
const currentRow = target.closest(this.rowSelector);
const currentBox = target.matches(this.boxSelector) ? target : currentRow.querySelector(this.boxSelector);
if (!currentBox) {
return;
}
const isChecked = currentBox !== target ? !currentBox.checked : currentBox.checked;
if (isChecked !== currentBox.checked) {
currentBox.checked = isChecked;
Joomla.isChecked(isChecked, this.formEl);
}
this.changeBg(currentRow, isChecked);
// Select rows in range
if (shiftKey && this.prevRow) {
// Prevent text selection
document.getSelection().removeAllRanges();
// Re-query all rows, because they may be modified during sort operations
const rows = this.getRows();
const idxStart = rows.indexOf(this.prevRow);
const idxEnd = rows.indexOf(currentRow);
// Check for more than 2 row selected
if (idxStart >= 0 && idxEnd >= 0 && Math.abs(idxStart - idxEnd) > 1) {
const slice = idxStart < idxEnd ? rows.slice(idxStart, idxEnd + 1) : rows.slice(idxEnd, idxStart + 1);
slice.forEach(row => {
if (row === currentRow) {
return;
}
const rowBox = row.querySelector(this.boxSelector);
if (rowBox && rowBox.checked !== isChecked) {
rowBox.checked = isChecked;
this.changeBg(row, isChecked);
Joomla.isChecked(isChecked, this.formEl);
}
});
}
}
this.prevRow = currentRow;
}
}
const onBoot = container => {
let selector = '#adminForm';
const confSelector = window.Joomla ? Joomla.getOptions('js-multiselect', {}).formName : '';
if (confSelector) {
const pref = confSelector[0];
selector = pref !== '.' && pref !== '#' ? `#${confSelector}` : confSelector;
}
container.querySelectorAll(selector).forEach(formElement => {
if (formElement && !('multiselect' in formElement.dataset)) {
formElement.dataset.multiselect = '';
// eslint-disable-next-line no-new
new JMultiSelect(formElement);
}
});
};
onBoot(document);
document.addEventListener('joomla:updated', ({
target
}) => onBoot(target));
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| editors | Folder | 0775 |
|
|
| fields | Folder | 0775 |
|
|
| core.js | File | 25.96 KB | 0664 |
|
| core.min.js | File | 7.58 KB | 0664 |
|
| core.min.js.gz | File | 3.14 KB | 0664 |
|
| draggable.js | File | 5.66 KB | 0664 |
|
| draggable.min.js | File | 2.54 KB | 0664 |
|
| draggable.min.js.gz | File | 1.05 KB | 0664 |
|
| highlight.js | File | 61.61 KB | 0664 |
|
| highlight.min.js | File | 15.58 KB | 0664 |
|
| highlight.min.js.gz | File | 5.44 KB | 0664 |
|
| inlinehelp.js | File | 2.18 KB | 0664 |
|
| inlinehelp.min.js | File | 805 B | 0664 |
|
| inlinehelp.min.js.gz | File | 486 B | 0664 |
|
| joomla-core-loader.js | File | 4.91 KB | 0664 |
|
| joomla-core-loader.min.js | File | 4.02 KB | 0664 |
|
| joomla-core-loader.min.js.gz | File | 1.66 KB | 0664 |
|
| joomla-dialog-autocreate.js | File | 2.9 KB | 0664 |
|
| joomla-dialog-autocreate.min.js | File | 1.22 KB | 0664 |
|
| joomla-dialog-autocreate.min.js.gz | File | 664 B | 0664 |
|
| joomla-dialog.js | File | 17.7 KB | 0664 |
|
| joomla-dialog.min.js | File | 8.29 KB | 0664 |
|
| joomla-dialog.min.js.gz | File | 2.43 KB | 0664 |
|
| joomla-hidden-mail.js | File | 2.26 KB | 0664 |
|
| joomla-hidden-mail.min.js | File | 1.53 KB | 0664 |
|
| joomla-hidden-mail.min.js.gz | File | 721 B | 0664 |
|
| joomla-toolbar-button.js | File | 3.56 KB | 0664 |
|
| joomla-toolbar-button.min.js | File | 2.08 KB | 0664 |
|
| joomla-toolbar-button.min.js.gz | File | 868 B | 0664 |
|
| keepalive.js | File | 1 KB | 0664 |
|
| keepalive.min.js | File | 741 B | 0664 |
|
| keepalive.min.js.gz | File | 430 B | 0664 |
|
| list-view.js | File | 2.75 KB | 0664 |
|
| list-view.min.js | File | 1.59 KB | 0664 |
|
| list-view.min.js.gz | File | 555 B | 0664 |
|
| messages.js | File | 10.19 KB | 0664 |
|
| messages.min.js | File | 5.41 KB | 0664 |
|
| messages.min.js.gz | File | 1.77 KB | 0664 |
|
| modal-content-select.js | File | 1.14 KB | 0664 |
|
| modal-content-select.min.js | File | 781 B | 0664 |
|
| modal-content-select.min.js.gz | File | 497 B | 0664 |
|
| multiselect.js | File | 3.77 KB | 0664 |
|
| multiselect.min.js | File | 1.86 KB | 0664 |
|
| multiselect.min.js.gz | File | 917 B | 0664 |
|
| searchtools.js | File | 18.69 KB | 0664 |
|
| searchtools.min.js | File | 10.4 KB | 0664 |
|
| searchtools.min.js.gz | File | 2.56 KB | 0664 |
|
| showon.js | File | 9.91 KB | 0664 |
|
| showon.min.js | File | 3.55 KB | 0664 |
|
| showon.min.js.gz | File | 1.39 KB | 0664 |
|
| table-columns.js | File | 6 KB | 0664 |
|
| table-columns.min.js | File | 3.39 KB | 0664 |
|
| table-columns.min.js.gz | File | 1.28 KB | 0664 |
|
| treeselectmenu.js | File | 5.74 KB | 0664 |
|
| treeselectmenu.min.js | File | 4.07 KB | 0664 |
|
| treeselectmenu.min.js.gz | File | 976 B | 0664 |
|