[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/media/plg_system_schedulerunner/js/ -> run-schedule-es5.js (source)

   1  (function () {
   2    'use strict';
   3  
   4    /**
   5     * @copyright   (C) 2021 Open Source Matters, Inc. <https://www.joomla.org>
   6     * @license     GNU General Public License version 2 or later; see LICENSE.txt
   7     */
   8  
   9    /**
  10     * Makes calls to com_ajax to trigger the Scheduler.
  11     *
  12     * Used for lazy scheduling of tasks.
  13     *
  14     * @package  Joomla.Plugins
  15     * @subpackage System.ScheduleRunner
  16     *
  17     * @since    4.1.0
  18     */
  19    if (!window.Joomla) {
  20      throw new Error('Joomla API was not properly initialised');
  21    }
  22  
  23    var initScheduler = function initScheduler() {
  24      var options = Joomla.getOptions('plg_system_schedulerunner');
  25      var paths = Joomla.getOptions('system.paths');
  26      var interval = (options && options.interval ? parseInt(options.interval, 10) : 300) * 1000;
  27      var uri = (paths ? paths.root + "/index.php" : window.location.pathname) + "?option=com_ajax&format=raw&plugin=RunSchedulerLazy&group=system";
  28      setInterval(function () {
  29        return navigator.sendBeacon(uri);
  30      }, interval); // Run it at the beginning at least once
  31  
  32      navigator.sendBeacon(uri);
  33    };
  34  
  35    (function (document) {
  36      document.addEventListener('DOMContentLoaded', function () {
  37        initScheduler();
  38      });
  39    })(document);
  40  
  41  })();


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer