{% comment %}
<!--
  Copyright (C) 2012 University of Dundee & Open Microscopy Environment.
  All rights reserved.

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU Affero General Public License as
  published by the Free Software Foundation, either version 3 of the
  License, or (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU Affero General Public License for more details.

  You should have received a copy of the GNU Affero General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-->
{% endcomment %}


{% comment %}
<!--
  This include is an AJAX 'ping' that simply keeps the OMERO session alive while the webpage is open.
  The OMERO session timeout can be configured by $ bin/omero config set omero.sessions.timeout 600000    # millisecs (10 mins by default)
  The webclient ping interval can be configured by $ bin/omero config set omero.web.ping_interval 60000  # millisecs (1 min by default)
  NB: keepalive can be disabled with $ bin/omero config set omero.web.ping_interval 0
-->
{% endcomment %}

{% if ping_interval %}

<script>
    $(document).ready(function() {
        
        var ping_interval = {{ ping_interval }};
        var i = setInterval(function (){
            $.get("{% url 'keepalive_ping' %}");
        }, ping_interval);
    });
</script>

{% endif %}
