CoreFiles by mySites.guru
run-schedule-es5.js40 lines, 1,230 bytes, from Joomla_4.3.0-beta3-Beta-Full_Package.zip
Raw History Compare with 4.3.0-beta2
md5
dba1c939c544d5b13b13e4f7ace4d7c3
sha1
e038e38823d8b43e8994c67abc25d09754f577f2
sha256
488784b39bad30f4892463f0ca9c8b42d5c73679f4194a3d18125a689fbf34dc
(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 13 releases, Joomla 4.3.0-alpha1 to 4.3.1. See them all, or every version of this file.