CoreFiles by mySites.guru
changelog.es6.js59 lines, 1,747 bytes, from Joomla_4.0.0-alpha11-Alpha-Full_Package.zip
Raw History Compare with 4.0.0-alpha10
md5
5bcc989f133276462292a7d91727a6b7
sha1
e59f7083039e810f65f66baa175950a33b84462a
sha256
66e7d936dff07dd17682ca60336cf224f4eb3a20be4bf1d2c3f48e2fbe7a30ae
/**
* 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 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */
Joomla = window.Joomla || {};

(Joomla => {
  'use strict';

  document.addEventListener('DOMContentLoaded', () => {
    const modals = document.getElementsByClassName('changelogModal');
    Array.from(modals).forEach(element => {
      element.addEventListener('click', modal => {
        Joomla.loadChangelog(modal.target.dataset.jsExtensionid, modal.target.dataset.jsView);
      });
    });
  });
  /**
   * Load the changelog data
   *
   * @param extensionId The extension ID to load the changelog for
   * @param view The view the changelog is for,
   *             this is used to determine which version number to show
   *
   * @since   4.0.0
   */

  Joomla.loadChangelog = (extensionId, view) => {
    const modal = document.querySelector("#changelogModal".concat(extensionId, " .modal-body"));
    Joomla.request({
      url: "index.php?option=com_installer&task=manage.loadChangelog&eid=".concat(extensionId, "&source=").concat(view, "&format=json"),
      onSuccess: response => {
        let message = '';

        try {
          const result = JSON.parse(response);

          if (result.error) {
            [message] = result;
          } else {
            message = result.data;
          }
        } catch (exception) {
          message = exception;
        }

        modal.innerHTML = message;
      },
      onError: function onError(xhr) {
        modal.innerHTML = xhr.statusText;
      }
    });
  };
})(Joomla);

The same content is in 3 releases, Joomla 4.0.0-alpha10 to 4.0.0-alpha12. See them all, or every version of this file.