CoreFiles by mySites.guru
admin-users-mail.js32 lines, 1,152 bytes, from Joomla_4.3.0-alpha1-Alpha-Full_Package.zip
Raw History Compare with 4.2.0-alpha3
md5
f3078c62421a7d37a4368606d864b389
sha1
60d0fecf8ca131c77ae31cf110fe0238422277f0
sha256
e7c35ae9ee7f062ca0d47ff8bb7bf2a9462e99608ca4710aa1d15f7489bf7c70
/**
 * @copyright   (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

(() => {

  document.addEventListener('DOMContentLoaded', () => {
    Joomla.submitbutton = pressbutton => {
      const form = document.adminForm;
      const 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);
      }
    };
  });
})();

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