[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/media/com_installer/js/ -> changelog-es5.js (source)

   1  (function () {
   2    'use strict';
   3  
   4    /**
   5     * @copyright   (C) 2019 Open Source Matters, Inc. <https://www.joomla.org>
   6     * @license     GNU General Public License version 2 or later; see LICENSE.txt
   7     */
   8    Joomla = window.Joomla || {};
   9  
  10    (function (Joomla) {
  11      document.addEventListener('DOMContentLoaded', function () {
  12        var modals = document.getElementsByClassName('changelogModal');
  13        Array.from(modals).forEach(function (element) {
  14          element.addEventListener('click', function (modal) {
  15            Joomla.loadChangelog(modal.target.dataset.jsExtensionid, modal.target.dataset.jsView);
  16          });
  17        });
  18      });
  19      /**
  20       * Load the changelog data
  21       *
  22       * @param extensionId The extension ID to load the changelog for
  23       * @param view The view the changelog is for,
  24       *             this is used to determine which version number to show
  25       *
  26       * @since   4.0.0
  27       */
  28  
  29      Joomla.loadChangelog = function (extensionId, view) {
  30        var modal = document.querySelector("#changelogModal" + extensionId + " .modal-body");
  31        Joomla.request({
  32          url: "index.php?option=com_installer&task=manage.loadChangelog&eid=" + extensionId + "&source=" + view + "&format=json",
  33          onSuccess: function onSuccess(response) {
  34            var message = '';
  35  
  36            try {
  37              var result = JSON.parse(response);
  38  
  39              if (result.error) {
  40                message = result[0];
  41              } else {
  42                message = result.data;
  43              }
  44            } catch (exception) {
  45              message = exception;
  46            }
  47  
  48            modal.innerHTML = Joomla.sanitizeHtml(message);
  49          },
  50          onError: function onError(xhr) {
  51            modal.innerHTML = Joomla.sanitizeHtml(xhr.statusText);
  52          }
  53        });
  54      };
  55    })(Joomla);
  56  
  57  })();


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer