CoreFiles by mySites.guru
admin-users-mail-es5.js36 lines, 1,257 bytes, from Joomla_4.0.0-Stable-Full_Package.zip
Raw History Compare with 3.10.12
md5
38de1cf3aaef09b89b8f4e57feec3ff2
sha1
3944700e71c38ce74c4f20541d42d05222596288
sha256
22c0b9c5bc14e53991d60119d3678df90eac812d899e74611ec44e7ae741e7e8
(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
   */
  (function () {
    document.addEventListener('DOMContentLoaded', function () {
      Joomla.submitbutton = function (pressbutton) {
        var form = document.adminForm;
        var html = document.createElement('joomla-alert');

        if (pressbutton === 'mail.cancel') {
          Joomla.submitform(pressbutton);
          return;
        } // do field validation


        if (form.jform_subject.value === '') {
          html.innerText = Joomla.Text._('COM_USERS_MAIL_PLEASE_FILL_IN_THE_SUBJECT');
          form.insertAdjacentElement('afterbegin', html);
        } else if (form.jform_group.value < 0) {
          html.innerText = Joomla.Text._('COM_USERS_MAIL_PLEASE_SELECT_A_GROUP');
          form.insertAdjacentElement('afterbegin', html);
        } else if (form.jform_message.value === '') {
          html.innerText = Joomla.Text._('COM_USERS_MAIL_PLEASE_FILL_IN_THE_MESSAGE');
          form.insertAdjacentElement('afterbegin', html);
        } else {
          Joomla.submitform(pressbutton);
        }
      };
    });
  })();

}());

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.