CoreFiles by mySites.guru
run-schedule-es5.js41 lines, 1,228 bytes, from Joomla_4.2.0-beta2-Beta-Full_Package.zip
Raw History Compare with 4.2.0-beta1
md5
e03d7d469bc8146224c4a542b5ddb78e
sha1
2c776263cdfe639daff26fa16cedee1d3df927a4
sha256
ea5ba56811739e90feed46e51fe60fb40f3ae6bfb22ed2f7269f6ee006358d2f
(function () {
  'use strict';

  /**
   * @copyright   (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   */

  /**
   * Makes calls to com_ajax to trigger the Scheduler.
   *
   * Used for lazy scheduling of tasks.
   *
   * @package  Joomla.Plugins
   * @subpackage System.ScheduleRunner
   *
   * @since    4.1.0
   */
  if (!window.Joomla) {
    throw new Error('Joomla API was not properly initialised');
  }

  var initScheduler = function initScheduler() {
    var options = Joomla.getOptions('plg_system_schedulerunner');
    var paths = Joomla.getOptions('system.paths');
    var interval = (options && options.interval ? parseInt(options.interval, 10) : 300) * 1000;
    var uri = (paths ? paths.root + "/index.php" : window.location.pathname) + "?option=com_ajax&format=raw&plugin=RunSchedulerLazy&group=system";
    setInterval(function () {
      return navigator.sendBeacon(uri);
    }, interval); // Run it at the beginning at least once

    navigator.sendBeacon(uri);
  };

  (function (document) {
    document.addEventListener('DOMContentLoaded', function () {
      initScheduler();
    });
  })(document);

})();

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