CoreFiles by mySites.guru
admin-history-modal-es5.js73 lines, 2,763 bytes, from Joomla_4.0.3-Stable-Full_Package.zip
Raw History Compare with 4.0.2
md5
3c85efdf1bf16cc24df0162d84fb6989
sha1
a2ff029b9e98f23a0b94a4d637fa42e0e72277d0
sha256
c9d2e8a60ba36fa2b6102ab7e51d50a7be6dae6217233c38963b5e168d4bd71d
(function () {
  'use strict';

  /**
   * @copyright  (C) 2018 Open Source Matters, Inc. <https://www.joomla.org>
   * @license    GNU General Public License version 2 or later; see LICENSE.txt
   */
  (function (document, Joomla) {
    if (!Joomla || typeof Joomla.Text._ !== 'function') {
      throw new Error('core.js was not properly initialised');
    }

    document.addEventListener('DOMContentLoaded', function () {
      document.getElementById('toolbar-load').addEventListener('click', function () {
        var ids = document.querySelectorAll('input[id*="cb"]:checked');

        if (ids.length === 1) {
          // Add version item id to URL
          var url = document.getElementById('toolbar-load').childNodes[1].getAttribute('data-url') + "&version_id=" + ids[0].value;

          if (window.parent && url) {
            window.parent.location = url;
          }
        } else {
          // @todo use the CE Modal here
          alert(Joomla.Text._('COM_CONTENTHISTORY_BUTTON_SELECT_ONE'));
        }

        return false;
      });
      document.getElementById('toolbar-preview').addEventListener('click', function () {
        var windowSizeArray = ['width=800, height=600, resizable=yes, scrollbars=yes'];
        var ids = document.querySelectorAll('input[id*="cb"]:checked');

        if (ids.length === 1) {
          // Add version item id to URL
          var url = document.getElementById('toolbar-preview').childNodes[1].getAttribute('data-url') + "&version_id=" + ids[0].value;

          if (window.parent && url) {
            window.open(url, '', windowSizeArray.toString());
          }
        } else {
          // @todo use the CE Modal here
          alert(Joomla.Text._('COM_CONTENTHISTORY_BUTTON_SELECT_ONE'));
        }

        return false;
      });
      document.getElementById('toolbar-compare').addEventListener('click', function () {
        var windowSizeArray = ['width=1000, height=600, resizable=yes, scrollbars=yes'];
        var ids = document.querySelectorAll('input[id*="cb"]:checked');

        if (ids.length === 0) {
          // @todo use the CE Modal here
          alert(Joomla.Text._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST'));
        } else if (ids.length === 2) {
          // Add version item ids to URL
          var url = document.getElementById('toolbar-compare').childNodes[1].getAttribute('data-url') + "&id1=" + ids[0].value + "&id2=" + ids[1].value;

          if (window.parent && url) {
            window.open(url, '', windowSizeArray.toString());
          }
        } else {
          // @todo use the CE Modal here
          alert(Joomla.Text._('COM_CONTENTHISTORY_BUTTON_SELECT_TWO'));
        }

        return false;
      });
    });
  })(document, Joomla);

}());

The same content is in 11 releases, Joomla 4.0.0-rc2 to 4.1.0-alpha1. See them all, or every version of this file.