CoreFiles by mySites.guru
admin-users-groups-es5.js34 lines, 967 bytes, from Joomla_4.0.1-Stable-Full_Package.zip
Raw History Compare with 4.0.0
md5
6e58db3e50bc029c1cd4fb1dd212e3c8
sha1
c1b26fed7f4753d2a35356d1316f3cfbc3a5b980
sha256
5538d688c13d6f4a486f5312280d7d62be026454edcb28861f9fedfb65004a78
(function () {
  'use strict';

  /**
   * @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 || {};

  (function (Joomla) {
    document.addEventListener('DOMContentLoaded', function () {
      Joomla.submitbutton = function (task) {
        if (task === 'groups.delete') {
          var cids = document.getElementsByName('cid[]');

          for (var 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.Text._('COM_USERS_GROUPS_CONFIRM_DELETE'))) {
                Joomla.submitform(task);
              }

              return false;
            }
          }
        }

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

}());

The same content is in 22 releases, Joomla 4.0.0-rc2 to 4.1.0-beta2. See them all, or every version of this file.