CoreFiles by mySites.guru
admin-fields-modal.js37 lines, 1,371 bytes, from Joomla_5.2.2-Stable-Full_Package.zip
Raw History Compare with 5.2.1
md5
9285160efc07de455753c25ff2818577
sha1
79da7fe75e0c1b66c2a0e95bb05c8a23902a27e4
sha256
03670c3543670fe8976b7c1d7ea77ae1d99dcd026bfda8ce41803f8772947a7f
/**
 * @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;
    }
    // eslint-disable-next-line no-console
    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;
    }
    // eslint-disable-next-line no-console
    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 78 releases, Joomla 5.0.0-beta1 to 6.0.0-alpha3. See them all, or every version of this file.