CoreFiles by mySites.guru
admin-users-mail-es5.js36 lines, 1,257 bytes, from Joomla_4.2.4-Stable-Full_Package.zip
Raw History Compare with 4.2.3
md5
42abc90c3139e9f2f7eee181ff385ddd
sha1
ac7e374658b027946417c981a4f5aa9d0a090f6a
sha256
ca3270548f1789af2d21cd7d79e95148fc1123aaf1c5c1cb79ca2703597ef11f
(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 45 releases, Joomla 4.0.6-rc1 to 4.2.9. See them all, or every version of this file.