CoreFiles by mySites.guru
admin-users-mail-es5.js38 lines, 1,347 bytes, from Joomla_4.3.0-alpha2-Alpha-Full_Package.zip
Raw History Compare with 4.3.0-alpha1
md5
51182196854572b59a61aa7e8af99cc9
sha1
96ef57e25f57ebf85cf2183b6f6872fdbde60223
sha256
1efa3f2fb9bb740a9ca032bd1c9c4e9ec1d76ee07ccba2936d7b9fd989fd0232
(function () {
  'use strict';

  /**
   * @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
   */

  (function () {
    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.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.