# for privacy, reload the page after (default) 5 minutes
return_to = CGI.param('return-to');
kiosk = CGI.param('kiosk');
-refresh_time = ctx.register.settings.refresh_timeout || 300;
-complete_url = return_to || 'https://www.kcls.org'
-ctx.refresh = refresh_time _ '; ' _ complete_url;
# Ugh, CGI.new/.param insists on mangling the return-to URL.
# Build the redo_url by hand.
END;
SET redo_url = redo_url _ joiner _ 'kiosk=1' IF kiosk;
+complete_url = 'https://www.kcls.org';
+IF return_to;
+ IF return_to == 'self';
+ # 'self' is a special return-to value that means return back to the
+ # current URL. Without this, to return back to the samge page,
+ # we'd need an infinitely nesting series of return-to values.
+ # The self URL is the same as the redo ("submit another") url.
+ complete_url = redo_url;
+ ELSE;
+ complete_url = return_to;
+ END;
+END;
+
# some useful variables and MACROs for display,
# field validation, and added info display
ctx_org = ctx.physical_loc || ctx.search_ou || ctx.aou_tree.id;
<html lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
- <meta http-equiv="refresh" content="[% ctx.refresh %]">
<title>[% l('[_1]', ctx.page_title) %]</title>
[% INCLUDE 'opac/parts/goog_analytics.tt2' %]
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
<script type="text/javascript"
src="[% ctx.media_prefix %]/js/ui/default/opac/register.js"></script>
<script>
- var timeout_redirect = '[% complete_url | html %]';
- var post_success_timeout = '[% kiosk ? 300000 : 30000 %]';
+ var timeout_redirect = '[% complete_url | url %]';
+ var post_success_timeout = '[% kiosk ? 30000 : 30000 %]';
+ var activity_timeout = '[% kiosk ? 120000 : 300000 %]';
</script>
<style>
];
var last_activity = new Date();
-var activity_timeout = 300000; // 300 seconds
var phone_regex = new RegExp(/^\d{3}-\d{3}-\d{4}/);
var post_regex = new RegExp(/^\d{5}(?:[-\s]\d{4})?$/);
-// Loaded from the template to pick up return-to URL option.
-// var timeout_redirect = 'https://www.kcls.org';
-// Loaded from the template / longer in kiosk mode
-// var post_success_timeout = 30000;
-
/* show/hide card options depending on the selected type. */
function show_card_types(type) {
last_activity = new Date();
document.getElementById('register-success') ?
post_success_timeout : activity_timeout;
- /*
console.debug('checking activity timeout=' +
timeout + ' : time range (ms) = ' + diff);
- */
if (diff > timeout) {
location.href = timeout_redirect;
return;
}
- setTimeout(activity_checker_thread, 2000);
+ setTimeout(activity_checker_thread, 5000);
}
-activity_checker_thread();
-
// No other onload should be firing for this page.
window.onload = function() {
// Clear all values on page load to avoid browser-back leaking
input.value = '';
}
}
+
+ activity_checker_thread();
}