CoreFiles by mySites.guru
admin-users-mail.js38 lines, 1,323 bytes, from Joomla_4.0.0-alpha11-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha10
md5
4eab3cca50e485b29cc38a91cdbb654a
sha1
0ee75702ec114881a245b52cf3a42fbeb9abcbda
sha256
326b0c54c805a42b29479e48ebd16dba223acf09beff06df2b5931eac48b60ae
/**
* 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;
      var html = document.createElement('joomla-alert');

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


      if (form.jform_subject.value === '') {
        html.innerText = Joomla.JText._('COM_USERS_MAIL_PLEASE_FILL_IN_THE_SUBJECT');
        form.insertAdjacentElement('afterbegin', html);
      } else if (form.jform_group.value < 0) {
        html.innerText = Joomla.JText._('COM_USERS_MAIL_PLEASE_SELECT_A_GROUP');
        form.insertAdjacentElement('afterbegin', html);
      } else if (form.jform_message.value === '') {
        html.innerText = Joomla.JText._('COM_USERS_MAIL_PLEASE_FILL_IN_THE_MESSAGE');
        form.insertAdjacentElement('afterbegin', html);
      } else {
        Joomla.submitform(pressbutton);
      }
    };
  });
})();

The same content is in 2 releases, Joomla 4.0.0-alpha11 to 4.0.0-alpha12. See them all, or every version of this file.