CoreFiles by mySites.guru
admin-fields-modal.js30 lines, 799 bytes, from Joomla_4.2.3-Stable-Full_Package.zip
Raw History Compare with 4.2.2
md5
e1b0b0d0e04f4d4b88ab92506faadafe
sha1
36380c6a6c65a19d5ba9ae6e7a41979f76d0fdfe
sha256
d78bdac3ab73760ecf4ed1c3de57e54ea9e2daf62b58b792383a38afb3c86867
/**
 * @copyright  (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */
(Joomla => {

  if (!window.parent.Joomla) {
    throw new Error('core.js was not properly initialised');
  }

  if (!Joomla) {
    window.Joomla = {};
  }

  Joomla.fieldIns = (id, editor) => {
    window.parent.Joomla.editors.instances[editor].replaceSelection(`{field ${id}}`);

    if (window.parent.Joomla.Modal) {
      window.parent.Joomla.Modal.getCurrent().close();
    }
  };

  Joomla.fieldgroupIns = (id, editor) => {
    window.parent.Joomla.editors.instances[editor].replaceSelection(`{fieldgroup ${id}}`);

    if (window.parent.Joomla.Modal) {
      window.parent.Joomla.Modal.getCurrent().close();
    }
  };
})(Joomla);

The same content is in 68 releases, Joomla 4.0.0-rc1 to 4.2.9. See them all, or every version of this file.