CoreFiles by mySites.guru
admin-users-mail.es6.js37 lines, 1,206 bytes, from Joomla_4.0.0-alpha10-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha9
md5
149a9a6c50c9bde6a837805d5933cd89
sha1
ec2d8e89673630672fc2e46fc1d5d3af8987ec58
sha256
0d21782ed6751e839735e1e0d79cdec167289237fe9dbefc76a4c627ae46ebb2
/**
* PLEASE DO NOT MODIFY THIS FILE. WORK ON THE ES6 VERSION.
* OTHERWISE YOUR CHANGES WILL BE REPLACED ON THE NEXT BUILD.
**/

/**
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
(() => {
  'use strict';

  document.addEventListener('DOMContentLoaded', () => {
    Joomla.submitbutton = pressbutton => {
      const form = document.adminForm;

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


      if (form.jform_subject.value === '') {
        // TODO replace with joomla-alert
        alert(Joomla.JText._('COM_USERS_MAIL_PLEASE_FILL_IN_THE_SUBJECT'));
      } else if (Joomla.getSelectedValue('adminForm', 'jform[group]') < 0) {
        // TODO replace with joomla-alert
        alert(Joomla.JText._('COM_USERS_MAIL_PLEASE_SELECT_A_GROUP'));
      } else if (form.jform_message.value === '') {
        // TODO replace with joomla-alert
        alert(Joomla.JText._('COM_USERS_MAIL_PLEASE_FILL_IN_THE_MESSAGE'));
      } else {
        Joomla.submitform(pressbutton);
      }
    };
  });
})();

The same content is in 4 releases, Joomla 4.0.0-alpha7 to 4.0.0-alpha10. See them all, or every version of this file.