CoreFiles by mySites.guru
admin-users-mail-es5.js39 lines, 1,369 bytes, from Joomla_4.4.2-Stable-Full_Package.zip
Raw History Compare with 4.4.1
md5
94210ca12864bdba6308e3699a5c0f8f
sha1
aeb9ec0b5deb28c8006efbe1ff56164ba6aa477e
sha256
db3100b3a12167cd6e87aef999e1fba96a1c1262cad692d9614ddd864b19c799
(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  4.3
   *              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 48 releases, Joomla 4.3.0-rc3 to 5.0.0-alpha1. See them all, or every version of this file.