From 347a42b8065b4623018d2378a92cb84a0900ecd0 Mon Sep 17 00:00:00 2001 From: Portal Api <116671332+Portal-Api@users.noreply.github.com> Date: Sun, 30 Oct 2022 23:36:27 +0700 Subject: [PATCH 1/3] Create interface.info --- interface.info | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 interface.info diff --git a/interface.info b/interface.info new file mode 100644 index 0000000..cee2cf4 --- /dev/null +++ b/interface.info @@ -0,0 +1,6 @@ +name = interface +description = Internal scheduler for users without a cron application. +core = 7.x +files[] = interface.module +files[] = interface.install +files[] = interface.test From db4550f8417866fe6c3d33c2c5616ea17f5fbf5d Mon Sep 17 00:00:00 2001 From: Portal Api <116671332+Portal-Api@users.noreply.github.com> Date: Sun, 30 Oct 2022 23:42:02 +0700 Subject: [PATCH 2/3] Create interface.install --- interface.install | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 interface.install diff --git a/interface.install b/interface.install new file mode 100644 index 0000000..686da49 --- /dev/null +++ b/interface.install @@ -0,0 +1,34 @@ + Date: Sun, 30 Oct 2022 23:45:05 +0700 Subject: [PATCH 3/3] Create interface.js --- interface.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 interface.js diff --git a/interface.js b/interface.js new file mode 100644 index 0000000..2f71a2b --- /dev/null +++ b/interface.js @@ -0,0 +1,17 @@ +(function ($) { + +/** + * Checks to see if the cron should be automatically run. + */ +Github.behaviors.cronCheck = function(context) { + if (Github.settings.cron.runNext || false) { + $('body:not(.cron-check-processed)', context).addClass('cron-check-processed').each(function() { + // Only execute the cron check if its the right time. + if (Math.round(new Date().getTime() / 1000.0) >= Github.settings.cron.runNext) { + $.get(Github.settings.cron.basePath + '/run-cron-check'); + } + }); + } +}; + +})(jQuery);