CoreFiles by mySites.guru
run-schedule-es5.js41 lines, 1,228 bytes, from Joomla_4.1.0-beta3-Beta-Full_Package.zip
Raw History Compare with 4.1.0-beta2
md5
29a65524f3e8e2c3e1e06941ef9e4928
sha1
ff6dbc2717004d0d62853fa8cd682496126bff07
sha256
ce600be55a3f23efcb271708e1fc48f9ee26b01c2439b4627c4cdf07d7ae3690
(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-beta3 to 4.1.0-rc1. See them all, or every version of this file.