CoreFiles by mySites.guru
admin-fields-modal.js35 lines, 1,285 bytes, from Joomla_5.4.2-Stable-Full_Package.zip
Raw History Compare with 5.4.1
md5
e522999d388406199dd98fa42cdfd038
sha1
e79be51fd15d78706c16f60eb9b1d8999060bcdd
sha256
472042680199f7af16383918f2c3d9f4e4b507fffe5f98e1cd17ece979df4c02
/**
 * @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) => {
    // Use a JoomlaExpectingPostMessage flag to be able to distinct legacy methods
    if (window.parent.JoomlaExpectingPostMessage) {
      return;
    }
    console.warn('Method Joomla.fieldIns() is deprecated. Use postMessage() instead.');
    window.parent.Joomla.editors.instances[editor].replaceSelection(`{field ${id}}`);
    if (window.parent.Joomla.Modal) {
      window.parent.Joomla.Modal.getCurrent().close();
    }
  };
  Joomla.fieldgroupIns = (id, editor) => {
    // Use a JoomlaExpectingPostMessage flag to be able to distinct legacy methods
    if (window.parent.JoomlaExpectingPostMessage) {
      return;
    }
    console.warn('Method Joomla.fieldgroupIns() is deprecated. Use postMessage() instead.');
    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 73 releases, Joomla 5.4.0-beta1 to 6.2.1-rc1. See them all, or every version of this file.