CoreFiles by mySites.guru
admin-users-mail.js34 lines, 1,231 bytes, from Joomla_4.3.0-beta2-Beta-Full_Package.zip
Raw History Compare with 4.3.0-beta1
md5
0a1b6e3aa5fd0288be8c6acf2199eca0
sha1
35865ea30306dcc62ad9bab13069d374425792f0
sha256
32a7d586090136e39fd2d8c79e2f13b38d97387284afc2826c352080a2c8a545
/**
 * @copyright   (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 *
 * @deprecated  This file is deprecated and will be removed with Joomla 5.0
 */

(() => {

  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);
      }
    };
  });
})();

The same content is in 8 releases, Joomla 4.3.0-alpha2 to 4.3.0-rc2. See them all, or every version of this file.