summaryrefslogtreecommitdiffstatshomepage
path: root/core/modules/system/system.cron.js
diff options
context:
space:
mode:
authorNathan Haug <nate@quicksketch.org>2011-10-30 16:32:37 -0700
committerNathaniel <catch@35733.no-reply.drupal.org>2011-11-01 12:48:40 +0900
commit06fb770bd340e5a18555e0da55a4dd6ba22f76ba (patch)
treee814bc08d51db3af473ae5be565219c0249b7870 /core/modules/system/system.cron.js
parent906a6db34707d27120dddd43a23f26f24153255d (diff)
downloaddrupal-06fb770bd340e5a18555e0da55a4dd6ba22f76ba.tar.gz
drupal-06fb770bd340e5a18555e0da55a4dd6ba22f76ba.zip
Issue #22336 by quicksketch, scor, boombatower, and rfay. Move all core Drupal files under a core subdirectory.
Diffstat (limited to 'core/modules/system/system.cron.js')
-rw-r--r--core/modules/system/system.cron.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/core/modules/system/system.cron.js b/core/modules/system/system.cron.js
new file mode 100644
index 00000000000..af17dab5273
--- /dev/null
+++ b/core/modules/system/system.cron.js
@@ -0,0 +1,19 @@
+(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);