CoreFiles by mySites.guru
admin-users-mail.es6.js32 lines, 1,085 bytes, from Joomla_4.0.0-alpha5-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha3
md5
be171220854d278217d81fa24652a7d3
sha1
d91d1889a020bb340751141c2e4e633896b2ff0f
sha256
d9a7605808480dd2020bb0a7c23577bdd325d405b5412a7ff8a5db42ae4372ff
/**
 * @copyright   Copyright (C) 2005 - 2018 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 2 releases, Joomla 4.0.0-alpha5 to 4.0.0-alpha6. See them all, or every version of this file.