diff options
Diffstat (limited to 'modules/system/system.cron.js')
-rw-r--r-- | modules/system/system.cron.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/modules/system/system.cron.js b/modules/system/system.cron.js new file mode 100644 index 000000000..01809b096 --- /dev/null +++ b/modules/system/system.cron.js @@ -0,0 +1,20 @@ +// $Id$ +(function ($) { + +/** + * Checks to see if the cron should be automatically run. + */ +Drupal.behaviors.cronCheck = { + attach: function(context, settings) { + if (settings.cronCheck || false) { + $('body').once('cron-check', function() { + // Only execute the cron check if its the right time. + if (Math.round(new Date().getTime() / 1000.0) > settings.cronCheck) { + $.get(settings.basePath + 'system/run-cron-check'); + } + }); + } + } +}; + +})(jQuery); |