CoreFiles by mySites.guru
admin-users-mail.js37 lines, 1,224 bytes, from Joomla_4.0.0-alpha7-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha6
md5
3b4a3637cc8cfb3ea5c55f533438df41
sha1
4d7d433e2cea27a58441de87c780099948248ca4
sha256
1f3c4503362e2f9a7ae5c1098ed9a7fa80246209d49e7fc8228b2acf82a107cd
/**
* 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
 */
(function () {
  'use strict';

  document.addEventListener('DOMContentLoaded', function () {
    Joomla.submitbutton = function (pressbutton) {
      var 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.