CoreFiles by mySites.guru
admin-users-groups.js30 lines, 860 bytes, from Joomla_4.0.0-rc1-Release_Candidate-Full_Package.zip
Raw History Compare with 3.10.12-rc1
md5
7d611f061a0d79b11d962d7ed8ff8075
sha1
f57f317ab664842f4648f318704f8b47a52e2b92
sha256
b4167a9e4640b7ee34312a4e9890cdead6107c7f5322e294af4cdf2a72538f17
/**
 * @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.addEventListener('DOMContentLoaded', () => {
    Joomla.submitbutton = task => {
      if (task === 'groups.delete') {
        const cids = document.getElementsByName('cid[]');

        for (let i = 0; i < cids.length; i += 1) {
          if (cids[i].checked && cids[i].parentNode.getAttribute('data-usercount') !== '0') {
            // TODO replace with joomla-alert
            if (window.confirm(Joomla.JText._('COM_USERS_GROUPS_CONFIRM_DELETE'))) {
              Joomla.submitform(task);
            }

            return false;
          }
        }
      }

      Joomla.submitform(task);
      return false;
    };
  });
})(Joomla);

No other release has this exact content. See every version of this file.