CoreFiles by mySites.guru
run-schedule-es5.js41 lines, 1,228 bytes, from Joomla_4.1.0-beta2-Beta-Full_Package.zip
Raw History Compare with 4.1.0-beta1
md5
d3d03668ab05ef08fbb37f5796e90bd9
sha1
354e1f3667ae779f28495dd04692165d568f58ea
sha256
f49d30f6eded149c800acc153871eec0e6c260e09383a0b53a40d316c4b36d3a
(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.inverval ? 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 2 releases, Joomla 4.1.0-beta1 to 4.1.0-beta2. See them all, or every version of this file.