CoreFiles by mySites.guru
admin-modules-modal.js47 lines, 1,904 bytes, from Joomla_4.0.0-alpha6-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha5
md5
06e59b8fc0288b0bcc5b9592dcb79ac4
sha1
7f29c7d2b1cb504fdf0d06bcf7654df80645a656
sha256
2c962fbe10f8057ec51b9818ef1133563e98ef70baeabe8155897a61dd41e641
/**
* PLEASE DO NOT MODIFY THIS FILE. WORK ON THE ES6 VERSION.
* OTHERWISE YOUR CHANGES WILL BE REPLACED ON THE NEXT BUILD.
**/

/**
 * @copyright  Copyright (C) 2005 - 2018 Open Source Matters, Inc. All rights reserved.
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */
document.addEventListener('DOMContentLoaded', function () {
  'use strict';
  /** Get the elements * */

  var modulesLinks = [].slice.call(document.querySelectorAll('.js-module-insert'));
  var positionsLinks = [].slice.call(document.querySelectorAll('.js-position-insert'));
  /** Assign listener for click event (for single module insertion) * */

  modulesLinks.forEach(function (modulesLink) {
    modulesLink.addEventListener('click', function (event) {
      event.preventDefault();
      var type = event.target.getAttribute('data-module');
      var name = event.target.getAttribute('data-title');
      var editor = event.target.getAttribute('data-editor'); // Insert the short tag in the editor

      window.parent.Joomla.editors.instances[editor].replaceSelection("{loadmodule ".concat(type, ",").concat(name, "}")); // Close the modal

      if (window.parent.Joomla.Modal) {
        window.parent.Joomla.Modal.getCurrent().close();
      }
    });
  });
  /** Assign listener for click event (for position insertion) * */

  positionsLinks.forEach(function (positionsLink) {
    positionsLink.addEventListener('click', function (event) {
      event.preventDefault();
      var position = event.target.getAttribute('data-position');
      var editor = event.target.getAttribute('data-editor'); // Insert the short tag in the editor

      window.parent.Joomla.editors.instances[editor].replaceSelection("{loadposition ".concat(position, "}")); // Close the modal

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

No other release has this exact content. See every version of this file.